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
263
269
277
284extern int efi_shutdown_in_progress;
285
286extern const __attribute__ (( pure )) char *
288extern const __attribute__ (( pure )) char *
289efi_tpl_name ( EFI_TPL tpl );
290extern const __attribute__ (( pure )) char *
292extern const __attribute__ (( pure )) char *
293efi_open_attributes_name ( unsigned int attributes );
294extern const __attribute__ (( pure )) char *
296extern const __attribute__ (( pure )) char *
298
303extern void dbg_efi_protocols ( EFI_HANDLE handle );
304
305#define DBG_EFI_OPENER_IF( level, handle, protocol, \
306 opener ) do { \
307 if ( DBG_ ## level ) { \
308 dbg_efi_opener ( handle, protocol, \
309 opener ); \
310 } \
311 } while ( 0 )
312
313#define DBG_EFI_OPENERS_IF( level, handle, protocol ) do { \
314 if ( DBG_ ## level ) { \
315 dbg_efi_openers ( handle, protocol ); \
316 } \
317 } while ( 0 )
318
319#define DBG_EFI_PROTOCOLS_IF( level, handle ) do { \
320 if ( DBG_ ## level ) { \
321 dbg_efi_protocols ( handle ); \
322 } \
323 } while ( 0 )
324
325#define DBGC_EFI_OPENER_IF( level, id, ... ) do { \
326 DBG_AC_IF ( level, id ); \
327 DBG_EFI_OPENER_IF ( level, __VA_ARGS__ ); \
328 DBG_DC_IF ( level ); \
329 } while ( 0 )
330
331#define DBGC_EFI_OPENERS_IF( level, id, ... ) do { \
332 DBG_AC_IF ( level, id ); \
333 DBG_EFI_OPENERS_IF ( level, __VA_ARGS__ ); \
334 DBG_DC_IF ( level ); \
335 } while ( 0 )
336
337#define DBGC_EFI_PROTOCOL_IF( level, id, ... ) do { \
338 DBG_AC_IF ( level, id ); \
339 DBG_EFI_PROTOCOL_IF ( level, __VA_ARGS__ ); \
340 DBG_DC_IF ( level ); \
341 } while ( 0 )
342
343#define DBGC_EFI_PROTOCOLS_IF( level, id, ... ) do { \
344 DBG_AC_IF ( level, id ); \
345 DBG_EFI_PROTOCOLS_IF ( level, __VA_ARGS__ ); \
346 DBG_DC_IF ( level ); \
347 } while ( 0 )
348
349#define DBGC_EFI_OPENER( ... ) \
350 DBGC_EFI_OPENER_IF ( LOG, ##__VA_ARGS__ )
351#define DBGC_EFI_OPENERS( ... ) \
352 DBGC_EFI_OPENERS_IF ( LOG, ##__VA_ARGS__ )
353#define DBGC_EFI_PROTOCOL( ... ) \
354 DBGC_EFI_PROTOCOL_IF ( LOG, ##__VA_ARGS__ )
355#define DBGC_EFI_PROTOCOLS( ... ) \
356 DBGC_EFI_PROTOCOLS_IF ( LOG, ##__VA_ARGS__ )
357
358#define DBGC2_EFI_OPENER( ... ) \
359 DBGC_EFI_OPENER_IF ( EXTRA, ##__VA_ARGS__ )
360#define DBGC2_EFI_OPENERS( ... ) \
361 DBGC_EFI_OPENERS_IF ( EXTRA, ##__VA_ARGS__ )
362#define DBGC2_EFI_PROTOCOL( ... ) \
363 DBGC_EFI_PROTOCOL_IF ( EXTRA, ##__VA_ARGS__ )
364#define DBGC2_EFI_PROTOCOLS( ... ) \
365 DBGC_EFI_PROTOCOLS_IF ( EXTRA, ##__VA_ARGS__ )
366
367#define DBGCP_EFI_OPENER( ... ) \
368 DBGC_EFI_OPENER_IF ( PROFILE, ##__VA_ARGS__ )
369#define DBGCP_EFI_OPENERS( ... ) \
370 DBGC_EFI_OPENERS_IF ( PROFILE, ##__VA_ARGS__ )
371#define DBGCP_EFI_PROTOCOL( ... ) \
372 DBGC_EFI_PROTOCOL_IF ( PROFILE, ##__VA_ARGS__ )
373#define DBGCP_EFI_PROTOCOLS( ... ) \
374 DBGC_EFI_PROTOCOLS_IF ( PROFILE, ##__VA_ARGS__ )
375
376/* Allow for EFI-only interface operations */
377#ifdef PLATFORM_efi
378#define EFI_INTF_OP INTF_OP
379#else
380#define EFI_INTF_OP UNUSED_INTF_OP
381#endif
382
383extern unsigned long __stack_chk_guard;
384extern unsigned long efi_stack_cookie ( EFI_HANDLE handle );
385extern void __stack_chk_fail ( void );
386
387/**
388 * Initialise stack cookie
389 *
390 * @v handle Image handle
391 */
392static inline __attribute__ (( always_inline )) void
394
395 /* The calling function must not itself use stack protection,
396 * since the change in the stack guard value would trigger a
397 * false positive.
398 *
399 * There is unfortunately no way to annotate a function to
400 * exclude the use of stack protection. We must therefore
401 * rely on correctly anticipating the compiler's decision on
402 * the use of stack protection.
403 *
404 * The calculation of the stack cookie value deliberately
405 * takes the address of a stack variable (to provide an
406 * additional source of entropy). This operation would
407 * trigger the application of stack protection to the calling
408 * function, and so must be externalised.
409 */
411}
412
413extern EFI_STATUS efi_init ( EFI_HANDLE image_handle,
414 EFI_SYSTEM_TABLE *systab );
415extern void efi_raise_tpl ( struct efi_saved_tpl *tpl );
416extern void efi_restore_tpl ( struct efi_saved_tpl *tpl );
417extern void efi_drop_tpl ( struct efi_dropped_tpl *tpl );
418extern void efi_undrop_tpl ( struct efi_dropped_tpl *tpl );
420 void **interface );
422 void **interface );
425 void **interface );
428 EFI_HANDLE child, void **interface );
430 EFI_HANDLE child );
431extern int efi_connect ( EFI_HANDLE device, EFI_HANDLE driver );
432extern int efi_disconnect ( EFI_HANDLE device, EFI_HANDLE driver );
433
434/**
435 * Test protocol existence
436 *
437 * @v handle EFI handle
438 * @v protocol Protocol GUID
439 * @ret rc Return status code
440 */
441#define efi_test( handle, protocol ) \
442 efi_open_untyped ( (handle), (protocol), NULL )
443
444/**
445 * Open protocol for ephemeral use
446 *
447 * @v handle EFI handle
448 * @v protocol Protocol GUID
449 * @v interface Protocol interface pointer to fill in
450 * @ret rc Return status code
451 */
452#define efi_open( handle, protocol, interface ) ( { \
453 typeof ( *(interface) ) check_ptr_ptr = NULL; \
454 efi_open_untyped ( (handle), (protocol), \
455 ( ( void ) check_ptr_ptr, \
456 ( void ** ) (interface) ) ); \
457 } )
458
459/**
460 * Open protocol for unsafe persistent use
461 *
462 * @v handle EFI handle
463 * @v protocol Protocol GUID
464 * @v interface Protocol interface pointer to fill in
465 * @ret rc Return status code
466 */
467#define efi_open_unsafe( handle, protocol, interface ) ( { \
468 typeof ( *(interface) ) check_ptr_ptr = NULL; \
469 efi_open_unsafe_untyped ( (handle), (protocol), \
470 ( ( void ) check_ptr_ptr, \
471 ( void ** ) (interface) ) ); \
472 } )
473
474/**
475 * Open protocol for persistent use by a driver
476 *
477 * @v handle EFI handle
478 * @v protocol Protocol GUID
479 * @v interface Protocol interface pointer to fill in
480 * @ret rc Return status code
481 */
482#define efi_open_by_driver( handle, protocol, interface ) ( { \
483 typeof ( *(interface) ) check_ptr_ptr = NULL; \
484 efi_open_by_driver_untyped ( (handle), (protocol), \
485 ( ( void ) check_ptr_ptr, \
486 ( void ** ) (interface) ) ); \
487 } )
488
489/**
490 * Open protocol for persistent use by a child controller
491 *
492 * @v handle EFI handle
493 * @v protocol Protocol GUID
494 * @v child Child controller handle
495 * @v interface Protocol interface pointer to fill in
496 * @ret rc Return status code
497 */
498#define efi_open_by_child( handle, protocol, child, interface ) ( { \
499 typeof ( *(interface) ) check_ptr_ptr = NULL; \
500 efi_open_by_child_untyped ( (handle), (protocol), (child), \
501 ( ( void ) check_ptr_ptr, \
502 ( void ** ) (interface) ) ); \
503 } )
504
505#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
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: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:393
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: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: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.