mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-24 06:24:17 +00:00
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>
This commit is contained in:
parent
7be56e864e
commit
bb68957720
1 changed files with 22 additions and 8 deletions
|
@ -20,6 +20,7 @@ static u32 desc_version;
|
||||||
static u64 page1;
|
static u64 page1;
|
||||||
static u64 page2;
|
static u64 page2;
|
||||||
static u32 notify_call_count;
|
static u32 notify_call_count;
|
||||||
|
static bool convert_pointer_failed;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* notify () - notification function
|
* notify () - notification function
|
||||||
|
@ -39,17 +40,28 @@ static void EFIAPI notify(struct efi_event *event, void *context)
|
||||||
|
|
||||||
addr = (void *)(uintptr_t)page1;
|
addr = (void *)(uintptr_t)page1;
|
||||||
ret = runtime->convert_pointer(0, &addr);
|
ret = runtime->convert_pointer(0, &addr);
|
||||||
if (ret != EFI_SUCCESS)
|
if (ret != EFI_SUCCESS) {
|
||||||
efi_st_todo("ConvertPointer failed\n");
|
efi_st_error("ConvertPointer failed\n");
|
||||||
if ((uintptr_t)addr != page1 + EFI_PAGE_SIZE)
|
convert_pointer_failed = true;
|
||||||
efi_st_todo("ConvertPointer wrong address\n");
|
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;
|
addr = (void *)(uintptr_t)page2;
|
||||||
ret = runtime->convert_pointer(0, &addr);
|
ret = runtime->convert_pointer(0, &addr);
|
||||||
if (ret != EFI_SUCCESS)
|
if (ret != EFI_SUCCESS) {
|
||||||
efi_st_todo("ConvertPointer failed\n");
|
efi_st_error("ConvertPointer failed\n");
|
||||||
if ((uintptr_t)addr != page2 + 2 * EFI_PAGE_SIZE)
|
convert_pointer_failed = true;
|
||||||
efi_st_todo("ConvertPointer wrong address\n");
|
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);
|
notify_call_count);
|
||||||
return EFI_ST_FAILURE;
|
return EFI_ST_FAILURE;
|
||||||
}
|
}
|
||||||
|
if (convert_pointer_failed)
|
||||||
|
return EFI_ST_FAILURE;
|
||||||
|
|
||||||
return EFI_ST_SUCCESS;
|
return EFI_ST_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue