• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef _SYS_REBOOT_H
2 #define _SYS_REBOOT_H
3 #ifdef __cplusplus
4 extern "C" {
5 #endif
6 
7 #define RB_AUTOBOOT     0x01234567
8 #define RB_HALT_SYSTEM  0xcdef0123
9 #define RB_ENABLE_CAD   0x89abcdef
10 #define RB_DISABLE_CAD  0
11 #define RB_POWER_OFF    0x4321fedc
12 #define RB_SW_SUSPEND   0xd000fce2
13 #define RB_KEXEC        0x45584543
14 #define RB_MAGIC1 0xfee1dead
15 #define RB_MAGIC2 672274793
16 
17 /**
18   * @brief reboots the device, or enables/disables the reboot keystroke.
19   * @param type commands accepted by the reboot() system call.
20   *    -- RESTART     Restart system using default command and mode.
21   *    -- HALT        Stop OS and give system control to ROM monitor, if any.
22   *    -- CAD_ON      Ctrl-Alt-Del sequence causes RESTART command.
23   *    -- CAD_OFF     Ctrl-Alt-Del sequence sends SIGINT to init task.
24   *    -- POWER_OFF   Stop OS and remove all power from system, if possible.
25   *    -- RESTART2    Restart system using given command string.
26   *    -- SW_SUSPEND  Suspend system using software suspend if compiled in.
27   *    -- KEXEC       Restart system using a previously loaded Linux kernel.
28   * @return reboot result.
29   * @retval 0 is returned on success, if CAD was successfully enabled/disabled.
30   * @retval -1 is returned on failure, and errno is set to indicate the error.
31   */
32 int reboot(int);
33 
34 #ifdef __cplusplus
35 }
36 #endif
37 #endif
38