]>
git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Foundation/Include/Ipf/EfiBind.h
3 Copyright (c) 2004 - 2007, 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 Intel Itanium(TM).
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)
32 #define EFI_APPLICATION_ENTRY_POINT EFI_DRIVER_ENTRY_POINT
38 // Make sure we are useing the correct packing rules per EFI specification
46 // Disable warning that make it impossible to compile at /W4
47 // This only works for Microsoft tools. Copied from the
48 // IA-32 version of efibind.h
52 // Disabling bitfield type checking warnings.
54 #pragma warning ( disable : 4214 )
57 // Disabling the unreferenced formal parameter warnings.
59 #pragma warning ( disable : 4100 )
62 // Disable slightly different base types warning as CHAR8 * can not be set
63 // to a constant string.
65 #pragma warning ( disable : 4057 )
68 // ASSERT(FALSE) or while (TRUE) are legal constructes so supress this warning
70 #pragma warning ( disable : 4127 )
73 // Can not cast a function pointer to a data pointer. We need to do this on
74 // IPF to get access to the PLABEL.
76 #pragma warning ( disable : 4514 )
79 // Int64ShllMod32 unreferenced inline function
81 #pragma warning ( disable : 4054 )
84 // Unreferenced formal parameter - We are object oriented, so we pass This even
85 // if we don't need them.
87 #pragma warning ( disable : 4100 )
90 // This warning is caused by empty (after preprocessing) souce file.
92 #pragma warning ( disable : 4206 )
95 // Warning: The result of the unary '&' operator may be unaligned. Ignore it.
97 #pragma warning ( disable : 4366 )
102 #if (__STDC_VERSION__ < 199901L)
104 // No ANSI C 2000 stdint.h integer width declarations, so define equivalents
111 // use Microsoft C complier dependent interger width types
113 typedef unsigned __int64
uint64_t;
114 typedef __int64
int64_t;
115 typedef unsigned __int32
uint32_t;
116 typedef __int32
int32_t;
117 typedef unsigned short uint16_t;
118 typedef short int16_t;
119 typedef unsigned char uint8_t;
124 // P64 - is Intel Itanium(TM) speak for pointers being 64-bit and longs and ints
127 typedef unsigned long long uint64_t;
128 typedef long long int64_t;
129 typedef unsigned int uint32_t;
131 typedef unsigned short uint16_t;
132 typedef short int16_t;
133 typedef unsigned char uint8_t;
137 // Assume LP64 - longs and pointers are 64-bit. Ints are 32-bit.
139 typedef unsigned long uint64_t;
140 typedef long int64_t;
141 typedef unsigned int uint32_t;
143 typedef unsigned short uint16_t;
144 typedef short int16_t;
145 typedef unsigned char uint8_t;
151 // Use ANSI C 2000 stdint.h integer width declarations
157 // Native integer size in stdint.h
159 typedef uint64_t uintn_t
;
160 typedef int64_t intn_t
;
163 // Processor specific defines
165 #define EFI_MAX_BIT 0x8000000000000000
166 #define MAX_2_BITS 0xC000000000000000
169 // Maximum legal Itanium-based address
171 #define EFI_MAX_ADDRESS 0xFFFFFFFFFFFFFFFF
174 // Bad pointer value to use in check builds.
175 // if you see this value you are using uninitialized or free'ed data
177 #define EFI_BAD_POINTER 0xAFAFAFAFAFAFAFAF
178 #define EFI_BAD_POINTER_AS_BYTE 0xAF
181 // Inject a break point in the code to assist debugging.
183 #pragma intrinsic (__break)
184 #define EFI_BREAKPOINT() __break(0)
185 #define EFI_DEADLOOP() while(TRUE)
188 // Memory Fence forces serialization, and is needed to support out of order
189 // memory transactions. The Memory Fence is mainly used to make sure IO
190 // transactions complete in a deterministic sequence, and to syncronize locks
191 // an other MP code. Intel Itanium(TM) processors require explicit memory fence instructions
192 // after every IO. Need to find a way of doing that in the function _mf.
195 #pragma intrinsic (__mfa)
196 #define MEMORY_FENCE() __mfa()
200 // Some compilers don't support the forward reference construct:
201 // typedef struct XXXXX. The forward reference is required for
202 // ANSI compatibility.
204 // The following macro provide a workaround for such cases.
208 #ifdef EFI_NO_INTERFACE_DECL
209 #define EFI_FORWARD_DECLARATION(x)
211 #define EFI_FORWARD_DECLARATION(x) typedef struct _##x x
215 // Some C compilers optimize the calling conventions to increase performance.
216 // _EFIAPI is used to make all public APIs follow the standard C calling
221 #define _EFIAPI __cdecl
229 #define EFI_SUPPRESS_BENIGN_REDEFINITION_OF_TYPE_WARNING() \
230 warning ( disable : 4142 )
232 #define EFI_DEFAULT_BENIGN_REDEFINITION_OF_TYPE_WARNING() \
233 warning ( default : 4142 )
236 #define EFI_SUPPRESS_BENIGN_REDEFINITION_OF_TYPE_WARNING() \
237 warning ( disable : 4068 )
239 #define EFI_DEFAULT_BENIGN_REDEFINITION_OF_TYPE_WARNING() \
240 warning ( default : 4068 )