XenevaOS
Loading...
Searching...
No Matches
ProcessorBind.h
Go to the documentation of this file.
1
15#ifndef __PROCESSOR_BIND_H__
16#define __PROCESSOR_BIND_H__
17
21#define MDE_CPU_X64
22
23//
24// Make sure we are using the correct packing rules per EFI specification
25//
26#if !defined(__GNUC__)
27#pragma pack()
28#endif
29
30#if defined(__GNUC__) && defined(__pic__) && !defined(USING_LTO)
31//
32// Mark all symbol declarations and references as hidden, meaning they will
33// not be subject to symbol preemption. This allows the compiler to refer to
34// symbols directly using relative references rather than via the GOT, which
35// contains absolute symbol addresses that are subject to runtime relocation.
36//
37// The LTO linker will not emit GOT based relocations when all symbol
38// references can be resolved locally, and so there is no need to set the
39// pragma in that case (and doing so will cause other issues).
40//
41#pragma GCC visibility push (hidden)
42#endif
43
44#if defined(__INTEL_COMPILER)
45//
46// Disable ICC's remark #869: "Parameter" was never referenced warning.
47// This is legal ANSI C code so we disable the remark that is turned on with -Wall
48//
49#pragma warning ( disable : 869 )
50
51//
52// Disable ICC's remark #1418: external function definition with no prior declaration.
53// This is legal ANSI C code so we disable the remark that is turned on with /W4
54//
55#pragma warning ( disable : 1418 )
56
57//
58// Disable ICC's remark #1419: external declaration in primary source file
59// This is legal ANSI C code so we disable the remark that is turned on with /W4
60//
61#pragma warning ( disable : 1419 )
62
63//
64// Disable ICC's remark #593: "Variable" was set but never used.
65// This is legal ANSI C code so we disable the remark that is turned on with /W4
66//
67#pragma warning ( disable : 593 )
68
69#endif
70
71
72#if defined(_MSC_EXTENSIONS)
73
74//
75// Disable warning that make it impossible to compile at /W4
76// This only works for Microsoft* tools
77//
78
79//
80// Disabling bitfield type checking warnings.
81//
82#pragma warning ( disable : 4214 )
83
84//
85// Disabling the unreferenced formal parameter warnings.
86//
87#pragma warning ( disable : 4100 )
88
89//
90// Disable slightly different base types warning as CHAR8 * can not be set
91// to a constant string.
92//
93#pragma warning ( disable : 4057 )
94
95//
96// ASSERT(FALSE) or while (TRUE) are legal constructs so suppress this warning
97//
98#pragma warning ( disable : 4127 )
99
100//
101// This warning is caused by functions defined but not used. For precompiled header only.
102//
103#pragma warning ( disable : 4505 )
104
105//
106// This warning is caused by empty (after preprocessing) source file. For precompiled header only.
107//
108#pragma warning ( disable : 4206 )
109
110#if _MSC_VER == 1800 || _MSC_VER == 1900 || _MSC_VER >= 1910
111
112//
113// Disable these warnings for VS2013.
114//
115
116//
117// This warning is for potentially uninitialized local variable, and it may cause false
118// positive issues in VS2013 and VS2015 build
119//
120#pragma warning ( disable : 4701 )
121
122//
123// This warning is for potentially uninitialized local pointer variable, and it may cause
124// false positive issues in VS2013 and VS2015 build
125//
126#pragma warning ( disable : 4703 )
127
128#endif
129
130#endif
131
132
133#if defined(_MSC_EXTENSIONS)
134 //
135 // use Microsoft C compiler dependent integer width types
136 //
137
141 typedef unsigned __int64 UINT64;
145 typedef __int64 INT64;
149 typedef unsigned __int32 UINT32;
153 typedef __int32 INT32;
157 typedef unsigned short UINT16;
162 typedef unsigned short CHAR16;
166 typedef short INT16;
171 typedef unsigned char BOOLEAN;
175 typedef unsigned char UINT8;
179 typedef char CHAR8;
183 typedef signed char INT8;
184#else
188 typedef unsigned long long UINT64;
192 typedef long long INT64;
196 typedef unsigned int UINT32;
200 typedef int INT32;
204 typedef unsigned short UINT16;
209 typedef unsigned short CHAR16;
213 typedef short INT16;
218 typedef unsigned char BOOLEAN;
222 typedef unsigned char UINT8;
226 typedef char CHAR8;
230 typedef signed char INT8;
231#endif
232
237typedef UINT64 UINTN;
242typedef INT64 INTN;
243
244
245//
246// Processor specific defines
247//
248
252#define MAX_BIT 0x8000000000000000ULL
256#define MAX_2_BITS 0xC000000000000000ULL
257
261#define MAX_ADDRESS 0xFFFFFFFFFFFFFFFFULL
262
266#define MAX_INTN ((INTN)0x7FFFFFFFFFFFFFFFULL)
267#define MAX_UINTN ((UINTN)0xFFFFFFFFFFFFFFFFULL)
268
272#define MIN_INTN (((INTN)-9223372036854775807LL) - 1)
273
277#define CPU_STACK_ALIGNMENT 16
278
282#define DEFAULT_PAGE_ALLOCATION_GRANULARITY (0x1000)
283#define RUNTIME_PAGE_ALLOCATION_GRANULARITY (0x1000)
284
285//
286// Modifier to ensure that all protocol member functions and EFI intrinsics
287// use the correct C calling convention. All protocol member functions and
288// EFI intrinsics are required to modify their member functions with EFIAPI.
289//
290#ifdef EFIAPI
294#elif defined(_MSC_EXTENSIONS)
298 #define EFIAPI __cdecl
299#elif defined(__GNUC__)
308 #define EFIAPI
309#else
314 #define EFIAPI
315#endif
316
317#if defined(__GNUC__)
322 #define ASM_GLOBAL .globl
323#endif
324
335#define FUNCTION_ENTRY_POINT(FunctionPointer) (VOID *)(UINTN)(FunctionPointer)
336
337#ifndef __USER_LABEL_PREFIX__
338#define __USER_LABEL_PREFIX__
339#endif
340
341#endif
342
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