summaryrefslogtreecommitdiffstats
path: root/src/interface/efi/efi_debug.c
Commit message (Collapse)AuthorAgeFilesLines
* [efi] Provide efi_tpl_name() for transcribing TPLs in debug messagesMichael Brown2025-07-141-0/+21
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Allow use of typed pointers for efi_open() et alMichael Brown2025-03-241-12/+6Star
| | | | | | | | | Provide wrapper macros to allow efi_open() and related functions to accept a pointer to any pointer type as the "interface" argument, in order to allow a substantial amount of type adjustment boilerplate to be removed. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Eliminate uses of HandleProtocol()Michael Brown2025-03-241-5/+1Star
| | | | | | | | It is now simpler to use efi_open() than to use HandleProtocol() to obtain an ephemeral protocol instance. Remove all remaining uses of HandleProtocol() to simplify the code. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Use efi_open() for all ephemeral protocol opensMichael Brown2025-03-241-38/+12Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Use driver name only from driver binding handles in debug messagesMichael Brown2025-03-211-6/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some non-driver handles may have an installed component name protocol. In particular, iPXE itself installs these protocols on its SNP device handles, to simplify the process of delegating GetControllerName() from our single-instance driver binding protocol to whatever child controllers the relevant EFI driver may have installed. For non-driver handles, the device path is more useful as debugging information than the driver name. Limit the use of the component name protocols to handles with a driver binding protocol installed, so that we will end up using the device path for non-driver handles such as the SNP device. Continue to prefer the driver name to the device path for handles with a driver binding protocol installed, since these will generally map to things we are likely to conceptualise as drivers rather than as devices. Note that we deliberately do not use GetControllerName() to attempt to get a human-readable name for a controller handle. In the normal course of events, iPXE is likely to disconnect at least some existing drivers from their controller handles. This would cause the name obtained via GetControllerName() to change. By using the device path instead, we ensure that the debug message name remains the same even when the driver controlling the handle is changed. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Prefer driver name to device path for debug messagesMichael Brown2025-03-201-3/+3
| | | | | | | | The driver name is usually more informative for debug messages than the device path from which a driver was loaded. Try using the various mechanisms for obtaining a driver name before trying the device path. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Attempt to retrieve driver name from image handle for debug messagesMichael Brown2025-03-201-0/+91
| | | | | | | | | Not all drivers will install the driver binding protocol on the image handle. Accommodate these drivers by attempting to retrieve the driver name via the component name protocol(s) located on the driver binding's ImageHandle, as well as on the driver handle itself. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Allow efi_guid_ntoa() to be used in non-EFI buildsMichael Brown2025-03-111-236/+0Star
| | | | | | | | | | | The debug message transcription of well-known EFI GUIDs does not require any EFI boot services calls. Move this code from efi_debug.c to efi_guid.c, to allow it to be linked in to non-EFI builds. We continue to rely on linker garbage collection to ensure that the code is omitted completely from any non-debug builds. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Add EFI_SIGNATURE_LIST header and GUID definitionsMichael Brown2025-03-101-0/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Add EFI_TCG2_PROTOCOL header and GUID definitionMichael Brown2024-12-171-0/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Use long forms of device paths in debug messagesMichael Brown2024-03-041-1/+1
| | | | | | | | | | | | | | We currently call ConvertDevicePathToText() with DisplayOnly=TRUE when constructing a device path to appear within a debug message. For ATAPI device paths, this will unfortunately omit some key information: the textual representation will not indicate which ATA bus or drive is represented. This can lead to misleading debug messages that appear to refer to identical devices. Fix by setting DisplayOnly=FALSE to select the long form of device path textual representations. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Avoid modifying PE/COFF debug filenameMichael Brown2023-11-291-2/+2
| | | | | | | | | | | | | The function efi_pecoff_debug_name() (called by efi_handle_name()) is used to extract a filename from the debug data directory entry located within a PE/COFF image. The name is copied into a temporary static buffer to allow for modifications, but the code currently erroneously modifies the original name within the loaded PE/COFF image. Fix by performing the modification on the copy in the temporary buffer, as originally intended. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Include protocol interface address in debug outputMichael Brown2023-06-081-5/+29
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Add UefiPxeBcDxe module GUIDMichael Brown2023-06-071-0/+8
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Add HttpBootDxe module GUIDMichael Brown2023-06-071-0/+8
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Add new IScsiDxe module GUIDMichael Brown2023-06-071-1/+9
| | | | | | | | | The old IPv4-only IScsiDxe driver in MdeModulePkg/Universal/Network was replaced by a dual-stack IScsiDxe driver in NetworkPkg. Add the module GUID for this driver. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Add HTTP header and GUID definitionsMichael Brown2023-06-071-0/+4
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Add DNS headers and GUID definitionsMichael Brown2023-06-071-0/+8
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Add Ip4Config2 header and GUID definitionMichael Brown2023-06-071-0/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Add IPv6 versions of existing IPv4 headers and GUID definitionsMichael Brown2023-06-071-0/+22
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Add definitions for the UEFI shim lock protocolMichael Brown2023-05-221-0/+2
| | | | | | | | | The UEFI shim includes a "shim lock protocol" that can be used by a third party second stage loader such as GRUB to verify a kernel image. Add definitions for the relevant portions of this protocol interface. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Allow for longer device paths in debug messagesb1f6c1c42020-12-291-1/+1
| | | | | Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Split out dbg_efi_opener() as a standalone functionMichael Brown2020-11-301-15/+24
| | | | | | | Allow external code to dump the information for an opened protocol information entry via DBG_EFI_OPENER() et al. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Split device path functions out to efi_path.cMichael Brown2020-10-161-2/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Add debug wrappers for all boot services functions of interestMichael Brown2020-09-191-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Fix "'%s' directive argument is null" errorValentine Barshak2019-07-221-2/+1Star
| | | | | | | | | | | | Use '%p' directive, and print handle's address if the address is null and the handle doesn't have a name. This fixes the following compilation error: interface/efi/efi_debug.c:334:3: error: '%s' directive argument is null [-Werror=format-overflow=] Signed-off-by: Valentine Barshak <gvaxon@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Add EFI_ACPI_TABLE_PROTOCOL header and GUID definitionMichael Brown2017-03-101-0/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Add EFI_BLOCK_IO2_PROTOCOL header and GUID definitionMichael Brown2016-10-171-0/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Expose DHCP packets via the Apple NetBoot protocolMichael Brown2016-05-291-0/+2
| | | | | | | | Mac OS X uses non-standard EFI protocols to obtain the DHCP packets from the UEFI firmware. Originally-implemented-by: Michael Kuron <m.kuron@gmx.de> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Import EFI_HII_FONT_PROTOCOL definitionsMichael Brown2015-10-071-0/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Provide efi_devpath_len()Michael Brown2015-09-131-10/+2Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Add USB headers and GUID definitionsMichael Brown2015-09-061-0/+6
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Add definitions of GUIDs observed when booting wdsmgfw.efiMichael Brown2015-09-011-0/+54
| | | | | | | Add definitions of protocols observed to be used by wdsmgfw.efi, and add a handle name type for ConIn, ConOut, and StdErr. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Improve efi_wrap debuggingMichael Brown2015-08-271-1/+22
| | | | | | | Add debug wrappers for more boot services functions, and print symbolic values rather than raw numbers where possible. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Include installed protocol list in unknown handle namesMichael Brown2015-08-271-3/+19
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Remove raw EFI_HANDLE values from debug messagesMichael Brown2015-08-271-15/+19
| | | | | | | | | The raw EFI_HANDLE value is almost never useful to know, and simply adds noise to the already verbose debug messages. Improve the legibility of debug messages by using only the name generated by efi_handle_name(). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Mark EFI debug transcription functions as __attribute__ (( pure ))Michael Brown2015-08-271-3/+4
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Add definitions of GUIDs observed when booting shim.efi and grub.efiMichael Brown2015-08-271-0/+8
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [base16] Add buffer size parameter to base16_encode() and base16_decode()Michael Brown2015-04-241-1/+1
| | | | | | | | | | | | | | The current API for Base16 (and Base64) encoding requires the caller to always provide sufficient buffer space. This prevents the use of the generic encoding/decoding functionality in some situations, such as in formatting the hex setting types. Implement a generic hex_encode() (based on the existing format_hex_setting()), implement base16_encode() and base16_decode() in terms of the more generic hex_encode() and hex_decode(), and update all callers to provide the additional buffer length parameter. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Relicense files under GPL2_OR_LATER_OR_UBDLMichael Brown2015-03-021-1/+5
| | | | | | | Relicense files for which I am the sole author (as identified by util/relicense.pl). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Add definitions of GUIDs observed when chainloading from Intel driverMichael Brown2014-09-251-2/+50
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Centralise definitions of more protocol GUIDsMichael Brown2014-09-251-0/+6
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Add definitions of GUIDs observed during Windows bootMichael Brown2014-08-211-0/+6
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Move abstract device path and handle functions to efi_utils.cMichael Brown2014-08-061-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Provide centralised definitions of commonly-used GUIDsMichael Brown2014-08-061-72/+0Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Print raw device path when we have no DevicePathToTextProtocolMichael Brown2014-08-011-4/+18
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Also try original ComponentName protocol for retrieving driver namesMichael Brown2014-08-011-1/+34
| | | | | | | The ComponentName and ComponentName2 protocols differ only in the standard which is used for language name codes. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Add excessive sanity checks into efi_debug functionsMichael Brown2014-08-011-3/+53
| | | | | | | | Try very hard to avoid ever doing something invalid while attempting to generate a debug message. Debugged-by: Curtis Larsen <larsen@dixie.edu> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Improve debugging of the debugging facilitiesMichael Brown2014-08-011-17/+41
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Use efi_handle_name() instead of efi_handle_devpath_text()Michael Brown2014-07-311-34/+0Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>