Index Index for
Section 9
Index Alphabetical
listing for D
Bottom of page Bottom of
page

drvr_register_shutdown(9r)

NAME

drvr_register_shutdown - General: Registers or deregisters a shutdown interface

SYNOPSIS

void drvr_register_shutdown( void (*callback) (), caddr_t parameter, int flags );

ARGUMENTS

callback Specifies the name of the device driver interface to be registered or deregistered by drvr_register_shutdown. When registered, this is the interface that the kernel calls when the system shuts down or halts. parameter Specifies a parameter that you want the kernel to pass to the device driver's registered shutdown interface. For example, you could pass a pointer to a softc structure or a pointer to a unit-specific data structure and the kernel passes it to the driver's registered shutdown interface. flags Specifies whether to register or deregister the device driver's shutdown interface. You can pass one of the following constants: DRVR_REGISTER Registers a device driver shutdown interface. DRVR_UNREGISTER Deregisters a device driver's shutdown interface.

DESCRIPTION

The drvr_register_shutdown interface registers or deregisters a shutdown interface for the calling device driver. Device drivers call drvr_register_shutdown to register a device driver shutdown interface that the kernel calls at system shutdown time (or when the user halts the system). The drvr_register_shutdown interface allows device drivers to register interfaces that turn off the hardware device before the system shuts down. For example, a device driver that operates on a SCSI bus connected to two host CPUs (Available Server Environment) must ensure that the SCSI adapter on the shutdown host CPU is not doing work on the bus.

NOTES

Device drivers should call the drvr_register_shutdown interface if it is necessary to call a shutdown interface that the kernel calls after it performs the dump operation. Device drivers should call the drvr_register_flush interface if it is necessary to call a flush interface before the kernel performs a dump operation.

CAUTIONS

The drvr_register_shutdown interface causes a system crash and displays an appropriate message on the console terminal if the device driver writer sets an invalid bit in the flags argument. The shutdown interface that you register should never acquire a simple or complex lock. The reason for this is that on a panic, the kernel's call to the shutdown interface can cause the CPU to double panic, hang, or both if the callback interface tries to access locks that were taken through active code paths at the time of the panic. This double panic or hang of the CPU would result in no crash dump for diagnosis. A hang of the CPU can require operator intervention to restart the CPU. After the system has performed the crash dump and a panic occurs, the kernel's call to the shutdown interface can cause the CPU to double panic, hang, or both. This double panic or hang of the CPU can be the result of the following activities: · If the shutdown interface tries to access locks that were taken through active code paths at the time of the panic. · The device being shutdown exists along the hardware path that the crash dump used. The process of performing the crash dump gives control of all hardware used for the dump (devices, controllers, bridges, and so forth, thus the hardware path) to the console. Upon returning from the crash dump, anything connected to the hardware path might no longer function as the console has disrupted the hardware state expected by the kernel. A hang of the CPU can require operator intervention to restart the CPU.

RETURN VALUES

None

SEE ALSO

Kernel Interfaces: drvr_register_flush(9r)

Index Index for
Section 9
Index Alphabetical
listing for D
Top of page Top of
page