Xenomai
3.1
|
Functions | |
void | xnintr_destroy (struct xnintr *intr) |
Destroy an interrupt descriptor. More... | |
int | xnintr_attach (struct xnintr *intr, void *cookie) |
Attach an interrupt descriptor. More... | |
void | xnintr_detach (struct xnintr *intr) |
Detach an interrupt descriptor. More... | |
void | xnintr_enable (struct xnintr *intr) |
Enable an interrupt line. More... | |
void | xnintr_disable (struct xnintr *intr) |
Disable an interrupt line. More... | |
void | xnintr_affinity (struct xnintr *intr, cpumask_t cpumask) |
Set processor affinity of interrupt. More... | |
int | xnintr_init (struct xnintr *intr, const char *name, unsigned int irq, xnisr_t isr, xniack_t iack, int flags) |
Initialize an interrupt descriptor. More... | |
void xnintr_affinity | ( | struct xnintr * | intr, |
cpumask_t | cpumask | ||
) |
Set processor affinity of interrupt.
Restricts the IRQ line associated with the interrupt descriptor intr to be received only on processors which bits are set in cpumask.
intr | The address of the interrupt descriptor. |
cpumask | The new processor affinity. |
int xnintr_attach | ( | struct xnintr * | intr, |
void * | cookie | ||
) |
Attach an interrupt descriptor.
Attach an interrupt descriptor previously initialized by xnintr_init(). This operation registers the descriptor at the interrupt pipeline, but does not enable the interrupt line yet. A call to xnintr_enable() is required to start receiving IRQs from the interrupt line associated to the descriptor.
intr | The address of the interrupt descriptor to attach. |
cookie | A user-defined opaque value which is stored into the descriptor for further retrieval by the interrupt handler. |
void xnintr_destroy | ( | struct xnintr * | intr | ) |
Destroy an interrupt descriptor.
Destroys an interrupt descriptor previously initialized by xnintr_init(). The descriptor is automatically detached by a call to xnintr_detach(). No more IRQs will be received through this descriptor after this service has returned.
intr | The address of the interrupt descriptor to destroy. |
void xnintr_detach | ( | struct xnintr * | intr | ) |
Detach an interrupt descriptor.
This call unregisters an interrupt descriptor previously attached by xnintr_attach() from the interrupt pipeline. Once detached, the associated interrupt line is disabled, but the descriptor remains valid. The descriptor can be attached anew by a call to xnintr_attach().
intr | The address of the interrupt descriptor to detach. |
void xnintr_disable | ( | struct xnintr * | intr | ) |
Disable an interrupt line.
Disables the interrupt line associated with an interrupt descriptor.
intr | The address of the interrupt descriptor. |
void xnintr_enable | ( | struct xnintr * | intr | ) |
Enable an interrupt line.
Enables the interrupt line associated with an interrupt descriptor.
intr | The address of the interrupt descriptor. |
int xnintr_init | ( | struct xnintr * | intr, |
const char * | name, | ||
unsigned int | irq, | ||
xnisr_t | isr, | ||
xniack_t | iack, | ||
int | flags | ||
) |
Initialize an interrupt descriptor.
When an interrupt occurs on the given irq line, the interrupt service routine isr is fired in order to deal with the hardware event. The interrupt handler may call any non-blocking service from the Cobalt core.
Upon receipt of an IRQ, the interrupt handler isr is immediately called on behalf of the interrupted stack context, the rescheduling procedure is locked, and the interrupt line is masked in the system interrupt controller chip. Upon return, the status of the interrupt handler is checked for the following bits:
In addition, one of the following bits may be present in the status:
A count of interrupt receipts is tracked into the interrupt descriptor, and reset to zero each time such descriptor is attached. Since this count could wrap around, it should be used as an indication of interrupt activity only.
intr | The address of a descriptor the Cobalt core will use to store the interrupt-specific data. |
name | An ASCII string standing for the symbolic name of the interrupt or NULL. |
irq | The IRQ line number associated with the interrupt descriptor. This value is architecture-dependent. An interrupt descriptor must be attached to the system by a call to xnintr_attach() before irq events can be received. |
isr | The address of an interrupt handler, which is passed the address of the interrupt descriptor receiving the IRQ. |
iack | The address of an optional interrupt acknowledge routine, aimed at replacing the default one. Only very specific situations actually require to override the default setting for this parameter, like having to acknowledge non-standard PIC hardware. iack should return a non-zero value to indicate that the interrupt has been properly acknowledged. If iack is NULL, the default routine will be used instead. |
flags | A set of creation flags affecting the operation. The valid flags are: |