iPXE
Data Structures | Macros | Functions | Variables
efi_debug.c File Reference

EFI debugging utilities. More...

#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <ipxe/uuid.h>
#include <ipxe/base16.h>
#include <ipxe/vsprintf.h>
#include <ipxe/efi/efi.h>
#include <ipxe/efi/efi_path.h>
#include <ipxe/efi/Protocol/ComponentName.h>
#include <ipxe/efi/Protocol/ComponentName2.h>
#include <ipxe/efi/Protocol/DevicePathToText.h>
#include <ipxe/efi/IndustryStandard/PeImage.h>

Go to the source code of this file.

Data Structures

struct  efi_well_known_guid
 A well-known GUID. More...
 
struct  efi_handle_name_type
 An EFI handle name type. More...
 

Macros

#define EFI_HANDLE_NAME_TYPE(protocol, name)
 Define an EFI handle name type. More...
 

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 
 EFI_REQUEST_PROTOCOL (EFI_DEVICE_PATH_TO_TEXT_PROTOCOL, &efidpt)
 
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...
 
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...
 
const char * efi_devpath_text (EFI_DEVICE_PATH_PROTOCOL *path)
 Get textual representation of device path. More...
 
static const char * efi_driver_name (EFI_COMPONENT_NAME_PROTOCOL *wtf)
 Get driver name. More...
 
static const char * efi_driver_name2 (EFI_COMPONENT_NAME2_PROTOCOL *wtf)
 Get driver name. More...
 
static const char * efi_pecoff_debug_name (EFI_LOADED_IMAGE_PROTOCOL *loaded)
 Get PE/COFF debug filename. More...
 
static const char * efi_first_loaded_image_name (EFI_LOADED_IMAGE_PROTOCOL *loaded)
 Get initial loaded image name. More...
 
static const char * efi_loaded_image_filepath_name (EFI_LOADED_IMAGE_PROTOCOL *loaded)
 Get loaded image name from file path. More...
 
static const char * efi_conin_name (EFI_SIMPLE_TEXT_INPUT_PROTOCOL *input)
 Get console input handle name. More...
 
static const char * efi_conout_name (EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *output)
 Get console output handle name. More...
 
const char * efi_handle_name (EFI_HANDLE handle)
 Get name of an EFI handle. More...
 

Variables

static EFI_DEVICE_PATH_TO_TEXT_PROTOCOLefidpt
 Device path to text protocol. More...
 
static EFI_GUID efi_http_boot_dxe_guid
 HttpBootDxe module GUID. More...
 
static EFI_GUID efi_iscsi_dxe_guid
 IScsiDxe module GUID. More...
 
static EFI_GUID efi_iscsi4_dxe_guid
 Old IScsi4Dxe module GUID. More...
 
static EFI_GUID efi_uefi_pxe_bc_dxe_guid
 UefiPxeBcDxe module GUID. More...
 
static EFI_GUID efi_vlan_config_dxe_guid
 VlanConfigDxe module GUID. More...
 
static struct efi_well_known_guid efi_well_known_guids []
 Well-known GUIDs. More...
 
static struct efi_handle_name_type efi_handle_name_types []
 EFI handle name types. More...
 

Detailed Description

EFI debugging utilities.

Definition in file efi_debug.c.

Macro Definition Documentation

◆ EFI_HANDLE_NAME_TYPE

#define EFI_HANDLE_NAME_TYPE (   protocol,
  name 
)
Value:
{ \
(protocol), \
( const char * ( * ) ( void * ) ) (name), \
}
const char * name
Definition: ath9k_hw.c:1984
uint16_t protocol
Protocol ID.
Definition: stp.h:18

Define an EFI handle name type.

Parameters
protocolProtocol interface
nameMethod to get name
Return values
typeEFI handle name type

Definition at line 766 of file efi_debug.c.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )

◆ EFI_REQUEST_PROTOCOL()

EFI_REQUEST_PROTOCOL ( EFI_DEVICE_PATH_TO_TEXT_PROTOCOL  ,
efidpt 
)

◆ 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
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_autoexec_load(), 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().

◆ 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_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_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_driver_name()

static const char* efi_driver_name ( EFI_COMPONENT_NAME_PROTOCOL wtf)
static

Get driver name.

Parameters
wtfComponent name protocol
Return values
nameDriver name, or NULL

