Xenomai API  2.5.6.1
Interrupt Management Services
Collaboration diagram for Interrupt Management Services:

Defines

#define rtdm_irq_get_arg(irq_handle, type)   ((type *)irq_handle->cookie)
 Retrieve IRQ handler argument.

Typedefs

typedef int(* rtdm_irq_handler_t )(rtdm_irq_t *irq_handle)
 Interrupt handler.

Functions

int rtdm_irq_request (rtdm_irq_t *irq_handle, unsigned int irq_no, rtdm_irq_handler_t handler, unsigned long flags, const char *device_name, void *arg)
 Register an interrupt handler.
int rtdm_irq_free (rtdm_irq_t *irq_handle)
 Release an interrupt handler.
int rtdm_irq_enable (rtdm_irq_t *irq_handle)
 Enable interrupt line.
int rtdm_irq_disable (rtdm_irq_t *irq_handle)
 Disable interrupt line.

RTDM_IRQTYPE_xxx

Interrupt registrations flags

#define RTDM_IRQTYPE_SHARED   XN_ISR_SHARED
 Enable IRQ-sharing with other real-time drivers.
#define RTDM_IRQTYPE_EDGE   XN_ISR_EDGE
 Mark IRQ as edge-triggered, relevant for correct handling of shared edge-triggered IRQs.

RTDM_IRQ_xxx

Return flags of interrupt handlers

#define RTDM_IRQ_NONE   XN_ISR_NONE
 Unhandled interrupt.
#define RTDM_IRQ_HANDLED   XN_ISR_HANDLED
 Denote handled interrupt.

Define Documentation

#define rtdm_irq_get_arg (   irq_handle,
  type 
)    ((type *)irq_handle->cookie)

Retrieve IRQ handler argument.

Parameters:
irq_handleIRQ handle
typeType of the pointer to return
Returns:
The argument pointer registered on rtdm_irq_request() is returned, type-casted to the specified type.

Environments:

This service can be called from:

  • Interrupt service routine

Rescheduling: never.


Typedef Documentation

typedef int(* rtdm_irq_handler_t)(rtdm_irq_t *irq_handle)

Interrupt handler.

Parameters:
[in]irq_handleIRQ handle as returned by rtdm_irq_request()
Returns:
0 or a combination of RTDM_IRQ_xxx flags

Function Documentation

int rtdm_irq_disable ( rtdm_irq_t *  irq_handle)

Disable interrupt line.

Parameters:
[in,out]irq_handleIRQ handle as returned by rtdm_irq_request()
Returns:
0 on success, otherwise negative error code

Environments:

This service can be called from:

  • Kernel module initialization/cleanup code
  • Interrupt service routine
  • Kernel-based task
  • User-space task (RT, non-RT)

Rescheduling: never.

int rtdm_irq_enable ( rtdm_irq_t *  irq_handle)

Enable interrupt line.

Parameters:
[in,out]irq_handleIRQ handle as returned by rtdm_irq_request()
Returns:
0 on success, otherwise negative error code

Environments:

This service can be called from:

  • Kernel module initialization/cleanup code
  • Interrupt service routine
  • Kernel-based task
  • User-space task (RT, non-RT)

Rescheduling: possible.

int rtdm_irq_free ( rtdm_irq_t *  irq_handle)

Release an interrupt handler.

Parameters:
[in,out]irq_handleIRQ handle as returned by rtdm_irq_request()
Returns:
0 on success, otherwise negative error code

Environments:

This service can be called from:

  • Kernel module initialization/cleanup code
  • Kernel-based task
  • User-space task (RT, non-RT)

Rescheduling: never.

int rtdm_irq_request ( rtdm_irq_t *  irq_handle,
unsigned int  irq_no,
rtdm_irq_handler_t  handler,
unsigned long  flags,
const char *  device_name,
void *  arg 
)

Register an interrupt handler.

This function registers the provided handler with an IRQ line and enables the line.

Parameters:
[in,out]irq_handleIRQ handle
[in]irq_noLine number of the addressed IRQ
[in]handlerInterrupt handler
[in]flagsRegistration flags, see RTDM_IRQTYPE_xxx for details
[in]device_nameDevice name to show up in real-time IRQ lists
[in]argPointer to be passed to the interrupt handler on invocation
Returns:
0 on success, otherwise:
  • -EINVAL is returned if an invalid parameter was passed.
  • -EBUSY is returned if the specified IRQ line is already in use.

Environments:

This service can be called from:

  • Kernel module initialization/cleanup code
  • Kernel-based task
  • User-space task (RT, non-RT)

Rescheduling: never.

References xnintr_attach(), xnintr_detach(), xnintr_enable(), and xnintr_init().

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines