/*++12Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.34This program and the accompanying materials5are licensed and made available under the terms and conditions of the BSD License6which accompanies this distribution. The full text of the license may be found at7http://opensource.org/licenses/bsd-license.php89THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.1112Module Name:1314EfiBind.h1516Abstract:1718Processor or Compiler specific defines and types for IA-32.19We are using the ANSI C 2000 _t type definitions for basic types.20This it technically a violation of the coding standard, but they21are used to make EfiTypes.h portable. Code other than EfiTypes.h22should never use any ANSI C 2000 _t integer types.2324--*/2526#ifndef _EFI_BIND_H_27#define _EFI_BIND_H_282930#define EFI_DRIVER_ENTRY_POINT(InitFunction)31#define EFI_APPLICATION_ENTRY_POINT EFI_DRIVER_ENTRY_POINT323334//35// Make sure we are using the correct packing rules per EFI specification36//37#ifndef __GNUC__38#pragma pack()39#endif404142#define EFIERR(a) (0x80000000 | a)43#define EFI_ERROR_MASK 0x8000000044#define EFIERR_OEM(a) (0xc0000000 | a)4546//47// Processor specific defines48//49#define EFI_MAX_BIT 0x8000000050#define MAX_2_BITS 0xC00000005152//53// Maximum legal IA-32 address54//55#define EFI_MAX_ADDRESS 0xFFFFFFFF5657//58// Bad pointer value to use in check builds.59// if you see this value you are using uninitialized or free'ed data60//61#define EFI_BAD_POINTER 0xAFAFAFAF62#define EFI_BAD_POINTER_AS_BYTE 0xAF6364#define EFI_DEADLOOP() { volatile UINTN __iii; __iii = 1; while (__iii); }6566//67// Inject a break point in the code to assist debugging for NT Emulation Environment68// For real hardware, just put in a halt loop. Don't do a while(1) because the69// compiler will optimize away the rest of the function following, so that you run out in70// the weeds if you skip over it with a debugger.71//72#define EFI_BREAKPOINT EFI_DEADLOOP()737475//76// Memory Fence forces serialization, and is needed to support out of order77// memory transactions. The Memory Fence is mainly used to make sure IO78// transactions complete in a deterministic sequence, and to syncronize locks79// an other MP code. Currently no memory fencing is required.80//81#define MEMORY_FENCE()8283//84// Some compilers don't support the forward reference construct:85// typedef struct XXXXX. The forward reference is required for86// ANSI compatibility.87//88// The following macro provide a workaround for such cases.89//909192#ifdef EFI_NO_INTERFACE_DECL93#define EFI_FORWARD_DECLARATION(x)94#else95#define EFI_FORWARD_DECLARATION(x) typedef struct _##x x96#endif979899//100// Some C compilers optimize the calling conventions to increase performance.101// EFIAPI is used to make all public APIs follow the standard C calling102// convention.103//104#define EFIAPI105106107108//109// For symbol name in GNU assembly code, an extra "_" is necessary110//111#if defined(__GNUC__)112///113/// Private worker functions for ASM_PFX()114///115#define _CONCATENATE(a, b) __CONCATENATE(a, b)116#define __CONCATENATE(a, b) a ## b117118///119/// The __USER_LABEL_PREFIX__ macro predefined by GNUC represents the prefix120/// on symbols in assembly language.121///122#define ASM_PFX(name) _CONCATENATE (__USER_LABEL_PREFIX__, name)123124#endif125126#define INTERFACE_DECL(x) struct x127128#endif129130131