Definition at line 501 of file efi_debug.c.

501  {
502  static char name[64];
503  CHAR16 *driver_name;
504  EFI_STATUS efirc;
505 
506  /* Sanity check */
507  if ( ! wtf ) {
508  DBG ( "[NULL ComponentName]" );
509  return NULL;
510  }
511 
512  /* Try "eng" first; if that fails then try the first language */
513  if ( ( ( efirc = wtf->GetDriverName ( wtf, "eng",
514  &driver_name ) ) != 0 ) &&
515  ( ( efirc = wtf->GetDriverName ( wtf, wtf->SupportedLanguages,
516  &driver_name ) ) != 0 ) ) {
517  return NULL;
518  }
519 
520  /* Convert name from CHAR16 to char */
521  snprintf ( name, sizeof ( name ), "%ls", driver_name );
522  return name;
523 }
const char * name
Definition: ath9k_hw.c:1984
unsigned short CHAR16
char wtf[42]
Authenticator response string.
Definition: mschapv2.h:18
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
int snprintf(char *buf, size_t size, const char *fmt,...)
Write a formatted string to a buffer.
Definition: vsprintf.c:382
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321

References DBG, name, NULL, snprintf(), and wtf.

◆ efi_driver_name2()

static const char* efi_driver_name2 ( EFI_COMPONENT_NAME2_PROTOCOL wtf)
static

Get driver name.

Parameters
wtfComponent name protocol
Return values
nameDriver name, or NULL

Definition at line 531 of file efi_debug.c.

531  {
532  static char name[64];
533  CHAR16 *driver_name;
534  EFI_STATUS efirc;
535 
536  /* Sanity check */
537  if ( ! wtf ) {
538  DBG ( "[NULL ComponentName2]" );
539  return NULL;
540  }
541 
542  /* Try "en" first; if that fails then try the first language */
543  if ( ( ( efirc = wtf->GetDriverName ( wtf, "en",
544  &driver_name ) ) != 0 ) &&
545  ( ( efirc = wtf->GetDriverName ( wtf, wtf->SupportedLanguages,
546  &driver_name ) ) != 0 ) ) {
547  return NULL;
548  }
549 
550  /* Convert name from CHAR16 to char */
551  snprintf ( name, sizeof ( name ), "%ls", driver_name );
552  return name;
553 }
const char * name
Definition: ath9k_hw.c:1984
unsigned short CHAR16
char wtf[42]
Authenticator response string.
Definition: mschapv2.h:18
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
int snprintf(char *buf, size_t size, const char *fmt,...)
Write a formatted string to a buffer.
Definition: vsprintf.c:382
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321

References DBG, name, NULL, snprintf(), and wtf.

◆ efi_pecoff_debug_name()

static const char* efi_pecoff_debug_name ( EFI_LOADED_IMAGE_PROTOCOL loaded)
static

Get PE/COFF debug filename.

Parameters
loadedLoaded image
Return values
namePE/COFF debug filename, or NULL

Definition at line 562 of file efi_debug.c.

