RTEMS CPU Kit with SuperCore  4.10.99.0
Files | Defines | Typedefs | Functions
Interrupt Manager Extension
Interrupts

In addition to the Classic API interrupt handler with a handle are supported. More...

Collaboration diagram for Interrupt Manager Extension:

Files

file  irq-extension.h
 

Header file for the Interrupt Manager Extension.


Defines

#define RTEMS_INTERRUPT_UNIQUE   ((rtems_option) 0x00000001)
 Makes the interrupt handler unique.
#define RTEMS_INTERRUPT_SHARED   ((rtems_option) 0x00000000)
 Allows that this interrupt handler may share a common interrupt vector with other handler.
#define RTEMS_INTERRUPT_REPLACE   ((rtems_option) 0x00000002)
 Forces that this interrupt handler replaces the first handler with the same argument.
#define RTEMS_INTERRUPT_IS_UNIQUE(options)   ((options) & RTEMS_INTERRUPT_UNIQUE)
 Returns true if the interrupt handler unique option is set.
#define RTEMS_INTERRUPT_IS_SHARED(options)   (!RTEMS_INTERRUPT_IS_UNIQUE( options))
 Returns true if the interrupt handler shared option is set.
#define RTEMS_INTERRUPT_IS_REPLACE(options)   ((options) & RTEMS_INTERRUPT_REPLACE)
 Returns true if the interrupt handler replace option is set.

Typedefs

typedef void(* rtems_interrupt_handler )(void *)
 Interrupt handler routine type.
typedef void(* rtems_interrupt_per_handler_routine )(void *, const char *, rtems_option, rtems_interrupt_handler, void *)
 Interrupt handler iteration routine type.

Functions

rtems_status_code rtems_interrupt_handler_install (rtems_vector_number vector, const char *info, rtems_option options, rtems_interrupt_handler handler, void *arg)
 Installs the interrupt handler routine handler for the interrupt vector with number vector.
rtems_status_code rtems_interrupt_handler_remove (rtems_vector_number vector, rtems_interrupt_handler handler, void *arg)
 Removes the interrupt handler routine handler with argument arg for the interrupt vector with number vector.
rtems_status_code rtems_interrupt_handler_iterate (rtems_vector_number vector, rtems_interrupt_per_handler_routine routine, void *arg)
 Iterates over all installed interrupt handler of the interrupt vector with number vector.
rtems_status_code rtems_interrupt_server_initialize (rtems_task_priority priority, size_t stack_size, rtems_mode modes, rtems_attribute attributes, rtems_id *server)
 Initializes an interrupt server task.
rtems_status_code rtems_interrupt_server_handler_install (rtems_id server, rtems_vector_number vector, const char *info, rtems_option options, rtems_interrupt_handler handler, void *arg)
 Installs the interrupt handler routine handler for the interrupt vector with number vector on the server server.
rtems_status_code rtems_interrupt_server_handler_remove (rtems_id server, rtems_vector_number vector, rtems_interrupt_handler handler, void *arg)
 Removes the interrupt handler routine handler with argument arg for the interrupt vector with number vector from the server server.

Detailed Description

In addition to the Classic API interrupt handler with a handle are supported.

You can also install multiple shared handler for one interrupt vector.


Define Documentation

#define RTEMS_INTERRUPT_UNIQUE   ((rtems_option) 0x00000001)

Makes the interrupt handler unique.

Prevents other handler from using the same interrupt vector.


Typedef Documentation

typedef void(* rtems_interrupt_per_handler_routine)(void *, const char *, rtems_option, rtems_interrupt_handler, void *)

Interrupt handler iteration routine type.

See also:
rtems_interrupt_handler_iterate()

Function Documentation

rtems_status_code rtems_interrupt_handler_install ( rtems_vector_number  vector,
const char *  info,
rtems_option  options,
rtems_interrupt_handler  handler,
void *  arg 
)

Installs the interrupt handler routine handler for the interrupt vector with number vector.

You can set one of the mutually exclusive options

with the options parameter for the interrupt handler.

The handler routine shall be called with argument arg when dispatched. The order in which the shared interrupt handlers are dispatched for one vector is BSP dependent.

If the option RTEMS_INTERRUPT_UNIQUE is set then it shall be ensured that this handler will be the only one for this vector.

If the option RTEMS_INTERRUPT_REPLACE is set then it shall be ensured that this handler will replace the first handler with the same argument for this vector if it exists, otherwise an error status shall be returned. A second handler with the same argument for this vector shall remain unchanged. The new handler will inherit the unique or shared option from the replaced handler.

You can provide an informative description info. This may be used for system debugging and status tools. The string has to be persistent during the handler life time.

