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 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_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_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_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_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_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_disk_io_protocol_guid
 Disk I/O 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_ip4_protocol_guid
 IPv4 protocol GUID. More...
 
EFI_GUID efi_ip4_config_protocol_guid
 IPv4 configuration protocol GUID. More...
 
EFI_GUID efi_ip4_service_binding_protocol_guid
 IPv4 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_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_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_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_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 47 of file efi.h.

◆ EFI_PROTOCOLS

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

EFI protocol table.

Definition at line 85 of file efi.h.

◆ __efi_protocol

#define __efi_protocol   __table_entry ( EFI_PROTOCOLS, 01 )

Declare an EFI protocol used by iPXE.

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

Declare an EFI protocol to be required by iPXE.

Parameters
_protocolEFI protocol name
_ptrPointer to protocol instance

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

Declare an EFI protocol to be requested by iPXE.

Parameters
_protocolEFI protocol name
_ptrPointer to protocol instance

Definition at line 109 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 129 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 133 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:119
#define __efi_config_table
Declare an EFI configuration table used by iPXE.
Definition: efi.h:133

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 141 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 154 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 162 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 246 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 254 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 260 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 266 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 272 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 278 of file efi.h.

◆ DBGC_EFI_OPENER

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

Definition at line 284 of file efi.h.

◆ DBGC_EFI_OPENERS

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

Definition at line 286 of file efi.h.

◆ DBGC_EFI_PROTOCOLS

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

Definition at line 288 of file efi.h.

◆ DBGC2_EFI_OPENER

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

Definition at line 291 of file efi.h.

◆ DBGC2_EFI_OPENERS

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

Definition at line 293 of file efi.h.

◆ DBGC2_EFI_PROTOCOLS

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

Definition at line 295 of file efi.h.

◆ DBGCP_EFI_OPENER

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

Definition at line 298 of file efi.h.

◆ DBGCP_EFI_OPENERS

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

Definition at line 300 of file efi.h.

◆ DBGCP_EFI_PROTOCOLS

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

Definition at line 302 of file efi.h.

◆ EFI_INTF_OP

#define EFI_INTF_OP   UNUSED_INTF_OP

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

192  {
193  union {
194  union uuid uuid;
195  EFI_GUID guid;
196  } u;
197  unsigned int i;
198 
199  /* Sanity check */
200  if ( ! guid )
201  return NULL;
202 
203  /* Check for a match against well-known GUIDs */
204  for ( i = 0 ; i < ( sizeof ( efi_well_known_guids ) /
205  sizeof ( efi_well_known_guids[0] ) ) ; i++ ) {
207  sizeof ( *guid ) ) == 0 ) {
208  return efi_well_known_guids[i].name;
209  }
210  }
211 
212  /* Convert GUID to standard endianness */
213  memcpy ( &u.guid, guid, sizeof ( u.guid ) );
214  uuid_mangle ( &u.uuid );
215  return uuid_ntoa ( &u.uuid );
216 }
const char * name
Name.
Definition: efi_debug.c:67
128 bit buffer containing a unique identifier value.
Definition: Base.h:263
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:71
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:43
uint64_t guid
GUID.
Definition: edd.h:30
EFI_GUID guid
GUID.
Definition: efi.h:121
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:362

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_protocols(), efi_close_protocol_wrapper(), efi_create_event_ex_wrapper(), efi_file_get_info(), 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_uninstall_multiple_protocol_interfaces_wrapper(), efi_uninstall_protocol_interface_wrapper(), and efi_veto_close_protocol().

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

225  {
226  static char buf[16];
227 
228  switch ( search_type ) {
229  case AllHandles : return "AllHandles";
230  case ByRegisterNotify: return "ByRegisterNotify";
231  case ByProtocol: return "ByProtocol";
232  default:
233  snprintf ( buf, sizeof ( buf ), "UNKNOWN<%d>", search_type );
234  return buf;
235  }
236 }
Retrieve all the handles in the handle database.
Definition: UefiSpec.h:1439
Retrieve the next handle fron a RegisterProtocolNotify() event.
Definition: UefiSpec.h:1443
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:1448

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

