TianoCore EDK2 master
Loading...
Searching...
No Matches
ProcessorBind.h
Go to the documentation of this file.
1
9#ifndef __PROCESSOR_BIND_H__
10#define __PROCESSOR_BIND_H__
11
15#define MDE_CPU_IA32
16
17//
18// Make sure we are using the correct packing rules per EFI specification
19//
20#if !defined (__GNUC__)
21 #pragma pack()
22#endif
23
24#if defined (__INTEL_COMPILER)
25//
26// Disable ICC's remark #869: "Parameter" was never referenced warning.
27// This is legal ANSI C code so we disable the remark that is turned on with -Wall
28//
29 #pragma warning ( disable : 869 )
30
31//
32// Disable ICC's remark #1418: external function definition with no prior declaration.
33// This is legal ANSI C code so we disable the remark that is turned on with /W4
34//
35 #pragma warning ( disable : 1418 )
36
37//
38// Disable ICC's remark #1419: external declaration in primary source file
39// This is legal ANSI C code so we disable the remark that is turned on with /W4
40//
41 #pragma warning ( disable : 1419 )
42
43//
44// Disable ICC's remark #593: "Variable" was set but never used.
45// This is legal ANSI C code so we disable the remark that is turned on with /W4
46//
47 #pragma warning ( disable : 593 )
48
49#endif
50
51#if defined (_MSC_EXTENSIONS)
52
53//
54// Disable warning that make it impossible to compile at /W4
55// This only works for Microsoft* tools
56//
57
58//
59// Disabling bitfield type checking warnings.
60//
61 #pragma warning ( disable : 4214 )
62
63//
64// Disabling the unreferenced formal parameter warnings.
65//
66 #pragma warning ( disable : 4100 )
67
68//
69// Disable slightly different base types warning as CHAR8 * can not be set
70// to a constant string.
71//
72 #pragma warning ( disable : 4057 )
73
74//
75// ASSERT(FALSE) or while (TRUE) are legal constructs so suppress this warning
76//
77 #pragma warning ( disable : 4127 )
78
79//
80// This warning is caused by functions defined but not used. For precompiled header only.
81//
82 #pragma warning ( disable : 4505 )
83
84//
85// This warning is caused by empty (after preprocessing) source file. For precompiled header only.
86//
87 #pragma warning ( disable : 4206 )
88
89 #if defined (_MSC_VER) && _MSC_VER >= 1800
90
91//
92// This warning is for potentially uninitialized local variable, and it may cause false
93// positive issues in VS2015 build
94//
95 #pragma warning ( disable : 4701 )
96
97//
98// This warning is for potentially uninitialized local pointer variable, and it may cause
99// false positive issues in VS2015 build
100//
101 #pragma warning ( disable : 4703 )
102
103 #endif
104
105#endif
106
107#if defined (_MSC_EXTENSIONS)
108
109//
110// use Microsoft C compiler dependent integer width types
111//
112
116typedef unsigned __int64 UINT64;
120typedef __int64 INT64;
124typedef unsigned __int32 UINT32;
128typedef __int32 INT32;
132typedef unsigned short UINT16;
137typedef unsigned short CHAR16;
141typedef short INT16;
146typedef unsigned char BOOLEAN;
150typedef unsigned char UINT8;
154typedef char CHAR8;
158typedef signed char INT8;
159#else
163typedef unsigned long long UINT64;
167typedef long long INT64;
171typedef unsigned int UINT32;
175typedef int INT32;
179typedef unsigned short UINT16;
184typedef unsigned short CHAR16;
188typedef short INT16;
193typedef unsigned char BOOLEAN;
197typedef unsigned char UINT8;
201typedef char CHAR8;
205typedef signed char INT8;
206#endif
207
212typedef UINT32 UINTN;
217typedef INT32 INTN;
218
219//
220// Processor specific defines
221//
222
226#define MAX_BIT 0x80000000
230#define MAX_2_BITS 0xC0000000
231
235#define MAX_ADDRESS 0xFFFFFFFF
236
240#define MAX_ALLOC_ADDRESS MAX_ADDRESS
241
245#define MAX_INTN ((INTN)0x7FFFFFFF)
246#define MAX_UINTN ((UINTN)0xFFFFFFFF)
247
251#define MIN_INTN (((INTN)-2147483647) - 1)
252
256#define CPU_STACK_ALIGNMENT sizeof(UINTN)
257
261#define DEFAULT_PAGE_ALLOCATION_GRANULARITY (0x1000)
262#define RUNTIME_PAGE_ALLOCATION_GRANULARITY (0x1000)
263
264//
265// Modifier to ensure that all protocol member functions and EFI intrinsics
266// use the correct C calling convention. All protocol member functions and
267// EFI intrinsics are required to modify their member functions with EFIAPI.
268//
269#ifdef EFIAPI
273#elif defined (_MSC_EXTENSIONS)
277#define EFIAPI __cdecl
278#elif defined (__GNUC__) || defined (__clang__)
282#define EFIAPI __attribute__((cdecl))
283#else
288#define EFIAPI
289#endif
290
291#if defined (__GNUC__) || defined (__clang__)
296#define ASM_GLOBAL .globl
297#endif
298
309#define FUNCTION_ENTRY_POINT(FunctionPointer) (VOID *)(UINTN)(FunctionPointer)
310
311#ifndef __USER_LABEL_PREFIX__
312#define __USER_LABEL_PREFIX__ _
313#endif
314
315#endif
UINT64 UINTN
INT64 INTN