]> git.proxmox.com Git - mirror_edk2.git/blame - EdkCompatibilityPkg/Foundation/Include/Ipf/EfiBind.h
Update the copyright notice format
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Include / Ipf / EfiBind.h
CommitLineData
3eb9473e 1/*++\r
2\r
f57387d5
HT
3Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR>\r
4This program and the accompanying materials \r
3eb9473e 5are licensed and made available under the terms and conditions of the BSD License \r
6which accompanies this distribution. The full text of the license may be found at \r
7http://opensource.org/licenses/bsd-license.php \r
8 \r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11\r
12Module Name:\r
13\r
14 EfiBind.h\r
15\r
16Abstract:\r
17\r
18 Processor or Compiler specific defines and types for Intel Itanium(TM).\r
19 We are using the ANSI C 2000 _t type definitions for basic types.\r
20 This it technically a violation of the coding standard, but they\r
21 are used to make EfiTypes.h portable. Code other than EfiTypes.h\r
22 should never use any ANSI C 2000 _t integer types.\r
23\r
24--*/\r
25\r
26#ifndef _EFI_BIND_H_\r
27#define _EFI_BIND_H_\r
28\r
29\r
30#define EFI_DRIVER_ENTRY_POINT(InitFunction) \r
31\r
32#define EFI_APPLICATION_ENTRY_POINT EFI_DRIVER_ENTRY_POINT\r
33\r
aa274d2a 34#define ECP_CPU_IPF\r
3eb9473e 35\r
36\r
37//\r
38// Make sure we are useing the correct packing rules per EFI specification\r
39//\r
40#pragma pack()\r
41\r
42\r
43#if _MSC_EXTENSIONS \r
1bfbd131 44\r
45#if __INTEL_COMPILER\r
46\r
47//\r
48// Disable the extra ";" warning;\r
49// All places referencing EFI_GUID_STRING MACRO will generate this error.\r
50//\r
51#pragma warning ( disable : 424 )\r
52\r
53//\r
54// error #593: variable "Status" was set but never used\r
55// This error may be flagged if a function only do ASSERT on return status when \r
56// EFI_DEBUG is not defined (EDK's ASSERT will be defined as empty statement).\r
57// To make EdkCompatibilityPkg buildable by ICC with EFI_DEBUG undefined, disable\r
58// this warning.\r
59//\r
60#pragma warning ( disable : 593 )\r
61\r
62//\r
63// Disable ICC's remark #869: "Parameter" was never referenced warning.\r
64// This is legal ANSI C code so we disable the remark that is turned on with -Wall\r
65//\r
66#pragma warning ( disable : 869 )\r
67\r
68//\r
69// Disable ICC's remark #1418: external function definition with no prior declaration.\r
70// This is legal ANSI C code so we disable the remark that is turned on with /W4\r
71//\r
72#pragma warning ( disable : 1418 )\r
73\r
74//\r
75// Disable ICC's remark #1419: external declaration in primary source file\r
76// This is legal ANSI C code so we disable the remark that is turned on with /W4\r
77//\r
78#pragma warning ( disable : 1419 )\r
79\r
59a7e4f4 80//\r
81// Disable ICC's remark #869: "Parameter" was never referenced warning.\r
82// This is legal ANSI C code so we disable the remark that is turned on with -Wall\r
83//\r
84#pragma warning ( disable : 869 )\r
85\r
1bfbd131 86#endif\r
87\r
88\r
3eb9473e 89 \r
90//\r
91// Disable warning that make it impossible to compile at /W4\r
92// This only works for Microsoft tools. Copied from the \r
93// IA-32 version of efibind.h\r
94//\r
95\r
96//\r
97// Disabling bitfield type checking warnings.\r
98//\r
99#pragma warning ( disable : 4214 )\r
100\r
101\r
102// Disabling the unreferenced formal parameter warnings.\r
103//\r
104#pragma warning ( disable : 4100 )\r
105\r
106//\r
107// Disable slightly different base types warning as CHAR8 * can not be set\r
108// to a constant string.\r
109//\r
110#pragma warning ( disable : 4057 )\r
111\r
112//\r
113// ASSERT(FALSE) or while (TRUE) are legal constructes so supress this warning\r
114//\r
115#pragma warning ( disable : 4127 )\r
116\r
117//\r
118// Can not cast a function pointer to a data pointer. We need to do this on \r
119// IPF to get access to the PLABEL.\r
120//\r
121#pragma warning ( disable : 4514 )\r
122\r
123//\r
124// Int64ShllMod32 unreferenced inline function\r
125//\r
126#pragma warning ( disable : 4054 )\r
127\r
128//\r
129// Unreferenced formal parameter - We are object oriented, so we pass This even\r
130// if we don't need them.\r
131//\r
132#pragma warning ( disable : 4100 )\r
133\r
134//\r
135// This warning is caused by empty (after preprocessing) souce file.\r
136//\r
137#pragma warning ( disable : 4206 )\r
138\r
139//\r
140// Warning: The result of the unary '&' operator may be unaligned. Ignore it.\r
141//\r
142#pragma warning ( disable : 4366 )\r
143\r
144#endif\r
145\r
146\r
147#if (__STDC_VERSION__ < 199901L)\r
148 //\r
149 // No ANSI C 2000 stdint.h integer width declarations, so define equivalents\r
150 //\r
151 \r
152 #if _MSC_EXTENSIONS \r
153 \r
154\r
155 //\r
156 // use Microsoft C complier dependent interger width types \r
157 //\r
158 typedef unsigned __int64 uint64_t;\r
159 typedef __int64 int64_t;\r
160 typedef unsigned __int32 uint32_t;\r
161 typedef __int32 int32_t;\r
162 typedef unsigned short uint16_t;\r
163 typedef short int16_t;\r
164 typedef unsigned char uint8_t;\r
165 typedef char int8_t;\r
166 #else\r
167 #ifdef _EFI_P64 \r
168 //\r
169 // P64 - is Intel Itanium(TM) speak for pointers being 64-bit and longs and ints \r
170 // are 32-bits\r
171 //\r
172 typedef unsigned long long uint64_t;\r
173 typedef long long int64_t;\r
174 typedef unsigned int uint32_t;\r
175 typedef int int32_t;\r
176 typedef unsigned short uint16_t;\r
177 typedef short int16_t;\r
178 typedef unsigned char uint8_t;\r
179 typedef char int8_t;\r
180 #else\r
181 //\r
182 // Assume LP64 - longs and pointers are 64-bit. Ints are 32-bit.\r
183 //\r
184 typedef unsigned long uint64_t;\r
185 typedef long int64_t;\r
186 typedef unsigned int uint32_t;\r
187 typedef int int32_t;\r
188 typedef unsigned short uint16_t;\r
189 typedef short int16_t;\r
190 typedef unsigned char uint8_t;\r
191 typedef char int8_t;\r
192 #endif\r
193 #endif\r
194#else\r
195 //\r
196 // Use ANSI C 2000 stdint.h integer width declarations\r
197 //\r
198 #include "stdint.h"\r
199#endif\r
200\r
201//\r
202// Native integer size in stdint.h\r
203//\r
204typedef uint64_t uintn_t;\r
205typedef int64_t intn_t;\r
206\r
207//\r
208// Processor specific defines\r
209//\r
210#define EFI_MAX_BIT 0x8000000000000000\r
211#define MAX_2_BITS 0xC000000000000000\r
212\r
213//\r
214// Maximum legal Itanium-based address\r
215//\r
216#define EFI_MAX_ADDRESS 0xFFFFFFFFFFFFFFFF\r
217\r
218//\r
219// Bad pointer value to use in check builds.\r
220// if you see this value you are using uninitialized or free'ed data\r
221//\r
222#define EFI_BAD_POINTER 0xAFAFAFAFAFAFAFAF\r
223#define EFI_BAD_POINTER_AS_BYTE 0xAF\r
224\r
aa274d2a 225#define EFI_DEADLOOP() while(TRUE)\r
226\r
227#ifdef __GNUC__\r
228#define EFI_BREAKPOINT EcpEfiBreakPoint\r
229#define MEMORY_FENCE EcpMemoryFence\r
230#else\r
3eb9473e 231//\r
232// Inject a break point in the code to assist debugging.\r
233//\r
234#pragma intrinsic (__break) \r
235#define EFI_BREAKPOINT() __break(0)\r
236#define EFI_DEADLOOP() while(TRUE)\r
237\r
238//\r
239// Memory Fence forces serialization, and is needed to support out of order\r
240// memory transactions. The Memory Fence is mainly used to make sure IO\r
241// transactions complete in a deterministic sequence, and to syncronize locks\r
242// an other MP code. Intel Itanium(TM) processors require explicit memory fence instructions\r
243// after every IO. Need to find a way of doing that in the function _mf.\r
244//\r
245void __mfa (void); \r
246#pragma intrinsic (__mfa) \r
247#define MEMORY_FENCE() __mfa()\r
aa274d2a 248#endif\r
3eb9473e 249\r
250\r
251//\r
252// Some compilers don't support the forward reference construct:\r
253// typedef struct XXXXX. The forward reference is required for \r
254// ANSI compatibility.\r
255//\r
256// The following macro provide a workaround for such cases.\r
257//\r
258\r
259\r
260#ifdef EFI_NO_INTERFACE_DECL\r
261 #define EFI_FORWARD_DECLARATION(x)\r
262#else\r
263 #define EFI_FORWARD_DECLARATION(x) typedef struct _##x x\r
264#endif\r
265\r
266//\r
267// Some C compilers optimize the calling conventions to increase performance.\r
268// _EFIAPI is used to make all public APIs follow the standard C calling \r
269// convention.\r
270//\r
271\r
272#if _MSC_EXTENSIONS \r
273 #define _EFIAPI __cdecl \r
274#else\r
275 #define _EFIAPI \r
276#endif\r
277\r
278\r
279#ifdef _EFI_WINNT\r
280\r
281 #define EFI_SUPPRESS_BENIGN_REDEFINITION_OF_TYPE_WARNING() \\r
282 warning ( disable : 4142 )\r
283\r
284 #define EFI_DEFAULT_BENIGN_REDEFINITION_OF_TYPE_WARNING() \\r
285 warning ( default : 4142 )\r
286#else\r
287\r
288 #define EFI_SUPPRESS_BENIGN_REDEFINITION_OF_TYPE_WARNING() \\r
289 warning ( disable : 4068 )\r
290\r
291 #define EFI_DEFAULT_BENIGN_REDEFINITION_OF_TYPE_WARNING() \\r
292 warning ( default : 4068 )\r
293\r
294\r
295#endif\r
296\r
297\r
298#endif\r
299\r