]>
git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Ia32/ProcessorBind.h
2 Processor or Compiler specific defines and types for IA-32 architecture.
4 Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials are licensed and made available under
6 the terms and conditions of the BSD License that accompanies this distribution.
7 The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php.
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #ifndef __PROCESSOR_BIND_H__
16 #define __PROCESSOR_BIND_H__
19 /// Define the processor type so other code can make processor based choices.
24 // Make sure we are using the correct packing rules per EFI specification
26 #if !defined(__GNUC__)
30 #if defined(__INTEL_COMPILER)
32 // Disable ICC's remark #869: "Parameter" was never referenced warning.
33 // This is legal ANSI C code so we disable the remark that is turned on with -Wall
35 #pragma warning ( disable : 869 )
38 // Disable ICC's remark #1418: external function definition with no prior declaration.
39 // This is legal ANSI C code so we disable the remark that is turned on with /W4
41 #pragma warning ( disable : 1418 )
44 // Disable ICC's remark #1419: external declaration in primary source file
45 // This is legal ANSI C code so we disable the remark that is turned on with /W4
47 #pragma warning ( disable : 1419 )
50 // Disable ICC's remark #593: "Variable" was set but never used.
51 // This is legal ANSI C code so we disable the remark that is turned on with /W4
53 #pragma warning ( disable : 593 )
58 #if defined(_MSC_EXTENSIONS)
61 // Disable warning that make it impossible to compile at /W4
62 // This only works for Microsoft* tools
66 // Disabling bitfield type checking warnings.
68 #pragma warning ( disable : 4214 )
71 // Disabling the unreferenced formal parameter warnings.
73 #pragma warning ( disable : 4100 )
76 // Disable slightly different base types warning as CHAR8 * can not be set
77 // to a constant string.
79 #pragma warning ( disable : 4057 )
82 // ASSERT(FALSE) or while (TRUE) are legal constructs so suppress this warning
84 #pragma warning ( disable : 4127 )
87 // This warning is caused by functions defined but not used. For precompiled header only.
89 #pragma warning ( disable : 4505 )
92 // This warning is caused by empty (after preprocessing) source file. For precompiled header only.
94 #pragma warning ( disable : 4206 )
96 #if _MSC_VER == 1800 || _MSC_VER == 1900 || _MSC_VER >= 1910
99 // Disable these warnings for VS2013.
103 // This warning is for potentially uninitialized local variable, and it may cause false
104 // positive issues in VS2013 and VS2015 build
106 #pragma warning ( disable : 4701 )
109 // This warning is for potentially uninitialized local pointer variable, and it may cause
110 // false positive issues in VS2013 and VS2015 build
112 #pragma warning ( disable : 4703 )
119 #if defined(_MSC_EXTENSIONS)
122 // use Microsoft C compiler dependent integer width types
126 /// 8-byte unsigned value.
128 typedef unsigned __int64 UINT64
;
130 /// 8-byte signed value.
132 typedef __int64 INT64
;
134 /// 4-byte unsigned value.
136 typedef unsigned __int32 UINT32
;
138 /// 4-byte signed value.
140 typedef __int32 INT32
;
142 /// 2-byte unsigned value.
144 typedef unsigned short UINT16
;
146 /// 2-byte Character. Unless otherwise specified all strings are stored in the
147 /// UTF-16 encoding format as defined by Unicode 2.1 and ISO/IEC 10646 standards.
149 typedef unsigned short CHAR16
;
151 /// 2-byte signed value.
155 /// Logical Boolean. 1-byte value containing 0 for FALSE or a 1 for TRUE. Other
156 /// values are undefined.
158 typedef unsigned char BOOLEAN
;
160 /// 1-byte unsigned value.
162 typedef unsigned char UINT8
;
164 /// 1-byte Character.
168 /// 1-byte signed value.
170 typedef signed char INT8
;
173 /// 8-byte unsigned value.
175 typedef unsigned long long UINT64
;
177 /// 8-byte signed value.
179 typedef long long INT64
;
181 /// 4-byte unsigned value.
183 typedef unsigned int UINT32
;
185 /// 4-byte signed value.
189 /// 2-byte unsigned value.
191 typedef unsigned short UINT16
;
193 /// 2-byte Character. Unless otherwise specified all strings are stored in the
194 /// UTF-16 encoding format as defined by Unicode 2.1 and ISO/IEC 10646 standards.
196 typedef unsigned short CHAR16
;
198 /// 2-byte signed value.
202 /// Logical Boolean. 1-byte value containing 0 for FALSE or a 1 for TRUE. Other
203 /// values are undefined.
205 typedef unsigned char BOOLEAN
;
207 /// 1-byte unsigned value.
209 typedef unsigned char UINT8
;
215 /// 1-byte signed value
217 typedef signed char INT8
;
221 /// Unsigned value of native width. (4 bytes on supported 32-bit processor instructions;
222 /// 8 bytes on supported 64-bit processor instructions.)
224 typedef UINT32 UINTN
;
226 /// Signed value of native width. (4 bytes on supported 32-bit processor instructions;
227 /// 8 bytes on supported 64-bit processor instructions.)
232 // Processor specific defines
236 /// A value of native width with the highest bit set.
238 #define MAX_BIT 0x80000000
240 /// A value of native width with the two highest bits set.
242 #define MAX_2_BITS 0xC0000000
245 /// Maximum legal IA-32 address.
247 #define MAX_ADDRESS 0xFFFFFFFF
250 /// Maximum legal IA-32 INTN and UINTN values.
252 #define MAX_INTN ((INTN)0x7FFFFFFF)
253 #define MAX_UINTN ((UINTN)0xFFFFFFFF)
256 /// The stack alignment required for IA-32.
258 #define CPU_STACK_ALIGNMENT sizeof(UINTN)
261 /// Page allocation granularity for IA-32.
263 #define DEFAULT_PAGE_ALLOCATION_GRANULARITY (0x1000)
264 #define RUNTIME_PAGE_ALLOCATION_GRANULARITY (0x1000)
267 // Modifier to ensure that all protocol member functions and EFI intrinsics
268 // use the correct C calling convention. All protocol member functions and
269 // EFI intrinsics are required to modify their member functions with EFIAPI.
273 /// If EFIAPI is already defined, then we use that definition.
275 #elif defined(_MSC_EXTENSIONS)
277 /// Microsoft* compiler specific method for EFIAPI calling convention.
279 #define EFIAPI __cdecl
280 #elif defined(__GNUC__)
282 /// GCC specific method for EFIAPI calling convention.
284 #define EFIAPI __attribute__((cdecl))
287 /// The default for a non Microsoft* or GCC compiler is to assume the EFI ABI
293 #if defined(__GNUC__)
295 /// For GNU assembly code, .global or .globl can declare global symbols.
296 /// Define this macro to unify the usage.
298 #define ASM_GLOBAL .globl
302 Return the pointer to the first instruction of a function given a function pointer.
303 On IA-32 CPU architectures, these two pointer values are the same,
304 so the implementation of this macro is very simple.
306 @param FunctionPointer A pointer to a function.
308 @return The pointer to the first instruction of a function given a function pointer.
311 #define FUNCTION_ENTRY_POINT(FunctionPointer) (VOID *)(UINTN)(FunctionPointer)
313 #ifndef __USER_LABEL_PREFIX__
314 #define __USER_LABEL_PREFIX__ _