iPXE
efi.h File Reference

EFI API. More...

#include <ipxe/efi/Uefi/UefiBaseType.h>
#include <ipxe/efi/Uefi.h>
#include <ipxe/efi/PiDxe.h>
#include <ipxe/efi/Protocol/LoadedImage.h>
#include <ipxe/tables.h>
#include <ipxe/uuid.h>
#include <ipxe/version.h>
#include <ipxe/profile.h>

Go to the source code of this file.

Data Structures

struct  EFI_HANDLE
struct  EFI_EVENT
struct  efi_saved_tpl
 An EFI saved task priority level. More...
struct  efi_protocol
 An EFI protocol used by iPXE. More...
struct  efi_config_table
 An EFI configuration table used by iPXE. More...

Macros

#define EFI_HANDLE   STUPID_EFI_HANDLE
#define EFI_EVENT   STUPID_EFI_EVENT
#define _Static_assert(expr, msg)
#define EFI_PROTOCOLS   __table ( struct efi_protocol, "efi_protocols" )
 EFI protocol table.
#define __efi_protocol   __table_entry ( EFI_PROTOCOLS, 01 )
 Declare an EFI protocol used by iPXE.
#define EFI_REQUIRE_PROTOCOL(_protocol, _ptr)
 Declare an EFI protocol to be required by iPXE.
#define EFI_REQUEST_PROTOCOL(_protocol, _ptr)
 Declare an EFI protocol to be requested by iPXE.
#define EFI_CONFIG_TABLES    __table ( struct efi_config_table, "efi_config_tables" )
 EFI configuration table table.
#define __efi_config_table   __table_entry ( EFI_CONFIG_TABLES, 01 )
 Declare an EFI configuration table used by iPXE.
#define EFI_USE_TABLE(_table, _ptr, _required)
 Declare an EFI configuration table to be used by iPXE.
#define EFIRC(rc)
 Convert an iPXE status code to an EFI status code.
#define EEFI(efirc)
 Convert an EFI status code to an iPXE status code.
#define DBG_EFI_OPENER_IF(level, handle, protocol, opener)
#define DBG_EFI_OPENERS_IF(level, handle, protocol)
#define DBG_EFI_PROTOCOLS_IF(level, handle)
#define DBGC_EFI_OPENER_IF(level, id, ...)
#define DBGC_EFI_OPENERS_IF(level, id, ...)
#define DBGC_EFI_PROTOCOL_IF(level, id, ...)
#define DBGC_EFI_PROTOCOLS_IF(level, id, ...)
#define DBGC_EFI_OPENER(...)
#define DBGC_EFI_OPENERS(...)
#define DBGC_EFI_PROTOCOL(...)
#define DBGC_EFI_PROTOCOLS(...)
#define DBGC2_EFI_OPENER(...)
#define DBGC2_EFI_OPENERS(...)
#define DBGC2_EFI_PROTOCOL(...)
#define DBGC2_EFI_PROTOCOLS(...)
#define DBGCP_EFI_OPENER(...)
#define DBGCP_EFI_OPENERS(...)
#define DBGCP_EFI_PROTOCOL(...)
#define DBGCP_EFI_PROTOCOLS(...)
#define EFI_INTF_OP   UNUSED_INTF_OP
#define efi_test(handle, protocol)
 Test protocol existence.
#define efi_open(handle, protocol, interface)
 Open protocol for ephemeral use.
#define efi_open_unsafe(handle, protocol, interface)
 Open protocol for unsafe persistent use.
#define efi_open_by_driver(handle, protocol, interface)
 Open protocol for persistent use by a driver.
#define efi_open_by_child(handle, protocol, child, interface)
 Open protocol for persistent use by a child controller.

Functions

 FILE_LICENCE (GPL2_OR_LATER)
 FILE_SECBOOT (PERMITTED)
const char * efi_guid_ntoa (CONST EFI_GUID *guid)
 Convert GUID to a printable string.
const char * efi_tpl_name (EFI_TPL tpl)
 Name EFI TPL.
const char * efi_locate_search_type_name (EFI_LOCATE_SEARCH_TYPE search_type)
 Name locate search type.
const char * efi_open_attributes_name (unsigned int attributes)
 Name protocol open attributes.
const char * efi_devpath_text (EFI_DEVICE_PATH_PROTOCOL *path)
 Get textual representation of device path.
const char * efi_handle_name (EFI_HANDLE handle)
 Get name of an EFI handle.
void dbg_efi_opener (EFI_HANDLE handle, EFI_GUID *protocol, EFI_OPEN_PROTOCOL_INFORMATION_ENTRY *opener)
 Print opened protocol information.
void dbg_efi_openers (EFI_HANDLE handle, EFI_GUID *protocol)
 Print list of openers of a given protocol on a given handle.
void dbg_efi_protocol (EFI_HANDLE handle, EFI_GUID *protocol)
 Print protocol information on a given handle.
void dbg_efi_protocols (EFI_HANDLE handle)
 Print list of protocol handlers attached to a handle.
unsigned long efi_stack_cookie (EFI_HANDLE handle)
 Construct a stack cookie value.
void __stack_chk_fail (void)
 Abort on stack check failure.
static void efi_init_stack_guard (EFI_HANDLE handle)
 Initialise stack cookie.
EFI_STATUS efi_init (EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *systab)
 Initialise EFI environment.
void efi_raise_tpl (struct efi_saved_tpl *tpl)
 Raise task priority level to internal level.
void efi_restore_tpl (struct efi_saved_tpl *tpl)
 Restore task priority level.
int efi_open_untyped (EFI_HANDLE handle, EFI_GUID *protocol, void **interface)
 Open (or test) protocol for ephemeral use.
int efi_open_unsafe_untyped (EFI_HANDLE handle, EFI_GUID *protocol, void **interface)
 Open protocol for unsafe persistent use.
void efi_close_unsafe (EFI_HANDLE handle, EFI_GUID *protocol)
 Close protocol opened for unsafe persistent use.
int efi_open_by_driver_untyped (EFI_HANDLE handle, EFI_GUID *protocol, void **interface)
 Open protocol for persistent use by a driver.
void efi_close_by_driver (EFI_HANDLE handle, EFI_GUID *protocol)
 Close protocol opened for persistent use by a driver.
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.
void efi_close_by_child (EFI_HANDLE handle, EFI_GUID *protocol, EFI_HANDLE child)
 Close protocol opened for persistent use by a child controller.
int efi_connect (EFI_HANDLE device, EFI_HANDLE driver)
 Connect UEFI driver(s)
int efi_disconnect (EFI_HANDLE device, EFI_HANDLE driver)
 Disconnect UEFI driver(s)

Variables

EFI_GUID efi_absolute_pointer_protocol_guid
 Absolute pointer protocol GUID.
EFI_GUID efi_acpi_table_protocol_guid
 ACPI table protocol GUID.
EFI_GUID efi_adapter_information_protocol_guid
 Adapter information protocol GUID.
EFI_GUID efi_apple_net_boot_protocol_guid
 Apple NetBoot protocol GUID.
EFI_GUID efi_arp_protocol_guid
 ARP protocol GUID.
EFI_GUID efi_arp_service_binding_protocol_guid
 ARP service binding protocol GUID.
EFI_GUID efi_block_io_protocol_guid
 Block I/O protocol GUID.
EFI_GUID efi_block_io2_protocol_guid
 Block I/O version 2 protocol GUID.
EFI_GUID efi_bus_specific_driver_override_protocol_guid
 Bus specific driver override protocol GUID.
EFI_GUID efi_component_name_protocol_guid
 Component name protocol GUID.
EFI_GUID efi_component_name2_protocol_guid
 Component name 2 protocol GUID.
EFI_GUID efi_console_control_protocol_guid
 Console control protocol GUID.
EFI_GUID efi_device_path_protocol_guid
 Device path protocol GUID.
EFI_GUID efi_dhcp4_protocol_guid
 DHCPv4 protocol GUID.
EFI_GUID efi_dhcp4_service_binding_protocol_guid
 DHCPv4 service binding protocol GUID.
EFI_GUID efi_dhcp6_protocol_guid
 DHCPv6 protocol GUID.
EFI_GUID efi_dhcp6_service_binding_protocol_guid
 DHCPv6 service binding protocol GUID.
EFI_GUID efi_disk_io_protocol_guid
 Disk I/O protocol GUID.
EFI_GUID efi_dns4_protocol_guid
 DNSv4 protocol GUID.
EFI_GUID efi_dns4_service_binding_protocol_guid
 DNSv4 service binding protocol GUID.
EFI_GUID efi_dns6_protocol_guid
 DNSv6 protocol GUID.
EFI_GUID efi_dns6_service_binding_protocol_guid
 DNSv6 service binding protocol GUID.
EFI_GUID efi_driver_binding_protocol_guid
 Driver binding protocol GUID.
EFI_GUID efi_eap_configuration_protocol_guid
 EAP configuration protocol GUID.
EFI_GUID efi_graphics_output_protocol_guid
 Graphics output protocol GUID.
EFI_GUID efi_hii_config_access_protocol_guid
 HII configuration access protocol GUID.
EFI_GUID efi_hii_font_protocol_guid
 HII font protocol GUID.
EFI_GUID efi_http_protocol_guid
 HTTP protocol GUID.
EFI_GUID efi_http_service_binding_protocol_guid
 HTTP service binding protocol GUID.
EFI_GUID efi_ip4_protocol_guid
 IPv4 protocol GUID.
EFI_GUID efi_ip4_config_protocol_guid
 IPv4 configuration protocol GUID.
EFI_GUID efi_ip4_config2_protocol_guid
 IPv4 configuration 2 protocol GUID.
EFI_GUID efi_ip4_service_binding_protocol_guid
 IPv4 service binding protocol GUID.
EFI_GUID efi_ip6_protocol_guid
 IPv6 protocol GUID.
EFI_GUID efi_ip6_config_protocol_guid
 IPv6 configuration protocol GUID.
EFI_GUID efi_ip6_service_binding_protocol_guid
 IPv6 service binding protocol GUID.
EFI_GUID efi_load_file_protocol_guid
 Load file protocol GUID.
EFI_GUID efi_load_file2_protocol_guid
 Load file 2 protocol GUID.
EFI_GUID efi_loaded_image_protocol_guid
 Loaded image protocol GUID.
EFI_GUID efi_loaded_image_device_path_protocol_guid
 Loaded image device path protocol GUID.
EFI_GUID efi_managed_network_protocol_guid
 Managed network protocol GUID.
EFI_GUID efi_managed_network_service_binding_protocol_guid
 Managed network service binding protocol GUID.
EFI_GUID efi_mtftp4_protocol_guid
 MTFTPv4 protocol GUID.
EFI_GUID efi_mtftp4_service_binding_protocol_guid
 MTFTPv4 service binding protocol GUID.
EFI_GUID efi_mtftp6_protocol_guid
 MTFTPv6 protocol GUID.
EFI_GUID efi_mtftp6_service_binding_protocol_guid
 MTFTPv6 service binding protocol GUID.
EFI_GUID efi_nii_protocol_guid
 Network interface identifier protocol GUID (old version)
EFI_GUID efi_nii31_protocol_guid
 Network interface identifier protocol GUID (new version)
EFI_GUID efi_pci_io_protocol_guid
 PCI I/O protocol GUID.
EFI_GUID efi_pci_root_bridge_io_protocol_guid
 PCI root bridge I/O protocol GUID.
EFI_GUID efi_pxe_base_code_protocol_guid
 PXE base code protocol GUID.
EFI_GUID efi_rng_protocol_guid
 Random number generator protocol GUID.
EFI_GUID efi_serial_io_protocol_guid
 Serial I/O protocol GUID.
EFI_GUID efi_shim_lock_protocol_guid
 Shim lock protocol GUID.
EFI_GUID efi_simple_file_system_protocol_guid
 Simple file system protocol GUID.
EFI_GUID efi_simple_network_protocol_guid
 Simple network protocol GUID.
EFI_GUID efi_simple_pointer_protocol_guid
 Simple pointer protocol GUID.
EFI_GUID efi_simple_text_input_protocol_guid
 Simple text input protocol GUID.
EFI_GUID efi_simple_text_input_ex_protocol_guid
 Simple text input extension protocol GUID.
EFI_GUID efi_simple_text_output_protocol_guid
 Simple text output protocol GUID.
EFI_GUID efi_storage_security_command_protocol_guid
 Storage security protocol GUID.
EFI_GUID efi_supplicant_protocol_guid
 Supplicant protocol GUID.
EFI_GUID efi_tcg_protocol_guid
 TCG protocol GUID.
EFI_GUID efi_tcg2_protocol_guid
 TCG2 protocol GUID.
EFI_GUID efi_tcp4_protocol_guid
 TCPv4 protocol GUID.
EFI_GUID efi_tcp4_service_binding_protocol_guid
 TCPv4 service binding protocol GUID.
EFI_GUID efi_tcp6_protocol_guid
 TCPv6 protocol GUID.
EFI_GUID efi_tcp6_service_binding_protocol_guid
 TCPv6 service binding protocol GUID.
EFI_GUID efi_tree_protocol_guid
 TrEE protocol GUID.
EFI_GUID efi_udp4_protocol_guid
 UDPv4 protocol GUID.
EFI_GUID efi_udp4_service_binding_protocol_guid
 UDPv4 service binding protocol GUID.
EFI_GUID efi_udp6_protocol_guid
 UDPv6 protocol GUID.
EFI_GUID efi_udp6_service_binding_protocol_guid
 UDPv6 service binding protocol GUID.
EFI_GUID efi_uga_draw_protocol_guid
 UGA draw protocol GUID.
EFI_GUID efi_unicode_collation_protocol_guid
 Unicode collation protocol GUID.
EFI_GUID efi_usb_hc_protocol_guid
 USB host controller protocol GUID.
EFI_GUID efi_usb2_hc_protocol_guid
 USB2 host controller protocol GUID.
EFI_GUID efi_usb_io_protocol_guid
 USB I/O protocol GUID.
EFI_GUID efi_vlan_config_protocol_guid
 VLAN configuration protocol GUID.
EFI_GUID efi_wifi2_protocol_guid
 WiFi 2 protocol GUID.
EFI_GUID efi_acpi_10_table_guid
 ACPI 1.0 table GUID.
EFI_GUID efi_acpi_20_table_guid
 ACPI 2.0 table GUID.
EFI_GUID efi_fdt_table_guid
 FDT table GUID.
EFI_GUID efi_smbios_table_guid
 SMBIOS table GUID.
EFI_GUID efi_smbios2_table_guid
EFI_GUID efi_cert_x509_guid
 X.509 certificate GUID.
EFI_GUID efi_file_info_id
 File information GUID.
EFI_GUID efi_file_system_info_id
 File system information GUID.
EFI_GUID efi_global_variable
 Global variable GUID.
