Root/
Source at commit HEAD created 5 years 6 days ago. By ifabio, Few update to kernelPatcher (Credits to CrazyBirdy) | |
---|---|
1 | /*␊ |
2 | * Copyright (c) 2005 Apple Computer, Inc. All rights reserved.␊ |
3 | *␊ |
4 | * @APPLE_OSREFERENCE_LICENSE_HEADER_START@␊ |
5 | * ␊ |
6 | * This file contains Original Code and/or Modifications of Original Code␊ |
7 | * as defined in and that are subject to the Apple Public Source License␊ |
8 | * Version 2.0 (the 'License'). You may not use this file except in␊ |
9 | * compliance with the License. The rights granted to you under the License␊ |
10 | * may not be used to create, or enable the creation or redistribution of,␊ |
11 | * unlawful or unlicensed copies of an Apple operating system, or to␊ |
12 | * circumvent, violate, or enable the circumvention or violation of, any␊ |
13 | * terms of an Apple operating system software license agreement.␊ |
14 | * ␊ |
15 | * Please obtain a copy of the License at␊ |
16 | * http://www.opensource.apple.com/apsl/ and read it before using this file.␊ |
17 | * ␊ |
18 | * The Original Code and all software distributed under the License are␊ |
19 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER␊ |
20 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,␊ |
21 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,␊ |
22 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.␊ |
23 | * Please see the License for the specific language governing rights and␊ |
24 | * limitations under the License.␊ |
25 | * ␊ |
26 | * @APPLE_OSREFERENCE_LICENSE_HEADER_END@␊ |
27 | */␊ |
28 | ␊ |
29 | #ifndef _PEXPERT_I386_EFI_H␊ |
30 | #define _PEXPERT_I386_EFI_H␊ |
31 | ␊ |
32 | #include <stdint.h>␊ |
33 | ␊ |
34 | typedef uint8_t EFI_UINT8;␊ |
35 | typedef uint16_t EFI_UINT16;␊ |
36 | typedef uint32_t EFI_UINT32;␊ |
37 | typedef uint64_t EFI_UINT64;␊ |
38 | ␊ |
39 | typedef uint32_t EFI_UINTN; /* natural size for firmware, not kernel */␊ |
40 | ␊ |
41 | typedef int8_t EFI_INT8;␊ |
42 | typedef int16_t EFI_INT16;␊ |
43 | typedef int32_t EFI_INT32;␊ |
44 | typedef int64_t EFI_INT64;␊ |
45 | ␊ |
46 | typedef int8_t EFI_CHAR8;␊ |
47 | typedef int16_t EFI_CHAR16;␊ |
48 | typedef int32_t EFI_CHAR32;␊ |
49 | typedef int64_t EFI_CHAR64;␊ |
50 | ␊ |
51 | typedef uint32_t EFI_STATUS;␊ |
52 | typedef uint8_t EFI_BOOLEAN;␊ |
53 | typedef void VOID;␊ |
54 | ␊ |
55 | typedef uint32_t EFI_PTR32;␊ |
56 | typedef uint32_t EFI_HANDLE32;␊ |
57 | ␊ |
58 | typedef uint64_t EFI_PTR64;␊ |
59 | typedef uint64_t EFI_HANDLE64;␊ |
60 | /*␊ |
61 | ␊ |
62 | Portions Copyright 2004, Intel Corporation␊ |
63 | All rights reserved. This program and the accompanying materials␊ |
64 | are licensed and made available under the terms and conditions of the BSD License␊ |
65 | which accompanies this distribution. The full text of the license may be found at␊ |
66 | http://opensource.org/licenses/bsd-license.php␊ |
67 | ␊ |
68 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,␊ |
69 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.␊ |
70 | ␊ |
71 | */␊ |
72 | ␊ |
73 | ␊ |
74 | // Modifiers for EFI Runtime and Boot Services␊ |
75 | ␊ |
76 | #define EFI_RUNTIMESERVICE␊ |
77 | #define EFIAPI␊ |
78 | #define IN␊ |
79 | #define OUT␊ |
80 | #define OPTIONAL␊ |
81 | ␊ |
82 | #define EFI_MAX_BIT 0x80000000␊ |
83 | ␊ |
84 | // Set the upper bit to indicate EFI Error.␊ |
85 | #define EFIERR(a) (EFI_MAX_BIT | (a))␊ |
86 | ␊ |
87 | #define EFIWARN(a) (a)␊ |
88 | #define EFI_ERROR(a) (((INTN) (a)) < 0)␊ |
89 | ␊ |
90 | #define EFI_SUCCESS 0␊ |
91 | #define EFI_LOAD_ERROR EFIERR (1)␊ |
92 | #define EFI_INVALID_PARAMETER EFIERR (2)␊ |
93 | #define EFI_UNSUPPORTED EFIERR (3)␊ |
94 | #define EFI_BAD_BUFFER_SIZE EFIERR (4)␊ |
95 | #define EFI_BUFFER_TOO_SMALL EFIERR (5)␊ |
96 | #define EFI_NOT_READY EFIERR (6)␊ |
97 | #define EFI_DEVICE_ERROR EFIERR (7)␊ |
98 | #define EFI_WRITE_PROTECTED EFIERR (8)␊ |
99 | #define EFI_OUT_OF_RESOURCES EFIERR (9)␊ |
100 | #define EFI_VOLUME_CORRUPTED EFIERR (10)␊ |
101 | #define EFI_VOLUME_FULL EFIERR (11)␊ |
102 | #define EFI_NO_MEDIA EFIERR (12)␊ |
103 | #define EFI_MEDIA_CHANGED EFIERR (13)␊ |
104 | #define EFI_NOT_FOUND EFIERR (14)␊ |
105 | #define EFI_ACCESS_DENIED EFIERR (15)␊ |
106 | #define EFI_NO_RESPONSE EFIERR (16)␊ |
107 | #define EFI_NO_MAPPING EFIERR (17)␊ |
108 | #define EFI_TIMEOUT EFIERR (18)␊ |
109 | #define EFI_NOT_STARTED EFIERR (19)␊ |
110 | #define EFI_ALREADY_STARTED EFIERR (20)␊ |
111 | #define EFI_ABORTED EFIERR (21)␊ |
112 | #define EFI_ICMP_ERROR EFIERR (22)␊ |
113 | #define EFI_TFTP_ERROR EFIERR (23)␊ |
114 | #define EFI_PROTOCOL_ERROR EFIERR (24)␊ |
115 | #define EFI_INCOMPATIBLE_VERSION EFIERR (25)␊ |
116 | #define EFI_SECURITY_VIOLATION EFIERR (26)␊ |
117 | #define EFI_CRC_ERROR EFIERR (27)␊ |
118 | #define EFI_END_OF_MEDIA EFIERR (28)␊ |
119 | #define EFI_END_OF_FILE EFIERR (31)␊ |
120 | #define EFI_INVALID_LANGUAGE EFIERR (32)␊ |
121 | #define EFI_COMPROMISED_DATA EFIERR (33)␊ |
122 | ␊ |
123 | #define EFI_WARN_UNKNOWN_GLYPH EFIWARN (1)␊ |
124 | #define EFI_WARN_DELETE_FAILURE EFIWARN (2)␊ |
125 | #define EFI_WARN_WRITE_FAILURE EFIWARN (3)␊ |
126 | #define EFI_WARN_BUFFER_TOO_SMALL EFIWARN (4)␊ |
127 | #define EFI_WARN_STALE_DATA EFIWARN (5)␊ |
128 | ␊ |
129 | //␊ |
130 | // EFI Specification Revision information␊ |
131 | //␊ |
132 | #define EFI_SPECIFICATION_MAJOR_REVISION 1␊ |
133 | #define EFI_SPECIFICATION_MINOR_REVISION 10␊ |
134 | ␊ |
135 | typedef struct {␊ |
136 | EFI_UINT32 Data1;␊ |
137 | EFI_UINT16 Data2;␊ |
138 | EFI_UINT16 Data3;␊ |
139 | EFI_UINT8 Data4[8];␊ |
140 | } EFI_GUID;␊ |
141 | ␊ |
142 | #define APPLE_VENDOR_GUID \␊ |
143 | {0xAC39C713, 0x7E50, 0x423D, {0x88, 0x9D, 0x27, 0x8F, 0xCC, 0x34, 0x22, 0xB6} }␊ |
144 | ␊ |
145 | #define EFI_GLOBAL_VARIABLE_GUID \␊ |
146 | {0x8BE4DF61, 0x93CA, 0x11D2, {0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C} }␊ |
147 | ␊ |
148 | #define EFI_SMBIOS_TABLE_GUID \␊ |
149 | {0xEB9D2D31, 0x2D88, 0x11D3, {0x9A, 0x16, 0x0, 0x90, 0x27, 0x3F, 0xC1, 0x4D} }␊ |
150 | ␊ |
151 | // ACPI 1.0 Table GUID in EFI System Table␊ |
152 | #define EFI_ACPI_TABLE_GUID \␊ |
153 | {0xEB9D2D30, 0x2D88, 0x11D3, {0x9A, 0x16, 0x0, 0x90, 0x27, 0x3F, 0xC1, 0x4D} }␊ |
154 | ␊ |
155 | // ACPI 2.0 Table GUID in EFI System Table␊ |
156 | #define EFI_ACPI_20_TABLE_GUID \␊ |
157 | {0x8868E871, 0xE4f1, 0x11D3, {0xBC, 0x22, 0x0, 0x80, 0xC7, 0x3C, 0x88, 0x81} }␊ |
158 | ␊ |
159 | // ACPI 3.0 Table GUID in EFI System Table␊ |
160 | #define EFI_ACPI_30_TABLE_GUID EFI_ACPI_20_TABLE_GUID␊ |
161 | ␊ |
162 | // The EFI variable GUID for the 'FirmwareFeatures' and friends. Also known as AppleFirmwareVariableGuid in other sources.␊ |
163 | #define APPLE_FIRMWARE_VARIABLE_GUID \␊ |
164 | {0x4D1EDE05, 0x38C7, 0x4A6A, {0x9C, 0xC6, 0x4B, 0xCC, 0xA8, 0xB3, 0x8C, 0x14 } }␊ |
165 | ␊ |
166 | // The EFI variable GUID for the 'boot-args' variable and others. Also known as AppleNVRAMVariableGuid in other sources.␊ |
167 | #define APPLE_NVRAM_VARIABLE_GUID \␊ |
168 | {0x7C436110, 0xAB2A, 0x4BBB, {0xA8, 0x80, 0xFE, 0x41, 0x99, 0x5C, 0x9F, 0x82 } }␊ |
169 | ␊ |
170 | typedef union {␊ |
171 | EFI_GUID Guid;␊ |
172 | EFI_UINT8 Raw[16];␊ |
173 | } EFI_GUID_UNION;␊ |
174 | ␊ |
175 | //␊ |
176 | // EFI Time Abstraction:␊ |
177 | // Year: 2000 - 20XX␊ |
178 | // Month: 1 - 12␊ |
179 | // Day: 1 - 31␊ |
180 | // Hour: 0 - 23␊ |
181 | // Minute: 0 - 59␊ |
182 | // Second: 0 - 59␊ |
183 | // Nanosecond: 0 - 999,999,999␊ |
184 | // TimeZone: -1440 to 1440 or 2047␊ |
185 | //␊ |
186 | typedef struct {␊ |
187 | ␉EFI_UINT16 Year;␊ |
188 | ␉EFI_UINT8 Month;␊ |
189 | ␉EFI_UINT8 Day;␊ |
190 | ␉EFI_UINT8 Hour;␊ |
191 | ␉EFI_UINT8 Minute;␊ |
192 | ␉EFI_UINT8 Second;␊ |
193 | ␉EFI_UINT8 Pad1;␊ |
194 | ␉EFI_UINT32 Nanosecond;␊ |
195 | ␉EFI_INT16 TimeZone;␊ |
196 | ␉EFI_UINT8 Daylight;␊ |
197 | ␉EFI_UINT8 Pad2;␊ |
198 | } EFI_TIME;␊ |
199 | ␊ |
200 | ␊ |
201 | // Bit definitions for EFI_TIME.Daylight␊ |
202 | ␊ |
203 | #define EFI_TIME_ADJUST_DAYLIGHT 0x01␊ |
204 | #define EFI_TIME_IN_DAYLIGHT 0x02␊ |
205 | ␊ |
206 | ␊ |
207 | // Value definition for EFI_TIME.TimeZone␊ |
208 | ␊ |
209 | #define EFI_UNSPECIFIED_TIMEZONE 0x07FF␊ |
210 | ␊ |
211 | typedef enum {␊ |
212 | ␉EfiReservedMemoryType,␉// 0␊ |
213 | ␉EfiLoaderCode,␊ |
214 | ␉EfiLoaderData,␊ |
215 | ␉EfiBootServicesCode,␊ |
216 | ␉EfiBootServicesData,␊ |
217 | ␉EfiRuntimeServicesCode,␊ |
218 | ␉EfiRuntimeServicesData,␊ |
219 | ␉EfiConventionalMemory,␊ |
220 | ␉EfiUnusableMemory,␊ |
221 | ␉EfiACPIReclaimMemory,␊ |
222 | ␉EfiACPIMemoryNVS,␊ |
223 | ␉EfiMemoryMappedIO,␊ |
224 | ␉EfiMemoryMappedIOPortSpace,␊ |
225 | ␉EfiPalCode,␊ |
226 | ␉EfiMaxMemoryType␉// 14␊ |
227 | } EFI_MEMORY_TYPE;␊ |
228 | ␊ |
229 | typedef struct {␊ |
230 | ␉EFI_UINT64␉␉␉␉Signature;␊ |
231 | ␉EFI_UINT32␉␉␉␉Revision;␊ |
232 | ␉EFI_UINT32␉␉␉␉HeaderSize;␊ |
233 | ␉EFI_UINT32␉␉␉␉CRC32;␊ |
234 | ␉EFI_UINT32␉␉␉␉Reserved;␊ |
235 | } __attribute__((aligned(8))) EFI_TABLE_HEADER;␊ |
236 | ␊ |
237 | // possible caching types for the memory range␊ |
238 | #define EFI_MEMORY_UC␉␉0x0000000000000001ULL␉/* uncached */␊ |
239 | #define EFI_MEMORY_WC␉␉0x0000000000000002ULL␉/* write-coalescing */␊ |
240 | #define EFI_MEMORY_WT␉␉0x0000000000000004ULL␉/* write-through */␊ |
241 | #define EFI_MEMORY_WB␉␉0x0000000000000008ULL␉/* write-back */␊ |
242 | #define EFI_MEMORY_UCE␉␉0x0000000000000010ULL␉/* uncached, exported */␊ |
243 | ␊ |
244 | // physical memory protection on range␊ |
245 | ␊ |
246 | #define EFI_MEMORY_WP␉␉0x0000000000001000ULL␉/* write-protect */␊ |
247 | #define EFI_MEMORY_RP␉␉0x0000000000002000ULL␉/* read-protect */␊ |
248 | #define EFI_MEMORY_XP␉␉0x0000000000004000ULL␉/* execute-protect */␊ |
249 | ␊ |
250 | // range requires a runtime mapping␊ |
251 | ␊ |
252 | #define EFI_MEMORY_RUNTIME 0x8000000000000000ULL␊ |
253 | #define EFI_MEMORY_KERN_RESERVED (1ULL << 59)␊ |
254 | typedef EFI_UINT64 EFI_PHYSICAL_ADDRESS;␊ |
255 | typedef EFI_UINT64 EFI_VIRTUAL_ADDRESS;␊ |
256 | ␊ |
257 | #define EFI_MEMORY_DESCRIPTOR_VERSION 1␊ |
258 | typedef struct {␊ |
259 | ␉EFI_UINT32 Type;␊ |
260 | ␉EFI_UINT32 Pad;␊ |
261 | ␉EFI_PHYSICAL_ADDRESS PhysicalStart;␊ |
262 | ␉EFI_VIRTUAL_ADDRESS VirtualStart;␊ |
263 | ␉EFI_UINT64 NumberOfPages;␊ |
264 | ␉EFI_UINT64 Attribute;␊ |
265 | } __attribute__((aligned(8))) EFI_MEMORY_DESCRIPTOR;␊ |
266 | ␊ |
267 | ␊ |
268 | typedef␊ |
269 | EFI_RUNTIMESERVICE␊ |
270 | EFI_STATUS␊ |
271 | (EFIAPI *EFI_SET_VIRTUAL_ADDRESS_MAP) (␊ |
272 | IN EFI_UINTN MemoryMapSize,␊ |
273 | IN EFI_UINTN DescriptorSize,␊ |
274 | IN EFI_UINT32 DescriptorVersion,␊ |
275 | IN EFI_MEMORY_DESCRIPTOR * VirtualMap␊ |
276 | ) __attribute__((regparm(0)));␊ |
277 | ␊ |
278 | typedef␊ |
279 | EFI_RUNTIMESERVICE␊ |
280 | EFI_STATUS␊ |
281 | (EFIAPI *EFI_CONVERT_POINTER) (␊ |
282 | IN EFI_UINTN DebugDisposition,␊ |
283 | IN OUT VOID **Address␊ |
284 | ) __attribute__((regparm(0)));␊ |
285 | ␊ |
286 | ␊ |
287 | // Variable attributes␊ |
288 | ␊ |
289 | #define EFI_VARIABLE_NON_VOLATILE 0x00000001␊ |
290 | #define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x00000002␊ |
291 | #define EFI_VARIABLE_RUNTIME_ACCESS 0x00000004␊ |
292 | #define EFI_VARIABLE_READ_ONLY 0x00000008␊ |
293 | ␊ |
294 | typedef␊ |
295 | EFI_RUNTIMESERVICE␊ |
296 | EFI_STATUS␊ |
297 | (EFIAPI *EFI_GET_VARIABLE) (␊ |
298 | IN EFI_CHAR16 * VariableName,␊ |
299 | IN EFI_GUID * VendorGuid,␊ |
300 | OUT EFI_UINT32 * Attributes OPTIONAL,␊ |
301 | IN OUT EFI_UINTN * DataSize,␊ |
302 | OUT VOID * Data␊ |
303 | ) __attribute__((regparm(0)));␊ |
304 | ␊ |
305 | typedef␊ |
306 | EFI_RUNTIMESERVICE␊ |
307 | EFI_STATUS␊ |
308 | (EFIAPI *EFI_GET_NEXT_VARIABLE_NAME) (␊ |
309 | IN OUT EFI_UINTN * VariableNameSize,␊ |
310 | IN OUT EFI_CHAR16 * VariableName,␊ |
311 | IN OUT EFI_GUID * VendorGuid␊ |
312 | ) __attribute__((regparm(0)));␊ |
313 | ␊ |
314 | typedef␊ |
315 | EFI_RUNTIMESERVICE␊ |
316 | EFI_STATUS␊ |
317 | (EFIAPI *EFI_SET_VARIABLE) (␊ |
318 | IN EFI_CHAR16 * VariableName,␊ |
319 | IN EFI_GUID * VendorGuid,␊ |
320 | IN EFI_UINT32 Attributes,␊ |
321 | IN EFI_UINTN DataSize,␊ |
322 | IN VOID * Data␊ |
323 | ) __attribute__((regparm(0)));␊ |
324 | ␊ |
325 | ␊ |
326 | // EFI Time␊ |
327 | ␊ |
328 | typedef struct {␊ |
329 | ␉EFI_UINT32 Resolution;␊ |
330 | ␉EFI_UINT32 Accuracy;␊ |
331 | ␉EFI_BOOLEAN SetsToZero;␊ |
332 | } __attribute__((aligned(4))) EFI_TIME_CAPABILITIES;␊ |
333 | ␊ |
334 | typedef␊ |
335 | EFI_RUNTIMESERVICE␊ |
336 | EFI_STATUS␊ |
337 | (EFIAPI *EFI_GET_TIME) (␊ |
338 | OUT EFI_TIME * Time,␊ |
339 | OUT EFI_TIME_CAPABILITIES * Capabilities OPTIONAL␊ |
340 | ) __attribute__((regparm(0)));␊ |
341 | ␊ |
342 | typedef␊ |
343 | EFI_RUNTIMESERVICE␊ |
344 | EFI_STATUS␊ |
345 | (EFIAPI *EFI_SET_TIME) (␊ |
346 | IN EFI_TIME * Time␊ |
347 | ) __attribute__((regparm(0)));␊ |
348 | ␊ |
349 | typedef␊ |
350 | EFI_RUNTIMESERVICE␊ |
351 | EFI_STATUS␊ |
352 | (EFIAPI *EFI_GET_WAKEUP_TIME) (␊ |
353 | OUT EFI_BOOLEAN * Enabled,␊ |
354 | OUT EFI_BOOLEAN * Pending,␊ |
355 | OUT EFI_TIME * Time␊ |
356 | ) __attribute__((regparm(0)));␊ |
357 | ␊ |
358 | typedef␊ |
359 | EFI_RUNTIMESERVICE␊ |
360 | EFI_STATUS␊ |
361 | (EFIAPI *EFI_SET_WAKEUP_TIME) (␊ |
362 | IN EFI_BOOLEAN Enable,␊ |
363 | IN EFI_TIME * Time OPTIONAL␊ |
364 | ) __attribute((regparm(0)));␊ |
365 | ␊ |
366 | typedef enum {␊ |
367 | EfiResetCold,␊ |
368 | EfiResetWarm,␊ |
369 | EfiResetShutdown,␊ |
370 | ␊ |
371 | #ifdef TIANO_EXTENSION_FLAG␊ |
372 | EfiResetUpdate␊ |
373 | #endif␊ |
374 | ␊ |
375 | } EFI_RESET_TYPE;␊ |
376 | ␊ |
377 | typedef␊ |
378 | EFI_RUNTIMESERVICE␊ |
379 | VOID␊ |
380 | (EFIAPI *EFI_RESET_SYSTEM) (␊ |
381 | IN EFI_RESET_TYPE ResetType,␊ |
382 | IN EFI_STATUS ResetStatus,␊ |
383 | IN EFI_UINTN DataSize,␊ |
384 | IN EFI_CHAR16 * ResetData OPTIONAL␊ |
385 | ) __attribute__((regparm(0)));␊ |
386 | ␊ |
387 | typedef␊ |
388 | EFI_RUNTIMESERVICE␊ |
389 | EFI_STATUS␊ |
390 | (EFIAPI *EFI_GET_NEXT_HIGH_MONO_COUNT) (␊ |
391 | OUT EFI_UINT32 * HighCount␊ |
392 | ) __attribute__((regparm(0)));␊ |
393 | ␊ |
394 | // Definition of Status Code extended data header␊ |
395 | ␊ |
396 | // HeaderSize The size of the architecture. This is specified to enable the future expansion␊ |
397 | ␊ |
398 | // Size The size of the data in bytes. This does not include the size of the header structure.␊ |
399 | ␊ |
400 | // Type A GUID defining the type of the data␊ |
401 | ␊ |
402 | #ifdef TIANO_EXTENSION_FLAG␊ |
403 | ␊ |
404 | typedef␊ |
405 | EFI_RUNTIMESERVICE␊ |
406 | EFI_STATUS␊ |
407 | (EFIAPI *EFI_REPORT_STATUS_CODE) (␊ |
408 | IN EFI_STATUS_CODE_TYPE Type,␊ |
409 | IN EFI_STATUS_CODE_VALUE Value,␊ |
410 | IN EFI_UINT32 Instance,␊ |
411 | IN EFI_GUID * CallerId OPTIONAL,␊ |
412 | IN EFI_STATUS_CODE_DATA * Data OPTIONAL␊ |
413 | ) __attribute__((regparm(0)));␊ |
414 | ␊ |
415 | #endif␊ |
416 | //␊ |
417 | // EFI Runtime Services Table␊ |
418 | //␊ |
419 | #define EFI_RUNTIME_SERVICES_SIGNATURE 0x56524553544e5552ULL␊ |
420 | #define EFI_RUNTIME_SERVICES_REVISION ((EFI_SPECIFICATION_MAJOR_REVISION << 16) | (EFI_SPECIFICATION_MINOR_REVISION))␊ |
421 | ␊ |
422 | typedef struct {␊ |
423 | ␉EFI_TABLE_HEADER␉␉Hdr;␊ |
424 | ␊ |
425 | ␉// Time Services␊ |
426 | ␉EFI_PTR32␉␉␉␉GetTime;␊ |
427 | ␉EFI_PTR32␉␉␉␉SetTime;␊ |
428 | ␉EFI_PTR32␉␉␉␉GetWakeupTime;␊ |
429 | ␉EFI_PTR32␉␉␉␉SetWakeupTime;␊ |
430 | ␊ |
431 | ␉// Virtual Memory Services␊ |
432 | ␊ |
433 | ␉EFI_PTR32 SetVirtualAddressMap;␊ |
434 | ␉EFI_PTR32 ConvertPointer;␊ |
435 | ␊ |
436 | ␊ |
437 | ␉// Variable Services␊ |
438 | ␉EFI_PTR32 GetVariable;␊ |
439 | ␉EFI_PTR32 GetNextVariableName;␊ |
440 | ␉EFI_PTR32 SetVariable;␊ |
441 | ␊ |
442 | ␉// Miscellaneous Services␊ |
443 | ␉EFI_PTR32 GetNextHighMonotonicCount;␊ |
444 | ␉EFI_PTR32 ResetSystem;␊ |
445 | ␊ |
446 | #ifdef TIANO_EXTENSION_FLAG␊ |
447 | ␊ |
448 | ␉// ////////////////////////////////////////////////////␊ |
449 | ␉// Extended EFI Services␊ |
450 | ␉//////////////////////////////////////////////////////␊ |
451 | ␊ |
452 | ␉EFI_PTR32 ReportStatusCode;␊ |
453 | #endif␊ |
454 | ␊ |
455 | } __attribute__((aligned(8))) EFI_RUNTIME_SERVICES_32;␊ |
456 | ␊ |
457 | typedef struct {␊ |
458 | ␉EFI_TABLE_HEADER Hdr;␊ |
459 | ␊ |
460 | ␊ |
461 | ␉// Time services␊ |
462 | ␊ |
463 | ␉EFI_PTR64 GetTime;␊ |
464 | ␉EFI_PTR64 SetTime;␊ |
465 | ␉EFI_PTR64 GetWakeupTime;␊ |
466 | ␉EFI_PTR64 SetWakeupTime;␊ |
467 | ␊ |
468 | ␉// Virtual memory services␊ |
469 | ␊ |
470 | ␉EFI_PTR64 SetVirtualAddressMap;␊ |
471 | ␉EFI_PTR64 ConvertPointer;␊ |
472 | ␊ |
473 | ␉// Variable services␊ |
474 | ␊ |
475 | ␉EFI_PTR64 GetVariable;␊ |
476 | ␉EFI_PTR64 GetNextVariableName;␊ |
477 | ␉EFI_PTR64 SetVariable;␊ |
478 | ␊ |
479 | ␉// Misc␊ |
480 | ␊ |
481 | ␉EFI_PTR64 GetNextHighMonotonicCount;␊ |
482 | ␉EFI_PTR64 ResetSystem;␊ |
483 | ␊ |
484 | #ifdef TIANO_EXTENSION_FLAG␊ |
485 | ␊ |
486 | ␉// ////////////////////////////////////////////////////␊ |
487 | ␉// Extended EFI Services␊ |
488 | ␉//////////////////////////////////////////////////////␊ |
489 | ␊ |
490 | ␉EFI_PTR64 ReportStatusCode;␊ |
491 | #endif␊ |
492 | ␊ |
493 | } __attribute__((aligned(8))) EFI_RUNTIME_SERVICES_64;␊ |
494 | ␊ |
495 | //␊ |
496 | // EFI Configuration Table␊ |
497 | //␊ |
498 | typedef struct {␊ |
499 | ␉EFI_GUID VendorGuid;␊ |
500 | ␉EFI_PTR32 VendorTable;␊ |
501 | } EFI_CONFIGURATION_TABLE_32;␊ |
502 | ␊ |
503 | typedef struct {␊ |
504 | ␉EFI_GUID VendorGuid;␊ |
505 | ␉EFI_PTR64 VendorTable;␊ |
506 | } __attribute__((aligned(8))) EFI_CONFIGURATION_TABLE_64;␊ |
507 | ␊ |
508 | ␊ |
509 | // EFI System Table␊ |
510 | ␊ |
511 | #define EFI_SYSTEM_TABLE_SIGNATURE 0x5453595320494249ULL␊ |
512 | #define EFI_SYSTEM_TABLE_REVISION ((EFI_SPECIFICATION_MAJOR_REVISION << 16) | (EFI_SPECIFICATION_MINOR_REVISION))␊ |
513 | #define EFI_2_30_SYSTEM_TABLE_REVISION ((2 << 16) | (30))␊ |
514 | #define EFI_2_20_SYSTEM_TABLE_REVISION ((2 << 16) | (20))␊ |
515 | #define EFI_2_10_SYSTEM_TABLE_REVISION ((2 << 16) | (10))␊ |
516 | #define EFI_2_00_SYSTEM_TABLE_REVISION ((2 << 16) | (00))␊ |
517 | #define EFI_1_10_SYSTEM_TABLE_REVISION ((1 << 16) | (10))␊ |
518 | #define EFI_1_02_SYSTEM_TABLE_REVISION ((1 << 16) | (02))␊ |
519 | ␊ |
520 | typedef struct EFI_SYSTEM_TABLE_32 {␊ |
521 | ␉EFI_TABLE_HEADER Hdr;␊ |
522 | ␊ |
523 | ␉EFI_PTR32 FirmwareVendor;␊ |
524 | ␉EFI_UINT32 FirmwareRevision;␊ |
525 | ␊ |
526 | ␉EFI_HANDLE32 ConsoleInHandle;␊ |
527 | ␉EFI_PTR32 ConIn;␊ |
528 | ␊ |
529 | ␉EFI_HANDLE32 ConsoleOutHandle;␊ |
530 | ␉EFI_PTR32 ConOut;␊ |
531 | ␊ |
532 | ␉EFI_HANDLE32 StandardErrorHandle;␊ |
533 | ␉EFI_PTR32 StdErr;␊ |
534 | ␊ |
535 | ␉EFI_PTR32 RuntimeServices;␊ |
536 | ␉EFI_PTR32 BootServices;␊ |
537 | ␊ |
538 | ␉EFI_UINT32 NumberOfTableEntries;␊ |
539 | ␉EFI_PTR32 ConfigurationTable;␊ |
540 | ␊ |
541 | } __attribute__((aligned(8))) EFI_SYSTEM_TABLE_32;␊ |
542 | ␊ |
543 | typedef struct EFI_SYSTEM_TABLE_64 {␊ |
544 | ␉EFI_TABLE_HEADER Hdr;␊ |
545 | ␊ |
546 | ␉EFI_PTR64 FirmwareVendor;␊ |
547 | ␉EFI_UINT32 FirmwareRevision;␊ |
548 | ␊ |
549 | ␉EFI_UINT32 __pad;␊ |
550 | ␉EFI_HANDLE64 ConsoleInHandle;␊ |
551 | ␉EFI_PTR64 ConIn;␊ |
552 | ␊ |
553 | ␉EFI_HANDLE64 ConsoleOutHandle;␊ |
554 | ␉EFI_PTR64 ConOut;␊ |
555 | ␊ |
556 | ␉EFI_HANDLE64 StandardErrorHandle;␊ |
557 | ␉EFI_PTR64 StdErr;␊ |
558 | ␊ |
559 | ␉EFI_PTR64 RuntimeServices;␊ |
560 | ␉EFI_PTR64 BootServices;␊ |
561 | ␊ |
562 | ␉EFI_UINT64 NumberOfTableEntries;␊ |
563 | ␉EFI_PTR64 ConfigurationTable;␊ |
564 | } __attribute__((aligned(8))) EFI_SYSTEM_TABLE_64;␊ |
565 | ␊ |
566 | #endif /* _PEXPERT_I386_EFI_H */␊ |
567 |