RFC: Interrupt Manager Extension changes

Sebastian Huber sebastian.huber at embedded-brains.de
Fri Jul 10 12:04:25 UTC 2009


Hi,

the Interrupt Manager Extension is documented here:

http://www.rtems.com/doxygen/cpukit/html/group__rtems__interrupt__extension.html

In order to support the legacy API and FreeBSD interrupt handlers better I
would like to change the interrupt handler signature from

typedef void (*rtems_interrupt_handler)(rtems_vector_number, void *);

to

typedef void (*rtems_interrupt_handler)(void *);

The current signature was primarily chosen to support the Classic API in the
future without overhead.  This turned out to be impractical.

I would also like to change the return code for requests with an invalid vector
number from RTEMS_INVALID_NUMBER to RTEMS_INVALID_ID since the vector number
acts like an object ID in this context.

I would like to add a new API for interrupt handlers which should be executed
within a task context:

/**
 * @brief Initializes the interrupt server task.
 *
 * The task will have the priority @a priority, the stack size @a stack_size,
 * the modes @a modes and the attributes @a attributes.  Interrupt handlers can
 * be installed on the server with rtems_interrupt_server_handler_install() and
 * removed with rtems_interrupt_server_handler_remove().  In case of an
 * interrupt the request will be forwarded to the server.  The handlers are
 * executed within the server context.  If one handler blocks on something this
 * may delay the processing of other handlers.
 *
 * @note This function may block.
 *
 * @return
 * - On success @c RTEMS_SUCCESSFUL shall be returned.
 * - If the interrupt server task is already initialized
 *   @c RTEMS_INCORRECT_STATE shall be returned.
 * - Other error states are BSP specific.
 */
rtems_status_code rtems_interrupt_server_initialize(
  rtems_task_priority priority,
  size_t stack_size,
  rtems_mode modes,
  rtems_attribute attributes
);

/**
 * @brief Installs the interrupt handler routine @a handler for the interrupt
 * vector with number @a vector.
 *
 * The handler routine will be executed on the interrupt server task.
 *
 * @note This function may block.
 *
 * @see rtems_interrupt_handler_install().
 *
 * @return
 * - On success @c RTEMS_SUCCESSFUL shall be returned.
 * - If the interrupt handler server is not initialized
 *   @c RTEMS_INCORRECT_STATE shall be returned.
 * - For other errors see rtems_interrupt_handler_install().
 */
rtems_status_code rtems_interrupt_server_handler_install(
  rtems_vector_number vector,
  const char *info,
  rtems_option options,
  rtems_interrupt_handler handler,
  void *arg
);

/**
 * @brief Removes the interrupt handler routine @a handler with argument @a arg
 * for the interrupt vector with number @a vector.
 *
 * @note This function may block.
 *
 * @see rtems_interrupt_handler_remove().
 *
 * @return
 * - On success @c RTEMS_SUCCESSFUL shall be returned.
 * - If the interrupt handler server is not initialized
 *   @c RTEMS_INCORRECT_STATE shall be returned.
 * - For other errors see rtems_interrupt_handler_remove().
 */
rtems_status_code rtems_interrupt_server_handler_remove(
  rtems_vector_number vector,
  rtems_interrupt_handler handler,
  void *arg
);

Have a nice day!

-- 
Sebastian Huber, Embedded Brains GmbH

Address : Obere Lagerstr. 30, D-82178 Puchheim, Germany
Phone   : +49 89 18 90 80 79-6
Fax     : +49 89 18 90 80 79-9
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.



More information about the users mailing list