iPXE
Data Structures | Macros | Functions | Variables
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. More...
 
#define __efi_protocol   __table_entry ( EFI_PROTOCOLS, 01 )
 Declare an EFI protocol used by iPXE. More...
 
#define EFI_REQUIRE_PROTOCOL(_protocol, _ptr)
 Declare an EFI protocol to be required by iPXE. More...
 
#define EFI_REQUEST_PROTOCOL(_protocol, _ptr)
 Declare an EFI protocol to be requested by iPXE. More...
 
#define EFI_CONFIG_TABLES   __table ( struct efi_config_table, "efi_config_tables" )
 EFI configuration table table. More...
 
#define __efi_config_table   __table_entry ( EFI_CONFIG_TABLES, 01 )
 Declare an EFI configuration table used by iPXE. More...
 
#define EFI_USE_TABLE(_table, _ptr, _required)
 Declare an EFI configuration table to be used by iPXE. More...
 
#define EFIRC(rc)   ERRNO_TO_PLATFORM ( -(rc) )
 Convert an iPXE status code to an EFI status code. More...
 
#define EEFI(efirc)   EPLATFORM ( EINFO_EPLATFORM, efirc )
 Convert an EFI status code to an iPXE status code. More...
 
#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(...)   DBGC_EFI_OPENER_IF ( LOG, ##__VA_ARGS__ )
 
#define DBGC_EFI_OPENERS(...)   DBGC_EFI_OPENERS_IF ( LOG, ##__VA_ARGS__ )
 
#define DBGC_EFI_PROTOCOL(...)   DBGC_EFI_PROTOCOL_IF ( LOG, ##__VA_ARGS__ )
 
#define DBGC_EFI_PROTOCOLS(...)   DBGC_EFI_PROTOCOLS_IF ( LOG, ##__VA_ARGS__ )
 
#define DBGC2_EFI_OPENER(...)   DBGC_EFI_OPENER_IF ( EXTRA, ##__VA_ARGS__ )
 
#define DBGC2_EFI_OPENERS(...)   DBGC_EFI_OPENERS_IF ( EXTRA, ##__VA_ARGS__ )
 
#define DBGC2_EFI_PROTOCOL(...)   DBGC_EFI_PROTOCOL_IF ( EXTRA, ##__VA_ARGS__ )
 
#define DBGC2_EFI_PROTOCOLS(...)   DBGC_EFI_PROTOCOLS_IF ( EXTRA, ##__VA_ARGS__ )
 
#define DBGCP_EFI_OPENER(...)   DBGC_EFI_OPENER_IF ( PROFILE, ##__VA_ARGS__ )
 
#define DBGCP_EFI_OPENERS(...)   DBGC_EFI_OPENERS_IF ( PROFILE, ##__VA_ARGS__ )
 
#define DBGCP_EFI_PROTOCOL(...)   DBGC_EFI_PROTOCOL_IF ( PROFILE, ##__VA_ARGS__ )
 
#define DBGCP_EFI_PROTOCOLS(...)   DBGC_EFI_PROTOCOLS_IF ( PROFILE, ##__VA_ARGS__ )
 
#define EFI_INTF_OP   UNUSED_INTF_OP
 
#define efi_test(handle, protocol)   efi_open_untyped ( (handle), (protocol), NULL )
 Test protocol existence. More...
 
#define efi_open(handle, protocol, interface)
 Open protocol for ephemeral use. More...
 
#define efi_open_unsafe(handle, protocol, interface)
 Open protocol for unsafe persistent use. More...
 
#define efi_open_by_driver(handle, protocol, interface)
 Open protocol for persistent use by a driver. More...
 
#define efi_open_by_child(handle, protocol, child, interface)
 Open protocol for persistent use by a child controller. More...
 

Functions

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

Variables

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

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 52 of file efi.h.

◆ EFI_EVENT

#define EFI_EVENT   STUPID_EFI_EVENT

Definition at line 53 of file efi.h.

◆ _Static_assert

#define _Static_assert (   expr,
  msg 
)

Definition at line 55 of file efi.h.

◆ EFI_PROTOCOLS

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

EFI protocol table.

Definition at line 97 of file efi.h.

◆ __efi_protocol

#define __efi_protocol   __table_entry ( EFI_PROTOCOLS, 01 )

Declare an EFI protocol used by iPXE.

Definition at line 100 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, \
}
An EFI protocol used by iPXE.
Definition: efi.h:87
int required
Protocol is required.
Definition: efi.h:93
#define __efi_protocol
Declare an EFI protocol used by iPXE.
Definition: efi.h:100

Declare an EFI protocol to be required by iPXE.

Parameters
_protocolEFI protocol name
_ptrPointer to protocol instance

Definition at line 107 of file efi.h.

◆ 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, \
}
An EFI protocol used by iPXE.
Definition: efi.h:87
int required
Protocol is required.
Definition: efi.h:93
#define __efi_protocol
Declare an EFI protocol used by iPXE.
Definition: efi.h:100

Declare an EFI protocol to be requested by iPXE.

Parameters
_protocolEFI protocol name
_ptrPointer to protocol instance

Definition at line 121 of file efi.h.

◆ EFI_CONFIG_TABLES

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

EFI configuration table table.

Definition at line 141 of file efi.h.

◆ __efi_config_table

#define __efi_config_table   __table_entry ( EFI_CONFIG_TABLES, 01 )

Declare an EFI configuration table used by iPXE.

Definition at line 145 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), \
}
An EFI configuration table used by iPXE.
Definition: efi.h:131
#define __efi_config_table
Declare an EFI configuration table used by iPXE.
Definition: efi.h:145

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 153 of file efi.h.

◆ EFIRC

#define EFIRC (   rc)    ERRNO_TO_PLATFORM ( -(rc) )

Convert an iPXE status code to an EFI status code.

Parameters
rciPXE status code
Return values
efircEFI status code

Definition at line 166 of file efi.h.

◆ EEFI

#define EEFI (   efirc)    EPLATFORM ( EINFO_EPLATFORM, efirc )

Convert an EFI status code to an iPXE status code.

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

Definition at line 174 of file efi.h.

◆ 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 protocol
Protocol ID.
Definition: stp.h:18
uint16_t handle
Handle.
Definition: smbios.h:16

Definition at line 298 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 )
uint16_t protocol
Protocol ID.
Definition: stp.h:18
uint16_t handle
Handle.
Definition: smbios.h:16

Definition at line 306 of file efi.h.

◆ DBG_EFI_PROTOCOLS_IF

#define DBG_EFI_PROTOCOLS_IF (   level,
  handle 
)
Value:
do { \
if ( DBG_ ## level ) { \
dbg_efi_protocols ( handle ); \
} \
} while ( 0 )
uint16_t handle
Handle.
Definition: smbios.h:16

Definition at line 312 of file efi.h.

◆ 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 318 of file efi.h.

◆ 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 324 of file efi.h.

◆ 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 330 of file efi.h.

◆ 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 336 of file efi.h.

◆ DBGC_EFI_OPENER

#define DBGC_EFI_OPENER (   ...)    DBGC_EFI_OPENER_IF ( LOG, ##__VA_ARGS__ )

Definition at line 342 of file efi.h.

◆ DBGC_EFI_OPENERS

