void drv_shutdown(shutdown_request_t sd_rqt, int option);
Description
drv_shutdown is used
to initiate a specified type of system shutdown from a driver.
Arguments
sd_rqt
Type of shutdown request.
Valid values are:
SD_SOFT
Initiate a soft, graceful reboot.
This is equivalent to typing the
shutdown
command.
SD_HARD
Initiate a hard, immediate reboot, bypassing shutdown scripts.
This is equivalent to using the
uadmin
command or
uadmin
system call.
SD_PANIC
Initiate a user-requested panic.
option
Option qualifier for particular requests.
option values for SD_SOFT and SD_HARD:
AD_HALT
After shutting down, halt the processor and turn off the power, if possible.
AD_IBOOT
After shutting down, reboot interactively.
That is, come up in ``firmware'' mode to an interactive boot prompt,
if possible.
AD_BOOT
After shutting down, reboot the default kernel (see
boot(4))
without user intervention.
option values for SD_PANIC:
AD_QUERY
Interactive panic.
Query the user before panicking the system.
AD_NOQUERY
Unconditional panic.
Return values
None.
Usage
drv_shutdown is typically used by console drivers to handle
user-initiated shutdown and panic requests,
or by system condition monitors to attempt graceful system shutdown when
serious conditions (for example, excessive heat) have been detected.
Context and synchronization
Non-blockable, interrupt, user, or blockable
context.