]>
git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Foundation/Include/X64/EfiBind.h
3 Copyright (c) 2005 - 2008, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 Processor or Compiler specific defines and types for x64.
19 We are using the ANSI C 2000 _t type definitions for basic types.
20 This it technically a violation of the coding standard, but they
21 are used to make EfiTypes.h portable. Code other than EfiTypes.h
22 should never use any ANSI C 2000 _t integer types.
30 #define EFI_DRIVER_ENTRY_POINT(InitFunction)
31 #define EFI_APPLICATION_ENTRY_POINT EFI_DRIVER_ENTRY_POINT
36 // Make sure we are useing the correct packing rules per EFI specification
42 // Disable ICC's warning: trailing comma is nonstandard
44 //#pragma warning ( disable : 271 )
47 // Disable ICC's warning: extra ";" ignored
49 #pragma warning ( disable : 424 )
52 // Disable ICC's warning: : variable "foo" was set but never used
54 #pragma warning ( disable : 593 )
57 // Disable ICC's remark #1418: external function definition with no prior declaration.
58 // This is legal ANSI C code so we disable the remark that is turned on with /W4
60 #pragma warning ( disable : 1418 )
64 // Disable ICC's remark #1419: external declaration in primary source file
65 // This is legal ANSI C code so we disable the remark that is turned on with /W4
67 #pragma warning ( disable : 1419 )
75 // Disable warning that make it impossible to compile at /W4
76 // This only works for Microsoft* tools
80 // Disabling bitfield type checking warnings.
82 #pragma warning ( disable : 4214 )
85 // Disabling the unreferenced formal parameter warnings.
87 #pragma warning ( disable : 4100 )
90 // Disable slightly different base types warning as CHAR8 * can not be set
91 // to a constant string.
93 #pragma warning ( disable : 4057 )
96 // ASSERT(FALSE) or while (TRUE) are legal constructes so supress this warning
98 #pragma warning ( disable : 4127 )
101 // Int64ShllMod32 unreferenced inline function
103 #pragma warning ( disable : 4514 )
106 // Unreferenced formal parameter - We are object oriented, so we pass This even
107 // if we don't need them.
109 #pragma warning ( disable : 4100 )
112 // This warning is caused by empty (after preprocessing) souce file.
114 #pragma warning ( disable : 4206 )
117 // Warning: The result of the unary '&' operator may be unaligned. Ignore it.
119 #pragma warning ( disable : 4366 )
124 #if !defined(__GNUC__) && (__STDC_VERSION__ < 199901L)
126 // No ANSI C 2000 stdint.h integer width declarations, so define equivalents
132 // use Microsoft* C complier dependent interger width types
134 typedef unsigned __int64
uint64_t;
135 typedef __int64
int64_t;
136 typedef unsigned __int32
uint32_t;
137 typedef __int32
int32_t;
138 typedef unsigned short uint16_t;
139 typedef short int16_t;
140 typedef unsigned char uint8_t;
145 // Assume standard IA-32 alignment.
146 // BugBug: Need to check portability of long long
148 typedef unsigned long long uint64_t;
149 typedef long long int64_t;
150 typedef unsigned int uint32_t;
152 typedef unsigned short uint16_t;
153 typedef short int16_t;
154 typedef unsigned char uint8_t;
159 // Use ANSI C 2000 stdint.h integer width declarations
165 // Native integer size in stdint.h
167 typedef uint64_t uintn_t
;
168 typedef int64_t intn_t
;
171 // Processor specific defines
173 #define EFI_MAX_BIT 0x8000000000000000ULL
174 #define MAX_2_BITS 0xC000000000000000ULL
177 // Maximum legal IA-32 address
179 #define EFI_MAX_ADDRESS 0xFFFFFFFFFFFFFFFFULL
182 // Bad pointer value to use in check builds.
183 // if you see this value you are using uninitialized or free'ed data
185 #define EFI_BAD_POINTER 0xAFAFAFAFAFAFAFAFULL
186 #define EFI_BAD_POINTER_AS_BYTE 0xAF
189 // Inject a break point in the code to assist debugging.
191 #define EFI_DEADLOOP() { volatile int __iii; __iii = 1; while (__iii); }
192 #define EFI_BREAKPOINT() __debugbreak()
195 // Memory Fence forces serialization, and is needed to support out of order
196 // memory transactions. The Memory Fence is mainly used to make sure IO
197 // transactions complete in a deterministic sequence, and to syncronize locks
198 // an other MP code. Currently no memory fencing is required.
200 #define MEMORY_FENCE()
203 // Some compilers don't support the forward reference construct:
204 // typedef struct XXXXX. The forward reference is required for
205 // ANSI compatibility.
207 // The following macro provide a workaround for such cases.
211 #ifdef EFI_NO_INTERFACE_DECL
212 #define EFI_FORWARD_DECLARATION(x)
214 #define EFI_FORWARD_DECLARATION(x) typedef struct _##x x
219 // Some C compilers optimize the calling conventions to increase performance.
220 // _EFIAPI is used to make all public APIs follow the standard C calling
225 // Microsoft* compiler requires _EFIAPI useage, __cdecl is Microsoft* specific C.
228 #define _EFIAPI __cdecl
236 #define EFI_SUPPRESS_BENIGN_REDEFINITION_OF_TYPE_WARNING() \
237 warning ( disable : 4142 )
239 #define EFI_DEFAULT_BENIGN_REDEFINITION_OF_TYPE_WARNING() \
240 warning ( default : 4142 )
243 #define EFI_SUPPRESS_BENIGN_REDEFINITION_OF_TYPE_WARNING() \
244 warning ( disable : 4068 )
246 #define EFI_DEFAULT_BENIGN_REDEFINITION_OF_TYPE_WARNING() \
247 warning ( default : 4068 )
252 // For symbol name in GNU assembly code, an extra "_" is necessary
256 #define ASM_PFX(name) name
258 #define ASM_PFX(name) _##name