]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Ipf/ProcessorBind.h
Add the IPF boot mode into ProcessorBind.h, and these boot mode is defined in Itanium...
[mirror_edk2.git] / MdePkg / Include / Ipf / ProcessorBind.h
1 /** @file
2 Processor or Compiler specific defines and types for Intel Itanium(TM).
3
4 Copyright (c) 2006, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 #ifndef __PROCESSOR_BIND_H__
16 #define __PROCESSOR_BIND_H__
17
18
19 //
20 // Define the processor type so other code can make processor based choices
21 //
22 #define MDE_CPU_IPF
23
24
25 //
26 // Make sure we are useing the correct packing rules per EFI specification
27 //
28 #pragma pack()
29
30
31 #if _MSC_EXTENSIONS
32
33 //
34 // Disable warning that make it impossible to compile at /W4
35 // This only works for Microsoft tools. Copied from the
36 // IA-32 version of efibind.h
37 //
38
39 //
40 // Disabling bitfield type checking warnings.
41 //
42 #pragma warning ( disable : 4214 )
43
44
45 // Disabling the unreferenced formal parameter warnings.
46 //
47 #pragma warning ( disable : 4100 )
48
49 //
50 // Disable slightly different base types warning as CHAR8 * can not be set
51 // to a constant string.
52 //
53 #pragma warning ( disable : 4057 )
54
55 //
56 // Disable warning on conversion from function pointer to a data pointer
57 //
58 #pragma warning ( disable : 4054 )
59
60 //
61 // ASSERT(FALSE) or while (TRUE) are legal constructes so supress this warning
62 //
63 #pragma warning ( disable : 4127 )
64
65 //
66 // Can not cast a function pointer to a data pointer. We need to do this on
67 // IPF to get access to the PLABEL.
68 //
69 #pragma warning ( disable : 4514 )
70
71 //
72 // This warning is caused by functions defined but not used. For precompiled header only.
73 //
74 #pragma warning ( disable : 4505 )
75
76 //
77 // This warning is caused by empty (after preprocessing) souce file. For precompiled header only.
78 //
79 #pragma warning ( disable : 4206 )
80
81 #endif
82
83
84 #if (__STDC_VERSION__ < 199901L)
85 //
86 // No ANSI C 2000 stdint.h integer width declarations, so define equivalents
87 //
88
89 #if _MSC_EXTENSIONS
90
91
92 //
93 // use Microsoft C complier dependent interger width types
94 //
95 typedef unsigned __int64 UINT64;
96 typedef __int64 INT64;
97 typedef unsigned __int32 UINT32;
98 typedef __int32 INT32;
99 typedef unsigned short UINT16;
100 typedef unsigned short CHAR16;
101 typedef short INT16;
102 typedef unsigned char BOOLEAN;
103 typedef unsigned char UINT8;
104 typedef char CHAR8;
105 typedef char INT8;
106 #else
107 #ifdef _EFI_P64
108 //
109 // P64 - is Intel Itanium(TM) speak for pointers being 64-bit and longs and ints
110 // are 32-bits
111 //
112 typedef unsigned long long UINT64;
113 typedef long long INT64;
114 typedef unsigned int UINT32;
115 typedef int INT32;
116 typedef unsigned short CHAR16;
117 typedef unsigned short UINT16;
118 typedef short INT16;
119 typedef unsigned char BOOLEAN;
120 typedef unsigned char UINT8;
121 typedef char CHAR8;
122 typedef char INT8;
123 #else
124 //
125 // Assume LP64 - longs and pointers are 64-bit. Ints are 32-bit.
126 //
127 typedef unsigned long UINT64;
128 typedef long INT64;
129 typedef unsigned int UINT32;
130 typedef int INT32;
131 typedef unsigned short UINT16;
132 typedef unsigned short CHAR16;
133 typedef short INT16;
134 typedef unsigned char BOOLEAN;
135 typedef unsigned char UINT8;
136 typedef char CHAR8;
137 typedef char INT8;
138 #endif
139 #endif
140
141 #define UINT8_MAX 0xff
142
143 #else
144 //
145 // Use ANSI C 2000 stdint.h integer width declarations
146 //
147 #include <stdint.h>
148 typedef uint8_t BOOLEAN;
149 typedef int8_t INT8;
150 typedef uint8_t UINT8;
151 typedef int16_t INT16;
152 typedef uint16_t UINT16;
153 typedef int32_t INT32;
154 typedef uint32_t UINT32;
155 typedef int64_t INT64;
156 typedef uint64_t UINT64;
157 typedef char CHAR8;
158 typedef uint16_t CHAR16;
159
160 #endif
161
162 typedef UINT64 UINTN;
163 typedef INT64 INTN;
164
165
166 //
167 // Processor specific defines
168 //
169 #define MAX_BIT 0x8000000000000000ULL
170 #define MAX_2_BITS 0xC000000000000000ULL
171
172 //
173 // Maximum legal Itanium-based address
174 //
175 #define MAX_ADDRESS 0xFFFFFFFFFFFFFFFFULL
176
177 //
178 // Per the Itanium Software Conventions and Runtime Architecture Guide,
179 // section 3.3.4, IPF stack must always be 16-byte aligned.
180 //
181 #define CPU_STACK_ALIGNMENT 16
182
183 //
184 // Modifier to ensure that all protocol member functions and EFI intrinsics
185 // use the correct C calling convention. All protocol member functions and
186 // EFI intrinsics are required to modify thier member functions with EFIAPI.
187 //
188 #if _MSC_EXTENSIONS
189 //
190 // Microsoft* compiler requires _EFIAPI useage, __cdecl is Microsoft* specific C.
191 //
192 #define EFIAPI __cdecl
193 #else
194 #define EFIAPI
195 #endif
196
197 //
198 // The Microsoft* C compiler can removed references to unreferenced data items
199 // if the /OPT:REF linker option is used. We defined a macro as this is a
200 // a non standard extension
201 //
202 #if _MSC_EXTENSIONS
203 #define GLOBAL_REMOVE_IF_UNREFERENCED __declspec(selectany)
204 #else
205 #define GLOBAL_REMOVE_IF_UNREFERENCED
206 #endif
207
208 //
209 // For IPF boot mode
210 //
211 #define RECOVERY_CHECK_CALL 0x3
212 #define NORMAL_BOOT_CALL 0x0
213
214 //
215 // A pointer to a function in IPF points to a plabel.
216 //
217 typedef struct {
218 UINT64 EntryPoint;
219 UINT64 GP;
220 } EFI_PLABEL;
221
222 typedef struct {
223 UINT64 Status;
224 UINT64 r9;
225 UINT64 r10;
226 UINT64 r11;
227 } PAL_CALL_RETURN;
228
229 #endif
230