EFI_GUID efi_image_security_database_guid
 Image security database GUID.
EFI_GUID efi_microsoft_vendor_guid
 Microsoft vendor GUID.
EFI_GUID efi_tls_ca_certificate_guid
 TLS CA certificate variable GUID.
EFI_HANDLE efi_image_handle
 Image handle passed to entry point.
EFI_LOADED_IMAGE_PROTOCOLefi_loaded_image
 Loaded image protocol for this image.
EFI_DEVICE_PATH_PROTOCOLefi_loaded_image_path
 Device path for the loaded image's device handle.
EFI_SYSTEM_TABLEefi_systab
EFI_TPL efi_internal_tpl
 Internal task priority level.
EFI_TPL efi_external_tpl
 External task priority level.
int efi_shutdown_in_progress
 EFI shutdown is in progress.
unsigned long __stack_chk_guard
 Stack cookie.

Detailed Description

EFI API.

The intention is to include near-verbatim copies of the EFI headers required by iPXE. This is achieved using the import.pl script in this directory. Run the import script to update the local copies of the headers:

./import.pl /path/to/edk2/edk2

where /path/to/edk2/edk2 is the path to your local checkout of the EFI Development Kit.

Note that import.pl will modify any #include lines in each imported header to reflect its new location within the iPXE tree. It will also tidy up the file by removing carriage return characters and trailing whitespace.

Definition in file efi.h.

Macro Definition Documentation

◆ EFI_HANDLE

#define EFI_HANDLE   STUPID_EFI_HANDLE

Definition at line 53 of file efi.h.

Referenced by _efi_start(), _efidrv_start(), chained_locate(), chained_supported(), dbg_efi_opener(), dbg_efi_openers(), dbg_efi_protocol(), dbg_efi_protocols(), efi_autoexec_filesystem(), efi_autoexec_load(), efi_autoexec_network(), efi_binding_name(), efi_binding_name2(), efi_block_boot(), efi_block_connect(), efi_block_exec(), efi_block_filename(), efi_block_local(), efi_block_match(), efi_block_root(), efi_block_scan(), efi_bofm_start(), efi_bofm_supported(), efi_cachedhcp_record(), efi_child_add(), efi_child_del(), efi_close_by_child(), efi_close_by_driver(), efi_close_protocol_wrapper(), efi_close_unsafe(), efi_connect(), efi_connect_controller_wrapper(), efi_device_info(), efi_device_info_pci(), efi_disconnect(), efi_disconnect_controller_wrapper(), efi_download_install(), efi_download_uninstall(), efi_driver_connect(), efi_driver_controller_name(), efi_driver_disconnect(), efi_driver_exclude(), efi_driver_handles(), efi_driver_reconnect(), efi_driver_start(), efi_driver_stop(), efi_driver_supported(), efi_dump_image(), efi_exit_boot_services_wrapper(), efi_exit_wrapper(), efi_file_install(), efi_file_path_claim(), efi_file_uninstall(), efi_handle_name(), efi_handle_protocol_wrapper(), efi_image_exec(), efi_image_probe(), efi_init(), efi_init_application(), efi_init_stack_guard(), efi_install_multiple_protocol_interfaces_wrapper(), efi_install_protocol_interface_wrapper(), efi_load_image_wrapper(), efi_local_check_volume_name(), efi_local_open_root(), efi_local_open_volume(), efi_locate_device(), efi_locate_device_path_wrapper(), efi_locate_handle_buffer_wrapper(), efi_locate_handle_wrapper(), efi_null_get_controller_name(), efi_open_by_child_untyped(), efi_open_by_driver_untyped(), efi_open_protocol_information_wrapper(), efi_open_protocol_wrapper(), efi_open_unsafe_untyped(), efi_open_untyped(), efi_protocols_per_handle_wrapper(), efi_pxe_find(), efi_pxe_install(), efi_pxe_uninstall(), efi_reinstall_protocol_interface_wrapper(), efi_service_add(), efi_service_del(), efi_set_autoboot_ll_addr(), efi_shim_inhibit_pxe(), efi_shim_install(), efi_snp_get_controller_name(), efi_stack_cookie(), efi_start_image_wrapper(), efi_uninstall_multiple_protocol_interfaces_wrapper(), efi_uninstall_protocol_interface_wrapper(), efi_unload(), efi_unload_image_wrapper(), efi_veto(), efi_veto_close(), efi_veto_close_handle(), efi_veto_close_protocol(), efi_veto_destroy(), efi_veto_disconnect(), efi_veto_find(), efi_veto_uninstall(), efi_veto_unload(), efi_wrap_image(), efidev_alloc(), efidev_find(), efipci_discover(), efipci_discover_any(), efipci_discover_one(), efipci_exclude(), efipci_info(), efipci_ioremap(), efipci_read(), efipci_root_open(), efipci_start(), efipci_stop(), efipci_supported(), efipci_write(), FILE_SECBOOT(), find_snpdev(), mnp_supported(), mnpnet_start(), mnponly_supported(), mnptemp_create(), nii_exclude(), nii_pci_open(), nii_start(), nii_stop(), nii_supported(), niionly_supported(), snp_supported(), snpnet_exclude(), snpnet_insomniac_patch(), snpnet_insomniac_restore(), snpnet_is_insomniac(), snpnet_start(), snpnet_stop(), snpnet_supported(), snponly_supported(), usbio_bulk_in_poll(), usbio_bulk_out_poll(), usbio_config(), usbio_control_poll(), usbio_endpoint_open(), usbio_exclude(), usbio_interface(), usbio_interfaces(), usbio_interrupt_callback(), usbio_interrupt_open(), usbio_open(), usbio_path(), usbio_start(), usbio_stop(), and usbio_supported().

◆ EFI_EVENT

◆ _Static_assert

#define _Static_assert ( expr,
msg )

Definition at line 56 of file efi.h.

◆ EFI_PROTOCOLS

#define EFI_PROTOCOLS   __table ( struct efi_protocol, "efi_protocols" )

EFI protocol table.

Definition at line 98 of file efi.h.

Referenced by efi_init().

◆ __efi_protocol

#define __efi_protocol   __table_entry ( EFI_PROTOCOLS, 01 )

Declare an EFI protocol used by iPXE.

Definition at line 101 of file efi.h.

◆ EFI_REQUIRE_PROTOCOL

#define EFI_REQUIRE_PROTOCOL ( _protocol,
_ptr )
Value:
struct efi_protocol __ ## _protocol __efi_protocol = { \
.guid = _protocol ## _GUID, \
.protocol = ( ( void ** ) ( void * ) \
( ( (_ptr) == ( ( _protocol ** ) (_ptr) ) ) ? \
(_ptr) : (_ptr) ) ), \
.required = 1, \
}
#define __efi_protocol
Declare an EFI protocol used by iPXE.
Definition efi.h:101
An EFI protocol used by iPXE.
Definition efi.h:88

Declare an EFI protocol to be required by iPXE.

Parameters
_protocolEFI protocol name
_ptrPointer to protocol instance

Definition at line 108 of file efi.h.

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 }

◆ EFI_REQUEST_PROTOCOL

#define EFI_REQUEST_PROTOCOL ( _protocol,
_ptr )
Value:
struct efi_protocol __ ## _protocol __efi_protocol = { \
.guid = _protocol ## _GUID, \
.protocol = ( ( void ** ) ( void * ) \
( ( (_ptr) == ( ( _protocol ** ) (_ptr) ) ) ? \
(_ptr) : (_ptr) ) ), \
.required = 0, \
}

Declare an EFI protocol to be requested by iPXE.

Parameters
_protocolEFI protocol name
_ptrPointer to protocol instance

Definition at line 122 of file efi.h.

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 }

◆ EFI_CONFIG_TABLES

#define EFI_CONFIG_TABLES    __table ( struct efi_config_table, "efi_config_tables" )

EFI configuration table table.

Definition at line 142 of file efi.h.

142#define EFI_CONFIG_TABLES \
143 __table ( struct efi_config_table, "efi_config_tables" )

Referenced by efi_init().

◆ __efi_config_table

#define __efi_config_table   __table_entry ( EFI_CONFIG_TABLES, 01 )

Declare an EFI configuration table used by iPXE.

Definition at line 146 of file efi.h.

◆ EFI_USE_TABLE

#define EFI_USE_TABLE ( _table,
_ptr,
_required )
Value:
struct efi_config_table __ ## _table __efi_config_table = { \
.guid = _table ## _GUID, \
.table = ( ( void ** ) ( void * ) (_ptr) ), \
.required = (_required), \
}
#define __efi_config_table
Declare an EFI configuration table used by iPXE.
Definition efi.h:146
An EFI configuration table used by iPXE.
Definition efi.h:132

Declare an EFI configuration table to be used by iPXE.

Parameters
_tableEFI configuration table name
_ptrPointer to configuration table
_requiredTable is required for operation

Definition at line 154 of file efi.h.

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 }

◆ EFIRC

◆ EEFI

#define EEFI ( efirc)
Value:
#define EPLATFORM(einfo_base, platform,...)
Generate an error based on an external platform error code.
Definition errno.h:249
#define EINFO_EPLATFORM
Platform-generated base error.
Definition errno.h:692

Convert an EFI status code to an iPXE status code.

Parameters
efircEFI status code
Return values
rciPXE status code (before negation)

Definition at line 175 of file efi.h.

Referenced by __stack_chk_fail(), dbg_efi_openers(), dbg_efi_protocols(), efi_block_boot(), efi_block_describe(), efi_block_exec(), efi_block_filename(), efi_block_hook(), efi_block_install(), efi_block_label(), efi_block_root(), efi_block_scan(), efi_block_unhook(), efi_bofm_start(), efi_bofm_supported(), efi_boot_path(), efi_cacert_all(), efi_current_boot_path(), efi_disconnect(), efi_download_abort(), efi_download_deliver_iob(), efi_download_install(), efi_driver_connect(), efi_driver_exclude(), efi_driver_handles(), efi_driver_install(), efi_entropy_enable(), efi_entropy_tick(), efi_file_install(), efi_file_path_claim(), efi_file_path_install(), efi_file_path_uninstall(), efi_file_uninstall(), efi_get_time(), efi_getchar(), efi_init(), efi_install_table(), efi_local_check_volume_name(), efi_local_len(), efi_local_open_root(), efi_local_open_volume(), efi_local_step(), efi_locate_device(), efi_mp_start_all(), efi_open_by_child_untyped(), efi_open_by_driver_untyped(), efi_open_unsafe_untyped(), efi_open_untyped(), efi_pxe_install(), efi_pxe_uninstall(), efi_reboot(), efi_service_add(), efi_service_del(), efi_shim_inhibit_pxe(), efi_snp_hii_append(), efi_snp_hii_install(), efi_snp_hii_uninstall(), efi_snp_probe(), efi_snp_remove(), efi_tick_shutdown(), efi_tick_startup(), efi_udelay(), efi_urealloc(), efi_usb_async_start(), efi_usb_get_string_descriptor(), efi_usb_install(), efi_usb_open(), efi_usb_uninstall(), efi_veto(), efi_veto_close(), efi_veto_close_handle(), efi_veto_close_protocol(), efi_veto_disconnect(), efi_veto_uninstall(), efi_veto_unload(), efi_vlan_find(), efi_watchdog_expired(), efi_watchdog_shutdown(), efifb_draw(), efifb_init(), efifb_restore(), efifb_select_mode(), efipci_discover_any(), efipci_discover_one(), efipci_dma_alloc(), efipci_dma_map(), efipci_dma_set_mask(), efipci_info(), efipci_ioremap(), efipci_read(), efipci_write(), efirng_get_noise(), efivars_fetch(), efivars_find(), mnpnet_open(), mnpnet_poll_rx(), mnpnet_poll_tx(), mnpnet_refill_rx(), mnpnet_start(), mnpnet_transmit(), nii_io(), nii_map(), nii_pci_open(), snpnet_close(), snpnet_open(), snpnet_poll_rx(), snpnet_poll_tx(), snpnet_rx_filters(), snpnet_start(), snpnet_stop(), snpnet_transmit(), txnic_bgx_mac(), usbio_bulk_in_poll(), usbio_bulk_out_poll(), usbio_config(), usbio_control_poll(), usbio_interfaces(), usbio_interrupt_open(), usbio_open(), and usbio_supported().

◆ DBG_EFI_OPENER_IF

#define DBG_EFI_OPENER_IF ( level,
handle,
protocol,
opener )
Value:
do { \
if ( DBG_ ## level ) { \
dbg_efi_opener ( handle, protocol, \
opener ); \
} \
} while ( 0 )
uint16_t handle
Handle.
Definition smbios.h:5
uint16_t protocol
Protocol ID.
Definition stp.h:7

Definition at line 299 of file efi.h.

◆ DBG_EFI_OPENERS_IF

#define DBG_EFI_OPENERS_IF ( level,
handle,
protocol )
Value:
do { \
if ( DBG_ ## level ) { \
dbg_efi_openers ( handle, protocol ); \
} \
} while ( 0 )

Definition at line 307 of file efi.h.

307#define DBG_EFI_OPENERS_IF( level, handle, protocol ) do { \
308 if ( DBG_ ## level ) { \
309 dbg_efi_openers ( handle, protocol ); \
310 } \
311 } while ( 0 )

◆ DBG_EFI_PROTOCOLS_IF

#define DBG_EFI_PROTOCOLS_IF ( level,
handle )
Value:
do { \
if ( DBG_ ## level ) { \
dbg_efi_protocols ( handle ); \
} \
} while ( 0 )

Definition at line 313 of file efi.h.

313#define DBG_EFI_PROTOCOLS_IF( level, handle ) do { \
314 if ( DBG_ ## level ) { \
315 dbg_efi_protocols ( handle ); \
316 } \
317 } while ( 0 )

◆ DBGC_EFI_OPENER_IF

#define DBGC_EFI_OPENER_IF ( level,
id,
... )
Value:
do { \
DBG_AC_IF ( level, id ); \
DBG_EFI_OPENER_IF ( level, __VA_ARGS__ ); \
DBG_DC_IF ( level ); \
} while ( 0 )

Definition at line 319 of file efi.h.

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 )

◆ DBGC_EFI_OPENERS_IF

#define DBGC_EFI_OPENERS_IF ( level,
id,
... )
Value:
do { \
DBG_AC_IF ( level, id ); \
DBG_EFI_OPENERS_IF ( level, __VA_ARGS__ ); \
DBG_DC_IF ( level ); \
} while ( 0 )

Definition at line 325 of file efi.h.

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 )

◆ DBGC_EFI_PROTOCOL_IF

#define DBGC_EFI_PROTOCOL_IF ( level,
id,
... )
Value:
do { \
DBG_AC_IF ( level, id ); \
DBG_EFI_PROTOCOL_IF ( level, __VA_ARGS__ ); \
DBG_DC_IF ( level ); \
} while ( 0 )

