diff options
author | Tom Rini <trini@konsulko.com> | 2019-09-21 07:31:23 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2019-09-21 07:31:23 -0400 |
commit | 390183b58179ddaf986422f4d9446c596660f7e0 (patch) | |
tree | d2401285ea91806eeac338eeaf721d855c896f4b /lib/efi_selftest/efi_selftest_variables.c | |
parent | d6c7309f561ac832c080e5ec07b0af9c8da319a8 (diff) | |
parent | 79907a4f8429aef161add59b3d026cf2c734c1aa (diff) |
Merge tag 'efi-2019-10-rc4-5' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
Pull request for UEFI sub-system for v2019.10-rc4 (5)
This patch set fixes errors in the UEFI sub-system and adds a function to
compare u16 strings which is prerequisite for further patches.
Diffstat (limited to 'lib/efi_selftest/efi_selftest_variables.c')
-rw-r--r-- | lib/efi_selftest/efi_selftest_variables.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/lib/efi_selftest/efi_selftest_variables.c b/lib/efi_selftest/efi_selftest_variables.c index 06c1a032dd..a6b41d1f00 100644 --- a/lib/efi_selftest/efi_selftest_variables.c +++ b/lib/efi_selftest/efi_selftest_variables.c @@ -21,6 +21,9 @@ static const efi_guid_t guid_vendor0 = static const efi_guid_t guid_vendor1 = EFI_GUID(0xff629290, 0x1fc1, 0xd73f, 0x8f, 0xb1, 0x32, 0xf9, 0x0c, 0xa0, 0x42, 0xea); +static const efi_guid_t guid_global = + EFI_GUID(0x8be4df61, 0x93ca, 0x11d2, + 0xaa, 0x0d, 0x00, 0xe0, 0x98, 0x03, 0x2b, 0x8c); /* * Setup unit test. @@ -116,7 +119,7 @@ static int execute(void) EFI_VARIABLE_APPEND_WRITE, 7, v + 8); if (ret != EFI_SUCCESS) { - efi_st_todo("SetVariable(APPEND_WRITE) failed\n"); + efi_st_error("SetVariable(APPEND_WRITE) failed\n"); } else { len = EFI_ST_MAX_DATA_SIZE; ret = runtime->get_variable(L"efi_st_var1", &guid_vendor1, @@ -131,6 +134,21 @@ static int execute(void) if (memcmp(data, v, len)) efi_st_todo("GetVariable returned wrong value\n"); } + /* Append variable 2 */ + ret = runtime->set_variable(L"efi_none", &guid_vendor1, + EFI_VARIABLE_BOOTSERVICE_ACCESS | + EFI_VARIABLE_APPEND_WRITE, + 15, v); + if (ret != EFI_NOT_FOUND) + efi_st_error("SetVariable(APPEND_WRITE) with size 0 to non-existent variable returns wrong code\n"); + /* Append variable 3 */ + ret = runtime->set_variable(L"PlatformLangCodes", &guid_global, + EFI_VARIABLE_BOOTSERVICE_ACCESS | + EFI_VARIABLE_RUNTIME_ACCESS | + EFI_VARIABLE_APPEND_WRITE, + 15, v); + if (ret != EFI_WRITE_PROTECTED) + efi_st_todo("SetVariable(APPEND_WRITE) to read-only variable returns wrong code\n"); /* Enumerate variables */ boottime->set_mem(&guid, 16, 0); *varname = 0; |