Writing Device Drivers

Multithreading Additions to the State Structure

This section adds the following fields to the state structure. See "Software State Structure" for more information.

int     busy;		/* device busy flag */
 	kmutex_t       mu;		/* mutex to protect state structure */
 	kcondvar_t     cv;		/* threads wait for access here */