summaryrefslogtreecommitdiff
path: root/lib/efi_selftest
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2019-07-27 19:32:23 +0200
committerHeinrich Schuchardt <xypron.glpk@gmx.de>2019-07-30 21:36:22 +0200
commitbb689577206a679f5066a5251610ff80659507af (patch)
treef7037ae7a8ef0416412278be088eaa0b5b397a40 /lib/efi_selftest
parent7be56e864e64c30f1bd13d42bfc0d0a6f9999e65 (diff)
efi_selftest: sharpen ConvertPointer() test
Now that ConvertPointer() is implemented throw an error if the result is incorrect. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'lib/efi_selftest')
-rw-r--r--lib/efi_selftest/efi_selftest_set_virtual_address_map.c30
1 files changed, 22 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 3ffb61b7e8f..a4e5a50f632 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;
+ }
}
/**
@@ -181,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;
}