]>
Commit | Line | Data |
---|---|---|
1afe0401 A |
1 | /*++\r |
2 | \r | |
f57387d5 HT |
3 | Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>\r |
4 | This program and the accompanying materials \r | |
1afe0401 A |
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 IA-32.\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 | #define EFI_APPLICATION_ENTRY_POINT EFI_DRIVER_ENTRY_POINT\r | |
32 | \r | |
33 | \r | |
34 | //\r | |
35 | // Make sure we are useing the correct packing rules per EFI specification\r | |
36 | //\r | |
37 | #ifndef __GNUC__\r | |
38 | #pragma pack()\r | |
39 | #endif\r | |
40 | \r | |
41 | \r | |
42 | //\r | |
43 | // Assume standard IA-32 alignment. \r | |
44 | // BugBug: Need to check portability of long long\r | |
45 | //\r | |
46 | typedef unsigned long long uint64_t;\r | |
47 | typedef long long int64_t;\r | |
48 | typedef unsigned int uint32_t;\r | |
49 | typedef int int32_t;\r | |
50 | typedef unsigned short uint16_t;\r | |
51 | typedef short int16_t;\r | |
52 | typedef unsigned char uint8_t;\r | |
53 | typedef char int8_t;\r | |
54 | \r | |
55 | //\r | |
56 | // Native integer size in stdint.h\r | |
57 | //\r | |
58 | typedef uint32_t uintn_t;\r | |
59 | typedef int32_t intn_t;\r | |
60 | \r | |
61 | //\r | |
62 | // Processor specific defines\r | |
63 | //\r | |
64 | #define EFI_MAX_BIT 0x80000000\r | |
65 | #define MAX_2_BITS 0xC0000000\r | |
66 | \r | |
67 | //\r | |
68 | // Maximum legal IA-32 address\r | |
69 | //\r | |
70 | #define EFI_MAX_ADDRESS 0xFFFFFFFF\r | |
71 | \r | |
72 | //\r | |
73 | // Bad pointer value to use in check builds.\r | |
74 | // if you see this value you are using uninitialized or free'ed data\r | |
75 | //\r | |
76 | #define EFI_BAD_POINTER 0xAFAFAFAF\r | |
77 | #define EFI_BAD_POINTER_AS_BYTE 0xAF\r | |
78 | \r | |
79 | #define EFI_DEADLOOP() { volatile UINTN __iii; __iii = 1; while (__iii); }\r | |
80 | \r | |
81 | //\r | |
82 | // Inject a break point in the code to assist debugging for NT Emulation Environment\r | |
83 | // For real hardware, just put in a halt loop. Don't do a while(1) because the\r | |
84 | // compiler will optimize away the rest of the function following, so that you run out in\r | |
85 | // the weeds if you skip over it with a debugger.\r | |
86 | //\r | |
87 | #define EFI_BREAKPOINT EFI_DEADLOOP()\r | |
88 | \r | |
89 | \r | |
90 | //\r | |
91 | // Memory Fence forces serialization, and is needed to support out of order\r | |
92 | // memory transactions. The Memory Fence is mainly used to make sure IO\r | |
93 | // transactions complete in a deterministic sequence, and to syncronize locks\r | |
94 | // an other MP code. Currently no memory fencing is required.\r | |
95 | //\r | |
96 | #define MEMORY_FENCE()\r | |
97 | \r | |
98 | //\r | |
99 | // Some compilers don't support the forward reference construct:\r | |
100 | // typedef struct XXXXX. The forward reference is required for \r | |
101 | // ANSI compatibility.\r | |
102 | //\r | |
103 | // The following macro provide a workaround for such cases.\r | |
104 | //\r | |
105 | \r | |
106 | \r | |
107 | #ifdef EFI_NO_INTERFACE_DECL\r | |
108 | #define EFI_FORWARD_DECLARATION(x)\r | |
109 | #else\r | |
110 | #define EFI_FORWARD_DECLARATION(x) typedef struct _##x x\r | |
111 | #endif\r | |
112 | \r | |
113 | \r | |
114 | //\r | |
115 | // Some C compilers optimize the calling conventions to increase performance.\r | |
116 | // _EFIAPI is used to make all public APIs follow the standard C calling \r | |
117 | // convention.\r | |
118 | //\r | |
119 | #define _EFIAPI \r | |
120 | \r | |
121 | \r | |
122 | \r | |
123 | //\r | |
124 | // For symbol name in GNU assembly code, an extra "_" is necessary\r | |
125 | //\r | |
126 | #if defined(__GNUC__)\r | |
127 | ///\r | |
128 | /// Private worker functions for ASM_PFX()\r | |
129 | ///\r | |
130 | #define _CONCATENATE(a, b) __CONCATENATE(a, b)\r | |
131 | #define __CONCATENATE(a, b) a ## b\r | |
132 | \r | |
133 | ///\r | |
134 | /// The __USER_LABEL_PREFIX__ macro predefined by GNUC represents the prefix\r | |
135 | /// on symbols in assembly language.\r | |
136 | ///\r | |
137 | #define ASM_PFX(name) _CONCATENATE (__USER_LABEL_PREFIX__, name)\r | |
138 | \r | |
139 | #endif\r | |
140 | \r | |
141 | #endif\r | |
142 | \r |