Next | Prev | Up | Top | Contents | Index
GIO Interrupt Handler
Your driver module must contain an interrupt routine. The name of this routine does not need to be drvintr(), since GIO uses setgiovector() to register interrupt routines. When the device generates an interrupt, the general GIO interrupt handler calls your driver's interrupt routine and passes it the unit number for the device. Within your interrupt routine, you must set flags to indicate the state of the transfer and wake up sleeping processes (if any) waiting on the transfer to complete. Usually, the interrupt routine calls iodone() to indicate that a block type I/O transfer for the buffer is complete.
Caution: Interrupt routines must not try to sleep themselves by calling iowait(), sleep(), psema(), or delay() kernel calls, nor should they try to access the per-process global variables in the u type structure directly. The u type structure they access may not be that of the process that made the I/O request.
Next | Prev | Up | Top | Contents | Index