diff options
| author | Simon Rettberg | 2026-01-28 12:53:53 +0100 |
|---|---|---|
| committer | Simon Rettberg | 2026-01-28 12:53:53 +0100 |
| commit | 8e82785c584dc13e20f9229decb95bd17bbe9cd1 (patch) | |
| tree | a8b359e59196be5b2e3862bed189107f4bc9975f /src/include/ipxe/efi/ProcessorBind.h | |
| parent | Merge branch 'master' into openslx (diff) | |
| parent | [prefix] Make unlzma.S compatible with 386 class CPUs (diff) | |
| download | ipxe-openslx.tar.gz ipxe-openslx.tar.xz ipxe-openslx.zip | |
Merge branch 'master' into openslxopenslx
Diffstat (limited to 'src/include/ipxe/efi/ProcessorBind.h')
| -rw-r--r-- | src/include/ipxe/efi/ProcessorBind.h | 70 |
1 files changed, 41 insertions, 29 deletions
diff --git a/src/include/ipxe/efi/ProcessorBind.h b/src/include/ipxe/efi/ProcessorBind.h index dbccf346d..9fb8012f7 100644 --- a/src/include/ipxe/efi/ProcessorBind.h +++ b/src/include/ipxe/efi/ProcessorBind.h @@ -2,6 +2,7 @@ #define _IPXE_EFI_PROCESSOR_BIND_H FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); +FILE_SECBOOT ( PERMITTED ); /* * EFI header files rely on having the CPU architecture directory @@ -10,13 +11,43 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); * - mcb30 */ -#ifdef EFI_HOSTONLY +/* Determine EFI architecture name (if existent) */ +#if defined ( __i386__ ) +#define EFIARCH Ia32 +#endif +#if defined ( __x86_64__ ) +#define EFIARCH X64 +#endif +#if defined ( __arm__ ) +#define EFIARCH Arm +#endif +#if defined ( __aarch64__ ) +#define EFIARCH AArch64 +#endif +#if defined ( __loongarch__ ) +#define EFIARCH LoongArch64 +#endif +#if defined ( __riscv ) && ( _riscv_xlen == 64 ) +#define EFIARCH RiscV64 +#endif + +/* Determine architecture-specific ProcessorBind.h path */ +#define PROCESSORBIND(_arch) <ipxe/efi/_arch/ProcessorBind.h> /* - * We cannot rely on the EDK2 ProcessorBind.h headers when compiling a - * binary for execution on the build host itself, since the host's CPU - * architecture may not even be supported by EDK2. + * We do not want to use any EFI-specific calling conventions etc when + * compiling a binary for execution on the build host itself. */ +#ifdef EFI_HOSTONLY +#undef EFIARCH +#endif + +#if defined ( EFIARCH ) + +/* Include architecture-specific ProcessorBind.h if existent */ +#include PROCESSORBIND(EFIARCH) + +#else /* EFIARCH */ /* Define the basic integer types in terms of the host's <stdint.h> */ #include <stdint.h> @@ -30,8 +61,8 @@ typedef uint16_t UINT16; typedef uint32_t UINT32; typedef uint64_t UINT64; typedef unsigned long UINTN; -typedef int8_t CHAR8; -typedef int16_t CHAR16; +typedef char CHAR8; +typedef uint16_t CHAR16; typedef uint8_t BOOLEAN; /* Define EFIAPI as whatever API the host uses by default */ @@ -40,31 +71,12 @@ typedef uint8_t BOOLEAN; /* Define an architecture-neutral MDE_CPU macro to prevent build errors */ #define MDE_CPU_EBC +/* Define a dummy boot file name to prevent build errors */ +#define EFI_REMOVABLE_MEDIA_FILE_NAME L"\\EFI\\BOOT\\BOOTNONE.EFI" + /* Define MAX_BIT in terms of UINTN */ #define MAX_BIT ( ( ( UINTN ) 1U ) << ( ( 8 * sizeof ( UINTN ) ) - 1 ) ) -#else /* EFI_HOSTONLY */ - -#ifdef __i386__ -#include <ipxe/efi/Ia32/ProcessorBind.h> -#endif - -#ifdef __x86_64__ -#include <ipxe/efi/X64/ProcessorBind.h> -#endif - -#ifdef __arm__ -#include <ipxe/efi/Arm/ProcessorBind.h> -#endif - -#ifdef __aarch64__ -#include <ipxe/efi/AArch64/ProcessorBind.h> -#endif - -#ifdef __loongarch__ -#include <ipxe/efi/LoongArch64/ProcessorBind.h> -#endif - -#endif /* EFI_HOSTONLY */ +#endif /* EFIARCH */ #endif /* _IPXE_EFI_PROCESSOR_BIND_H */ |
