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