TianoCore EDK2 master
ProcessorBind.h
Go to the documentation of this file.
1
12#ifndef __PROCESSOR_BIND_H__
13#define __PROCESSOR_BIND_H__
14
18#define MDE_CPU_AARCH64
19
20//
21// Make sure we are using the correct packing rules per EFI specification
22//
23#if !defined (__GNUC__) && !defined (__ASSEMBLER__)
24 #pragma pack()
25#endif
26
27#if defined (_MSC_EXTENSIONS)
28
29//
30// Disable some level 4 compilation warnings (same as IA32 and X64)
31//
32
33//
34// Disabling bitfield type checking warnings.
35//
36 #pragma warning ( disable : 4214 )
37
38//
39// Disabling the unreferenced formal parameter warnings.
40//
41 #pragma warning ( disable : 4100 )
42
43//
44// Disable slightly different base types warning as CHAR8 * can not be set
45// to a constant string.
46//
47 #pragma warning ( disable : 4057 )
48
49//
50// ASSERT(FALSE) or while (TRUE) are legal constructs so suppress this warning
51//
52 #pragma warning ( disable : 4127 )
53
54//
55// This warning is caused by functions defined but not used. For precompiled header only.
56//
57 #pragma warning ( disable : 4505 )
58
59//
60// This warning is caused by empty (after preprocessing) source file. For precompiled header only.
61//
62 #pragma warning ( disable : 4206 )
63
64//
65// Disable 'potentially uninitialized local variable X used' warnings
66//
67 #pragma warning ( disable : 4701 )
68
69//
70// Disable 'potentially uninitialized local pointer variable X used' warnings
71//
72 #pragma warning ( disable : 4703 )
73
74//
75// use Microsoft* C compiler dependent integer width types
76//
77typedef unsigned __int64 UINT64;
78typedef __int64 INT64;
79typedef unsigned __int32 UINT32;
80typedef __int32 INT32;
81typedef unsigned short UINT16;
82typedef unsigned short CHAR16;
83typedef short INT16;
84typedef unsigned char BOOLEAN;
85typedef unsigned char UINT8;
86typedef char CHAR8;
87typedef signed char INT8;
88
89#else
90
91//
92// Assume standard AARCH64 alignment.
93//
94typedef unsigned long long UINT64;
95typedef long long INT64;
96typedef unsigned int UINT32;
97typedef int INT32;
98typedef unsigned short UINT16;
99typedef unsigned short CHAR16;
100typedef short INT16;
101typedef unsigned char BOOLEAN;
102typedef unsigned char UINT8;
103typedef char CHAR8;
104typedef signed char INT8;
105
106#endif
107
112typedef UINT64 UINTN;
113
118typedef INT64 INTN;
119
120//
121// Processor specific defines
122//
123
127#define MAX_BIT 0x8000000000000000ULL
128
132#define MAX_2_BITS 0xC000000000000000ULL
133
137#define MAX_ADDRESS 0xFFFFFFFFFFFFFFFFULL
138
142#define MAX_ALLOC_ADDRESS 0xFFFFFFFFFFFFULL
143
147#define MAX_INTN ((INTN)0x7FFFFFFFFFFFFFFFULL)
148#define MAX_UINTN ((UINTN)0xFFFFFFFFFFFFFFFFULL)
149
153#define MIN_INTN (((INTN)-9223372036854775807LL) - 1)
154
158#define CPU_STACK_ALIGNMENT 16
159
163#define DEFAULT_PAGE_ALLOCATION_GRANULARITY (0x1000)
164#define RUNTIME_PAGE_ALLOCATION_GRANULARITY (0x10000)
165
166//
167// Modifier to ensure that all protocol member functions and EFI intrinsics
168// use the correct C calling convention. All protocol member functions and
169// EFI intrinsics are required to modify their member functions with EFIAPI.
170//
171#define EFIAPI
172
173// When compiling with Clang, we still use GNU as for the assembler, so we still
174// need to define the GCC_ASM* macros.
175#if defined (__GNUC__) || defined (__clang__)
180#define ASM_GLOBAL .globl
181
182#define GCC_ASM_EXPORT(func__) \
183 .global _CONCATENATE (__USER_LABEL_PREFIX__, func__) ;\
184 .type ASM_PFX(func__), %function
185
186#define GCC_ASM_IMPORT(func__) \
187 .extern _CONCATENATE (__USER_LABEL_PREFIX__, func__)
188
189#endif
190
201#define FUNCTION_ENTRY_POINT(FunctionPointer) (VOID *)(UINTN)(FunctionPointer)
202
203#ifndef __USER_LABEL_PREFIX__
204#define __USER_LABEL_PREFIX__
205#endif
206
207#endif
UINT64 UINTN
INT64 INTN
unsigned short UINT16
Definition: ProcessorBind.h:48
unsigned char BOOLEAN
Definition: ProcessorBind.h:32
__int64 INT64
Definition: ProcessorBind.h:65
char CHAR8
Definition: ProcessorBind.h:40
short INT16
Definition: ProcessorBind.h:44
int INT32
Definition: ProcessorBind.h:57
unsigned short CHAR16
Definition: ProcessorBind.h:53
signed char INT8
Definition: ProcessorBind.h:27
unsigned __int64 UINT64
Definition: ProcessorBind.h:69
unsigned char UINT8
Definition: ProcessorBind.h:36
unsigned int UINT32
Definition: ProcessorBind.h:61