summaryrefslogtreecommitdiff
path: root/include/efi_api.h
AgeCommit message (Collapse)AuthorFilesLines
2019-05-07efi_loader: signature of ExitBootServices()Heinrich Schuchardt1-1/+2
Consistently use efi_uintn_t as type of memory keys. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Alexander Graf <graf@amazon.com>
2019-05-07efi_loader: implement UnloadImage()Heinrich Schuchardt1-1/+1
Implement the UnloadImage() boot service Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-04-23efi_loader: consistent naming of protocol GUIDsHeinrich Schuchardt1-11/+7
We should consistently use the same name for protocol GUIDs as defined in the UEFI specification. Not adhering to this rule has led to duplicate definitions for the EFI_LOADED_IMAGE_PROTOCOL_GUID. Adjust misnamed protocol GUIDs. Adjust the text for the graphics output protocol in the output of the `efidebug dh` command. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-04-07efi_loader: boottime: add loaded image device path protocol to image handleAKASHI Takahiro1-0/+4
To meet UEFI spec v2.7a section 9.2, we should add EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL to image handle, instead of EFI_DEVICE_PATH_PROTOCOL. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-03-27efi_loader: TODO for the EFI file protocolHeinrich Schuchardt1-1/+7
We currently only support EFI_FILE_PROTOCOL_REVISION while UEFI specs 2.4 - 2.7 prescribe EFI_FILE_PROTOCOL_REVISION2. Add a todo. Add missing constants for the EFI file protocol revision. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-02-25efi_loader: define load option attributesAKASHI Takahiro1-0/+9
See UEFI specification v2.7a, section 3.1.3, "Load Option Processing." Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2019-02-13efi: hii: add HII config routing/access protocolsAKASHI Takahiro1-0/+161
This patch is a place holder for HII configuration routing protocol and HII configuration access protocol. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Signed-off-by: Alexander Graf <agraf@suse.de>
2019-02-13efi: hii: add keyboard layout package supportAKASHI Takahiro1-0/+6
Allow for handling keyboard layout package in HII database protocol. A package can be added or deleted in HII database protocol, but we don't set 'current' keyboard layout as there is no driver that requests a keyboard layout. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Signed-off-by: Alexander Graf <agraf@suse.de>
2019-02-13efi: hii: add guid package supportAKASHI Takahiro1-0/+9
Allow for handling GUID package in HII database protocol. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Signed-off-by: Alexander Graf <agraf@suse.de>
2019-02-13efi_loader: Initial HII database protocolsLeif Lindholm1-1/+244
This patch provides enough implementation of the following protocols to run EDKII's Shell.efi and UEFI SCT: * EfiHiiDatabaseProtocol * EfiHiiStringProtocol Not implemented are: * ExportPackageLists() * RegisterPackageNotify()/UnregisterPackageNotify() * SetKeyboardLayout() (i.e. *current* keyboard layout) HII database protocol in this patch series can handle only: * GUID package * string package * keyboard layout package (The other packages, except Device path package, will be necessary for interactive and graphical UI.) Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org> Signed-off-by: Rob Clark <robdclark@gmail.com> Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Signed-off-by: Alexander Graf <agraf@suse.de>
2019-02-13efi_loader: remove duplicate GUID definitionHeinrich Schuchardt1-3/+0
Remove duplicate definition o EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2019-02-13efi_loader: use u16* for file nameHeinrich Schuchardt1-1/+1
UTF-16 strings in our code should all be u16 *. Fix an inconsistency for file names which may lead to a warning for printf("%ls", ). Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2019-02-13efi_loader: efi_set_variable use const void *Heinrich Schuchardt1-1/+2
The SetVariable() runtime service does not change the data passed to it. So mark the parameter as constant. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2019-02-13efi_loader: use const efi_guid_t * for variable servicesHeinrich Schuchardt1-3/+5
The runtime variable services never change GUIDs. So we should declare the GUID parameters as constant. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2019-02-13efi_loader: signature of StartImage and ExitHeinrich Schuchardt1-3/+3
We use u16* for Unicode strings and efi_uintn_t for UINTN. Correct the signature of efi_exit() and efi_start_image(). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2019-02-13efi_loader: struct efi_configuration_tableHeinrich Schuchardt1-1/+1
Commit 393fccdf6c73 ("efi_loader: efi_guid_t must be 64-bit aligned") has changed the alignment of efi_guid_t. This changed the size of struct efi_configuration_table on 32-bit systems form 20 to 24 bytes. As an array of this type is pointed to by the system table this breaks compatibility with existing versions of GRUB and Linux. Let's get back the original size by using the attribute __packed. Fixes: 393fccdf6c73 ("efi_loader: efi_guid_t must be 64-bit aligned") Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-12-02efi_loader: use u16* for UTF16 stringsHeinrich Schuchardt1-1/+1
We should be consistent in the types that we use to store Unicode strings. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-12-02efi_loader: correct a function prototype of QueryCapsuleCapabilities()AKASHI Takahiro1-2/+2
See UEFI specification v2.7, section 8.5.3. Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-12-02efi_loader: typedef struct efi_object *efi_handle_tHeinrich Schuchardt1-4/+4
All our handles point to a struct efi_object. So let's define the efi_handle_t accordingly. This helps us to discover coding errors much more easily. This becomes evident by the corrections to the usage of handles in this patch. Rename variable image_handle to image_obj where applicable. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-10-16efi_loader: correct signature of GetPosition, SetPositionHeinrich Schuchardt1-2/+2
The UEFI spec requires that file positions are passed as u64 in GetPosition() and SetPosition(). Check if the file handle points to a directory in GetPosition(). Provide a unit test for GetPosition() and SetPosition(). Fix Coverity warning CID 184079 (CONSTANT_EXPRESSION_RESULT). Add comments. Fixes: b6dd57773719 ("efi_loader: use correct types in EFI_FILE_PROTOCOL") Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-09-23efi_loader: refactor efi_setup_loaded_image()Heinrich Schuchardt1-8/+0
Create the handle of loaded images and the EFI_LOADED_IMAGE_PROTOCOL inside efi_setup_loaded_image(). Do not use local variables. Currently we expect the loaded image handle to point to the loaded image protocol. Additionally we have appended private fields to the protocol. With the patch the handle points to a loaded image object and the private fields are added here. This matches how we handle the net and the gop object. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-09-23efi_loader: EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOLHeinrich Schuchardt1-0/+56
This patch implements the EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL. The implementation of notification functions is postponed to a later patch. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-09-23efi_loader: SPDX-License-Identifier for efi_api.hHeinrich Schuchardt1-18/+10
Add the missing SPDX-License-Identifier based on Linux kernel commit b24413180f56 ("License cleanup: add SPDX GPL-2.0 license identifier to files with no license"). Correct formatting errors. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-09-23efi_loader: struct efi_simple_text_input_protocolHeinrich Schuchardt1-5/+5
%s/efi_simple_input_interface/efi_simple_text_input_protocol/ We should be consistent in the naming of the EFI protocol interface structures. The protocol is called EFI_SIMPLE_TEXT_INPUT_PROTOCOL. %s/ExtendedVerification/extended_verification/ Use consistent naming of function parameters. Do not use CamelCase. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-09-23efi_loader: EFI_UNICODE_COLLATION_PROTOCOLHeinrich Schuchardt1-0/+21
The patch implements the EFI_UNICODE_COLLATION_PROTOCOL. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-07-25efi_loader: correct signature of CalculateCrc32()Heinrich Schuchardt1-2/+3
Use const for the buffer. We are not changing the buffer. Use efi_uintn_t where prescribed by the UEFI spec. Prefer u32 over uint32_t. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-07-25efi_loader: provide firmware revisionHeinrich Schuchardt1-1/+1
Provide a firmware revision in the system table using the Makefile variables VERSION and PATCHLEVEL, e.g. 0x20180700 for v2018.07. Correct the type of the firmware vendor. It is a u16* pointer. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-07-25efi_loader: correct EFI_RUNTIME_SERVICES_SIGNATUREHeinrich Schuchardt1-1/+1
The value for EFI_RUNTIME_SERVICES_SIGNATURE does not match the UEFI spec 2.7. Reported-by: Takahiro Akashi <takahiro.akashi@linaro.org> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-07-25efi_loader: specify UEFI spec revisionHeinrich Schuchardt1-1/+4
Both in the boot and the runtime services tables we have to specify the UEFI spec revision. The same value is already used for the system table. So let's use a common constant. In the boot services table we have to provide the header signature. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-07-25efi_loader: set revision in loaded image protocolHeinrich Schuchardt1-0/+2
The revision number has to be set in the loaded image protocol. The problem was detected by running the SCT in Protocol/LoadedImage/BlackBoxTest/LoadedImageBBTestMain.c:890 Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-07-02efi_loader: Install ACPI configuration tablesBin Meng1-0/+4
ACPI tables can be passed via EFI configuration table to an EFI application. This is only supported on x86 so far. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2018-06-03efi_loader: adjust definitions of variable servicesHeinrich Schuchardt1-12/+12
The definitons of the variable services are adjusted: - use efi_uintn_t instead of unsigned long - use u16 * instead of s16 * for Unicode strings - correct definition of QueryVariableInfo - rename efi_get_next_variable to efi_get_next_variable_name Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-04-23efi_loader: complete EFI_DEVICE_PATH_UTILITIES_PROTOCOLHeinrich Schuchardt1-0/+1
The missing services of the EFI_DEVICE_PATH_UTILITIES_PROTOCOL are implemented. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-04-05efi_loader: implement EFI_FILE_SYSTEM_INFOHeinrich Schuchardt1-0/+13
Implement the information type EFI_FILE_SYSTEM_INFO in the service GetInfo() of the EFI_FILE_PROTOCOL. The volume label is not available in U-Boot. As a work-around use the partition name instead. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-04-05efi_loader: use const for GUIDs in the EFI_FILE_PROTOCOLHeinrich Schuchardt1-2/+2
Use const efi_guid_t* when passing GUIDs. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-04-04efi_loader: use correct types in EFI_FILE_PROTOCOLHeinrich Schuchardt1-6/+8
In the EFI_FILE_PROTOCOL buffer sizes and positions are passed as UINTN and not as u64. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-04-04efi_loader: correct types for EFI_LOADED_IMAGE_PROTOCOLHeinrich Schuchardt1-2/+2
We should not use void * but specific types for * device_handle * file_path Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-04-04efi_loader: save image relocation address and sizeHeinrich Schuchardt1-0/+2
For analyzing crash output the relocation address and size are needed. Save them in the loaded image info. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-04-04efi_loader: use efi_uintn_t for LoadImageHeinrich Schuchardt1-1/+1
We generally use efi_uintn_t where the UEFI spec uses UINTN. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-04-04efi_loader: complete efi_pxe_mode struct definitionPatrick Wildt1-2/+23
The efi_pxe_mode struct which represents the PXE_BASE_CODE_PROTOCOL Replace the placeholder paddings in the efi_pxe_mode struct with the actual fields as defined in UEFI's PXE Base Code Protocol. Since our efi_ip_address is a simple char array set a specific alignment to the efi_ip_address fields, as expected by the UEFI spec. Signed-off-by: Patrick Wildt <patrick@blueri.se> [agraf: s/pxe_discovervalid/pxe_discover_valid] Signed-off-by: Alexander Graf <agraf@suse.de>
2018-04-04efi_loader: add missing EFI_RESET_PLATFORM_SPECIFICHeinrich Schuchardt1-1/+2
EFI_RESET_PLATFORM_SPECIFIC is one of the values that can be used for the EFI service ResetSystem. The missing definition is added. The value has to handled in efi_reset_system(). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-04-04efi_loader: implement missing bit blit operations in gopHeinrich Schuchardt1-1/+9
With the patch all block image transfer operations of the EFI_GRAPHICS_OUTPUT_PROTOCOL are supported. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-04-04efi_loader: define GUIDS for event groupsHeinrich Schuchardt1-0/+21
Event groups are used to signal multiple events at the same time. They are identified by GUIDs. This patch provided the predefined GUIDs of UEFI specification 2.7. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-04-04efi_loader: Initial EFI_DEVICE_PATH_UTILITIES_PROTOCOLLeif Lindholm1-0/+29
Not complete, but enough for Shell.efi and SCT.efi. We'll implement the rest as needed or once we have SCT running properly so there is a way to validate the interface against the conformance test suite. Initial skeleton written by Leif, and then implementation by Rob. Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org> [Fill initial skeleton] Signed-off-by: Rob Clark <robdclark@gmail.com> [Rebase on v2018.03-rc1] Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-04-04efi_loader: remove deprecated ConsoleControlProtocolHeinrich Schuchardt1-18/+0
The console control protocol is not defined in the UEFI standard. It exists in EDK2's EdkCompatiblityPkg package. But this package is deprecated according to https://github.com/tianocore/tianocore.github.io/wiki/Differences-between-EDK-and-EDK-II Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-02-10efi_loader: add missing runtime services stubsHeinrich Schuchardt1-3/+25
Add stubs for UpdateCapsule, QueryCapsuleCapabilities, and QueryVariableInfo. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-02-10efi_loader: create stub for CreateEventExHeinrich Schuchardt1-1/+8
Currently we set the function pointer for the CreateEventEx boot service to NULL. When called this would lead to an immediate failure. A function stub is provided which handles the case that the boot service is called without an event group and returns EFI_UNSUPPORTED otherwise. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-01-23efi_loader: fix ExitBootServicesHeinrich Schuchardt1-3/+3
This patch lets the implementation of ExitBootServices conform to the UEFI standard. The timer events must be disabled before calling the notification functions of the exit boot services events. The boot services must be disabled in the system table. The handles in the system table should be defined as efi_handle_t. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-01-23efi_loader: correct EFI_BLOCK_IO_PROTOCOL definitionsHeinrich Schuchardt1-2/+10
Add the revision constants. Depending on the revision additional fields are needed in the media descriptor. Use efi_uintn_t for number of bytes to read or write. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2018-01-23efi_loader: consistently use efi_handle_t for handlesHeinrich Schuchardt1-9/+11
We should consistently use the efi_handle_t typedef when referring to handles. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Alexander Graf <agraf@suse.de>