#define DBGC_EFI_OPENERS (   ...)    DBGC_EFI_OPENERS_IF ( LOG, ##__VA_ARGS__ )

Definition at line 344 of file efi.h.

◆ DBGC_EFI_PROTOCOL

#define DBGC_EFI_PROTOCOL (   ...)    DBGC_EFI_PROTOCOL_IF ( LOG, ##__VA_ARGS__ )

Definition at line 346 of file efi.h.

◆ DBGC_EFI_PROTOCOLS

#define DBGC_EFI_PROTOCOLS (   ...)    DBGC_EFI_PROTOCOLS_IF ( LOG, ##__VA_ARGS__ )

Definition at line 348 of file efi.h.

◆ DBGC2_EFI_OPENER

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

Definition at line 351 of file efi.h.

◆ DBGC2_EFI_OPENERS

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

Definition at line 353 of file efi.h.

◆ DBGC2_EFI_PROTOCOL

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

Definition at line 355 of file efi.h.

◆ DBGC2_EFI_PROTOCOLS

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

Definition at line 357 of file efi.h.

◆ DBGCP_EFI_OPENER

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

Definition at line 360 of file efi.h.

◆ DBGCP_EFI_OPENERS

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

Definition at line 362 of file efi.h.

◆ DBGCP_EFI_PROTOCOL

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

Definition at line 364 of file efi.h.

◆ DBGCP_EFI_PROTOCOLS

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

Definition at line 366 of file efi.h.

◆ EFI_INTF_OP

#define EFI_INTF_OP   UNUSED_INTF_OP

Definition at line 373 of file efi.h.

◆ efi_test

#define efi_test (   handle,
  protocol 
)    efi_open_untyped ( (handle), (protocol), NULL )

Test protocol existence.

Parameters
handleEFI handle
protocolProtocol GUID
Return values
rcReturn status code

Definition at line 432 of file efi.h.

◆ 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:124
uint16_t protocol
Protocol ID.
Definition: stp.h:18
uint16_t handle
Handle.
Definition: smbios.h:16
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321

Open protocol for ephemeral use.

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

Definition at line 443 of file efi.h.

◆ 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) ) ); \
} )
An object interface.
Definition: interface.h:124
uint16_t protocol
Protocol ID.
Definition: stp.h:18
uint16_t handle
Handle.
Definition: smbios.h:16
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321

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 458 of file efi.h.

◆ 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) ) ); \
} )
An object interface.
Definition: interface.h:124
uint16_t protocol
Protocol ID.
Definition: stp.h:18
uint16_t handle
Handle.
Definition: smbios.h:16
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321

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 473 of file efi.h.

◆ 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) ) ); \
} )
An object interface.
Definition: interface.h:124
uint16_t protocol
Protocol ID.
Definition: stp.h:18
uint16_t handle
Handle.
Definition: smbios.h:16
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321

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 489 of file efi.h.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER  )

◆ efi_guid_ntoa()

const char* efi_guid_ntoa ( CONST EFI_GUID guid)

Convert GUID to a printable string.

Parameters
guidGUID
Return values
stringPrintable string

Definition at line 725 of file efi_guid.c.

725  {
726  union {
727  union uuid uuid;
728  EFI_GUID guid;
729  } u;
730  unsigned int i;
731 
732  /* Sanity check */
733  if ( ! guid )
734  return NULL;
735 
736  /* Check for a match against well-known GUIDs */
737  for ( i = 0 ; i < ( sizeof ( efi_well_known_guids ) /
738  sizeof ( efi_well_known_guids[0] ) ) ; i++ ) {
740  sizeof ( *guid ) ) == 0 ) {
741  return efi_well_known_guids[i].name;
742  }
743  }
744 
745  /* Convert GUID to standard endianness */
746  memcpy ( &u.guid, guid, sizeof ( u.guid ) );
747  uuid_mangle ( &u.uuid );
748  return uuid_ntoa ( &u.uuid );
749 }
static struct efi_well_known_guid efi_well_known_guids[]
Well-known GUIDs.
Definition: efi_guid.c:524
const char * name
Name.
Definition: efi_guid.c:520
128 bit buffer containing a unique identifier value.
Definition: Base.h:215
A universally unique ID.
Definition: uuid.h:15
union @18 u
static void uuid_mangle(union uuid *uuid)
Change UUID endianness.
Definition: uuid.h:43
void * memcpy(void *dest, const void *src, size_t len) __nonnull
const char * uuid_ntoa(const union uuid *uuid)
Convert UUID to printable string.
Definition: uuid.c:45
uint64_t guid
GUID.
Definition: edd.h:30
EFI_GUID guid
GUID.
Definition: efi.h:133
int memcmp(const void *first, const void *second, size_t len)
Compare memory regions.
Definition: string.c:114
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321

References efi_well_known_guids, guid, efi_well_known_guid::guid, memcmp(), memcpy(), efi_well_known_guid::name, 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)

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_APPLICATION
Definition: UefiSpec.h:647
#define TPL_NOTIFY
Definition: UefiSpec.h:649
#define TPL_CALLBACK
Definition: UefiSpec.h:648
#define TPL_HIGH_LEVEL
Definition: UefiSpec.h:650
int snprintf(char *buf, size_t size, const char *fmt,...)
Write a formatted string to a buffer.
Definition: vsprintf.c:382

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)

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 }
Retrieve all the handles in the handle database.
Definition: UefiSpec.h:1521
Retrieve the next handle fron a RegisterProtocolNotify() event.
Definition: UefiSpec.h:1525
int snprintf(char *buf, size_t size, const char *fmt,...)
Write a formatted string to a buffer.
Definition: vsprintf.c:382
Retrieve the set of handles from the handle database that support a specified protocol.
Definition: UefiSpec.h:1530

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)

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:1984
unsigned long tmp
Definition: linux_pci.h:64

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)

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  {
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 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
size_t efi_path_len(EFI_DEVICE_PATH_PROTOCOL *path)
Find length of device path (excluding terminator)
Definition: efi_path.c:173
unsigned short CHAR16
static EFI_DEVICE_PATH_TO_TEXT_PROTOCOL * efidpt
Device path to text protocol.
Definition: efi_debug.c:46
ring len
Length.
Definition: dwmac.h:231
EFI Boot Services Table.
Definition: UefiSpec.h:1930
EFI_FREE_POOL FreePool
Definition: UefiSpec.h:1949
#define FALSE
Definition: tlan.h:45
int snprintf(char *buf, size_t size, const char *fmt,...)
Write a formatted string to a buffer.
Definition: vsprintf.c:382
EFI_SYSTEM_TABLE * efi_systab
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498
EFI_DEVICE_PATH_TO_TEXT_PATH ConvertDevicePathToText
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321

References EFI_SYSTEM_TABLE::BootServices, EFI_DEVICE_PATH_TO_TEXT_PROTOCOL::ConvertDevicePathToText, 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)

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  {
654  struct efi_handle_name_type *type;
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 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
const char * name
Definition: ath9k_hw.c:1984
128 bit buffer containing a unique identifier value.
Definition: Base.h:215
uint32_t type
Operating system type.
Definition: ena.h:12
int ssnprintf(char *buf, ssize_t ssize, const char *fmt,...)
Version of vsnprintf() that accepts a signed buffer size.
Definition: vsprintf.c:420
An object interface.
Definition: interface.h:124
static unsigned int count
Number of entries.
Definition: dwmac.h:225
static struct efi_handle_name_type efi_handle_name_types[]
EFI handle name types.
Definition: efi_debug.c:616
EFI Boot Services Table.
Definition: UefiSpec.h:1930
#define efi_open(handle, protocol, interface)
Open protocol for ephemeral use.
Definition: efi.h:443
UINT64 UINTN
Unsigned value of native width.
const char * efi_guid_ntoa(CONST EFI_GUID *guid)
Convert GUID to a printable string.
Definition: efi_guid.c:725
EFI_FREE_POOL FreePool
Definition: UefiSpec.h:1949
EFI_PROTOCOLS_PER_HANDLE ProtocolsPerHandle
Definition: UefiSpec.h:2006
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
An EFI handle name type.
Definition: efi_debug.c:591
EFI_SYSTEM_TABLE * efi_systab
uint16_t handle
Handle.
Definition: smbios.h:16
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321
#define DBG2(...)
Definition: compiler.h:515

References EFI_SYSTEM_TABLE::BootServices, count, DBG2, efi_guid_ntoa(), 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 
)

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,
129  efi_open_attributes_name ( opener->Attributes ) );
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 }
int printf(const char *fmt,...)
Write a formatted string to the console.
Definition: vsprintf.c:464
EFI_HANDLE ControllerHandle
Definition: UefiSpec.h:1433
EFI_HANDLE AgentHandle
Definition: UefiSpec.h:1432
UINT32 OpenCount
Definition: UefiSpec.h:1435
UINT32 Attributes
Definition: UefiSpec.h:1434
const char * efi_handle_name(EFI_HANDLE handle)
Get name of an EFI handle.
Definition: efi_debug.c:652
const char * efi_guid_ntoa(CONST EFI_GUID *guid)
Convert GUID to a printable string.
Definition: efi_guid.c:725
const char * efi_open_attributes_name(unsigned int attributes)
Name protocol open attributes.
Definition: efi_debug.c:102
uint16_t protocol
Protocol ID.
Definition: stp.h:18
uint16_t handle
Handle.
Definition: smbios.h:16

