1 #ifndef _IPXE_REBOOT_H 2 #define _IPXE_REBOOT_H 3 4 /** @file 5 * 6 * iPXE reboot API 7 * 8 */ 9 10 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); 11 12 #include <ipxe/api.h> 13 #include <config/reboot.h> 14 15 /** 16 * Calculate static inline reboot API function name 17 * 18 * @v _prefix Subsystem prefix 19 * @v _api_func API function 20 * @ret _subsys_func Subsystem API function 21 */ 22 #define REBOOT_INLINE( _subsys, _api_func ) \ 23 SINGLE_API_INLINE ( REBOOT_PREFIX_ ## _subsys, _api_func ) 24 25 /** 26 * Provide an reboot API implementation 27 * 28 * @v _prefix Subsystem prefix 29 * @v _api_func API function 30 * @v _func Implementing function 31 */ 32 #define PROVIDE_REBOOT( _subsys, _api_func, _func ) \ 33 PROVIDE_SINGLE_API ( REBOOT_PREFIX_ ## _subsys, _api_func, _func ) 34 35 /** 36 * Provide a static inline reboot API implementation 37 * 38 * @v _prefix Subsystem prefix 39 * @v _api_func API function 40 */ 41 #define PROVIDE_REBOOT_INLINE( _subsys, _api_func ) \ 42 PROVIDE_SINGLE_API_INLINE ( REBOOT_PREFIX_ ## _subsys, _api_func ) 43 44 /* Include all architecture-independent reboot API headers */ 45 #include <ipxe/null_reboot.h> 46 #include <ipxe/efi/efi_reboot.h> 47 48 /* Include all architecture-dependent reboot API headers */ 49 #include <bits/reboot.h> 50 51 /** 52 * Reboot system 53 * 54 * @v warm Perform a warm reboot 55 */ 56 void reboot ( int warm ); 57 58 /** 59 * Power off system 60 * 61 * @ret rc Return status code 62 * 63 * This function may fail, since not all systems support being powered 64 * off by software. 65 */ 66 int poweroff ( void ); 67 68 #endif /* _IPXE_REBOOT_H */ 69