]>
Commit | Line | Data |
---|---|---|
3eb9473e | 1 | /*++\r |
2 | \r | |
3 | Copyright (c) 2004 - 2006, Intel Corporation \r | |
4 | All rights reserved. This program and the accompanying materials \r | |
5 | are licensed and made available under the terms and conditions of the BSD License \r | |
6 | which accompanies this distribution. The full text of the license may be found at \r | |
7 | http://opensource.org/licenses/bsd-license.php \r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
11 | \r | |
12 | Module Name:\r | |
13 | \r | |
14 | EfiBind.h\r | |
15 | \r | |
16 | Abstract:\r | |
17 | \r | |
18 | Processor or compiler specific defines and types for EBC.\r | |
19 | \r | |
20 | --*/\r | |
21 | \r | |
22 | #ifndef _EFI_BIND_H_\r | |
23 | #define _EFI_BIND_H_\r | |
24 | \r | |
25 | #define EFI_DRIVER_ENTRY_POINT(InitFunction)\r | |
26 | #define EFI_APPLICATION_ENTRY_POINT EFI_DRIVER_ENTRY_POINT\r | |
27 | \r | |
28 | //\r | |
29 | // Disable warning that make it impossible to compile at /W3\r | |
30 | // This only works for Intel EBC Compiler tools\r | |
31 | //\r | |
32 | \r | |
33 | //\r | |
34 | // Disabling argument of type "TYPE **" is incompatible with parameter of type "void **"\r | |
35 | //\r | |
36 | #pragma warning ( disable : 167 )\r | |
37 | \r | |
38 | //\r | |
39 | // Disabling pointless comparison of unsigned integer with zero\r | |
40 | //\r | |
41 | #pragma warning ( disable : 186 )\r | |
42 | \r | |
43 | //\r | |
44 | // Disabling enumerated type mixed with another type\r | |
45 | //\r | |
46 | #pragma warning ( disable : 188 )\r | |
47 | \r | |
48 | //\r | |
49 | // Native integer types\r | |
50 | //\r | |
51 | typedef char int8_t;\r | |
52 | typedef unsigned char uint8_t;\r | |
53 | \r | |
54 | typedef short int16_t;\r | |
55 | typedef unsigned short uint16_t;\r | |
56 | \r | |
57 | typedef int int32_t;\r | |
58 | typedef unsigned int uint32_t;\r | |
59 | \r | |
60 | typedef __int64 int64_t;\r | |
61 | typedef unsigned __int64 uint64_t;\r | |
62 | \r | |
63 | //\r | |
64 | // "long" type scales to the processor native size with EBC compiler\r | |
65 | //\r | |
66 | typedef long intn_t;\r | |
67 | typedef unsigned long uintn_t;\r | |
68 | \r | |
69 | //\r | |
70 | // Scalable macro to set the most significant bit in a natural number\r | |
71 | //\r | |
72 | #define EFI_MAX_BIT ((UINTN)0x01 << ((sizeof (char *) * 8) - 1))\r | |
73 | #define MAX_2_BITS (EFI_MAX_BIT | (EFI_MAX_BIT >> 1))\r | |
74 | \r | |
75 | //\r | |
76 | // Maximum legal EBC address\r | |
77 | //\r | |
78 | #define EFI_MAX_ADDRESS (UINTN)~0\r | |
79 | \r | |
80 | //\r | |
81 | // Bad pointer value to use in check builds.\r | |
82 | // if you see this value you are using uninitialized or free'ed data\r | |
83 | //\r | |
84 | #define EFI_BAD_POINTER (UINTN)0xAFAFAFAFAFAFAFAF\r | |
85 | #define EFI_BAD_POINTER_AS_BYTE (UINTN)0xAF\r | |
86 | \r | |
87 | //\r | |
88 | // _break() is an EBC compiler intrinsic function\r | |
89 | //\r | |
90 | extern \r | |
91 | uint64_t \r | |
92 | _break (\r | |
93 | unsigned char BreakCode\r | |
94 | );\r | |
95 | \r | |
96 | //\r | |
97 | // Macro to inject a break point in the code to assist debugging.\r | |
98 | //\r | |
99 | #define EFI_BREAKPOINT() _break ( 3 )\r | |
100 | #define EFI_DEADLOOP() while (TRUE)\r | |
101 | \r | |
102 | //\r | |
103 | // Memory Fence forces serialization, and is needed to support out of order\r | |
104 | // memory transactions. The Memory Fence is mainly used to make sure IO\r | |
105 | // transactions complete in a deterministic sequence, and to syncronize locks\r | |
106 | // an other MP code. Currently no memory fencing is required.\r | |
107 | //\r | |
108 | #define MEMORY_FENCE()\r | |
109 | \r | |
110 | //\r | |
111 | // Some compilers don't support the forward reference construct:\r | |
112 | // typedef struct XXXXX. The forward reference is required for \r | |
113 | // ANSI compatibility.\r | |
114 | //\r | |
115 | // The following macro provide a workaround for such cases.\r | |
116 | //\r | |
117 | \r | |
118 | \r | |
119 | #ifdef EFI_NO_INTERFACE_DECL\r | |
120 | #define EFI_FORWARD_DECLARATION(x)\r | |
121 | #else\r | |
122 | #define EFI_FORWARD_DECLARATION(x) typedef struct _##x x\r | |
123 | #endif\r | |
124 | \r | |
125 | \r | |
126 | #define _EFIAPI \r | |
127 | \r | |
128 | #endif // ifndef _EFI_BIND_H_\r | |
129 | \r |