]>
git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Ia32/ProcessorBind.h
2 Processor or Compiler specific defines and types for x64.
4 Copyright (c) 2006, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. 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 useing the correct packing rules per EFI specification
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
35 #pragma warning ( disable : 1418 )
39 // Disable ICC's remark #1419: external declaration in primary source file
40 // This is legal ANSI C code so we disable the remark that is turned on with /W4
42 #pragma warning ( disable : 1419 )
50 // Disable warning that make it impossible to compile at /W4
51 // This only works for Microsoft* tools
55 // Disabling bitfield type checking warnings.
57 #pragma warning ( disable : 4214 )
60 // Disabling the unreferenced formal parameter warnings.
62 #pragma warning ( disable : 4100 )
65 // Disable slightly different base types warning as CHAR8 * can not be set
66 // to a constant string.
68 #pragma warning ( disable : 4057 )
71 // ASSERT(FALSE) or while (TRUE) are legal constructes so supress this warning
73 #pragma warning ( disable : 4127 )
76 // This warning is caused by functions defined but not used. For precompiled header only.
78 #pragma warning ( disable : 4505 )
81 // This warning is caused by empty (after preprocessing) souce file. For precompiled header only.
83 #pragma warning ( disable : 4206 )
88 #if !defined(__GNUC__) && (__STDC_VERSION__ < 199901L)
90 // No ANSI C 2000 stdint.h integer width declarations, so define equivalents
96 // use Microsoft* C complier dependent interger width types
98 typedef unsigned __int64 UINT64
;
99 typedef __int64 INT64
;
100 typedef unsigned __int32 UINT32
;
101 typedef __int32 INT32
;
102 typedef unsigned short UINT16
;
103 typedef unsigned short CHAR16
;
105 typedef unsigned char BOOLEAN
;
106 typedef unsigned char UINT8
;
112 // Assume standard IA-32 alignment.
113 // Need to check portability of long long
115 typedef unsigned long long UINT64
;
116 typedef long long INT64
;
117 typedef unsigned int UINT32
;
119 typedef unsigned short UINT16
;
120 typedef unsigned short CHAR16
;
122 typedef unsigned char BOOLEAN
;
123 typedef unsigned char UINT8
;
128 #define UINT8_MAX 0xff
132 // Use ANSI C 2000 stdint.h integer width declarations
135 typedef uint8_t BOOLEAN
;
137 typedef uint8_t UINT8
;
138 typedef int16_t INT16
;
139 typedef uint16_t UINT16
;
140 typedef int32_t INT32
;
141 typedef uint32_t UINT32
;
142 typedef int64_t INT64
;
143 typedef uint64_t UINT64
;
145 typedef uint16_t CHAR16
;
149 typedef UINT32 UINTN
;
154 // Processor specific defines
156 #define MAX_BIT 0x80000000
157 #define MAX_2_BITS 0xC0000000
160 // Maximum legal IA-32 address
162 #define MAX_ADDRESS 0xFFFFFFFF
165 // The stack alignment required for IA-32
167 #define CPU_STACK_ALIGNMENT sizeof(UINTN)
170 // Modifier to ensure that all protocol member functions and EFI intrinsics
171 // use the correct C calling convention. All protocol member functions and
172 // EFI intrinsics are required to modify thier member functions with EFIAPI.
176 // Microsoft* compiler requires _EFIAPI useage, __cdecl is Microsoft* specific C.
178 #define EFIAPI __cdecl
182 #define EFIAPI __attribute__((cdecl))
186 // The Microsoft* C compiler can removed references to unreferenced data items
187 // if the /OPT:REF linker option is used. We defined a macro as this is a
188 // a non standard extension
191 #define GLOBAL_REMOVE_IF_UNREFERENCED __declspec(selectany)
193 #define GLOBAL_REMOVE_IF_UNREFERENCED
197 // For symbol name in GNU assembly code, an extra "_" is necessary
200 #define ASM_PFX(name) _##name