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