mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-06-05 14:21:37 +00:00
Pull request for UEFI sub-system for v2019.07-rc1 (2)
In the aarch64 crash dump information about the loaded EFI images is added. In README.uefi the development target is for the UEFI subsystem is described as "Embedded Base Boot Requirements (EBBR) Specification" compliance. Several bug fixes are supplied. -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEbcT5xx8ppvoGt20zxIHbvCwFGsQFAlyyzHEACgkQxIHbvCwF GsS+9Q/9HahVvxHFljI8ymxznml7AlFCrxWwcVo5HhftbGuQIgF3NMXRlsxmsSPM Z+Cc3EFni4EWWWe9yDMLqXV4NCd6bnfWYWP4UvbqAKCfeX8jScRyMypPnxZ3rNrg oe/8zDT9qXQnEah4sB+AQhar2VRTS1p97wKDObt3mj9c2g5pGL1zdejS/4SfnCd0 a1BymV7p7fpykDjW8S0GQM56QAkbB9CJ4Q7nlPCDlspqJlQB318lWs46FfUn2Aue DNLm0uscrMZtEr/aAdT+r/96GIq4AVkexy7b5MZ0v/NDNAtmIqO1ORUmLSNSDfcM /cbtxq53VbeztMzMoYDdU0zNR//N4dL3GbSRKJulksvxeIExCp3dRV7gfTOwWq7J Lg/b43WJI1f2vgXDgEPddTO3E3SPjCGQcnCNOcVNNfTkyrtVaCmRYh69lV2BpKKF oQCYQyzS8yYLxj16YXixK9seyQYxh/vPYVT78ed5A8B1dmyxSQMnEJjY93jngj1g k5DRH9nnx12aeEqkhsWvVdHT0OBNj/+oZlzT3KGDcxhrDeZXAgqxAO1oPG85Wqnx kPeadyVD0T5Dd8fpMqF+tToB+GCbvyUVJsVlNqDSC7NslJ3AbxBKNDuEsMJlXgwL Yh4/lusg/YXzZ4ACWHgUnckZDVZGNj+58QRgEU+3mZinMjDS38E= =QdJl -----END PGP SIGNATURE----- Merge tag 'efi-2019-07-rc1-2' of git://git.denx.de/u-boot-efi Pull request for UEFI sub-system for v2019.07-rc1 (2) In the aarch64 crash dump information about the loaded EFI images is added. In README.uefi the development target is for the UEFI subsystem is described as "Embedded Base Boot Requirements (EBBR) Specification" compliance. Several bug fixes are supplied.
This commit is contained in:
commit
38f94d3539
14 changed files with 146 additions and 101 deletions
|
@ -25,6 +25,11 @@ int disable_interrupts(void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void show_efi_loaded_images(struct pt_regs *regs)
|
||||
{
|
||||
efi_print_image_infos((void *)regs->elr);
|
||||
}
|
||||
|
||||
void show_regs(struct pt_regs *regs)
|
||||
{
|
||||
int i;
|
||||
|
@ -49,6 +54,7 @@ void do_bad_sync(struct pt_regs *pt_regs, unsigned int esr)
|
|||
efi_restore_gd();
|
||||
printf("Bad mode in \"Synchronous Abort\" handler, esr 0x%08x\n", esr);
|
||||
show_regs(pt_regs);
|
||||
show_efi_loaded_images(pt_regs);
|
||||
panic("Resetting CPU ...\n");
|
||||
}
|
||||
|
||||
|
@ -60,6 +66,7 @@ void do_bad_irq(struct pt_regs *pt_regs, unsigned int esr)
|
|||
efi_restore_gd();
|
||||
printf("Bad mode in \"Irq\" handler, esr 0x%08x\n", esr);
|
||||
show_regs(pt_regs);
|
||||
show_efi_loaded_images(pt_regs);
|
||||
panic("Resetting CPU ...\n");
|
||||
}
|
||||
|
||||
|
@ -71,6 +78,7 @@ void do_bad_fiq(struct pt_regs *pt_regs, unsigned int esr)
|
|||
efi_restore_gd();
|
||||
printf("Bad mode in \"Fiq\" handler, esr 0x%08x\n", esr);
|
||||
show_regs(pt_regs);
|
||||
show_efi_loaded_images(pt_regs);
|
||||
panic("Resetting CPU ...\n");
|
||||
}
|
||||
|
||||
|
@ -82,6 +90,7 @@ void do_bad_error(struct pt_regs *pt_regs, unsigned int esr)
|
|||
efi_restore_gd();
|
||||
printf("Bad mode in \"Error\" handler, esr 0x%08x\n", esr);
|
||||
show_regs(pt_regs);
|
||||
show_efi_loaded_images(pt_regs);
|
||||
panic("Resetting CPU ...\n");
|
||||
}
|
||||
|
||||
|
@ -93,6 +102,7 @@ void do_sync(struct pt_regs *pt_regs, unsigned int esr)
|
|||
efi_restore_gd();
|
||||
printf("\"Synchronous Abort\" handler, esr 0x%08x\n", esr);
|
||||
show_regs(pt_regs);
|
||||
show_efi_loaded_images(pt_regs);
|
||||
panic("Resetting CPU ...\n");
|
||||
}
|
||||
|
||||
|
@ -104,6 +114,7 @@ void do_irq(struct pt_regs *pt_regs, unsigned int esr)
|
|||
efi_restore_gd();
|
||||
printf("\"Irq\" handler, esr 0x%08x\n", esr);
|
||||
show_regs(pt_regs);
|
||||
show_efi_loaded_images(pt_regs);
|
||||
panic("Resetting CPU ...\n");
|
||||
}
|
||||
|
||||
|
@ -115,6 +126,7 @@ void do_fiq(struct pt_regs *pt_regs, unsigned int esr)
|
|||
efi_restore_gd();
|
||||
printf("\"Fiq\" handler, esr 0x%08x\n", esr);
|
||||
show_regs(pt_regs);
|
||||
show_efi_loaded_images(pt_regs);
|
||||
panic("Resetting CPU ...\n");
|
||||
}
|
||||
|
||||
|
@ -129,5 +141,6 @@ void __weak do_error(struct pt_regs *pt_regs, unsigned int esr)
|
|||
efi_restore_gd();
|
||||
printf("\"Error\" handler, esr 0x%08x\n", esr);
|
||||
show_regs(pt_regs);
|
||||
show_efi_loaded_images(pt_regs);
|
||||
panic("Resetting CPU ...\n");
|
||||
}
|
||||
|
|
|
@ -111,13 +111,13 @@ static efi_status_t copy_fdt(void **fdtp)
|
|||
new_fdt_addr = (uintptr_t)map_sysmem(fdt_ram_start + 0x7f00000 +
|
||||
fdt_size, 0);
|
||||
ret = efi_allocate_pages(EFI_ALLOCATE_MAX_ADDRESS,
|
||||
EFI_RUNTIME_SERVICES_DATA, fdt_pages,
|
||||
EFI_BOOT_SERVICES_DATA, fdt_pages,
|
||||
&new_fdt_addr);
|
||||
if (ret != EFI_SUCCESS) {
|
||||
/* If we can't put it there, put it somewhere */
|
||||
new_fdt_addr = (ulong)memalign(EFI_PAGE_SIZE, fdt_size);
|
||||
ret = efi_allocate_pages(EFI_ALLOCATE_MAX_ADDRESS,
|
||||
EFI_RUNTIME_SERVICES_DATA, fdt_pages,
|
||||
EFI_BOOT_SERVICES_DATA, fdt_pages,
|
||||
&new_fdt_addr);
|
||||
if (ret != EFI_SUCCESS) {
|
||||
printf("ERROR: Failed to reserve space for FDT\n");
|
||||
|
|
|
@ -154,6 +154,13 @@ static int initr_reloc_global_data(void)
|
|||
gd->fdt_blob += gd->reloc_off;
|
||||
#endif
|
||||
#ifdef CONFIG_EFI_LOADER
|
||||
/*
|
||||
* On the ARM architecture gd is mapped to a fixed register (r9 or x18).
|
||||
* As this register may be overwritten by an EFI payload we save it here
|
||||
* and restore it on every callback entered.
|
||||
*/
|
||||
efi_save_gd();
|
||||
|
||||
efi_runtime_relocate(gd->relocaddr, NULL);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -14,9 +14,11 @@ and boot loaders like GRUB or the FreeBSD loader can be executed.
|
|||
|
||||
## Development target
|
||||
|
||||
The implementation of UEFI in U-Boot strives to reach the minimum requirements
|
||||
described in "Server Base Boot Requirements System Software on ARM Platforms -
|
||||
Version 1.1" [4].
|
||||
The implementation of UEFI in U-Boot strives to reach the requirements described
|
||||
in the "Embedded Base Boot Requirements (EBBR) Specification - Release v1.0"
|
||||
[4]. The "Server Base Boot Requirements System Software on ARM Platforms" [5]
|
||||
describes a superset of the EBBR specification and may be used as further
|
||||
reference.
|
||||
|
||||
A full blown UEFI implementation would contradict the U-Boot design principle
|
||||
"keep it small".
|
||||
|
@ -344,5 +346,7 @@ This driver is only available if U-Boot is configured with
|
|||
http://uefi.org/specifications - UEFI specifications
|
||||
* [2](./driver-model/README.txt) doc/driver-model/README.txt - Driver model
|
||||
* [3](./README.iscsi) doc/README.iscsi - iSCSI booting with U-Boot and iPXE
|
||||
* [4](https://developer.arm.com/docs/den0044/latest/server-base-boot-requirements-system-software-on-arm-platforms-version-11)
|
||||
* [4](https://github.com/ARM-software/ebbr/releases/download/v1.0/ebbr-v1.0.pdf)
|
||||
Embedded Base Boot Requirements (EBBR) Specification - Release v1.0
|
||||
* [5](https://developer.arm.com/docs/den0044/latest/server-base-boot-requirements-system-software-on-arm-platforms-version-11)
|
||||
Server Base Boot Requirements System Software on ARM Platforms - Version 1.1
|
||||
|
|
|
@ -190,7 +190,7 @@ enum efi_mem_type {
|
|||
#define EFI_MEM_DESC_VERSION 1
|
||||
|
||||
#define EFI_PAGE_SHIFT 12
|
||||
#define EFI_PAGE_SIZE (1UL << EFI_PAGE_SHIFT)
|
||||
#define EFI_PAGE_SIZE (1ULL << EFI_PAGE_SHIFT)
|
||||
#define EFI_PAGE_MASK (EFI_PAGE_SIZE - 1)
|
||||
|
||||
struct efi_mem_desc {
|
||||
|
|
|
@ -344,6 +344,9 @@ efi_status_t efi_remove_protocol(const efi_handle_t handle,
|
|||
void *protocol_interface);
|
||||
/* Delete all protocols from a handle */
|
||||
efi_status_t efi_remove_all_protocols(const efi_handle_t handle);
|
||||
/* Install multiple protocol interfaces */
|
||||
efi_status_t EFIAPI efi_install_multiple_protocol_interfaces
|
||||
(efi_handle_t *handle, ...);
|
||||
/* Call this to create an event */
|
||||
efi_status_t efi_create_event(uint32_t type, efi_uintn_t notify_tpl,
|
||||
void (EFIAPI *notify_function) (
|
||||
|
|
|
@ -300,9 +300,6 @@ efi_status_t efi_driver_init(void)
|
|||
struct driver *drv;
|
||||
efi_status_t ret = EFI_SUCCESS;
|
||||
|
||||
/* Save 'gd' pointer */
|
||||
efi_save_gd();
|
||||
|
||||
debug("EFI: Initializing EFI driver framework\n");
|
||||
for (drv = ll_entry_start(struct driver, driver);
|
||||
drv < ll_entry_end(struct driver, driver); ++drv) {
|
||||
|
|
|
@ -26,6 +26,16 @@ config EFI_UNICODE_CAPITALIZATION
|
|||
set, only the the correct handling of the letters of the codepage
|
||||
used by the FAT file system is ensured.
|
||||
|
||||
config EFI_PLATFORM_LANG_CODES
|
||||
string "Language codes supported by firmware"
|
||||
depends on EFI_LOADER
|
||||
default "en-US"
|
||||
help
|
||||
This value is used to initialize the PlatformLangCodes variable. Its
|
||||
value is a semicolon (;) separated list of language codes in native
|
||||
RFC 4646 format, e.g. "en-US;de-DE". The first language code is used
|
||||
to initialize the PlatformLang variable.
|
||||
|
||||
config EFI_LOADER_BOUNCE_BUFFER
|
||||
bool "EFI Applications use bounce buffers for DMA operations"
|
||||
depends on EFI_LOADER && ARM64
|
||||
|
@ -38,14 +48,11 @@ config EFI_LOADER_BOUNCE_BUFFER
|
|||
config EFI_LOADER_HII
|
||||
bool "Expose HII protocols to EFI applications"
|
||||
depends on EFI_LOADER
|
||||
default n
|
||||
default y
|
||||
help
|
||||
The Human Interface Infrastructure is a complicated framework that
|
||||
allows UEFI applications to draw fancy menus and hook strings using
|
||||
a translation framework.
|
||||
|
||||
U-Boot implements enough of its features to be able to run the UEFI
|
||||
Shell, but not more than that. The code is experimental still, so
|
||||
beware that your system might break with HII enabled.
|
||||
|
||||
If unsure, say n.
|
||||
Shell, but not more than that.
|
||||
|
|
|
@ -1569,26 +1569,6 @@ efi_status_t efi_setup_loaded_image(struct efi_device_path *device_path,
|
|||
if (ret != EFI_SUCCESS)
|
||||
goto failure;
|
||||
|
||||
#if CONFIG_IS_ENABLED(EFI_LOADER_HII)
|
||||
ret = efi_add_protocol(&obj->header,
|
||||
&efi_guid_hii_string_protocol,
|
||||
(void *)&efi_hii_string);
|
||||
if (ret != EFI_SUCCESS)
|
||||
goto failure;
|
||||
|
||||
ret = efi_add_protocol(&obj->header,
|
||||
&efi_guid_hii_database_protocol,
|
||||
(void *)&efi_hii_database);
|
||||
if (ret != EFI_SUCCESS)
|
||||
goto failure;
|
||||
|
||||
ret = efi_add_protocol(&obj->header,
|
||||
&efi_guid_hii_config_routing_protocol,
|
||||
(void *)&efi_hii_config_routing);
|
||||
if (ret != EFI_SUCCESS)
|
||||
goto failure;
|
||||
#endif
|
||||
|
||||
*info_ptr = info;
|
||||
*handle_ptr = obj;
|
||||
|
||||
|
@ -2287,7 +2267,7 @@ out:
|
|||
*
|
||||
* Return: status code
|
||||
*/
|
||||
static efi_status_t EFIAPI efi_install_multiple_protocol_interfaces
|
||||
efi_status_t EFIAPI efi_install_multiple_protocol_interfaces
|
||||
(efi_handle_t *handle, ...)
|
||||
{
|
||||
EFI_ENTRY("%p", handle);
|
||||
|
|
|
@ -5,8 +5,6 @@
|
|||
* (C) Copyright 2017 Rob Clark
|
||||
*/
|
||||
|
||||
#define LOG_CATEGORY LOGL_ERR
|
||||
|
||||
#include <common.h>
|
||||
#include <blk.h>
|
||||
#include <dm.h>
|
||||
|
@ -970,7 +968,7 @@ efi_status_t efi_dp_from_name(const char *dev, const char *devnr,
|
|||
if (!is_net) {
|
||||
part = blk_get_device_part_str(dev, devnr, &desc, &fs_partition,
|
||||
1);
|
||||
if (part < 0)
|
||||
if (part < 0 || !desc)
|
||||
return EFI_INVALID_PARAMETER;
|
||||
|
||||
if (device)
|
||||
|
|
|
@ -193,6 +193,7 @@ static s64 efi_mem_carve_out(struct efi_mem_list *map,
|
|||
free(map);
|
||||
} else {
|
||||
map->desc.physical_start = carve_end;
|
||||
map->desc.virtual_start = carve_end;
|
||||
map->desc.num_pages = (map_end - carve_end)
|
||||
>> EFI_PAGE_SHIFT;
|
||||
}
|
||||
|
@ -211,6 +212,7 @@ static s64 efi_mem_carve_out(struct efi_mem_list *map,
|
|||
newmap = calloc(1, sizeof(*newmap));
|
||||
newmap->desc = map->desc;
|
||||
newmap->desc.physical_start = carve_start;
|
||||
newmap->desc.virtual_start = carve_start;
|
||||
newmap->desc.num_pages = (map_end - carve_start) >> EFI_PAGE_SHIFT;
|
||||
/* Insert before current entry (descending address order) */
|
||||
list_add_tail(&newmap->link, &map->link);
|
||||
|
|
|
@ -26,16 +26,10 @@ struct efi_root_dp {
|
|||
*/
|
||||
efi_status_t efi_root_node_register(void)
|
||||
{
|
||||
efi_handle_t root;
|
||||
efi_status_t ret;
|
||||
efi_handle_t root = NULL;
|
||||
struct efi_root_dp *dp;
|
||||
|
||||
/* Create handle */
|
||||
ret = efi_create_handle(&root);
|
||||
if (ret != EFI_SUCCESS)
|
||||
return ret;
|
||||
|
||||
/* Install device path protocol */
|
||||
/* Create device path protocol */
|
||||
dp = calloc(1, sizeof(*dp));
|
||||
if (!dp)
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
|
@ -51,29 +45,29 @@ efi_status_t efi_root_node_register(void)
|
|||
dp->end.sub_type = DEVICE_PATH_SUB_TYPE_END;
|
||||
dp->end.length = sizeof(struct efi_device_path);
|
||||
|
||||
/* Install device path protocol */
|
||||
ret = efi_add_protocol(root, &efi_guid_device_path, dp);
|
||||
if (ret != EFI_SUCCESS)
|
||||
goto failure;
|
||||
|
||||
/* Install device path to text protocol */
|
||||
ret = efi_add_protocol(root, &efi_guid_device_path_to_text_protocol,
|
||||
(void *)&efi_device_path_to_text);
|
||||
if (ret != EFI_SUCCESS)
|
||||
goto failure;
|
||||
|
||||
/* Install device path utilities protocol */
|
||||
ret = efi_add_protocol(root, &efi_guid_device_path_utilities_protocol,
|
||||
(void *)&efi_device_path_utilities);
|
||||
if (ret != EFI_SUCCESS)
|
||||
goto failure;
|
||||
|
||||
/* Install Unicode collation protocol */
|
||||
ret = efi_add_protocol(root, &efi_guid_unicode_collation_protocol,
|
||||
(void *)&efi_unicode_collation_protocol);
|
||||
if (ret != EFI_SUCCESS)
|
||||
goto failure;
|
||||
|
||||
failure:
|
||||
return ret;
|
||||
/* Create root node and install protocols */
|
||||
return EFI_CALL(efi_install_multiple_protocol_interfaces(&root,
|
||||
/* Device path protocol */
|
||||
&efi_guid_device_path, dp,
|
||||
/* Device path to text protocol */
|
||||
&efi_guid_device_path_to_text_protocol,
|
||||
(void *)&efi_device_path_to_text,
|
||||
/* Device path utilities protocol */
|
||||
&efi_guid_device_path_utilities_protocol,
|
||||
(void *)&efi_device_path_utilities,
|
||||
/* Unicode collation protocol */
|
||||
&efi_guid_unicode_collation_protocol,
|
||||
(void *)&efi_unicode_collation_protocol,
|
||||
#if CONFIG_IS_ENABLED(EFI_LOADER_HII)
|
||||
/* HII string protocol */
|
||||
&efi_guid_hii_string_protocol,
|
||||
(void *)&efi_hii_string,
|
||||
/* HII database protocol */
|
||||
&efi_guid_hii_database_protocol,
|
||||
(void *)&efi_hii_database,
|
||||
/* HII configuration routing protocol */
|
||||
&efi_guid_hii_config_routing_protocol,
|
||||
(void *)&efi_hii_config_routing,
|
||||
#endif
|
||||
NULL));
|
||||
}
|
||||
|
|
|
@ -10,34 +10,21 @@
|
|||
|
||||
#define OBJ_LIST_NOT_INITIALIZED 1
|
||||
|
||||
/* Language code for American English according to RFC 4646 */
|
||||
#define EN_US L"en-US"
|
||||
|
||||
static efi_status_t efi_obj_list_initialized = OBJ_LIST_NOT_INITIALIZED;
|
||||
|
||||
/* Initialize and populate EFI object list */
|
||||
efi_status_t efi_init_obj_list(void)
|
||||
/**
|
||||
* efi_init_platform_lang() - define supported languages
|
||||
*
|
||||
* Set the PlatformLangCodes and PlatformLang variables.
|
||||
*
|
||||
* Return: status code
|
||||
*/
|
||||
static efi_status_t efi_init_platform_lang(void)
|
||||
{
|
||||
efi_status_t ret = EFI_SUCCESS;
|
||||
|
||||
/*
|
||||
* On the ARM architecture gd is mapped to a fixed register (r9 or x18).
|
||||
* As this register may be overwritten by an EFI payload we save it here
|
||||
* and restore it on every callback entered.
|
||||
*/
|
||||
efi_save_gd();
|
||||
|
||||
/*
|
||||
* Variable PlatformLang defines the language that the machine has been
|
||||
* configured for.
|
||||
*/
|
||||
ret = EFI_CALL(efi_set_variable(L"PlatformLang",
|
||||
&efi_global_variable_guid,
|
||||
EFI_VARIABLE_BOOTSERVICE_ACCESS |
|
||||
EFI_VARIABLE_RUNTIME_ACCESS,
|
||||
sizeof(EN_US), EN_US));
|
||||
if (ret != EFI_SUCCESS)
|
||||
goto out;
|
||||
efi_status_t ret;
|
||||
efi_uintn_t data_size = 0;
|
||||
char *lang = CONFIG_EFI_PLATFORM_LANG_CODES;
|
||||
char *pos;
|
||||
|
||||
/*
|
||||
* Variable PlatformLangCodes defines the language codes that the
|
||||
|
@ -47,14 +34,62 @@ efi_status_t efi_init_obj_list(void)
|
|||
&efi_global_variable_guid,
|
||||
EFI_VARIABLE_BOOTSERVICE_ACCESS |
|
||||
EFI_VARIABLE_RUNTIME_ACCESS,
|
||||
sizeof(EN_US), EN_US));
|
||||
sizeof(CONFIG_EFI_PLATFORM_LANG_CODES),
|
||||
CONFIG_EFI_PLATFORM_LANG_CODES));
|
||||
if (ret != EFI_SUCCESS)
|
||||
goto out;
|
||||
|
||||
/*
|
||||
* Variable PlatformLang defines the language that the machine has been
|
||||
* configured for.
|
||||
*/
|
||||
ret = EFI_CALL(efi_get_variable(L"PlatformLang",
|
||||
&efi_global_variable_guid,
|
||||
NULL, &data_size, &pos));
|
||||
if (ret == EFI_BUFFER_TOO_SMALL) {
|
||||
/* The variable is already set. Do not change it. */
|
||||
ret = EFI_SUCCESS;
|
||||
goto out;
|
||||
}
|
||||
|
||||
/*
|
||||
* The list of supported languages is semicolon separated. Use the first
|
||||
* language to initialize PlatformLang.
|
||||
*/
|
||||
pos = strchr(lang, ';');
|
||||
if (pos)
|
||||
*pos = 0;
|
||||
|
||||
ret = EFI_CALL(efi_set_variable(L"PlatformLang",
|
||||
&efi_global_variable_guid,
|
||||
EFI_VARIABLE_NON_VOLATILE |
|
||||
EFI_VARIABLE_BOOTSERVICE_ACCESS |
|
||||
EFI_VARIABLE_RUNTIME_ACCESS,
|
||||
1 + strlen(lang), lang));
|
||||
out:
|
||||
if (ret != EFI_SUCCESS)
|
||||
printf("EFI: cannot initialize platform language settings\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* efi_init_obj_list() - Initialize and populate EFI object list
|
||||
*
|
||||
* Return: status code
|
||||
*/
|
||||
efi_status_t efi_init_obj_list(void)
|
||||
{
|
||||
efi_status_t ret = EFI_SUCCESS;
|
||||
|
||||
/* Initialize once only */
|
||||
if (efi_obj_list_initialized != OBJ_LIST_NOT_INITIALIZED)
|
||||
return efi_obj_list_initialized;
|
||||
|
||||
/* Define supported languages */
|
||||
ret = efi_init_platform_lang();
|
||||
if (ret != EFI_SUCCESS)
|
||||
goto out;
|
||||
|
||||
/* Initialize system table */
|
||||
ret = efi_initialize_system_table();
|
||||
if (ret != EFI_SUCCESS)
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* Copyright (c) 2018 Heinrich Schuchardt <xypron.glpk@gmx.de>
|
||||
*
|
||||
* This unit test checks the following runtime services:
|
||||
* This unit test checks the following boottime services:
|
||||
* AllocatePages, FreePages, GetMemoryMap
|
||||
*
|
||||
* The memory type used for the device tree is checked.
|
||||
|
@ -65,6 +65,11 @@ static int find_in_memory_map(efi_uintn_t map_size,
|
|||
for (i = 0; map_size; ++i, map_size -= desc_size) {
|
||||
struct efi_mem_desc *entry = &memory_map[i];
|
||||
|
||||
if (entry->physical_start != entry->virtual_start) {
|
||||
efi_st_error("Physical and virtual addresses do not match\n");
|
||||
return EFI_ST_FAILURE;
|
||||
}
|
||||
|
||||
if (addr >= entry->physical_start &&
|
||||
addr < entry->physical_start +
|
||||
(entry->num_pages << EFI_PAGE_SHIFT)) {
|
||||
|
@ -171,9 +176,9 @@ static int execute(void)
|
|||
/* Check memory reservation for the device tree */
|
||||
if (fdt_addr &&
|
||||
find_in_memory_map(map_size, memory_map, desc_size, fdt_addr,
|
||||
EFI_RUNTIME_SERVICES_DATA) != EFI_ST_SUCCESS) {
|
||||
EFI_BOOT_SERVICES_DATA) != EFI_ST_SUCCESS) {
|
||||
efi_st_error
|
||||
("Device tree not marked as runtime services data\n");
|
||||
("Device tree not marked as boot services data\n");
|
||||
return EFI_ST_FAILURE;
|
||||
}
|
||||
return EFI_ST_SUCCESS;
|
||||
|
|
Loading…
Add table
Reference in a new issue