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
4FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
5FILE_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>
54typedef int8_t INT8;
55typedef int16_t INT16;
56typedef int32_t INT32;
57typedef int64_t INT64;
58typedef uint8_t UINT8;
59typedef long INTN;
63typedef unsigned long UINTN;
64typedef char CHAR8;
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 */
unsigned short UINT16
2-byte unsigned value.
unsigned char BOOLEAN
Logical Boolean.
char CHAR8
1-byte Character
UINT64 UINTN
Unsigned value of native width.
unsigned long long UINT64
8-byte unsigned value.
short INT16
2-byte signed value.
int INT32
4-byte signed value.
long long INT64
8-byte signed value.
unsigned short CHAR16
2-byte Character.
signed char INT8
1-byte signed value
INT64 INTN
Signed value of native width.
unsigned char UINT8
1-byte unsigned value.
unsigned int UINT32
4-byte unsigned value.
signed short int16_t
Definition stdint.h:16
unsigned short uint16_t
Definition stdint.h:11
unsigned int uint32_t
Definition stdint.h:12
unsigned long long uint64_t
Definition stdint.h:13
signed int int32_t
Definition stdint.h:17
unsigned char uint8_t
Definition stdint.h:10
signed long long int64_t
Definition stdint.h:18
signed char int8_t
Definition stdint.h:15
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:896
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:926