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