References EFI_OPEN_PROTOCOL_INFORMATION_ENTRY::AgentHandle, EFI_OPEN_PROTOCOL_INFORMATION_ENTRY::Attributes, EFI_OPEN_PROTOCOL_INFORMATION_ENTRY::ControllerHandle, efi_guid_ntoa(), 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 
)

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  {
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",
157  efi_guid_ntoa ( protocol ) );
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",
167  efi_guid_ntoa ( protocol ), strerror ( rc ) );
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 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
EFI Oprn Protocol Information Entry.
Definition: UefiSpec.h:1431
#define EEFI(efirc)
Convert an EFI status code to an iPXE status code.
Definition: efi.h:174
int printf(const char *fmt,...)
Write a formatted string to the console.
Definition: vsprintf.c:464
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
static unsigned int count
Number of entries.
Definition: dwmac.h:225
const char * efi_handle_name(EFI_HANDLE handle)
Get name of an EFI handle.
Definition: efi_debug.c:652
char * strerror(int errno)
Retrieve string representation of error number.
Definition: strerror.c:78
EFI Boot Services Table.
Definition: UefiSpec.h:1930
UINT64 UINTN
Unsigned value of native width.
const char * efi_guid_ntoa(CONST EFI_GUID *guid)
Convert GUID to a printable string.
Definition: efi_guid.c:725
EFI_FREE_POOL FreePool
Definition: UefiSpec.h:1949
EFI_OPEN_PROTOCOL_INFORMATION OpenProtocolInformation
Definition: UefiSpec.h:2001
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
EFI_SYSTEM_TABLE * efi_systab
uint16_t protocol
Protocol ID.
Definition: stp.h:18
uint16_t handle
Handle.
Definition: smbios.h:16

References EFI_SYSTEM_TABLE::BootServices, count, dbg_efi_opener(), EEFI, efi_guid_ntoa(), 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 
)

Print protocol information on a given handle.

Parameters
handleEFI handle
protocolProtocol GUID

Definition at line 185 of file efi_debug.c.

185  {
186  VOID *interface;
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",
193  efi_guid_ntoa ( protocol ), strerror ( rc ) );
194  return;
195  }
196  printf ( "HANDLE %s %s at %p\n", efi_handle_name ( handle ),
198 
199  /* Dump list of openers */
201 }
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
int printf(const char *fmt,...)
Write a formatted string to the console.
Definition: vsprintf.c:464
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
An object interface.
Definition: interface.h:124
const char * efi_handle_name(EFI_HANDLE handle)
Get name of an EFI handle.
Definition: efi_debug.c:652
char * strerror(int errno)
Retrieve string representation of error number.
Definition: strerror.c:78
#define efi_open(handle, protocol, interface)
Open protocol for ephemeral use.
Definition: efi.h:443
const char * efi_guid_ntoa(CONST EFI_GUID *guid)
Convert GUID to a printable string.
Definition: efi_guid.c:725
#define VOID
Undeclared type.
Definition: Base.h:271
uint16_t protocol
Protocol ID.
Definition: stp.h:18
uint16_t handle
Handle.
Definition: smbios.h:16

References dbg_efi_openers(), efi_guid_ntoa(), 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)

Print list of protocol handlers attached to a handle.

Parameters
handleEFI handle

Definition at line 208 of file efi_debug.c.

208  {
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",
227  efi_handle_name ( handle ), strerror ( rc ) );
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 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
#define EEFI(efirc)
Convert an EFI status code to an iPXE status code.
Definition: efi.h:174
int printf(const char *fmt,...)
Write a formatted string to the console.
Definition: vsprintf.c:464
128 bit buffer containing a unique identifier value.
Definition: Base.h:215
void dbg_efi_protocol(EFI_HANDLE handle, EFI_GUID *protocol)
Print protocol information on a given handle.
Definition: efi_debug.c:185
static unsigned int count
Number of entries.
Definition: dwmac.h:225
const char * efi_handle_name(EFI_HANDLE handle)
Get name of an EFI handle.
Definition: efi_debug.c:652
char * strerror(int errno)
Retrieve string representation of error number.
Definition: strerror.c:78
EFI Boot Services Table.
Definition: UefiSpec.h:1930
UINT64 UINTN
Unsigned value of native width.
EFI_FREE_POOL FreePool
Definition: UefiSpec.h:1949
EFI_PROTOCOLS_PER_HANDLE ProtocolsPerHandle
Definition: UefiSpec.h:2006
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
EFI_SYSTEM_TABLE * efi_systab
uint16_t handle
Handle.
Definition: smbios.h:16

References EFI_SYSTEM_TABLE::BootServices, count, dbg_efi_protocol(), EEFI, 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)

Construct a stack cookie value.

Parameters
handleImage handle
Return values
cookieStack cookie

Definition at line 114 of file efi_init.c.

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

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

Referenced by efi_init_stack_guard().

◆ __stack_chk_fail()

void __stack_chk_fail ( void  )

Abort on stack check failure.

Definition at line 355 of file efi_init.c.

