1 /* efi.h - declare EFI types and functions */
3 * GRUB -- GRand Unified Bootloader
4 * Copyright (C) 2006,2007,2008,2009 Free Software Foundation, Inc.
6 * GRUB is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * GRUB is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef GRUB_EFI_API_HEADER
21 #define GRUB_EFI_API_HEADER 1
23 #include <grub/types.h>
24 #include <grub/symbol.h>
26 /* For consistency and safety, we name the EFI-defined types differently.
27 All names are transformed into lower case, _t appended, and
28 grub_efi_ prepended. */
31 #define GRUB_EFI_EVT_TIMER 0x80000000
32 #define GRUB_EFI_EVT_RUNTIME 0x40000000
33 #define GRUB_EFI_EVT_RUNTIME_CONTEXT 0x20000000
34 #define GRUB_EFI_EVT_NOTIFY_WAIT 0x00000100
35 #define GRUB_EFI_EVT_NOTIFY_SIGNAL 0x00000200
36 #define GRUB_EFI_EVT_SIGNAL_EXIT_BOOT_SERVICES 0x00000201
37 #define GRUB_EFI_EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE 0x60000202
39 #define GRUB_EFI_TPL_APPLICATION 4
40 #define GRUB_EFI_TPL_CALLBACK 8
41 #define GRUB_EFI_TPL_NOTIFY 16
42 #define GRUB_EFI_TPL_HIGH_LEVEL 31
44 #define GRUB_EFI_MEMORY_UC 0x0000000000000001LL
45 #define GRUB_EFI_MEMORY_WC 0x0000000000000002LL
46 #define GRUB_EFI_MEMORY_WT 0x0000000000000004LL
47 #define GRUB_EFI_MEMORY_WB 0x0000000000000008LL
48 #define GRUB_EFI_MEMORY_UCE 0x0000000000000010LL
49 #define GRUB_EFI_MEMORY_WP 0x0000000000001000LL
50 #define GRUB_EFI_MEMORY_RP 0x0000000000002000LL
51 #define GRUB_EFI_MEMORY_XP 0x0000000000004000LL
52 #define GRUB_EFI_MEMORY_NV 0x0000000000008000LL
53 #define GRUB_EFI_MEMORY_MORE_RELIABLE 0x0000000000010000LL
54 #define GRUB_EFI_MEMORY_RO 0x0000000000020000LL
55 #define GRUB_EFI_MEMORY_RUNTIME 0x8000000000000000LL
57 #define GRUB_EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL 0x00000001
58 #define GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL 0x00000002
59 #define GRUB_EFI_OPEN_PROTOCOL_TEST_PROTOCOL 0x00000004
60 #define GRUB_EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER 0x00000008
61 #define GRUB_EFI_OPEN_PROTOCOL_BY_DRIVER 0x00000010
62 #define GRUB_EFI_OPEN_PROTOCOL_BY_EXCLUSIVE 0x00000020
64 #define GRUB_EFI_OS_INDICATIONS_BOOT_TO_FW_UI 0x0000000000000001ULL
66 #define GRUB_EFI_VARIABLE_NON_VOLATILE 0x0000000000000001
67 #define GRUB_EFI_VARIABLE_BOOTSERVICE_ACCESS 0x0000000000000002
68 #define GRUB_EFI_VARIABLE_RUNTIME_ACCESS 0x0000000000000004
70 #define GRUB_EFI_TIME_ADJUST_DAYLIGHT 0x01
71 #define GRUB_EFI_TIME_IN_DAYLIGHT 0x02
73 #define GRUB_EFI_UNSPECIFIED_TIMEZONE 0x07FF
75 #define GRUB_EFI_OPTIONAL_PTR 0x00000001
77 #define GRUB_EFI_LOADED_IMAGE_GUID \
78 { 0x5b1b31a1, 0x9562, 0x11d2, \
79 { 0x8e, 0x3f, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
82 #define GRUB_EFI_DISK_IO_GUID \
83 { 0xce345171, 0xba0b, 0x11d2, \
84 { 0x8e, 0x4f, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
87 #define GRUB_EFI_BLOCK_IO_GUID \
88 { 0x964e5b21, 0x6459, 0x11d2, \
89 { 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
92 #define GRUB_EFI_SERIAL_IO_GUID \
93 { 0xbb25cf6f, 0xf1d4, 0x11d2, \
94 { 0x9a, 0x0c, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0xfd } \
97 #define GRUB_EFI_SIMPLE_NETWORK_GUID \
98 { 0xa19832b9, 0xac25, 0x11d3, \
99 { 0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
102 #define GRUB_EFI_PXE_GUID \
103 { 0x03c4e603, 0xac28, 0x11d3, \
104 { 0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
107 #define GRUB_EFI_DEVICE_PATH_GUID \
108 { 0x09576e91, 0x6d3f, 0x11d2, \
109 { 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
112 #define GRUB_EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID \
113 { 0x387477c1, 0x69c7, 0x11d2, \
114 { 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
117 #define GRUB_EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL_GUID \
118 { 0xdd9e7534, 0x7762, 0x4698, \
119 { 0x8c, 0x14, 0xf5, 0x85, 0x17, 0xa6, 0x25, 0xaa } \
122 #define GRUB_EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL_GUID \
123 { 0x387477c2, 0x69c7, 0x11d2, \
124 { 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
127 #define GRUB_EFI_SIMPLE_POINTER_PROTOCOL_GUID \
128 { 0x31878c87, 0xb75, 0x11d5, \
129 { 0x9a, 0x4f, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
132 #define GRUB_EFI_ABSOLUTE_POINTER_PROTOCOL_GUID \
133 { 0x8D59D32B, 0xC655, 0x4AE9, \
134 { 0x9B, 0x15, 0xF2, 0x59, 0x04, 0x99, 0x2A, 0x43 } \
137 #define GRUB_EFI_DRIVER_BINDING_PROTOCOL_GUID \
138 { 0x18A031AB, 0xB443, 0x4D1A, \
139 { 0xA5, 0xC0, 0x0C, 0x09, 0x26, 0x1E, 0x9F, 0x71 } \
142 #define GRUB_EFI_LOADED_IMAGE_PROTOCOL_GUID \
143 { 0x5B1B31A1, 0x9562, 0x11d2, \
144 { 0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B } \
147 #define GRUB_EFI_LOAD_FILE_PROTOCOL_GUID \
148 { 0x56EC3091, 0x954C, 0x11d2, \
149 { 0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B } \
152 #define GRUB_EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID \
153 { 0x0964e5b22, 0x6459, 0x11d2, \
154 { 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
157 #define GRUB_EFI_TAPE_IO_PROTOCOL_GUID \
158 { 0x1e93e633, 0xd65a, 0x459e, \
159 { 0xab, 0x84, 0x93, 0xd9, 0xec, 0x26, 0x6d, 0x18 } \
162 #define GRUB_EFI_UNICODE_COLLATION_PROTOCOL_GUID \
163 { 0x1d85cd7f, 0xf43d, 0x11d2, \
164 { 0x9a, 0x0c, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
167 #define GRUB_EFI_SCSI_IO_PROTOCOL_GUID \
168 { 0x932f47e6, 0x2362, 0x4002, \
169 { 0x80, 0x3e, 0x3c, 0xd5, 0x4b, 0x13, 0x8f, 0x85 } \
172 #define GRUB_EFI_USB2_HC_PROTOCOL_GUID \
173 { 0x3e745226, 0x9818, 0x45b6, \
174 { 0xa2, 0xac, 0xd7, 0xcd, 0x0e, 0x8b, 0xa2, 0xbc } \
177 #define GRUB_EFI_DEBUG_SUPPORT_PROTOCOL_GUID \
178 { 0x2755590C, 0x6F3C, 0x42FA, \
179 { 0x9E, 0xA4, 0xA3, 0xBA, 0x54, 0x3C, 0xDA, 0x25 } \
182 #define GRUB_EFI_DEBUGPORT_PROTOCOL_GUID \
183 { 0xEBA4E8D2, 0x3858, 0x41EC, \
184 { 0xA2, 0x81, 0x26, 0x47, 0xBA, 0x96, 0x60, 0xD0 } \
187 #define GRUB_EFI_DECOMPRESS_PROTOCOL_GUID \
188 { 0xd8117cfe, 0x94a6, 0x11d4, \
189 { 0x9a, 0x3a, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
192 #define GRUB_EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID \
193 { 0x8b843e20, 0x8132, 0x4852, \
194 { 0x90, 0xcc, 0x55, 0x1a, 0x4e, 0x4a, 0x7f, 0x1c } \
197 #define GRUB_EFI_DEVICE_PATH_UTILITIES_PROTOCOL_GUID \
198 { 0x379be4e, 0xd706, 0x437d, \
199 { 0xb0, 0x37, 0xed, 0xb8, 0x2f, 0xb7, 0x72, 0xa4 } \
202 #define GRUB_EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL_GUID \
203 { 0x5c99a21, 0xc70f, 0x4ad2, \
204 { 0x8a, 0x5f, 0x35, 0xdf, 0x33, 0x43, 0xf5, 0x1e } \
207 #define GRUB_EFI_ACPI_TABLE_PROTOCOL_GUID \
208 { 0xffe06bdd, 0x6107, 0x46a6, \
209 { 0x7b, 0xb2, 0x5a, 0x9c, 0x7e, 0xc5, 0x27, 0x5c} \
212 #define GRUB_EFI_HII_CONFIG_ROUTING_PROTOCOL_GUID \
213 { 0x587e72d7, 0xcc50, 0x4f79, \
214 { 0x82, 0x09, 0xca, 0x29, 0x1f, 0xc1, 0xa1, 0x0f } \
217 #define GRUB_EFI_HII_DATABASE_PROTOCOL_GUID \
218 { 0xef9fc172, 0xa1b2, 0x4693, \
219 { 0xb3, 0x27, 0x6d, 0x32, 0xfc, 0x41, 0x60, 0x42 } \
222 #define GRUB_EFI_HII_STRING_PROTOCOL_GUID \
223 { 0xfd96974, 0x23aa, 0x4cdc, \
224 { 0xb9, 0xcb, 0x98, 0xd1, 0x77, 0x50, 0x32, 0x2a } \
227 #define GRUB_EFI_HII_IMAGE_PROTOCOL_GUID \
228 { 0x31a6406a, 0x6bdf, 0x4e46, \
229 { 0xb2, 0xa2, 0xeb, 0xaa, 0x89, 0xc4, 0x9, 0x20 } \
232 #define GRUB_EFI_HII_FONT_PROTOCOL_GUID \
233 { 0xe9ca4775, 0x8657, 0x47fc, \
234 { 0x97, 0xe7, 0x7e, 0xd6, 0x5a, 0x8, 0x43, 0x24 } \
237 #define GRUB_EFI_HII_CONFIGURATION_ACCESS_PROTOCOL_GUID \
238 { 0x330d4706, 0xf2a0, 0x4e4f, \
239 { 0xa3, 0x69, 0xb6, 0x6f, 0xa8, 0xd5, 0x43, 0x85 } \
242 #define GRUB_EFI_COMPONENT_NAME2_PROTOCOL_GUID \
243 { 0x6a7a5cff, 0xe8d9, 0x4f70, \
244 { 0xba, 0xda, 0x75, 0xab, 0x30, 0x25, 0xce, 0x14} \
247 #define GRUB_EFI_USB_IO_PROTOCOL_GUID \
248 { 0x2B2F68D6, 0x0CD2, 0x44cf, \
249 { 0x8E, 0x8B, 0xBB, 0xA2, 0x0B, 0x1B, 0x5B, 0x75 } \
252 #define GRUB_EFI_TIANO_CUSTOM_DECOMPRESS_GUID \
253 { 0xa31280ad, 0x481e, 0x41b6, \
254 { 0x95, 0xe8, 0x12, 0x7f, 0x4c, 0x98, 0x47, 0x79 } \
257 #define GRUB_EFI_CRC32_GUIDED_SECTION_EXTRACTION_GUID \
258 { 0xfc1bcdb0, 0x7d31, 0x49aa, \
259 { 0x93, 0x6a, 0xa4, 0x60, 0x0d, 0x9d, 0xd0, 0x83 } \
262 #define GRUB_EFI_LZMA_CUSTOM_DECOMPRESS_GUID \
263 { 0xee4e5898, 0x3914, 0x4259, \
264 { 0x9d, 0x6e, 0xdc, 0x7b, 0xd7, 0x94, 0x03, 0xcf } \
267 #define GRUB_EFI_TSC_FREQUENCY_GUID \
268 { 0xdba6a7e3, 0xbb57, 0x4be7, \
269 { 0x8a, 0xf8, 0xd5, 0x78, 0xdb, 0x7e, 0x56, 0x87 } \
272 #define GRUB_EFI_SYSTEM_RESOURCE_TABLE_GUID \
273 { 0xb122a263, 0x3661, 0x4f68, \
274 { 0x99, 0x29, 0x78, 0xf8, 0xb0, 0xd6, 0x21, 0x80 } \
277 #define GRUB_EFI_DXE_SERVICES_TABLE_GUID \
278 { 0x05ad34ba, 0x6f02, 0x4214, \
279 { 0x95, 0x2e, 0x4d, 0xa0, 0x39, 0x8e, 0x2b, 0xb9 } \
282 #define GRUB_EFI_HOB_LIST_GUID \
283 { 0x7739f24c, 0x93d7, 0x11d4, \
284 { 0x9a, 0x3a, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
287 #define GRUB_EFI_MEMORY_TYPE_INFORMATION_GUID \
288 { 0x4c19049f, 0x4137, 0x4dd3, \
289 { 0x9c, 0x10, 0x8b, 0x97, 0xa8, 0x3f, 0xfd, 0xfa } \
292 #define GRUB_EFI_DEBUG_IMAGE_INFO_TABLE_GUID \
293 { 0x49152e77, 0x1ada, 0x4764, \
294 { 0xb7, 0xa2, 0x7a, 0xfe, 0xfe, 0xd9, 0x5e, 0x8b } \
297 #define GRUB_EFI_MPS_TABLE_GUID \
298 { 0xeb9d2d2f, 0x2d88, 0x11d3, \
299 { 0x9a, 0x16, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
302 #define GRUB_EFI_ACPI_TABLE_GUID \
303 { 0xeb9d2d30, 0x2d88, 0x11d3, \
304 { 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
307 #define GRUB_EFI_ACPI_20_TABLE_GUID \
308 { 0x8868e871, 0xe4f1, 0x11d3, \
309 { 0xbc, 0x22, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \
312 #define GRUB_EFI_SMBIOS_TABLE_GUID \
313 { 0xeb9d2d31, 0x2d88, 0x11d3, \
314 { 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
317 #define GRUB_EFI_SAL_TABLE_GUID \
318 { 0xeb9d2d32, 0x2d88, 0x11d3, \
319 { 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
322 #define GRUB_EFI_HCDP_TABLE_GUID \
323 { 0xf951938d, 0x620b, 0x42ef, \
324 { 0x82, 0x79, 0xa8, 0x4b, 0x79, 0x61, 0x78, 0x98 } \
327 #define GRUB_EFI_DEVICE_TREE_GUID \
328 { 0xb1b621d5, 0xf19c, 0x41a5, \
329 { 0x83, 0x0b, 0xd9, 0x15, 0x2c, 0x69, 0xaa, 0xe0 } \
332 #define GRUB_EFI_VENDOR_APPLE_GUID \
333 { 0x2B0585EB, 0xD8B8, 0x49A9, \
334 { 0x8B, 0x8C, 0xE2, 0x1B, 0x01, 0xAE, 0xF2, 0xB7 } \
337 struct grub_efi_sal_system_table
339 grub_uint32_t signature
;
340 grub_uint32_t total_table_len
;
341 grub_uint16_t sal_rev
;
342 grub_uint16_t entry_count
;
343 grub_uint8_t checksum
;
344 grub_uint8_t reserved1
[7];
345 grub_uint16_t sal_a_version
;
346 grub_uint16_t sal_b_version
;
347 grub_uint8_t oem_id
[32];
348 grub_uint8_t product_id
[32];
349 grub_uint8_t reserved2
[8];
350 grub_uint8_t entries
[0];
355 GRUB_EFI_SAL_SYSTEM_TABLE_TYPE_ENTRYPOINT_DESCRIPTOR
= 0,
356 GRUB_EFI_SAL_SYSTEM_TABLE_TYPE_MEMORY_DESCRIPTOR
= 1,
357 GRUB_EFI_SAL_SYSTEM_TABLE_TYPE_PLATFORM_FEATURES
= 2,
358 GRUB_EFI_SAL_SYSTEM_TABLE_TYPE_TRANSLATION_REGISTER_DESCRIPTOR
= 3,
359 GRUB_EFI_SAL_SYSTEM_TABLE_TYPE_PURGE_TRANSLATION_COHERENCE
= 4,
360 GRUB_EFI_SAL_SYSTEM_TABLE_TYPE_AP_WAKEUP
= 5
363 struct grub_efi_sal_system_table_entrypoint_descriptor
367 grub_uint64_t pal_proc_addr
;
368 grub_uint64_t sal_proc_addr
;
369 grub_uint64_t global_data_ptr
;
370 grub_uint64_t reserved
[2];
373 struct grub_efi_sal_system_table_memory_descriptor
376 grub_uint8_t sal_used
;
379 grub_uint8_t attr_mask
;
380 grub_uint8_t mem_type
;
382 grub_uint8_t unknown
;
385 grub_uint64_t unknown2
;
388 struct grub_efi_sal_system_table_platform_features
392 grub_uint8_t reserved
[14];
395 struct grub_efi_sal_system_table_translation_register_descriptor
398 grub_uint8_t register_type
;
399 grub_uint8_t register_number
;
400 grub_uint8_t reserved
[5];
402 grub_uint64_t page_size
;
403 grub_uint64_t reserver
;
406 struct grub_efi_sal_system_table_purge_translation_coherence
409 grub_uint8_t reserved
[3];
410 grub_uint32_t ndomains
;
411 grub_uint64_t coherence
;
414 struct grub_efi_sal_system_table_ap_wakeup
417 grub_uint8_t mechanism
;
418 grub_uint8_t reserved
[6];
419 grub_uint64_t vector
;
424 GRUB_EFI_SAL_SYSTEM_TABLE_PLATFORM_FEATURE_BUSLOCK
= 1,
425 GRUB_EFI_SAL_SYSTEM_TABLE_PLATFORM_FEATURE_IRQREDIRECT
= 2,
426 GRUB_EFI_SAL_SYSTEM_TABLE_PLATFORM_FEATURE_IPIREDIRECT
= 4,
427 GRUB_EFI_SAL_SYSTEM_TABLE_PLATFORM_FEATURE_ITCDRIFT
= 8,
430 typedef enum grub_efi_parity_type
432 GRUB_EFI_SERIAL_DEFAULT_PARITY
,
433 GRUB_EFI_SERIAL_NO_PARITY
,
434 GRUB_EFI_SERIAL_EVEN_PARITY
,
435 GRUB_EFI_SERIAL_ODD_PARITY
437 grub_efi_parity_type_t
;
439 typedef enum grub_efi_stop_bits
441 GRUB_EFI_SERIAL_DEFAULT_STOP_BITS
,
442 GRUB_EFI_SERIAL_1_STOP_BIT
,
443 GRUB_EFI_SERIAL_1_5_STOP_BITS
,
444 GRUB_EFI_SERIAL_2_STOP_BITS
446 grub_efi_stop_bits_t
;
449 enum grub_efi_timer_delay
451 GRUB_EFI_TIMER_CANCEL
,
452 GRUB_EFI_TIMER_PERIODIC
,
453 GRUB_EFI_TIMER_RELATIVE
455 typedef enum grub_efi_timer_delay grub_efi_timer_delay_t
;
457 enum grub_efi_allocate_type
459 GRUB_EFI_ALLOCATE_ANY_PAGES
,
460 GRUB_EFI_ALLOCATE_MAX_ADDRESS
,
461 GRUB_EFI_ALLOCATE_ADDRESS
,
462 GRUB_EFI_MAX_ALLOCATION_TYPE
464 typedef enum grub_efi_allocate_type grub_efi_allocate_type_t
;
466 enum grub_efi_memory_type
468 GRUB_EFI_RESERVED_MEMORY_TYPE
,
469 GRUB_EFI_LOADER_CODE
,
470 GRUB_EFI_LOADER_DATA
,
471 GRUB_EFI_BOOT_SERVICES_CODE
,
472 GRUB_EFI_BOOT_SERVICES_DATA
,
473 GRUB_EFI_RUNTIME_SERVICES_CODE
,
474 GRUB_EFI_RUNTIME_SERVICES_DATA
,
475 GRUB_EFI_CONVENTIONAL_MEMORY
,
476 GRUB_EFI_UNUSABLE_MEMORY
,
477 GRUB_EFI_ACPI_RECLAIM_MEMORY
,
478 GRUB_EFI_ACPI_MEMORY_NVS
,
479 GRUB_EFI_MEMORY_MAPPED_IO
,
480 GRUB_EFI_MEMORY_MAPPED_IO_PORT_SPACE
,
482 GRUB_EFI_PERSISTENT_MEMORY
,
483 GRUB_EFI_MAX_MEMORY_TYPE
485 typedef enum grub_efi_memory_type grub_efi_memory_type_t
;
487 enum grub_efi_interface_type
489 GRUB_EFI_NATIVE_INTERFACE
491 typedef enum grub_efi_interface_type grub_efi_interface_type_t
;
493 enum grub_efi_locate_search_type
495 GRUB_EFI_ALL_HANDLES
,
496 GRUB_EFI_BY_REGISTER_NOTIFY
,
499 typedef enum grub_efi_locate_search_type grub_efi_locate_search_type_t
;
501 enum grub_efi_reset_type
505 GRUB_EFI_RESET_SHUTDOWN
507 typedef enum grub_efi_reset_type grub_efi_reset_type_t
;
510 typedef char grub_efi_boolean_t
;
511 #if GRUB_CPU_SIZEOF_VOID_P == 8
512 typedef grub_int64_t grub_efi_intn_t
;
513 typedef grub_uint64_t grub_efi_uintn_t
;
515 typedef grub_int32_t grub_efi_intn_t
;
516 typedef grub_uint32_t grub_efi_uintn_t
;
518 typedef grub_int8_t grub_efi_int8_t
;
519 typedef grub_uint8_t grub_efi_uint8_t
;
520 typedef grub_int16_t grub_efi_int16_t
;
521 typedef grub_uint16_t grub_efi_uint16_t
;
522 typedef grub_int32_t grub_efi_int32_t
;
523 typedef grub_uint32_t grub_efi_uint32_t
;
524 typedef grub_int64_t grub_efi_int64_t
;
525 typedef grub_uint64_t grub_efi_uint64_t
;
526 typedef grub_uint8_t grub_efi_char8_t
;
527 typedef grub_uint16_t grub_efi_char16_t
;
529 typedef grub_efi_intn_t grub_efi_status_t
;
531 #define GRUB_EFI_ERROR_CODE(value) \
532 ((((grub_efi_status_t) 1) << (sizeof (grub_efi_status_t) * 8 - 1)) | (value))
534 #define GRUB_EFI_WARNING_CODE(value) (value)
536 #define GRUB_EFI_SUCCESS 0
538 #define GRUB_EFI_LOAD_ERROR GRUB_EFI_ERROR_CODE (1)
539 #define GRUB_EFI_INVALID_PARAMETER GRUB_EFI_ERROR_CODE (2)
540 #define GRUB_EFI_UNSUPPORTED GRUB_EFI_ERROR_CODE (3)
541 #define GRUB_EFI_BAD_BUFFER_SIZE GRUB_EFI_ERROR_CODE (4)
542 #define GRUB_EFI_BUFFER_TOO_SMALL GRUB_EFI_ERROR_CODE (5)
543 #define GRUB_EFI_NOT_READY GRUB_EFI_ERROR_CODE (6)
544 #define GRUB_EFI_DEVICE_ERROR GRUB_EFI_ERROR_CODE (7)
545 #define GRUB_EFI_WRITE_PROTECTED GRUB_EFI_ERROR_CODE (8)
546 #define GRUB_EFI_OUT_OF_RESOURCES GRUB_EFI_ERROR_CODE (9)
547 #define GRUB_EFI_VOLUME_CORRUPTED GRUB_EFI_ERROR_CODE (10)
548 #define GRUB_EFI_VOLUME_FULL GRUB_EFI_ERROR_CODE (11)
549 #define GRUB_EFI_NO_MEDIA GRUB_EFI_ERROR_CODE (12)
550 #define GRUB_EFI_MEDIA_CHANGED GRUB_EFI_ERROR_CODE (13)
551 #define GRUB_EFI_NOT_FOUND GRUB_EFI_ERROR_CODE (14)
552 #define GRUB_EFI_ACCESS_DENIED GRUB_EFI_ERROR_CODE (15)
553 #define GRUB_EFI_NO_RESPONSE GRUB_EFI_ERROR_CODE (16)
554 #define GRUB_EFI_NO_MAPPING GRUB_EFI_ERROR_CODE (17)
555 #define GRUB_EFI_TIMEOUT GRUB_EFI_ERROR_CODE (18)
556 #define GRUB_EFI_NOT_STARTED GRUB_EFI_ERROR_CODE (19)
557 #define GRUB_EFI_ALREADY_STARTED GRUB_EFI_ERROR_CODE (20)
558 #define GRUB_EFI_ABORTED GRUB_EFI_ERROR_CODE (21)
559 #define GRUB_EFI_ICMP_ERROR GRUB_EFI_ERROR_CODE (22)
560 #define GRUB_EFI_TFTP_ERROR GRUB_EFI_ERROR_CODE (23)
561 #define GRUB_EFI_PROTOCOL_ERROR GRUB_EFI_ERROR_CODE (24)
562 #define GRUB_EFI_INCOMPATIBLE_VERSION GRUB_EFI_ERROR_CODE (25)
563 #define GRUB_EFI_SECURITY_VIOLATION GRUB_EFI_ERROR_CODE (26)
564 #define GRUB_EFI_CRC_ERROR GRUB_EFI_ERROR_CODE (27)
566 #define GRUB_EFI_WARN_UNKNOWN_GLYPH GRUB_EFI_WARNING_CODE (1)
567 #define GRUB_EFI_WARN_DELETE_FAILURE GRUB_EFI_WARNING_CODE (2)
568 #define GRUB_EFI_WARN_WRITE_FAILURE GRUB_EFI_WARNING_CODE (3)
569 #define GRUB_EFI_WARN_BUFFER_TOO_SMALL GRUB_EFI_WARNING_CODE (4)
571 typedef void *grub_efi_handle_t
;
572 typedef void *grub_efi_event_t
;
573 typedef grub_efi_uint64_t grub_efi_lba_t
;
574 typedef grub_efi_uintn_t grub_efi_tpl_t
;
575 typedef grub_uint8_t grub_efi_mac_address_t
[32];
576 typedef grub_uint8_t grub_efi_ipv4_address_t
[4];
577 typedef grub_uint16_t grub_efi_ipv6_address_t
[8];
578 typedef grub_uint8_t grub_efi_ip_address_t
[8] __attribute__ ((aligned(4)));
579 typedef grub_efi_uint64_t grub_efi_physical_address_t
;
580 typedef grub_efi_uint64_t grub_efi_virtual_address_t
;
587 grub_uint8_t data4
[8];
588 } __attribute__ ((aligned(8)));
589 typedef struct grub_efi_guid grub_efi_guid_t
;
591 struct grub_efi_packed_guid
596 grub_uint8_t data4
[8];
598 typedef struct grub_efi_packed_guid grub_efi_packed_guid_t
;
600 /* XXX although the spec does not specify the padding, this actually
601 must have the padding! */
602 struct grub_efi_memory_descriptor
604 grub_efi_uint32_t type
;
605 grub_efi_uint32_t padding
;
606 grub_efi_physical_address_t physical_start
;
607 grub_efi_virtual_address_t virtual_start
;
608 grub_efi_uint64_t num_pages
;
609 grub_efi_uint64_t attribute
;
611 typedef struct grub_efi_memory_descriptor grub_efi_memory_descriptor_t
;
613 /* Device Path definitions. */
614 struct grub_efi_device_path
616 grub_efi_uint8_t type
;
617 grub_efi_uint8_t subtype
;
618 grub_efi_uint16_t length
;
620 typedef struct grub_efi_device_path grub_efi_device_path_t
;
621 /* XXX EFI does not define EFI_DEVICE_PATH_PROTOCOL but uses it.
622 It seems to be identical to EFI_DEVICE_PATH. */
623 typedef struct grub_efi_device_path grub_efi_device_path_protocol_t
;
625 #define GRUB_EFI_DEVICE_PATH_TYPE(dp) ((dp)->type & 0x7f)
626 #define GRUB_EFI_DEVICE_PATH_SUBTYPE(dp) ((dp)->subtype)
627 #define GRUB_EFI_DEVICE_PATH_LENGTH(dp) ((dp)->length)
629 /* The End of Device Path nodes. */
630 #define GRUB_EFI_END_DEVICE_PATH_TYPE (0xff & 0x7f)
632 #define GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE 0xff
633 #define GRUB_EFI_END_THIS_DEVICE_PATH_SUBTYPE 0x01
635 #define GRUB_EFI_END_ENTIRE_DEVICE_PATH(dp) \
636 (GRUB_EFI_DEVICE_PATH_TYPE (dp) == GRUB_EFI_END_DEVICE_PATH_TYPE \
637 && (GRUB_EFI_DEVICE_PATH_SUBTYPE (dp) \
638 == GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE))
640 #define GRUB_EFI_NEXT_DEVICE_PATH(dp) \
641 ((grub_efi_device_path_t *) ((char *) (dp) \
642 + GRUB_EFI_DEVICE_PATH_LENGTH (dp)))
644 /* Hardware Device Path. */
645 #define GRUB_EFI_HARDWARE_DEVICE_PATH_TYPE 1
647 #define GRUB_EFI_PCI_DEVICE_PATH_SUBTYPE 1
649 struct grub_efi_pci_device_path
651 grub_efi_device_path_t header
;
652 grub_efi_uint8_t function
;
653 grub_efi_uint8_t device
;
655 typedef struct grub_efi_pci_device_path grub_efi_pci_device_path_t
;
657 #define GRUB_EFI_PCCARD_DEVICE_PATH_SUBTYPE 2
659 struct grub_efi_pccard_device_path
661 grub_efi_device_path_t header
;
662 grub_efi_uint8_t function
;
664 typedef struct grub_efi_pccard_device_path grub_efi_pccard_device_path_t
;
666 #define GRUB_EFI_MEMORY_MAPPED_DEVICE_PATH_SUBTYPE 3
668 struct grub_efi_memory_mapped_device_path
670 grub_efi_device_path_t header
;
671 grub_efi_uint32_t memory_type
;
672 grub_efi_physical_address_t start_address
;
673 grub_efi_physical_address_t end_address
;
675 typedef struct grub_efi_memory_mapped_device_path grub_efi_memory_mapped_device_path_t
;
677 #define GRUB_EFI_VENDOR_DEVICE_PATH_SUBTYPE 4
679 struct grub_efi_vendor_device_path
681 grub_efi_device_path_t header
;
682 grub_efi_packed_guid_t vendor_guid
;
683 grub_efi_uint8_t vendor_defined_data
[0];
685 typedef struct grub_efi_vendor_device_path grub_efi_vendor_device_path_t
;
687 #define GRUB_EFI_CONTROLLER_DEVICE_PATH_SUBTYPE 5
689 struct grub_efi_controller_device_path
691 grub_efi_device_path_t header
;
692 grub_efi_uint32_t controller_number
;
694 typedef struct grub_efi_controller_device_path grub_efi_controller_device_path_t
;
696 /* ACPI Device Path. */
697 #define GRUB_EFI_ACPI_DEVICE_PATH_TYPE 2
699 #define GRUB_EFI_ACPI_DEVICE_PATH_SUBTYPE 1
701 struct grub_efi_acpi_device_path
703 grub_efi_device_path_t header
;
704 grub_efi_uint32_t hid
;
705 grub_efi_uint32_t uid
;
707 typedef struct grub_efi_acpi_device_path grub_efi_acpi_device_path_t
;
709 #define GRUB_EFI_EXPANDED_ACPI_DEVICE_PATH_SUBTYPE 2
711 struct grub_efi_expanded_acpi_device_path
713 grub_efi_device_path_t header
;
714 grub_efi_uint32_t hid
;
715 grub_efi_uint32_t uid
;
716 grub_efi_uint32_t cid
;
719 typedef struct grub_efi_expanded_acpi_device_path grub_efi_expanded_acpi_device_path_t
;
721 #define GRUB_EFI_EXPANDED_ACPI_HIDSTR(dp) \
722 (((grub_efi_expanded_acpi_device_path_t *) dp)->hidstr)
723 #define GRUB_EFI_EXPANDED_ACPI_UIDSTR(dp) \
724 (GRUB_EFI_EXPANDED_ACPI_HIDSTR(dp) \
725 + grub_strlen (GRUB_EFI_EXPANDED_ACPI_HIDSTR(dp)) + 1)
726 #define GRUB_EFI_EXPANDED_ACPI_CIDSTR(dp) \
727 (GRUB_EFI_EXPANDED_ACPI_UIDSTR(dp) \
728 + grub_strlen (GRUB_EFI_EXPANDED_ACPI_UIDSTR(dp)) + 1)
730 /* Messaging Device Path. */
731 #define GRUB_EFI_MESSAGING_DEVICE_PATH_TYPE 3
733 #define GRUB_EFI_ATAPI_DEVICE_PATH_SUBTYPE 1
735 struct grub_efi_atapi_device_path
737 grub_efi_device_path_t header
;
738 grub_efi_uint8_t primary_secondary
;
739 grub_efi_uint8_t slave_master
;
740 grub_efi_uint16_t lun
;
742 typedef struct grub_efi_atapi_device_path grub_efi_atapi_device_path_t
;
744 #define GRUB_EFI_SCSI_DEVICE_PATH_SUBTYPE 2
746 struct grub_efi_scsi_device_path
748 grub_efi_device_path_t header
;
749 grub_efi_uint16_t pun
;
750 grub_efi_uint16_t lun
;
752 typedef struct grub_efi_scsi_device_path grub_efi_scsi_device_path_t
;
754 #define GRUB_EFI_FIBRE_CHANNEL_DEVICE_PATH_SUBTYPE 3
756 struct grub_efi_fibre_channel_device_path
758 grub_efi_device_path_t header
;
759 grub_efi_uint32_t reserved
;
760 grub_efi_uint64_t wwn
;
761 grub_efi_uint64_t lun
;
763 typedef struct grub_efi_fibre_channel_device_path grub_efi_fibre_channel_device_path_t
;
765 #define GRUB_EFI_1394_DEVICE_PATH_SUBTYPE 4
767 struct grub_efi_1394_device_path
769 grub_efi_device_path_t header
;
770 grub_efi_uint32_t reserved
;
771 grub_efi_uint64_t guid
;
773 typedef struct grub_efi_1394_device_path grub_efi_1394_device_path_t
;
775 #define GRUB_EFI_USB_DEVICE_PATH_SUBTYPE 5
777 struct grub_efi_usb_device_path
779 grub_efi_device_path_t header
;
780 grub_efi_uint8_t parent_port_number
;
781 grub_efi_uint8_t usb_interface
;
783 typedef struct grub_efi_usb_device_path grub_efi_usb_device_path_t
;
785 #define GRUB_EFI_USB_CLASS_DEVICE_PATH_SUBTYPE 15
787 struct grub_efi_usb_class_device_path
789 grub_efi_device_path_t header
;
790 grub_efi_uint16_t vendor_id
;
791 grub_efi_uint16_t product_id
;
792 grub_efi_uint8_t device_class
;
793 grub_efi_uint8_t device_subclass
;
794 grub_efi_uint8_t device_protocol
;
796 typedef struct grub_efi_usb_class_device_path grub_efi_usb_class_device_path_t
;
798 #define GRUB_EFI_I2O_DEVICE_PATH_SUBTYPE 6
800 struct grub_efi_i2o_device_path
802 grub_efi_device_path_t header
;
803 grub_efi_uint32_t tid
;
805 typedef struct grub_efi_i2o_device_path grub_efi_i2o_device_path_t
;
807 #define GRUB_EFI_MAC_ADDRESS_DEVICE_PATH_SUBTYPE 11
809 struct grub_efi_mac_address_device_path
811 grub_efi_device_path_t header
;
812 grub_efi_mac_address_t mac_address
;
813 grub_efi_uint8_t if_type
;
815 typedef struct grub_efi_mac_address_device_path grub_efi_mac_address_device_path_t
;
817 #define GRUB_EFI_IPV4_DEVICE_PATH_SUBTYPE 12
819 struct grub_efi_ipv4_device_path
821 grub_efi_device_path_t header
;
822 grub_efi_ipv4_address_t local_ip_address
;
823 grub_efi_ipv4_address_t remote_ip_address
;
824 grub_efi_uint16_t local_port
;
825 grub_efi_uint16_t remote_port
;
826 grub_efi_uint16_t protocol
;
827 grub_efi_uint8_t static_ip_address
;
829 typedef struct grub_efi_ipv4_device_path grub_efi_ipv4_device_path_t
;
831 #define GRUB_EFI_IPV6_DEVICE_PATH_SUBTYPE 13
833 struct grub_efi_ipv6_device_path
835 grub_efi_device_path_t header
;
836 grub_efi_ipv6_address_t local_ip_address
;
837 grub_efi_ipv6_address_t remote_ip_address
;
838 grub_efi_uint16_t local_port
;
839 grub_efi_uint16_t remote_port
;
840 grub_efi_uint16_t protocol
;
841 grub_efi_uint8_t static_ip_address
;
843 typedef struct grub_efi_ipv6_device_path grub_efi_ipv6_device_path_t
;
845 #define GRUB_EFI_INFINIBAND_DEVICE_PATH_SUBTYPE 9
847 struct grub_efi_infiniband_device_path
849 grub_efi_device_path_t header
;
850 grub_efi_uint32_t resource_flags
;
851 grub_efi_uint8_t port_gid
[16];
852 grub_efi_uint64_t remote_id
;
853 grub_efi_uint64_t target_port_id
;
854 grub_efi_uint64_t device_id
;
856 typedef struct grub_efi_infiniband_device_path grub_efi_infiniband_device_path_t
;
858 #define GRUB_EFI_UART_DEVICE_PATH_SUBTYPE 14
860 struct grub_efi_uart_device_path
862 grub_efi_device_path_t header
;
863 grub_efi_uint32_t reserved
;
864 grub_efi_uint64_t baud_rate
;
865 grub_efi_uint8_t data_bits
;
866 grub_efi_uint8_t parity
;
867 grub_efi_uint8_t stop_bits
;
869 typedef struct grub_efi_uart_device_path grub_efi_uart_device_path_t
;
871 #define GRUB_EFI_SATA_DEVICE_PATH_SUBTYPE 18
873 struct grub_efi_sata_device_path
875 grub_efi_device_path_t header
;
876 grub_efi_uint16_t hba_port
;
877 grub_efi_uint16_t multiplier_port
;
878 grub_efi_uint16_t lun
;
880 typedef struct grub_efi_sata_device_path grub_efi_sata_device_path_t
;
882 #define GRUB_EFI_VENDOR_MESSAGING_DEVICE_PATH_SUBTYPE 10
884 /* Media Device Path. */
885 #define GRUB_EFI_MEDIA_DEVICE_PATH_TYPE 4
887 #define GRUB_EFI_HARD_DRIVE_DEVICE_PATH_SUBTYPE 1
889 struct grub_efi_hard_drive_device_path
891 grub_efi_device_path_t header
;
892 grub_efi_uint32_t partition_number
;
893 grub_efi_lba_t partition_start
;
894 grub_efi_lba_t partition_size
;
895 grub_efi_uint8_t partition_signature
[16];
896 grub_efi_uint8_t partmap_type
;
897 grub_efi_uint8_t signature_type
;
899 typedef struct grub_efi_hard_drive_device_path grub_efi_hard_drive_device_path_t
;
901 #define GRUB_EFI_CDROM_DEVICE_PATH_SUBTYPE 2
903 struct grub_efi_cdrom_device_path
905 grub_efi_device_path_t header
;
906 grub_efi_uint32_t boot_entry
;
907 grub_efi_lba_t partition_start
;
908 grub_efi_lba_t partition_size
;
910 typedef struct grub_efi_cdrom_device_path grub_efi_cdrom_device_path_t
;
912 #define GRUB_EFI_VENDOR_MEDIA_DEVICE_PATH_SUBTYPE 3
914 struct grub_efi_vendor_media_device_path
916 grub_efi_device_path_t header
;
917 grub_efi_packed_guid_t vendor_guid
;
918 grub_efi_uint8_t vendor_defined_data
[0];
920 typedef struct grub_efi_vendor_media_device_path grub_efi_vendor_media_device_path_t
;
922 #define GRUB_EFI_FILE_PATH_DEVICE_PATH_SUBTYPE 4
924 struct grub_efi_file_path_device_path
926 grub_efi_device_path_t header
;
927 grub_efi_char16_t path_name
[0];
929 typedef struct grub_efi_file_path_device_path grub_efi_file_path_device_path_t
;
931 #define GRUB_EFI_PROTOCOL_DEVICE_PATH_SUBTYPE 5
933 struct grub_efi_protocol_device_path
935 grub_efi_device_path_t header
;
936 grub_efi_packed_guid_t guid
;
938 typedef struct grub_efi_protocol_device_path grub_efi_protocol_device_path_t
;
940 #define GRUB_EFI_PIWG_DEVICE_PATH_SUBTYPE 6
942 struct grub_efi_piwg_device_path
944 grub_efi_device_path_t header
;
945 grub_efi_packed_guid_t guid
;
947 typedef struct grub_efi_piwg_device_path grub_efi_piwg_device_path_t
;
950 /* BIOS Boot Specification Device Path. */
951 #define GRUB_EFI_BIOS_DEVICE_PATH_TYPE 5
953 #define GRUB_EFI_BIOS_DEVICE_PATH_SUBTYPE 1
955 struct grub_efi_bios_device_path
957 grub_efi_device_path_t header
;
958 grub_efi_uint16_t device_type
;
959 grub_efi_uint16_t status_flags
;
962 typedef struct grub_efi_bios_device_path grub_efi_bios_device_path_t
;
964 struct grub_efi_open_protocol_information_entry
966 grub_efi_handle_t agent_handle
;
967 grub_efi_handle_t controller_handle
;
968 grub_efi_uint32_t attributes
;
969 grub_efi_uint32_t open_count
;
971 typedef struct grub_efi_open_protocol_information_entry grub_efi_open_protocol_information_entry_t
;
975 grub_efi_uint16_t year
;
976 grub_efi_uint8_t month
;
977 grub_efi_uint8_t day
;
978 grub_efi_uint8_t hour
;
979 grub_efi_uint8_t minute
;
980 grub_efi_uint8_t second
;
981 grub_efi_uint8_t pad1
;
982 grub_efi_uint32_t nanosecond
;
983 grub_efi_int16_t time_zone
;
984 grub_efi_uint8_t daylight
;
985 grub_efi_uint8_t pad2
;
987 typedef struct grub_efi_time grub_efi_time_t
;
989 struct grub_efi_time_capabilities
991 grub_efi_uint32_t resolution
;
992 grub_efi_uint32_t accuracy
;
993 grub_efi_boolean_t sets_to_zero
;
995 typedef struct grub_efi_time_capabilities grub_efi_time_capabilities_t
;
997 struct grub_efi_input_key
999 grub_efi_uint16_t scan_code
;
1000 grub_efi_char16_t unicode_char
;
1002 typedef struct grub_efi_input_key grub_efi_input_key_t
;
1004 typedef grub_efi_uint8_t grub_efi_key_toggle_state_t
;
1005 struct grub_efi_key_state
1007 grub_efi_uint32_t key_shift_state
;
1008 grub_efi_key_toggle_state_t key_toggle_state
;
1010 typedef struct grub_efi_key_state grub_efi_key_state_t
;
1012 #define GRUB_EFI_SHIFT_STATE_VALID 0x80000000
1013 #define GRUB_EFI_RIGHT_SHIFT_PRESSED 0x00000001
1014 #define GRUB_EFI_LEFT_SHIFT_PRESSED 0x00000002
1015 #define GRUB_EFI_RIGHT_CONTROL_PRESSED 0x00000004
1016 #define GRUB_EFI_LEFT_CONTROL_PRESSED 0x00000008
1017 #define GRUB_EFI_RIGHT_ALT_PRESSED 0x00000010
1018 #define GRUB_EFI_LEFT_ALT_PRESSED 0x00000020
1019 #define GRUB_EFI_RIGHT_LOGO_PRESSED 0x00000040
1020 #define GRUB_EFI_LEFT_LOGO_PRESSED 0x00000080
1021 #define GRUB_EFI_MENU_KEY_PRESSED 0x00000100
1022 #define GRUB_EFI_SYS_REQ_PRESSED 0x00000200
1024 #define GRUB_EFI_TOGGLE_STATE_VALID 0x80
1025 #define GRUB_EFI_KEY_STATE_EXPOSED 0x40
1026 #define GRUB_EFI_SCROLL_LOCK_ACTIVE 0x01
1027 #define GRUB_EFI_NUM_LOCK_ACTIVE 0x02
1028 #define GRUB_EFI_CAPS_LOCK_ACTIVE 0x04
1030 struct grub_efi_simple_text_output_mode
1032 grub_efi_int32_t max_mode
;
1033 grub_efi_int32_t mode
;
1034 grub_efi_int32_t attribute
;
1035 grub_efi_int32_t cursor_column
;
1036 grub_efi_int32_t cursor_row
;
1037 grub_efi_boolean_t cursor_visible
;
1039 typedef struct grub_efi_simple_text_output_mode grub_efi_simple_text_output_mode_t
;
1042 struct grub_efi_table_header
1044 grub_efi_uint64_t signature
;
1045 grub_efi_uint32_t revision
;
1046 grub_efi_uint32_t header_size
;
1047 grub_efi_uint32_t crc32
;
1048 grub_efi_uint32_t reserved
;
1050 typedef struct grub_efi_table_header grub_efi_table_header_t
;
1052 struct grub_efi_boot_services
1054 grub_efi_table_header_t hdr
;
1057 (*raise_tpl
) (grub_efi_tpl_t new_tpl
);
1060 (*restore_tpl
) (grub_efi_tpl_t old_tpl
);
1063 (*allocate_pages
) (grub_efi_allocate_type_t type
,
1064 grub_efi_memory_type_t memory_type
,
1065 grub_efi_uintn_t pages
,
1066 grub_efi_physical_address_t
*memory
);
1069 (*free_pages
) (grub_efi_physical_address_t memory
,
1070 grub_efi_uintn_t pages
);
1073 (*get_memory_map
) (grub_efi_uintn_t
*memory_map_size
,
1074 grub_efi_memory_descriptor_t
*memory_map
,
1075 grub_efi_uintn_t
*map_key
,
1076 grub_efi_uintn_t
*descriptor_size
,
1077 grub_efi_uint32_t
*descriptor_version
);
1080 (*allocate_pool
) (grub_efi_memory_type_t pool_type
,
1081 grub_efi_uintn_t size
,
1085 (*free_pool
) (void *buffer
);
1088 (*create_event
) (grub_efi_uint32_t type
,
1089 grub_efi_tpl_t notify_tpl
,
1090 void (*notify_function
) (grub_efi_event_t event
,
1092 void *notify_context
,
1093 grub_efi_event_t
*event
);
1096 (*set_timer
) (grub_efi_event_t event
,
1097 grub_efi_timer_delay_t type
,
1098 grub_efi_uint64_t trigger_time
);
1101 (*wait_for_event
) (grub_efi_uintn_t num_events
,
1102 grub_efi_event_t
*event
,
1103 grub_efi_uintn_t
*index
);
1106 (*signal_event
) (grub_efi_event_t event
);
1109 (*close_event
) (grub_efi_event_t event
);
1112 (*check_event
) (grub_efi_event_t event
);
1115 (*install_protocol_interface
) (grub_efi_handle_t
*handle
,
1116 grub_efi_guid_t
*protocol
,
1117 grub_efi_interface_type_t protocol_interface_type
,
1118 void *protocol_interface
);
1121 (*reinstall_protocol_interface
) (grub_efi_handle_t handle
,
1122 grub_efi_guid_t
*protocol
,
1123 void *old_interface
,
1124 void *new_interface
);
1127 (*uninstall_protocol_interface
) (grub_efi_handle_t handle
,
1128 grub_efi_guid_t
*protocol
,
1129 void *protocol_interface
);
1132 (*handle_protocol
) (grub_efi_handle_t handle
,
1133 grub_efi_guid_t
*protocol
,
1134 void **protocol_interface
);
1139 (*register_protocol_notify
) (grub_efi_guid_t
*protocol
,
1140 grub_efi_event_t event
,
1141 void **registration
);
1144 (*locate_handle
) (grub_efi_locate_search_type_t search_type
,
1145 grub_efi_guid_t
*protocol
,
1147 grub_efi_uintn_t
*buffer_size
,
1148 grub_efi_handle_t
*buffer
);
1151 (*locate_device_path
) (grub_efi_guid_t
*protocol
,
1152 grub_efi_device_path_t
**device_path
,
1153 grub_efi_handle_t
*device
);
1156 (*install_configuration_table
) (grub_efi_guid_t
*guid
, void *table
);
1159 (*load_image
) (grub_efi_boolean_t boot_policy
,
1160 grub_efi_handle_t parent_image_handle
,
1161 grub_efi_device_path_t
*file_path
,
1162 void *source_buffer
,
1163 grub_efi_uintn_t source_size
,
1164 grub_efi_handle_t
*image_handle
);
1167 (*start_image
) (grub_efi_handle_t image_handle
,
1168 grub_efi_uintn_t
*exit_data_size
,
1169 grub_efi_char16_t
**exit_data
);
1172 (*exit
) (grub_efi_handle_t image_handle
,
1173 grub_efi_status_t exit_status
,
1174 grub_efi_uintn_t exit_data_size
,
1175 grub_efi_char16_t
*exit_data
) __attribute__((noreturn
));
1178 (*unload_image
) (grub_efi_handle_t image_handle
);
1181 (*exit_boot_services
) (grub_efi_handle_t image_handle
,
1182 grub_efi_uintn_t map_key
);
1185 (*get_next_monotonic_count
) (grub_efi_uint64_t
*count
);
1188 (*stall
) (grub_efi_uintn_t microseconds
);
1191 (*set_watchdog_timer
) (grub_efi_uintn_t timeout
,
1192 grub_efi_uint64_t watchdog_code
,
1193 grub_efi_uintn_t data_size
,
1194 grub_efi_char16_t
*watchdog_data
);
1197 (*connect_controller
) (grub_efi_handle_t controller_handle
,
1198 grub_efi_handle_t
*driver_image_handle
,
1199 grub_efi_device_path_protocol_t
*remaining_device_path
,
1200 grub_efi_boolean_t recursive
);
1203 (*disconnect_controller
) (grub_efi_handle_t controller_handle
,
1204 grub_efi_handle_t driver_image_handle
,
1205 grub_efi_handle_t child_handle
);
1208 (*open_protocol
) (grub_efi_handle_t handle
,
1209 grub_efi_guid_t
*protocol
,
1210 void **protocol_interface
,
1211 grub_efi_handle_t agent_handle
,
1212 grub_efi_handle_t controller_handle
,
1213 grub_efi_uint32_t attributes
);
1216 (*close_protocol
) (grub_efi_handle_t handle
,
1217 grub_efi_guid_t
*protocol
,
1218 grub_efi_handle_t agent_handle
,
1219 grub_efi_handle_t controller_handle
);
1222 (*open_protocol_information
) (grub_efi_handle_t handle
,
1223 grub_efi_guid_t
*protocol
,
1224 grub_efi_open_protocol_information_entry_t
**entry_buffer
,
1225 grub_efi_uintn_t
*entry_count
);
1228 (*protocols_per_handle
) (grub_efi_handle_t handle
,
1229 grub_efi_packed_guid_t
***protocol_buffer
,
1230 grub_efi_uintn_t
*protocol_buffer_count
);
1233 (*locate_handle_buffer
) (grub_efi_locate_search_type_t search_type
,
1234 grub_efi_guid_t
*protocol
,
1236 grub_efi_uintn_t
*no_handles
,
1237 grub_efi_handle_t
**buffer
);
1240 (*locate_protocol
) (grub_efi_guid_t
*protocol
,
1242 void **protocol_interface
);
1245 (*install_multiple_protocol_interfaces
) (grub_efi_handle_t
*handle
, ...);
1248 (*uninstall_multiple_protocol_interfaces
) (grub_efi_handle_t handle
, ...);
1251 (*calculate_crc32
) (void *data
,
1252 grub_efi_uintn_t data_size
,
1253 grub_efi_uint32_t
*crc32
);
1256 (*copy_mem
) (void *destination
, void *source
, grub_efi_uintn_t length
);
1259 (*set_mem
) (void *buffer
, grub_efi_uintn_t size
, grub_efi_uint8_t value
);
1261 typedef struct grub_efi_boot_services grub_efi_boot_services_t
;
1263 struct grub_efi_runtime_services
1265 grub_efi_table_header_t hdr
;
1268 (*get_time
) (grub_efi_time_t
*time
,
1269 grub_efi_time_capabilities_t
*capabilities
);
1272 (*set_time
) (grub_efi_time_t
*time
);
1275 (*get_wakeup_time
) (grub_efi_boolean_t
*enabled
,
1276 grub_efi_boolean_t
*pending
,
1277 grub_efi_time_t
*time
);
1280 (*set_wakeup_time
) (grub_efi_boolean_t enabled
,
1281 grub_efi_time_t
*time
);
1284 (*set_virtual_address_map
) (grub_efi_uintn_t memory_map_size
,
1285 grub_efi_uintn_t descriptor_size
,
1286 grub_efi_uint32_t descriptor_version
,
1287 grub_efi_memory_descriptor_t
*virtual_map
);
1290 (*convert_pointer
) (grub_efi_uintn_t debug_disposition
, void **address
);
1292 #define GRUB_EFI_GLOBAL_VARIABLE_GUID \
1293 { 0x8BE4DF61, 0x93CA, 0x11d2, { 0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B,0x8C }}
1297 (*get_variable
) (grub_efi_char16_t
*variable_name
,
1298 const grub_efi_guid_t
*vendor_guid
,
1299 grub_efi_uint32_t
*attributes
,
1300 grub_efi_uintn_t
*data_size
,
1304 (*get_next_variable_name
) (grub_efi_uintn_t
*variable_name_size
,
1305 grub_efi_char16_t
*variable_name
,
1306 grub_efi_guid_t
*vendor_guid
);
1309 (*set_variable
) (grub_efi_char16_t
*variable_name
,
1310 const grub_efi_guid_t
*vendor_guid
,
1311 grub_efi_uint32_t attributes
,
1312 grub_efi_uintn_t data_size
,
1316 (*get_next_high_monotonic_count
) (grub_efi_uint32_t
*high_count
);
1319 (*reset_system
) (grub_efi_reset_type_t reset_type
,
1320 grub_efi_status_t reset_status
,
1321 grub_efi_uintn_t data_size
,
1322 grub_efi_char16_t
*reset_data
);
1324 typedef struct grub_efi_runtime_services grub_efi_runtime_services_t
;
1326 struct grub_efi_configuration_table
1328 grub_efi_packed_guid_t vendor_guid
;
1331 typedef struct grub_efi_configuration_table grub_efi_configuration_table_t
;
1333 #define GRUB_EFIEMU_SYSTEM_TABLE_SIGNATURE 0x5453595320494249LL
1334 #define GRUB_EFIEMU_RUNTIME_SERVICES_SIGNATURE 0x56524553544e5552LL
1336 struct grub_efi_serial_io_interface
1338 grub_efi_uint32_t revision
;
1339 void (*reset
) (void);
1340 grub_efi_status_t (*set_attributes
) (struct grub_efi_serial_io_interface
*this,
1341 grub_efi_uint64_t speed
,
1342 grub_efi_uint32_t fifo_depth
,
1343 grub_efi_uint32_t timeout
,
1344 grub_efi_parity_type_t parity
,
1345 grub_uint8_t word_len
,
1346 grub_efi_stop_bits_t stop_bits
);
1347 grub_efi_status_t (*set_control_bits
) (struct grub_efi_serial_io_interface
*this,
1348 grub_efi_uint32_t flags
);
1349 void (*get_control_bits
) (void);
1350 grub_efi_status_t (*write
) (struct grub_efi_serial_io_interface
*this,
1351 grub_efi_uintn_t
*buf_size
,
1353 grub_efi_status_t (*read
) (struct grub_efi_serial_io_interface
*this,
1354 grub_efi_uintn_t
*buf_size
,
1358 struct grub_efi_simple_input_interface
1361 (*reset
) (struct grub_efi_simple_input_interface
*this,
1362 grub_efi_boolean_t extended_verification
);
1365 (*read_key_stroke
) (struct grub_efi_simple_input_interface
*this,
1366 grub_efi_input_key_t
*key
);
1368 grub_efi_event_t wait_for_key
;
1370 typedef struct grub_efi_simple_input_interface grub_efi_simple_input_interface_t
;
1372 struct grub_efi_key_data
{
1373 grub_efi_input_key_t key
;
1374 grub_efi_key_state_t key_state
;
1376 typedef struct grub_efi_key_data grub_efi_key_data_t
;
1378 typedef grub_efi_status_t (*grub_efi_key_notify_function_t
) (
1379 grub_efi_key_data_t
*key_data
1382 struct grub_efi_simple_text_input_ex_interface
1385 (*reset
) (struct grub_efi_simple_text_input_ex_interface
*this,
1386 grub_efi_boolean_t extended_verification
);
1389 (*read_key_stroke
) (struct grub_efi_simple_text_input_ex_interface
*this,
1390 grub_efi_key_data_t
*key_data
);
1392 grub_efi_event_t wait_for_key
;
1395 (*set_state
) (struct grub_efi_simple_text_input_ex_interface
*this,
1396 grub_efi_key_toggle_state_t
*key_toggle_state
);
1399 (*register_key_notify
) (struct grub_efi_simple_text_input_ex_interface
*this,
1400 grub_efi_key_data_t
*key_data
,
1401 grub_efi_key_notify_function_t key_notification_function
);
1404 (*unregister_key_notify
) (struct grub_efi_simple_text_input_ex_interface
*this,
1405 void *notification_handle
);
1407 typedef struct grub_efi_simple_text_input_ex_interface grub_efi_simple_text_input_ex_interface_t
;
1409 struct grub_efi_simple_text_output_interface
1412 (*reset
) (struct grub_efi_simple_text_output_interface
*this,
1413 grub_efi_boolean_t extended_verification
);
1416 (*output_string
) (struct grub_efi_simple_text_output_interface
*this,
1417 grub_efi_char16_t
*string
);
1420 (*test_string
) (struct grub_efi_simple_text_output_interface
*this,
1421 grub_efi_char16_t
*string
);
1424 (*query_mode
) (struct grub_efi_simple_text_output_interface
*this,
1425 grub_efi_uintn_t mode_number
,
1426 grub_efi_uintn_t
*columns
,
1427 grub_efi_uintn_t
*rows
);
1430 (*set_mode
) (struct grub_efi_simple_text_output_interface
*this,
1431 grub_efi_uintn_t mode_number
);
1434 (*set_attributes
) (struct grub_efi_simple_text_output_interface
*this,
1435 grub_efi_uintn_t attribute
);
1438 (*clear_screen
) (struct grub_efi_simple_text_output_interface
*this);
1441 (*set_cursor_position
) (struct grub_efi_simple_text_output_interface
*this,
1442 grub_efi_uintn_t column
,
1443 grub_efi_uintn_t row
);
1446 (*enable_cursor
) (struct grub_efi_simple_text_output_interface
*this,
1447 grub_efi_boolean_t visible
);
1449 grub_efi_simple_text_output_mode_t
*mode
;
1451 typedef struct grub_efi_simple_text_output_interface grub_efi_simple_text_output_interface_t
;
1453 typedef grub_uint8_t grub_efi_pxe_packet_t
[1472];
1455 typedef struct grub_efi_pxe_mode
1457 grub_uint8_t unused
[52];
1458 grub_efi_pxe_packet_t dhcp_discover
;
1459 grub_efi_pxe_packet_t dhcp_ack
;
1460 grub_efi_pxe_packet_t proxy_offer
;
1461 grub_efi_pxe_packet_t pxe_discover
;
1462 grub_efi_pxe_packet_t pxe_reply
;
1463 } grub_efi_pxe_mode_t
;
1465 typedef struct grub_efi_pxe
1468 void (*start
) (void);
1469 void (*stop
) (void);
1470 void (*dhcp
) (void);
1471 void (*discover
) (void);
1472 void (*mftp
) (void);
1473 void (*udpwrite
) (void);
1474 void (*udpread
) (void);
1475 void (*setipfilter
) (void);
1477 void (*setparams
) (void);
1478 void (*setstationip
) (void);
1479 void (*setpackets
) (void);
1480 struct grub_efi_pxe_mode
*mode
;
1483 #define GRUB_EFI_BLACK 0x00
1484 #define GRUB_EFI_BLUE 0x01
1485 #define GRUB_EFI_GREEN 0x02
1486 #define GRUB_EFI_CYAN 0x03
1487 #define GRUB_EFI_RED 0x04
1488 #define GRUB_EFI_MAGENTA 0x05
1489 #define GRUB_EFI_BROWN 0x06
1490 #define GRUB_EFI_LIGHTGRAY 0x07
1491 #define GRUB_EFI_BRIGHT 0x08
1492 #define GRUB_EFI_DARKGRAY 0x08
1493 #define GRUB_EFI_LIGHTBLUE 0x09
1494 #define GRUB_EFI_LIGHTGREEN 0x0A
1495 #define GRUB_EFI_LIGHTCYAN 0x0B
1496 #define GRUB_EFI_LIGHTRED 0x0C
1497 #define GRUB_EFI_LIGHTMAGENTA 0x0D
1498 #define GRUB_EFI_YELLOW 0x0E
1499 #define GRUB_EFI_WHITE 0x0F
1501 #define GRUB_EFI_BACKGROUND_BLACK 0x00
1502 #define GRUB_EFI_BACKGROUND_BLUE 0x10
1503 #define GRUB_EFI_BACKGROUND_GREEN 0x20
1504 #define GRUB_EFI_BACKGROUND_CYAN 0x30
1505 #define GRUB_EFI_BACKGROUND_RED 0x40
1506 #define GRUB_EFI_BACKGROUND_MAGENTA 0x50
1507 #define GRUB_EFI_BACKGROUND_BROWN 0x60
1508 #define GRUB_EFI_BACKGROUND_LIGHTGRAY 0x70
1510 #define GRUB_EFI_TEXT_ATTR(fg, bg) ((fg) | ((bg)))
1512 struct grub_efi_system_table
1514 grub_efi_table_header_t hdr
;
1515 grub_efi_char16_t
*firmware_vendor
;
1516 grub_efi_uint32_t firmware_revision
;
1517 grub_efi_handle_t console_in_handler
;
1518 grub_efi_simple_input_interface_t
*con_in
;
1519 grub_efi_handle_t console_out_handler
;
1520 grub_efi_simple_text_output_interface_t
*con_out
;
1521 grub_efi_handle_t standard_error_handle
;
1522 grub_efi_simple_text_output_interface_t
*std_err
;
1523 grub_efi_runtime_services_t
*runtime_services
;
1524 grub_efi_boot_services_t
*boot_services
;
1525 grub_efi_uintn_t num_table_entries
;
1526 grub_efi_configuration_table_t
*configuration_table
;
1528 typedef struct grub_efi_system_table grub_efi_system_table_t
;
1530 struct grub_efi_loaded_image
1532 grub_efi_uint32_t revision
;
1533 grub_efi_handle_t parent_handle
;
1534 grub_efi_system_table_t
*system_table
;
1536 grub_efi_handle_t device_handle
;
1537 grub_efi_device_path_t
*file_path
;
1540 grub_efi_uint32_t load_options_size
;
1544 grub_efi_uint64_t image_size
;
1545 grub_efi_memory_type_t image_code_type
;
1546 grub_efi_memory_type_t image_data_type
;
1548 grub_efi_status_t (*unload
) (grub_efi_handle_t image_handle
);
1550 typedef struct grub_efi_loaded_image grub_efi_loaded_image_t
;
1552 struct grub_efi_disk_io
1554 grub_efi_uint64_t revision
;
1555 grub_efi_status_t (*read
) (struct grub_efi_disk_io
*this,
1556 grub_efi_uint32_t media_id
,
1557 grub_efi_uint64_t offset
,
1558 grub_efi_uintn_t buffer_size
,
1560 grub_efi_status_t (*write
) (struct grub_efi_disk_io
*this,
1561 grub_efi_uint32_t media_id
,
1562 grub_efi_uint64_t offset
,
1563 grub_efi_uintn_t buffer_size
,
1566 typedef struct grub_efi_disk_io grub_efi_disk_io_t
;
1568 struct grub_efi_block_io_media
1570 grub_efi_uint32_t media_id
;
1571 grub_efi_boolean_t removable_media
;
1572 grub_efi_boolean_t media_present
;
1573 grub_efi_boolean_t logical_partition
;
1574 grub_efi_boolean_t read_only
;
1575 grub_efi_boolean_t write_caching
;
1576 grub_efi_uint8_t pad
[3];
1577 grub_efi_uint32_t block_size
;
1578 grub_efi_uint32_t io_align
;
1579 grub_efi_uint8_t pad2
[4];
1580 grub_efi_lba_t last_block
;
1582 typedef struct grub_efi_block_io_media grub_efi_block_io_media_t
;
1584 typedef grub_uint8_t grub_efi_mac_t
[32];
1586 struct grub_efi_simple_network_mode
1588 grub_uint32_t state
;
1589 grub_uint32_t hwaddr_size
;
1590 grub_uint32_t media_header_size
;
1591 grub_uint32_t max_packet_size
;
1592 grub_uint32_t nvram_size
;
1593 grub_uint32_t nvram_access_size
;
1594 grub_uint32_t receive_filter_mask
;
1595 grub_uint32_t receive_filter_setting
;
1596 grub_uint32_t max_mcast_filter_count
;
1597 grub_uint32_t mcast_filter_count
;
1598 grub_efi_mac_t mcast_filter
[16];
1599 grub_efi_mac_t current_address
;
1600 grub_efi_mac_t broadcast_address
;
1601 grub_efi_mac_t permanent_address
;
1602 grub_uint8_t if_type
;
1603 grub_uint8_t mac_changeable
;
1604 grub_uint8_t multitx_supported
;
1605 grub_uint8_t media_present_supported
;
1606 grub_uint8_t media_present
;
1611 GRUB_EFI_NETWORK_STOPPED
,
1612 GRUB_EFI_NETWORK_STARTED
,
1613 GRUB_EFI_NETWORK_INITIALIZED
,
1618 GRUB_EFI_SIMPLE_NETWORK_RECEIVE_UNICAST
= 0x01,
1619 GRUB_EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST
= 0x02,
1620 GRUB_EFI_SIMPLE_NETWORK_RECEIVE_BROADCAST
= 0x04,
1621 GRUB_EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS
= 0x08,
1622 GRUB_EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS_MULTICAST
= 0x10,
1625 struct grub_efi_simple_network
1627 grub_uint64_t revision
;
1628 grub_efi_status_t (*start
) (struct grub_efi_simple_network
*this);
1629 grub_efi_status_t (*stop
) (struct grub_efi_simple_network
*this);
1630 grub_efi_status_t (*initialize
) (struct grub_efi_simple_network
*this,
1631 grub_efi_uintn_t extra_rx
,
1632 grub_efi_uintn_t extra_tx
);
1633 void (*reset
) (void);
1634 grub_efi_status_t (*shutdown
) (struct grub_efi_simple_network
*this);
1635 grub_efi_status_t (*receive_filters
) (struct grub_efi_simple_network
*this,
1636 grub_uint32_t enable
,
1637 grub_uint32_t disable
,
1638 grub_efi_boolean_t reset_mcast_filter
,
1639 grub_efi_uintn_t mcast_filter_count
,
1640 grub_efi_mac_address_t
*mcast_filter
);
1641 void (*station_address
) (void);
1642 void (*statistics
) (void);
1643 void (*mcastiptomac
) (void);
1644 void (*nvdata
) (void);
1645 grub_efi_status_t (*get_status
) (struct grub_efi_simple_network
*this,
1646 grub_uint32_t
*int_status
,
1648 grub_efi_status_t (*transmit
) (struct grub_efi_simple_network
*this,
1649 grub_efi_uintn_t header_size
,
1650 grub_efi_uintn_t buffer_size
,
1652 grub_efi_mac_t
*src_addr
,
1653 grub_efi_mac_t
*dest_addr
,
1654 grub_efi_uint16_t
*protocol
);
1655 grub_efi_status_t (*receive
) (struct grub_efi_simple_network
*this,
1656 grub_efi_uintn_t
*header_size
,
1657 grub_efi_uintn_t
*buffer_size
,
1659 grub_efi_mac_t
*src_addr
,
1660 grub_efi_mac_t
*dest_addr
,
1661 grub_uint16_t
*protocol
);
1662 void (*waitforpacket
) (void);
1663 struct grub_efi_simple_network_mode
*mode
;
1665 typedef struct grub_efi_simple_network grub_efi_simple_network_t
;
1668 struct grub_efi_block_io
1670 grub_efi_uint64_t revision
;
1671 grub_efi_block_io_media_t
*media
;
1672 grub_efi_status_t (*reset
) (struct grub_efi_block_io
*this,
1673 grub_efi_boolean_t extended_verification
);
1674 grub_efi_status_t (*read_blocks
) (struct grub_efi_block_io
*this,
1675 grub_efi_uint32_t media_id
,
1677 grub_efi_uintn_t buffer_size
,
1679 grub_efi_status_t (*write_blocks
) (struct grub_efi_block_io
*this,
1680 grub_efi_uint32_t media_id
,
1682 grub_efi_uintn_t buffer_size
,
1684 grub_efi_status_t (*flush_blocks
) (struct grub_efi_block_io
*this);
1686 typedef struct grub_efi_block_io grub_efi_block_io_t
;
1688 #if (GRUB_TARGET_SIZEOF_VOID_P == 4) || defined (__ia64__) \
1689 || defined (__aarch64__) || defined(__mips__) || defined (__MINGW64__) || defined (__CYGWIN__) \
1692 #define efi_call_0(func) func()
1693 #define efi_call_1(func, a) func(a)
1694 #define efi_call_2(func, a, b) func(a, b)
1695 #define efi_call_3(func, a, b, c) func(a, b, c)
1696 #define efi_call_4(func, a, b, c, d) func(a, b, c, d)
1697 #define efi_call_5(func, a, b, c, d, e) func(a, b, c, d, e)
1698 #define efi_call_6(func, a, b, c, d, e, f) func(a, b, c, d, e, f)
1699 #define efi_call_7(func, a, b, c, d, e, f, g) func(a, b, c, d, e, f, g)
1700 #define efi_call_10(func, a, b, c, d, e, f, g, h, i, j) func(a, b, c, d, e, f, g, h, i, j)
1704 #define efi_call_0(func) \
1706 #define efi_call_1(func, a) \
1707 efi_wrap_1(func, (grub_uint64_t) (a))
1708 #define efi_call_2(func, a, b) \
1709 efi_wrap_2(func, (grub_uint64_t) (a), (grub_uint64_t) (b))
1710 #define efi_call_3(func, a, b, c) \
1711 efi_wrap_3(func, (grub_uint64_t) (a), (grub_uint64_t) (b), \
1712 (grub_uint64_t) (c))
1713 #define efi_call_4(func, a, b, c, d) \
1714 efi_wrap_4(func, (grub_uint64_t) (a), (grub_uint64_t) (b), \
1715 (grub_uint64_t) (c), (grub_uint64_t) (d))
1716 #define efi_call_5(func, a, b, c, d, e) \
1717 efi_wrap_5(func, (grub_uint64_t) (a), (grub_uint64_t) (b), \
1718 (grub_uint64_t) (c), (grub_uint64_t) (d), (grub_uint64_t) (e))
1719 #define efi_call_6(func, a, b, c, d, e, f) \
1720 efi_wrap_6(func, (grub_uint64_t) (a), (grub_uint64_t) (b), \
1721 (grub_uint64_t) (c), (grub_uint64_t) (d), (grub_uint64_t) (e), \
1722 (grub_uint64_t) (f))
1723 #define efi_call_7(func, a, b, c, d, e, f, g) \
1724 efi_wrap_7(func, (grub_uint64_t) (a), (grub_uint64_t) (b), \
1725 (grub_uint64_t) (c), (grub_uint64_t) (d), (grub_uint64_t) (e), \
1726 (grub_uint64_t) (f), (grub_uint64_t) (g))
1727 #define efi_call_10(func, a, b, c, d, e, f, g, h, i, j) \
1728 efi_wrap_10(func, (grub_uint64_t) (a), (grub_uint64_t) (b), \
1729 (grub_uint64_t) (c), (grub_uint64_t) (d), (grub_uint64_t) (e), \
1730 (grub_uint64_t) (f), (grub_uint64_t) (g), (grub_uint64_t) (h), \
1731 (grub_uint64_t) (i), (grub_uint64_t) (j))
1733 grub_uint64_t
EXPORT_FUNC(efi_wrap_0
) (void *func
);
1734 grub_uint64_t
EXPORT_FUNC(efi_wrap_1
) (void *func
, grub_uint64_t arg1
);
1735 grub_uint64_t
EXPORT_FUNC(efi_wrap_2
) (void *func
, grub_uint64_t arg1
,
1736 grub_uint64_t arg2
);
1737 grub_uint64_t
EXPORT_FUNC(efi_wrap_3
) (void *func
, grub_uint64_t arg1
,
1738 grub_uint64_t arg2
, grub_uint64_t arg3
);
1739 grub_uint64_t
EXPORT_FUNC(efi_wrap_4
) (void *func
, grub_uint64_t arg1
,
1740 grub_uint64_t arg2
, grub_uint64_t arg3
,
1741 grub_uint64_t arg4
);
1742 grub_uint64_t
EXPORT_FUNC(efi_wrap_5
) (void *func
, grub_uint64_t arg1
,
1743 grub_uint64_t arg2
, grub_uint64_t arg3
,
1744 grub_uint64_t arg4
, grub_uint64_t arg5
);
1745 grub_uint64_t
EXPORT_FUNC(efi_wrap_6
) (void *func
, grub_uint64_t arg1
,
1746 grub_uint64_t arg2
, grub_uint64_t arg3
,
1747 grub_uint64_t arg4
, grub_uint64_t arg5
,
1748 grub_uint64_t arg6
);
1749 grub_uint64_t
EXPORT_FUNC(efi_wrap_7
) (void *func
, grub_uint64_t arg1
,
1750 grub_uint64_t arg2
, grub_uint64_t arg3
,
1751 grub_uint64_t arg4
, grub_uint64_t arg5
,
1752 grub_uint64_t arg6
, grub_uint64_t arg7
);
1753 grub_uint64_t
EXPORT_FUNC(efi_wrap_10
) (void *func
, grub_uint64_t arg1
,
1754 grub_uint64_t arg2
, grub_uint64_t arg3
,
1755 grub_uint64_t arg4
, grub_uint64_t arg5
,
1756 grub_uint64_t arg6
, grub_uint64_t arg7
,
1757 grub_uint64_t arg8
, grub_uint64_t arg9
,
1758 grub_uint64_t arg10
);
1761 #endif /* ! GRUB_EFI_API_HEADER */