summaryrefslogtreecommitdiffstats
path: root/src/include/ipxe/efi
Commit message (Collapse)AuthorAgeFilesLines
...
* [efi] Avoid unnecessarily passing pointers to EFI_HANDLEsMichael Brown2014-07-312-3/+3
| | | | | | | | | | | | efi_file_install() and efi_download_install() are both used to install onto existing handles. There is therefore no need to allow for each of their calls to InstallMultipleProtocolInterfaces() to create a new handle. By passing the handle directly (rather than a pointer to the handle), we avoid potential confusion (and erroneous debug message colours). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Allow compiler to perform type checks on EFI_HANDLEMichael Brown2014-07-311-0/+10
| | | | | | | | | The EFI headers define EFI_HANDLE as a void pointer, which renders type checking on anything dealing with EFI handles somewhat useless. Work around this bizarre sabotage attempt by redefining EFI_HANDLE as a pointer to an anonymous structure. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Use efi_handle_name() instead of efi_handle_devpath_text()Michael Brown2014-07-311-1/+0Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Add ability to dump all openers of a given protocol on a handleMichael Brown2014-07-311-1/+26
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Provide efi_handle_name() for debuggingMichael Brown2014-07-311-0/+1
| | | | | | | | Provide a function efi_handle_name() (as a generalisation of efi_handle_devpath_text()) which tries various methods to produce a human-readable name for an EFI handle. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Expand the range of well-known EFI GUIDs in debug messagesMichael Brown2014-07-313-0/+292
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Default to releasing network devices for use via SNPMichael Brown2014-07-301-2/+17
| | | | | | | | | | | | | | | | | | | | | | | | We currently treat network devices as available for use via the SNP API only if RX queue processing has been frozen. (This is similar in spirit to the way that RX queue processing is frozen for the network device currently exposed via the PXE API.) The default state of a freshly created network device is for the RX queue to not be frozen, and thus to be unavailable for use via SNP. This causes problems when devices are added through code paths other than _efidrv_start() (which explicitly releases devices for use via SNP). We don't actually need to freeze RX queue processing, since calls via the SNP API will always use netdev_poll() rather than net_poll(), and so will never trigger the RX queue processing code path anyway. We can therefore simplify the code to use a single global flag to indicate whether network devices are claimed for use by iPXE or available for use via SNP. Using a global flag allows the default state for dynamically created network devices to behave sensibly. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Include EFI_CONSOLE_CONTROL_PROTOCOL headerMichael Brown2014-07-162-1/+125
| | | | | | | | | | | | The EFI_CONSOLE_CONTROL_PROTOCOL does not exist in the current UEFI specification, but is required to enable text output on some older EFI 1.10 implementations (observed on an old iMac). The header is not present in any of the standard include directories, but can still be found in the EDK2 codebase as part of EdkCompatibilityPkg. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Allow for interception of boot services calls by loaded imageMichael Brown2014-07-161-0/+16
| | | | | | | When building with DEBUG=efi_wrap, print details of calls made by the loaded image to selected boot services functions. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Install our own disk I/O protocol and claim exclusive use of itMichael Brown2014-07-141-0/+119
| | | | | | | | | | | | | | | | | | | The EFI FAT filesystem driver has a bug: if a block device contains no FAT filesystem but does have an EFI_SIMPLE_FILE_SYSTEM_PROTOCOL instance, the FAT driver will assume that it must have previously installed the EFI_SIMPLE_FILE_SYSTEM_PROTOCOL. This causes the FAT driver to claim control of our device, and to refuse to stop driving it, which prevents us from later uninstalling correctly. Work around this bug by opening the disk I/O protocol ourselves, thereby preventing the FAT driver from opening it. Note that the alternative approach of opening the block I/O protocol (and thereby in theory preventing DiskIo from attaching to the block I/O protocol) causes an endless loop of calls to our DRIVER_STOP method when starting the EFI shell. I have no idea why this is. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Update EDK2 headersMichael Brown2014-07-1420-96/+533
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Identify autoboot device by MAC address when chainloadingMichael Brown2014-07-081-0/+14
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Allow network devices to be created on top of arbitrary SNP devicesMichael Brown2014-07-033-34/+52
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Restructure EFI driver modelMichael Brown2014-06-252-33/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | Provide a single instance of EFI_DRIVER_BINDING_PROTOCOL (attached to our image handle); this matches the expectations scattered throughout the EFI specification. Open the underlying hardware device using EFI_OPEN_PROTOCOL_BY_DRIVER and EFI_OPEN_PROTOCOL_EXCLUSIVE, to prevent other drivers from attaching to the same device. Do not automatically connect to devices when being loaded as a driver; leave this task to the platform firmware (or to the user, if loading directly from the EFI shell). When running as an application, forcibly disconnect any existing drivers from devices that we want to control, and reconnect them on exit. Provide a meaningful driver version number (based on the build timestamp), to allow platform firmware to automatically load newer versions of iPXE drivers if multiple drivers are present. Include device paths within debug messages where possible, to aid in debugging. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Provide a meaningful EFI SNP device nameMichael Brown2014-06-251-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Allow device paths to be easily included in debug messagesMichael Brown2014-06-251-16/+2Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Allow for optional protocolsMichael Brown2014-05-191-0/+17
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Disable SNP devices when running iPXE as the applicationMichael Brown2014-03-141-0/+4
| | | | | | | | | | | | | Some UEFI builds will set up a timer to continuously poll any SNP devices. This can drain packets from the network device's receive queue before iPXE gets a chance to process them. Use netdev_rx_[un]freeze() to explicitly indicate when we expect our network devices to be driven via the external SNP API (as we do with the UNDI API on the standard BIOS build), and disable the SNP API except when receive queue processing is frozen. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Allow driver to be unloadedMichael Brown2014-03-101-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [uaccess] Add memcmp_user()Michael Brown2014-01-121-0/+7
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Add missing FILE_LICENCE declarationsMarin Hannache2013-07-152-0/+4
| | | | | Signed-off-by: Marin Hannache <git@mareo.fr> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Perform meaningful error code conversionsMichael Brown2013-04-193-16/+14Star
| | | | | | | | Exploit the redefinition of iPXE error codes to include a "platform error code" to allow for meaningful conversion of EFI_STATUS values to iPXE errors and vice versa. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Remove obsolete EFI I/O implementation using EFI_CPU_IO_PROTOCOLMichael Brown2013-04-193-372/+0Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Fetch device path for loaded image during initialisationMichael Brown2013-03-271-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Add "reboot" command for EFIMichael Brown2013-03-221-0/+18
| | | | | | | | | Abstract out the ability to reboot the system to a separate reboot() function (with platform-specific implementations), add an EFI implementation, and make the existing "reboot" command available under EFI. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Provide efi_guid_ntoa() for printing EFI GUIDsMichael Brown2013-03-201-14/+5Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Add EFI-specific debugging macrosMichael Brown2013-03-202-0/+121
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Add our own EFI_LOAD_FILE_PROTOCOL implementationMichael Brown2013-03-141-0/+3
| | | | | | | | | | | | | When iPXE is used as a UEFI driver, the UEFI PXE base code currently provides the TCP/IP stack, network protocols, and user interface. This represents a substantial downgrade from the standard BIOS iPXE user experience. Fix by installing our own EFI_LOAD_FILE_PROTOCOL implementation which initiates the standard iPXE boot procedure. This upgrades the UEFI iPXE user experience to match the standard BIOS iPXE user experience. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Expose downloaded images via EFI_SIMPLE_FILE_SYSTEM_PROTOCOLMichael Brown2013-03-137-2/+800
| | | | | | | | | | | | | | | | | Expose iPXE's images as a UEFI file system, allowing the booted image to access all images downloaded by iPXE. This functionality is complementary to the custom iPXE download protocol. The iPXE download protocol allows a booted image to utilise iPXE to download arbitrary URIs, but requires the booted image to specifically support the custom iPXE download protocol. The new functionality limits the booted image to accessing only files that were already downloaded by iPXE (e.g. as part of a script), but can work with any generic UEFI image (e.g. the UEFI shell). Both protocols are provided simultaneously, and are attached to the SNP device handle. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Add last_opened_snpdev()Michael Brown2013-03-131-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Update to latest EDK2 headersMichael Brown2013-03-138-73/+125
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [uaccess] Add userptr_sub() to find the difference between two user pointersMichael Brown2012-11-051-0/+6
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Add EFI_COMPONENT_NAME2_PROTOCOL instance for each SNP deviceMichael Brown2012-10-231-0/+7
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Expose net device non-volatile settings via HIIMichael Brown2012-10-161-123/+74Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Split SNP HII functionality into a separate fileMichael Brown2012-10-161-0/+68
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Mark SNP formset compliant with IBM's Unified Configuration ManagerMichael Brown2012-10-051-0/+5
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Add EFI_LOAD_FILE_PROTOCOL headerMichael Brown2012-07-191-0/+90
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Update to current EDK2 headersMichael Brown2012-07-1924-156/+8026
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Standardise #include guard in ipxe_download.hMichael Brown2012-07-191-4/+4
| | | | | | | | The script include/ipxe/efi/import.pl relies on a particular format for the #include guard in order to detect EFI headers that are not imported. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Add iPXE download protocolJarrod Johnson2012-02-152-0/+156
| | | | | | | | | | | | | iPXE exposes some extended capabilities via the PXE FILE API to allow NBPs such as pxelinux to use protocols other than TFTP. Provide an equivalent interface as a UEFI protocol so that EFI binaries may also take advantage of iPXE's extended capabilities. This can be used with a patched version of elilo, for example: http://comments.gmane.org/gmane.comp.boot-loaders.elilo.general/147 Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Add support for HIIMichael Brown2011-04-086-0/+1316
| | | | | | | Some EFI platforms expect us to provide an HII interface to display information about the driver. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Include MdeModulePkg directory in header import listMichael Brown2011-04-081-1/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Add EFI string formatting functionsMichael Brown2011-04-081-0/+23
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Synchronise EFI header filesMichael Brown2011-03-3112-33/+100
| | | | | | Synchronised to EDK2 SVN revision 11462. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Mark SNP devices as children of EFI PCI deviceMichael Brown2011-03-151-0/+6
| | | | | | | | | | | | | Re-open the EFI_PCI_IO_PROTOCOL specifying an Attributes value of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER. This causes the SNP devices to be marked as children of the EFI PCI device (as shown in the "devtree" command). On at least one IBM blade system, this is required in order to have the relevant drivers automatically attach to the SNP controller at device creation time. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Provide space for storing the EFI driver nameMichael Brown2011-02-221-1/+1
| | | | | | | | Commit d7736fb ("[efi] Allow EFI to control PCI bus enumeration") introduced a bug in which the EFI driver name became an (uninitialised) pointer rather than an array. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Allow EFI to control PCI bus enumerationMichael Brown2011-02-173-1/+89
| | | | | | | | | | | | | | EFI performs its own PCI bus enumeration. Respect this, and start controlling devices only when instructed to do so by EFI. As a side benefit, we should now correctly create multiple SNP instances for multi-port devices. This should also fix the problem of failing to enumerate devices because the PCI bridges have not yet been enabled at the time the iPXE driver is loaded. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Rename efi_pci.h to efi_pci_api.hMichael Brown2011-02-171-5/+5
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pci] Replace pci_max_bus() with pci_num_bus()Michael Brown2011-02-171-4/+4
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Add the "snpnet" driverGeoff Lywood2010-06-022-0/+90
| | | | | | | | | Add a new network driver that consumes the EFI Simple Network Protocol. Also add a bus driver that can find the Simple Network Protocol that iPXE was loaded from; the resulting behavior is similar to the "undionly" driver for BIOS systems. Signed-off-by: Michael Brown <mcb30@ipxe.org>