]>
Commit | Line | Data |
---|---|---|
1 | /** @file\r | |
2 | Processor or compiler specific defines and types for EBC.\r | |
3 | \r | |
4 | We currently only have one EBC compiler so there may be some Intel compiler\r | |
5 | specific functions in this file.\r | |
6 | \r | |
7 | Copyright (c) 2006 - 2009, Intel Corporation<BR> \r | |
8 | All rights reserved. This program and the accompanying materials \r | |
9 | are licensed and made available under the terms and conditions of the BSD License \r | |
10 | which accompanies this distribution. The full text of the license may be found at \r | |
11 | http://opensource.org/licenses/bsd-license.php \r | |
12 | \r | |
13 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
14 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
15 | \r | |
16 | **/\r | |
17 | \r | |
18 | #ifndef __PROCESSOR_BIND_H__\r | |
19 | #define __PROCESSOR_BIND_H__\r | |
20 | \r | |
21 | ///\r | |
22 | /// Define the processor type so other code can make processor based choices\r | |
23 | ///\r | |
24 | #define MDE_CPU_EBC\r | |
25 | \r | |
26 | //\r | |
27 | // Native integer types\r | |
28 | //\r | |
29 | \r | |
30 | ///\r | |
31 | /// 1-byte signed value\r | |
32 | ///\r | |
33 | typedef char INT8;\r | |
34 | ///\r | |
35 | /// Logical Boolean. 1-byte value containing 0 for FALSE or a 1 for TRUE. Other\r | |
36 | /// values are undefined.\r | |
37 | ///\r | |
38 | typedef unsigned char BOOLEAN;\r | |
39 | ///\r | |
40 | /// 1-byte unsigned value\r | |
41 | ///\r | |
42 | typedef unsigned char UINT8;\r | |
43 | ///\r | |
44 | /// 1-byte Character\r | |
45 | ///\r | |
46 | typedef char CHAR8;\r | |
47 | ///\r | |
48 | /// 2-byte signed value\r | |
49 | ///\r | |
50 | typedef short INT16;\r | |
51 | ///\r | |
52 | /// 2-byte unsigned value\r | |
53 | ///\r | |
54 | typedef unsigned short UINT16;\r | |
55 | ///\r | |
56 | /// 2-byte Character. Unless otherwise specified all strings are stored in the\r | |
57 | /// UTF-16 encoding format as defined by Unicode 2.1 and ISO/IEC 10646 standards.\r | |
58 | ///\r | |
59 | typedef unsigned short CHAR16;\r | |
60 | ///\r | |
61 | /// 4-byte signed value\r | |
62 | ///\r | |
63 | typedef int INT32;\r | |
64 | ///\r | |
65 | /// 4-byte unsigned value\r | |
66 | ///\r | |
67 | typedef unsigned int UINT32;\r | |
68 | ///\r | |
69 | /// 8-byte signed value\r | |
70 | ///\r | |
71 | typedef __int64 INT64;\r | |
72 | ///\r | |
73 | /// 8-byte unsigned value\r | |
74 | ///\r | |
75 | typedef unsigned __int64 UINT64;\r | |
76 | \r | |
77 | ///\r | |
78 | /// Signed value of native width. (4 bytes on supported 32-bit processor instructions,\r | |
79 | /// 8 bytes on supported 64-bit processor instructions)\r | |
80 | /// "long" type scales to the processor native size with EBC compiler\r | |
81 | ///\r | |
82 | typedef long INTN;\r | |
83 | ///\r | |
84 | /// Unsigned value of native width. (4 bytes on supported 32-bit processor instructions,\r | |
85 | /// 8 bytes on supported 64-bit processor instructions)\r | |
86 | /// "long" type scales to the processor native size with EBC compiler\r | |
87 | ///\r | |
88 | typedef unsigned long UINTN;\r | |
89 | \r | |
90 | ///\r | |
91 | /// A value of native width with the highest bit set.\r | |
92 | /// Scalable macro to set the most significant bit in a natural number\r | |
93 | ///\r | |
94 | #define MAX_BIT (1ULL << (sizeof (INTN) * 8 - 1)) \r | |
95 | ///\r | |
96 | /// A value of native width with the two highest bits set.\r | |
97 | /// Scalable macro to set the most 2 significant bits in a natural number\r | |
98 | ///\r | |
99 | #define MAX_2_BITS (3ULL << (sizeof (INTN) * 8 - 2))\r | |
100 | \r | |
101 | ///\r | |
102 | /// Maximum legal EBC address\r | |
103 | ///\r | |
104 | #define MAX_ADDRESS ((UINTN) ~0)\r | |
105 | \r | |
106 | ///\r | |
107 | /// The stack alignment required for EBC\r | |
108 | ///\r | |
109 | #define CPU_STACK_ALIGNMENT sizeof(UINTN)\r | |
110 | \r | |
111 | ///\r | |
112 | /// Modifier to ensure that all protocol member functions and EFI intrinsics\r | |
113 | /// use the correct C calling convention. All protocol member functions and\r | |
114 | /// EFI intrinsics are required to modify their member functions with EFIAPI.\r | |
115 | ///\r | |
116 | #ifdef EFIAPI\r | |
117 | ///\r | |
118 | /// If EFIAPI is already defined, then we use that definition.\r | |
119 | ///\r | |
120 | #else\r | |
121 | #define EFIAPI \r | |
122 | #endif\r | |
123 | \r | |
124 | /**\r | |
125 | Return the pointer to the first instruction of a function given a function pointer.\r | |
126 | On EBC architectures, these two pointer values are the same, \r | |
127 | so the implementation of this macro is very simple.\r | |
128 | \r | |
129 | @param FunctionPointer A pointer to a function.\r | |
130 | \r | |
131 | @return The pointer to the first instruction of a function given a function pointer.\r | |
132 | **/\r | |
133 | #define FUNCTION_ENTRY_POINT(FunctionPointer) (VOID *)(UINTN)(FunctionPointer)\r | |
134 | \r | |
135 | #endif \r | |
136 | \r |