iPXE
nap.h
Go to the documentation of this file.
1 #ifndef _IPXE_NAP_H
2 #define _IPXE_NAP_H
3 
4 /** @file
5  *
6  * CPU sleeping
7  *
8  */
9 
10 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11 FILE_SECBOOT ( PERMITTED );
12 
13 #include <ipxe/api.h>
14 #include <config/nap.h>
15 
16 /**
17  * Calculate static inline CPU sleeping 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 NAP_INLINE( _subsys, _api_func ) \
24  SINGLE_API_INLINE ( NAP_PREFIX_ ## _subsys, _api_func )
25 
26 /**
27  * Provide an CPU sleeping API implementation
28  *
29  * @v _prefix Subsystem prefix
30  * @v _api_func API function
31  * @v _func Implementing function
32  */
33 #define PROVIDE_NAP( _subsys, _api_func, _func ) \
34  PROVIDE_SINGLE_API ( NAP_PREFIX_ ## _subsys, _api_func, _func )
35 
36 /**
37  * Provide a static inline CPU sleeping API implementation
38  *
39  * @v _prefix Subsystem prefix
40  * @v _api_func API function
41  */
42 #define PROVIDE_NAP_INLINE( _subsys, _api_func ) \
43  PROVIDE_SINGLE_API_INLINE ( NAP_PREFIX_ ## _subsys, _api_func )
44 
45 /* Include all architecture-independent I/O API headers */
46 #include <ipxe/null_nap.h>
47 #include <ipxe/efi/efi_nap.h>
48 #include <ipxe/linux/linux_nap.h>
49 
50 /* Include all architecture-dependent I/O API headers */
51 #include <bits/nap.h>
52 
53 /**
54  * Sleep until next CPU interrupt
55  *
56  */
57 void cpu_halt ( void );
58 
59 /**
60  * Sleep with interrupts enabled until next CPU interrupt
61  *
62  */
63 void cpu_nap ( void );
64 
65 #endif /* _IPXE_NAP_H */
iPXE internal APIs
CPU sleeping.
void cpu_halt(void)
Sleep until next CPU interrupt.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
FILE_SECBOOT(PERMITTED)
Linux CPU sleeping.
void cpu_nap(void)
Sleep with interrupts enabled until next CPU interrupt.
Null CPU sleeping.
CPU sleeping.