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_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 _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
 

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_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...
 

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_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_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_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_tcg_protocol_guid
 TCG 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_file_info_id
 File information GUID. More...
 
EFI_GUID efi_file_system_info_id
 File system information 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.

◆ _Static_assert

#define _Static_assert (   expr,
  msg 
)

Definition at line 54 of file efi.h.

◆ EFI_PROTOCOLS

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

EFI protocol table.

Definition at line 94 of file efi.h.

◆ __efi_protocol

#define __efi_protocol   __table_entry ( EFI_PROTOCOLS, 01 )

Declare an EFI protocol used by iPXE.

Definition at line 97 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:84
int required
Protocol is required.
Definition: efi.h:90
#define __efi_protocol
Declare an EFI protocol used by iPXE.
Definition: efi.h:97

Declare an EFI protocol to be required by iPXE.

Parameters
_protocolEFI protocol name
_ptrPointer to protocol instance

Definition at line 104 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:84
int required
Protocol is required.
Definition: efi.h:90
#define __efi_protocol
Declare an EFI protocol used by iPXE.
Definition: efi.h:97

Declare an EFI protocol to be requested by iPXE.

Parameters
_protocolEFI protocol name
_ptrPointer to protocol instance

Definition at line 118 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 138 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 142 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:128
#define __efi_config_table
Declare an EFI configuration table used by iPXE.
Definition: efi.h:142

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 150 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 163 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 171 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 275 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 283 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 289 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 295 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 301 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 307 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 313 of file efi.h.

◆ DBGC_EFI_OPENER

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

Definition at line 319 of file efi.h.

◆ DBGC_EFI_OPENERS

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

Definition at line 321 of file efi.h.

◆ DBGC_EFI_PROTOCOL

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

Definition at line 323 of file efi.h.

◆ DBGC_EFI_PROTOCOLS

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

Definition at line 325 of file efi.h.

◆ DBGC2_EFI_OPENER

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

Definition at line 328 of file efi.h.

◆ DBGC2_EFI_OPENERS

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

Definition at line 330 of file efi.h.

◆ DBGC2_EFI_PROTOCOL

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

Definition at line 332 of file efi.h.

◆ DBGC2_EFI_PROTOCOLS

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

Definition at line 334 of file efi.h.

◆ DBGCP_EFI_OPENER

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

Definition at line 337 of file efi.h.

◆ DBGCP_EFI_OPENERS

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

Definition at line 339 of file efi.h.

◆ DBGCP_EFI_PROTOCOL

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

Definition at line 341 of file efi.h.

◆ DBGCP_EFI_PROTOCOLS

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

Definition at line 343 of file efi.h.

◆ EFI_INTF_OP

#define EFI_INTF_OP   UNUSED_INTF_OP

Definition at line 350 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 254 of file efi_debug.c.

254  {
255  union {
256  union uuid uuid;
257  EFI_GUID guid;
258  } u;
259  unsigned int i;
260 
261  /* Sanity check */
262  if ( ! guid )
263  return NULL;
264 
265  /* Check for a match against well-known GUIDs */
266  for ( i = 0 ; i < ( sizeof ( efi_well_known_guids ) /
267  sizeof ( efi_well_known_guids[0] ) ) ; i++ ) {
269  sizeof ( *guid ) ) == 0 ) {
270  return efi_well_known_guids[i].name;
271  }
272  }
273 
274  /* Convert GUID to standard endianness */
275  memcpy ( &u.guid, guid, sizeof ( u.guid ) );
276  uuid_mangle ( &u.uuid );
277  return uuid_ntoa ( &u.uuid );
278 }
const char * name
Name.
Definition: efi_debug.c:85
128 bit buffer containing a unique identifier value.
Definition: Base.h:215
A universally unique ID.
Definition: uuid.h:15
static struct efi_well_known_guid efi_well_known_guids[]
Well-known GUIDs.
Definition: efi_debug.c:89
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:130
union @17 u
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_close_protocol_wrapper(), efi_create_event_ex_wrapper(), efi_file_get_info(), efi_file_path_uninstall(), efi_file_set_info(), 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_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_uninstall_multiple_protocol_interfaces_wrapper(), efi_uninstall_protocol_interface_wrapper(), efi_veto_close_protocol(), efivars_fetch(), efivars_find(), and snpnet_supported().

◆ 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 287 of file efi_debug.c.

287  {
288  static char buf[16];
289 
290  switch ( search_type ) {
291  case AllHandles : return "AllHandles";
292  case ByRegisterNotify: return "ByRegisterNotify";
293  case ByProtocol: return "ByProtocol";
294  default:
295  snprintf ( buf, sizeof ( buf ), "UNKNOWN<%d>", search_type );
296  return buf;
297  }
298 }
Retrieve all the handles in the handle database.
Definition: UefiSpec.h:1511
Retrieve the next handle fron a RegisterProtocolNotify() event.
Definition: UefiSpec.h:1515
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:1520

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 312 of file efi_debug.c.

312  {
313  static char attribute_chars[] = "HGTCDX";
314  static char name[ sizeof ( attribute_chars ) ];
315  char *tmp = name;
316  unsigned int i;
317 
318  for ( i = 0 ; i < ( sizeof ( attribute_chars ) - 1 ) ; i++ ) {
319  if ( attributes & ( 1 << i ) )
320  *(tmp++) = attribute_chars[i];
321  }
322  *tmp = '\0';
323 
324  return name;
325 }
const char * name
Definition: ath9k_hw.c:1984
unsigned long tmp
Definition: linux_pci.h:53

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 461 of file efi_debug.c.

