XenevaOS
Loading...
Searching...
No Matches
ProcessorBind.h
Go to the documentation of this file.
1
16#ifndef __PROCESSOR_BIND_H__
17#define __PROCESSOR_BIND_H__
18
22#define MDE_CPU_ARM
23
24//
25// Make sure we are using the correct packing rules per EFI specification
26//
27#if !defined(__GNUC__) && !defined(__ASSEMBLER__)
28#pragma pack()
29#endif
30
31#if defined(_MSC_EXTENSIONS)
32
33//
34// Disable some level 4 compilation warnings (same as IA32 and X64)
35//
36
37//
38// Disabling bitfield type checking warnings.
39//
40#pragma warning ( disable : 4214 )
41
42//
43// Disabling the unreferenced formal parameter warnings.
44//
45#pragma warning ( disable : 4100 )
46
47//
48// Disable slightly different base types warning as CHAR8 * can not be set
49// to a constant string.
50//
51#pragma warning ( disable : 4057 )
52
53//
54// ASSERT(FALSE) or while (TRUE) are legal constructs so suppress this warning
55//
56#pragma warning ( disable : 4127 )
57
58//
59// This warning is caused by functions defined but not used. For precompiled header only.
60//
61#pragma warning ( disable : 4505 )
62
63//
64// This warning is caused by empty (after preprocessing) source file. For precompiled header only.
65//
66#pragma warning ( disable : 4206 )
67
68//
69// Disable 'potentially uninitialized local variable X used' warnings
70//
71#pragma warning ( disable : 4701 )
72
73//
74// Disable 'potentially uninitialized local pointer variable X used' warnings
75//
76#pragma warning ( disable : 4703 )
77
78#endif
79
80//
81// RVCT and MSFT don't support the __builtin_unreachable() macro
82//
83#if defined(__ARMCC_VERSION) || defined(_MSC_EXTENSIONS)
84#define UNREACHABLE()
85#endif
86
87#if defined(_MSC_EXTENSIONS)
88 //
89 // use Microsoft* C compiler dependent integer width types
90 //
91 typedef unsigned __int64 UINT64;
92 typedef __int64 INT64;
93 typedef unsigned __int32 UINT32;
94 typedef __int32 INT32;
95 typedef unsigned short UINT16;
96 typedef unsigned short CHAR16;
97 typedef short INT16;
98 typedef unsigned char BOOLEAN;
99 typedef unsigned char UINT8;
100 typedef char CHAR8;
101 typedef signed char INT8;
102#else
103 //
104 // Assume standard ARM alignment.
105 // Need to check portability of long long
106 //
107 typedef unsigned long long UINT64;
108 typedef long long INT64;
109 typedef unsigned int UINT32;
110 typedef int INT32;
111 typedef unsigned short UINT16;
112 typedef unsigned short CHAR16;
113 typedef short INT16;
114 typedef unsigned char BOOLEAN;
115 typedef unsigned char UINT8;
116 typedef char CHAR8;
117 typedef signed char INT8;
118#endif
119
124typedef UINT32 UINTN;
125
130typedef INT32 INTN;
131
132//
133// Processor specific defines
134//
135
139#define MAX_BIT 0x80000000
140
144#define MAX_2_BITS 0xC0000000
145
149#define MAX_ADDRESS 0xFFFFFFFF
150
154#define MAX_INTN ((INTN)0x7FFFFFFF)
155#define MAX_UINTN ((UINTN)0xFFFFFFFF)
156
160#define MIN_INTN (((INTN)-2147483647) - 1)
161
165#define CPU_STACK_ALIGNMENT sizeof(UINT64)
166
170#define DEFAULT_PAGE_ALLOCATION_GRANULARITY (0x1000)
171#define RUNTIME_PAGE_ALLOCATION_GRANULARITY (0x1000)
172
173//
174// Modifier to ensure that all protocol member functions and EFI intrinsics
175// use the correct C calling convention. All protocol member functions and
176// EFI intrinsics are required to modify their member functions with EFIAPI.
177//
178#define EFIAPI
179
180// When compiling with Clang, we still use GNU as for the assembler, so we still
181// need to define the GCC_ASM* macros.
182#if defined(__GNUC__) || defined(__clang__)
187 #define ASM_GLOBAL .globl
188
189 #if !defined(__APPLE__)
195 #define INTERWORK_FUNC(func__) .type ASM_PFX(func__), %function
196
197 #define GCC_ASM_EXPORT(func__) \
198 .global _CONCATENATE (__USER_LABEL_PREFIX__, func__) ;\
199 .type ASM_PFX(func__), %function
200
201 #define GCC_ASM_IMPORT(func__) \
202 .extern _CONCATENATE (__USER_LABEL_PREFIX__, func__)
203
204 #else
205 //
206 // .type not supported by Apple Xcode tools
207 //
208 #define INTERWORK_FUNC(func__)
209
210 #define GCC_ASM_EXPORT(func__) \
211 .globl _CONCATENATE (__USER_LABEL_PREFIX__, func__) \
212
213 #define GCC_ASM_IMPORT(name)
214
215 #endif
216#elif defined(_MSC_EXTENSIONS)
217 //
218 // PRESERVE8 is not supported by the MSFT assembler.
219 //
220 #define PRESERVE8
221#endif
222
233#define FUNCTION_ENTRY_POINT(FunctionPointer) (VOID *)(UINTN)(FunctionPointer)
234
235#ifndef __USER_LABEL_PREFIX__
236#define __USER_LABEL_PREFIX__
237#endif
238
239#endif
240
241
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