Next | Prev | Top | Contents | Index

Chapter 8: Writing Multiprocessor Device Drivers


This chapter addresses questions particular to device drivers that run on multiprocessor workstations. It contains the following sections:

By default, all upper-half device driver functions--open(), close(), ioctl(), read(), write(), and strategy()-- and the interrupt function are forced onto processor 0 on a multiprocessor (MP) system. Therefore, a device driver written for a single processor will work unmodified on a multiprocessor system. To avoid context switches to processor 0 for every I/O call, you can modify a device driver to run on any processor. The process of making a device driver MP-safe is often called semaphoring, or multi-threading, a driver, although the preferred method relies, strictly speaking, on locks rather than on semaphores.

Note: The driver interface now uses the SVR4 MP DDI/DKI interface except for the Silicon Graphics-specific routines, such as pio_map() and dma_map(). For example, entry points such as open(), close(), read(), and write() all have slightly different arguments and, in some cases, different procedure types in 5.x than they had in earlier versions.


Preliminary Considerations
Shared Data between Upper-half and Interrupt Routines
Protecting Shared Data Among Upper-half Routines
Semaphore and Spinlock Calls
Multiprocessing STREAMS Drivers

Next | Prev | Top | Contents | Index