461  {
463  static char text[512];
464  size_t len;
465  CHAR16 *wtext;
466 
467  /* Sanity checks */
468  if ( ! path ) {
469  DBG ( "[NULL DevicePath]" );
470  return NULL;
471  }
472 
473  /* If we have no DevicePathToText protocol then use a raw hex string */
474  if ( ! efidpt ) {
475  DBG ( "[No DevicePathToText]" );
476  len = efi_path_len ( path );
477  base16_encode ( path, len, text, sizeof ( text ) );
478  return text;
479  }
480 
481  /* Convert path to a textual representation */
482  wtext = efidpt->ConvertDevicePathToText ( path, FALSE, FALSE );
483  if ( ! wtext )
484  return NULL;
485 
486  /* Store path in buffer */
487  snprintf ( text, sizeof ( text ), "%ls", wtext );
488 
489  /* Free path */
490  bs->FreePool ( wtext );
491 
492  return text;
493 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2081
size_t efi_path_len(EFI_DEVICE_PATH_PROTOCOL *path)
Find length of device path (excluding terminator)
Definition: efi_path.c:144
unsigned short CHAR16
static EFI_DEVICE_PATH_TO_TEXT_PROTOCOL * efidpt
Device path to text protocol.
Definition: efi_debug.c:47
EFI Boot Services Table.
Definition: UefiSpec.h:1917
EFI_FREE_POOL FreePool
Definition: UefiSpec.h:1936
uint32_t len
Length.
Definition: ena.h:14
#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_autoexec_filesystem(), 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_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 808 of file efi_debug.c.

808  {
810  struct efi_handle_name_type *type;
811  static char buf[256];
812  size_t used = 0;
813  EFI_GUID **protocols;
814  UINTN count;
815  unsigned int i;
816  void *interface;
817  const char *name;
818  EFI_STATUS efirc;
819 
820  /* Fail immediately for NULL handles */
821  if ( ! handle )
822  return NULL;
823 
824  /* Try each name type in turn */
825  for ( i = 0 ; i < ( sizeof ( efi_handle_name_types ) /
826  sizeof ( efi_handle_name_types[0] ) ) ; i++ ) {
828  DBG2 ( "<%d", i );
829 
830  /* Try to open the applicable protocol */
831  efirc = bs->OpenProtocol ( handle, type->protocol, &interface,
834  if ( efirc != 0 ) {
835  DBG2 ( ">" );
836  continue;
837  }
838 
839  /* Try to get name from this protocol */
840  DBG2 ( "-" );
841  name = type->name ( interface );
842  DBG2 ( "%c", ( name ? ( name[0] ? 'Y' : 'E' ) : 'N' ) );
843 
844  /* Close protocol */
845  bs->CloseProtocol ( handle, type->protocol,
847  DBG2 ( ">" );
848 
849  /* Use this name, if possible */
850  if ( name && name[0] )
851  return name;
852  }
853 
854  /* If no name is found, then use the raw handle value and a
855  * list of installed protocols.
856  */
857  used = ssnprintf ( buf, sizeof ( buf ), "UNKNOWN<%p", handle );
858  if ( ( efirc = bs->ProtocolsPerHandle ( handle, &protocols,
859  &count ) ) == 0 ) {
860  for ( i = 0 ; i < count ; i++ ) {
861  used += ssnprintf ( ( buf + used ),
862  ( sizeof ( buf ) - used ), ",%s",
863  efi_guid_ntoa ( protocols[i] ) );
864  }
865  bs->FreePool ( protocols );
866  }
867  used += ssnprintf ( ( buf + used ), ( sizeof ( buf ) - used ), ">" );
868  return buf;
869 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2081
const char * name
Definition: ath9k_hw.c:1984
128 bit buffer containing a unique identifier value.
Definition: Base.h:215
EFI_CLOSE_PROTOCOL CloseProtocol
Definition: UefiSpec.h:1987
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
#define EFI_OPEN_PROTOCOL_GET_PROTOCOL
Definition: UefiSpec.h:1344
static struct efi_handle_name_type efi_handle_name_types[]
EFI handle name types.
Definition: efi_debug.c:772
const char * efi_guid_ntoa(CONST EFI_GUID *guid)
Convert GUID to a printable string.
Definition: efi_debug.c:254
EFI Boot Services Table.
Definition: UefiSpec.h:1917
EFI_HANDLE efi_image_handle
Image handle passed to entry point.
Definition: efi_init.c:34
UINT64 UINTN
Unsigned value of native width.
EFI_FREE_POOL FreePool
Definition: UefiSpec.h:1936
EFI_PROTOCOLS_PER_HANDLE ProtocolsPerHandle
Definition: UefiSpec.h:1993
uint32_t type
Operating system type.
Definition: ena.h:12
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
uint16_t count
Number of entries.
Definition: ena.h:22
An EFI handle name type.
Definition: efi_debug.c:747
EFI_SYSTEM_TABLE * efi_systab
EFI_OPEN_PROTOCOL OpenProtocol
Definition: UefiSpec.h:1986
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, EFI_BOOT_SERVICES::CloseProtocol, count, DBG2, efi_guid_ntoa(), efi_handle_name_types, efi_image_handle, EFI_OPEN_PROTOCOL_GET_PROTOCOL, efi_systab, EFI_BOOT_SERVICES::FreePool, handle, name, NULL, EFI_BOOT_SERVICES::OpenProtocol, EFI_BOOT_SERVICES::ProtocolsPerHandle, 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_startup(), efi_autoexec_tftp(), 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_controller_wrapper(), efi_device_info(), efi_disconnect_controller_wrapper(), efi_driver_connect(), 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_pci_info(), 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(), efipci_open(), efipci_root_match(), efipci_root_open(), efipci_start(), mnpnet_start(), nii_start(), snpnet_start(), snpnet_stop(), snpnet_supported(), usbio_bulk_in_poll(), usbio_bulk_out_poll(), usbio_config(), usbio_control_poll(), usbio_endpoint_open(), 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 334 of file efi_debug.c.

335  {
336 
337  printf ( "HANDLE %s %s opened %dx (%s)", efi_handle_name ( handle ),
338  efi_guid_ntoa ( protocol ), opener->OpenCount,
339  efi_open_attributes_name ( opener->Attributes ) );
340  printf ( " by %s", efi_handle_name ( opener->AgentHandle ) );
341  if ( opener->ControllerHandle == handle ) {
342  printf ( "\n" );
343  } else {
344  printf ( " for %s\n",
345  efi_handle_name ( opener->ControllerHandle ) );
346  }
347 }
int printf(const char *fmt,...)
Write a formatted string to the console.
Definition: vsprintf.c:464
EFI_HANDLE ControllerHandle
Definition: UefiSpec.h:1423
EFI_HANDLE AgentHandle
Definition: UefiSpec.h:1422
UINT32 OpenCount
Definition: UefiSpec.h:1425
UINT32 Attributes
Definition: UefiSpec.h:1424
const char * efi_handle_name(EFI_HANDLE handle)
Get name of an EFI handle.
Definition: efi_debug.c:808
const char * efi_guid_ntoa(CONST EFI_GUID *guid)
Convert GUID to a printable string.
Definition: efi_debug.c:254
const char * efi_open_attributes_name(unsigned int attributes)
Name protocol open attributes.
Definition: efi_debug.c:312
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 355 of file efi_debug.c.

355  {
358  UINTN count;
359  unsigned int i;
360  EFI_STATUS efirc;
361  int rc;
362 
363  /* Sanity check */
364  if ( ( ! handle ) || ( ! protocol ) ) {
365  printf ( "HANDLE %s could not retrieve openers for %s\n",
367  efi_guid_ntoa ( protocol ) );
368  return;
369  }
370 
371  /* Retrieve list of openers */
372  if ( ( efirc = bs->OpenProtocolInformation ( handle, protocol, &openers,
373  &count ) ) != 0 ) {
374  rc = -EEFI ( efirc );
375  printf ( "HANDLE %s could not retrieve openers for %s: %s\n",
377  efi_guid_ntoa ( protocol ), strerror ( rc ) );
378  return;
379  }
380 
381  /* Dump list of openers */
382  for ( i = 0 ; i < count ; i++ )
383  dbg_efi_opener ( handle, protocol, &openers[i] );
384 
385  /* Free list */
386  bs->FreePool ( openers );
387 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2081
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
EFI Oprn Protocol Information Entry.
Definition: UefiSpec.h:1421
#define EEFI(efirc)
Convert an EFI status code to an iPXE status code.
Definition: efi.h:171
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:334
const char * efi_handle_name(EFI_HANDLE handle)
Get name of an EFI handle.
Definition: efi_debug.c:808
const char * efi_guid_ntoa(CONST EFI_GUID *guid)
Convert GUID to a printable string.
Definition: efi_debug.c:254
char * strerror(int errno)
Retrieve string representation of error number.
Definition: strerror.c:78
EFI Boot Services Table.
Definition: UefiSpec.h:1917
UINT64 UINTN
Unsigned value of native width.
EFI_FREE_POOL FreePool
Definition: UefiSpec.h:1936
EFI_OPEN_PROTOCOL_INFORMATION OpenProtocolInformation
Definition: UefiSpec.h:1988
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
uint16_t count
Number of entries.
Definition: ena.h:22
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 395 of file efi_debug.c.

395  {
397  VOID *interface;
398  EFI_STATUS efirc;
399  int rc;
400 
401  /* Get protocol instance */
402  if ( ( efirc = bs->HandleProtocol ( handle, protocol,
403  &interface ) ) != 0 ) {
404  rc = -EEFI ( efirc );
405  printf ( "HANDLE %s could not identify %s: %s\n",
407  efi_guid_ntoa ( protocol ), strerror ( rc ) );
408  return;
409  }
410  printf ( "HANDLE %s %s at %p\n", efi_handle_name ( handle ),
412 
413  /* Dump list of openers */
415 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2081
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:171
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:355
An object interface.
Definition: interface.h:124
EFI_HANDLE_PROTOCOL HandleProtocol
Definition: UefiSpec.h:1954
const char * efi_handle_name(EFI_HANDLE handle)
Get name of an EFI handle.
Definition: efi_debug.c:808
const char * efi_guid_ntoa(CONST EFI_GUID *guid)
Convert GUID to a printable string.
Definition: efi_debug.c:254
char * strerror(int errno)
Retrieve string representation of error number.
Definition: strerror.c:78
EFI Boot Services Table.
Definition: UefiSpec.h:1917
#define VOID
Undeclared type.
Definition: Base.h:271
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, dbg_efi_openers(), EEFI, efi_guid_ntoa(), efi_handle_name(), efi_systab, handle, EFI_BOOT_SERVICES::HandleProtocol, 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 422 of file efi_debug.c.

422  {
424  EFI_GUID **protocols;
425  UINTN count;
426  unsigned int i;
427  EFI_STATUS efirc;
428  int rc;
429 
430  /* Sanity check */
431  if ( ! handle ) {
432  printf ( "HANDLE %p could not retrieve protocols\n", handle );
433  return;
434  }
435 
436  /* Retrieve list of protocols */
437  if ( ( efirc = bs->ProtocolsPerHandle ( handle, &protocols,
438  &count ) ) != 0 ) {
439  rc = -EEFI ( efirc );
440  printf ( "HANDLE %s could not retrieve protocols: %s\n",
441  efi_handle_name ( handle ), strerror ( rc ) );
442  return;
443  }
444 
445  /* Dump list of protocols */
446  for ( i = 0 ; i < count ; i++ ) {
447  dbg_efi_protocol ( handle, protocols[i] );
448  }
449 
450  /* Free list */
451  bs->FreePool ( protocols );
452 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2081
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:171
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:395
const char * efi_handle_name(EFI_HANDLE handle)
Get name of an EFI handle.
Definition: efi_debug.c:808
char * strerror(int errno)
Retrieve string representation of error number.
Definition: strerror.c:78
EFI Boot Services Table.
Definition: UefiSpec.h:1917
UINT64 UINTN
Unsigned value of native width.
EFI_FREE_POOL FreePool
Definition: UefiSpec.h:1936
EFI_PROTOCOLS_PER_HANDLE ProtocolsPerHandle
Definition: UefiSpec.h:1993
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
uint16_t count
Number of entries.
Definition: ena.h:22
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 131 of file efi_init.c.

131  {
132  unsigned long cookie = 0;
133  unsigned int rotation = ( 8 * sizeof ( cookie ) / 4 );
134 
135  /* There is no viable source of entropy available at this
136  * point. Construct a value that is at least likely to vary
137  * between platforms and invocations.
138  */
139  cookie ^= ( ( unsigned long ) handle );
140  cookie = roll ( cookie, rotation );
141  cookie ^= ( ( unsigned long ) &handle );
142  cookie = roll ( cookie, rotation );
143  cookie ^= profile_timestamp();
144  cookie = roll ( cookie, rotation );
145  cookie ^= build_id;
146 
147  /* Ensure that the value contains a NUL byte, to act as a
148  * runaway string terminator. Construct the NUL using a shift
149  * rather than a mask, to avoid losing valuable entropy in the
150  * lower-order bits.
151  */
152  cookie <<= 8;
153 
154  /* Ensure that the NUL byte is placed at the bottom of the
155  * stack cookie, to avoid potential disclosure via an
156  * unterminated string.
157  */
158  if ( __BYTE_ORDER == __BIG_ENDIAN )
159  cookie >>= 8;
160 
161  return cookie;
162 }
#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
uint16_t handle
Handle.
Definition: smbios.h:16

References __BIG_ENDIAN, __BYTE_ORDER, build_id, handle, and rotation.

Referenced by efi_init_stack_guard().

◆ __stack_chk_fail()

void __stack_chk_fail ( void  )

Abort on stack check failure.

Definition at line 372 of file efi_init.c.

372  {
373  EFI_STATUS efirc;
374  int rc;
375 
376  /* Report failure (when debugging) */
377  DBGC ( efi_systab, "EFI stack check failed (cookie %#lx); aborting\n",
379 
380  /* Attempt to exit cleanly with an error status */
381  if ( efi_exit ) {
383  0, NULL );
384  rc = -EEFI ( efirc );
385  DBGC ( efi_systab, "EFI stack check exit failed: %s\n",
386  strerror ( rc ) );
387  }
388 
389  /* If the exit fails for any reason, lock the system */
390  while ( 1 ) {}
391 
392 }
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:171
#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:34
unsigned long __stack_chk_guard
Stack cookie.
Definition: efi_init.c:64
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:71
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 363 of file efi.h.

363  {
364 
365  /* The calling function must not itself use stack protection,
366  * since the change in the stack guard value would trigger a
367  * false positive.
368  *
369  * There is unfortunately no way to annotate a function to
370  * exclude the use of stack protection. We must therefore
371  * rely on correctly anticipating the compiler's decision on
372  * the use of stack protection.
373  *
374  * The calculation of the stack cookie value deliberately
375  * takes the address of a stack variable (to provide an
376  * additional source of entropy). This operation would
377  * trigger the application of stack protection to the calling
378  * function, and so must be externalised.
379  */
381 }
unsigned long __stack_chk_guard
Stack cookie.
Definition: efi_init.c:64
unsigned long efi_stack_cookie(EFI_HANDLE handle)
Construct a stack cookie value.
Definition: efi_init.c:131
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 171 of file efi_init.c.

172  {
173  EFI_BOOT_SERVICES *bs;
174  struct efi_protocol *prot;
175  struct efi_config_table *tab;
176  void *loaded_image;
177  void *device_path;
178  void *device_path_copy;
179  size_t device_path_len;
180  EFI_STATUS efirc;
181  int rc;
182 
183  /* Store image handle and system table pointer for future use */
184  efi_image_handle = image_handle;
185  efi_systab = systab;
186 
187  /* Sanity checks */
188  if ( ! systab ) {
189  efirc = EFI_NOT_AVAILABLE_YET;
190  goto err_sanity;
191  }
192  if ( ! systab->ConOut ) {
193  efirc = EFI_NOT_AVAILABLE_YET;
194  goto err_sanity;
195  }
196  if ( ! systab->BootServices ) {
197  DBGC ( systab, "EFI provided no BootServices entry point\n" );
198  efirc = EFI_NOT_AVAILABLE_YET;
199  goto err_sanity;
200  }
201  if ( ! systab->RuntimeServices ) {
202  DBGC ( systab, "EFI provided no RuntimeServices entry "
203  "point\n" );
204  efirc = EFI_NOT_AVAILABLE_YET;
205  goto err_sanity;
206  }
207  DBGC ( systab, "EFI handle %p systab %p\n", image_handle, systab );
208  bs = systab->BootServices;
209 
210  /* Store abort function pointer */
211  efi_exit = bs->Exit;
212 
213  /* Look up used protocols */
215  if ( ( efirc = bs->LocateProtocol ( &prot->guid, NULL,
216  prot->protocol ) ) == 0 ) {
217  DBGC ( systab, "EFI protocol %s is at %p\n",
218  efi_guid_ntoa ( &prot->guid ),
219  *(prot->protocol) );
220  } else {
221  DBGC ( systab, "EFI does not provide protocol %s\n",
222  efi_guid_ntoa ( &prot->guid ) );
223  /* Fail if protocol is required */
224  if ( prot->required )
225  goto err_missing_protocol;
226  }
227  }
228 
229  /* Look up used configuration tables */
231  if ( ( *(tab->table) = efi_find_table ( &tab->guid ) ) ) {
232  DBGC ( systab, "EFI configuration table %s is at %p\n",
233  efi_guid_ntoa ( &tab->guid ), *(tab->table) );
234  } else {
235  DBGC ( systab, "EFI does not provide configuration "
236  "table %s\n", efi_guid_ntoa ( &tab->guid ) );
237  if ( tab->required ) {
238  efirc = EFI_NOT_AVAILABLE_YET;
239  goto err_missing_table;
240  }
241  }
242  }
243 
244  /* Get loaded image protocol */
245  if ( ( efirc = bs->OpenProtocol ( image_handle,
247  &loaded_image, image_handle, NULL,
248  EFI_OPEN_PROTOCOL_GET_PROTOCOL ) ) != 0 ) {
249  rc = -EEFI ( efirc );
250  DBGC ( systab, "EFI could not get loaded image protocol: %s",
251  strerror ( rc ) );
252  goto err_no_loaded_image;
253  }
254  efi_loaded_image = loaded_image;
255  DBGC ( systab, "EFI image base address %p\n",
257 
258  /* Record command line */
261 
262  /* Get loaded image's device handle's device path */
263  if ( ( efirc = bs->OpenProtocol ( efi_loaded_image->DeviceHandle,
265  &device_path, image_handle, NULL,
266  EFI_OPEN_PROTOCOL_GET_PROTOCOL ) ) != 0 ) {
267  rc = -EEFI ( efirc );
268  DBGC ( systab, "EFI could not get loaded image's device path: "
269  "%s", strerror ( rc ) );
270  goto err_no_device_path;
271  }
272 
273  /* Make a copy of the loaded image's device handle's device
274  * path, since the device handle itself may become invalidated
275  * when we load our own drivers.
276  */
277  device_path_len = ( efi_path_len ( device_path ) +
278  sizeof ( EFI_DEVICE_PATH_PROTOCOL ) );
279  if ( ( efirc = bs->AllocatePool ( EfiBootServicesData, device_path_len,
280  &device_path_copy ) ) != 0 ) {
281  rc = -EEFI ( efirc );
282  goto err_alloc_device_path;
283  }
284  memcpy ( device_path_copy, device_path, device_path_len );
285  efi_loaded_image_path = device_path_copy;
286  DBGC ( systab, "EFI image device path %s\n",
288 
289  /* EFI is perfectly capable of gracefully shutting down any
290  * loaded devices if it decides to fall back to a legacy boot.
291  * For no particularly comprehensible reason, it doesn't
292  * bother doing so when ExitBootServices() is called.
293  */
294  if ( ( efirc = bs->CreateEvent ( EVT_SIGNAL_EXIT_BOOT_SERVICES,
296  NULL, &efi_shutdown_event ) ) != 0 ) {
297  rc = -EEFI ( efirc );
298  DBGC ( systab, "EFI could not create ExitBootServices event: "
299  "%s\n", strerror ( rc ) );
300  goto err_create_event;
301  }
302 
303  /* Install driver binding protocol */
304  if ( ( rc = efi_driver_install() ) != 0 ) {
305  DBGC ( systab, "EFI could not install driver: %s\n",
306  strerror ( rc ) );
307  efirc = EFIRC ( rc );
308  goto err_driver_install;
309  }
310 
311  /* Install image unload method */
313 
314  return 0;
315 
317  err_driver_install:
319  err_create_event:
321  err_alloc_device_path:
322  err_no_device_path:
323  err_no_loaded_image:
324  err_missing_table:
325  err_missing_protocol:
326  err_sanity:
327  return efirc;
328 }
void efi_driver_uninstall(void)
Uninstall EFI driver.
Definition: efi_driver.c:424
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:2081
void ** protocol
Variable containing pointer to protocol structure.
Definition: efi.h:88
EFI_LOADED_IMAGE_PROTOCOL * efi_loaded_image
Loaded image protocol for this image.
Definition: efi_init.c:37
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:171
const wchar_t * efi_cmdline
EFI command line (may not be wNUL-terminated.
Definition: efi_cmdline.c:43
EFI_LOCATE_PROTOCOL LocateProtocol
Definition: UefiSpec.h:1995
EFI_GUID guid
GUID.
Definition: efi.h:86
#define DBGC(...)
Definition: compiler.h:505
EFI_GUID efi_loaded_image_protocol_guid
Loaded image protocol GUID.
Definition: efi_guid.c:243
size_t efi_path_len(EFI_DEVICE_PATH_PROTOCOL *path)
Find length of device path (excluding terminator)
Definition: efi_path.c:144
EFI_CLOSE_EVENT CloseEvent
Definition: UefiSpec.h:1945
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:639
#define EFI_PROTOCOLS
EFI protocol table.
Definition: efi.h:94
#define EVT_SIGNAL_EXIT_BOOT_SERVICES
Definition: UefiSpec.h:445
#define EFI_CONFIG_TABLES
EFI configuration table table.
Definition: efi.h:138
An EFI configuration table used by iPXE.
Definition: efi.h:128
EFI_DEVICE_PATH_PROTOCOL * efi_loaded_image_path
Device path for the loaded image's device handle.
Definition: efi_init.c:40
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:49
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL * ConOut
A pointer to the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL interface that is associated with ConsoleOutHandle.
Definition: UefiSpec.h:2063
static EFI_EVENT efi_shutdown_event
Event used to signal shutdown.
Definition: efi_init.c:61
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:83
EFI_CREATE_EVENT CreateEvent
Definition: UefiSpec.h:1941
static void * efi_find_table(EFI_GUID *guid)
Look up EFI configuration table.
Definition: efi_init.c:112
const char * efi_devpath_text(EFI_DEVICE_PATH_PROTOCOL *path)
Get textual representation of device path.
Definition: efi_debug.c:461
VOID * LoadOptions
A pointer to the image's binary load options.
Definition: LoadedImage.h:64
#define EFI_OPEN_PROTOCOL_GET_PROTOCOL
Definition: UefiSpec.h:1344
An EFI protocol used by iPXE.
Definition: efi.h:84
const char * efi_guid_ntoa(CONST EFI_GUID *guid)
Convert GUID to a printable string.
Definition: efi_debug.c:254
char * strerror(int errno)
Retrieve string representation of error number.
Definition: strerror.c:78
EFI Boot Services Table.
Definition: UefiSpec.h:1917
EFI_HANDLE efi_image_handle
Image handle passed to entry point.
Definition: efi_init.c:34
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
EFI_GUID efi_device_path_protocol_guid
Device path protocol GUID.
Definition: efi_guid.c:143
EFI_FREE_POOL FreePool
Definition: UefiSpec.h:1936
void ** table
Variable containing pointer to configuration table.
Definition: efi.h:132
UINT32 LoadOptionsSize
The size in bytes of LoadOptions.
Definition: LoadedImage.h:63
int required
Protocol is required.
Definition: efi.h:90
EFI_RUNTIME_SERVICES * RuntimeServices
A pointer to the EFI Runtime Services Table.
Definition: UefiSpec.h:2077
EFI_GUID guid
GUID.
Definition: efi.h:130
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:71
EFI_SYSTEM_TABLE * efi_systab
EFI_OPEN_PROTOCOL OpenProtocol
Definition: UefiSpec.h:1986
size_t efi_cmdline_len
Length of EFI command line (in bytes)
Definition: efi_cmdline.c:46
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:134
static EFI_STATUS EFIAPI efi_unload(EFI_HANDLE image_handle)
Shut down EFI environment.
Definition: efi_init.c:335
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321
int efi_driver_install(void)
Install EFI driver.
Definition: efi_driver.c:391
#define EFIRC(rc)
Convert an iPXE status code to an EFI status code.
Definition: efi.h:163
EFI_HANDLE DeviceHandle
The device handle that the EFI Image was loaded from.
Definition: LoadedImage.h:55
EFI_ALLOCATE_POOL AllocatePool
Definition: UefiSpec.h:1935

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_PROTOCOL_GET_PROTOCOL, 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_BOOT_SERVICES::OpenProtocol, 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 399 of file efi_init.c.

399  {
401 
402  /* Record current external TPL */
403  tpl->previous = efi_external_tpl;
404 
405  /* Raise TPL and record previous TPL as new external TPL */
406  tpl->current = bs->RaiseTPL ( efi_internal_tpl );
407  efi_external_tpl = tpl->current;
408 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2081
EFI_RAISE_TPL RaiseTPL
Definition: UefiSpec.h:1926
EFI_TPL efi_internal_tpl
Internal task priority level.
Definition: efi_init.c:52
EFI_TPL current
Current external TPL.
Definition: efi.h:78
EFI Boot Services Table.
Definition: UefiSpec.h:1917
EFI_TPL previous
Previous external TPL.
Definition: efi.h:80
EFI_SYSTEM_TABLE * efi_systab
EFI_TPL efi_external_tpl
External task priority level.
Definition: efi_init.c:55

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 415 of file efi_init.c.

415  {
417 
418  /* Restore external TPL */
419  efi_external_tpl = tpl->previous;
420 
421  /* Restore TPL */
422  bs->RestoreTPL ( tpl->current );
423 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2081
EFI_TPL current
Current external TPL.
Definition: efi.h:78
EFI Boot Services Table.
Definition: UefiSpec.h:1917
EFI_TPL previous
Previous external TPL.
Definition: efi.h:80
EFI_SYSTEM_TABLE * efi_systab
EFI_RESTORE_TPL RestoreTPL
Definition: UefiSpec.h:1927
EFI_TPL efi_external_tpl
External task priority level.
Definition: efi_init.c:55

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

Variable Documentation

◆ efi_absolute_pointer_protocol_guid

EFI_GUID efi_absolute_pointer_protocol_guid

Absolute pointer protocol GUID.

Definition at line 99 of file efi_guid.c.

◆ efi_acpi_table_protocol_guid

EFI_GUID efi_acpi_table_protocol_guid

ACPI table protocol GUID.

Definition at line 103 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 107 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 111 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 115 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 119 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 123 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 127 of file efi_guid.c.

◆ efi_component_name_protocol_guid

EFI_GUID efi_component_name_protocol_guid

Component name protocol GUID.

Definition at line 131 of file efi_guid.c.

Referenced by efi_veto_find().

◆ efi_component_name2_protocol_guid

EFI_GUID efi_component_name2_protocol_guid

Component name 2 protocol GUID.

Definition at line 135 of file efi_guid.c.

Referenced by efi_driver_controller_name(), efi_driver_install(), efi_driver_uninstall(), efi_snp_probe(), and efi_snp_remove().

◆ efi_console_control_protocol_guid

EFI_GUID efi_console_control_protocol_guid

Console control protocol GUID.

Definition at line 139 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 147 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 151 of file efi_guid.c.

◆ efi_dhcp6_protocol_guid

EFI_GUID efi_dhcp6_protocol_guid

DHCPv6 protocol GUID.

Definition at line 155 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 159 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 163 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 167 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 171 of file efi_guid.c.

◆ efi_dns6_protocol_guid

EFI_GUID efi_dns6_protocol_guid

DNSv6 protocol GUID.

Definition at line 175 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 179 of file efi_guid.c.

◆ efi_driver_binding_protocol_guid

EFI_GUID efi_driver_binding_protocol_guid

Driver binding protocol GUID.

Definition at line 183 of file efi_guid.c.

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

◆ efi_graphics_output_protocol_guid

EFI_GUID efi_graphics_output_protocol_guid

Graphics output protocol GUID.

Definition at line 187 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 191 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 195 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 199 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 203 of file efi_guid.c.

◆ efi_ip4_protocol_guid

EFI_GUID efi_ip4_protocol_guid

IPv4 protocol GUID.

Definition at line 207 of file efi_guid.c.

◆ efi_ip4_config_protocol_guid

EFI_GUID efi_ip4_config_protocol_guid

IPv4 configuration protocol GUID.

Definition at line 211 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 215 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 219 of file efi_guid.c.

◆ efi_ip6_protocol_guid

EFI_GUID efi_ip6_protocol_guid

IPv6 protocol GUID.

Definition at line 223 of file efi_guid.c.

◆ efi_ip6_config_protocol_guid

EFI_GUID efi_ip6_config_protocol_guid

IPv6 configuration protocol GUID.

Definition at line 227 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 231 of file efi_guid.c.

◆ efi_load_file_protocol_guid

EFI_GUID efi_load_file_protocol_guid

Load file protocol GUID.

Definition at line 235 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 239 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 243 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 247 of file efi_guid.c.

◆ efi_managed_network_protocol_guid

EFI_GUID efi_managed_network_protocol_guid

Managed network protocol GUID.

Definition at line 251 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 255 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 259 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 263 of file efi_guid.c.

◆ efi_mtftp6_protocol_guid

EFI_GUID efi_mtftp6_protocol_guid

MTFTPv6 protocol GUID.

Definition at line 267 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 271 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 275 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 279 of file efi_guid.c.

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

◆ efi_pci_io_protocol_guid

EFI_GUID efi_pci_io_protocol_guid

PCI I/O protocol GUID.

Definition at line 283 of file efi_guid.c.

Referenced by efi_pci_info(), efipci_close(), efipci_open(), efipci_start(), nii_pci_close(), and nii_pci_open().

◆ 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 287 of file efi_guid.c.

Referenced by efipci_root_close(), 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 291 of file efi_guid.c.

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

◆ efi_serial_io_protocol_guid

EFI_GUID efi_serial_io_protocol_guid

Serial I/O protocol GUID.

Definition at line 295 of file efi_guid.c.

◆ efi_shim_lock_protocol_guid

EFI_GUID efi_shim_lock_protocol_guid

Shim lock protocol GUID.

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

◆ efi_simple_network_protocol_guid

EFI_GUID efi_simple_network_protocol_guid

Simple network protocol GUID.

Definition at line 307 of file efi_guid.c.

Referenced by efi_set_autoboot_ll_addr(), efi_snp_probe(), efi_snp_remove(), snp_supported(), snpnet_start(), and snpnet_stop().

◆ efi_simple_pointer_protocol_guid

EFI_GUID efi_simple_pointer_protocol_guid

Simple pointer protocol GUID.

Definition at line 311 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 315 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 319 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 323 of file efi_guid.c.

◆ efi_tcg_protocol_guid

EFI_GUID efi_tcg_protocol_guid

TCG protocol GUID.

Definition at line 327 of file efi_guid.c.

◆ efi_tcp4_protocol_guid

EFI_GUID efi_tcp4_protocol_guid

TCPv4 protocol GUID.

Definition at line 331 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 335 of file efi_guid.c.

◆ efi_tcp6_protocol_guid

EFI_GUID efi_tcp6_protocol_guid

TCPv6 protocol GUID.

Definition at line 339 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 343 of file efi_guid.c.

◆ efi_tree_protocol_guid

EFI_GUID efi_tree_protocol_guid

TrEE protocol GUID.

Definition at line 347 of file efi_guid.c.

◆ efi_udp4_protocol_guid

EFI_GUID efi_udp4_protocol_guid

UDPv4 protocol GUID.

Definition at line 351 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 355 of file efi_guid.c.

◆ efi_udp6_protocol_guid

EFI_GUID efi_udp6_protocol_guid

UDPv6 protocol GUID.

Definition at line 359 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 363 of file efi_guid.c.

◆ efi_uga_draw_protocol_guid

EFI_GUID efi_uga_draw_protocol_guid

UGA draw protocol GUID.

Definition at line 367 of file efi_guid.c.

◆ efi_unicode_collation_protocol_guid

EFI_GUID efi_unicode_collation_protocol_guid

Unicode collation protocol GUID.

Definition at line 371 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 375 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 379 of file efi_guid.c.

◆ efi_usb_io_protocol_guid

EFI_GUID efi_usb_io_protocol_guid

USB I/O protocol GUID.

Definition at line 383 of file efi_guid.c.

Referenced by efi_usb_install(), efi_usb_uninstall(), usbio_close(), usbio_open(), usbio_start(), usbio_stop(), and usbio_supported().

◆ efi_vlan_config_protocol_guid

EFI_GUID efi_vlan_config_protocol_guid

VLAN configuration protocol GUID.

Definition at line 387 of file efi_guid.c.

Referenced by efi_snp_probe(), and efi_snp_remove().

◆ efi_file_info_id

EFI_GUID efi_file_info_id

File information GUID.

Definition at line 390 of file efi_guid.c.

Referenced by efi_autoexec_filesystem(), 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 393 of file efi_guid.c.

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

◆ efi_image_handle

EFI_HANDLE efi_image_handle

◆ efi_loaded_image

EFI_LOADED_IMAGE_PROTOCOL* efi_loaded_image

Loaded image protocol for this image.

Definition at line 37 of file efi_init.c.

Referenced by _efi_start(), chained_locate(), efi_autoexec_startup(), efi_init(), efi_init_application(), and efi_local_open_path().

◆ efi_loaded_image_path

EFI_DEVICE_PATH_PROTOCOL* efi_loaded_image_path

Device path for the loaded image's device handle.

Definition at line 40 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(), chained_locate(), chained_supported(), dbg_efi_openers(), dbg_efi_protocol(), dbg_efi_protocols(), efi_allocate_pages_wrapper(), efi_allocate_pool_wrapper(), efi_autoexec_filesystem(), efi_autoexec_startup(), efi_autoexec_tftp(), efi_block_boot(), efi_block_connect(), efi_block_exec(), efi_block_hook(), efi_block_local(), efi_block_match(), efi_block_root(), efi_block_scan(), efi_block_unhook(), efi_bofm_start(), efi_bofm_supported(), efi_cachedhcp_record(), efi_check_event_wrapper(), efi_child_add(), efi_child_del(), efi_close_event_wrapper(), efi_close_protocol_wrapper(), efi_conin_name(), efi_connect_controller_wrapper(), efi_conout_name(), efi_console_init(), efi_create_event_ex_wrapper(), efi_create_event_wrapper(), efi_currticks(), efi_devpath_text(), efi_disconnect_controller_wrapper(), efi_download_install(), efi_download_uninstall(), efi_driver_connect(), efi_driver_controller_name(), efi_driver_disconnect(), efi_driver_handles(), efi_driver_install(), efi_driver_reconnect(), efi_driver_start(), efi_driver_uninstall(), efi_dump_image(), efi_entropy_disable(), efi_entropy_enable(), efi_entropy_tick(), efi_exit_boot_services_wrapper(), efi_exit_wrapper(), 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_time(), 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_iskey(), efi_load_image_wrapper(), 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_locate_protocol_wrapper(), efi_open_protocol_information_wrapper(), efi_open_protocol_wrapper(), efi_poweroff(), 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_restore_tpl(), efi_restore_tpl_wrapper(), efi_service_add(), efi_service_del(), efi_set_autoboot_ll_addr(), efi_set_timer_wrapper(), efi_set_watchdog_timer_wrapper(), efi_shim_get_memory_map(), efi_shim_inhibit_pxe(), 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_unload(), efi_unload_image_wrapper(), 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_probe(), efi_usb_uninstall(), efi_veto(), efi_veto_close(), efi_veto_close_handle(), efi_veto_close_protocol(), efi_veto_disconnect(), efi_veto_find(), efi_veto_uninstall(), efi_veto_unload(), efi_vlan_find(), efi_wait_for_event_wrapper(), efi_watchdog_expired(), efi_watchdog_shutdown(), efi_wrap(), efi_wrap_bs(), efifb_draw(), efifb_init(), efifb_select_mode(), efipci_close(), efipci_open(), efipci_root_close(), efipci_root_open(), efivars_fetch(), efivars_find(), mnpnet_close(), mnpnet_open(), mnpnet_poll_rx(), mnpnet_start(), mnpnet_stop(), nii_block(), nii_issue_cpb_db(), nii_pci_close(), nii_pci_open(), nii_start(), nii_stop(), snpnet_start(), snpnet_stop(), snpnet_supported(), usbio_close(), usbio_open(), usbio_path(), usbio_start(), usbio_stop(), and usbio_supported().

◆ efi_internal_tpl

EFI_TPL efi_internal_tpl

Internal task priority level.

Definition at line 52 of file efi_init.c.

Referenced by efi_currticks(), 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 55 of file efi_init.c.

Referenced by efi_currticks(), 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 64 of file efi_init.c.

Referenced by __stack_chk_fail(), and efi_init_stack_guard().