[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>
This commit is contained in:
Michael Brown
2024-09-13 14:26:34 +01:00
parent 5de5d4626e
commit c85ad12468
12 changed files with 53 additions and 179 deletions

View File

@@ -26,6 +26,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#define ACPI_EFI
#define FDT_EFI
#define MPAPI_EFI
#define NAP_EFI
#define NET_PROTO_IPV6 /* IPv6 protocol */
#define NET_PROTO_LLDP /* Link Layer Discovery protocol */
@@ -53,7 +54,6 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#if defined ( __i386__ ) || defined ( __x86_64__ )
#define IOAPI_X86
#define NAP_EFIX86
#define ENTROPY_RDRAND
#define CPUID_CMD /* x86 CPU feature detection command */
#define UNSAFE_STD /* Avoid setting direction flag */
@@ -61,7 +61,6 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#if defined ( __arm__ ) || defined ( __aarch64__ )
#define IOAPI_ARM
#define NAP_EFIARM
#endif
#if defined ( __aarch64__ )
@@ -70,7 +69,6 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#if defined ( __loongarch__ )
#define IOAPI_LOONG64
#define NAP_EFILOONG64
#endif
#endif /* CONFIG_DEFAULTS_EFI_H */