irq_bind

Number0x41
Signature(dev_handle, ntfn_handle) -> 0 or -err
Groupirq
Since1.0

Bind a device’s interrupt to a notification object. When the IRQ fires, the kernel masks the line and signals the notification; the driver waits on it with ntfn_wait or waitany. This folds in the old irq_claim. The IRQ sets bit irq_num & 31.

Pitfalls

As of Loaf, do not bind two IRQs to a single notification. The 31st bit of the notification is reserved, do not bind any IRQs to it.

Arguments

RegisterNameDescription
r0dev_handleHandle of the device (from devmgr)
r1ntfn_handleNotification to signal on each interrupt

Returns

0 on success.

Errors

CodeCondition
ERR_BADHANDLE / ERR_BADTYPEBad device or notification handle
ERR_BUSYAnother process already owns that IRQ
ERR_DEADNotification object is dead
ERR_BADARGInvalid IRQ number, or the device has no IRQ

See also