iPXE
efi.h
Go to the documentation of this file.
1#ifndef _IPXE_EFI_H
2#define _IPXE_EFI_H
3
4/** @file
5 *
6 * EFI API
7 *
8 * The intention is to include near-verbatim copies of the EFI headers
9 * required by iPXE. This is achieved using the import.pl script in
10 * this directory. Run the import script to update the local copies
11 * of the headers:
12 *
13 * ./import.pl /path/to/edk2/edk2
14 *
15 * where /path/to/edk2/edk2 is the path to your local checkout of the
16 * EFI Development Kit.
17 *
18 * Note that import.pl will modify any #include lines in each imported
19 * header to reflect its new location within the iPXE tree. It will
20 * also tidy up the file by removing carriage return characters and
21 * trailing whitespace.
22 */
23
24FILE_LICENCE ( GPL2_OR_LATER );
25FILE_SECBOOT ( PERMITTED );
26
27/* EFI headers rudely redefine NULL */
28#undef NULL
29
30/* EFI headers redefine ARRAY_SIZE */
31#undef ARRAY_SIZE
32
33/* EFI headers think your compiler uses the MS ABI by default on X64 */
34#if __x86_64__
35#define EFIAPI __attribute__((ms_abi))
36#endif
37
38/* EFI headers assume regparm(0) on i386, but that is not the case for iPXE */
39#if __i386__
40#define EFIAPI __attribute__((cdecl,regparm(0)))
41#endif
42
43/* EFI headers define EFI_HANDLE and EFI_EVENT as void pointers, which
44 * renders type checking somewhat useless. Work around this bizarre
45 * sabotage attempt by redefining both as pointers to anonymous
46 * structures.
47 *
48 * EFI headers perform some ABI validation checks via _Static_assert()
49 * that may fail when EFI headers are included on a non-EFI platform.
50 * Temporarily disable static assertions to allow these headers to be
51 * included.
52 */
53#define EFI_HANDLE STUPID_EFI_HANDLE
54#define EFI_EVENT STUPID_EFI_EVENT
55#ifndef PLATFORM_efi
56#define _Static_assert(expr, msg)
57#endif
59#undef EFI_HANDLE
60#undef EFI_EVENT
61#undef _Static_assert
62typedef struct {} *EFI_HANDLE;
63typedef struct {} *EFI_EVENT;
64
65/* Include the top-level EFI header files */
66#include <ipxe/efi/Uefi.h>
67#include <ipxe/efi/PiDxe.h>
69
70/* Reset any trailing #pragma pack directives */
71#pragma pack(1)
72#pragma pack()
73
74#include <ipxe/tables.h>
75#include <ipxe/uuid.h>
76#include <ipxe/version.h>
77#include <ipxe/profile.h>
78
79/** An EFI saved task priority level */
81 /** Current external TPL */
83 /** Previous external TPL */
85};
86
87/** An EFI dropped task priority level */
89 /** Current TPL */
91};
92
93/** An EFI protocol used by iPXE */
95 /** GUID */
97 /** Variable containing pointer to protocol structure */
98 void **protocol;
99 /** Protocol is required */
101};
102
103/** EFI protocol table */
104#define EFI_PROTOCOLS __table ( struct efi_protocol, "efi_protocols" )
105
106/** Declare an EFI protocol used by iPXE */
107#define __efi_protocol __table_entry ( EFI_PROTOCOLS, 01 )
108
109/** Declare an EFI protocol to be required by iPXE
110 *
111 * @v _protocol EFI protocol name
112 * @v _ptr Pointer to protocol instance
113 */
114#define EFI_REQUIRE_PROTOCOL( _protocol, _ptr ) \
115 struct efi_protocol __ ## _protocol __efi_protocol = { \
116 .guid = _protocol ## _GUID, \
117 .protocol = ( ( void ** ) ( void * ) \
118 ( ( (_ptr) == ( ( _protocol ** ) (_ptr) ) ) ? \
119 (_ptr) : (_ptr) ) ), \
120 .required = 1, \
121 }
122
123/** Declare an EFI protocol to be requested by iPXE
124 *
125 * @v _protocol EFI protocol name
126 * @v _ptr Pointer to protocol instance
127 */
128#define EFI_REQUEST_PROTOCOL( _protocol, _ptr ) \
129 struct efi_protocol __ ## _protocol __efi_protocol = { \
130 .guid = _protocol ## _GUID, \
131 .protocol = ( ( void ** ) ( void * ) \
132 ( ( (_ptr) == ( ( _protocol ** ) (_ptr) ) ) ? \
133 (_ptr) : (_ptr) ) ), \
134 .required = 0, \
135 }
136
137/** An EFI configuration table used by iPXE */
139 /** GUID */
141 /** Variable containing pointer to configuration table */
142 void **table;
143 /** Table is required for operation */
145};
146
147/** EFI configuration table table */
148#define EFI_CONFIG_TABLES \
149 __table ( struct efi_config_table, "efi_config_tables" )
150
151/** Declare an EFI configuration table used by iPXE */
152#define __efi_config_table __table_entry ( EFI_CONFIG_TABLES, 01 )
153
154/** Declare an EFI configuration table to be used by iPXE
155 *
156 * @v _table EFI configuration table name
157 * @v _ptr Pointer to configuration table
158 * @v _required Table is required for operation
159 */
160#define EFI_USE_TABLE( _table, _ptr, _required ) \
161 struct efi_config_table __ ## _table __efi_config_table = { \
162 .guid = _table ## _GUID, \
163 .table = ( ( void ** ) ( void * ) (_ptr) ), \
164 .required = (_required), \
165 }
166
167/**
168 * Convert an iPXE status code to an EFI status code
169 *
170 * @v rc iPXE status code
171 * @ret efirc EFI status code
172 */
173#define EFIRC( rc ) ERRNO_TO_PLATFORM ( -(rc) )
174
175/**
176 * Convert an EFI status code to an iPXE status code
177 *
178 * @v efirc EFI status code
179 * @ret rc iPXE status code (before negation)
180 */
181#define EEFI( efirc ) EPLATFORM ( EINFO_EPLATFORM, efirc )
182
264
270
278
285extern int efi_shutdown_in_progress;
286
287extern const __attribute__ (( pure )) char *
289extern const __attribute__ (( pure )) char *
290efi_tpl_name ( EFI_TPL tpl );
291extern const __attribute__ (( pure )) char *
293extern const __attribute__ (( pure )) char *
294efi_open_attributes_name ( unsigned int attributes );
295extern const __attribute__ (( pure )) char *
297extern const __attribute__ (( pure )) char *
299
304extern void dbg_efi_protocols ( EFI_HANDLE handle );
305
306#define DBG_EFI_OPENER_IF( level, handle, protocol, \
307 opener ) do { \
308 if ( DBG_ ## level ) { \
309 dbg_efi_opener ( handle, protocol, \
310 opener ); \
311 } \
312 } while ( 0 )
313
314#define DBG_EFI_OPENERS_IF( level, handle, protocol ) do { \
315 if ( DBG_ ## level ) { \
316 dbg_efi_openers ( handle, protocol ); \
317 } \
318 } while ( 0 )
319
320#define DBG_EFI_PROTOCOLS_IF( level, handle ) do { \
321 if ( DBG_ ## level ) { \
322 dbg_efi_protocols ( handle ); \
323 } \
324 } while ( 0 )
325
326#define DBGC_EFI_OPENER_IF( level, id, ... ) do { \
327 DBG_AC_IF ( level, id ); \
328 DBG_EFI_OPENER_IF ( level, __VA_ARGS__ ); \
329 DBG_DC_IF ( level ); \
330 } while ( 0 )
331
332#define DBGC_EFI_OPENERS_IF( level, id, ... ) do { \
333 DBG_AC_IF ( level, id ); \
334 DBG_EFI_OPENERS_IF ( level, __VA_ARGS__ ); \
335 DBG_DC_IF ( level ); \
336 } while ( 0 )
337
338#define DBGC_EFI_PROTOCOL_IF( level, id, ... ) do { \
339 DBG_AC_IF ( level, id ); \
340 DBG_EFI_PROTOCOL_IF ( level, __VA_ARGS__ ); \
341 DBG_DC_IF ( level ); \
342 } while ( 0 )
343
344#define DBGC_EFI_PROTOCOLS_IF( level, id, ... ) do { \
345 DBG_AC_IF ( level, id ); \
346 DBG_EFI_PROTOCOLS_IF ( level, __VA_ARGS__ ); \
347 DBG_DC_IF ( level ); \
348 } while ( 0 )
349
350#define DBGC_EFI_OPENER( ... ) \
351 DBGC_EFI_OPENER_IF ( LOG, ##__VA_ARGS__ )
352#define DBGC_EFI_OPENERS( ... ) \
353 DBGC_EFI_OPENERS_IF ( LOG, ##__VA_ARGS__ )
354#define DBGC_EFI_PROTOCOL( ... ) \
355 DBGC_EFI_PROTOCOL_IF ( LOG, ##__VA_ARGS__ )
356#define DBGC_EFI_PROTOCOLS( ... ) \
357 DBGC_EFI_PROTOCOLS_IF ( LOG, ##__VA_ARGS__ )
358
359#define DBGC2_EFI_OPENER( ... ) \
360 DBGC_EFI_OPENER_IF ( EXTRA, ##__VA_ARGS__ )
361#define DBGC2_EFI_OPENERS( ... ) \
362 DBGC_EFI_OPENERS_IF ( EXTRA, ##__VA_ARGS__ )
363#define DBGC2_EFI_PROTOCOL( ... ) \
364 DBGC_EFI_PROTOCOL_IF ( EXTRA, ##__VA_ARGS__ )
365#define DBGC2_EFI_PROTOCOLS( ... ) \
366 DBGC_EFI_PROTOCOLS_IF ( EXTRA, ##__VA_ARGS__ )
367
368#define DBGCP_EFI_OPENER( ... ) \
369 DBGC_EFI_OPENER_IF ( PROFILE, ##__VA_ARGS__ )
370#define DBGCP_EFI_OPENERS( ... ) \
371 DBGC_EFI_OPENERS_IF ( PROFILE, ##__VA_ARGS__ )
372#define DBGCP_EFI_PROTOCOL( ... ) \
373 DBGC_EFI_PROTOCOL_IF ( PROFILE, ##__VA_ARGS__ )
374#define DBGCP_EFI_PROTOCOLS( ... ) \
375 DBGC_EFI_PROTOCOLS_IF ( PROFILE, ##__VA_ARGS__ )
376
377/* Allow for EFI-only interface operations */
378#ifdef PLATFORM_efi
379#define EFI_INTF_OP INTF_OP
380#else
381#define EFI_INTF_OP UNUSED_INTF_OP
382#endif
383
384extern unsigned long __stack_chk_guard;
385extern unsigned long efi_stack_cookie ( EFI_HANDLE handle );
386extern void __stack_chk_fail ( void );
387
388/**
389 * Initialise stack cookie
390 *
391 * @v handle Image handle
392 */
393static inline __attribute__ (( always_inline )) void
395
396 /* The calling function must not itself use stack protection,
397 * since the change in the stack guard value would trigger a
398 * false positive.
399 *
400 * There is unfortunately no way to annotate a function to
401 * exclude the use of stack protection. We must therefore
402 * rely on correctly anticipating the compiler's decision on
403 * the use of stack protection.
404 *
405 * The calculation of the stack cookie value deliberately
406 * takes the address of a stack variable (to provide an
407 * additional source of entropy). This operation would
408 * trigger the application of stack protection to the calling
409 * function, and so must be externalised.
410 */
412}
413
414extern EFI_STATUS efi_init ( EFI_HANDLE image_handle,
415 EFI_SYSTEM_TABLE *systab );
416extern void efi_raise_tpl ( struct efi_saved_tpl *tpl );
417extern void efi_restore_tpl ( struct efi_saved_tpl *tpl );
418extern void efi_drop_tpl ( struct efi_dropped_tpl *tpl );
419extern void efi_undrop_tpl ( struct efi_dropped_tpl *tpl );
421 void **interface );
423 void **interface );
426 void **interface );
429 EFI_HANDLE child, void **interface );
431 EFI_HANDLE child );
432extern int efi_connect ( EFI_HANDLE device, EFI_HANDLE driver );
433extern int efi_disconnect ( EFI_HANDLE device, EFI_HANDLE driver );
434
435/**
436 * Test protocol existence
437 *
438 * @v handle EFI handle
439 * @v protocol Protocol GUID
440 * @ret rc Return status code
441 */
442#define efi_test( handle, protocol ) \
443 efi_open_untyped ( (handle), (protocol), NULL )
444
445/**
446 * Open protocol for ephemeral use
447 *
448 * @v handle EFI handle
449 * @v protocol Protocol GUID
450 * @v interface Protocol interface pointer to fill in
451 * @ret rc Return status code
452 */
453#define efi_open( handle, protocol, interface ) ( { \
454 typeof ( *(interface) ) check_ptr_ptr = NULL; \
455 efi_open_untyped ( (handle), (protocol), \
456 ( ( void ) check_ptr_ptr, \
457 ( void ** ) (interface) ) ); \
458 } )
459
460/**
461 * Open protocol for unsafe persistent use
462 *
463 * @v handle EFI handle
464 * @v protocol Protocol GUID
465 * @v interface Protocol interface pointer to fill in
466 * @ret rc Return status code
467 */
468#define efi_open_unsafe( handle, protocol, interface ) ( { \
469 typeof ( *(interface) ) check_ptr_ptr = NULL; \
470 efi_open_unsafe_untyped ( (handle), (protocol), \
471 ( ( void ) check_ptr_ptr, \
472 ( void ** ) (interface) ) ); \
473 } )
474
475/**
476 * Open protocol for persistent use by a driver
477 *
478 * @v handle EFI handle
479 * @v protocol Protocol GUID
480 * @v interface Protocol interface pointer to fill in
481 * @ret rc Return status code
482 */
483#define efi_open_by_driver( handle, protocol, interface ) ( { \
484 typeof ( *(interface) ) check_ptr_ptr = NULL; \
485 efi_open_by_driver_untyped ( (handle), (protocol), \
486 ( ( void ) check_ptr_ptr, \
487 ( void ** ) (interface) ) ); \
488 } )
489
490/**
491 * Open protocol for persistent use by a child controller
492 *
493 * @v handle EFI handle
494 * @v protocol Protocol GUID
495 * @v child Child controller handle
496 * @v interface Protocol interface pointer to fill in
497 * @ret rc Return status code
498 */
499#define efi_open_by_child( handle, protocol, child, interface ) ( { \
500 typeof ( *(interface) ) check_ptr_ptr = NULL; \
501 efi_open_by_child_untyped ( (handle), (protocol), (child), \
502 ( ( void ) check_ptr_ptr, \
503 ( void ** ) (interface) ) ); \
504 } )
505
506#endif /* _IPXE_EFI_H */
#define CONST
Datum is read-only.
Definition Base.h:261
UEFI 2.0 Loaded image protocol definition.
Root include file for Mde Package DXE_CORE, DXE, RUNTIME, SMM, SAL type modules.
Defines data types and constants introduced in UEFI.
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
UINTN EFI_TPL
Task priority level.
GUID EFI_GUID
128-bit buffer containing a unique identifier value.
EFI_LOCATE_SEARCH_TYPE
Enumeration of EFI Locate Search Types.
Definition UefiSpec.h:1517
Root include file for Mde Package UEFI, UEFI_APPLICATION type modules.
uint64_t guid
GUID.
Definition edd.h:1
EFI_GUID efi_udp6_service_binding_protocol_guid
UDPv6 service binding protocol GUID.
Definition efi_guid.c:414
EFI_GUID efi_serial_io_protocol_guid
Serial I/O protocol GUID.
Definition efi_guid.c:334
EFI_GUID efi_loaded_image_protocol_guid
Loaded image protocol GUID.
Definition efi_guid.c:274
EFI_GUID efi_udp4_service_binding_protocol_guid
UDPv4 service binding protocol GUID.
Definition efi_guid.c:406
EFI_GUID efi_dhcp6_protocol_guid
DHCPv6 protocol GUID.
Definition efi_guid.c:182
EFI_GUID efi_component_name2_protocol_guid
Component name 2 protocol GUID.
Definition efi_guid.c:162
EFI_GUID efi_supplicant_protocol_guid
Supplicant protocol GUID.
Definition efi_guid.c:370
EFI_GUID efi_acpi_20_table_guid
ACPI 2.0 table GUID.
Definition efi_guid.c:450
EFI_GUID efi_ip4_protocol_guid
IPv4 protocol GUID.
Definition efi_guid.c:238
EFI_GUID efi_load_file2_protocol_guid
Load file 2 protocol GUID.
Definition efi_guid.c:270
EFI_GUID efi_acpi_10_table_guid
ACPI 1.0 table GUID.
Definition efi_guid.c:446
EFI_GUID efi_mtftp6_protocol_guid
MTFTPv6 protocol GUID.
Definition efi_guid.c:298
EFI_GUID efi_tcg2_protocol_guid
TCG2 protocol GUID.
Definition efi_guid.c:378
EFI_GUID efi_graphics_output_protocol_guid
Graphics output protocol GUID.
Definition efi_guid.c:218
EFI_GUID efi_simple_network_protocol_guid
Simple network protocol GUID.
Definition efi_guid.c:346
EFI_GUID efi_shim_lock_protocol_guid
Shim lock protocol GUID.
Definition efi_guid.c:338
EFI_GUID efi_block_io_protocol_guid
Block I/O protocol GUID.
Definition efi_guid.c:146
EFI_GUID efi_dhcp6_service_binding_protocol_guid
DHCPv6 service binding protocol GUID.
Definition efi_guid.c:186
EFI_GUID efi_loaded_image_device_path_protocol_guid
Loaded image device path protocol GUID.
Definition efi_guid.c:278
EFI_GUID efi_file_system_info_id
File system information GUID.
Definition efi_guid.c:471
EFI_GUID efi_device_path_protocol_guid
Device path protocol GUID.
Definition efi_guid.c:170
EFI_GUID efi_tcp6_service_binding_protocol_guid
TCPv6 service binding protocol GUID.
Definition efi_guid.c:394
EFI_GUID efi_console_control_protocol_guid
Console control protocol GUID.
Definition efi_guid.c:166
EFI_GUID efi_adapter_information_protocol_guid
Adapter information protocol GUID.
Definition efi_guid.c:130
EFI_GUID efi_vlan_config_protocol_guid
VLAN configuration protocol GUID.
Definition efi_guid.c:438
EFI_GUID efi_dns4_service_binding_protocol_guid
DNSv4 service binding protocol GUID.
Definition efi_guid.c:198
EFI_GUID efi_ip4_config_protocol_guid
IPv4 configuration protocol GUID.
Definition efi_guid.c:242
EFI_GUID efi_load_file_protocol_guid
Load file protocol GUID.
Definition efi_guid.c:266
EFI_GUID efi_hii_font_protocol_guid
HII font protocol GUID.
Definition efi_guid.c:226
EFI_GUID efi_absolute_pointer_protocol_guid
Absolute pointer protocol GUID.
Definition efi_guid.c:122
EFI_GUID efi_udp4_protocol_guid
UDPv4 protocol GUID.
Definition efi_guid.c:402
EFI_GUID efi_http_protocol_guid
HTTP protocol GUID.
Definition efi_guid.c:230
EFI_GUID efi_simple_text_output_protocol_guid
Simple text output protocol GUID.
Definition efi_guid.c:362
EFI_GUID efi_nii_protocol_guid
Network interface identifier protocol GUID (old version)
Definition efi_guid.c:306
EFI_GUID efi_partition_info_protocol_guid
Partition information protocol GUID.
Definition efi_guid.c:314
EFI_GUID efi_pci_root_bridge_io_protocol_guid
PCI root bridge I/O protocol GUID.
Definition efi_guid.c:322
EFI_GUID efi_mtftp6_service_binding_protocol_guid
MTFTPv6 service binding protocol GUID.
Definition efi_guid.c:302
EFI_GUID efi_tcp6_protocol_guid
TCPv6 protocol GUID.
Definition efi_guid.c:390
EFI_GUID efi_udp6_protocol_guid
UDPv6 protocol GUID.
Definition efi_guid.c:410
EFI_GUID efi_dns6_service_binding_protocol_guid
DNSv6 service binding protocol GUID.
Definition efi_guid.c:206
EFI_GUID efi_disk_io_protocol_guid
Disk I/O protocol GUID.
Definition efi_guid.c:190
EFI_GUID efi_simple_file_system_protocol_guid
Simple file system protocol GUID.
Definition efi_guid.c:342
EFI_GUID efi_dhcp4_protocol_guid
DHCPv4 protocol GUID.
Definition efi_guid.c:174
EFI_GUID efi_tls_ca_certificate_guid
TLS CA certificate variable GUID.
Definition efi_guid.c:483
EFI_GUID efi_tcp4_service_binding_protocol_guid
TCPv4 service binding protocol GUID.
Definition efi_guid.c:386
EFI_GUID efi_hii_config_access_protocol_guid
HII configuration access protocol GUID.
Definition efi_guid.c:222
EFI_GUID efi_usb_hc_protocol_guid
USB host controller protocol GUID.
Definition efi_guid.c:426
EFI_GUID efi_arp_protocol_guid
ARP protocol GUID.
Definition efi_guid.c:138
EFI_GUID efi_file_info_id
File information GUID.
Definition efi_guid.c:468
EFI_GUID efi_ip4_config2_protocol_guid
IPv4 configuration 2 protocol GUID.
Definition efi_guid.c:246
EFI_GUID efi_acpi_table_protocol_guid
ACPI table protocol GUID.
Definition efi_guid.c:126
EFI_GUID efi_wifi2_protocol_guid
WiFi 2 protocol GUID.
Definition efi_guid.c:442
EFI_GUID efi_storage_security_command_protocol_guid
Storage security protocol GUID.
Definition efi_guid.c:366
EFI_GUID efi_pxe_base_code_protocol_guid
PXE base code protocol GUID.
Definition efi_guid.c:326
EFI_GUID efi_global_variable
Global variable GUID.
Definition efi_guid.c:474
EFI_GUID efi_arp_service_binding_protocol_guid
ARP service binding protocol GUID.
Definition efi_guid.c:142
EFI_GUID efi_cert_x509_guid
X.509 certificate GUID.
Definition efi_guid.c:465
EFI_GUID efi_ip6_config_protocol_guid
IPv6 configuration protocol GUID.
Definition efi_guid.c:258
EFI_GUID efi_tcg_protocol_guid
TCG protocol GUID.
Definition efi_guid.c:374
EFI_GUID efi_rng_protocol_guid
Random number generator protocol GUID.
Definition efi_guid.c:330
EFI_GUID efi_ip6_protocol_guid
IPv6 protocol GUID.
Definition efi_guid.c:254
EFI_GUID efi_dns6_protocol_guid
DNSv6 protocol GUID.
Definition efi_guid.c:202
EFI_GUID efi_nii31_protocol_guid
Network interface identifier protocol GUID (new version)
Definition efi_guid.c:310
EFI_GUID efi_driver_binding_protocol_guid
Driver binding protocol GUID.
Definition efi_guid.c:210
EFI_GUID efi_microsoft_vendor_guid
Microsoft vendor GUID.
Definition efi_guid.c:480
EFI_GUID efi_image_security_database_guid
Image security database GUID.
Definition efi_guid.c:477
EFI_GUID efi_mtftp4_service_binding_protocol_guid
MTFTPv4 service binding protocol GUID.
Definition efi_guid.c:294
EFI_GUID efi_simple_text_input_protocol_guid
Simple text input protocol GUID.
Definition efi_guid.c:354
EFI_GUID efi_ip6_service_binding_protocol_guid
IPv6 service binding protocol GUID.
Definition efi_guid.c:262
EFI_GUID efi_eap_configuration_protocol_guid
EAP configuration protocol GUID.
Definition efi_guid.c:214
EFI_GUID efi_ip4_service_binding_protocol_guid
IPv4 service binding protocol GUID.
Definition efi_guid.c:250
EFI_GUID efi_usb_io_protocol_guid
USB I/O protocol GUID.
Definition efi_guid.c:434
EFI_GUID efi_fdt_table_guid
FDT table GUID.
Definition efi_guid.c:454
EFI_GUID efi_pci_io_protocol_guid
PCI I/O protocol GUID.
Definition efi_guid.c:318
EFI_GUID efi_managed_network_service_binding_protocol_guid
Managed network service binding protocol GUID.
Definition efi_guid.c:286
EFI_GUID efi_dhcp4_service_binding_protocol_guid
DHCPv4 service binding protocol GUID.
Definition efi_guid.c:178
EFI_GUID efi_simple_text_input_ex_protocol_guid
Simple text input extension protocol GUID.
Definition efi_guid.c:358
EFI_GUID efi_mtftp4_protocol_guid
MTFTPv4 protocol GUID.
Definition efi_guid.c:290
EFI_GUID efi_dns4_protocol_guid
DNSv4 protocol GUID.
Definition efi_guid.c:194
EFI_GUID efi_smbios_table_guid
SMBIOS table GUID.
Definition efi_guid.c:458
EFI_GUID efi_bus_specific_driver_override_protocol_guid
Bus specific driver override protocol GUID.
Definition efi_guid.c:154
EFI_GUID efi_usb2_hc_protocol_guid
USB2 host controller protocol GUID.
Definition efi_guid.c:430
EFI_GUID efi_unicode_collation_protocol_guid
Unicode collation protocol GUID.
Definition efi_guid.c:422
EFI_GUID efi_apple_net_boot_protocol_guid
Apple NetBoot protocol GUID.
Definition efi_guid.c:134
EFI_GUID efi_managed_network_protocol_guid
Managed network protocol GUID.
Definition efi_guid.c:282
EFI_GUID efi_tcp4_protocol_guid
TCPv4 protocol GUID.
Definition efi_guid.c:382
EFI_GUID efi_block_io2_protocol_guid
Block I/O version 2 protocol GUID.
Definition efi_guid.c:150
EFI_GUID efi_simple_pointer_protocol_guid
Simple pointer protocol GUID.
Definition efi_guid.c:350
EFI_GUID efi_tree_protocol_guid
TrEE protocol GUID.
Definition efi_guid.c:398
EFI_GUID efi_component_name_protocol_guid
Component name protocol GUID.
Definition efi_guid.c:158
EFI_GUID efi_uga_draw_protocol_guid
UGA draw protocol GUID.
Definition efi_guid.c:418
EFI_GUID efi_http_service_binding_protocol_guid
HTTP service binding protocol GUID.
Definition efi_guid.c:234
EFI_TPL efi_external_tpl
External task priority level.
Definition efi_init.c:57
EFI_TPL efi_internal_tpl
Internal task priority level.
Definition efi_init.c:54
EFI_DEVICE_PATH_PROTOCOL * efi_loaded_image_path
Device path for the loaded image's device handle.
Definition efi_init.c:42
unsigned long __stack_chk_guard
Stack cookie.
Definition efi_init.c:66
EFI_LOADED_IMAGE_PROTOCOL * efi_loaded_image
Loaded image protocol for this image.
Definition efi_init.c:39
EFI_HANDLE efi_image_handle
Image handle passed to entry point.
Definition efi_init.c:36
int efi_shutdown_in_progress
EFI shutdown is in progress.
Definition efi_init.c:60
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:921
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:951
#define __attribute__(x)
Definition compiler.h:10
const char * efi_handle_name(EFI_HANDLE handle)
Get name of an EFI handle.
Definition efi_debug.c:652
void __stack_chk_fail(void)
Abort on stack check failure.
Definition efi_init.c:356
EFI_STATUS efi_init(EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *systab)
Initialise EFI environment.
Definition efi_init.c:155
void efi_undrop_tpl(struct efi_dropped_tpl *tpl)
Restore dropped task priority level.
Definition efi_init.c:430
int efi_disconnect(EFI_HANDLE device, EFI_HANDLE driver)
Disconnect UEFI driver(s)
Definition efi_connect.c:91
const char * efi_open_attributes_name(unsigned int attributes)
Name protocol open attributes.
Definition efi_debug.c:102
void efi_close_by_driver(EFI_HANDLE handle, EFI_GUID *protocol)
Close protocol opened for persistent use by a driver.
Definition efi_open.c:279
const char * efi_guid_ntoa(CONST EFI_GUID *guid)
Convert GUID to a printable string.
Definition efi_guid.c:733
void efi_close_by_child(EFI_HANDLE handle, EFI_GUID *protocol, EFI_HANDLE child)
Close protocol opened for persistent use by a child controller.
Definition efi_open.c:344
int efi_open_by_child_untyped(EFI_HANDLE handle, EFI_GUID *protocol, EFI_HANDLE child, void **interface)
Open protocol for persistent use by a child controller.
Definition efi_open.c:302
const char * efi_locate_search_type_name(EFI_LOCATE_SEARCH_TYPE search_type)
Name locate search type.
Definition efi_debug.c:77
void efi_close_unsafe(EFI_HANDLE handle, EFI_GUID *protocol)
Close protocol opened for unsafe persistent use.
Definition efi_open.c:219
unsigned long efi_stack_cookie(EFI_HANDLE handle)
Construct a stack cookie value.
Definition efi_init.c:115
#define EFI_HANDLE
Definition efi.h:53
static void efi_init_stack_guard(EFI_HANDLE handle)
Initialise stack cookie.
Definition efi.h:394
const char * efi_devpath_text(EFI_DEVICE_PATH_PROTOCOL *path)
Get textual representation of device path.
Definition efi_debug.c:247
EFI_GUID efi_smbios2_table_guid
void efi_drop_tpl(struct efi_dropped_tpl *tpl)
Drop task priority level temporarily to external level.
Definition efi_init.c:414
void dbg_efi_openers(EFI_HANDLE handle, EFI_GUID *protocol)
Print list of openers of a given protocol on a given handle.
Definition efi_debug.c:145
void efi_raise_tpl(struct efi_saved_tpl *tpl)
Raise task priority level to internal level.
Definition efi_init.c:383
int efi_open_by_driver_untyped(EFI_HANDLE handle, EFI_GUID *protocol, void **interface)
Open protocol for persistent use by a driver.
Definition efi_open.c:241
void dbg_efi_protocol(EFI_HANDLE handle, EFI_GUID *protocol)
Print protocol information on a given handle.
Definition efi_debug.c:185
int efi_connect(EFI_HANDLE device, EFI_HANDLE driver)
Connect UEFI driver(s)
Definition efi_connect.c:58
int efi_open_untyped(EFI_HANDLE handle, EFI_GUID *protocol, void **interface)
Open (or test) protocol for ephemeral use.
Definition efi_open.c:97
#define EFI_EVENT
Definition efi.h:54
void dbg_efi_protocols(EFI_HANDLE handle)
Print list of protocol handlers attached to a handle.
Definition efi_debug.c:208
void efi_restore_tpl(struct efi_saved_tpl *tpl)
Restore saved task priority level.
Definition efi_init.c:399
const char * efi_tpl_name(EFI_TPL tpl)
Name EFI TPL.
Definition efi_debug.c:55
EFI_SYSTEM_TABLE * efi_systab
void dbg_efi_opener(EFI_HANDLE handle, EFI_GUID *protocol, EFI_OPEN_PROTOCOL_INFORMATION_ENTRY *opener)
Print opened protocol information.
Definition efi_debug.c:124
int efi_open_unsafe_untyped(EFI_HANDLE handle, EFI_GUID *protocol, void **interface)
Open protocol for unsafe persistent use.
Definition efi_open.c:181
Profiling.
uint16_t handle
Handle.
Definition smbios.h:5
Version number.
uint16_t protocol
Protocol ID.
Definition stp.h:7
This protocol can be used on any device handle to obtain generic path/location information concerning...
Definition DevicePath.h:45
Can be used on any image handle to obtain information about the loaded image.
Definition LoadedImage.h:45
EFI Oprn Protocol Information Entry.
Definition UefiSpec.h:1431
EFI System Table.
Definition UefiSpec.h:2043
A hardware device.
Definition device.h:77
An EFI configuration table used by iPXE.
Definition efi.h:138
int required
Table is required for operation.
Definition efi.h:144
void ** table
Variable containing pointer to configuration table.
Definition efi.h:142
EFI_GUID guid
GUID.
Definition efi.h:140
An EFI dropped task priority level.
Definition efi.h:88
EFI_TPL current
Current TPL.
Definition efi.h:90
An EFI protocol used by iPXE.
Definition efi.h:94
EFI_GUID guid
GUID.
Definition efi.h:96
int required
Protocol is required.
Definition efi.h:100
void ** protocol
Variable containing pointer to protocol structure.
Definition efi.h:98
An EFI saved task priority level.
Definition efi.h:80
EFI_TPL previous
Previous external TPL.
Definition efi.h:84
EFI_TPL current
Current external TPL.
Definition efi.h:82
An object interface.
Definition interface.h:125
Linker tables.
Universally unique IDs.