355  {
356  EFI_STATUS efirc;
357  int rc;
358 
359  /* Report failure (when debugging) */
360  DBGC ( efi_systab, "EFI stack check failed (cookie %#lx); aborting\n",
362 
363  /* Attempt to exit cleanly with an error status */
364  if ( efi_exit ) {
366  0, NULL );
367  rc = -EEFI ( efirc );
368  DBGC ( efi_systab, "EFI stack check exit failed: %s\n",
369  strerror ( rc ) );
370  }
371 
372  /* If the exit fails for any reason, lock the system */
373  while ( 1 ) {}
374 
375 }
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
#define EEFI(efirc)
Convert an EFI status code to an iPXE status code.
Definition: efi.h:174
#define DBGC(...)
Definition: compiler.h:505
#define EFI_COMPROMISED_DATA
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:145
char * strerror(int errno)
Retrieve string representation of error number.
Definition: strerror.c:78
EFI_HANDLE efi_image_handle
Image handle passed to entry point.
Definition: efi_init.c:35
unsigned long __stack_chk_guard
Stack cookie.
Definition: efi_init.c:65
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
static EFI_EXIT efi_exit
Exit function.
Definition: efi_init.c:72
EFI_SYSTEM_TABLE * efi_systab
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321

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

◆ efi_init_stack_guard()

static void efi_init_stack_guard ( EFI_HANDLE  handle)
inlinestatic

Initialise stack cookie.

Parameters
handleImage handle

Definition at line 386 of file efi.h.

386  {
387 
388  /* The calling function must not itself use stack protection,
389  * since the change in the stack guard value would trigger a
390  * false positive.
391  *
392  * There is unfortunately no way to annotate a function to
393  * exclude the use of stack protection. We must therefore
394  * rely on correctly anticipating the compiler's decision on
395  * the use of stack protection.
396  *
397  * The calculation of the stack cookie value deliberately
398  * takes the address of a stack variable (to provide an
399  * additional source of entropy). This operation would
400  * trigger the application of stack protection to the calling
401  * function, and so must be externalised.
402  */
404 }
unsigned long __stack_chk_guard
Stack cookie.
Definition: efi_init.c:65
unsigned long efi_stack_cookie(EFI_HANDLE handle)
Construct a stack cookie value.
Definition: efi_init.c:114
uint16_t handle
Handle.
Definition: smbios.h:16

References __stack_chk_guard, 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 
)

Initialise EFI environment.

Parameters
image_handleImage handle
systabSystem table
Return values
efircEFI return status code

Definition at line 154 of file efi_init.c.

