Xenomai  3.1
Interrupt Management Services
Collaboration diagram for Interrupt Management Services:

Macros

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

Typedefs

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

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 More...
 
int rtdm_irq_free (rtdm_irq_t *irq_handle)
 
Release an interrupt handler More...
 
int rtdm_irq_enable (rtdm_irq_t *irq_handle)
 
Enable interrupt line More...
 
int rtdm_irq_disable (rtdm_irq_t *irq_handle)
 
Disable interrupt line More...
 

RTDM_IRQTYPE_xxx

Interrupt registrations flags

#define RTDM_IRQTYPE_SHARED   XN_IRQTYPE_SHARED
 Enable IRQ-sharing with other real-time drivers.
 
#define RTDM_IRQTYPE_EDGE   XN_IRQTYPE_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_IRQ_NONE
 Unhandled interrupt.
 
#define RTDM_IRQ_HANDLED   XN_IRQ_HANDLED
 Denote handled interrupt.
 
#define RTDM_IRQ_DISABLE   XN_IRQ_DISABLE
 Request interrupt disabling on exit.
 

Detailed Description

Macro Definition Documentation

◆ rtdm_irq_get_arg

#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.
Tags
unrestricted

Typedef Documentation

◆ rtdm_irq_handler_t

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

◆ rtdm_irq_disable()

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
Note
This service is for exceptional use only. Drivers should always prefer interrupt masking at device level (via corresponding control registers etc.) over masking at line level. Keep in mind that the latter is incompatible with IRQ line sharing and can also be more costly as interrupt controller access requires broader synchronization. Also, such service is solely available from secondary mode. The caller is responsible for excluding such conflicts.
Tags
secondary-only

◆ rtdm_irq_enable()

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
Note
This service is for exceptional use only. Drivers should always prefer interrupt masking at device level (via corresponding control registers etc.) over masking at line level. Keep in mind that the latter is incompatible with IRQ line sharing and can also be more costly as interrupt controller access requires broader synchronization. Also, such service is solely available from secondary mode. The caller is responsible for excluding such conflicts.
Tags
secondary-only

◆ rtdm_irq_free()

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
Note
The caller is responsible for shutting down the IRQ source at device level before invoking this service. In turn, rtdm_irq_free ensures that any pending event on the given IRQ line is fully processed on return from this service.
Tags
secondary-only

◆ rtdm_irq_request()

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.
  • -ENOSYS is returned if the real-time core is disabled.
Tags
secondary-only