]>
git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Foundation/Include/Ebc/EfiBind.h
3 Copyright (c) 2004 - 2006, 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 EBC.
25 #define EFI_DRIVER_ENTRY_POINT(InitFunction)
26 #define EFI_APPLICATION_ENTRY_POINT EFI_DRIVER_ENTRY_POINT
29 // Disable warning that make it impossible to compile at /W3
30 // This only works for Intel EBC Compiler tools
34 // Disabling argument of type "TYPE **" is incompatible with parameter of type "void **"
36 #pragma warning ( disable : 167 )
39 // Disabling pointless comparison of unsigned integer with zero
41 #pragma warning ( disable : 186 )
44 // Disabling enumerated type mixed with another type
46 #pragma warning ( disable : 188 )
49 // Native integer types
52 typedef unsigned char uint8_t;
54 typedef short int16_t;
55 typedef unsigned short uint16_t;
58 typedef unsigned int uint32_t;
60 typedef __int64
int64_t;
61 typedef unsigned __int64
uint64_t;
64 // "long" type scales to the processor native size with EBC compiler
67 typedef unsigned long uintn_t
;
70 // Scalable macro to set the most significant bit in a natural number
72 #define EFI_MAX_BIT ((UINTN)0x01 << ((sizeof (char *) * 8) - 1))
73 #define MAX_2_BITS (EFI_MAX_BIT | (EFI_MAX_BIT >> 1))
76 // Maximum legal EBC address
78 #define EFI_MAX_ADDRESS (UINTN)~0
81 // Bad pointer value to use in check builds.
82 // if you see this value you are using uninitialized or free'ed data
84 #define EFI_BAD_POINTER (UINTN)0xAFAFAFAFAFAFAFAF
85 #define EFI_BAD_POINTER_AS_BYTE (UINTN)0xAF
88 // _break() is an EBC compiler intrinsic function
93 unsigned char BreakCode
97 // Macro to inject a break point in the code to assist debugging.
99 #define EFI_BREAKPOINT() _break ( 3 )
100 #define EFI_DEADLOOP() while (TRUE)
103 // Memory Fence forces serialization, and is needed to support out of order
104 // memory transactions. The Memory Fence is mainly used to make sure IO
105 // transactions complete in a deterministic sequence, and to syncronize locks
106 // an other MP code. Currently no memory fencing is required.
108 #define MEMORY_FENCE()
111 // Some compilers don't support the forward reference construct:
112 // typedef struct XXXXX. The forward reference is required for
113 // ANSI compatibility.
115 // The following macro provide a workaround for such cases.
119 #ifdef EFI_NO_INTERFACE_DECL
120 #define EFI_FORWARD_DECLARATION(x)
122 #define EFI_FORWARD_DECLARATION(x) typedef struct _##x x
128 #endif // ifndef _EFI_BIND_H_