iPXE
reboot.h
Go to the documentation of this file.
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 FILE_SECBOOT ( PERMITTED );
12 
13 #include <ipxe/api.h>
14 #include <config/reboot.h>
15 
16 /**
17  * Calculate static inline reboot API function name
18  *
19  * @v _prefix Subsystem prefix
20  * @v _api_func API function
21  * @ret _subsys_func Subsystem API function
22  */
23 #define REBOOT_INLINE( _subsys, _api_func ) \
24  SINGLE_API_INLINE ( REBOOT_PREFIX_ ## _subsys, _api_func )
25 
26 /**
27  * Provide an reboot API implementation
28  *
29  * @v _prefix Subsystem prefix
30  * @v _api_func API function
31  * @v _func Implementing function
32  */
33 #define PROVIDE_REBOOT( _subsys, _api_func, _func ) \
34  PROVIDE_SINGLE_API ( REBOOT_PREFIX_ ## _subsys, _api_func, _func )
35 
36 /**
37  * Provide a static inline reboot API implementation
38  *
39  * @v _prefix Subsystem prefix
40  * @v _api_func API function
41  */
42 #define PROVIDE_REBOOT_INLINE( _subsys, _api_func ) \
43  PROVIDE_SINGLE_API_INLINE ( REBOOT_PREFIX_ ## _subsys, _api_func )
44 
45 /* Include all architecture-independent reboot API headers */
46 #include <ipxe/null_reboot.h>
47 #include <ipxe/efi/efi_reboot.h>
48 
49 /* Include all architecture-dependent reboot API headers */
50 #include <bits/reboot.h>
51 
52 /**
53  * Reboot system
54  *
55  * @v flags Reboot flags
56  */
57 void reboot ( int flags );
58 
59 #define REBOOT_WARM 0x00000001 /**< Perform a warm reboot */
60 #define REBOOT_SETUP 0x00000002 /**< Reboot to firmware setup */
61 
62 /**
63  * Power off system
64  *
65  * @ret rc Return status code
66  *
67  * This function may fail, since not all systems support being powered
68  * off by software.
69  */
70 int poweroff ( void );
71 
72 #endif /* _IPXE_REBOOT_H */
iPXE internal APIs
iPXE reboot API for EFI
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
int poweroff(void)
Power off system.
FILE_SECBOOT(PERMITTED)
uint8_t flags
Flags.
Definition: ena.h:18
iPXE do-nothing reboot API
Reboot API configuration.
void reboot(int flags)
Reboot system.