Specifications

Writing a User-Level Device Drive
r
17-33
Example specification and pseudo code for a user-level driver’s close routine is
presented as follows:
int
dev_close(dev_desc)
int dev_desc;
{
Wait for all pending I/O operations to complete.
Free the device descriptor.
Detach the driver’s shared memory and device register regions.
Mark the device closed.
Return success status.
}