diff options
author | Michael Brown <mcb30@ipxe.org> | 2024-09-13 14:26:34 +0100 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2024-09-13 14:38:23 +0100 |
commit | c85ad1246890cf3c0c5f2ac6de06ab046ddd0043 (patch) | |
tree | 38332dfe1a3bd21503d3f53f693b33fa0d5b49f7 /src/include/ipxe | |
parent | 5de5d4626e192f5d0e6c97e14ce03b92a43622b3 (diff) | |
download | ipxe-c85ad1246890cf3c0c5f2ac6de06ab046ddd0043.tar.gz |
[efi] Centralise definition of efi_cpu_nap()
Define a cpu_halt() function which is architecture-specific but
platform-independent, and merge the multiple architecture-specific
implementations of the EFI cpu_nap() function into a single central
efi_cpu_nap() that uses cpu_halt() if applicable.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe')
-rw-r--r-- | src/include/ipxe/efi/efi_nap.h | 18 | ||||
-rw-r--r-- | src/include/ipxe/nap.h | 7 |
2 files changed, 25 insertions, 0 deletions
diff --git a/src/include/ipxe/efi/efi_nap.h b/src/include/ipxe/efi/efi_nap.h new file mode 100644 index 000000000..1ffb05569 --- /dev/null +++ b/src/include/ipxe/efi/efi_nap.h @@ -0,0 +1,18 @@ +#ifndef _IPXE_EFI_NAP_H +#define _IPXE_EFI_NAP_H + +/** @file + * + * CPU sleeping + * + */ + +FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); + +#ifdef NAP_EFI +#define NAP_PREFIX_efi +#else +#define NAP_PREFIX_efi __efi_ +#endif + +#endif /* _IPXE_EFI_NAP_H */ diff --git a/src/include/ipxe/nap.h b/src/include/ipxe/nap.h index f4de778c4..8d5d8e3df 100644 --- a/src/include/ipxe/nap.h +++ b/src/include/ipxe/nap.h @@ -43,6 +43,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); /* Include all architecture-independent I/O API headers */ #include <ipxe/null_nap.h> +#include <ipxe/efi/efi_nap.h> #include <ipxe/linux/linux_nap.h> /* Include all architecture-dependent I/O API headers */ @@ -52,6 +53,12 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); * Sleep until next CPU interrupt * */ +void cpu_halt ( void ); + +/** + * Sleep with interrupts enabled until next CPU interrupt + * + */ void cpu_nap ( void ); #endif /* _IPXE_NAP_H */ |