iPXE
|
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_PROTOCOL * | efidpt |
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... | |
EFI debugging utilities.
Definition in file efi_debug.c.
Define an EFI handle name type.
protocol | Protocol interface |
name | Method to get name |
type | EFI handle name type |
Definition at line 768 of file efi_debug.c.
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
EFI_REQUEST_PROTOCOL | ( | EFI_DEVICE_PATH_TO_TEXT_PROTOCOL | , |
& | efidpt | ||
) |
Convert GUID to a printable string.
guid | GUID |
string | Printable string |
Definition at line 256 of file efi_debug.c.
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().
const char* efi_locate_search_type_name | ( | EFI_LOCATE_SEARCH_TYPE | search_type | ) |
Name locate search type.
search_type | Locate search type |
name | Locate search type name |
Definition at line 289 of file efi_debug.c.
References AllHandles, ByProtocol, ByRegisterNotify, and snprintf().
Referenced by efi_locate_handle_buffer_wrapper(), and efi_locate_handle_wrapper().
const char* efi_open_attributes_name | ( | unsigned int | attributes | ) |
Name protocol open attributes.
attributes | Protocol open attributes |
name | Protocol 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 314 of file efi_debug.c.
Referenced by dbg_efi_opener(), and efi_open_protocol_wrapper().
void dbg_efi_opener | ( | EFI_HANDLE | handle, |
EFI_GUID * | protocol, | ||
EFI_OPEN_PROTOCOL_INFORMATION_ENTRY * | opener | ||
) |
Print opened protocol information.
handle | EFI handle @V protocol Protocol GUID |
opener | Opened protocol information |
Definition at line 336 of file efi_debug.c.
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().
void dbg_efi_openers | ( | EFI_HANDLE | handle, |
EFI_GUID * | protocol | ||
) |
Print list of openers of a given protocol on a given handle.
handle | EFI handle |
protocol | Protocol GUID |
Definition at line 357 of file efi_debug.c.
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().
void dbg_efi_protocol | ( | EFI_HANDLE | handle, |
EFI_GUID * | protocol | ||
) |
Print protocol information on a given handle.
handle | EFI handle |
protocol | Protocol GUID |
Definition at line 397 of file efi_debug.c.
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().
void dbg_efi_protocols | ( | EFI_HANDLE | handle | ) |
Print list of protocol handlers attached to a handle.
handle | EFI handle |
Definition at line 424 of file efi_debug.c.
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().
const char* efi_devpath_text | ( | EFI_DEVICE_PATH_PROTOCOL * | path | ) |
Get textual representation of device path.
path | Device path |
text | Textual representation of device path, or NULL |
Definition at line 463 of file efi_debug.c.
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().
|
static |
Get driver name.
wtf | Component name protocol |
name | Driver name, or NULL |
Definition at line 503 of file efi_debug.c.
References DBG, name, NULL, snprintf(), and wtf.
|
static |
Get driver name.
wtf | Component name protocol |
name | Driver name, or NULL |
Definition at line 533 of file efi_debug.c.
References DBG, name, NULL, snprintf(), and wtf.
|
static |
Get PE/COFF debug filename.
loaded | Loaded image |
name | PE/COFF debug filename, or NULL |
Definition at line 564 of file efi_debug.c.
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, 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.
|
static |
Get initial loaded image name.
loaded | Loaded image |
name | Initial loaded image name, or NULL |
Definition at line 683 of file efi_debug.c.
References DBG, NULL, and EFI_LOADED_IMAGE_PROTOCOL::ParentHandle.
|
static |
Get loaded image name from file path.
loaded | Loaded image |
name | Loaded image name, or NULL |
Definition at line 701 of file efi_debug.c.
References DBG, efi_devpath_text(), EFI_LOADED_IMAGE_PROTOCOL::FilePath, and NULL.
|
static |
Get console input handle name.
input | Simple text input protocol |
name | Console input handle name, or NULL |
Definition at line 719 of file efi_debug.c.
References EFI_SYSTEM_TABLE::ConIn, efi_systab, and NULL.
|
static |
Get console output handle name.
output | Simple text output protocol |
name | Console output handle name, or NULL |
Definition at line 735 of file efi_debug.c.
References EFI_SYSTEM_TABLE::ConOut, efi_systab, NULL, and EFI_SYSTEM_TABLE::StdErr.
const char* efi_handle_name | ( | EFI_HANDLE | handle | ) |
Get name of an EFI handle.
handle | EFI handle |
text | Name of handle, or NULL |
Definition at line 810 of file efi_debug.c.
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_discover_one(), efipci_open(), 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().
|
static |
Device path to text protocol.
Definition at line 47 of file efi_debug.c.
Referenced by efi_devpath_text().
|
static |
HttpBootDxe module GUID.
Definition at line 51 of file efi_debug.c.
|
static |
IScsiDxe module GUID.
Definition at line 57 of file efi_debug.c.
|
static |
Old IScsi4Dxe module GUID.
Definition at line 63 of file efi_debug.c.
|
static |
UefiPxeBcDxe module GUID.
Definition at line 69 of file efi_debug.c.
|
static |
VlanConfigDxe module GUID.
Definition at line 75 of file efi_debug.c.
|
static |
|
static |
EFI handle name types.
Definition at line 774 of file efi_debug.c.
Referenced by efi_handle_name().