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 protocol used by iPXE */
89 /** GUID */
91 /** Variable containing pointer to protocol structure */
92 void **protocol;
93 /** Protocol is required */
95};
96
97/** EFI protocol table */
98#define EFI_PROTOCOLS __table ( struct efi_protocol, "efi_protocols" )
99
100/** Declare an EFI protocol used by iPXE */
101#define __efi_protocol __table_entry ( EFI_PROTOCOLS, 01 )
102
103/** Declare an EFI protocol to be required by iPXE
104 *
105 * @v _protocol EFI protocol name
106 * @v _ptr Pointer to protocol instance
107 */
108#define EFI_REQUIRE_PROTOCOL( _protocol, _ptr ) \
109 struct efi_protocol __ ## _protocol __efi_protocol = { \
110 .guid = _protocol ## _GUID, \
111 .protocol = ( ( void ** ) ( void * ) \
112 ( ( (_ptr) == ( ( _protocol ** ) (_ptr) ) ) ? \
113 (_ptr) : (_ptr) ) ), \
114 .required = 1, \
115 }
116
117/** Declare an EFI protocol to be requested by iPXE
118 *
119 * @v _protocol EFI protocol name
120 * @v _ptr Pointer to protocol instance
121 */
122#define EFI_REQUEST_PROTOCOL( _protocol, _ptr ) \
123 struct efi_protocol __ ## _protocol __efi_protocol = { \
124 .guid = _protocol ## _GUID, \
125 .protocol = ( ( void ** ) ( void * ) \
126 ( ( (_ptr) == ( ( _protocol ** ) (_ptr) ) ) ? \
127 (_ptr) : (_ptr) ) ), \
128 .required = 0, \
129 }
130
131/** An EFI configuration table used by iPXE */
133 /** GUID */
135 /** Variable containing pointer to configuration table */
136 void **table;
137 /** Table is required for operation */
139};
140
141/** EFI configuration table table */
142#define EFI_CONFIG_TABLES \
143 __table ( struct efi_config_table, "efi_config_tables" )
144
145/** Declare an EFI configuration table used by iPXE */
146#define __efi_config_table __table_entry ( EFI_CONFIG_TABLES, 01 )
147
148/** Declare an EFI configuration table to be used by iPXE
149 *
150 * @v _table EFI configuration table name
151 * @v _ptr Pointer to configuration table
152 * @v _required Table is required for operation
153 */
154#define EFI_USE_TABLE( _table, _ptr, _required ) \
155 struct efi_config_table __ ## _table __efi_config_table = { \
156 .guid = _table ## _GUID, \
157 .table = ( ( void ** ) ( void * ) (_ptr) ), \
158 .required = (_required), \
159 }
160
161/**
162 * Convert an iPXE status code to an EFI status code
163 *
164 * @v rc iPXE status code
165 * @ret efirc EFI status code
166 */
167#define EFIRC( rc ) ERRNO_TO_PLATFORM ( -(rc) )
168
169/**
170 * Convert an EFI status code to an iPXE status code
171 *
172 * @v efirc EFI status code
173 * @ret rc iPXE status code (before negation)
174 */
175#define EEFI( efirc ) EPLATFORM ( EINFO_EPLATFORM, efirc )
176
257
263
271
278extern int efi_shutdown_in_progress;
279
280extern const __attribute__ (( pure )) char *
282extern const __attribute__ (( pure )) char *
283efi_tpl_name ( EFI_TPL tpl );
284extern const __attribute__ (( pure )) char *
286extern const __attribute__ (( pure )) char *
287efi_open_attributes_name ( unsigned int attributes );
288extern const __attribute__ (( pure )) char *
290extern const __attribute__ (( pure )) char *
292
297extern void dbg_efi_protocols ( EFI_HANDLE handle );
298
299#define DBG_EFI_OPENER_IF( level, handle, protocol, \
300 opener ) do { \
301 if ( DBG_ ## level ) { \
302 dbg_efi_opener ( handle, protocol, \
303 opener ); \
304 } \
305 } while ( 0 )
306
307#define DBG_EFI_OPENERS_IF( level, handle, protocol ) do { \
308 if ( DBG_ ## level ) { \
309 dbg_efi_openers ( handle, protocol ); \
310 } \
311 } while ( 0 )
312
313#define DBG_EFI_PROTOCOLS_IF( level, handle ) do { \
314 if ( DBG_ ## level ) { \
315 dbg_efi_protocols ( handle ); \
316 } \
317 } while ( 0 )
318
319#define DBGC_EFI_OPENER_IF( level, id, ... ) do { \
320 DBG_AC_IF ( level, id ); \
321 DBG_EFI_OPENER_IF ( level, __VA_ARGS__ ); \
322 DBG_DC_IF ( level ); \
323 } while ( 0 )
324
325#define DBGC_EFI_OPENERS_IF( level, id, ... ) do { \
326 DBG_AC_IF ( level, id ); \
327 DBG_EFI_OPENERS_IF ( level, __VA_ARGS__ ); \
328 DBG_DC_IF ( level ); \
329 } while ( 0 )
330
331#define DBGC_EFI_PROTOCOL_IF( level, id, ... ) do { \
332 DBG_AC_IF ( level, id ); \
333 DBG_EFI_PROTOCOL_IF ( level, __VA_ARGS__ ); \
334 DBG_DC_IF ( level ); \
335 } while ( 0 )
336
337#define DBGC_EFI_PROTOCOLS_IF( level, id, ... ) do { \
338 DBG_AC_IF ( level, id ); \
339 DBG_EFI_PROTOCOLS_IF ( level, __VA_ARGS__ ); \
340 DBG_DC_IF ( level ); \
341 } while ( 0 )
342
343#define DBGC_EFI_OPENER( ... ) \
344 DBGC_EFI_OPENER_IF ( LOG, ##__VA_ARGS__ )
345#define DBGC_EFI_OPENERS( ... ) \
346 DBGC_EFI_OPENERS_IF ( LOG, ##__VA_ARGS__ )
347#define DBGC_EFI_PROTOCOL( ... ) \
348 DBGC_EFI_PROTOCOL_IF ( LOG, ##__VA_ARGS__ )
349#define DBGC_EFI_PROTOCOLS( ... ) \
350 DBGC_EFI_PROTOCOLS_IF ( LOG, ##__VA_ARGS__ )
351
352#define DBGC2_EFI_OPENER( ... ) \
353 DBGC_EFI_OPENER_IF ( EXTRA, ##__VA_ARGS__ )
354#define DBGC2_EFI_OPENERS( ... ) \
355 DBGC_EFI_OPENERS_IF ( EXTRA, ##__VA_ARGS__ )
356#define DBGC2_EFI_PROTOCOL( ... ) \
357 DBGC_EFI_PROTOCOL_IF ( EXTRA, ##__VA_ARGS__ )
358#define DBGC2_EFI_PROTOCOLS( ... ) \
359 DBGC_EFI_PROTOCOLS_IF ( EXTRA, ##__VA_ARGS__ )
360
361#define DBGCP_EFI_OPENER( ... ) \
362 DBGC_EFI_OPENER_IF ( PROFILE, ##__VA_ARGS__ )
363#define DBGCP_EFI_OPENERS( ... ) \
364 DBGC_EFI_OPENERS_IF ( PROFILE, ##__VA_ARGS__ )
365#define DBGCP_EFI_PROTOCOL( ... ) \
366 DBGC_EFI_PROTOCOL_IF ( PROFILE, ##__VA_ARGS__ )
367#define DBGCP_EFI_PROTOCOLS( ... ) \
368 DBGC_EFI_PROTOCOLS_IF ( PROFILE, ##__VA_ARGS__ )
369
370/* Allow for EFI-only interface operations */
371#ifdef PLATFORM_efi
372#define EFI_INTF_OP INTF_OP
373#else
374#define EFI_INTF_OP UNUSED_INTF_OP
375#endif
376
377extern unsigned long __stack_chk_guard;
378extern unsigned long efi_stack_cookie ( EFI_HANDLE handle );
379extern void __stack_chk_fail ( void );
380
381/**
382 * Initialise stack cookie
383 *
384 * @v handle Image handle
385 */
386static inline __attribute__ (( always_inline )) void
388
389 /* The calling function must not itself use stack protection,
390 * since the change in the stack guard value would trigger a
391 * false positive.
392 *
393 * There is unfortunately no way to annotate a function to
394 * exclude the use of stack protection. We must therefore
395 * rely on correctly anticipating the compiler's decision on
396 * the use of stack protection.
397 *
398 * The calculation of the stack cookie value deliberately
399 * takes the address of a stack variable (to provide an
400 * additional source of entropy). This operation would
401 * trigger the application of stack protection to the calling
402 * function, and so must be externalised.
403 */
405}
406
407extern EFI_STATUS efi_init ( EFI_HANDLE image_handle,
408 EFI_SYSTEM_TABLE *systab );
409extern void efi_raise_tpl ( struct efi_saved_tpl *tpl );
410extern void efi_restore_tpl ( struct efi_saved_tpl *tpl );
412 void **interface );
414 void **interface );
417 void **interface );
420 EFI_HANDLE child, void **interface );
422 EFI_HANDLE child );
423extern int efi_connect ( EFI_HANDLE device, EFI_HANDLE driver );
424extern int efi_disconnect ( EFI_HANDLE device, EFI_HANDLE driver );
425
426/**
427 * Test protocol existence
428 *
429 * @v handle EFI handle
430 * @v protocol Protocol GUID
431 * @ret rc Return status code
432 */
433#define efi_test( handle, protocol ) \
434 efi_open_untyped ( (handle), (protocol), NULL )
435
436/**
437 * Open protocol for ephemeral use
438 *
439 * @v handle EFI handle
440 * @v protocol Protocol GUID
441 * @v interface Protocol interface pointer to fill in
442 * @ret rc Return status code
443 */
444#define efi_open( handle, protocol, interface ) ( { \
445 typeof ( *(interface) ) check_ptr_ptr = NULL; \
446 efi_open_untyped ( (handle), (protocol), \
447 ( ( void ) check_ptr_ptr, \
448 ( void ** ) (interface) ) ); \
449 } )
450
451/**
452 * Open protocol for unsafe persistent use
453 *
454 * @v handle EFI handle
455 * @v protocol Protocol GUID
456 * @v interface Protocol interface pointer to fill in
457 * @ret rc Return status code
458 */
459#define efi_open_unsafe( handle, protocol, interface ) ( { \
460 typeof ( *(interface) ) check_ptr_ptr = NULL; \
461 efi_open_unsafe_untyped ( (handle), (protocol), \
462 ( ( void ) check_ptr_ptr, \
463 ( void ** ) (interface) ) ); \
464 } )
465
466/**
467 * Open protocol for persistent use by a driver
468 *
469 * @v handle EFI handle
470 * @v protocol Protocol GUID
471 * @v interface Protocol interface pointer to fill in
472 * @ret rc Return status code
473 */
474#define efi_open_by_driver( handle, protocol, interface ) ( { \
475 typeof ( *(interface) ) check_ptr_ptr = NULL; \
476 efi_open_by_driver_untyped ( (handle), (protocol), \
477 ( ( void ) check_ptr_ptr, \
478 ( void ** ) (interface) ) ); \
479 } )
480
481/**
482 * Open protocol for persistent use by a child controller
483 *
484 * @v handle EFI handle
485 * @v protocol Protocol GUID
486 * @v child Child controller handle
487 * @v interface Protocol interface pointer to fill in
488 * @ret rc Return status code
489 */
490#define efi_open_by_child( handle, protocol, child, interface ) ( { \
491 typeof ( *(interface) ) check_ptr_ptr = NULL; \
492 efi_open_by_child_untyped ( (handle), (protocol), (child), \
493 ( ( void ) check_ptr_ptr, \
494 ( void ** ) (interface) ) ); \
495 } )
496
497#endif /* _IPXE_EFI_H */
#define CONST
Datum is read-only.
Definition Base.h:262
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:1518
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:409
EFI_GUID efi_serial_io_protocol_guid
Serial I/O protocol GUID.
Definition efi_guid.c:329
EFI_GUID efi_loaded_image_protocol_guid
Loaded image protocol GUID.
Definition efi_guid.c:273
EFI_GUID efi_udp4_service_binding_protocol_guid
UDPv4 service binding protocol GUID.
Definition efi_guid.c:401
EFI_GUID efi_dhcp6_protocol_guid
DHCPv6 protocol GUID.
Definition efi_guid.c:181
EFI_GUID efi_component_name2_protocol_guid
Component name 2 protocol GUID.
Definition efi_guid.c:161
EFI_GUID efi_supplicant_protocol_guid
Supplicant protocol GUID.
Definition efi_guid.c:365
EFI_GUID efi_acpi_20_table_guid
ACPI 2.0 table GUID.
Definition efi_guid.c:445
EFI_GUID efi_ip4_protocol_guid
IPv4 protocol GUID.
Definition efi_guid.c:237
EFI_GUID efi_load_file2_protocol_guid
Load file 2 protocol GUID.
Definition efi_guid.c:269
EFI_GUID efi_acpi_10_table_guid
ACPI 1.0 table GUID.
Definition efi_guid.c:441
EFI_GUID efi_mtftp6_protocol_guid
MTFTPv6 protocol GUID.
Definition efi_guid.c:297
EFI_GUID efi_tcg2_protocol_guid
TCG2 protocol GUID.
Definition efi_guid.c:373
EFI_GUID efi_graphics_output_protocol_guid
Graphics output protocol GUID.
Definition efi_guid.c:217
EFI_GUID efi_simple_network_protocol_guid
Simple network protocol GUID.
Definition efi_guid.c:341
EFI_GUID efi_shim_lock_protocol_guid
Shim lock protocol GUID.
Definition efi_guid.c:333
EFI_GUID efi_block_io_protocol_guid
Block I/O protocol GUID.
Definition efi_guid.c:145
EFI_GUID efi_dhcp6_service_binding_protocol_guid
DHCPv6 service binding protocol GUID.
Definition efi_guid.c:185
EFI_GUID efi_loaded_image_device_path_protocol_guid
Loaded image device path protocol GUID.
Definition efi_guid.c:277
EFI_GUID efi_file_system_info_id
File system information GUID.
Definition efi_guid.c:466
EFI_GUID efi_device_path_protocol_guid
Device path protocol GUID.
Definition efi_guid.c:169
EFI_GUID efi_tcp6_service_binding_protocol_guid
TCPv6 service binding protocol GUID.
Definition efi_guid.c:389
EFI_GUID efi_console_control_protocol_guid
Console control protocol GUID.
Definition efi_guid.c:165
EFI_GUID efi_adapter_information_protocol_guid
Adapter information protocol GUID.
Definition efi_guid.c:129
EFI_GUID efi_vlan_config_protocol_guid
VLAN configuration protocol GUID.
Definition efi_guid.c:433
EFI_GUID efi_dns4_service_binding_protocol_guid
DNSv4 service binding protocol GUID.
Definition efi_guid.c:197
EFI_GUID efi_ip4_config_protocol_guid
IPv4 configuration protocol GUID.
Definition efi_guid.c:241
EFI_GUID efi_load_file_protocol_guid
Load file protocol GUID.
Definition efi_guid.c:265
EFI_GUID efi_hii_font_protocol_guid
HII font protocol GUID.
Definition efi_guid.c:225
EFI_GUID efi_absolute_pointer_protocol_guid
Absolute pointer protocol GUID.
Definition efi_guid.c:121
EFI_GUID efi_udp4_protocol_guid
UDPv4 protocol GUID.
Definition efi_guid.c:397
EFI_GUID efi_http_protocol_guid
HTTP protocol GUID.
Definition efi_guid.c:229
EFI_GUID efi_simple_text_output_protocol_guid
Simple text output protocol GUID.
Definition efi_guid.c:357
EFI_GUID efi_nii_protocol_guid
Network interface identifier protocol GUID (old version)
Definition efi_guid.c:305
EFI_GUID efi_pci_root_bridge_io_protocol_guid
PCI root bridge I/O protocol GUID.
Definition efi_guid.c:317
EFI_GUID efi_mtftp6_service_binding_protocol_guid
MTFTPv6 service binding protocol GUID.
Definition efi_guid.c:301
EFI_GUID efi_tcp6_protocol_guid
TCPv6 protocol GUID.
Definition efi_guid.c:385
EFI_GUID efi_udp6_protocol_guid
UDPv6 protocol GUID.
Definition efi_guid.c:405
EFI_GUID efi_dns6_service_binding_protocol_guid
DNSv6 service binding protocol GUID.
Definition efi_guid.c:205
EFI_GUID efi_disk_io_protocol_guid
Disk I/O protocol GUID.
Definition efi_guid.c:189
EFI_GUID efi_simple_file_system_protocol_guid
Simple file system protocol GUID.
Definition efi_guid.c:337
EFI_GUID efi_dhcp4_protocol_guid
DHCPv4 protocol GUID.
Definition efi_guid.c:173
EFI_GUID efi_tls_ca_certificate_guid
TLS CA certificate variable GUID.
Definition efi_guid.c:478
EFI_GUID efi_tcp4_service_binding_protocol_guid
TCPv4 service binding protocol GUID.
Definition efi_guid.c:381
EFI_GUID efi_hii_config_access_protocol_guid
HII configuration access protocol GUID.
Definition efi_guid.c:221
EFI_GUID efi_usb_hc_protocol_guid
USB host controller protocol GUID.
Definition efi_guid.c:421
EFI_GUID efi_arp_protocol_guid
ARP protocol GUID.
Definition efi_guid.c:137
EFI_GUID efi_file_info_id
File information GUID.
Definition efi_guid.c:463
EFI_GUID efi_ip4_config2_protocol_guid
IPv4 configuration 2 protocol GUID.
Definition efi_guid.c:245
EFI_GUID efi_acpi_table_protocol_guid
ACPI table protocol GUID.
Definition efi_guid.c:125
EFI_GUID efi_wifi2_protocol_guid
WiFi 2 protocol GUID.
Definition efi_guid.c:437
EFI_GUID efi_storage_security_command_protocol_guid
Storage security protocol GUID.
Definition efi_guid.c:361
EFI_GUID efi_pxe_base_code_protocol_guid
PXE base code protocol GUID.
Definition efi_guid.c:321
EFI_GUID efi_global_variable
Global variable GUID.
Definition efi_guid.c:469
EFI_GUID efi_arp_service_binding_protocol_guid
ARP service binding protocol GUID.
Definition efi_guid.c:141
EFI_GUID efi_cert_x509_guid
X.509 certificate GUID.
Definition efi_guid.c:460
EFI_GUID efi_ip6_config_protocol_guid
IPv6 configuration protocol GUID.
Definition efi_guid.c:257
EFI_GUID efi_tcg_protocol_guid
TCG protocol GUID.
Definition efi_guid.c:369
EFI_GUID efi_rng_protocol_guid
Random number generator protocol GUID.
Definition efi_guid.c:325
EFI_GUID efi_ip6_protocol_guid
IPv6 protocol GUID.
Definition efi_guid.c:253
EFI_GUID efi_dns6_protocol_guid
DNSv6 protocol GUID.
Definition efi_guid.c:201
EFI_GUID efi_nii31_protocol_guid
Network interface identifier protocol GUID (new version)
Definition efi_guid.c:309
EFI_GUID efi_driver_binding_protocol_guid
Driver binding protocol GUID.
Definition efi_guid.c:209
EFI_GUID efi_microsoft_vendor_guid
Microsoft vendor GUID.
Definition efi_guid.c:475
EFI_GUID efi_image_security_database_guid
Image security database GUID.
Definition efi_guid.c:472
EFI_GUID efi_mtftp4_service_binding_protocol_guid
MTFTPv4 service binding protocol GUID.
Definition efi_guid.c:293
EFI_GUID efi_simple_text_input_protocol_guid
Simple text input protocol GUID.
Definition efi_guid.c:349
EFI_GUID efi_ip6_service_binding_protocol_guid
IPv6 service binding protocol GUID.
Definition efi_guid.c:261
EFI_GUID efi_eap_configuration_protocol_guid
EAP configuration protocol GUID.
Definition efi_guid.c:213
EFI_GUID efi_ip4_service_binding_protocol_guid
IPv4 service binding protocol GUID.
Definition efi_guid.c:249
EFI_GUID efi_usb_io_protocol_guid
USB I/O protocol GUID.
Definition efi_guid.c:429
EFI_GUID efi_fdt_table_guid
FDT table GUID.
Definition efi_guid.c:449
EFI_GUID efi_pci_io_protocol_guid
PCI I/O protocol GUID.
Definition efi_guid.c:313
EFI_GUID efi_managed_network_service_binding_protocol_guid
Managed network service binding protocol GUID.
Definition efi_guid.c:285
EFI_GUID efi_dhcp4_service_binding_protocol_guid
DHCPv4 service binding protocol GUID.
Definition efi_guid.c:177
EFI_GUID efi_simple_text_input_ex_protocol_guid
Simple text input extension protocol GUID.
Definition efi_guid.c:353
EFI_GUID efi_mtftp4_protocol_guid
MTFTPv4 protocol GUID.
Definition efi_guid.c:289
EFI_GUID efi_dns4_protocol_guid
DNSv4 protocol GUID.
Definition efi_guid.c:193
EFI_GUID efi_smbios_table_guid
SMBIOS table GUID.
Definition efi_guid.c:453
EFI_GUID efi_bus_specific_driver_override_protocol_guid
Bus specific driver override protocol GUID.
Definition efi_guid.c:153
EFI_GUID efi_usb2_hc_protocol_guid
USB2 host controller protocol GUID.
Definition efi_guid.c:425
EFI_GUID efi_unicode_collation_protocol_guid
Unicode collation protocol GUID.
Definition efi_guid.c:417
EFI_GUID efi_apple_net_boot_protocol_guid
Apple NetBoot protocol GUID.
Definition efi_guid.c:133
EFI_GUID efi_managed_network_protocol_guid
Managed network protocol GUID.
Definition efi_guid.c:281
EFI_GUID efi_tcp4_protocol_guid
TCPv4 protocol GUID.
Definition efi_guid.c:377
EFI_GUID efi_block_io2_protocol_guid
Block I/O version 2 protocol GUID.
Definition efi_guid.c:149
EFI_GUID efi_simple_pointer_protocol_guid
Simple pointer protocol GUID.
Definition efi_guid.c:345
EFI_GUID efi_tree_protocol_guid
TrEE protocol GUID.
Definition efi_guid.c:393
EFI_GUID efi_component_name_protocol_guid
Component name protocol GUID.
Definition efi_guid.c:157
EFI_GUID efi_uga_draw_protocol_guid
UGA draw protocol GUID.
Definition efi_guid.c:413
EFI_GUID efi_http_service_binding_protocol_guid
HTTP service binding protocol GUID.
Definition efi_guid.c:233
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:896
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:926
#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
int efi_disconnect(EFI_HANDLE device, EFI_HANDLE driver)
Disconnect UEFI driver(s)
Definition efi_connect.c:90
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:726
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:387
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 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 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:46
Can be used on any image handle to obtain information about the loaded image.
Definition LoadedImage.h:46
EFI Oprn Protocol Information Entry.
Definition UefiSpec.h:1432
EFI System Table.
Definition UefiSpec.h:2044
A hardware device.
Definition device.h:77
An EFI configuration table used by iPXE.
Definition efi.h:132
int required
Table is required for operation.
Definition efi.h:138
void ** table
Variable containing pointer to configuration table.
Definition efi.h:136
EFI_GUID guid
GUID.
Definition efi.h:134
An EFI protocol used by iPXE.
Definition efi.h:88
EFI_GUID guid
GUID.
Definition efi.h:90
int required
Protocol is required.
Definition efi.h:94
void ** protocol
Variable containing pointer to protocol structure.
Definition efi.h:92
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.