int osenv_irq_alloc(int irqnum, void (*handler)(void *), void *data, int flags);
Component OS, Blocking
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).
- 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 0 on success, non-zero on error.