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 
12 #include <ipxe/api.h>
13 #include <config/nap.h>
14 
15 /**
16  * Calculate static inline CPU sleeping 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 NAP_INLINE( _subsys, _api_func ) \
23  SINGLE_API_INLINE ( NAP_PREFIX_ ## _subsys, _api_func )
24 
25 /**
26  * Provide an CPU sleeping API implementation
27  *
28  * @v _prefix Subsystem prefix
29  * @v _api_func API function
30  * @v _func Implementing function
31  */
32 #define PROVIDE_NAP( _subsys, _api_func, _func ) \
33  PROVIDE_SINGLE_API ( NAP_PREFIX_ ## _subsys, _api_func, _func )
34 
35 /**
36  * Provide a static inline CPU sleeping API implementation
37  *
38  * @v _prefix Subsystem prefix
39  * @v _api_func API function
40  */
41 #define PROVIDE_NAP_INLINE( _subsys, _api_func ) \
42  PROVIDE_SINGLE_API_INLINE ( NAP_PREFIX_ ## _subsys, _api_func )
43 
44 /* Include all architecture-independent I/O API headers */
45 #include <ipxe/null_nap.h>
46 #include <ipxe/linux/linux_nap.h>
47 
48 /* Include all architecture-dependent I/O API headers */
49 #include <bits/nap.h>
50 
51 /**
52  * Sleep until next CPU interrupt
53  *
54  */
55 void cpu_nap ( void );
56 
57 #endif /* _IPXE_NAP_H */
x86-specific CPU sleeping API implementations
iPXE internal APIs
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
Linux CPU sleeping.
void cpu_nap(void)
Sleep until next CPU interrupt.
Null CPU sleeping.
CPU sleeping.