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
10FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11FILE_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>
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 */
57void cpu_halt ( void );
58
59/**
60 * Sleep with interrupts enabled until next CPU interrupt
61 *
62 */
63void cpu_nap ( void );
64
65#endif /* _IPXE_NAP_H */
iPXE internal APIs
x86-specific CPU sleeping API implementations
CPU sleeping.
CPU sleeping.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:896
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:926
void cpu_halt(void)
Sleep until next CPU interrupt.
void cpu_nap(void)
Sleep with interrupts enabled until next CPU interrupt.
Linux CPU sleeping.
Null CPU sleeping.