Definition at line 331 of file efi.h.

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 )

◆ DBGC_EFI_PROTOCOLS_IF

#define DBGC_EFI_PROTOCOLS_IF ( level,
id,
... )
Value:
do { \
DBG_AC_IF ( level, id ); \
DBG_EFI_PROTOCOLS_IF ( level, __VA_ARGS__ ); \
DBG_DC_IF ( level ); \
} while ( 0 )

Definition at line 337 of file efi.h.

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 )

◆ DBGC_EFI_OPENER

#define DBGC_EFI_OPENER ( ...)
Value:
DBGC_EFI_OPENER_IF ( LOG, ##__VA_ARGS__ )
#define DBGC_EFI_OPENER_IF(level, id,...)
Definition efi.h:319

Definition at line 343 of file efi.h.

343#define DBGC_EFI_OPENER( ... ) \
344 DBGC_EFI_OPENER_IF ( LOG, ##__VA_ARGS__ )

Referenced by efi_veto_close_protocol().

◆ DBGC_EFI_OPENERS

#define DBGC_EFI_OPENERS ( ...)
Value:
DBGC_EFI_OPENERS_IF ( LOG, ##__VA_ARGS__ )
#define DBGC_EFI_OPENERS_IF(level, id,...)
Definition efi.h:325

Definition at line 345 of file efi.h.

345#define DBGC_EFI_OPENERS( ... ) \
346 DBGC_EFI_OPENERS_IF ( LOG, ##__VA_ARGS__ )

Referenced by efi_child_add(), efi_file_install(), efipci_start(), nii_start(), snpnet_start(), usbio_open(), and usbio_start().

◆ DBGC_EFI_PROTOCOL

#define DBGC_EFI_PROTOCOL ( ...)
Value:
DBGC_EFI_PROTOCOL_IF ( LOG, ##__VA_ARGS__ )
#define DBGC_EFI_PROTOCOL_IF(level, id,...)
Definition efi.h:331

Definition at line 347 of file efi.h.

347#define DBGC_EFI_PROTOCOL( ... ) \
348 DBGC_EFI_PROTOCOL_IF ( LOG, ##__VA_ARGS__ )

◆ DBGC_EFI_PROTOCOLS

#define DBGC_EFI_PROTOCOLS ( ...)
Value:
DBGC_EFI_PROTOCOLS_IF ( LOG, ##__VA_ARGS__ )
#define DBGC_EFI_PROTOCOLS_IF(level, id,...)
Definition efi.h:337

Definition at line 349 of file efi.h.

349#define DBGC_EFI_PROTOCOLS( ... ) \
350 DBGC_EFI_PROTOCOLS_IF ( LOG, ##__VA_ARGS__ )

Referenced by efi_dump_image().

◆ DBGC2_EFI_OPENER

#define DBGC2_EFI_OPENER ( ...)
Value:
DBGC_EFI_OPENER_IF ( EXTRA, ##__VA_ARGS__ )

Definition at line 352 of file efi.h.

352#define DBGC2_EFI_OPENER( ... ) \
353 DBGC_EFI_OPENER_IF ( EXTRA, ##__VA_ARGS__ )

◆ DBGC2_EFI_OPENERS

#define DBGC2_EFI_OPENERS ( ...)
Value:
DBGC_EFI_OPENERS_IF ( EXTRA, ##__VA_ARGS__ )

Definition at line 354 of file efi.h.

354#define DBGC2_EFI_OPENERS( ... ) \
355 DBGC_EFI_OPENERS_IF ( EXTRA, ##__VA_ARGS__ )

◆ DBGC2_EFI_PROTOCOL

#define DBGC2_EFI_PROTOCOL ( ...)
Value:
DBGC_EFI_PROTOCOL_IF ( EXTRA, ##__VA_ARGS__ )

Definition at line 356 of file efi.h.

356#define DBGC2_EFI_PROTOCOL( ... ) \
357 DBGC_EFI_PROTOCOL_IF ( EXTRA, ##__VA_ARGS__ )

◆ DBGC2_EFI_PROTOCOLS

#define DBGC2_EFI_PROTOCOLS ( ...)
Value:
DBGC_EFI_PROTOCOLS_IF ( EXTRA, ##__VA_ARGS__ )

Definition at line 358 of file efi.h.

358#define DBGC2_EFI_PROTOCOLS( ... ) \
359 DBGC_EFI_PROTOCOLS_IF ( EXTRA, ##__VA_ARGS__ )

Referenced by efi_block_connect(), and efi_driver_connect().

◆ DBGCP_EFI_OPENER

#define DBGCP_EFI_OPENER ( ...)
Value:
DBGC_EFI_OPENER_IF ( PROFILE, ##__VA_ARGS__ )

Definition at line 361 of file efi.h.

361#define DBGCP_EFI_OPENER( ... ) \
362 DBGC_EFI_OPENER_IF ( PROFILE, ##__VA_ARGS__ )

◆ DBGCP_EFI_OPENERS

#define DBGCP_EFI_OPENERS ( ...)
Value:
DBGC_EFI_OPENERS_IF ( PROFILE, ##__VA_ARGS__ )

Definition at line 363 of file efi.h.

363#define DBGCP_EFI_OPENERS( ... ) \
364 DBGC_EFI_OPENERS_IF ( PROFILE, ##__VA_ARGS__ )

◆ DBGCP_EFI_PROTOCOL

#define DBGCP_EFI_PROTOCOL ( ...)
Value:
DBGC_EFI_PROTOCOL_IF ( PROFILE, ##__VA_ARGS__ )

Definition at line 365 of file efi.h.

365#define DBGCP_EFI_PROTOCOL( ... ) \
366 DBGC_EFI_PROTOCOL_IF ( PROFILE, ##__VA_ARGS__ )

◆ DBGCP_EFI_PROTOCOLS

#define DBGCP_EFI_PROTOCOLS ( ...)
Value:
DBGC_EFI_PROTOCOLS_IF ( PROFILE, ##__VA_ARGS__ )

Definition at line 367 of file efi.h.

367#define DBGCP_EFI_PROTOCOLS( ... ) \
368 DBGC_EFI_PROTOCOLS_IF ( PROFILE, ##__VA_ARGS__ )

◆ EFI_INTF_OP

#define EFI_INTF_OP   UNUSED_INTF_OP

Definition at line 374 of file efi.h.

◆ efi_test

#define efi_test ( handle,
protocol )
Value:
#define NULL
NULL pointer (VOID *)
Definition Base.h:322
int efi_open_untyped(EFI_HANDLE handle, EFI_GUID *protocol, void **interface)
Open (or test) protocol for ephemeral use.
Definition efi_open.c:97

Test protocol existence.

Parameters
handleEFI handle
protocolProtocol GUID
Return values
rcReturn status code

Definition at line 433 of file efi.h.

433#define efi_test( handle, protocol ) \
434 efi_open_untyped ( (handle), (protocol), NULL )

Referenced by chained_supported(), snpnet_is_insomniac(), and snpnet_supported().

◆ efi_open

#define efi_open ( handle,
protocol,
interface )
Value:
( { \
typeof ( *(interface) ) check_ptr_ptr = NULL; \
efi_open_untyped ( (handle), (protocol), \
( ( void ) check_ptr_ptr, \
( void ** ) (interface) ) ); \
} )
An object interface.
Definition interface.h:125

Open protocol for ephemeral use.

Parameters
handleEFI handle
protocolProtocol GUID
interfaceProtocol interface pointer to fill in
Return values
rcReturn status code

Definition at line 444 of file efi.h.

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 } )

Referenced by chained_locate(), chained_supported(), dbg_efi_protocol(), efi_binding_name(), efi_binding_name2(), efi_block_local(), efi_block_match(), efi_block_root(), efi_block_scan(), efi_cachedhcp_record(), efi_driver_controller_name(), efi_dump_image(), efi_file_path_claim(), efi_handle_name(), efi_image_exec(), efi_init(), efi_local_open_root(), efi_locate_device(), efi_service_add(), efi_service_del(), efi_set_autoboot_ll_addr(), efi_shim_inhibit_pxe(), efi_veto_find(), efi_veto_uninstall(), efidev_alloc(), efipci_discover_one(), efipci_info(), efipci_root_open(), snpnet_insomniac_patch(), snpnet_insomniac_restore(), usbio_path(), and usbio_supported().

◆ efi_open_unsafe

#define efi_open_unsafe ( handle,
protocol,
interface )
Value:
( { \
typeof ( *(interface) ) check_ptr_ptr = NULL; \
efi_open_unsafe_untyped ( (handle), (protocol), \
( ( void ) check_ptr_ptr, \
( void ** ) (interface) ) ); \
} )

Open protocol for unsafe persistent use.

Parameters
handleEFI handle
protocolProtocol GUID
interfaceProtocol interface pointer to fill in
Return values
rcReturn status code

Definition at line 459 of file efi.h.

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 } )

Referenced by efi_bofm_start(), efi_console_init(), efi_init(), and nii_pci_open().

◆ efi_open_by_driver

#define efi_open_by_driver ( handle,
protocol,
interface )
Value:
( { \
typeof ( *(interface) ) check_ptr_ptr = NULL; \
efi_open_by_driver_untyped ( (handle), (protocol), \
( ( void ) check_ptr_ptr, \
( void ** ) (interface) ) ); \
} )

Open protocol for persistent use by a driver.

Parameters
handleEFI handle
protocolProtocol GUID
interfaceProtocol interface pointer to fill in
Return values
rcReturn status code

Definition at line 474 of file efi.h.

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 } )

Referenced by efi_file_install(), efi_snp_probe(), efipci_start(), mnpnet_start(), nii_start(), snpnet_start(), usbio_open(), and usbio_start().

◆ efi_open_by_child

#define efi_open_by_child ( handle,
protocol,
child,
interface )
Value:
( { \
typeof ( *(interface) ) check_ptr_ptr = NULL; \
efi_open_by_child_untyped ( (handle), (protocol), (child), \
( ( void ) check_ptr_ptr, \
( void ** ) (interface) ) ); \
} )

Open protocol for persistent use by a child controller.

Parameters
handleEFI handle
protocolProtocol GUID
childChild controller handle
interfaceProtocol interface pointer to fill in
Return values
rcReturn status code

Definition at line 490 of file efi.h.

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 } )

Referenced by efi_child_add().

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER )

◆ FILE_SECBOOT()

FILE_SECBOOT ( PERMITTED )

◆ efi_guid_ntoa()

const char * efi_guid_ntoa ( CONST EFI_GUID * guid)
extern

Convert GUID to a printable string.

Parameters
guidGUID
Return values
stringPrintable string

Definition at line 726 of file efi_guid.c.

726 {
727 union {
728 union uuid uuid;
730 } u;
731 unsigned int i;
732
733 /* Sanity check */
734 if ( ! guid )
735 return NULL;
736
737 /* Check for a match against well-known GUIDs */
738 for ( i = 0 ; i < ( sizeof ( efi_well_known_guids ) /
739 sizeof ( efi_well_known_guids[0] ) ) ; i++ ) {
741 sizeof ( *guid ) ) == 0 ) {
742 return efi_well_known_guids[i].name;
743 }
744 }
745
746 /* Convert GUID to standard endianness */
747 memcpy ( &u.guid, guid, sizeof ( u.guid ) );
748 uuid_mangle ( &u.uuid );
749 return uuid_ntoa ( &u.uuid );
750}
GUID EFI_GUID
128-bit buffer containing a unique identifier value.
union @104331263140136355135267063077374276003064103115 u
uint64_t guid
GUID.
Definition edd.h:1
static struct efi_well_known_guid efi_well_known_guids[]
Well-known GUIDs.
Definition efi_guid.c:525
void * memcpy(void *dest, const void *src, size_t len) __nonnull
int memcmp(const void *first, const void *second, size_t len)
Compare memory regions.
Definition string.c:115
A universally unique ID.
Definition uuid.h:16
const char * uuid_ntoa(const union uuid *uuid)
Convert UUID to printable string.
Definition uuid.c:46
static void uuid_mangle(union uuid *uuid)
Change UUID endianness.
Definition uuid.h:44

References CONST, efi_well_known_guids, guid, memcmp(), memcpy(), NULL, u, uuid_mangle(), and uuid_ntoa().

Referenced by chained_locate(), chained_supported(), dbg_efi_opener(), dbg_efi_openers(), dbg_efi_protocol(), efi_autoexec_load(), efi_close_protocol_wrapper(), efi_create_event_ex_wrapper(), efi_driver_exclude(), efi_file_get_info(), efi_file_path_uninstall(), efi_file_set_info(), efi_find_table(), efi_get_next_variable_name_wrapper(), efi_get_variable_wrapper(), efi_handle_name(), efi_handle_protocol_wrapper(), efi_init(), efi_install_configuration_table_wrapper(), efi_install_multiple_protocol_interfaces_wrapper(), efi_install_protocol_interface_wrapper(), efi_install_table(), efi_locate_device(), efi_locate_device_path_wrapper(), efi_locate_handle_buffer_wrapper(), efi_locate_handle_wrapper(), efi_locate_protocol_wrapper(), efi_open_protocol_information_wrapper(), efi_open_protocol_wrapper(), efi_protocols_per_handle_wrapper(), efi_register_protocol_notify_wrapper(), efi_reinstall_protocol_interface_wrapper(), efi_service_add(), efi_service_del(), efi_set_variable_wrapper(), efi_uninstall_multiple_protocol_interfaces_wrapper(), efi_uninstall_protocol_interface_wrapper(), efi_veto_close_protocol(), efisig_find(), efivars_fetch(), efivars_find(), and snpnet_supported().

◆ efi_tpl_name()

const char * efi_tpl_name ( EFI_TPL tpl)
extern

Name EFI TPL.

Parameters
tplTask priority level
Return values
textTask priority level as text

Definition at line 55 of file efi_debug.c.

55 {
56 static char buf[ 19 /* "0xXXXXXXXXXXXXXXXX" + NUL */ ];
57
58 switch ( tpl ) {
59 case TPL_APPLICATION: return "Application";
60 case TPL_CALLBACK: return "Callback";
61 case TPL_NOTIFY: return "Notify";
62 case TPL_HIGH_LEVEL: return "HighLevel";
63 default:
64 snprintf ( buf, sizeof ( buf ), "%#lx",
65 ( unsigned long ) tpl );
66 return buf;
67 }
68}
#define TPL_CALLBACK
Definition UefiSpec.h:649
#define TPL_HIGH_LEVEL
Definition UefiSpec.h:651
#define TPL_APPLICATION
Definition UefiSpec.h:648
#define TPL_NOTIFY
Definition UefiSpec.h:650
int snprintf(char *buf, size_t size, const char *fmt,...)
Write a formatted string to a buffer.
Definition vsprintf.c:383

References snprintf(), TPL_APPLICATION, TPL_CALLBACK, TPL_HIGH_LEVEL, and TPL_NOTIFY.

Referenced by efi_connect(), efi_create_event_ex_wrapper(), efi_create_event_wrapper(), efi_disconnect(), efi_raise_tpl_wrapper(), and efi_restore_tpl_wrapper().

◆ efi_locate_search_type_name()

const char * efi_locate_search_type_name ( EFI_LOCATE_SEARCH_TYPE search_type)
extern

Name locate search type.

Parameters
search_typeLocate search type
Return values
nameLocate search type name

Definition at line 77 of file efi_debug.c.

77 {
78 static char buf[16];
79
80 switch ( search_type ) {
81 case AllHandles : return "AllHandles";
82 case ByRegisterNotify: return "ByRegisterNotify";
83 case ByProtocol: return "ByProtocol";
84 default:
85 snprintf ( buf, sizeof ( buf ), "UNKNOWN<%d>", search_type );
86 return buf;
87 }
88}
@ ByProtocol
Retrieve the set of handles from the handle database that support a specified protocol.
Definition UefiSpec.h:1531
@ ByRegisterNotify
Retrieve the next handle fron a RegisterProtocolNotify() event.
Definition UefiSpec.h:1526
@ AllHandles
Retrieve all the handles in the handle database.
Definition UefiSpec.h:1522

References AllHandles, ByProtocol, ByRegisterNotify, and snprintf().

Referenced by efi_locate_handle_buffer_wrapper(), and efi_locate_handle_wrapper().

◆ efi_open_attributes_name()

const char * efi_open_attributes_name ( unsigned int attributes)
extern

Name protocol open attributes.

Parameters
attributesProtocol open attributes
Return values
nameProtocol open attributes name

Returns a (static) string with characters for each set bit corresponding to BY_(H)ANDLE_PROTOCOL, (G)ET_PROTOCOL, (T)EST_PROTOCOL, BY_(C)HILD_CONTROLLER, BY_(D)RIVER, and E(X)CLUSIVE.

Definition at line 102 of file efi_debug.c.

102 {
103 static char attribute_chars[] = "HGTCDX";
104 static char name[ sizeof ( attribute_chars ) ];
105 char *tmp = name;
106 unsigned int i;
107
108 for ( i = 0 ; i < ( sizeof ( attribute_chars ) - 1 ) ; i++ ) {
109 if ( attributes & ( 1 << i ) )
110 *(tmp++) = attribute_chars[i];
111 }
112 *tmp = '\0';
113
114 return name;
115}
const char * name
Definition ath9k_hw.c:1986
unsigned long tmp
Definition linux_pci.h:65

References name, and tmp.

Referenced by dbg_efi_opener(), and efi_open_protocol_wrapper().

◆ efi_devpath_text()

const char * efi_devpath_text ( EFI_DEVICE_PATH_PROTOCOL * path)
extern

Get textual representation of device path.

Parameters
pathDevice path
Return values
textTextual representation of device path, or NULL

Definition at line 247 of file efi_debug.c.

247 {
248 EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
249 static char text[512];
250 size_t len;
251 CHAR16 *wtext;
252
253 /* Sanity checks */
254 if ( ! path ) {
255 DBG ( "[NULL DevicePath]" );
256 return NULL;
257 }
258
259 /* If we have no DevicePathToText protocol then use a raw hex string */
260 if ( ! efidpt ) {
261 DBG ( "[No DevicePathToText]" );
262 len = efi_path_len ( path );
263 base16_encode ( path, len, text, sizeof ( text ) );
264 return text;
265 }
266
267 /* Convert path to a textual representation */
268 wtext = efidpt->ConvertDevicePathToText ( path, FALSE, FALSE );
269 if ( ! wtext )
270 return NULL;
271
272 /* Store path in buffer */
273 snprintf ( text, sizeof ( text ), "%ls", wtext );
274
275 /* Free path */
276 bs->FreePool ( wtext );
277
278 return text;
279}
unsigned short CHAR16
2-byte Character.
ring len
Length.
Definition dwmac.h:226
static EFI_DEVICE_PATH_TO_TEXT_PROTOCOL * efidpt
Device path to text protocol.
Definition efi_debug.c:46
size_t efi_path_len(EFI_DEVICE_PATH_PROTOCOL *path)
Find length of device path (excluding terminator)
Definition efi_path.c:174
#define DBG(...)
Print a debugging message.
Definition compiler.h:498
EFI_SYSTEM_TABLE * efi_systab
EFI Boot Services Table.
Definition UefiSpec.h:1931
EFI_FREE_POOL FreePool
Definition UefiSpec.h:1950
#define FALSE
Definition tlan.h:45

References DBG, efi_path_len(), efi_systab, efidpt, FALSE, EFI_BOOT_SERVICES::FreePool, len, NULL, and snprintf().

Referenced by efi_block_exec(), efi_block_hook(), efi_block_match(), efi_connect_controller_wrapper(), efi_driver_start(), efi_driver_supported(), efi_dump_image(), efi_file_path_claim(), efi_file_path_install(), efi_file_path_uninstall(), efi_init(), efi_init_application(), efi_load_image_wrapper(), efi_loaded_image_filepath_name(), efi_local_open_volume(), efi_locate_device(), efi_locate_device_path_wrapper(), efi_path_net_probe(), usbio_open(), and usbio_path().

◆ efi_handle_name()

const char * efi_handle_name ( EFI_HANDLE handle)
extern

Get name of an EFI handle.

Parameters
handleEFI handle
Return values
textName of handle, or NULL

Definition at line 652 of file efi_debug.c.

652 {
653 EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
655 static char buf[256];
656 size_t used = 0;
657 EFI_GUID **protocols;
658 UINTN count;
659 unsigned int i;
660 void *interface;
661 const char *name;
662 EFI_STATUS efirc;
663 int rc;
664
665 /* Fail immediately for NULL handles */
666 if ( ! handle )
667 return NULL;
668
669 /* Try each name type in turn */
670 for ( i = 0 ; i < ( sizeof ( efi_handle_name_types ) /
671 sizeof ( efi_handle_name_types[0] ) ) ; i++ ) {
673 DBG2 ( "<%d", i );
674
675 /* Try to open the applicable protocol */
676 if ( ( rc = efi_open ( handle, type->protocol,
677 &interface ) ) != 0 ) {
678 DBG2 ( ">" );
679 continue;
680 }
681
682 /* Try to get name from this protocol */
683 DBG2 ( "-" );
684 name = type->name ( interface );
685 DBG2 ( "%c>", ( name ? ( name[0] ? 'Y' : 'E' ) : 'N' ) );
686
687 /* Use this name, if possible */
688 if ( name && name[0] )
689 return name;
690 }
691
692 /* If no name is found, then use the raw handle value and a
693 * list of installed protocols.
694 */
695 used = ssnprintf ( buf, sizeof ( buf ), "UNKNOWN<%p", handle );
696 if ( ( efirc = bs->ProtocolsPerHandle ( handle, &protocols,
697 &count ) ) == 0 ) {
698 for ( i = 0 ; i < count ; i++ ) {
699 used += ssnprintf ( ( buf + used ),
700 ( sizeof ( buf ) - used ), ",%s",
701 efi_guid_ntoa ( protocols[i] ) );
702 }
703 bs->FreePool ( protocols );
704 }
705 used += ssnprintf ( ( buf + used ), ( sizeof ( buf ) - used ), ">" );
706 return buf;
707}
UINT64 UINTN
Unsigned value of native width.
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
static struct efi_handle_name_type efi_handle_name_types[]
EFI handle name types.
Definition efi_debug.c:616
const char * efi_guid_ntoa(CONST EFI_GUID *guid)
Convert GUID to a printable string.
Definition efi_guid.c:726
uint32_t type
Operating system type.
Definition ena.h:1
#define DBG2(...)
Definition compiler.h:515
static unsigned int count
Number of entries.
Definition dwmac.h:220
#define efi_open(handle, protocol, interface)
Open protocol for ephemeral use.
Definition efi.h:444
EFI_PROTOCOLS_PER_HANDLE ProtocolsPerHandle
Definition UefiSpec.h:2007
An EFI handle name type.
Definition efi_debug.c:591
int ssnprintf(char *buf, ssize_t ssize, const char *fmt,...)
Version of vsnprintf() that accepts a signed buffer size.
Definition vsprintf.c:421

References count, DBG2, efi_guid_ntoa(), EFI_HANDLE, efi_handle_name_types, efi_open, efi_systab, EFI_BOOT_SERVICES::FreePool, handle, name, NULL, EFI_BOOT_SERVICES::ProtocolsPerHandle, rc, ssnprintf(), and type.

Referenced by chained_locate(), chained_supported(), dbg_efi_opener(), dbg_efi_openers(), dbg_efi_protocol(), dbg_efi_protocols(), efi_autoexec_filesystem(), efi_autoexec_load(), efi_autoexec_network(), efi_block_boot(), efi_block_filename(), efi_block_hook(), efi_block_local(), efi_block_match(), efi_block_root(), efi_bofm_start(), efi_bofm_supported(), efi_cachedhcp_record(), efi_child_add(), efi_child_del(), efi_close_protocol_wrapper(), efi_connect(), efi_connect_controller_wrapper(), efi_device_info(), efi_device_info_pci(), efi_disconnect(), efi_disconnect_controller_wrapper(), efi_driver_connect(), efi_driver_exclude(), efi_driver_start(), efi_driver_stop(), efi_driver_supported(), efi_dump_image(), efi_exit_boot_services_wrapper(), efi_exit_wrapper(), efi_file_path_claim(), efi_handle_protocol_wrapper(), efi_install_multiple_protocol_interfaces_wrapper(), efi_install_protocol_interface_wrapper(), efi_load_image_wrapper(), efi_local_check_volume_name(), efi_local_open_root(), efi_local_open_volume(), efi_locate_device(), efi_locate_device_path_wrapper(), efi_locate_handle_buffer_wrapper(), efi_locate_handle_wrapper(), efi_open_protocol_information_wrapper(), efi_open_protocol_wrapper(), efi_protocols_per_handle_wrapper(), efi_pxe_install(), efi_pxe_uninstall(), efi_reinstall_protocol_interface_wrapper(), efi_service_add(), efi_service_del(), efi_set_autoboot_ll_addr(), efi_snp_probe(), efi_start_image_wrapper(), efi_uninstall_multiple_protocol_interfaces_wrapper(), efi_uninstall_protocol_interface_wrapper(), efi_unload_image_wrapper(), efi_usb_install(), efi_usb_uninstall(), efi_veto(), efi_veto_close(), efi_veto_close_handle(), efi_veto_close_protocol(), efi_veto_destroy(), efi_veto_disconnect(), efi_veto_find(), efi_veto_uninstall(), efi_veto_unload(), efidev_alloc(), efipci_discover_one(), efipci_exclude(), efipci_info(), efipci_root_open(), efipci_start(), mnpnet_start(), mnptemp_create(), nii_exclude(), nii_start(), snpnet_exclude(), snpnet_insomniac_patch(), snpnet_insomniac_restore(), snpnet_is_insomniac(), snpnet_start(), snpnet_stop(), snpnet_supported(), usbio_bulk_in_poll(), usbio_bulk_out_poll(), usbio_config(), usbio_control_poll(), usbio_endpoint_open(), usbio_exclude(), usbio_interface(), usbio_interfaces(), usbio_interrupt_callback(), usbio_interrupt_open(), usbio_open(), usbio_path(), usbio_start(), and usbio_supported().

◆ dbg_efi_opener()

void dbg_efi_opener ( EFI_HANDLE handle,
EFI_GUID * protocol,
EFI_OPEN_PROTOCOL_INFORMATION_ENTRY * opener )
extern

Print opened protocol information.

Parameters
handleEFI handle @V protocol Protocol GUID
openerOpened protocol information

Definition at line 124 of file efi_debug.c.

125 {
126
127 printf ( "HANDLE %s %s opened %dx (%s)", efi_handle_name ( handle ),
128 efi_guid_ntoa ( protocol ), opener->OpenCount,
130 printf ( " by %s", efi_handle_name ( opener->AgentHandle ) );
131 if ( opener->ControllerHandle == handle ) {
132 printf ( "\n" );
133 } else {
134 printf ( " for %s\n",
135 efi_handle_name ( opener->ControllerHandle ) );
136 }
137}
const char * efi_handle_name(EFI_HANDLE handle)
Get name of an EFI handle.
Definition efi_debug.c:652
const char * efi_open_attributes_name(unsigned int attributes)
Name protocol open attributes.
Definition efi_debug.c:102
EFI_HANDLE AgentHandle
Definition UefiSpec.h:1433
UINT32 OpenCount
Definition UefiSpec.h:1436
UINT32 Attributes
Definition UefiSpec.h:1435
EFI_HANDLE ControllerHandle
Definition UefiSpec.h:1434
int printf(const char *fmt,...)
Write a formatted string to the console.
Definition vsprintf.c:465

References EFI_OPEN_PROTOCOL_INFORMATION_ENTRY::AgentHandle, EFI_OPEN_PROTOCOL_INFORMATION_ENTRY::Attributes, EFI_OPEN_PROTOCOL_INFORMATION_ENTRY::ControllerHandle, efi_guid_ntoa(), EFI_HANDLE, efi_handle_name(), efi_open_attributes_name(), handle, EFI_OPEN_PROTOCOL_INFORMATION_ENTRY::OpenCount, printf(), and protocol.

Referenced by dbg_efi_openers().

◆ dbg_efi_openers()

void dbg_efi_openers ( EFI_HANDLE handle,
EFI_GUID * protocol )
extern

Print list of openers of a given protocol on a given handle.

Parameters
handleEFI handle
protocolProtocol GUID

Definition at line 145 of file efi_debug.c.

145 {
146 EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
148 UINTN count;
149 unsigned int i;
150 EFI_STATUS efirc;
151 int rc;
152
153 /* Sanity check */
154 if ( ( ! handle ) || ( ! protocol ) ) {
155 printf ( "HANDLE %s could not retrieve openers for %s\n",
158 return;
159 }
160
161 /* Retrieve list of openers */
162 if ( ( efirc = bs->OpenProtocolInformation ( handle, protocol, &openers,
163 &count ) ) != 0 ) {
164 rc = -EEFI ( efirc );
165 printf ( "HANDLE %s could not retrieve openers for %s: %s\n",
168 return;
169 }
170
171 /* Dump list of openers */
172 for ( i = 0 ; i < count ; i++ )
173 dbg_efi_opener ( handle, protocol, &openers[i] );
174
175 /* Free list */
176 bs->FreePool ( openers );
177}
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
#define EEFI(efirc)
Convert an EFI status code to an iPXE status code.
Definition efi.h:175
char * strerror(int errno)
Retrieve string representation of error number.
Definition strerror.c:79
EFI_OPEN_PROTOCOL_INFORMATION OpenProtocolInformation
Definition UefiSpec.h:2002
EFI Oprn Protocol Information Entry.
Definition UefiSpec.h:1432

References count, dbg_efi_opener(), EEFI, efi_guid_ntoa(), EFI_HANDLE, efi_handle_name(), efi_systab, EFI_BOOT_SERVICES::FreePool, handle, EFI_BOOT_SERVICES::OpenProtocolInformation, printf(), protocol, rc, and strerror().

Referenced by dbg_efi_protocol().

◆ dbg_efi_protocol()

void dbg_efi_protocol ( EFI_HANDLE handle,
EFI_GUID * protocol )
extern

Print protocol information on a given handle.

Parameters
handleEFI handle
protocolProtocol GUID

Definition at line 185 of file efi_debug.c.

185 {
187 int rc;
188
189 /* Get protocol instance */
190 if ( ( rc = efi_open ( handle, protocol, &interface ) ) != 0 ) {
191 printf ( "HANDLE %s could not identify %s: %s\n",
194 return;
195 }
196 printf ( "HANDLE %s %s at %p\n", efi_handle_name ( handle ),
198
199 /* Dump list of openers */
201}
#define VOID
Undeclared type.
Definition Base.h:272
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

References dbg_efi_openers(), efi_guid_ntoa(), EFI_HANDLE, efi_handle_name(), efi_open, handle, printf(), protocol, rc, strerror(), and VOID.

Referenced by dbg_efi_protocols().

◆ dbg_efi_protocols()

void dbg_efi_protocols ( EFI_HANDLE handle)
extern

Print list of protocol handlers attached to a handle.

Parameters
handleEFI handle

Definition at line 208 of file efi_debug.c.

208 {
209 EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
210 EFI_GUID **protocols;
211 UINTN count;
212 unsigned int i;
213 EFI_STATUS efirc;
214 int rc;
215
216 /* Sanity check */
217 if ( ! handle ) {
218 printf ( "HANDLE %p could not retrieve protocols\n", handle );
219 return;
220 }
221
222 /* Retrieve list of protocols */
223 if ( ( efirc = bs->ProtocolsPerHandle ( handle, &protocols,
224 &count ) ) != 0 ) {
225 rc = -EEFI ( efirc );
226 printf ( "HANDLE %s could not retrieve protocols: %s\n",
228 return;
229 }
230
231 /* Dump list of protocols */
232 for ( i = 0 ; i < count ; i++ ) {
233 dbg_efi_protocol ( handle, protocols[i] );
234 }
235
236 /* Free list */
237 bs->FreePool ( protocols );
238}
void dbg_efi_protocol(EFI_HANDLE handle, EFI_GUID *protocol)
Print protocol information on a given handle.
Definition efi_debug.c:185

References count, dbg_efi_protocol(), EEFI, EFI_HANDLE, efi_handle_name(), efi_systab, EFI_BOOT_SERVICES::FreePool, handle, printf(), EFI_BOOT_SERVICES::ProtocolsPerHandle, rc, and strerror().

◆ efi_stack_cookie()

unsigned long efi_stack_cookie ( EFI_HANDLE handle)
extern

Construct a stack cookie value.

Parameters
handleImage handle
Return values
cookieStack cookie

Definition at line 115 of file efi_init.c.

115 {
116 unsigned long cookie = 0;
117 unsigned int rotation = ( 8 * sizeof ( cookie ) / 4 );
118
119 /* There is no viable source of entropy available at this
120 * point. Construct a value that is at least likely to vary
121 * between platforms and invocations.
122 */
123 cookie ^= ( ( unsigned long ) handle );
124 cookie = roll ( cookie, rotation );
125 cookie ^= ( ( unsigned long ) &handle );
126 cookie = roll ( cookie, rotation );
127 cookie ^= profile_timestamp();
128 cookie = roll ( cookie, rotation );
129 cookie ^= build_id;
130
131 /* Ensure that the value contains a NUL byte, to act as a
132 * runaway string terminator. Construct the NUL using a shift
133 * rather than a mask, to avoid losing valuable entropy in the
134 * lower-order bits.
135 */
136 cookie <<= 8;
137
138 /* Ensure that the NUL byte is placed at the bottom of the
139 * stack cookie, to avoid potential disclosure via an
140 * unterminated string.
141 */
142 if ( __BYTE_ORDER == __BIG_ENDIAN )
143 cookie >>= 8;
144
145 return cookie;
146}
#define __BYTE_ORDER
Definition endian.h:7
#define __BIG_ENDIAN
Constant representing big-endian byte order.
Definition endian.h:22
unsigned long profile_timestamp(void)
static unsigned int rotation
Definition rotate.h:23
unsigned long build_id
Build ID.
Definition version.c:62

References __BIG_ENDIAN, __BYTE_ORDER, build_id, EFI_HANDLE, handle, profile_timestamp(), and rotation.

Referenced by efi_init_stack_guard().

◆ __stack_chk_fail()

void __stack_chk_fail ( void )
extern

Abort on stack check failure.

Definition at line 356 of file efi_init.c.

356 {
357 EFI_STATUS efirc;
358 int rc;
359
360 /* Report failure (when debugging) */
361 DBGC ( efi_systab, "EFI stack check failed (cookie %#lx); aborting\n",
363
364 /* Attempt to exit cleanly with an error status */
365 if ( efi_exit ) {
367 0, NULL );
368 rc = -EEFI ( efirc );
369 DBGC ( efi_systab, "EFI stack check exit failed: %s\n",
370 strerror ( rc ) );
371 }
372
373 /* If the exit fails for any reason, lock the system */
374 while ( 1 ) {}
375
376}
#define EFI_COMPROMISED_DATA
Enumeration of EFI_STATUS.
static EFI_EXIT efi_exit
Exit function.
Definition efi_init.c:73
unsigned long __stack_chk_guard
Stack cookie.
Definition efi_init.c:66
EFI_HANDLE efi_image_handle
Image handle passed to entry point.
Definition efi_init.c:36
#define DBGC(...)
Definition compiler.h:505

References __stack_chk_guard, DBGC, EEFI, EFI_COMPROMISED_DATA, efi_exit, efi_image_handle, efi_systab, NULL, rc, and strerror().

◆ efi_init_stack_guard()

void efi_init_stack_guard ( EFI_HANDLE handle)
inlinestatic

Initialise stack cookie.

Parameters
handleImage handle

Definition at line 387 of file efi.h.

387 {
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}
unsigned long efi_stack_cookie(EFI_HANDLE handle)
Construct a stack cookie value.
Definition efi_init.c:115

References __stack_chk_guard, EFI_HANDLE, efi_stack_cookie(), and handle.

Referenced by _efi_start(), and _efidrv_start().

◆ efi_init()

EFI_STATUS efi_init ( EFI_HANDLE image_handle,
EFI_SYSTEM_TABLE * systab )
extern

Initialise EFI environment.

Parameters
image_handleImage handle
systabSystem table
Return values
efircEFI return status code

Definition at line 155 of file efi_init.c.

156 {
158 struct efi_protocol *prot;
159 struct efi_config_table *tab;
161 void *device_path_copy;
162 size_t device_path_len;
163 EFI_STATUS efirc;
164 int rc;
165
166 /* Store image handle and system table pointer for future use */
167 efi_image_handle = image_handle;
168 efi_systab = systab;
169
170 /* Sanity checks */
171 if ( ! systab ) {
172 efirc = EFI_NOT_AVAILABLE_YET;
173 goto err_sanity;
174 }
175 if ( ! systab->ConOut ) {
176 efirc = EFI_NOT_AVAILABLE_YET;
177 goto err_sanity;
178 }
179 if ( ! systab->BootServices ) {
180 DBGC ( systab, "EFI provided no BootServices entry point\n" );
181 efirc = EFI_NOT_AVAILABLE_YET;
182 goto err_sanity;
183 }
184 if ( ! systab->RuntimeServices ) {
185 DBGC ( systab, "EFI provided no RuntimeServices entry "
186 "point\n" );
187 efirc = EFI_NOT_AVAILABLE_YET;
188 goto err_sanity;
189 }
190 DBGC ( systab, "EFI handle %p systab %p\n", image_handle, systab );
191 bs = systab->BootServices;
192
193 /* Store abort function pointer */
194 efi_exit = bs->Exit;
195
196 /* Look up used protocols */
198 if ( ( efirc = bs->LocateProtocol ( &prot->guid, NULL,
199 prot->protocol ) ) == 0 ) {
200 DBGC ( systab, "EFI protocol %s is at %p\n",
201 efi_guid_ntoa ( &prot->guid ),
202 *(prot->protocol) );
203 } else {
204 DBGC ( systab, "EFI does not provide protocol %s\n",
205 efi_guid_ntoa ( &prot->guid ) );
206 /* Fail if protocol is required */
207 if ( prot->required )
208 goto err_missing_protocol;
209 }
210 }
211
212 /* Look up used configuration tables */
214 if ( ( *(tab->table) = efi_find_table ( &tab->guid ) ) ) {
215 DBGC ( systab, "EFI configuration table %s is at %p\n",
216 efi_guid_ntoa ( &tab->guid ), *(tab->table) );
217 } else {
218 DBGC ( systab, "EFI does not provide configuration "
219 "table %s\n", efi_guid_ntoa ( &tab->guid ) );
220 if ( tab->required ) {
221 efirc = EFI_NOT_AVAILABLE_YET;
222 goto err_missing_table;
223 }
224 }
225 }
226
227 /* Get loaded image protocol
228 *
229 * We assume that our loaded image protocol will not be
230 * uninstalled while our image code is still running.
231 */
232 if ( ( rc = efi_open_unsafe ( image_handle,
234 &efi_loaded_image ) ) != 0 ) {
235 DBGC ( systab, "EFI could not get loaded image protocol: %s",
236 strerror ( rc ) );
237 efirc = EFIRC ( rc );
238 goto err_no_loaded_image;
239 }
240 DBGC ( systab, "EFI image base address %p\n",
241 efi_loaded_image->ImageBase );
242
243 /* Record command line */
244 efi_cmdline = efi_loaded_image->LoadOptions;
245 efi_cmdline_len = efi_loaded_image->LoadOptionsSize;
246
247 /* Get loaded image's device handle's device path */
248 if ( ( rc = efi_open ( efi_loaded_image->DeviceHandle,
250 &device_path ) ) != 0 ) {
251 DBGC ( systab, "EFI could not get loaded image's device path: "
252 "%s", strerror ( rc ) );
253 efirc = EFIRC ( rc );
254 goto err_no_device_path;
255 }
256
257 /* Make a copy of the loaded image's device handle's device
258 * path, since the device handle itself may become invalidated
259 * when we load our own drivers.
260 */
261 device_path_len = ( efi_path_len ( device_path ) +
262 sizeof ( EFI_DEVICE_PATH_PROTOCOL ) );
263 if ( ( efirc = bs->AllocatePool ( EfiBootServicesData, device_path_len,
264 &device_path_copy ) ) != 0 ) {
265 rc = -EEFI ( efirc );
266 goto err_alloc_device_path;
267 }
268 memcpy ( device_path_copy, device_path, device_path_len );
269 efi_loaded_image_path = device_path_copy;
270 DBGC ( systab, "EFI image device path %s\n",
272
273 /* EFI is perfectly capable of gracefully shutting down any
274 * loaded devices if it decides to fall back to a legacy boot.
275 * For no particularly comprehensible reason, it doesn't
276 * bother doing so when ExitBootServices() is called.
277 */
278 if ( ( efirc = bs->CreateEvent ( EVT_SIGNAL_EXIT_BOOT_SERVICES,
280 NULL, &efi_shutdown_event ) ) != 0 ) {
281 rc = -EEFI ( efirc );
282 DBGC ( systab, "EFI could not create ExitBootServices event: "
283 "%s\n", strerror ( rc ) );
284 goto err_create_event;
285 }
286
287 /* Install driver binding protocol */
288 if ( ( rc = efi_driver_install() ) != 0 ) {
289 DBGC ( systab, "EFI could not install driver: %s\n",
290 strerror ( rc ) );
291 efirc = EFIRC ( rc );
292 goto err_driver_install;
293 }
294
295 /* Install image unload method */
297
298 return 0;
299
301 err_driver_install:
303 err_create_event:
305 err_alloc_device_path:
306 err_no_device_path:
307 err_no_loaded_image:
308 err_missing_table:
309 err_missing_protocol:
310 err_sanity:
311 return efirc;
312}
#define EFI_NOT_AVAILABLE_YET
If this value is returned by an API, it means the capability is not yet installed/available/ready to ...
@ EfiBootServicesData
The data portions of a loaded Boot Serves Driver, and the default data allocation type used by a Boot...
#define EVT_SIGNAL_EXIT_BOOT_SERVICES
Definition UefiSpec.h:456
union edd_device_path device_path
Device path.
Definition edd.h:13
size_t efi_cmdline_len
Length of EFI command line (in bytes)
Definition efi_cmdline.c:49
const wchar_t * efi_cmdline
EFI command line (may not be wNUL-terminated.
Definition efi_cmdline.c:46
const char * efi_devpath_text(EFI_DEVICE_PATH_PROTOCOL *path)
Get textual representation of device path.
Definition efi_debug.c:247
int efi_driver_install(void)
Install EFI driver.
Definition efi_driver.c:388
void efi_driver_uninstall(void)
Uninstall EFI driver.
Definition efi_driver.c:421
EFI_GUID efi_loaded_image_protocol_guid
Loaded image protocol GUID.
Definition efi_guid.c:273
EFI_GUID efi_device_path_protocol_guid
Device path protocol GUID.
Definition efi_guid.c:169
EFI_DEVICE_PATH_PROTOCOL * efi_loaded_image_path
Device path for the loaded image's device handle.
Definition efi_init.c:42
static EFI_STATUS EFIAPI efi_unload(EFI_HANDLE image_handle)
Shut down EFI environment.
Definition efi_init.c:319
static EFIAPI void efi_shutdown_hook(EFI_EVENT event __unused, void *context __unused)
Shut down in preparation for booting an OS.
Definition efi_init.c:85
EFI_LOADED_IMAGE_PROTOCOL * efi_loaded_image
Loaded image protocol for this image.
Definition efi_init.c:39
static EFI_EVENT efi_shutdown_event
Event used to signal shutdown.
Definition efi_init.c:63
void * efi_find_table(EFI_GUID *guid)
Look up EFI configuration table.
Definition efi_table.c:45
#define EFI_PROTOCOLS
EFI protocol table.
Definition efi.h:98
#define EFIRC(rc)
Convert an iPXE status code to an EFI status code.
Definition efi.h:167
#define efi_open_unsafe(handle, protocol, interface)
Open protocol for unsafe persistent use.
Definition efi.h:459
#define EFI_CONFIG_TABLES
EFI configuration table table.
Definition efi.h:142
EFI_CREATE_EVENT CreateEvent
Definition UefiSpec.h:1955
EFI_LOCATE_PROTOCOL LocateProtocol
Definition UefiSpec.h:2009
EFI_CLOSE_EVENT CloseEvent
Definition UefiSpec.h:1959
EFI_ALLOCATE_POOL AllocatePool
Definition UefiSpec.h:1949
This protocol can be used on any device handle to obtain generic path/location information concerning...
Definition DevicePath.h:46
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition UefiSpec.h:2099
EFI_RUNTIME_SERVICES * RuntimeServices
A pointer to the EFI Runtime Services Table.
Definition UefiSpec.h:2095
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL * ConOut
A pointer to the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL interface that is associated with ConsoleOutHandle.
Definition UefiSpec.h:2080
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
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
#define for_each_table_entry(pointer, table)
Iterate through all entries within a linker table.
Definition tables.h:386

References EFI_BOOT_SERVICES::AllocatePool, EFI_SYSTEM_TABLE::BootServices, EFI_BOOT_SERVICES::CloseEvent, EFI_SYSTEM_TABLE::ConOut, EFI_BOOT_SERVICES::CreateEvent, DBGC, device_path, EEFI, efi_cmdline, efi_cmdline_len, EFI_CONFIG_TABLES, efi_device_path_protocol_guid, efi_devpath_text(), efi_driver_install(), efi_driver_uninstall(), efi_exit, efi_find_table(), efi_guid_ntoa(), EFI_HANDLE, efi_image_handle, efi_loaded_image, efi_loaded_image_path, efi_loaded_image_protocol_guid, EFI_NOT_AVAILABLE_YET, efi_open, efi_open_unsafe, efi_path_len(), EFI_PROTOCOLS, efi_shutdown_event, efi_shutdown_hook(), efi_systab, efi_unload(), EfiBootServicesData, EFIRC, EVT_SIGNAL_EXIT_BOOT_SERVICES, EFI_BOOT_SERVICES::Exit, for_each_table_entry, EFI_BOOT_SERVICES::FreePool, efi_config_table::guid, efi_protocol::guid, EFI_BOOT_SERVICES::LocateProtocol, memcpy(), NULL, efi_protocol::protocol, rc, efi_config_table::required, efi_protocol::required, EFI_SYSTEM_TABLE::RuntimeServices, strerror(), efi_config_table::table, and TPL_NOTIFY.

Referenced by _efi_start(), and _efidrv_start().

◆ efi_raise_tpl()

void efi_raise_tpl ( struct efi_saved_tpl * tpl)
extern

Raise task priority level to internal level.

Parameters
tplSaved TPL

Definition at line 383 of file efi_init.c.

383 {
384 EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
385
386 /* Record current external TPL */
388
389 /* Raise TPL and record previous TPL as new external TPL */
390 tpl->current = bs->RaiseTPL ( efi_internal_tpl );
392}
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_RAISE_TPL RaiseTPL
Definition UefiSpec.h:1940
EFI_TPL previous
Previous external TPL.
Definition efi.h:84
EFI_TPL current
Current external TPL.
Definition efi.h:82

References efi_saved_tpl::current, efi_external_tpl, efi_internal_tpl, efi_systab, efi_saved_tpl::previous, and EFI_BOOT_SERVICES::RaiseTPL.

Referenced by _efidrv_start(), efi_driver_start(), efi_driver_stop(), efi_snp_add_claim(), efi_snp_get_status(), efi_snp_initialize(), efi_snp_receive(), efi_snp_reset(), efi_snp_shutdown(), efi_snp_transmit(), efi_snp_wait_for_packet(), efi_unload(), efi_usb_async_interrupt_transfer(), efi_usb_bulk_transfer(), efi_usb_control_transfer(), efi_usb_get_string_descriptor(), efi_usb_sync_interrupt_transfer(), efi_vlan_find(), efi_vlan_remove(), and efi_vlan_set().

◆ efi_restore_tpl()

◆ efi_open_untyped()

int efi_open_untyped ( EFI_HANDLE handle,
EFI_GUID * protocol,
void ** interface )
extern

Open (or test) protocol for ephemeral use.

Parameters
handleEFI handle
protocolProtocol GUID
interfaceProtocol interface pointer to fill in (or NULL to test)
Return values
rcReturn status code

Definition at line 97 of file efi_open.c.

98 {
99 EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
102 unsigned int attributes;
103 EFI_STATUS efirc;
104 int rc;
105
106 /* Sanity checks */
107 assert ( handle != NULL );
108 assert ( protocol != NULL );
109
110 /* Open protocol
111 *
112 * We set ControllerHandle to NULL to avoid collisions with
113 * other open types.
114 */
116 attributes = ( interface ? EFI_OPEN_PROTOCOL_GET_PROTOCOL :
118 if ( ( efirc = bs->OpenProtocol ( handle, protocol, interface, agent,
119 controller, attributes ) ) != 0 ) {
120 rc = -EEFI ( efirc );
121 if ( interface )
122 *interface = NULL;
123 return rc;
124 }
125
126 /* Close protocol immediately
127 *
128 * While it may seem prima facie unsafe to use a protocol
129 * after closing it, UEFI doesn't actually give us any safety
130 * even while the protocol is nominally open. Opening a
131 * protocol with EFI_OPEN_PROTOCOL_GET_PROTOCOL attributes
132 * does not in any way ensure that the interface pointer
133 * remains valid: there are no locks or notifications
134 * associated with these "opens".
135 *
136 * The only way to obtain a (partially) guaranteed persistent
137 * interface pointer is to open the protocol with the
138 * EFI_OPEN_PROTOCOL_BY_DRIVER attributes. This is not
139 * possible in the general case, since UEFI permits only a
140 * single image at a time to have the protocol opened with
141 * these attributes.
142 *
143 * We can therefore obtain at best an ephemeral interface
144 * pointer: one that is guaranteed to remain valid only for as
145 * long as we do not relinquish the thread of control.
146 *
147 * (Since UEFI permits calls to UninstallProtocolInterface()
148 * at levels up to and including TPL_NOTIFY, this means that
149 * we technically cannot rely on the pointer remaining valid
150 * unless the caller is itself running at TPL_NOTIFY. This is
151 * clearly impractical, and large portions of the EDK2
152 * codebase presume that using EFI_OPEN_PROTOCOL_GET_PROTOCOL
153 * is safe at lower TPLs.)
154 *
155 * Closing is not strictly necessary for protocols opened
156 * ephemerally (i.e. using EFI_OPEN_PROTOCOL_GET_PROTOCOL or
157 * EFI_OPEN_PROTOCOL_TEST_PROTOCOL), but avoids polluting the
158 * protocol open information tables with stale data.
159 *
160 * Closing immediately also simplifies the callers' code
161 * paths, since they do not need to worry about closing the
162 * protocol.
163 *
164 * The overall effect is equivalent to using HandleProtocol(),
165 * but without the associated pollution of the protocol open
166 * information tables, and with improved traceability.
167 */
168 bs->CloseProtocol ( handle, protocol, agent, controller );
169
170 return 0;
171}
#define EFI_OPEN_PROTOCOL_TEST_PROTOCOL
Definition UefiSpec.h:1356
#define EFI_OPEN_PROTOCOL_GET_PROTOCOL
Definition UefiSpec.h:1355
#define assert(condition)
Assert a condition at run-time.
Definition assert.h:50
uint8_t controller
CD-ROM controller number.
Definition int13.h:7
#define EFI_HANDLE
Definition efi.h:53
if(natsemi->flags &NATSEMI_64BIT) return 1
EFI_CLOSE_PROTOCOL CloseProtocol
Definition UefiSpec.h:2001

References assert, EFI_BOOT_SERVICES::CloseProtocol, controller, EEFI, EFI_HANDLE, efi_image_handle, EFI_OPEN_PROTOCOL_GET_PROTOCOL, EFI_OPEN_PROTOCOL_TEST_PROTOCOL, efi_systab, handle, if(), NULL, protocol, and rc.

◆ efi_open_unsafe_untyped()

int efi_open_unsafe_untyped ( EFI_HANDLE handle,
EFI_GUID * protocol,
void ** interface )
extern

Open protocol for unsafe persistent use.

Parameters
handleEFI handle
protocolProtocol GUID
interfaceProtocol interface pointer to fill in
Return values
rcReturn status code

Definition at line 181 of file efi_open.c.

182 {
183 EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
186 unsigned int attributes;
187 EFI_STATUS efirc;
188 int rc;
189
190 /* Sanity checks */
191 assert ( handle != NULL );
192 assert ( protocol != NULL );
193 assert ( interface != NULL );
194
195 /* Open protocol
196 *
197 * We set ControllerHandle equal to AgentHandle to avoid
198 * collisions with other open types.
199 */
200 controller = agent;
202 if ( ( efirc = bs->OpenProtocol ( handle, protocol, interface, agent,
203 controller, attributes ) ) != 0 ) {
204 rc = -EEFI ( efirc );
205 *interface = NULL;
206 return rc;
207 }
208
209 return 0;
210}
EFI_OPEN_PROTOCOL OpenProtocol
Definition UefiSpec.h:2000

References assert, controller, EEFI, EFI_HANDLE, efi_image_handle, EFI_OPEN_PROTOCOL_GET_PROTOCOL, efi_systab, handle, NULL, EFI_BOOT_SERVICES::OpenProtocol, protocol, and rc.

◆ efi_close_unsafe()

void efi_close_unsafe ( EFI_HANDLE handle,
EFI_GUID * protocol )
extern

Close protocol opened for unsafe persistent use.

Parameters
handleEFI handle
protocolProtocol GUID
childChild controller handle

Definition at line 219 of file efi_open.c.

219 {
220 EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
223
224 /* Sanity checks */
225 assert ( handle != NULL );
226 assert ( protocol != NULL );
227
228 /* Close protocol */
229 controller = agent;
230 bs->CloseProtocol ( handle, protocol, agent, controller );
231}

References assert, EFI_BOOT_SERVICES::CloseProtocol, controller, EFI_HANDLE, efi_image_handle, efi_systab, handle, NULL, and protocol.

Referenced by efi_bofm_start(), nii_pci_close(), and nii_pci_open().

◆ efi_open_by_driver_untyped()

int efi_open_by_driver_untyped ( EFI_HANDLE handle,
EFI_GUID * protocol,
void ** interface )
extern

Open protocol for persistent use by a driver.

Parameters
handleEFI handle
protocolProtocol GUID
interfaceProtocol interface pointer to fill in
Return values
rcReturn status code

Definition at line 241 of file efi_open.c.

242 {
243 EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
246 unsigned int attributes;
247 EFI_STATUS efirc;
248 int rc;
249
250 /* Sanity checks */
251 assert ( handle != NULL );
252 assert ( protocol != NULL );
253 assert ( interface != NULL );
254
255 /* Open protocol
256 *
257 * We set ControllerHandle equal to Handle to avoid collisions
258 * with other open types.
259 */
261 attributes = ( EFI_OPEN_PROTOCOL_BY_DRIVER |
263 if ( ( efirc = bs->OpenProtocol ( handle, protocol, interface, agent,
264 controller, attributes ) ) != 0 ) {
265 rc = -EEFI ( efirc );
266 *interface = NULL;
267 return rc;
268 }
269
270 return 0;
271}
#define EFI_OPEN_PROTOCOL_BY_DRIVER
Definition UefiSpec.h:1358
#define EFI_OPEN_PROTOCOL_EXCLUSIVE
Definition UefiSpec.h:1359

References assert, controller, EEFI, EFI_HANDLE, efi_image_handle, EFI_OPEN_PROTOCOL_BY_DRIVER, EFI_OPEN_PROTOCOL_EXCLUSIVE, efi_systab, handle, NULL, EFI_BOOT_SERVICES::OpenProtocol, protocol, and rc.

◆ efi_close_by_driver()

void efi_close_by_driver ( EFI_HANDLE handle,
EFI_GUID * protocol )
extern

Close protocol opened for persistent use by a driver.

Parameters
handleEFI handle
protocolProtocol GUID

Definition at line 279 of file efi_open.c.

279 {
280 EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
283
284 /* Sanity checks */
285 assert ( handle != NULL );
286 assert ( protocol != NULL );
287
288 /* Close protocol */
290 bs->CloseProtocol ( handle, protocol, agent, controller );
291}

References assert, EFI_BOOT_SERVICES::CloseProtocol, controller, EFI_HANDLE, efi_image_handle, efi_systab, handle, NULL, and protocol.

Referenced by efi_file_install(), efi_file_uninstall(), efi_snp_probe(), efi_snp_remove(), efipci_start(), efipci_stop(), mnpnet_start(), mnpnet_stop(), nii_start(), nii_stop(), snpnet_start(), snpnet_stop(), usbio_close(), usbio_start(), and usbio_stop().

◆ efi_open_by_child_untyped()

int efi_open_by_child_untyped ( EFI_HANDLE handle,
EFI_GUID * protocol,
EFI_HANDLE child,
void ** interface )
extern

Open protocol for persistent use by a child controller.

Parameters
handleEFI handle
protocolProtocol GUID
childChild controller handle
interfaceProtocol interface pointer to fill in
Return values
rcReturn status code

Definition at line 302 of file efi_open.c.

303 {
304 EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
307 unsigned int attributes;
308 EFI_STATUS efirc;
309 int rc;
310
311 /* Sanity checks */
312 assert ( handle != NULL );
313 assert ( protocol != NULL );
314 assert ( child != NULL );
315 assert ( interface != NULL );
316
317 /* Open protocol
318 *
319 * We set ControllerHandle to a non-NULL value distinct from
320 * both Handle and AgentHandle to avoid collisions with other
321 * open types.
322 */
323 controller = child;
324 assert ( controller != handle );
325 assert ( controller != agent );
327 if ( ( efirc = bs->OpenProtocol ( handle, protocol, interface, agent,
328 controller, attributes ) ) != 0 ) {
329 rc = -EEFI ( efirc );
330 *interface = NULL;
331 return rc;
332 }
333
334 return 0;
335}
#define EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER
Definition UefiSpec.h:1357

References assert, controller, EEFI, EFI_HANDLE, efi_image_handle, EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER, efi_systab, handle, NULL, EFI_BOOT_SERVICES::OpenProtocol, protocol, and rc.

◆ efi_close_by_child()

void efi_close_by_child ( EFI_HANDLE handle,
EFI_GUID * protocol,
EFI_HANDLE child )
extern

Close protocol opened for persistent use by a child controller.

Parameters
handleEFI handle
protocolProtocol GUID
childChild controller handle

Definition at line 344 of file efi_open.c.

345 {
346 EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
349
350 /* Sanity checks */
351 assert ( handle != NULL );
352 assert ( protocol != NULL );
353 assert ( child != NULL );
354
355 /* Close protocol */
356 controller = child;
357 assert ( controller != handle );
358 assert ( controller != agent );
359 bs->CloseProtocol ( handle, protocol, agent, controller );
360}

References assert, EFI_BOOT_SERVICES::CloseProtocol, controller, EFI_HANDLE, efi_image_handle, efi_systab, handle, NULL, and protocol.

Referenced by efi_child_del().

◆ efi_connect()

int efi_connect ( EFI_HANDLE device,
EFI_HANDLE driver )
extern

Connect UEFI driver(s)

Parameters
deviceEFI device handle
driverEFI driver handle, or NULL
Return values
rcReturn status code

Definition at line 58 of file efi_connect.c.

58 {
59 EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
60 EFI_HANDLE driverlist[2] = { driver, NULL };
61 EFI_HANDLE *drivers = ( driver ? driverlist : NULL );
62 EFI_STATUS efirc;
63 int rc;
64
65 /* Attempt connection at external TPL */
66 DBGC ( device, "EFI %s connecting ", efi_handle_name ( device ) );
67 DBGC ( device, "%s driver at %s TPL\n",
68 ( driver ? efi_handle_name ( driver ) : "any" ),
71 efirc = bs->ConnectController ( device, drivers, NULL, TRUE );
73 if ( efirc != 0 ) {
74 rc = -EEFI_CONNECT ( efirc );
75 DBGC ( device, "EFI %s could not connect: %s\n",
77 return rc;
78 }
79
80 return 0;
81}
#define EEFI_CONNECT(efirc)
Definition efi_connect.c:48
const char * efi_tpl_name(EFI_TPL tpl)
Name EFI TPL.
Definition efi_debug.c:55
EFI_CONNECT_CONTROLLER ConnectController
Definition UefiSpec.h:1994
A hardware device.
Definition device.h:77
#define TRUE
Definition tlan.h:46

References EFI_BOOT_SERVICES::ConnectController, DBGC, EEFI_CONNECT, efi_external_tpl, EFI_HANDLE, efi_handle_name(), efi_internal_tpl, efi_systab, efi_tpl_name(), NULL, EFI_BOOT_SERVICES::RaiseTPL, rc, EFI_BOOT_SERVICES::RestoreTPL, strerror(), and TRUE.

Referenced by efi_block_connect(), efi_driver_connect(), efi_driver_reconnect(), and efi_usb_probe().

◆ efi_disconnect()

int efi_disconnect ( EFI_HANDLE device,
EFI_HANDLE driver )
extern

Disconnect UEFI driver(s)

Parameters
deviceEFI device handle
driverEFI driver handle, or NULL
Return values
rcReturn status code

Definition at line 90 of file efi_connect.c.

90 {
91 EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
92 EFI_STATUS efirc;
93 int rc;
94
95 /* Attempt disconnection at external TPL */
96 DBGC ( device, "EFI %s disconnecting ", efi_handle_name ( device ) );
97 DBGC ( device, "%s driver at %s TPL\n",
98 ( driver ? efi_handle_name ( driver ) : "any" ),
101 efirc = bs->DisconnectController ( device, driver, NULL );
103 if ( ( efirc != 0 ) && ( efirc != EFI_NOT_FOUND ) ) {
104 rc = -EEFI ( efirc );
105 DBGC ( device, "EFI %s could not disconnect: %s\n",
107 return rc;
108 }
109
110 return 0;
111}
#define EFI_NOT_FOUND
Enumeration of EFI_STATUS.
EFI_DISCONNECT_CONTROLLER DisconnectController
Definition UefiSpec.h:1995

References DBGC, EFI_BOOT_SERVICES::DisconnectController, EEFI, efi_external_tpl, EFI_HANDLE, efi_handle_name(), efi_internal_tpl, EFI_NOT_FOUND, efi_systab, efi_tpl_name(), NULL, EFI_BOOT_SERVICES::RaiseTPL, rc, EFI_BOOT_SERVICES::RestoreTPL, and strerror().

Referenced by efi_driver_disconnect(), efi_driver_exclude(), efi_usb_uninstall(), and efi_veto_disconnect().

Variable Documentation

◆ efi_absolute_pointer_protocol_guid

EFI_GUID efi_absolute_pointer_protocol_guid
extern

Absolute pointer protocol GUID.

Definition at line 120 of file efi_guid.c.

◆ efi_acpi_table_protocol_guid

EFI_GUID efi_acpi_table_protocol_guid
extern

ACPI table protocol GUID.

Definition at line 124 of file efi_guid.c.

◆ efi_adapter_information_protocol_guid

EFI_GUID efi_adapter_information_protocol_guid
extern

Adapter information protocol GUID.

Definition at line 128 of file efi_guid.c.

◆ efi_apple_net_boot_protocol_guid

EFI_GUID efi_apple_net_boot_protocol_guid
extern

Apple NetBoot protocol GUID.

Definition at line 132 of file efi_guid.c.

Referenced by efi_pxe_install(), and efi_pxe_uninstall().

◆ efi_arp_protocol_guid

EFI_GUID efi_arp_protocol_guid
extern

ARP protocol GUID.

Definition at line 136 of file efi_guid.c.

◆ efi_arp_service_binding_protocol_guid

EFI_GUID efi_arp_service_binding_protocol_guid
extern

ARP service binding protocol GUID.

Definition at line 140 of file efi_guid.c.

◆ efi_block_io_protocol_guid

EFI_GUID efi_block_io_protocol_guid
extern

Block I/O protocol GUID.

Definition at line 144 of file efi_guid.c.

Referenced by efi_block_boot(), efi_block_hook(), efi_block_local(), efi_block_unhook(), efi_file_install(), and efi_file_uninstall().

◆ efi_block_io2_protocol_guid

EFI_GUID efi_block_io2_protocol_guid
extern

Block I/O version 2 protocol GUID.

Definition at line 148 of file efi_guid.c.

◆ efi_bus_specific_driver_override_protocol_guid

EFI_GUID efi_bus_specific_driver_override_protocol_guid
extern

Bus specific driver override protocol GUID.

Definition at line 152 of file efi_guid.c.

◆ efi_component_name_protocol_guid

EFI_GUID efi_component_name_protocol_guid
extern

Component name protocol GUID.

Definition at line 156 of file efi_guid.c.

Referenced by efi_binding_name(), and efi_veto_find().

◆ efi_component_name2_protocol_guid

EFI_GUID efi_component_name2_protocol_guid
extern

◆ efi_console_control_protocol_guid

EFI_GUID efi_console_control_protocol_guid
extern

Console control protocol GUID.

Definition at line 164 of file efi_guid.c.

◆ efi_device_path_protocol_guid

◆ efi_dhcp4_protocol_guid

EFI_GUID efi_dhcp4_protocol_guid
extern

DHCPv4 protocol GUID.

Definition at line 172 of file efi_guid.c.

◆ efi_dhcp4_service_binding_protocol_guid

EFI_GUID efi_dhcp4_service_binding_protocol_guid
extern

DHCPv4 service binding protocol GUID.

Definition at line 176 of file efi_guid.c.

◆ efi_dhcp6_protocol_guid

EFI_GUID efi_dhcp6_protocol_guid
extern

DHCPv6 protocol GUID.

Definition at line 180 of file efi_guid.c.

◆ efi_dhcp6_service_binding_protocol_guid

EFI_GUID efi_dhcp6_service_binding_protocol_guid
extern

DHCPv6 service binding protocol GUID.

Definition at line 184 of file efi_guid.c.

◆ efi_disk_io_protocol_guid

EFI_GUID efi_disk_io_protocol_guid
extern

Disk I/O protocol GUID.

Definition at line 188 of file efi_guid.c.

Referenced by efi_file_install(), and efi_file_uninstall().

◆ efi_dns4_protocol_guid

EFI_GUID efi_dns4_protocol_guid
extern

DNSv4 protocol GUID.

Definition at line 192 of file efi_guid.c.

◆ efi_dns4_service_binding_protocol_guid

EFI_GUID efi_dns4_service_binding_protocol_guid
extern

DNSv4 service binding protocol GUID.

Definition at line 196 of file efi_guid.c.

◆ efi_dns6_protocol_guid

EFI_GUID efi_dns6_protocol_guid
extern

DNSv6 protocol GUID.

Definition at line 200 of file efi_guid.c.

◆ efi_dns6_service_binding_protocol_guid

EFI_GUID efi_dns6_service_binding_protocol_guid
extern

DNSv6 service binding protocol GUID.

Definition at line 204 of file efi_guid.c.

◆ efi_driver_binding_protocol_guid

EFI_GUID efi_driver_binding_protocol_guid
extern

Driver binding protocol GUID.

Definition at line 208 of file efi_guid.c.

Referenced by efi_driver_install(), efi_driver_uninstall(), efi_veto(), efi_veto_find(), and efi_veto_uninstall().

◆ efi_eap_configuration_protocol_guid

EFI_GUID efi_eap_configuration_protocol_guid
extern

EAP configuration protocol GUID.

Definition at line 212 of file efi_guid.c.

◆ efi_graphics_output_protocol_guid

EFI_GUID efi_graphics_output_protocol_guid
extern

Graphics output protocol GUID.

Definition at line 216 of file efi_guid.c.

Referenced by efifb_init().

◆ efi_hii_config_access_protocol_guid

EFI_GUID efi_hii_config_access_protocol_guid
extern

HII configuration access protocol GUID.

Definition at line 220 of file efi_guid.c.

Referenced by efi_snp_hii_install(), and efi_snp_hii_uninstall().

◆ efi_hii_font_protocol_guid

EFI_GUID efi_hii_font_protocol_guid
extern

HII font protocol GUID.

Definition at line 224 of file efi_guid.c.

Referenced by efifb_init().

◆ efi_http_protocol_guid

EFI_GUID efi_http_protocol_guid
extern

HTTP protocol GUID.

Definition at line 228 of file efi_guid.c.

◆ efi_http_service_binding_protocol_guid

EFI_GUID efi_http_service_binding_protocol_guid
extern

HTTP service binding protocol GUID.

Definition at line 232 of file efi_guid.c.

◆ efi_ip4_protocol_guid

EFI_GUID efi_ip4_protocol_guid
extern

IPv4 protocol GUID.

Definition at line 236 of file efi_guid.c.

◆ efi_ip4_config_protocol_guid

EFI_GUID efi_ip4_config_protocol_guid
extern

IPv4 configuration protocol GUID.

Definition at line 240 of file efi_guid.c.

◆ efi_ip4_config2_protocol_guid

EFI_GUID efi_ip4_config2_protocol_guid
extern

IPv4 configuration 2 protocol GUID.

Definition at line 244 of file efi_guid.c.

◆ efi_ip4_service_binding_protocol_guid

EFI_GUID efi_ip4_service_binding_protocol_guid
extern

IPv4 service binding protocol GUID.

Definition at line 248 of file efi_guid.c.

◆ efi_ip6_protocol_guid

EFI_GUID efi_ip6_protocol_guid
extern

IPv6 protocol GUID.

Definition at line 252 of file efi_guid.c.

◆ efi_ip6_config_protocol_guid

EFI_GUID efi_ip6_config_protocol_guid
extern

IPv6 configuration protocol GUID.

Definition at line 256 of file efi_guid.c.

◆ efi_ip6_service_binding_protocol_guid

EFI_GUID efi_ip6_service_binding_protocol_guid
extern

IPv6 service binding protocol GUID.

Definition at line 260 of file efi_guid.c.

◆ efi_load_file_protocol_guid

EFI_GUID efi_load_file_protocol_guid
extern

Load file protocol GUID.

Definition at line 264 of file efi_guid.c.

Referenced by efi_snp_probe(), and efi_snp_remove().

◆ efi_load_file2_protocol_guid

EFI_GUID efi_load_file2_protocol_guid
extern

Load file 2 protocol GUID.

Definition at line 268 of file efi_guid.c.

Referenced by efi_file_path_install(), and efi_file_path_uninstall().

◆ efi_loaded_image_protocol_guid

EFI_GUID efi_loaded_image_protocol_guid
extern

Loaded image protocol GUID.

Definition at line 272 of file efi_guid.c.

Referenced by efi_dump_image(), efi_image_exec(), efi_init(), and efi_veto_find().

◆ efi_loaded_image_device_path_protocol_guid

EFI_GUID efi_loaded_image_device_path_protocol_guid
extern

Loaded image device path protocol GUID.

Definition at line 276 of file efi_guid.c.

◆ efi_managed_network_protocol_guid

EFI_GUID efi_managed_network_protocol_guid
extern

Managed network protocol GUID.

Definition at line 280 of file efi_guid.c.

Referenced by mnpnet_start(), and mnpnet_stop().

◆ efi_managed_network_service_binding_protocol_guid

EFI_GUID efi_managed_network_service_binding_protocol_guid
extern

Managed network service binding protocol GUID.

Definition at line 284 of file efi_guid.c.

Referenced by mnp_supported(), mnpnet_start(), and mnpnet_stop().

◆ efi_mtftp4_protocol_guid

EFI_GUID efi_mtftp4_protocol_guid
extern

MTFTPv4 protocol GUID.

Definition at line 288 of file efi_guid.c.

◆ efi_mtftp4_service_binding_protocol_guid

EFI_GUID efi_mtftp4_service_binding_protocol_guid
extern

MTFTPv4 service binding protocol GUID.

Definition at line 292 of file efi_guid.c.

◆ efi_mtftp6_protocol_guid

EFI_GUID efi_mtftp6_protocol_guid
extern

MTFTPv6 protocol GUID.

Definition at line 296 of file efi_guid.c.

◆ efi_mtftp6_service_binding_protocol_guid

EFI_GUID efi_mtftp6_service_binding_protocol_guid
extern

MTFTPv6 service binding protocol GUID.

Definition at line 300 of file efi_guid.c.

◆ efi_nii_protocol_guid

EFI_GUID efi_nii_protocol_guid
extern

Network interface identifier protocol GUID (old version)

Definition at line 304 of file efi_guid.c.

Referenced by efi_snp_probe(), and efi_snp_remove().

◆ efi_nii31_protocol_guid

EFI_GUID efi_nii31_protocol_guid
extern

Network interface identifier protocol GUID (new version)

Definition at line 308 of file efi_guid.c.

Referenced by efi_snp_probe(), efi_snp_remove(), nii_exclude(), nii_start(), nii_stop(), and nii_supported().

◆ efi_pci_io_protocol_guid

EFI_GUID efi_pci_io_protocol_guid
extern

◆ efi_pci_root_bridge_io_protocol_guid

EFI_GUID efi_pci_root_bridge_io_protocol_guid
extern

PCI root bridge I/O protocol GUID.

Definition at line 316 of file efi_guid.c.

Referenced by efipci_discover_any(), efipci_discover_one(), and efipci_root_open().

◆ efi_pxe_base_code_protocol_guid

EFI_GUID efi_pxe_base_code_protocol_guid
extern

PXE base code protocol GUID.

Definition at line 320 of file efi_guid.c.

Referenced by efi_cachedhcp_record(), efi_pxe_install(), efi_pxe_uninstall(), and efi_shim_inhibit_pxe().

◆ efi_rng_protocol_guid

EFI_GUID efi_rng_protocol_guid
extern

Random number generator protocol GUID.

Definition at line 324 of file efi_guid.c.

◆ efi_serial_io_protocol_guid

EFI_GUID efi_serial_io_protocol_guid
extern

Serial I/O protocol GUID.

Definition at line 328 of file efi_guid.c.

◆ efi_shim_lock_protocol_guid

EFI_GUID efi_shim_lock_protocol_guid
extern

Shim lock protocol GUID.

Definition at line 332 of file efi_guid.c.

Referenced by efi_shim_is_sbatlevel(), and efi_shim_unlock().

◆ efi_simple_file_system_protocol_guid

EFI_GUID efi_simple_file_system_protocol_guid
extern

Simple file system protocol GUID.

Definition at line 336 of file efi_guid.c.

Referenced by efi_block_root(), efi_block_scan(), efi_file_install(), efi_file_uninstall(), efi_local_open_root(), and efi_local_open_volume().

◆ efi_simple_network_protocol_guid

EFI_GUID efi_simple_network_protocol_guid
extern

◆ efi_simple_pointer_protocol_guid

EFI_GUID efi_simple_pointer_protocol_guid
extern

Simple pointer protocol GUID.

Definition at line 344 of file efi_guid.c.

◆ efi_simple_text_input_protocol_guid

EFI_GUID efi_simple_text_input_protocol_guid
extern

Simple text input protocol GUID.

Definition at line 348 of file efi_guid.c.

◆ efi_simple_text_input_ex_protocol_guid

EFI_GUID efi_simple_text_input_ex_protocol_guid
extern

Simple text input extension protocol GUID.

Definition at line 352 of file efi_guid.c.

Referenced by efi_console_init().

◆ efi_simple_text_output_protocol_guid

EFI_GUID efi_simple_text_output_protocol_guid
extern

Simple text output protocol GUID.

Definition at line 356 of file efi_guid.c.

◆ efi_storage_security_command_protocol_guid

EFI_GUID efi_storage_security_command_protocol_guid
extern

Storage security protocol GUID.

Definition at line 360 of file efi_guid.c.

◆ efi_supplicant_protocol_guid

EFI_GUID efi_supplicant_protocol_guid
extern

Supplicant protocol GUID.

Definition at line 364 of file efi_guid.c.

◆ efi_tcg_protocol_guid

EFI_GUID efi_tcg_protocol_guid
extern

TCG protocol GUID.

Definition at line 368 of file efi_guid.c.

◆ efi_tcg2_protocol_guid

EFI_GUID efi_tcg2_protocol_guid
extern

TCG2 protocol GUID.

Definition at line 372 of file efi_guid.c.

◆ efi_tcp4_protocol_guid

EFI_GUID efi_tcp4_protocol_guid
extern

TCPv4 protocol GUID.

Definition at line 376 of file efi_guid.c.

◆ efi_tcp4_service_binding_protocol_guid

EFI_GUID efi_tcp4_service_binding_protocol_guid
extern

TCPv4 service binding protocol GUID.

Definition at line 380 of file efi_guid.c.

◆ efi_tcp6_protocol_guid

EFI_GUID efi_tcp6_protocol_guid
extern

TCPv6 protocol GUID.

Definition at line 384 of file efi_guid.c.

◆ efi_tcp6_service_binding_protocol_guid

EFI_GUID efi_tcp6_service_binding_protocol_guid
extern

TCPv6 service binding protocol GUID.

Definition at line 388 of file efi_guid.c.

◆ efi_tree_protocol_guid

EFI_GUID efi_tree_protocol_guid
extern

TrEE protocol GUID.

Definition at line 392 of file efi_guid.c.

◆ efi_udp4_protocol_guid

EFI_GUID efi_udp4_protocol_guid
extern

UDPv4 protocol GUID.

Definition at line 396 of file efi_guid.c.

◆ efi_udp4_service_binding_protocol_guid

EFI_GUID efi_udp4_service_binding_protocol_guid
extern

UDPv4 service binding protocol GUID.

Definition at line 400 of file efi_guid.c.

◆ efi_udp6_protocol_guid

EFI_GUID efi_udp6_protocol_guid
extern

UDPv6 protocol GUID.

Definition at line 404 of file efi_guid.c.

◆ efi_udp6_service_binding_protocol_guid

EFI_GUID efi_udp6_service_binding_protocol_guid
extern

UDPv6 service binding protocol GUID.

Definition at line 408 of file efi_guid.c.

◆ efi_uga_draw_protocol_guid

EFI_GUID efi_uga_draw_protocol_guid
extern

UGA draw protocol GUID.

Definition at line 412 of file efi_guid.c.

◆ efi_unicode_collation_protocol_guid

EFI_GUID efi_unicode_collation_protocol_guid
extern

Unicode collation protocol GUID.

Definition at line 416 of file efi_guid.c.

◆ efi_usb_hc_protocol_guid

EFI_GUID efi_usb_hc_protocol_guid
extern

USB host controller protocol GUID.

Definition at line 420 of file efi_guid.c.

◆ efi_usb2_hc_protocol_guid

EFI_GUID efi_usb2_hc_protocol_guid
extern

USB2 host controller protocol GUID.

Definition at line 424 of file efi_guid.c.

◆ efi_usb_io_protocol_guid

EFI_GUID efi_usb_io_protocol_guid
extern

◆ efi_vlan_config_protocol_guid

EFI_GUID efi_vlan_config_protocol_guid
extern

VLAN configuration protocol GUID.

Definition at line 432 of file efi_guid.c.

Referenced by efi_snp_probe(), and efi_snp_remove().

◆ efi_wifi2_protocol_guid

EFI_GUID efi_wifi2_protocol_guid
extern

WiFi 2 protocol GUID.

Definition at line 436 of file efi_guid.c.

Referenced by chained_supported(), snpnet_is_insomniac(), and snpnet_supported().

◆ efi_acpi_10_table_guid

EFI_GUID efi_acpi_10_table_guid
extern

ACPI 1.0 table GUID.

Definition at line 440 of file efi_guid.c.

◆ efi_acpi_20_table_guid

EFI_GUID efi_acpi_20_table_guid
extern

ACPI 2.0 table GUID.

Definition at line 444 of file efi_guid.c.

◆ efi_fdt_table_guid

EFI_GUID efi_fdt_table_guid
extern

FDT table GUID.

Definition at line 448 of file efi_guid.c.

◆ efi_smbios_table_guid

EFI_GUID efi_smbios_table_guid
extern

SMBIOS table GUID.

Definition at line 452 of file efi_guid.c.

◆ efi_smbios2_table_guid

EFI_GUID efi_smbios2_table_guid
extern

◆ efi_cert_x509_guid

EFI_GUID efi_cert_x509_guid
extern

X.509 certificate GUID.

Definition at line 460 of file efi_guid.c.

◆ efi_file_info_id

EFI_GUID efi_file_info_id
extern

File information GUID.

Definition at line 463 of file efi_guid.c.

Referenced by efi_file_get_info(), and efi_local_len().

◆ efi_file_system_info_id

EFI_GUID efi_file_system_info_id
extern

File system information GUID.

Definition at line 466 of file efi_guid.c.

Referenced by efi_block_label(), efi_file_get_info(), and efi_local_check_volume_name().

◆ efi_global_variable

EFI_GUID efi_global_variable
extern

Global variable GUID.

Definition at line 469 of file efi_guid.c.

Referenced by efi_boot_path(), efi_current_boot_path(), and efi_reboot().

◆ efi_image_security_database_guid

EFI_GUID efi_image_security_database_guid
extern

Image security database GUID.

Definition at line 472 of file efi_guid.c.

◆ efi_microsoft_vendor_guid

EFI_GUID efi_microsoft_vendor_guid
extern

Microsoft vendor GUID.

Definition at line 475 of file efi_guid.c.

◆ efi_tls_ca_certificate_guid

EFI_GUID efi_tls_ca_certificate_guid
extern

TLS CA certificate variable GUID.

Definition at line 478 of file efi_guid.c.

Referenced by efi_cacert_all().

◆ efi_image_handle

◆ efi_loaded_image

EFI_LOADED_IMAGE_PROTOCOL* efi_loaded_image
extern

◆ efi_loaded_image_path

EFI_DEVICE_PATH_PROTOCOL* efi_loaded_image_path
extern

Device path for the loaded image's device handle.

Definition at line 42 of file efi_init.c.

Referenced by efi_init(), efi_init_application(), efi_local_open_volume(), efi_path_net_probe(), and efi_unload().

◆ efi_systab

EFI_SYSTEM_TABLE* efi_systab
extern

Referenced by __stack_chk_fail(), dbg_efi_openers(), dbg_efi_protocols(), efi_allocate_pages_wrapper(), efi_allocate_pool_wrapper(), efi_block_boot(), efi_block_exec(), efi_block_hook(), efi_block_scan(), efi_block_unhook(), efi_bofm_start(), efi_bofm_supported(), efi_boot_path(), efi_cacert_all(), efi_check_event_wrapper(), efi_close_by_child(), efi_close_by_driver(), efi_close_event_wrapper(), efi_close_protocol_wrapper(), efi_close_unsafe(), efi_conin_name(), efi_connect(), efi_connect_controller_wrapper(), efi_conout_name(), efi_console_init(), efi_create_event_ex_wrapper(), efi_create_event_wrapper(), efi_current_boot_path(), efi_currticks(), efi_devpath_text(), efi_disconnect(), efi_disconnect_controller_wrapper(), efi_download_install(), efi_download_uninstall(), efi_driver_exclude(), efi_driver_handles(), efi_driver_install(), efi_driver_uninstall(), efi_entropy_disable(), efi_entropy_enable(), efi_entropy_tick(), efi_exit_boot_services_wrapper(), efi_exit_wrapper(), efi_fdt_init(), efi_file_install(), efi_file_path_claim(), efi_file_path_install(), efi_file_path_uninstall(), efi_file_uninstall(), efi_find_table(), efi_free_pages_wrapper(), efi_free_pool_wrapper(), efi_get_memory_map_wrapper(), efi_get_next_monotonic_count_wrapper(), efi_get_next_variable_name_wrapper(), efi_get_time(), efi_get_time_wrapper(), efi_get_variable_wrapper(), efi_get_wakeup_time_wrapper(), efi_getchar(), efi_handle_cup(), efi_handle_dectcem_reset(), efi_handle_dectcem_set(), efi_handle_ed(), efi_handle_name(), efi_handle_protocol_wrapper(), efi_handle_sgr(), efi_image_exec(), efi_image_probe(), efi_init(), efi_install_configuration_table_wrapper(), efi_install_multiple_protocol_interfaces_wrapper(), efi_install_protocol_interface_wrapper(), efi_install_table(), efi_iskey(), efi_load_image_wrapper(), efi_local_open_volume(), efi_locate_device(), efi_locate_device_path_wrapper(), efi_locate_handle_buffer_wrapper(), efi_locate_handle_wrapper(), efi_locate_protocol_wrapper(), efi_open_by_child_untyped(), efi_open_by_driver_untyped(), efi_open_protocol_information_wrapper(), efi_open_protocol_wrapper(), efi_open_unsafe_untyped(), efi_open_untyped(), efi_poweroff(), efi_prescroll(), efi_protocols_per_handle_wrapper(), efi_putchar(), efi_pxe_install(), efi_pxe_uninstall(), efi_raise_tpl(), efi_raise_tpl_wrapper(), efi_reboot(), efi_register_protocol_notify_wrapper(), efi_reinstall_protocol_interface_wrapper(), efi_reset_system_wrapper(), efi_restore_tpl(), efi_restore_tpl_wrapper(), efi_set_time_wrapper(), efi_set_timer_wrapper(), efi_set_variable_wrapper(), efi_set_wakeup_time_wrapper(), efi_set_watchdog_timer_wrapper(), efi_shim_get_memory_map(), efi_shim_install(), efi_shim_uninstall(), efi_shim_unlock(), efi_signal_event_wrapper(), efi_snp_hii_append(), efi_snp_hii_install(), efi_snp_hii_uninstall(), efi_snp_poll(), efi_snp_probe(), efi_snp_remove(), efi_stall_wrapper(), efi_start_image_wrapper(), efi_tick_shutdown(), efi_tick_startup(), efi_udelay(), efi_uninstall_multiple_protocol_interfaces_wrapper(), efi_uninstall_protocol_interface_wrapper(), efi_uninstall_table(), efi_unload(), efi_unload_image_wrapper(), efi_unwrap(), efi_urealloc(), efi_usb_async_start(), efi_usb_async_stop(), efi_usb_close(), efi_usb_get_string_descriptor(), efi_usb_install(), efi_usb_open(), efi_usb_uninstall(), efi_veto(), efi_veto_close(), efi_veto_close_handle(), efi_veto_close_protocol(), efi_veto_disconnect(), efi_veto_uninstall(), efi_veto_unload(), efi_vlan_find(), efi_wait_for_event_wrapper(), efi_watchdog_expired(), efi_watchdog_shutdown(), efi_wrap_bs(), efi_wrap_rs(), efi_wrap_systab(), efifb_draw(), efifb_init(), efifb_select_mode(), efipci_discover_any(), efivars_fetch(), efivars_find(), mnpnet_close(), mnpnet_open(), mnpnet_poll_rx(), nii_block(), nii_issue_cpb_db(), nii_pci_open(), and usbio_open().

◆ efi_internal_tpl

EFI_TPL efi_internal_tpl
extern

Internal task priority level.

Definition at line 54 of file efi_init.c.

Referenced by efi_connect(), efi_currticks(), efi_disconnect(), efi_entropy_disable(), efi_raise_tpl(), efi_shutdown_hook(), and nii_issue_cpb_db().

◆ efi_external_tpl

EFI_TPL efi_external_tpl
extern

External task priority level.

Definition at line 57 of file efi_init.c.

Referenced by efi_connect(), efi_currticks(), efi_disconnect(), efi_entropy_enable(), efi_raise_tpl(), and efi_restore_tpl().

◆ efi_shutdown_in_progress

◆ __stack_chk_guard

unsigned long __stack_chk_guard
extern

Stack cookie.

Definition at line 66 of file efi_init.c.

Referenced by __stack_chk_fail(), and efi_init_stack_guard().