diff options
author | Tom Rini <trini@konsulko.com> | 2019-04-08 22:32:45 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2019-04-08 22:32:45 -0400 |
commit | 1d63ec3fa40e4899ad1d74d5ed3c926acfda54f2 (patch) | |
tree | ceef3a1214f5422b0071454aecd511e1b5f6bf95 /lib/efi_loader/efi_setup.c | |
parent | ffb269ab30dbce8ab87d09942e2a6951694516f1 (diff) | |
parent | bfc2dd53812f7946b61c18e915118fb7aad12e6d (diff) |
Merge tag 'efi-2019-07-rc1' of git://git.denx.de/u-boot-efi
Pull request for UEFI sub-system for v2019.07-rc1
The patch series adds support for the BootNext and BootCurrent variables.
The rest is mostly bug fixes. With the bug fixes in place it becomes
possible to use the EFI Shell `edit` command.
A new unit test is supplied to check the image base and size fields of the
loaded image protocol.
An inline check when freeing memory from the pool safeguards against double
frees.
Diffstat (limited to 'lib/efi_loader/efi_setup.c')
-rw-r--r-- | lib/efi_loader/efi_setup.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/efi_loader/efi_setup.c b/lib/efi_loader/efi_setup.c index 8266d06c2e..a908843d87 100644 --- a/lib/efi_loader/efi_setup.c +++ b/lib/efi_loader/efi_setup.c @@ -10,6 +10,9 @@ #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 */ @@ -24,6 +27,30 @@ efi_status_t efi_init_obj_list(void) */ 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; + + /* + * Variable PlatformLangCodes defines the language codes that the + * machine can support. + */ + ret = EFI_CALL(efi_set_variable(L"PlatformLangCodes", + &efi_global_variable_guid, + EFI_VARIABLE_BOOTSERVICE_ACCESS | + EFI_VARIABLE_RUNTIME_ACCESS, + sizeof(EN_US), EN_US)); + if (ret != EFI_SUCCESS) + goto out; + /* Initialize once only */ if (efi_obj_list_initialized != OBJ_LIST_NOT_INITIALIZED) return efi_obj_list_initialized; |