+++ /dev/null
-/*++\r
-\r
-Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials \r
-are licensed and made available under the terms and conditions of the BSD License \r
-which accompanies this distribution. The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
-\r
-Module Name:\r
-\r
- EfiBind.h\r
-\r
-Abstract:\r
-\r
- Processor or Compiler specific defines and types for IA-32.\r
- We are using the ANSI C 2000 _t type definitions for basic types.\r
- This it technically a violation of the coding standard, but they\r
- are used to make EfiTypes.h portable. Code other than EfiTypes.h\r
- should never use any ANSI C 2000 _t integer types.\r
-\r
---*/\r
-\r
-#ifndef _EFI_BIND_H_\r
-#define _EFI_BIND_H_\r
-\r
-#ifdef EFI_DEBUG\r
-\r
-#ifdef EFI_NT_EMULATOR\r
-\r
-#define EFI_DRIVER_ENTRY_POINT(InitFunction) \\r
- EFI_STATUS \\r
- EFIAPI \\r
- InitFunction ( \\r
- EFI_HANDLE ImageHandle, \\r
- EFI_SYSTEM_TABLE *SystemTable \\r
- ); \\r
- \\r
- UINTN \\r
- __stdcall \\r
- _DllMainCRTStartup ( \\r
- UINTN Inst, \\r
- UINTN reason_for_call, \\r
- VOID *rserved \\r
- ) \\r
- { \\r
- return 1; \\r
- } \\r
- \\r
- EFI_STATUS \\r
- __declspec( dllexport ) \\r
- __cdecl \\r
- InitializeDriver ( \\r
- EFI_HANDLE ImageHandle, \\r
- EFI_SYSTEM_TABLE *SystemTable \\r
- ) \\r
- { \\r
- return InitFunction(ImageHandle, SystemTable); \\r
- }\r
-\r
-#define EFI_APPLICATION_ENTRY_POINT EFI_DRIVER_ENTRY_POINT\r
-\r
-#else\r
-\r
-#define EFI_DRIVER_ENTRY_POINT(InitFunction) \r
-#define EFI_APPLICATION_ENTRY_POINT EFI_DRIVER_ENTRY_POINT\r
-\r
-#endif\r
-\r
-#else\r
-\r
-#define EFI_DRIVER_ENTRY_POINT(InitFunction) \r
-#define EFI_APPLICATION_ENTRY_POINT EFI_DRIVER_ENTRY_POINT\r
-\r
-#endif\r
-\r
-\r
-\r
-\r
-\r
-//\r
-// Make sure we are useing the correct packing rules per EFI specification\r
-//\r
-#ifndef __GNUC__\r
-#pragma pack()\r
-#endif\r
-\r
-#if __INTEL_COMPILER\r
-//\r
-// Disable ICC's warning: trailing comma is nonstandard\r
-//\r
-//#pragma warning ( disable : 271 )\r
-\r
-//\r
-// Disable ICC's warning: extra ";" ignored\r
-//\r
-#pragma warning ( disable : 424 )\r
-\r
-//\r
-// Disable ICC's warning: : variable "foo" was set but never used\r
-//\r
-#pragma warning ( disable : 593 )\r
-\r
-//\r
-// Disable ICC's remark #1418: external function definition with no prior declaration.\r
-// This is legal ANSI C code so we disable the remark that is turned on with /W4\r
-//\r
-#pragma warning ( disable : 1418 )\r
-\r
-\r
-//\r
-// Disable ICC's remark #1419: external declaration in primary source file\r
-// This is legal ANSI C code so we disable the remark that is turned on with /W4\r
-//\r
-#pragma warning ( disable : 1419 )\r
-\r
-//\r
-// Disable ICC's remark #869: "Parameter" was never referenced warning.\r
-// This is legal ANSI C code so we disable the remark that is turned on with -Wall\r
-//\r
-#pragma warning ( disable : 869 )\r
-\r
-#endif\r
-\r
-\r
-#if _MSC_EXTENSIONS\r
-\r
-//\r
-// Disable warning that make it impossible to compile at /W4\r
-// This only works for Microsoft* tools\r
-//\r
-\r
-//\r
-// Disabling bitfield type checking warnings.\r
-//\r
-#pragma warning ( disable : 4214 )\r
-\r
-//\r
-// Disabling the unreferenced formal parameter warnings.\r
-//\r
-#pragma warning ( disable : 4100 )\r
-\r
-//\r
-// Disable slightly different base types warning as CHAR8 * can not be set\r
-// to a constant string.\r
-//\r
-#pragma warning ( disable : 4057 )\r
-\r
-//\r
-// ASSERT(FALSE) or while (TRUE) are legal constructes so supress this warning\r
-//\r
-#pragma warning ( disable : 4127 )\r
-\r
-//\r
-// Int64ShllMod32 unreferenced inline function\r
-//\r
-#pragma warning ( disable : 4514 )\r
-\r
-//\r
-// Unreferenced formal parameter - We are object oriented, so we pass This even\r
-// if we don't need them.\r
-//\r
-#pragma warning ( disable : 4100 )\r
-\r
-//\r
-// This warning is caused by empty (after preprocessing) souce file.\r
-//\r
-#pragma warning ( disable : 4206 )\r
-\r
-\r
-#endif\r
-\r
-\r
-#if defined(_MSC_EXTENSIONS)\r
-\r
- //\r
- // use Microsoft C complier dependent integer width types \r
- //\r
-\r
- typedef unsigned __int64 uint64_t;\r
- typedef __int64 int64_t;\r
- typedef unsigned __int32 uint32_t;\r
- typedef __int32 int32_t;\r
- typedef unsigned short uint16_t;\r
- typedef short int16_t;\r
- typedef unsigned char uint8_t;\r
- typedef signed char int8_t;\r
-#else \r
- typedef unsigned long long uint64_t;\r
- typedef long long int64_t;\r
- typedef unsigned int uint32_t;\r
- typedef int int32_t;\r
- typedef unsigned short uint16_t;\r
- typedef short int16_t;\r
- typedef unsigned char uint8_t;\r
- typedef signed char int8_t;\r
-#endif\r
-\r
-//\r
-// Native integer size in stdint.h\r
-//\r
-typedef uint32_t uintn_t;\r
-typedef int32_t intn_t;\r
-\r
-//\r
-// Processor specific defines\r
-//\r
-#define EFI_MAX_BIT 0x80000000\r
-#define MAX_2_BITS 0xC0000000\r
-\r
-//\r
-// Maximum legal IA-32 address\r
-//\r
-#define EFI_MAX_ADDRESS 0xFFFFFFFF\r
-\r
-//\r
-// Bad pointer value to use in check builds.\r
-// if you see this value you are using uninitialized or free'ed data\r
-//\r
-#define EFI_BAD_POINTER 0xAFAFAFAF\r
-#define EFI_BAD_POINTER_AS_BYTE 0xAF\r
-\r
-//\r
-// Inject a break point in the code to assist debugging for NT Emulation Environment\r
-// For real hardware, just put in a halt loop. Don't do a while(1) because the\r
-// compiler will optimize away the rest of the function following, so that you run out in\r
-// the weeds if you skip over it with a debugger.\r
-//\r
-#ifdef _MSC_EXTENSIONS\r
-#define EFI_BREAKPOINT() __asm { int 3 }\r
-#elif __GNUC__\r
-#define EFI_BREAKPOINT() asm(" int $3");\r
-#endif\r
-\r
-#define EFI_DEADLOOP() { volatile UINTN __iii; __iii = 1; while (__iii); }\r
-\r
-//\r
-// Memory Fence forces serialization, and is needed to support out of order\r
-// memory transactions. The Memory Fence is mainly used to make sure IO\r
-// transactions complete in a deterministic sequence, and to syncronize locks\r
-// an other MP code. Currently no memory fencing is required.\r
-//\r
-#define MEMORY_FENCE()\r
-\r
-//\r
-// Some compilers don't support the forward reference construct:\r
-// typedef struct XXXXX. The forward reference is required for \r
-// ANSI compatibility.\r
-//\r
-// The following macro provide a workaround for such cases.\r
-//\r
-\r
-\r
-#ifdef EFI_NO_INTERFACE_DECL\r
- #define EFI_FORWARD_DECLARATION(x)\r
-#else\r
- #define EFI_FORWARD_DECLARATION(x) typedef struct _##x x\r
-#endif\r
-\r
-\r
-//\r
-// Some C compilers optimize the calling conventions to increase performance.\r
-// _EFIAPI is used to make all public APIs follow the standard C calling \r
-// convention.\r
-//\r
-#if _MSC_EXTENSIONS\r
- //\r
- // Microsoft* compiler requires _EFIAPI useage, __cdecl is Microsoft* specific C.\r
- // \r
-\r
- #define _EFIAPI __cdecl \r
-#else\r
- #define _EFIAPI \r
-#endif\r
-\r
-\r
-#ifdef _EFI_WINNT\r
-\r
- #define EFI_SUPPRESS_BENIGN_REDEFINITION_OF_TYPE_WARNING() \\r
- warning ( disable : 4142 )\r
-\r
- #define EFI_DEFAULT_BENIGN_REDEFINITION_OF_TYPE_WARNING() \\r
- warning ( default : 4142 )\r
-#else\r
-\r
- #define EFI_SUPPRESS_BENIGN_REDEFINITION_OF_TYPE_WARNING() \\r
- warning ( disable : 4068 )\r
-\r
- #define EFI_DEFAULT_BENIGN_REDEFINITION_OF_TYPE_WARNING() \\r
- warning ( default : 4068 )\r
-\r
-#endif\r
-\r
-//\r
-// For symbol name in GNU assembly code, an extra "_" is necessary\r
-//\r
-#if defined(__GNUC__)\r
- ///\r
- /// Private worker functions for ASM_PFX()\r
- ///\r
- #define _CONCATENATE(a, b) __CONCATENATE(a, b)\r
- #define __CONCATENATE(a, b) a ## b\r
-\r
- ///\r
- /// The __USER_LABEL_PREFIX__ macro predefined by GNUC represents the prefix\r
- /// on symbols in assembly language.\r
- ///\r
- #define ASM_PFX(name) _CONCATENATE (__USER_LABEL_PREFIX__, name)\r
-\r
-#endif\r
-\r
-#endif\r
-\r