56 static char buf[ 19 ];
64 snprintf ( buf,
sizeof ( buf ),
"%#lx",
65 (
unsigned long ) tpl );
80 switch ( search_type ) {
85 snprintf ( buf,
sizeof ( buf ),
"UNKNOWN<%d>", search_type );
103 static char attribute_chars[] =
"HGTCDX";
104 static char name[
sizeof ( attribute_chars ) ];
108 for ( i = 0 ; i < (
sizeof ( attribute_chars ) - 1 ) ; i++ ) {
109 if ( attributes & ( 1 << i ) )
110 *(
tmp++) = attribute_chars[i];
155 printf (
"HANDLE %s could not retrieve openers for %s\n",
165 printf (
"HANDLE %s could not retrieve openers for %s: %s\n",
172 for ( i = 0 ; i <
count ; i++ )
191 printf (
"HANDLE %s could not identify %s: %s\n",
218 printf (
"HANDLE %p could not retrieve protocols\n",
handle );
226 printf (
"HANDLE %s could not retrieve protocols: %s\n",
232 for ( i = 0 ; i <
count ; i++ ) {
249 static char text[512];
255 DBG (
"[NULL DevicePath]" );
261 DBG (
"[No DevicePathToText]" );
263 base16_encode ( path,
len, text,
sizeof ( text ) );
273 snprintf ( text,
sizeof ( text ),
"%ls", wtext );
288 static char name[64];
294 DBG (
"[NULL ComponentName]" );
299 if ( ( ( efirc =
wtf->GetDriverName (
wtf,
"eng",
300 &driver_name ) ) != 0 ) &&
301 ( ( efirc =
wtf->GetDriverName (
wtf,
wtf->SupportedLanguages,
302 &driver_name ) ) != 0 ) ) {
318 static char name[64];
324 DBG (
"[NULL ComponentName2]" );
329 if ( ( ( efirc =
wtf->GetDriverName (
wtf,
"en",
330 &driver_name ) ) != 0 ) &&
331 ( ( efirc =
wtf->GetDriverName (
wtf,
wtf->SupportedLanguages,
332 &driver_name ) ) != 0 ) ) {
354 DBG (
"[NULL DriverBinding]" );
362 DBG (
"[DriverBinding no ComponentName]" );
383 DBG (
"[NULL DriverBinding]" );
391 DBG (
"[DriverBinding no ComponentName2]" );
427 DBG (
"[NULL LoadedImage]" );
434 DBG (
"[Missing DOS header]" );
439 DBG (
"[Bad DOS signature %#04x]", dos_magic );
447 DBG (
"[Bad PE signature %#08x]", pe_magic );
452 opt_magic = opt32->
Magic;
458 DBG (
"[Bad optional header signature %#04x]", opt_magic );
464 DBG (
"[Empty debug directory entry]" );
472 DBG (
"[Not a CodeView debug directory entry (type %d)]",
479 codeview_magic = codeview_nb10->
Signature;
483 name = ( (
void * ) ( codeview_nb10 + 1 ) );
485 name = ( (
void * ) ( codeview_rsds + 1 ) );
487 name = ( (
void * ) ( codeview_mtoc + 1 ) );
489 DBG (
"[Bad CodeView signature %#08x]", codeview_magic );
496 DBG (
"[Excessively long or invalid CodeView name]" );
529 DBG (
"[NULL LoadedImage]" );
547 DBG (
"[NULL LoadedImage]" );
610 #define EFI_HANDLE_NAME_TYPE( protocol, name ) { \ 612 ( const char * ( * ) ( void * ) ) (name), \ 655 static char buf[256];
685 DBG2 (
"%c>", (
name ? (
name[0] ?
'Y' :
'E' ) :
'N' ) );
698 for ( i = 0 ; i <
count ; i++ ) {
700 (
sizeof ( buf ) - used ),
",%s",
705 used +=
ssnprintf ( ( buf + used ), (
sizeof ( buf ) - used ),
">" );
UEFI DriverBinding Protocol is defined in UEFI specification.
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
struct arbelprm_rc_send_wqe rc
EFI Oprn Protocol Information Entry.
This protocol is used to retrieve user readable names of drivers and controllers managed by UEFI Driv...
#define EEFI(efirc)
Convert an EFI status code to an iPXE status code.
int printf(const char *fmt,...)
Write a formatted string to the console.
void dbg_efi_openers(EFI_HANDLE handle, EFI_GUID *protocol)
Print list of openers of a given protocol on a given handle.
EFI_HANDLE ControllerHandle
This protocol is used to retrieve user readable names of drivers and controllers managed by UEFI Driv...
static const char * efi_loaded_image_filepath_name(EFI_LOADED_IMAGE_PROTOCOL *loaded)
Get loaded image name from file path.
char * strrchr(const char *src, int character)
Find rightmost character within a string.
128 bit buffer containing a unique identifier value.
static const char * efi_conin_name(EFI_SIMPLE_TEXT_INPUT_PROTOCOL *input)
Get console input handle name.
Retrieve all the handles in the handle database.
The EFI_SIMPLE_TEXT_INPUT_PROTOCOL is used on the ConsoleIn device.
static const char * efi_driver_name(EFI_COMPONENT_NAME_PROTOCOL *wtf)
Get driver name.
uint32_t type
Operating system type.
EFI_GUID efi_loaded_image_device_path_protocol_guid
Loaded image device path protocol GUID.
EFI_GUID efi_loaded_image_protocol_guid
Loaded image protocol GUID.
EFI_DEVICE_PATH_PROTOCOL * FilePath
A pointer to the file path portion specific to DeviceHandle that the EFI Image was loaded from.
Retrieve the next handle fron a RegisterProtocolNotify() event.
void dbg_efi_protocol(EFI_HANDLE handle, EFI_GUID *protocol)
Print protocol information on a given handle.
size_t efi_path_len(EFI_DEVICE_PATH_PROTOCOL *path)
Find length of device path (excluding terminator)
#define EFI_HANDLE_NAME_TYPE(protocol, name)
Define an EFI handle name type.
#define EFI_IMAGE_DOS_SIGNATURE
VOID * ImageBase
The base address at which the image was loaded.
This protocol can be used on any device handle to obtain generic path/location information concerning...
EFI Component Name Protocol as defined in the EFI 1.1 specification.
static const char * efi_binding_name(EFI_DRIVER_BINDING_PROTOCOL *binding)
Get driver binding name.
void dbg_efi_opener(EFI_HANDLE handle, EFI_GUID *protocol, EFI_OPEN_PROTOCOL_INFORMATION_ENTRY *opener)
Print opened protocol information.
static const char * efi_driver_name2(EFI_COMPONENT_NAME2_PROTOCOL *wtf)
Get driver name.
EFI_GUID efi_simple_text_output_protocol_guid
Simple text output protocol GUID.
The SIMPLE_TEXT_OUTPUT protocol is used to control text-based output devices.
int ssnprintf(char *buf, ssize_t ssize, const char *fmt,...)
Version of vsnprintf() that accepts a signed buffer size.
static EFI_DEVICE_PATH_TO_TEXT_PROTOCOL * efidpt
Device path to text protocol.
#define EFI_IMAGE_NT_SIGNATURE
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
Can be used on any image handle to obtain information about the loaded image.
This protocol converts device paths and device nodes to text.
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL * ConOut
A pointer to the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL interface that is associated with ConsoleOutHandle.
EFI_DEVICE_PATH_TO_TEXT_PROTOCOL as defined in UEFI 2.0.
#define EFI_IMAGE_DIRECTORY_ENTRY_DEBUG
char wtf[42]
Authenticator response string.
#define CODEVIEW_SIGNATURE_RSDS
Debug Data Structure defined in Microsoft C++.
UEFI Component Name 2 Protocol as defined in the UEFI 2.1 specification.
static unsigned int count
Number of entries.
EFI_SIMPLE_TEXT_INPUT_PROTOCOL * ConIn
A pointer to the EFI_SIMPLE_TEXT_INPUT_PROTOCOL interface that is associated with ConsoleInHandle.
const char * efi_locate_search_type_name(EFI_LOCATE_SEARCH_TYPE search_type)
Name locate search type.
const char * efi_devpath_text(EFI_DEVICE_PATH_PROTOCOL *path)
Get textual representation of device path.
uint64_t debug
Debug area base address.
const char * efi_handle_name(EFI_HANDLE handle)
Get name of an EFI handle.
static struct efi_handle_name_type efi_handle_name_types[]
EFI handle name types.
char * strerror(int errno)
Retrieve string representation of error number.
char * strchr(const char *src, int character)
Find character within a string.
#define CODEVIEW_SIGNATURE_MTOC
Debug Data Structure defined by Apple Mach-O to Coff utility.
#define efi_open(handle, protocol, interface)
Open protocol for ephemeral use.
UINT64 UINTN
Unsigned value of native width.
static const char * efi_pecoff_debug_name(EFI_LOADED_IMAGE_PROTOCOL *loaded)
Get PE/COFF debug filename.
size_t strnlen(const char *src, size_t max)
Get length of string.
EFI image format for PE32, PE32+ and TE.
This protocol provides the services required to determine if a driver supports a given controller.
EFI_GUID efi_device_path_protocol_guid
Device path protocol GUID.
const char * efi_guid_ntoa(CONST EFI_GUID *guid)
Convert GUID to a printable string.
EFI_GUID efi_component_name2_protocol_guid
Component name 2 protocol GUID.
#define VOID
Undeclared type.
void dbg_efi_protocols(EFI_HANDLE handle)
Print list of protocol handlers attached to a handle.
EFI_HANDLE ImageHandle
The image handle of the UEFI driver that produced this instance of the EFI_DRIVER_BINDING_PROTOCOL.
EFI_GUID efi_simple_text_input_protocol_guid
Simple text input protocol GUID.
EFI_OPEN_PROTOCOL_INFORMATION OpenProtocolInformation
#define CODEVIEW_SIGNATURE_NB10
Debug Data Structure defined in Microsoft C++.
static const char * efi_conout_name(EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *output)
Get console output handle name.
static const char * efi_first_loaded_image_name(EFI_LOADED_IMAGE_PROTOCOL *loaded)
Get initial loaded image name.
UINTN EFI_TPL
Task priority level.
EFI_PROTOCOLS_PER_HANDLE ProtocolsPerHandle
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
EFI_GUID * protocol
Protocol.
const char * efi_open_attributes_name(unsigned int attributes)
Name protocol open attributes.
int snprintf(char *buf, size_t size, const char *fmt,...)
Write a formatted string to a buffer.
Retrieve the set of handles from the handle database that support a specified protocol.
EFI_SYSTEM_TABLE * efi_systab
EFI_GUID efi_component_name_protocol_guid
Component name protocol GUID.
uint16_t protocol
Protocol ID.
EFI_LOCATE_SEARCH_TYPE
Enumeration of EFI Locate Search Types.
#define EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC
#define DBG(...)
Print a debugging message.
#define EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC
static const char * efi_binding_name2(EFI_DRIVER_BINDING_PROTOCOL *binding)
Get driver binding name.
EFI_DEVICE_PATH_TO_TEXT_PATH ConvertDevicePathToText
EFI_GUID efi_driver_binding_protocol_guid
Driver binding protocol GUID.
#define NULL
NULL pointer (VOID *)
EFI_REQUEST_PROTOCOL(EFI_DEVICE_PATH_TO_TEXT_PROTOCOL, &efidpt)
EFI_HANDLE ParentHandle
Parent image's image handle.
#define EFI_IMAGE_DEBUG_TYPE_CODEVIEW
The Visual C++ debug information.
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL * StdErr
A pointer to the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL interface that is associated with StandardErrorHandl...
const char * efi_tpl_name(EFI_TPL tpl)
Name EFI TPL.