blob: 23b36304cd881bb77bfb0ca092b0e4346b88d87d [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef _LINUX_REBOOT_H
2#define _LINUX_REBOOT_H
3
Linus Torvalds1da177e2005-04-16 15:20:36 -07004
5#include <linux/notifier.h>
David Howells607ca462012-10-13 10:46:48 +01006#include <uapi/linux/reboot.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07007
Amerigo Wangc5f41752011-07-25 17:13:10 -07008#define SYS_DOWN 0x0001 /* Notify of system down */
9#define SYS_RESTART SYS_DOWN
10#define SYS_HALT 0x0002 /* Notify of system halt */
11#define SYS_POWER_OFF 0x0003 /* Notify of system power off */
12
Linus Torvalds1da177e2005-04-16 15:20:36 -070013extern int register_reboot_notifier(struct notifier_block *);
14extern int unregister_reboot_notifier(struct notifier_block *);
15
16
17/*
18 * Architecture-specific implementations of sys_reboot commands.
19 */
20
21extern void machine_restart(char *cmd);
22extern void machine_halt(void);
23extern void machine_power_off(void);
24
Eric W. Biedermandc009d92005-06-25 14:57:52 -070025extern void machine_shutdown(void);
Alexander Nyberg6e274d12005-06-25 14:58:26 -070026struct pt_regs;
27extern void machine_crash_shutdown(struct pt_regs *);
Eric W. Biedermandc009d92005-06-25 14:57:52 -070028
Eric W. Biederman4a00ea12005-07-26 11:24:14 -060029/*
30 * Architecture independent implemenations of sys_reboot commands.
31 */
32
Huang Yingca195b72008-08-15 00:40:24 -070033extern void kernel_restart_prepare(char *cmd);
Eric W. Biederman4a00ea12005-07-26 11:24:14 -060034extern void kernel_restart(char *cmd);
35extern void kernel_halt(void);
36extern void kernel_power_off(void);
Adrian Bunk83cc5ed2006-06-25 05:47:41 -070037
Dave Youngeb5572f2010-03-10 15:23:59 -080038extern int C_A_D; /* for sysctl */
Adrian Bunk83cc5ed2006-06-25 05:47:41 -070039void ctrl_alt_del(void);
Eric W. Biederman4a00ea12005-07-26 11:24:14 -060040
Jeremy Fitzhardinge10a0a8d2007-07-17 18:37:02 -070041#define POWEROFF_CMD_PATH_LEN 256
42extern char poweroff_cmd[POWEROFF_CMD_PATH_LEN];
43
44extern int orderly_poweroff(bool force);
45
Eric W. Biederman7c903472005-07-26 11:29:55 -060046/*
47 * Emergency restart, callable from an interrupt handler.
48 */
49
50extern void emergency_restart(void);
51#include <asm/emergency-restart.h>
52
Linus Torvalds1da177e2005-04-16 15:20:36 -070053#endif /* _LINUX_REBOOT_H */