155  {
156  EFI_BOOT_SERVICES *bs;
157  struct efi_protocol *prot;
158  struct efi_config_table *tab;
160  void *device_path_copy;
161  size_t device_path_len;
162  EFI_STATUS efirc;
163  int rc;
164 
165  /* Store image handle and system table pointer for future use */
166  efi_image_handle = image_handle;
167  efi_systab = systab;
168 
169  /* Sanity checks */
170  if ( ! systab ) {
171  efirc = EFI_NOT_AVAILABLE_YET;
172  goto err_sanity;
173  }
174  if ( ! systab->ConOut ) {
175  efirc = EFI_NOT_AVAILABLE_YET;
176  goto err_sanity;
177  }
178  if ( ! systab->BootServices ) {
179  DBGC ( systab, "EFI provided no BootServices entry point\n" );
180  efirc = EFI_NOT_AVAILABLE_YET;
181  goto err_sanity;
182  }
183  if ( ! systab->RuntimeServices ) {
184  DBGC ( systab, "EFI provided no RuntimeServices entry "
185  "point\n" );
186  efirc = EFI_NOT_AVAILABLE_YET;
187  goto err_sanity;
188  }
189  DBGC ( systab, "EFI handle %p systab %p\n", image_handle, systab );
190  bs = systab->BootServices;
191 
192  /* Store abort function pointer */
193  efi_exit = bs->Exit;
194 
195  /* Look up used protocols */
197  if ( ( efirc = bs->LocateProtocol ( &prot->guid, NULL,
198  prot->protocol ) ) == 0 ) {
199  DBGC ( systab, "EFI protocol %s is at %p\n",
200  efi_guid_ntoa ( &prot->guid ),
201  *(prot->protocol) );
202  } else {
203  DBGC ( systab, "EFI does not provide protocol %s\n",
204  efi_guid_ntoa ( &prot->guid ) );
205  /* Fail if protocol is required */
206  if ( prot->required )
207  goto err_missing_protocol;
208  }
209  }
210 
211  /* Look up used configuration tables */
213  if ( ( *(tab->table) = efi_find_table ( &tab->guid ) ) ) {
214  DBGC ( systab, "EFI configuration table %s is at %p\n",
215  efi_guid_ntoa ( &tab->guid ), *(tab->table) );
216  } else {
217  DBGC ( systab, "EFI does not provide configuration "
218  "table %s\n", efi_guid_ntoa ( &tab->guid ) );
219  if ( tab->required ) {
220  efirc = EFI_NOT_AVAILABLE_YET;
221  goto err_missing_table;
222  }
223  }
224  }
225 
226  /* Get loaded image protocol
227  *
228  * We assume that our loaded image protocol will not be
229  * uninstalled while our image code is still running.
230  */
231  if ( ( rc = efi_open_unsafe ( image_handle,
233  &efi_loaded_image ) ) != 0 ) {
234  DBGC ( systab, "EFI could not get loaded image protocol: %s",
235  strerror ( rc ) );
236  efirc = EFIRC ( rc );
237  goto err_no_loaded_image;
238  }
239  DBGC ( systab, "EFI image base address %p\n",
241 
242  /* Record command line */
245 
246  /* Get loaded image's device handle's device path */
249  &device_path ) ) != 0 ) {
250  DBGC ( systab, "EFI could not get loaded image's device path: "
251  "%s", strerror ( rc ) );
252  efirc = EFIRC ( rc );
253  goto err_no_device_path;
254  }
255 
256  /* Make a copy of the loaded image's device handle's device
257  * path, since the device handle itself may become invalidated
258  * when we load our own drivers.
259  */
260  device_path_len = ( efi_path_len ( device_path ) +
261  sizeof ( EFI_DEVICE_PATH_PROTOCOL ) );
262  if ( ( efirc = bs->AllocatePool ( EfiBootServicesData, device_path_len,
263  &device_path_copy ) ) != 0 ) {
264  rc = -EEFI ( efirc );
265  goto err_alloc_device_path;
266  }
267  memcpy ( device_path_copy, device_path, device_path_len );
268  efi_loaded_image_path = device_path_copy;
269  DBGC ( systab, "EFI image device path %s\n",
271 
272  /* EFI is perfectly capable of gracefully shutting down any
273  * loaded devices if it decides to fall back to a legacy boot.
274  * For no particularly comprehensible reason, it doesn't
275  * bother doing so when ExitBootServices() is called.
276  */
277  if ( ( efirc = bs->CreateEvent ( EVT_SIGNAL_EXIT_BOOT_SERVICES,
279  NULL, &efi_shutdown_event ) ) != 0 ) {
280  rc = -EEFI ( efirc );
281  DBGC ( systab, "EFI could not create ExitBootServices event: "
282  "%s\n", strerror ( rc ) );
283  goto err_create_event;
284  }
285 
286  /* Install driver binding protocol */
287  if ( ( rc = efi_driver_install() ) != 0 ) {
288  DBGC ( systab, "EFI could not install driver: %s\n",
289  strerror ( rc ) );
290  efirc = EFIRC ( rc );
291  goto err_driver_install;
292  }
293 
294  /* Install image unload method */
296 
297  return 0;
298 
300  err_driver_install:
302  err_create_event:
304  err_alloc_device_path:
305  err_no_device_path:
306  err_no_loaded_image:
307  err_missing_table:
308  err_missing_protocol:
309  err_sanity:
310  return efirc;
311 }
void efi_driver_uninstall(void)
Uninstall EFI driver.
Definition: efi_driver.c:420
union edd_device_path device_path
Device path.
Definition: edd.h:24
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
void ** protocol
Variable containing pointer to protocol structure.
Definition: efi.h:91
EFI_LOADED_IMAGE_PROTOCOL * efi_loaded_image
Loaded image protocol for this image.
Definition: efi_init.c:38
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
#define EEFI(efirc)
Convert an EFI status code to an iPXE status code.
Definition: efi.h:174
const wchar_t * efi_cmdline
EFI command line (may not be wNUL-terminated.
Definition: efi_cmdline.c:45
EFI_LOCATE_PROTOCOL LocateProtocol
Definition: UefiSpec.h:2008
#define efi_open_unsafe(handle, protocol, interface)
Open protocol for unsafe persistent use.
Definition: efi.h:458
EFI_GUID guid
GUID.
Definition: efi.h:89
#define DBGC(...)
Definition: compiler.h:505
EFI_GUID efi_loaded_image_protocol_guid
Loaded image protocol GUID.
Definition: efi_guid.c:272
size_t efi_path_len(EFI_DEVICE_PATH_PROTOCOL *path)
Find length of device path (excluding terminator)
Definition: efi_path.c:173
EFI_CLOSE_EVENT CloseEvent
Definition: UefiSpec.h:1958
VOID * ImageBase
The base address at which the image was loaded.
Definition: LoadedImage.h:69
This protocol can be used on any device handle to obtain generic path/location information concerning...
Definition: DevicePath.h:45
#define TPL_NOTIFY
Definition: UefiSpec.h:649
#define EFI_PROTOCOLS
EFI protocol table.
Definition: efi.h:97
#define EVT_SIGNAL_EXIT_BOOT_SERVICES
Definition: UefiSpec.h:455
#define EFI_CONFIG_TABLES
EFI configuration table table.
Definition: efi.h:141
An EFI configuration table used by iPXE.
Definition: efi.h:131
EFI_DEVICE_PATH_PROTOCOL * efi_loaded_image_path
Device path for the loaded image's device handle.
Definition: efi_init.c:41
void * memcpy(void *dest, const void *src, size_t len) __nonnull
#define EFI_NOT_AVAILABLE_YET
If this value is returned by an API, it means the capability is not yet installed/available/ready to ...
Definition: PiMultiPhase.h:56
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL * ConOut
A pointer to the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL interface that is associated with ConsoleOutHandle.
Definition: UefiSpec.h:2079
static EFI_EVENT efi_shutdown_event
Event used to signal shutdown.
Definition: efi_init.c:62
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:84
EFI_CREATE_EVENT CreateEvent
Definition: UefiSpec.h:1954
const char * efi_devpath_text(EFI_DEVICE_PATH_PROTOCOL *path)
Get textual representation of device path.
Definition: efi_debug.c:247
VOID * LoadOptions
A pointer to the image's binary load options.
Definition: LoadedImage.h:64
An EFI protocol used by iPXE.
Definition: efi.h:87
char * strerror(int errno)
Retrieve string representation of error number.
Definition: strerror.c:78
EFI Boot Services Table.
Definition: UefiSpec.h:1930
EFI_HANDLE efi_image_handle
Image handle passed to entry point.
Definition: efi_init.c:35
EFI_IMAGE_UNLOAD Unload
Definition: LoadedImage.h:73
#define for_each_table_entry(pointer, table)
Iterate through all entries within a linker table.
Definition: tables.h:385
#define efi_open(handle, protocol, interface)
Open protocol for ephemeral use.
Definition: efi.h:443
EFI_GUID efi_device_path_protocol_guid
Device path protocol GUID.
Definition: efi_guid.c:168
const char * efi_guid_ntoa(CONST EFI_GUID *guid)
Convert GUID to a printable string.
Definition: efi_guid.c:725
EFI_FREE_POOL FreePool
Definition: UefiSpec.h:1949
void ** table
Variable containing pointer to configuration table.
Definition: efi.h:135
UINT32 LoadOptionsSize
The size in bytes of LoadOptions.
Definition: LoadedImage.h:63
int required
Protocol is required.
Definition: efi.h:93
EFI_RUNTIME_SERVICES * RuntimeServices
A pointer to the EFI Runtime Services Table.
Definition: UefiSpec.h:2094
EFI_GUID guid
GUID.
Definition: efi.h:133
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
static EFI_EXIT efi_exit
Exit function.
Definition: efi_init.c:72
EFI_SYSTEM_TABLE * efi_systab
size_t efi_cmdline_len
Length of EFI command line (in bytes)
Definition: efi_cmdline.c:48
The data portions of a loaded Boot Serves Driver, and the default data allocation type used by a Boot...
int required
Table is required for operation.
Definition: efi.h:137
static EFI_STATUS EFIAPI efi_unload(EFI_HANDLE image_handle)
Shut down EFI environment.
Definition: efi_init.c:318
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321
void * efi_find_table(EFI_GUID *guid)
Look up EFI configuration table.
Definition: efi_table.c:44
int efi_driver_install(void)
Install EFI driver.
Definition: efi_driver.c:387
#define EFIRC(rc)
Convert an iPXE status code to an EFI status code.
Definition: efi.h:166
EFI_HANDLE DeviceHandle
The device handle that the EFI Image was loaded from.
Definition: LoadedImage.h:55
EFI_ALLOCATE_POOL AllocatePool
Definition: UefiSpec.h:1948

References EFI_BOOT_SERVICES::AllocatePool, EFI_SYSTEM_TABLE::BootServices, EFI_BOOT_SERVICES::CloseEvent, EFI_SYSTEM_TABLE::ConOut, EFI_BOOT_SERVICES::CreateEvent, DBGC, device_path, EFI_LOADED_IMAGE_PROTOCOL::DeviceHandle, 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_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_protocol::guid, efi_config_table::guid, EFI_LOADED_IMAGE_PROTOCOL::ImageBase, EFI_LOADED_IMAGE_PROTOCOL::LoadOptions, EFI_LOADED_IMAGE_PROTOCOL::LoadOptionsSize, EFI_BOOT_SERVICES::LocateProtocol, memcpy(), NULL, efi_protocol::protocol, rc, efi_protocol::required, efi_config_table::required, EFI_SYSTEM_TABLE::RuntimeServices, strerror(), efi_config_table::table, TPL_NOTIFY, and EFI_LOADED_IMAGE_PROTOCOL::Unload.

Referenced by _efi_start(), and _efidrv_start().

◆ efi_raise_tpl()

void efi_raise_tpl ( struct efi_saved_tpl tpl)

Raise task priority level to internal level.

Parameters
tplSaved TPL

Definition at line 382 of file efi_init.c.

382  {
384 
385  /* Record current external TPL */
386  tpl->previous = efi_external_tpl;
387 
388  /* Raise TPL and record previous TPL as new external TPL */
389  tpl->current = bs->RaiseTPL ( efi_internal_tpl );
390  efi_external_tpl = tpl->current;
391 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
EFI_RAISE_TPL RaiseTPL
Definition: UefiSpec.h:1939
EFI_TPL efi_internal_tpl
Internal task priority level.
Definition: efi_init.c:53
EFI_TPL current
Current external TPL.
Definition: efi.h:81
EFI Boot Services Table.
Definition: UefiSpec.h:1930
EFI_TPL previous
Previous external TPL.
Definition: efi.h:83
EFI_SYSTEM_TABLE * efi_systab
EFI_TPL efi_external_tpl
External task priority level.
Definition: efi_init.c:56

References EFI_SYSTEM_TABLE::BootServices, 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()

void efi_restore_tpl ( struct efi_saved_tpl tpl)

Restore task priority level.

Parameters
tplSaved TPL

Definition at line 398 of file efi_init.c.

398  {
400 
401  /* Restore external TPL */
402  efi_external_tpl = tpl->previous;
403 
404  /* Restore TPL */
405  bs->RestoreTPL ( tpl->current );
406 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
EFI_TPL current
Current external TPL.
Definition: efi.h:81
EFI Boot Services Table.
Definition: UefiSpec.h:1930
EFI_TPL previous
Previous external TPL.
Definition: efi.h:83
EFI_SYSTEM_TABLE * efi_systab
EFI_RESTORE_TPL RestoreTPL
Definition: UefiSpec.h:1940
EFI_TPL efi_external_tpl
External task priority level.
Definition: efi_init.c:56

References EFI_SYSTEM_TABLE::BootServices, efi_saved_tpl::current, efi_external_tpl, efi_systab, efi_saved_tpl::previous, and EFI_BOOT_SERVICES::RestoreTPL.

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_open_untyped()

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

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 96 of file efi_open.c.

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

References assert(), EFI_SYSTEM_TABLE::BootServices, EFI_BOOT_SERVICES::CloseProtocol, controller, EEFI, 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 
)

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 180 of file efi_open.c.

181  {
185  unsigned int attributes;
186  EFI_STATUS efirc;
187  int rc;
188 
189  /* Sanity checks */
190  assert ( handle != NULL );
191  assert ( protocol != NULL );
192  assert ( interface != NULL );
193 
194  /* Open protocol
195  *
196  * We set ControllerHandle equal to AgentHandle to avoid
197  * collisions with other open types.
198  */
199  controller = agent;
200  attributes = EFI_OPEN_PROTOCOL_GET_PROTOCOL;
201  if ( ( efirc = bs->OpenProtocol ( handle, protocol, interface, agent,
202  controller, attributes ) ) != 0 ) {
203  rc = -EEFI ( efirc );
204  *interface = NULL;
205  return rc;
206  }
207 
208  return 0;
209 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
#define EEFI(efirc)
Convert an EFI status code to an iPXE status code.
Definition: efi.h:174
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
An object interface.
Definition: interface.h:124
#define EFI_OPEN_PROTOCOL_GET_PROTOCOL
Definition: UefiSpec.h:1354
EFI Boot Services Table.
Definition: UefiSpec.h:1930
EFI_HANDLE efi_image_handle
Image handle passed to entry point.
Definition: efi_init.c:35
uint8_t controller
CD-ROM controller number.
Definition: int13.h:18
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
EFI_SYSTEM_TABLE * efi_systab
EFI_OPEN_PROTOCOL OpenProtocol
Definition: UefiSpec.h:1999
uint16_t protocol
Protocol ID.
Definition: stp.h:18
uint16_t handle
Handle.
Definition: smbios.h:16
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321
Definition: efi.h:61

References assert(), EFI_SYSTEM_TABLE::BootServices, controller, EEFI, 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 
)

Close protocol opened for unsafe persistent use.

Parameters
handleEFI handle
protocolProtocol GUID
childChild controller handle

Definition at line 218 of file efi_open.c.

218  {
222 
223  /* Sanity checks */
224  assert ( handle != NULL );
225  assert ( protocol != NULL );
226 
227  /* Close protocol */
228  controller = agent;
229  bs->CloseProtocol ( handle, protocol, agent, controller );
230 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
EFI_CLOSE_PROTOCOL CloseProtocol
Definition: UefiSpec.h:2000
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
EFI Boot Services Table.
Definition: UefiSpec.h:1930
EFI_HANDLE efi_image_handle
Image handle passed to entry point.
Definition: efi_init.c:35
uint8_t controller
CD-ROM controller number.
Definition: int13.h:18
EFI_SYSTEM_TABLE * efi_systab
uint16_t protocol
Protocol ID.
Definition: stp.h:18
uint16_t handle
Handle.
Definition: smbios.h:16
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321
Definition: efi.h:61

References assert(), EFI_SYSTEM_TABLE::BootServices, EFI_BOOT_SERVICES::CloseProtocol, controller, 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 
)

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 240 of file efi_open.c.

241  {
245  unsigned int attributes;
246  EFI_STATUS efirc;
247  int rc;
248 
249  /* Sanity checks */
250  assert ( handle != NULL );
251  assert ( protocol != NULL );
252  assert ( interface != NULL );
253 
254  /* Open protocol
255  *
256  * We set ControllerHandle equal to Handle to avoid collisions
257  * with other open types.
258  */
259  controller = handle;
260  attributes = ( EFI_OPEN_PROTOCOL_BY_DRIVER |
262  if ( ( efirc = bs->OpenProtocol ( handle, protocol, interface, agent,
263  controller, attributes ) ) != 0 ) {
264  rc = -EEFI ( efirc );
265  *interface = NULL;
266  return rc;
267  }
268 
269  return 0;
270 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
#define EEFI(efirc)
Convert an EFI status code to an iPXE status code.
Definition: efi.h:174
#define EFI_OPEN_PROTOCOL_BY_DRIVER
Definition: UefiSpec.h:1357
#define EFI_OPEN_PROTOCOL_EXCLUSIVE
Definition: UefiSpec.h:1358
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
An object interface.
Definition: interface.h:124
EFI Boot Services Table.
Definition: UefiSpec.h:1930
EFI_HANDLE efi_image_handle
Image handle passed to entry point.
Definition: efi_init.c:35
uint8_t controller
CD-ROM controller number.
Definition: int13.h:18
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
EFI_SYSTEM_TABLE * efi_systab
EFI_OPEN_PROTOCOL OpenProtocol
Definition: UefiSpec.h:1999
uint16_t protocol
Protocol ID.
Definition: stp.h:18
uint16_t handle
Handle.
Definition: smbios.h:16
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321
Definition: efi.h:61

References assert(), EFI_SYSTEM_TABLE::BootServices, controller, EEFI, 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 
)

Close protocol opened for persistent use by a driver.

Parameters
handleEFI handle
protocolProtocol GUID

Definition at line 278 of file efi_open.c.

278  {
282 
283  /* Sanity checks */
284  assert ( handle != NULL );
285  assert ( protocol != NULL );
286 
287  /* Close protocol */
288  controller = handle;
289  bs->CloseProtocol ( handle, protocol, agent, controller );
290 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
EFI_CLOSE_PROTOCOL CloseProtocol
Definition: UefiSpec.h:2000
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
EFI Boot Services Table.
Definition: UefiSpec.h:1930
EFI_HANDLE efi_image_handle
Image handle passed to entry point.
Definition: efi_init.c:35
uint8_t controller
CD-ROM controller number.
Definition: int13.h:18
EFI_SYSTEM_TABLE * efi_systab
uint16_t protocol
Protocol ID.
Definition: stp.h:18
uint16_t handle
Handle.
Definition: smbios.h:16
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321
Definition: efi.h:61

References assert(), EFI_SYSTEM_TABLE::BootServices, EFI_BOOT_SERVICES::CloseProtocol, controller, 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 
)

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 301 of file efi_open.c.

302  {
306  unsigned int attributes;
307  EFI_STATUS efirc;
308  int rc;
309 
310  /* Sanity checks */
311  assert ( handle != NULL );
312  assert ( protocol != NULL );
313  assert ( child != NULL );
314  assert ( interface != NULL );
315 
316  /* Open protocol
317  *
318  * We set ControllerHandle to a non-NULL value distinct from
319  * both Handle and AgentHandle to avoid collisions with other
320  * open types.
321  */
322  controller = child;
323  assert ( controller != handle );
324  assert ( controller != agent );
326  if ( ( efirc = bs->OpenProtocol ( handle, protocol, interface, agent,
327  controller, attributes ) ) != 0 ) {
328  rc = -EEFI ( efirc );
329  *interface = NULL;
330  return rc;
331  }
332 
333  return 0;
334 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
#define EEFI(efirc)
Convert an EFI status code to an iPXE status code.
Definition: efi.h:174
#define EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER
Definition: UefiSpec.h:1356
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
An object interface.
Definition: interface.h:124
EFI Boot Services Table.
Definition: UefiSpec.h:1930
EFI_HANDLE efi_image_handle
Image handle passed to entry point.
Definition: efi_init.c:35
uint8_t controller
CD-ROM controller number.
Definition: int13.h:18
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
EFI_SYSTEM_TABLE * efi_systab
EFI_OPEN_PROTOCOL OpenProtocol
Definition: UefiSpec.h:1999
uint16_t protocol
Protocol ID.
Definition: stp.h:18
uint16_t handle
Handle.
Definition: smbios.h:16
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321
Definition: efi.h:61

References assert(), EFI_SYSTEM_TABLE::BootServices, controller, EEFI, 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 
)

Close protocol opened for persistent use by a child controller.

Parameters
handleEFI handle
protocolProtocol GUID
childChild controller handle

Definition at line 343 of file efi_open.c.

344  {
348 
349  /* Sanity checks */
350  assert ( handle != NULL );
351  assert ( protocol != NULL );
352  assert ( child != NULL );
353 
354  /* Close protocol */
355  controller = child;
356  assert ( controller != handle );
357  assert ( controller != agent );
358  bs->CloseProtocol ( handle, protocol, agent, controller );
359 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
EFI_CLOSE_PROTOCOL CloseProtocol
Definition: UefiSpec.h:2000
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
EFI Boot Services Table.
Definition: UefiSpec.h:1930
EFI_HANDLE efi_image_handle
Image handle passed to entry point.
Definition: efi_init.c:35
uint8_t controller
CD-ROM controller number.
Definition: int13.h:18
EFI_SYSTEM_TABLE * efi_systab
uint16_t protocol
Protocol ID.
Definition: stp.h:18
uint16_t handle
Handle.
Definition: smbios.h:16
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321
Definition: efi.h:61

References assert(), EFI_SYSTEM_TABLE::BootServices, EFI_BOOT_SERVICES::CloseProtocol, controller, 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 
)

Connect UEFI driver(s)

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

Definition at line 57 of file efi_connect.c.

57  {
59  EFI_HANDLE driverlist[2] = { driver, NULL };
60  EFI_HANDLE *drivers = ( driver ? driverlist : NULL );
61  EFI_STATUS efirc;
62  int rc;
63 
64  /* Attempt connection at external TPL */
65  DBGC ( device, "EFI %s connecting ", efi_handle_name ( device ) );
66  DBGC ( device, "%s driver at %s TPL\n",
67  ( driver ? efi_handle_name ( driver ) : "any" ),
70  efirc = bs->ConnectController ( device, drivers, NULL, TRUE );
71  bs->RaiseTPL ( efi_internal_tpl );
72  if ( efirc != 0 ) {
73  rc = -EEFI_CONNECT ( efirc );
74  DBGC ( device, "EFI %s could not connect: %s\n",
75  efi_handle_name ( device ), strerror ( rc ) );
76  return rc;
77  }
78 
79  return 0;
80 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
EFI_RAISE_TPL RaiseTPL
Definition: UefiSpec.h:1939
#define DBGC(...)
Definition: compiler.h:505
EFI_TPL efi_internal_tpl
Internal task priority level.
Definition: efi_init.c:53
A hardware device.
Definition: device.h:76
#define EEFI_CONNECT(efirc)
Definition: efi_connect.c:47
const char * efi_handle_name(EFI_HANDLE handle)
Get name of an EFI handle.
Definition: efi_debug.c:652
char * strerror(int errno)
Retrieve string representation of error number.
Definition: strerror.c:78
EFI Boot Services Table.
Definition: UefiSpec.h:1930
EFI_CONNECT_CONTROLLER ConnectController
Definition: UefiSpec.h:1993
#define TRUE
Definition: tlan.h:46
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
EFI_SYSTEM_TABLE * efi_systab
EFI_RESTORE_TPL RestoreTPL
Definition: UefiSpec.h:1940
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321
Definition: efi.h:61
const char * efi_tpl_name(EFI_TPL tpl)
Name EFI TPL.
Definition: efi_debug.c:55
EFI_TPL efi_external_tpl
External task priority level.
Definition: efi_init.c:56

References EFI_SYSTEM_TABLE::BootServices, EFI_BOOT_SERVICES::ConnectController, DBGC, EEFI_CONNECT, efi_external_tpl, 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 
)

Disconnect UEFI driver(s)

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

Definition at line 89 of file efi_connect.c.

89  {
91  EFI_STATUS efirc;
92  int rc;
93 
94  /* Attempt disconnection at external TPL */
95  DBGC ( device, "EFI %s disconnecting ", efi_handle_name ( device ) );
96  DBGC ( device, "%s driver at %s TPL\n",
97  ( driver ? efi_handle_name ( driver ) : "any" ),
100  efirc = bs->DisconnectController ( device, driver, NULL );
101  bs->RaiseTPL ( efi_internal_tpl );
102  if ( ( efirc != 0 ) && ( efirc != EFI_NOT_FOUND ) ) {
103  rc = -EEFI ( efirc );
104  DBGC ( device, "EFI %s could not disconnect: %s\n",
105  efi_handle_name ( device ), strerror ( rc ) );
106  return rc;
107  }
108 
109  return 0;
110 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2098
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
#define EEFI(efirc)
Convert an EFI status code to an iPXE status code.
Definition: efi.h:174
EFI_RAISE_TPL RaiseTPL
Definition: UefiSpec.h:1939
#define DBGC(...)
Definition: compiler.h:505
EFI_TPL efi_internal_tpl
Internal task priority level.
Definition: efi_init.c:53
A hardware device.
Definition: device.h:76
const char * efi_handle_name(EFI_HANDLE handle)
Get name of an EFI handle.
Definition: efi_debug.c:652
char * strerror(int errno)
Retrieve string representation of error number.
Definition: strerror.c:78
EFI Boot Services Table.
Definition: UefiSpec.h:1930
#define EFI_NOT_FOUND
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:128
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
EFI_SYSTEM_TABLE * efi_systab
EFI_RESTORE_TPL RestoreTPL
Definition: UefiSpec.h:1940
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321
const char * efi_tpl_name(EFI_TPL tpl)
Name EFI TPL.
Definition: efi_debug.c:55
EFI_TPL efi_external_tpl
External task priority level.
Definition: efi_init.c:56
EFI_DISCONNECT_CONTROLLER DisconnectController
Definition: UefiSpec.h:1994

References EFI_SYSTEM_TABLE::BootServices, DBGC, EFI_BOOT_SERVICES::DisconnectController, EEFI, efi_external_tpl, 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

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

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

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

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

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

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

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

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

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

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

◆ efi_console_control_protocol_guid

EFI_GUID efi_console_control_protocol_guid

Console control protocol GUID.

Definition at line 164 of file efi_guid.c.

◆ efi_device_path_protocol_guid

EFI_GUID efi_device_path_protocol_guid

◆ efi_dhcp4_protocol_guid

EFI_GUID efi_dhcp4_protocol_guid

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

DHCPv4 service binding protocol GUID.

Definition at line 176 of file efi_guid.c.

◆ efi_dhcp6_protocol_guid

EFI_GUID efi_dhcp6_protocol_guid

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

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

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

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

DNSv4 service binding protocol GUID.

Definition at line 196 of file efi_guid.c.

◆ efi_dns6_protocol_guid

EFI_GUID efi_dns6_protocol_guid

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

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

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

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

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

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

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

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

HTTP service binding protocol GUID.

Definition at line 232 of file efi_guid.c.

◆ efi_ip4_protocol_guid

EFI_GUID efi_ip4_protocol_guid

IPv4 protocol GUID.

Definition at line 236 of file efi_guid.c.

◆ efi_ip4_config_protocol_guid

EFI_GUID efi_ip4_config_protocol_guid

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

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

IPv4 service binding protocol GUID.

Definition at line 248 of file efi_guid.c.

◆ efi_ip6_protocol_guid

EFI_GUID efi_ip6_protocol_guid

IPv6 protocol GUID.

Definition at line 252 of file efi_guid.c.

◆ efi_ip6_config_protocol_guid

EFI_GUID efi_ip6_config_protocol_guid

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

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

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

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

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

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

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

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

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

MTFTPv4 service binding protocol GUID.

Definition at line 292 of file efi_guid.c.

◆ efi_mtftp6_protocol_guid

EFI_GUID efi_mtftp6_protocol_guid

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

MTFTPv6 service binding protocol GUID.

Definition at line 300 of file efi_guid.c.

◆ efi_nii_protocol_guid

EFI_GUID efi_nii_protocol_guid

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

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

◆ efi_pci_root_bridge_io_protocol_guid

EFI_GUID efi_pci_root_bridge_io_protocol_guid

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

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

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

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

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

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

◆ efi_simple_pointer_protocol_guid

EFI_GUID efi_simple_pointer_protocol_guid

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

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

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

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

Storage security protocol GUID.

Definition at line 360 of file efi_guid.c.

◆ efi_supplicant_protocol_guid

EFI_GUID efi_supplicant_protocol_guid

Supplicant protocol GUID.

Definition at line 364 of file efi_guid.c.

◆ efi_tcg_protocol_guid

EFI_GUID efi_tcg_protocol_guid

TCG protocol GUID.

Definition at line 368 of file efi_guid.c.

◆ efi_tcg2_protocol_guid

EFI_GUID efi_tcg2_protocol_guid

TCG2 protocol GUID.

Definition at line 372 of file efi_guid.c.

◆ efi_tcp4_protocol_guid

EFI_GUID efi_tcp4_protocol_guid

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

TCPv4 service binding protocol GUID.

Definition at line 380 of file efi_guid.c.

◆ efi_tcp6_protocol_guid

EFI_GUID efi_tcp6_protocol_guid

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

TCPv6 service binding protocol GUID.

Definition at line 388 of file efi_guid.c.

◆ efi_tree_protocol_guid

EFI_GUID efi_tree_protocol_guid

TrEE protocol GUID.

Definition at line 392 of file efi_guid.c.

◆ efi_udp4_protocol_guid

EFI_GUID efi_udp4_protocol_guid

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

UDPv4 service binding protocol GUID.

Definition at line 400 of file efi_guid.c.

◆ efi_udp6_protocol_guid

EFI_GUID efi_udp6_protocol_guid

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

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

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

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

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

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

◆ efi_vlan_config_protocol_guid

EFI_GUID efi_vlan_config_protocol_guid

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

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

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

ACPI 2.0 table GUID.

Definition at line 444 of file efi_guid.c.

◆ efi_fdt_table_guid

EFI_GUID efi_fdt_table_guid

FDT table GUID.

Definition at line 448 of file efi_guid.c.

◆ efi_smbios_table_guid

EFI_GUID efi_smbios_table_guid

SMBIOS table GUID.

Definition at line 452 of file efi_guid.c.

◆ efi_smbios2_table_guid

EFI_GUID efi_smbios2_table_guid

◆ efi_cert_x509_guid

EFI_GUID efi_cert_x509_guid

X.509 certificate GUID.

Definition at line 459 of file efi_guid.c.

◆ efi_file_info_id

EFI_GUID efi_file_info_id

File information GUID.

Definition at line 462 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

File system information GUID.

Definition at line 465 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

Global variable GUID.

Definition at line 468 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

Image security database GUID.

Definition at line 471 of file efi_guid.c.

◆ efi_microsoft_vendor_guid

EFI_GUID efi_microsoft_vendor_guid

Microsoft vendor GUID.

Definition at line 474 of file efi_guid.c.

◆ efi_tls_ca_certificate_guid

EFI_GUID efi_tls_ca_certificate_guid

TLS CA certificate variable GUID.

Definition at line 477 of file efi_guid.c.

Referenced by efi_cacert_all().

◆ efi_image_handle

EFI_HANDLE efi_image_handle

◆ efi_loaded_image

EFI_LOADED_IMAGE_PROTOCOL* efi_loaded_image

◆ efi_loaded_image_path

EFI_DEVICE_PATH_PROTOCOL* efi_loaded_image_path

Device path for the loaded image's device handle.

Definition at line 41 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

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

Internal task priority level.

Definition at line 53 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

External task priority level.

Definition at line 56 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

int efi_shutdown_in_progress

◆ __stack_chk_guard

unsigned long __stack_chk_guard

Stack cookie.

Definition at line 65 of file efi_init.c.

Referenced by __stack_chk_fail(), and efi_init_stack_guard().