mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
Add common orderly_poweroff()
Various pieces of code around the kernel want to be able to trigger an orderly poweroff. This pulls them together into a single implementation. By default the poweroff command is /sbin/poweroff, but it can be set via sysctl: kernel/poweroff_cmd. This is split at whitespace, so it can include command-line arguments. This patch replaces four other instances of invoking either "poweroff" or "shutdown -h now": two sbus drivers, and acpi thermal management. sparc64 has its own "powerd"; still need to determine whether it should be replaced by orderly_poweroff(). Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com> Acked-by: Len Brown <lenb@kernel.org> Signed-off-by: Chris Wright <chrisw@sous-sol.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Randy Dunlap <randy.dunlap@oracle.com> Cc: Andi Kleen <ak@suse.de> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Arnd Bergmann <arnd@arndb.de> Cc: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
0ab4dc9227
commit
10a0a8d4e3
6 changed files with 79 additions and 30 deletions
|
@ -67,6 +67,11 @@ extern void kernel_power_off(void);
|
|||
|
||||
void ctrl_alt_del(void);
|
||||
|
||||
#define POWEROFF_CMD_PATH_LEN 256
|
||||
extern char poweroff_cmd[POWEROFF_CMD_PATH_LEN];
|
||||
|
||||
extern int orderly_poweroff(bool force);
|
||||
|
||||
/*
|
||||
* Emergency restart, callable from an interrupt handler.
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue