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_X64
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// use Microsoft C compiler dependent integer width types
110//
111
115typedef unsigned __int64 UINT64;
119typedef __int64 INT64;
123typedef unsigned __int32 UINT32;
127typedef __int32 INT32;
131typedef unsigned short UINT16;
136typedef unsigned short CHAR16;
140typedef short INT16;
145typedef unsigned char BOOLEAN;
149typedef unsigned char UINT8;
153typedef char CHAR8;
157typedef signed char INT8;
158#else
162typedef unsigned long long UINT64;
166typedef long long INT64;
170typedef unsigned int UINT32;
174typedef int INT32;
178typedef unsigned short UINT16;
183typedef unsigned short CHAR16;
187typedef short INT16;
192typedef unsigned char BOOLEAN;
196typedef unsigned char UINT8;
200typedef char CHAR8;
204typedef signed char INT8;
205#endif
206
211typedef UINT64 UINTN;
216typedef INT64 INTN;
217
218//
219// Processor specific defines
220//
221
225#define MAX_BIT 0x8000000000000000ULL
229#define MAX_2_BITS 0xC000000000000000ULL
230
234#define MAX_ADDRESS 0xFFFFFFFFFFFFFFFFULL
235
239#define MAX_ALLOC_ADDRESS MAX_ADDRESS
240
244#define MAX_INTN ((INTN)0x7FFFFFFFFFFFFFFFULL)
245#define MAX_UINTN ((UINTN)0xFFFFFFFFFFFFFFFFULL)
246
250#define MIN_INTN (((INTN)-9223372036854775807LL) - 1)
251
255#define CPU_STACK_ALIGNMENT 16
256
260#define DEFAULT_PAGE_ALLOCATION_GRANULARITY (0x1000)
261#define RUNTIME_PAGE_ALLOCATION_GRANULARITY (0x1000)
262
263//
264// Modifier to ensure that all protocol member functions and EFI intrinsics
265// use the correct C calling convention. All protocol member functions and
266// EFI intrinsics are required to modify their member functions with EFIAPI.
267//
268#ifdef EFIAPI
272#elif defined (_MSC_EXTENSIONS)
276#define EFIAPI __cdecl
277#elif defined (__GNUC__)
286#define EFIAPI
287#else
292#define EFIAPI
293#endif
294
295#if defined (__GNUC__) || defined (__clang__)
300#define ASM_GLOBAL .globl
301#endif
302
313#define FUNCTION_ENTRY_POINT(FunctionPointer) (VOID *)(UINTN)(FunctionPointer)
314
315#ifndef __USER_LABEL_PREFIX__
316#define __USER_LABEL_PREFIX__
317#endif
318
319#endif
UINT64 UINTN
INT64 INTN