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