reboot.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #ifndef _LINUX_REBOOT_H
  2. #define _LINUX_REBOOT_H
  3. /*
  4. * Magic values required to use _reboot() system call.
  5. */
  6. #define LINUX_REBOOT_MAGIC1 0xfee1dead
  7. #define LINUX_REBOOT_MAGIC2 672274793
  8. #define LINUX_REBOOT_MAGIC2A 85072278
  9. #define LINUX_REBOOT_MAGIC2B 369367448
  10. #define LINUX_REBOOT_MAGIC2C 537993216
  11. /*
  12. * Commands accepted by the _reboot() system call.
  13. *
  14. * RESTART Restart system using default command and mode.
  15. * HALT Stop OS and give system control to ROM monitor, if any.
  16. * CAD_ON Ctrl-Alt-Del sequence causes RESTART command.
  17. * CAD_OFF Ctrl-Alt-Del sequence sends SIGINT to init task.
  18. * POWER_OFF Stop OS and remove all power from system, if possible.
  19. * RESTART2 Restart system using given command string.
  20. * SW_SUSPEND Suspend system using software suspend if compiled in.
  21. * KEXEC Restart system using a previously loaded Linux kernel
  22. */
  23. #define LINUX_REBOOT_CMD_RESTART 0x01234567
  24. #define LINUX_REBOOT_CMD_HALT 0xCDEF0123
  25. #define LINUX_REBOOT_CMD_CAD_ON 0x89ABCDEF
  26. #define LINUX_REBOOT_CMD_CAD_OFF 0x00000000
  27. #define LINUX_REBOOT_CMD_POWER_OFF 0x4321FEDC
  28. #define LINUX_REBOOT_CMD_RESTART2 0xA1B2C3D4
  29. #define LINUX_REBOOT_CMD_SW_SUSPEND 0xD000FCE2
  30. #define LINUX_REBOOT_CMD_KEXEC 0x45584543
  31. #ifdef __KERNEL__
  32. #include <linux/notifier.h>
  33. #define SYS_DOWN 0x0001 /* Notify of system down */
  34. #define SYS_RESTART SYS_DOWN
  35. #define SYS_HALT 0x0002 /* Notify of system halt */
  36. #define SYS_POWER_OFF 0x0003 /* Notify of system power off */
  37. extern int register_reboot_notifier(struct notifier_block *);
  38. extern int unregister_reboot_notifier(struct notifier_block *);
  39. /*
  40. * Architecture-specific implementations of sys_reboot commands.
  41. */
  42. extern void machine_restart(char *cmd);
  43. extern void machine_halt(void);
  44. extern void machine_power_off(void);
  45. extern void machine_shutdown(void);
  46. struct pt_regs;
  47. extern void machine_crash_shutdown(struct pt_regs *);
  48. /*
  49. * Architecture independent implemenations of sys_reboot commands.
  50. */
  51. extern void kernel_restart_prepare(char *cmd);
  52. extern void kernel_restart(char *cmd);
  53. extern void kernel_halt(void);
  54. extern void kernel_power_off(void);
  55. extern int C_A_D; /* for sysctl */
  56. void ctrl_alt_del(void);
  57. #define POWEROFF_CMD_PATH_LEN 256
  58. extern char poweroff_cmd[POWEROFF_CMD_PATH_LEN];
  59. extern int orderly_poweroff(bool force);
  60. /*
  61. * Emergency restart, callable from an interrupt handler.
  62. */
  63. extern void emergency_restart(void);
  64. #include <asm/emergency-restart.h>
  65. #endif
  66. #endif /* _LINUX_REBOOT_H */