The driver context determines which kernel routines the driver is permitted to call. There are four contexts in which driver code executes:
User context – A driver entry point has user context if it was directly invoked because of a user thread. For example, the read(9E) entry point of the driver, invoked by a read(2) system call, has user context.
Kernel context – A driver function has kernel context if it was invoked by some other part of the kernel. In a block device driver, the strategy(9E) entry point can be called by the pageout daemon to write pages to the device. Because the page daemon has no relation to the current user thread, strategy(9E) has kernel context in this case.
Interrupt context – Interrupt context is a more restrictive form of kernel context. Driver interrupt routines operate in interrupt context and have an interrupt level associated with them. Callback routines also operate in an interrupt context. See Chapter 7, Interrupt Handlers for more information.
High-level interrupt context – High-level interrupt context is a more restricted form of interrupt context. If ddi_intr_hilevel(9F) indicates that an interrupt is high level, the driver interrupt handler will run in high-level interrupt context. See Chapter 7, Interrupt Handlers for more information.
The manual pages in section 9F document the allowable contexts for each function. For example, in kernel context the driver must not call copyin(9F).