iPXE
ProcessorBind.h
Go to the documentation of this file.
1 #ifndef _IPXE_EFI_PROCESSOR_BIND_H
2 #define _IPXE_EFI_PROCESSOR_BIND_H
3 
4 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
5 FILE_SECBOOT ( PERMITTED );
6 
7 /*
8  * EFI header files rely on having the CPU architecture directory
9  * present in the search path in order to pick up ProcessorBind.h. We
10  * use this header file as a quick indirection layer.
11  * - mcb30
12  */
13 
14 /* Determine EFI architecture name (if existent) */
15 #if defined ( __i386__ )
16 #define EFIARCH Ia32
17 #endif
18 #if defined ( __x86_64__ )
19 #define EFIARCH X64
20 #endif
21 #if defined ( __arm__ )
22 #define EFIARCH Arm
23 #endif
24 #if defined ( __aarch64__ )
25 #define EFIARCH AArch64
26 #endif
27 #if defined ( __loongarch__ )
28 #define EFIARCH LoongArch64
29 #endif
30 #if defined ( __riscv ) && ( _riscv_xlen == 64 )
31 #define EFIARCH RiscV64
32 #endif
33 
34 /* Determine architecture-specific ProcessorBind.h path */
35 #define PROCESSORBIND(_arch) <ipxe/efi/_arch/ProcessorBind.h>
36 
37 /*
38  * We do not want to use any EFI-specific calling conventions etc when
39  * compiling a binary for execution on the build host itself.
40  */
41 #ifdef EFI_HOSTONLY
42 #undef EFIARCH
43 #endif
44 
45 #if defined ( EFIARCH )
46 
47 /* Include architecture-specific ProcessorBind.h if existent */
48 #include PROCESSORBIND(EFIARCH)
49 
50 #else /* EFIARCH */
51 
52 /* Define the basic integer types in terms of the host's <stdint.h> */
53 #include <stdint.h>
54 typedef int8_t INT8;
55 typedef int16_t INT16;
56 typedef int32_t INT32;
57 typedef int64_t INT64;
58 typedef uint8_t UINT8;
59 typedef long INTN;
60 typedef uint16_t UINT16;
61 typedef uint32_t UINT32;
62 typedef uint64_t UINT64;
63 typedef unsigned long UINTN;
64 typedef char CHAR8;
65 typedef uint16_t CHAR16;
66 typedef uint8_t BOOLEAN;
67 
68 /* Define EFIAPI as whatever API the host uses by default */
69 #define EFIAPI
70 
71 /* Define an architecture-neutral MDE_CPU macro to prevent build errors */
72 #define MDE_CPU_EBC
73 
74 /* Define a dummy boot file name to prevent build errors */
75 #define EFI_REMOVABLE_MEDIA_FILE_NAME L"\\EFI\\BOOT\\BOOTNONE.EFI"
76 
77 /* Define MAX_BIT in terms of UINTN */
78 #define MAX_BIT ( ( ( UINTN ) 1U ) << ( ( 8 * sizeof ( UINTN ) ) - 1 ) )
79 
80 #endif /* EFIARCH */
81 
82 #endif /* _IPXE_EFI_PROCESSOR_BIND_H */
int INT32
unsigned short uint16_t
Definition: stdint.h:11
FILE_SECBOOT(PERMITTED)
unsigned char BOOLEAN
INT64 INTN
Signed value of native width.
unsigned int UINT32
Definition: ProcessorBind.h:99
unsigned long long uint64_t
Definition: stdint.h:13
unsigned short CHAR16
unsigned char UINT8
long long INT64
Definition: ProcessorBind.h:98
signed long long int64_t
Definition: stdint.h:18
signed char int8_t
Definition: stdint.h:15
short INT16
unsigned short UINT16
unsigned char uint8_t
Definition: stdint.h:10
UINT64 UINTN
Unsigned value of native width.
unsigned int uint32_t
Definition: stdint.h:12
unsigned long long UINT64
Definition: ProcessorBind.h:97
FILE_LICENCE(BSD2_PATENT)
signed int int32_t
Definition: stdint.h:17
char CHAR8
signed short int16_t
Definition: stdint.h:16
signed char INT8