|
iPXE
|
EFI debugging utilities. More...
#include <stdio.h>#include <errno.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/DriverBinding.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_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_tpl_name (EFI_TPL tpl) |
| Name EFI TPL. 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_binding_name (EFI_DRIVER_BINDING_PROTOCOL *binding) |
| Get driver binding name. More... | |
| static const char * | efi_binding_name2 (EFI_DRIVER_BINDING_PROTOCOL *binding) |
| Get driver binding 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 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 610 of file efi_debug.c.
| FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
| EFI_REQUEST_PROTOCOL | ( | EFI_DEVICE_PATH_TO_TEXT_PROTOCOL | , |
| & | efidpt | ||
| ) |
| const char* efi_tpl_name | ( | EFI_TPL | tpl | ) |
Name EFI TPL.
| tpl | Task priority level |
| text | Task priority level as text |
Definition at line 55 of file efi_debug.c.
References snprintf(), TPL_APPLICATION, TPL_CALLBACK, TPL_HIGH_LEVEL, and TPL_NOTIFY.
Referenced by efi_connect(), efi_create_event_ex_wrapper(), efi_create_event_wrapper(), efi_disconnect(), efi_raise_tpl_wrapper(), and efi_restore_tpl_wrapper().
| 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 77 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 102 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 124 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 145 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 185 of file efi_debug.c.
References dbg_efi_openers(), efi_guid_ntoa(), efi_handle_name(), efi_open, handle, 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 208 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 247 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_init_application(), 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 287 of file efi_debug.c.
References DBG, name, NULL, snprintf(), and wtf.
Referenced by efi_binding_name().
|
static |
Get driver name.
| wtf | Component name protocol |
| name | Driver name, or NULL |
Definition at line 317 of file efi_debug.c.
References DBG, name, NULL, snprintf(), and wtf.
Referenced by efi_binding_name2().
|
static |
Get driver binding name.
| binding | Driver binding protocol |
| name | Driver name, or NULL |
Definition at line 347 of file efi_debug.c.
References DBG, efi_component_name_protocol_guid, efi_driver_name(), efi_open, _EFI_DRIVER_BINDING_PROTOCOL::ImageHandle, name, NULL, and rc.
|
static |
Get driver binding name.
| binding | Driver binding protocol |
| name | Driver name, or NULL |
Definition at line 376 of file efi_debug.c.
References DBG, efi_component_name2_protocol_guid, efi_driver_name2(), efi_open, _EFI_DRIVER_BINDING_PROTOCOL::ImageHandle, NULL, and rc.
|
static |
Get PE/COFF debug filename.
| loaded | Loaded image |
| name | PE/COFF debug filename, or NULL |
Definition at line 406 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 525 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 543 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 561 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 577 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 652 of file efi_debug.c.
References EFI_SYSTEM_TABLE::BootServices, count, DBG2, efi_guid_ntoa(), efi_handle_name_types, efi_open, efi_systab, EFI_BOOT_SERVICES::FreePool, handle, name, NULL, EFI_BOOT_SERVICES::ProtocolsPerHandle, rc, 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(), efi_connect_controller_wrapper(), efi_device_info(), efi_device_info_pci(), efi_disconnect(), efi_disconnect_controller_wrapper(), efi_driver_connect(), efi_driver_exclude(), 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_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_exclude(), efipci_info(), efipci_root_open(), efipci_start(), mnpnet_start(), mnptemp_create(), nii_exclude(), nii_start(), snpnet_exclude(), snpnet_insomniac_patch(), snpnet_insomniac_restore(), snpnet_is_insomniac(), snpnet_start(), snpnet_stop(), snpnet_supported(), usbio_bulk_in_poll(), usbio_bulk_out_poll(), usbio_config(), usbio_control_poll(), usbio_endpoint_open(), usbio_exclude(), 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 46 of file efi_debug.c.
Referenced by efi_devpath_text().
|
static |
EFI handle name types.
Definition at line 616 of file efi_debug.c.
Referenced by efi_handle_name().
1.8.15