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