next up previous contents index
Next: 6.15.5 osenv_irq_free: Unregister the Up: 6.15 Hardware Interrupts Previous: 6.15.3 osenv_intr_enabled: determine the

6.15.4 osenv_irq_alloc: allocate an interrupt request line

 

SYNOPSIS

int osenv_irq_alloc(int irqnum, void (*handler)(void *), void *data, int flags);

DIRECTION

Component tex2html_wrap_inline32841 OS, Blocking

DESCRIPTION

Allocate an interrupt request line and attach the specified handler to it. On interrupt, the kernel must pass the data argument to the handler.

XXX: interrupts should be ``disabled'' when the handler is invoked.

XXX: This has not been verified to function correctly if an incomming request is processed while this is blocked.

Flags:

OSENV_IRQ_SHAREABLE
If this flag is specified, the interrupt request line can be shared between multiple devices. On interrupt, the OS will call each handler attached to the interrupt line. Without this flag set, the OS is free to return an error if another handler is attached to the interrupt request line. (If shared, ALL handlers must have this set).

PARAMETERS

irqnum
The interrupt request line to allocate.
handler
Interrupt handler.
data
Data passed by the kernel to the interrupt handler.
flags
Flags indicating special behavior. Only OSENV_IRQ_SHAREABLE is currently used.

RETURNS

Returns 0 on success, non-zero on error.



University of Utah Flux Research Group