aboutsummaryrefslogtreecommitdiff
path: root/lib/efi_selftest/efi_selftest_set_virtual_address_map.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2019-08-04 19:39:54 -0400
committerTom Rini <trini@konsulko.com>2019-08-04 19:39:54 -0400
commit7127151d538d878bd073ca6d6cca630a4b35b76f (patch)
tree2c55481916d8d48bf9d05c6daa4fbd19be7a0b28 /lib/efi_selftest/efi_selftest_set_virtual_address_map.c
parent898c40c0d6f9e53dafcfdf6f870190faef6e088b (diff)
parentbb689577206a679f5066a5251610ff80659507af (diff)
Merge tag 'efi-2019-10-rc2' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
Pull request for UEFI sub-system for v2019.10-rc2 With this pull request a workaround for GRUB on 32bit ARM is re-enabled and made customizable. Without the patch booting on ARM 32bit with GRUB prior to version 2.04 or with a cache which is not managed via CP15 fails. Further work will be needed to achieve a UEFI compliant cache handling. According to the UEFI spec all caches except those that cannot be managed via CP15 should be enabled. An implementation of the ConvertPointer() runtime service is provided. efi_crt0 is always rebuild to avoid having to call 'make mrproper' when switching architectures.
Diffstat (limited to 'lib/efi_selftest/efi_selftest_set_virtual_address_map.c')
-rw-r--r--lib/efi_selftest/efi_selftest_set_virtual_address_map.c31
1 files changed, 23 insertions, 8 deletions
diff --git a/lib/efi_selftest/efi_selftest_set_virtual_address_map.c b/lib/efi_selftest/efi_selftest_set_virtual_address_map.c
index 6ee7bbeb01..a4e5a50f63 100644
--- a/lib/efi_selftest/efi_selftest_set_virtual_address_map.c
+++ b/lib/efi_selftest/efi_selftest_set_virtual_address_map.c
@@ -20,6 +20,7 @@ static u32 desc_version;
static u64 page1;
static u64 page2;
static u32 notify_call_count;
+static bool convert_pointer_failed;
/**
* notify () - notification function
@@ -39,17 +40,28 @@ static void EFIAPI notify(struct efi_event *event, void *context)
addr = (void *)(uintptr_t)page1;
ret = runtime->convert_pointer(0, &addr);
- if (ret != EFI_SUCCESS)
- efi_st_todo("ConvertPointer failed\n");
- if ((uintptr_t)addr != page1 + EFI_PAGE_SIZE)
- efi_st_todo("ConvertPointer wrong address\n");
+ if (ret != EFI_SUCCESS) {
+ efi_st_error("ConvertPointer failed\n");
+ convert_pointer_failed = true;
+ return;
+ }
+ if ((uintptr_t)addr != page1 + EFI_PAGE_SIZE) {
+ efi_st_error("ConvertPointer wrong address\n");
+ convert_pointer_failed = true;
+ return;
+ }
addr = (void *)(uintptr_t)page2;
ret = runtime->convert_pointer(0, &addr);
- if (ret != EFI_SUCCESS)
- efi_st_todo("ConvertPointer failed\n");
- if ((uintptr_t)addr != page2 + 2 * EFI_PAGE_SIZE)
- efi_st_todo("ConvertPointer wrong address\n");
+ if (ret != EFI_SUCCESS) {
+ efi_st_error("ConvertPointer failed\n");
+ convert_pointer_failed = true;
+ return;
+ }
+ if ((uintptr_t)addr != page2 + 2 * EFI_PAGE_SIZE) {
+ efi_st_error("ConvertPointer wrong address\n");
+ convert_pointer_failed = true;
+ }
}
/**
@@ -123,6 +135,7 @@ static int setup(const efi_handle_t handle,
case EFI_LOADER_DATA:
case EFI_BOOT_SERVICES_CODE:
case EFI_BOOT_SERVICES_DATA:
+ case EFI_CONVENTIONAL_MEMORY:
continue;
}
memcpy(pos1, pos2, desc_size);
@@ -180,6 +193,8 @@ static int execute(void)
notify_call_count);
return EFI_ST_FAILURE;
}
+ if (convert_pointer_failed)
+ return EFI_ST_FAILURE;
return EFI_ST_SUCCESS;
}