562  {
563  static char buf[32];
568  EFI_IMAGE_DATA_DIRECTORY *datadir;
573  uint16_t dos_magic;
574  uint32_t pe_magic;
575  uint16_t opt_magic;
576  uint32_t codeview_magic;
577  size_t max_len;
578  char *name;
579  char *tmp;
580 
581  /* Sanity check */
582  if ( ! loaded ) {
583  DBG ( "[NULL LoadedImage]" );
584  return NULL;
585  }
586 
587  /* Parse DOS header */
588  dos = loaded->ImageBase;
589  if ( ! dos ) {
590  DBG ( "[Missing DOS header]" );
591  return NULL;
592  }
593  dos_magic = dos->e_magic;
594  if ( dos_magic != EFI_IMAGE_DOS_SIGNATURE ) {
595  DBG ( "[Bad DOS signature %#04x]", dos_magic );
596  return NULL;
597  }
598  pe = ( loaded->ImageBase + dos->e_lfanew );
599 
600  /* Parse PE header */
601  pe_magic = pe->Pe32.Signature;
602  if ( pe_magic != EFI_IMAGE_NT_SIGNATURE ) {
603  DBG ( "[Bad PE signature %#08x]", pe_magic );
604  return NULL;
605  }
606  opt32 = &pe->Pe32.OptionalHeader;
607  opt64 = &pe->Pe32Plus.OptionalHeader;
608  opt_magic = opt32->Magic;
609  if ( opt_magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC ) {
610  datadir = opt32->DataDirectory;
611  } else if ( opt_magic == EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC ) {
612  datadir = opt64->DataDirectory;
613  } else {
614  DBG ( "[Bad optional header signature %#04x]", opt_magic );
615  return NULL;
616  }
617 
618  /* Parse data directory entry */
619  if ( ! datadir[EFI_IMAGE_DIRECTORY_ENTRY_DEBUG].VirtualAddress ) {
620  DBG ( "[Empty debug directory entry]" );
621  return NULL;
622  }
623  debug = ( loaded->ImageBase +
625 
626  /* Parse debug directory entry */
627  if ( debug->Type != EFI_IMAGE_DEBUG_TYPE_CODEVIEW ) {
628  DBG ( "[Not a CodeView debug directory entry (type %d)]",
629  debug->Type );
630  return NULL;
631  }
632  codeview_nb10 = ( loaded->ImageBase + debug->RVA );
633  codeview_rsds = ( loaded->ImageBase + debug->RVA );
634  codeview_mtoc = ( loaded->ImageBase + debug->RVA );
635  codeview_magic = codeview_nb10->Signature;
636 
637  /* Parse CodeView entry */
638  if ( codeview_magic == CODEVIEW_SIGNATURE_NB10 ) {
639  name = ( ( void * ) ( codeview_nb10 + 1 ) );
640  } else if ( codeview_magic == CODEVIEW_SIGNATURE_RSDS ) {
641  name = ( ( void * ) ( codeview_rsds + 1 ) );
642  } else if ( codeview_magic == CODEVIEW_SIGNATURE_MTOC ) {
643  name = ( ( void * ) ( codeview_mtoc + 1 ) );
644  } else {
645  DBG ( "[Bad CodeView signature %#08x]", codeview_magic );
646  return NULL;
647  }
648 
649  /* Sanity check - avoid scanning endlessly through memory */
650  max_len = EFI_PAGE_SIZE; /* Reasonably sane */
651  if ( strnlen ( name, max_len ) == max_len ) {
652  DBG ( "[Excessively long or invalid CodeView name]" );
653  return NULL;
654  }
655 
656  /* Skip any directory components. We cannot modify this data
657  * or create a temporary buffer, so do not use basename().
658  */
659  while ( ( ( tmp = strchr ( name, '/' ) ) != NULL ) ||
660  ( ( tmp = strchr ( name, '\\' ) ) != NULL ) ) {
661  name = ( tmp + 1 );
662  }
663 
664  /* Copy base name to buffer */
665  snprintf ( buf, sizeof ( buf ), "%s", name );
666 
667  /* Strip file suffix, if present */
668  if ( ( tmp = strrchr ( buf, '.' ) ) != NULL )
669  *tmp = '\0';
670 
671  return buf;
672 }
#define EFI_PAGE_SIZE
Definition: UefiBaseType.h:187
const char * name
Definition: ath9k_hw.c:1984
unsigned short uint16_t
Definition: stdint.h:11
char * strrchr(const char *src, int character)
Find rightmost character within a string.
Definition: string.c:289
uint16_t max_len
Maximum length (in bytes)
Definition: ntlm.h:18
Union of PE32, PE32+, and TE headers.
Definition: PeImage.h:805
Definition: PeImage.h:660
#define EFI_IMAGE_DOS_SIGNATURE
Definition: PeImage.h:50
Optional Header Standard Fields for PE32+.
Definition: PeImage.h:201
Optional Header Standard Fields for PE32.
Definition: PeImage.h:150
VOID * ImageBase
The base address at which the image was loaded.
Definition: LoadedImage.h:69
EFI_IMAGE_NT_HEADERS32 Pe32
Definition: PeImage.h:806
unsigned long tmp
Definition: linux_pci.h:53
#define EFI_IMAGE_NT_SIGNATURE
Definition: PeImage.h:53
Definition: PeImage.h:690
#define EFI_IMAGE_DIRECTORY_ENTRY_DEBUG
Definition: PeImage.h:131
#define CODEVIEW_SIGNATURE_RSDS
Debug Data Structure defined in Microsoft C++.
Definition: PeImage.h:673
uint64_t debug
Debug area base address.
Definition: ena.h:14
UINT16 Magic
Standard fields.
Definition: PeImage.h:154
char * strchr(const char *src, int character)
Find character within a string.
Definition: string.c:271
UINT32 Signature
"NB10"
Definition: PeImage.h:661
#define CODEVIEW_SIGNATURE_MTOC
Debug Data Structure defined by Apple Mach-O to Coff utility.
Definition: PeImage.h:689
Header Data Directories.
Definition: PeImage.h:117
EFI_IMAGE_DATA_DIRECTORY DataDirectory[EFI_IMAGE_NUMBER_OF_DIRECTORY_ENTRIES]
Definition: PeImage.h:237
size_t strnlen(const char *src, size_t max)
Get length of string.
Definition: string.c:255
EFI_IMAGE_OPTIONAL_HEADER64 OptionalHeader
Definition: PeImage.h:259
Definition: PeImage.h:674
unsigned int uint32_t
Definition: stdint.h:12
Debug Directory Format.
Definition: PeImage.h:642
#define CODEVIEW_SIGNATURE_NB10
Debug Data Structure defined in Microsoft C++.
Definition: PeImage.h:659
UINT32 e_lfanew
File address of new exe header.
Definition: PeImage.h:78
UINT16 e_magic
Magic number.
Definition: PeImage.h:60
EFI_IMAGE_DATA_DIRECTORY DataDirectory[EFI_IMAGE_NUMBER_OF_DIRECTORY_ENTRIES]
Definition: PeImage.h:187
PE images can start with an optional DOS header, so if an image is run under DOS it can print an erro...
Definition: PeImage.h:59
int snprintf(char *buf, size_t size, const char *fmt,...)
Write a formatted string to a buffer.
Definition: vsprintf.c:382
EFI_IMAGE_NT_HEADERS64 Pe32Plus
Definition: PeImage.h:807
#define EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC
Definition: PeImage.h:145
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498
#define EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC
Definition: PeImage.h:196
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321
#define EFI_IMAGE_DEBUG_TYPE_CODEVIEW
The Visual C++ debug information.
Definition: PeImage.h:653
EFI_IMAGE_OPTIONAL_HEADER32 OptionalHeader
Definition: PeImage.h:247

References CODEVIEW_SIGNATURE_MTOC, CODEVIEW_SIGNATURE_NB10, CODEVIEW_SIGNATURE_RSDS, EFI_IMAGE_OPTIONAL_HEADER32::DataDirectory, EFI_IMAGE_OPTIONAL_HEADER64::DataDirectory, DBG, debug, EFI_IMAGE_DOS_HEADER::e_lfanew, EFI_IMAGE_DOS_HEADER::e_magic, EFI_IMAGE_DEBUG_TYPE_CODEVIEW, EFI_IMAGE_DIRECTORY_ENTRY_DEBUG, EFI_IMAGE_DOS_SIGNATURE, EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC, EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC, EFI_IMAGE_NT_SIGNATURE, EFI_PAGE_SIZE, EFI_LOADED_IMAGE_PROTOCOL::ImageBase, EFI_IMAGE_OPTIONAL_HEADER32::Magic, max_len, name, NULL, EFI_IMAGE_NT_HEADERS32::OptionalHeader, EFI_IMAGE_NT_HEADERS64::OptionalHeader, EFI_IMAGE_OPTIONAL_HEADER_UNION::Pe32, EFI_IMAGE_OPTIONAL_HEADER_UNION::Pe32Plus, EFI_IMAGE_NT_HEADERS32::Signature, EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY::Signature, snprintf(), strchr(), strnlen(), strrchr(), tmp, and EFI_IMAGE_DATA_DIRECTORY::VirtualAddress.

◆ efi_first_loaded_image_name()

static const char* efi_first_loaded_image_name ( EFI_LOADED_IMAGE_PROTOCOL loaded)
static

Get initial loaded image name.

Parameters
loadedLoaded image
Return values
nameInitial loaded image name, or NULL

Definition at line 681 of file efi_debug.c.

681  {
682 
683  /* Sanity check */
684  if ( ! loaded ) {
685  DBG ( "[NULL LoadedImage]" );
686  return NULL;
687  }
688 
689  return ( ( loaded->ParentHandle == NULL ) ? "DxeCore(?)" : NULL );
690 }
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321
EFI_HANDLE ParentHandle
Parent image's image handle.
Definition: LoadedImage.h:48

References DBG, NULL, and EFI_LOADED_IMAGE_PROTOCOL::ParentHandle.

◆ efi_loaded_image_filepath_name()

static const char* efi_loaded_image_filepath_name ( EFI_LOADED_IMAGE_PROTOCOL loaded)
static

Get loaded image name from file path.

Parameters
loadedLoaded image
Return values
nameLoaded image name, or NULL

Definition at line 699 of file efi_debug.c.

699  {
700 
701  /* Sanity check */
702  if ( ! loaded ) {
703  DBG ( "[NULL LoadedImage]" );
704  return NULL;
705  }
706 
707  return efi_devpath_text ( loaded->FilePath );
708 }
EFI_DEVICE_PATH_PROTOCOL * FilePath
A pointer to the file path portion specific to DeviceHandle that the EFI Image was loaded from.
Definition: LoadedImage.h:56
const char * efi_devpath_text(EFI_DEVICE_PATH_PROTOCOL *path)
Get textual representation of device path.
Definition: efi_debug.c:461
#define DBG(...)
Print a debugging message.
Definition: compiler.h:498
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321

References DBG, efi_devpath_text(), EFI_LOADED_IMAGE_PROTOCOL::FilePath, and NULL.

◆ efi_conin_name()

static const char* efi_conin_name ( EFI_SIMPLE_TEXT_INPUT_PROTOCOL input)
static

Get console input handle name.

Parameters
inputSimple text input protocol
Return values
nameConsole input handle name, or NULL

Definition at line 717 of file efi_debug.c.

717  {
718 
719  /* Check for match against ConIn */
720  if ( input == efi_systab->ConIn )
721  return "ConIn";
722 
723  return NULL;
724 }
Definition: bnxt_hsi.h:68
EFI_SIMPLE_TEXT_INPUT_PROTOCOL * ConIn
A pointer to the EFI_SIMPLE_TEXT_INPUT_PROTOCOL interface that is associated with ConsoleInHandle.
Definition: UefiSpec.h:2054
EFI_SYSTEM_TABLE * efi_systab
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321

References EFI_SYSTEM_TABLE::ConIn, efi_systab, and NULL.

◆ efi_conout_name()

static const char* efi_conout_name ( EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL output)
static

Get console output handle name.

Parameters
outputSimple text output protocol
Return values
nameConsole output handle name, or NULL

Definition at line 733 of file efi_debug.c.

733  {
734 
735  /* Check for match against ConOut */
736  if ( output == efi_systab->ConOut )
737  return "ConOut";
738 
739  /* Check for match against StdErr (if different from ConOut) */
740  if ( output == efi_systab->StdErr )
741  return "StdErr";
742 
743  return NULL;
744 }
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
EFI_SYSTEM_TABLE * efi_systab
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL * StdErr
A pointer to the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL interface that is associated with StandardErrorHandl...
Definition: UefiSpec.h:2073

References EFI_SYSTEM_TABLE::ConOut, efi_systab, NULL, and EFI_SYSTEM_TABLE::StdErr.

◆ 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_load(), efi_autoexec_network(), efi_block_boot(), efi_block_filename(), efi_block_hook(), efi_block_local(), efi_block_match(), efi_block_root(), efi_bofm_start(), efi_bofm_supported(), efi_cachedhcp_record(), efi_child_add(), efi_child_del(), efi_close_protocol_wrapper(), efi_connect_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(), efidev_alloc(), efipci_open(), efipci_root_match(), efipci_root_open(), efipci_start(), mnpnet_start(), mnptemp_create(), 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().

Variable Documentation

◆ efidpt

Device path to text protocol.

Definition at line 47 of file efi_debug.c.

Referenced by efi_devpath_text().

◆ efi_http_boot_dxe_guid

EFI_GUID efi_http_boot_dxe_guid
static
Initial value:
= {
0xecebcb00, 0xd9c8, 0x11e4,
{ 0xaf, 0x3d, 0x8c, 0xdc, 0xd4, 0x26, 0xc9, 0x73 }
}

HttpBootDxe module GUID.

Definition at line 51 of file efi_debug.c.

◆ efi_iscsi_dxe_guid

EFI_GUID efi_iscsi_dxe_guid
static
Initial value:
= {
0x86cddf93, 0x4872, 0x4597,
{ 0x8a, 0xf9, 0xa3, 0x5a, 0xe4, 0xd3, 0x72, 0x5f }
}

IScsiDxe module GUID.

Definition at line 57 of file efi_debug.c.

◆ efi_iscsi4_dxe_guid

EFI_GUID efi_iscsi4_dxe_guid
static
Initial value:
= {
0x4579b72d, 0x7ec4, 0x4dd4,
{ 0x84, 0x86, 0x08, 0x3c, 0x86, 0xb1, 0x82, 0xa7 }
}

Old IScsi4Dxe module GUID.

Definition at line 63 of file efi_debug.c.

◆ efi_uefi_pxe_bc_dxe_guid

EFI_GUID efi_uefi_pxe_bc_dxe_guid
static
Initial value:
= {
0xb95e9fda, 0x26de, 0x48d2,
{ 0x88, 0x07, 0x1f, 0x91, 0x07, 0xac, 0x5e, 0x3a }
}

UefiPxeBcDxe module GUID.

Definition at line 69 of file efi_debug.c.

◆ efi_vlan_config_dxe_guid

EFI_GUID efi_vlan_config_dxe_guid
static
Initial value:
= {
0xe4f61863, 0xfe2c, 0x4b56,
{ 0xa8, 0xf4, 0x08, 0x51, 0x9b, 0xc4, 0x39, 0xdf }
}

VlanConfigDxe module GUID.

Definition at line 75 of file efi_debug.c.

◆ efi_well_known_guids

struct efi_well_known_guid efi_well_known_guids[]
static

Well-known GUIDs.

Definition at line 89 of file efi_debug.c.

Referenced by efi_guid_ntoa().

◆ efi_handle_name_types

struct efi_handle_name_type efi_handle_name_types[]
static
Initial value:
= {
}
static const char * efi_loaded_image_filepath_name(EFI_LOADED_IMAGE_PROTOCOL *loaded)
Get loaded image name from file path.
Definition: efi_debug.c:699
static const char * efi_conin_name(EFI_SIMPLE_TEXT_INPUT_PROTOCOL *input)
Get console input handle name.
Definition: efi_debug.c:717
static const char * efi_driver_name(EFI_COMPONENT_NAME_PROTOCOL *wtf)
Get driver name.
Definition: efi_debug.c:501
EFI_GUID efi_loaded_image_device_path_protocol_guid
Loaded image device path protocol GUID.
Definition: efi_guid.c:247
EFI_GUID efi_loaded_image_protocol_guid
Loaded image protocol GUID.
Definition: efi_guid.c:243
#define EFI_HANDLE_NAME_TYPE(protocol, name)
Define an EFI handle name type.
Definition: efi_debug.c:766
static const char * efi_driver_name2(EFI_COMPONENT_NAME2_PROTOCOL *wtf)
Get driver name.
Definition: efi_debug.c:531
EFI_GUID efi_simple_text_output_protocol_guid
Simple text output protocol GUID.
Definition: efi_guid.c:323
const char * efi_devpath_text(EFI_DEVICE_PATH_PROTOCOL *path)
Get textual representation of device path.
Definition: efi_debug.c:461
static const char * efi_pecoff_debug_name(EFI_LOADED_IMAGE_PROTOCOL *loaded)
Get PE/COFF debug filename.
Definition: efi_debug.c:562
EFI_GUID efi_device_path_protocol_guid
Device path protocol GUID.
Definition: efi_guid.c:143
EFI_GUID efi_component_name2_protocol_guid
Component name 2 protocol GUID.
Definition: efi_guid.c:135
EFI_GUID efi_simple_text_input_protocol_guid
Simple text input protocol GUID.
Definition: efi_guid.c:315
static const char * efi_conout_name(EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *output)
Get console output handle name.
Definition: efi_debug.c:733
static const char * efi_first_loaded_image_name(EFI_LOADED_IMAGE_PROTOCOL *loaded)
Get initial loaded image name.
Definition: efi_debug.c:681
EFI_GUID efi_component_name_protocol_guid
Component name protocol GUID.
Definition: efi_guid.c:131

EFI handle name types.

Definition at line 772 of file efi_debug.c.

Referenced by efi_handle_name().