This function may block.

Return values:
RTEMS_SUCCESSFULShall be returned in case of success.
RTEMS_CALLED_FROM_ISRIf this function is called from interrupt context this shall be returned.
RTEMS_INVALID_ADDRESSIf the handler address is NULL this shall be returned.
RTEMS_INVALID_IDIf the vector number is out of range this shall be returned.
RTEMS_INVALID_NUMBERIf an option is not applicable this shall be returned.
RTEMS_RESOURCE_IN_USEIf the vector is already occupied with a unique handler this shall be returned. If a unique handler should be installed and there is already a handler installed this shall be returned.
RTEMS_TOO_MANYIf a handler with this argument is already installed for the vector this shall be returned.
RTEMS_UNSATISFIEDIf no handler exists to replace with the specified argument and vector this shall be returned.
RTEMS_IO_ERRORReserved for board support package specific error conditions.
rtems_status_code rtems_interrupt_handler_iterate ( rtems_vector_number  vector,
rtems_interrupt_per_handler_routine  routine,
void *  arg 
)

Iterates over all installed interrupt handler of the interrupt vector with number vector.

For each installed handler of the vector the function routine will be called with the supplied argument arg and the handler information, options, routine and argument.

This function is intended for system information and diagnostics.

This function may block. Never install or remove an interrupt handler within the iteration routine. This may result in a deadlock.

Return values:
RTEMS_SUCCESSFULShall be returned in case of success.
RTEMS_CALLED_FROM_ISRIf this function is called from interrupt context this shall be returned.
RTEMS_INVALID_IDIf the vector number is out of range this shall be returned.
RTEMS_IO_ERRORReserved for board support package specific error conditions.
rtems_status_code rtems_interrupt_handler_remove ( rtems_vector_number  vector,
rtems_interrupt_handler  handler,
void *  arg 
)

Removes the interrupt handler routine handler with argument arg for the interrupt vector with number vector.

This function may block.

Return values:
RTEMS_SUCCESSFULShall be returned in case of success.
RTEMS_CALLED_FROM_ISRIf this function is called from interrupt context this shall be returned.
RTEMS_INVALID_ADDRESSIf the handler address is NULL this shall be returned.
RTEMS_INVALID_IDIf the vector number is out of range this shall be returned.
RTEMS_UNSATISFIEDIf the handler with its argument is not installed for the vector this shall be returned.
RTEMS_IO_ERRORReserved for board support package specific error conditions.
rtems_status_code rtems_interrupt_server_handler_install ( rtems_id  server,
rtems_vector_number  vector,
const char *  info,
rtems_option  options,
rtems_interrupt_handler  handler,
void *  arg 
)

Installs the interrupt handler routine handler for the interrupt vector with number vector on the server server.

The handler routine will be executed on the corresponding interrupt server task. A server identifier server of RTEMS_ID_NONE may be used to install the handler on the default server.

This function may block.

See also:
rtems_interrupt_handler_install().
Return values:
RTEMS_SUCCESSFULShall be returned in case of success.
RTEMS_INCORRECT_STATEIf the interrupt handler server is not initialized this shall be returned.
*For other errors see rtems_interrupt_handler_install().
rtems_status_code rtems_interrupt_server_handler_remove ( rtems_id  server,
rtems_vector_number  vector,
rtems_interrupt_handler  handler,
void *  arg 
)

Removes the interrupt handler routine handler with argument arg for the interrupt vector with number vector from the server server.

A server identifier server of RTEMS_ID_NONE may be used to remove the handler from the default server.

This function may block.

See also:
rtems_interrupt_handler_remove().
Return values:
RTEMS_SUCCESSFULShall be returned in case of success.
RTEMS_INCORRECT_STATEIf the interrupt handler server is not initialized this shall be returned.
*For other errors see rtems_interrupt_handler_remove().
rtems_status_code rtems_interrupt_server_initialize ( rtems_task_priority  priority,
size_t  stack_size,
rtems_mode  modes,
rtems_attribute  attributes,
rtems_id server 
)

Initializes an interrupt server task.

The task will have the priority priority, the stack size stack_size, the modes modes and the attributes attributes. The identifier of the server task will be returned in server. Interrupt handlers can be installed on the server with rtems_interrupt_server_handler_install() and removed with rtems_interrupt_server_handler_remove() using this identifier. 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.

The server identifier pointer server may be NULL to initialize the default server.

This function may block.

See also:
rtems_task_create().
Return values:
RTEMS_SUCCESSFULShall be returned in case of success.
RTEMS_INCORRECT_STATEIf the default server is already initialized this shall be returned.
RTEMS_IO_ERRORReserved for board support package specific error conditions.