1570af302Sopenharmony_ci#ifndef _SYS_REBOOT_H 2570af302Sopenharmony_ci#define _SYS_REBOOT_H 3570af302Sopenharmony_ci#ifdef __cplusplus 4570af302Sopenharmony_ciextern "C" { 5570af302Sopenharmony_ci#endif 6570af302Sopenharmony_ci 7570af302Sopenharmony_ci#define RB_AUTOBOOT 0x01234567 8570af302Sopenharmony_ci#define RB_HALT_SYSTEM 0xcdef0123 9570af302Sopenharmony_ci#define RB_ENABLE_CAD 0x89abcdef 10570af302Sopenharmony_ci#define RB_DISABLE_CAD 0 11570af302Sopenharmony_ci#define RB_POWER_OFF 0x4321fedc 12570af302Sopenharmony_ci#define RB_SW_SUSPEND 0xd000fce2 13570af302Sopenharmony_ci#define RB_KEXEC 0x45584543 14570af302Sopenharmony_ci#define RB_MAGIC1 0xfee1dead 15570af302Sopenharmony_ci#define RB_MAGIC2 672274793 16570af302Sopenharmony_ci 17570af302Sopenharmony_ci/** 18570af302Sopenharmony_ci * @brief reboots the device, or enables/disables the reboot keystroke. 19570af302Sopenharmony_ci * @param type commands accepted by the reboot() system call. 20570af302Sopenharmony_ci * -- RESTART Restart system using default command and mode. 21570af302Sopenharmony_ci * -- HALT Stop OS and give system control to ROM monitor, if any. 22570af302Sopenharmony_ci * -- CAD_ON Ctrl-Alt-Del sequence causes RESTART command. 23570af302Sopenharmony_ci * -- CAD_OFF Ctrl-Alt-Del sequence sends SIGINT to init task. 24570af302Sopenharmony_ci * -- POWER_OFF Stop OS and remove all power from system, if possible. 25570af302Sopenharmony_ci * -- RESTART2 Restart system using given command string. 26570af302Sopenharmony_ci * -- SW_SUSPEND Suspend system using software suspend if compiled in. 27570af302Sopenharmony_ci * -- KEXEC Restart system using a previously loaded Linux kernel. 28570af302Sopenharmony_ci * @return reboot result. 29570af302Sopenharmony_ci * @retval 0 is returned on success, if CAD was successfully enabled/disabled. 30570af302Sopenharmony_ci * @retval -1 is returned on failure, and errno is set to indicate the error. 31570af302Sopenharmony_ci */ 32570af302Sopenharmony_ciint reboot(int); 33570af302Sopenharmony_ci 34570af302Sopenharmony_ci#ifdef __cplusplus 35570af302Sopenharmony_ci} 36570af302Sopenharmony_ci#endif 37570af302Sopenharmony_ci#endif 38