250  {
251  static char attribute_chars[] = "HGTCDX";
252  static char name[ sizeof ( attribute_chars ) ];
253  char *tmp = name;
254  unsigned int i;
255 
256  for ( i = 0 ; i < ( sizeof ( attribute_chars ) - 1 ) ; i++ ) {
257  if ( attributes & ( 1 << i ) )
258  *(tmp++) = attribute_chars[i];
259  }
260  *tmp = '\0';
261 
262  return name;
263 }
const char * name
Definition: ath9k_hw.c:1984
uint8_t * tmp
Definition: entropy.h:156

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

375  {
377  static char text[512];
378  size_t len;
379  CHAR16 *wtext;
380 
381  /* Sanity checks */
382  if ( ! path ) {
383  DBG ( "[NULL DevicePath]" );
384  return NULL;
385  }
386 
387  /* If we have no DevicePathToText protocol then use a raw hex string */
388  if ( ! efidpt ) {
389  DBG ( "[No DevicePathToText]" );
390  len = efi_path_len ( path );
391  base16_encode ( path, len, text, sizeof ( text ) );
392  return text;
393  }
394 
395  /* Convert path to a textual representation */
396  wtext = efidpt->ConvertDevicePathToText ( path, TRUE, FALSE );
397  if ( ! wtext )
398  return NULL;
399 
400  /* Store path in buffer */
401  snprintf ( text, sizeof ( text ), "%ls", wtext );
402 
403  /* Free path */
404  bs->FreePool ( wtext );
405 
406  return text;
407 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2000
size_t efi_path_len(EFI_DEVICE_PATH_PROTOCOL *path)
Find length of device path (excluding terminator)
Definition: efi_path.c:67
unsigned short CHAR16
Definition: ProcessorBind.h:59
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:1836
EFI_FREE_POOL FreePool
Definition: UefiSpec.h:1855
#define TRUE
Definition: tlan.h:46
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:362

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, snprintf(), and TRUE.

Referenced by efi_block_boot_image(), efi_block_hook(), efi_connect_controller_wrapper(), efi_driver_start(), efi_driver_supported(), efi_dump_image(), efi_init(), efi_load_image_wrapper(), efi_loaded_image_filepath_name(), efi_local_open_volume(), efi_locate_device_path_wrapper(), 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 722 of file efi_debug.c.

722  {
724  struct efi_handle_name_type *type;
725  static char buf[256];
726  size_t used = 0;
727  EFI_GUID **protocols;
728  UINTN count;
729  unsigned int i;
730  void *interface;
731  const char *name;
732  EFI_STATUS efirc;
733 
734  /* Fail immediately for NULL handles */
735  if ( ! handle )
736  return NULL;
737 
738  /* Try each name type in turn */
739  for ( i = 0 ; i < ( sizeof ( efi_handle_name_types ) /
740  sizeof ( efi_handle_name_types[0] ) ) ; i++ ) {
742  DBG2 ( "<%d", i );
743 
744  /* Try to open the applicable protocol */
745  efirc = bs->OpenProtocol ( handle, type->protocol, &interface,
748  if ( efirc != 0 ) {
749  DBG2 ( ">" );
750  continue;
751  }
752 
753  /* Try to get name from this protocol */
754  DBG2 ( "-" );
755  name = type->name ( interface );
756  DBG2 ( "%c", ( name ? ( name[0] ? 'Y' : 'E' ) : 'N' ) );
757 
758  /* Close protocol */
759  bs->CloseProtocol ( handle, type->protocol,
761  DBG2 ( ">" );
762 
763  /* Use this name, if possible */
764  if ( name && name[0] )
765  return name;
766  }
767 
768  /* If no name is found, then use the raw handle value and a
769  * list of installed protocols.
770  */
771  used = ssnprintf ( buf, sizeof ( buf ), "UNKNOWN<%p", handle );
772  if ( ( efirc = bs->ProtocolsPerHandle ( handle, &protocols,
773  &count ) ) == 0 ) {
774  for ( i = 0 ; i < count ; i++ ) {
775  used += ssnprintf ( ( buf + used ),
776  ( sizeof ( buf ) - used ), ",%s",
777  efi_guid_ntoa ( protocols[i] ) );
778  }
779  bs->FreePool ( protocols );
780  }
781  used += ssnprintf ( ( buf + used ), ( sizeof ( buf ) - used ), ">" );
782  return buf;
783 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2000
const char * name
Definition: ath9k_hw.c:1984
128 bit buffer containing a unique identifier value.
Definition: Base.h:263
uint8_t type
Type.
Definition: ena.h:16
EFI_CLOSE_PROTOCOL CloseProtocol
Definition: UefiSpec.h:1906
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:1271
static struct efi_handle_name_type efi_handle_name_types[]
EFI handle name types.
Definition: efi_debug.c:686
const char * efi_guid_ntoa(CONST EFI_GUID *guid)
Convert GUID to a printable string.
Definition: efi_debug.c:192
EFI Boot Services Table.
Definition: UefiSpec.h:1836
EFI_HANDLE efi_image_handle
Image handle passed to entry point.
Definition: efi_init.c:33
UINT64 UINTN
Unsigned value of native width.
Definition: ProcessorBind.h:71
EFI_FREE_POOL FreePool
Definition: UefiSpec.h:1855
EFI_PROTOCOLS_PER_HANDLE ProtocolsPerHandle
Definition: UefiSpec.h:1912
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:35
uint16_t count
Number of entries.
Definition: ena.h:22
An EFI handle name type.
Definition: efi_debug.c:661
EFI_SYSTEM_TABLE * efi_systab
EFI_OPEN_PROTOCOL OpenProtocol
Definition: UefiSpec.h:1905
uint16_t handle
Handle.
Definition: smbios.h:16
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362
#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_protocols(), efi_autoexec_filesystem(), efi_autoexec_startup(), efi_autoexec_tftp(), 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_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_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(), nii_start(), nii_supported(), snp_supported(), snpnet_start(), snpnet_stop(), 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 272 of file efi_debug.c.

273  {
274 
275  printf ( "HANDLE %s %s opened %dx (%s)", efi_handle_name ( handle ),
276  efi_guid_ntoa ( protocol ), opener->OpenCount,
277  efi_open_attributes_name ( opener->Attributes ) );
278  printf ( " by %s", efi_handle_name ( opener->AgentHandle ) );
279  if ( opener->ControllerHandle == handle ) {
280  printf ( "\n" );
281  } else {
282  printf ( " for %s\n",
283  efi_handle_name ( opener->ControllerHandle ) );
284  }
285 }
int printf(const char *fmt,...)
Write a formatted string to the console.
Definition: vsprintf.c:464
EFI_HANDLE ControllerHandle
Definition: UefiSpec.h:1351
EFI_HANDLE AgentHandle
Definition: UefiSpec.h:1350
UINT32 OpenCount
Definition: UefiSpec.h:1353
UINT32 Attributes
Definition: UefiSpec.h:1352
const char * efi_handle_name(EFI_HANDLE handle)
Get name of an EFI handle.
Definition: efi_debug.c:722
const char * efi_guid_ntoa(CONST EFI_GUID *guid)
Convert GUID to a printable string.
Definition: efi_debug.c:192
const char * efi_open_attributes_name(unsigned int attributes)
Name protocol open attributes.
Definition: efi_debug.c:250
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 293 of file efi_debug.c.

293  {
296  UINTN count;
297  unsigned int i;
298  EFI_STATUS efirc;
299  int rc;
300 
301  /* Sanity check */
302  if ( ( ! handle ) || ( ! protocol ) ) {
303  printf ( "HANDLE %s could not retrieve openers for %s\n",
305  efi_guid_ntoa ( protocol ) );
306  return;
307  }
308 
309  /* Retrieve list of openers */
310  if ( ( efirc = bs->OpenProtocolInformation ( handle, protocol, &openers,
311  &count ) ) != 0 ) {
312  rc = -EEFI ( efirc );
313  printf ( "HANDLE %s could not retrieve openers for %s: %s\n",
315  efi_guid_ntoa ( protocol ), strerror ( rc ) );
316  return;
317  }
318 
319  /* Dump list of openers */
320  for ( i = 0 ; i < count ; i++ )
321  dbg_efi_opener ( handle, protocol, &openers[i] );
322 
323  /* Free list */
324  bs->FreePool ( openers );
325 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2000
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
EFI Oprn Protocol Information Entry.
Definition: UefiSpec.h:1349
#define EEFI(efirc)
Convert an EFI status code to an iPXE status code.
Definition: efi.h:162
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:272
const char * efi_handle_name(EFI_HANDLE handle)
Get name of an EFI handle.
Definition: efi_debug.c:722
const char * efi_guid_ntoa(CONST EFI_GUID *guid)
Convert GUID to a printable string.
Definition: efi_debug.c:192
char * strerror(int errno)
Retrieve string representation of error number.
Definition: strerror.c:78
EFI Boot Services Table.
Definition: UefiSpec.h:1836
UINT64 UINTN
Unsigned value of native width.
Definition: ProcessorBind.h:71
EFI_FREE_POOL FreePool
Definition: UefiSpec.h:1855
EFI_OPEN_PROTOCOL_INFORMATION OpenProtocolInformation
Definition: UefiSpec.h:1907
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:35
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_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 332 of file efi_debug.c.

332  {
334  EFI_GUID **protocols;
336  UINTN count;
337  unsigned int i;
338  EFI_STATUS efirc;
339  int rc;
340 
341  /* Sanity check */
342  if ( ! handle ) {
343  printf ( "HANDLE %p could not retrieve protocols\n", handle );
344  return;
345  }
346 
347  /* Retrieve list of protocols */
348  if ( ( efirc = bs->ProtocolsPerHandle ( handle, &protocols,
349  &count ) ) != 0 ) {
350  rc = -EEFI ( efirc );
351  printf ( "HANDLE %s could not retrieve protocols: %s\n",
352  efi_handle_name ( handle ), strerror ( rc ) );
353  return;
354  }
355 
356  /* Dump list of protocols */
357  for ( i = 0 ; i < count ; i++ ) {
358  protocol = protocols[i];
359  printf ( "HANDLE %s %s supported\n", efi_handle_name ( handle ),
360  efi_guid_ntoa ( protocol ) );
362  }
363 
364  /* Free list */
365  bs->FreePool ( protocols );
366 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2000
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:162
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:293
128 bit buffer containing a unique identifier value.
Definition: Base.h:263
const char * efi_handle_name(EFI_HANDLE handle)
Get name of an EFI handle.
Definition: efi_debug.c:722
const char * efi_guid_ntoa(CONST EFI_GUID *guid)
Convert GUID to a printable string.
Definition: efi_debug.c:192
char * strerror(int errno)
Retrieve string representation of error number.
Definition: strerror.c:78
EFI Boot Services Table.
Definition: UefiSpec.h:1836
UINT64 UINTN
Unsigned value of native width.
Definition: ProcessorBind.h:71
EFI_FREE_POOL FreePool
Definition: UefiSpec.h:1855
EFI_PROTOCOLS_PER_HANDLE ProtocolsPerHandle
Definition: UefiSpec.h:1912
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:35
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_openers(), EEFI, efi_guid_ntoa(), efi_handle_name(), efi_systab, EFI_BOOT_SERVICES::FreePool, handle, printf(), protocol, 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 130 of file efi_init.c.

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

367  {
368  EFI_STATUS efirc;
369  int rc;
370 
371  /* Report failure (when debugging) */
372  DBGC ( efi_systab, "EFI stack check failed (cookie %#lx); aborting\n",
374 
375  /* Attempt to exit cleanly with an error status */
376  if ( efi_exit ) {
378  0, NULL );
379  rc = -EEFI ( efirc );
380  DBGC ( efi_systab, "EFI stack check exit failed: %s\n",
381  strerror ( rc ) );
382  }
383 
384  /* If the exit fails for any reason, lock the system */
385  while ( 1 ) {}
386 
387 }
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:162
#define DBGC(...)
Definition: compiler.h:505
#define EFI_COMPROMISED_DATA
Enumeration of EFI_STATUS.
Definition: UefiBaseType.h:151
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:33
unsigned long __stack_chk_guard
Stack cookie.
Definition: efi_init.c:63
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:35
static EFI_EXIT efi_exit
Exit function.
Definition: efi_init.c:70
EFI_SYSTEM_TABLE * efi_systab
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362

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

322  {
323 
324  /* The calling function must not itself use stack protection,
325  * since the change in the stack guard value would trigger a
326  * false positive.
327  *
328  * There is unfortunately no way to annotate a function to
329  * exclude the use of stack protection. We must therefore
330  * rely on correctly anticipating the compiler's decision on
331  * the use of stack protection.
332  *
333  * The calculation of the stack cookie value deliberately
334  * takes the address of a stack variable (to provide an
335  * additional source of entropy). This operation would
336  * trigger the application of stack protection to the calling
337  * function, and so must be externalised.
338  */
340 }
unsigned long __stack_chk_guard
Stack cookie.
Definition: efi_init.c:63
unsigned long efi_stack_cookie(EFI_HANDLE handle)
Construct a stack cookie value.
Definition: efi_init.c:130
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 170 of file efi_init.c.

171  {
172  EFI_BOOT_SERVICES *bs;
173  struct efi_protocol *prot;
174  struct efi_config_table *tab;
175  void *loaded_image;
176  void *device_path;
177  void *device_path_copy;
178  size_t device_path_len;
179  EFI_STATUS efirc;
180  int rc;
181 
182  /* Store image handle and system table pointer for future use */
183  efi_image_handle = image_handle;
184  efi_systab = systab;
185 
186  /* Sanity checks */
187  if ( ! systab ) {
188  efirc = EFI_NOT_AVAILABLE_YET;
189  goto err_sanity;
190  }
191  if ( ! systab->ConOut ) {
192  efirc = EFI_NOT_AVAILABLE_YET;
193  goto err_sanity;
194  }
195  if ( ! systab->BootServices ) {
196  DBGC ( systab, "EFI provided no BootServices entry point\n" );
197  efirc = EFI_NOT_AVAILABLE_YET;
198  goto err_sanity;
199  }
200  if ( ! systab->RuntimeServices ) {
201  DBGC ( systab, "EFI provided no RuntimeServices entry "
202  "point\n" );
203  efirc = EFI_NOT_AVAILABLE_YET;
204  goto err_sanity;
205  }
206  DBGC ( systab, "EFI handle %p systab %p\n", image_handle, systab );
207  bs = systab->BootServices;
208 
209  /* Store abort function pointer */
210  efi_exit = bs->Exit;
211 
212  /* Look up used protocols */
214  if ( ( efirc = bs->LocateProtocol ( &prot->guid, NULL,
215  prot->protocol ) ) == 0 ) {
216  DBGC ( systab, "EFI protocol %s is at %p\n",
217  efi_guid_ntoa ( &prot->guid ),
218  *(prot->protocol) );
219  } else {
220  DBGC ( systab, "EFI does not provide protocol %s\n",
221  efi_guid_ntoa ( &prot->guid ) );
222  /* Fail if protocol is required */
223  if ( prot->required )
224  goto err_missing_protocol;
225  }
226  }
227 
228  /* Look up used configuration tables */
230  if ( ( *(tab->table) = efi_find_table ( &tab->guid ) ) ) {
231  DBGC ( systab, "EFI configuration table %s is at %p\n",
232  efi_guid_ntoa ( &tab->guid ), *(tab->table) );
233  } else {
234  DBGC ( systab, "EFI does not provide configuration "
235  "table %s\n", efi_guid_ntoa ( &tab->guid ) );
236  if ( tab->required ) {
237  efirc = EFI_NOT_AVAILABLE_YET;
238  goto err_missing_table;
239  }
240  }
241  }
242 
243  /* Get loaded image protocol */
244  if ( ( efirc = bs->OpenProtocol ( image_handle,
246  &loaded_image, image_handle, NULL,
247  EFI_OPEN_PROTOCOL_GET_PROTOCOL ) ) != 0 ) {
248  rc = -EEFI ( efirc );
249  DBGC ( systab, "EFI could not get loaded image protocol: %s",
250  strerror ( rc ) );
251  goto err_no_loaded_image;
252  }
253  efi_loaded_image = loaded_image;
254  DBGC ( systab, "EFI image base address %p\n",
256 
257  /* Get loaded image's device handle's device path */
258  if ( ( efirc = bs->OpenProtocol ( efi_loaded_image->DeviceHandle,
260  &device_path, image_handle, NULL,
261  EFI_OPEN_PROTOCOL_GET_PROTOCOL ) ) != 0 ) {
262  rc = -EEFI ( efirc );
263  DBGC ( systab, "EFI could not get loaded image's device path: "
264  "%s", strerror ( rc ) );
265  goto err_no_device_path;
266  }
267 
268  /* Make a copy of the loaded image's device handle's device
269  * path, since the device handle itself may become invalidated
270  * when we load our own drivers.
271  */
272  device_path_len = ( efi_path_len ( device_path ) +
273  sizeof ( EFI_DEVICE_PATH_PROTOCOL ) );
274  if ( ( efirc = bs->AllocatePool ( EfiBootServicesData, device_path_len,
275  &device_path_copy ) ) != 0 ) {
276  rc = -EEFI ( efirc );
277  goto err_alloc_device_path;
278  }
279  memcpy ( device_path_copy, device_path, device_path_len );
280  efi_loaded_image_path = device_path_copy;
281  DBGC ( systab, "EFI image device path %s\n",
283 
284  /* EFI is perfectly capable of gracefully shutting down any
285  * loaded devices if it decides to fall back to a legacy boot.
286  * For no particularly comprehensible reason, it doesn't
287  * bother doing so when ExitBootServices() is called.
288  */
289  if ( ( efirc = bs->CreateEvent ( EVT_SIGNAL_EXIT_BOOT_SERVICES,
291  NULL, &efi_shutdown_event ) ) != 0 ) {
292  rc = -EEFI ( efirc );
293  DBGC ( systab, "EFI could not create ExitBootServices event: "
294  "%s\n", strerror ( rc ) );
295  goto err_create_event;
296  }
297 
298  /* Install driver binding protocol */
299  if ( ( rc = efi_driver_install() ) != 0 ) {
300  DBGC ( systab, "EFI could not install driver: %s\n",
301  strerror ( rc ) );
302  efirc = EFIRC ( rc );
303  goto err_driver_install;
304  }
305 
306  /* Install image unload method */
308 
309  return 0;
310 
312  err_driver_install:
314  err_create_event:
316  err_alloc_device_path:
317  err_no_device_path:
318  err_no_loaded_image:
319  err_missing_table:
320  err_missing_protocol:
321  err_sanity:
322  return efirc;
323 }
void efi_driver_uninstall(void)
Uninstall EFI driver.
Definition: efi_driver.c:418
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:2000
void ** protocol
Variable containing pointer to protocol structure.
Definition: efi.h:79
EFI_LOADED_IMAGE_PROTOCOL * efi_loaded_image
Loaded image protocol for this image.
Definition: efi_init.c:36
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:162
EFI_LOCATE_PROTOCOL LocateProtocol
Definition: UefiSpec.h:1914
EFI_GUID guid
GUID.
Definition: efi.h:77
#define DBGC(...)
Definition: compiler.h:505
EFI_GUID efi_loaded_image_protocol_guid
Loaded image protocol GUID.
Definition: efi_guid.c:184
size_t efi_path_len(EFI_DEVICE_PATH_PROTOCOL *path)
Find length of device path (excluding terminator)
Definition: efi_path.c:67
EFI_CLOSE_EVENT CloseEvent
Definition: UefiSpec.h:1864
VOID * ImageBase
The base address at which the image was loaded.
Definition: LoadedImage.h:75
This protocol can be used on any device handle to obtain generic path/location information concerning...
Definition: DevicePath.h:51
#define TPL_NOTIFY
Definition: UefiSpec.h:592
#define EFI_PROTOCOLS
EFI protocol table.
Definition: efi.h:85
#define EVT_SIGNAL_EXIT_BOOT_SERVICES
Definition: UefiSpec.h:396
#define EFI_CONFIG_TABLES
EFI configuration table table.
Definition: efi.h:129
An EFI configuration table used by iPXE.
Definition: efi.h:119
EFI_DEVICE_PATH_PROTOCOL * efi_loaded_image_path
Device path for the loaded image's device handle.
Definition: efi_init.c:39
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:55
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL * ConOut
A pointer to the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL interface that is associated with ConsoleOutHandle.
Definition: UefiSpec.h:1982
static EFI_EVENT efi_shutdown_event
Event used to signal shutdown.
Definition: efi_init.c:60
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:82
EFI_CREATE_EVENT CreateEvent
Definition: UefiSpec.h:1860
static void * efi_find_table(EFI_GUID *guid)
Look up EFI configuration table.
Definition: efi_init.c:111
const char * efi_devpath_text(EFI_DEVICE_PATH_PROTOCOL *path)
Get textual representation of device path.
Definition: efi_debug.c:375
#define EFI_OPEN_PROTOCOL_GET_PROTOCOL
Definition: UefiSpec.h:1271
An EFI protocol used by iPXE.
Definition: efi.h:75
const char * efi_guid_ntoa(CONST EFI_GUID *guid)
Convert GUID to a printable string.
Definition: efi_debug.c:192
char * strerror(int errno)
Retrieve string representation of error number.
Definition: strerror.c:78
EFI Boot Services Table.
Definition: UefiSpec.h:1836
EFI_HANDLE efi_image_handle
Image handle passed to entry point.
Definition: efi_init.c:33
EFI_IMAGE_UNLOAD Unload
Definition: LoadedImage.h:79
#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:132
EFI_FREE_POOL FreePool
Definition: UefiSpec.h:1855
void ** table
Variable containing pointer to configuration table.
Definition: efi.h:123
int required
Protocol is required.
Definition: efi.h:81
EFI_RUNTIME_SERVICES * RuntimeServices
A pointer to the EFI Runtime Services Table.
Definition: UefiSpec.h:1996
EFI_GUID guid
GUID.
Definition: efi.h:121
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:35
static EFI_EXIT efi_exit
Exit function.
Definition: efi_init.c:70
EFI_SYSTEM_TABLE * efi_systab
EFI_OPEN_PROTOCOL OpenProtocol
Definition: UefiSpec.h:1905
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:125
static EFI_STATUS EFIAPI efi_unload(EFI_HANDLE image_handle)
Shut down EFI environment.
Definition: efi_init.c:330
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362
int efi_driver_install(void)
Install EFI driver.
Definition: efi_driver.c:385
#define EFIRC(rc)
Convert an iPXE status code to an EFI status code.
Definition: efi.h:154
EFI_HANDLE DeviceHandle
The device handle that the EFI Image was loaded from.
Definition: LoadedImage.h:61
EFI_ALLOCATE_POOL AllocatePool
Definition: UefiSpec.h:1854

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

394  {
396 
397  /* Record current external TPL */
398  tpl->previous = efi_external_tpl;
399 
400  /* Raise TPL and record previous TPL as new external TPL */
401  tpl->current = bs->RaiseTPL ( efi_internal_tpl );
402  efi_external_tpl = tpl->current;
403 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2000
EFI_RAISE_TPL RaiseTPL
Definition: UefiSpec.h:1845
EFI_TPL efi_internal_tpl
Internal task priority level.
Definition: efi_init.c:51
EFI_TPL current
Current external TPL.
Definition: efi.h:69
EFI Boot Services Table.
Definition: UefiSpec.h:1836
EFI_TPL previous
Previous external TPL.
Definition: efi.h:71
EFI_SYSTEM_TABLE * efi_systab
EFI_TPL efi_external_tpl
External task priority level.
Definition: efi_init.c:54

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(), and efi_usb_sync_interrupt_transfer().

◆ efi_restore_tpl()

void efi_restore_tpl ( struct efi_saved_tpl tpl)

Restore task priority level.

Parameters
tplSaved TPL

Definition at line 410 of file efi_init.c.

410  {
412 
413  /* Restore external TPL */
414  efi_external_tpl = tpl->previous;
415 
416  /* Restore TPL */
417  bs->RestoreTPL ( tpl->current );
418 }
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
Definition: UefiSpec.h:2000
EFI_TPL current
Current external TPL.
Definition: efi.h:69
EFI Boot Services Table.
Definition: UefiSpec.h:1836
EFI_TPL previous
Previous external TPL.
Definition: efi.h:71
EFI_SYSTEM_TABLE * efi_systab
EFI_RESTORE_TPL RestoreTPL
Definition: UefiSpec.h:1846
EFI_TPL efi_external_tpl
External task priority level.
Definition: efi_init.c:54

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(), and efi_usb_sync_interrupt_transfer().

Variable Documentation

◆ efi_absolute_pointer_protocol_guid

EFI_GUID efi_absolute_pointer_protocol_guid

Absolute pointer protocol GUID.

Definition at line 88 of file efi_guid.c.

◆ efi_acpi_table_protocol_guid

EFI_GUID efi_acpi_table_protocol_guid

ACPI table protocol GUID.

Definition at line 92 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 96 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 100 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 104 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 108 of file efi_guid.c.

Referenced by efi_block_hook(), 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 112 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 116 of file efi_guid.c.

◆ efi_component_name_protocol_guid

EFI_GUID efi_component_name_protocol_guid

Component name protocol GUID.

Definition at line 120 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 124 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 128 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 136 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 140 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 144 of file efi_guid.c.

Referenced by efi_file_install(), and efi_file_uninstall().

◆ efi_driver_binding_protocol_guid

EFI_GUID efi_driver_binding_protocol_guid

Driver binding protocol GUID.

Definition at line 148 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 152 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 156 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 160 of file efi_guid.c.

Referenced by efifb_init().

◆ efi_ip4_protocol_guid

EFI_GUID efi_ip4_protocol_guid

IPv4 protocol GUID.

Definition at line 164 of file efi_guid.c.

◆ efi_ip4_config_protocol_guid

EFI_GUID efi_ip4_config_protocol_guid

IPv4 configuration protocol GUID.

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

◆ efi_load_file_protocol_guid

EFI_GUID efi_load_file_protocol_guid

Load file protocol GUID.

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

◆ efi_loaded_image_protocol_guid

EFI_GUID efi_loaded_image_protocol_guid

Loaded image protocol GUID.

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

◆ efi_managed_network_protocol_guid

EFI_GUID efi_managed_network_protocol_guid

Managed network protocol GUID.

Definition at line 192 of file efi_guid.c.

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

◆ efi_mtftp4_protocol_guid

EFI_GUID efi_mtftp4_protocol_guid

MTFTPv4 protocol GUID.

Definition at line 200 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 204 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 208 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 212 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 216 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 220 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 224 of file efi_guid.c.

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

◆ efi_serial_io_protocol_guid

EFI_GUID efi_serial_io_protocol_guid

Serial I/O protocol GUID.

Definition at line 228 of file efi_guid.c.

◆ 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 236 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 240 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 244 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 248 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 252 of file efi_guid.c.

◆ efi_tcg_protocol_guid

EFI_GUID efi_tcg_protocol_guid

TCG protocol GUID.

Definition at line 256 of file efi_guid.c.

◆ efi_tcp4_protocol_guid

EFI_GUID efi_tcp4_protocol_guid

TCPv4 protocol GUID.

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

◆ efi_tree_protocol_guid

EFI_GUID efi_tree_protocol_guid

TrEE protocol GUID.

Definition at line 268 of file efi_guid.c.

◆ efi_udp4_protocol_guid

EFI_GUID efi_udp4_protocol_guid

UDPv4 protocol GUID.

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

◆ efi_uga_draw_protocol_guid

EFI_GUID efi_uga_draw_protocol_guid

UGA draw protocol GUID.

Definition at line 280 of file efi_guid.c.

◆ efi_unicode_collation_protocol_guid

EFI_GUID efi_unicode_collation_protocol_guid

Unicode collation protocol GUID.

Definition at line 284 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 288 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 292 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 296 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 300 of file efi_guid.c.

◆ efi_file_info_id

EFI_GUID efi_file_info_id

File information GUID.

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

Referenced by 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 36 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 39 of file efi_init.c.

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

◆ efi_systab

EFI_SYSTEM_TABLE* efi_systab

Referenced by __stack_chk_fail(), chained_locate(), chained_supported(), dbg_efi_openers(), 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_boot_image(), efi_block_connect(), efi_block_hook(), 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_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_set_autoboot_ll_addr(), efi_set_timer_wrapper(), efi_set_watchdog_timer_wrapper(), 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_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(), nii_block(), nii_issue_cpb_db(), nii_pci_close(), nii_pci_open(), nii_start(), nii_stop(), nii_supported(), snp_supported(), snpnet_start(), snpnet_stop(), 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 51 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 54 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 63 of file efi_init.c.

Referenced by __stack_chk_fail(), and efi_init_stack_guard().