.TH L4_IRQ_CONTROL 7 2009-11-07 "Codezero" "Codezero Programmer's Manual" .SH NAME .nf .BR "l4_irq_control" " - Register/unregister device irqs. .SH SYNOPSIS .nf .B #include .B #include .BI "int l4_irq_control (unsigned int " "req" ", unsigned int " "flags" ", l4id_t " "id"); .SH DESCRIPTION .B l4_irq_control() enables a thread to register/unregister device irqs. Caller of this sytem call has an option to choose between synchronous or asynchronous irq handling. .TP .fi .I req denotes the type of operation to be performed. .TP .BR IRQ_CONTROL_REGISTER Register the caller thread as irq handler for the irq index .BR "id". .TP .BR IRQ_CONTROL_RELEASE Unregister the caller thread, earlier registered as irq handler for the irq index .BR "id". .TP .BR IRQ_CONTROL_WAIT Wait for irq to happen. This flag is used by the irq handler to block and wait for irq to happen. .TP .fi .I flags denotes the slot number representing the irq handler, this is the identifier which distinguishes various handlers registered for the same device. .TP .fi .I id denotes the platform specific irq index of the concerned device. .SH RETURN VALUE .IR "l4_irq_control"() Returns 0 on success, and negative value on failure. See below for error codes. .SH ERRORS .TP .B -EINVAL when the .IR "flags" passed is not having valid information. .TP .B -ENOUTCB in case the thread making the system call does not have a valid utcb. .TP .B -EFAULT in case utcb of caller thread is not mapped. .TP .B -ENOIRQ in case the device represented by irq index .BR "id" is invalid or kernel does not allow user space tasks to avail this device.