From 95ab3816769827f73960f9c4347839e380c15c17 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Thu, 16 May 2019 07:52:58 +0200 Subject: efi_loader: rename Unicode collation protocol 2 variables Rename variables to make it clear they refer to the Unicode collation protocol identified by the EFI_UNICODE_PROTOCOL2_GUID. Signed-off-by: Heinrich Schuchardt --- include/efi_loader.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/efi_loader.h b/include/efi_loader.h index 07ef14ba1cd..835007e1794 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -108,7 +108,7 @@ extern const struct efi_device_path_utilities_protocol efi_device_path_utilities; /* Implementation of the EFI_UNICODE_COLLATION_PROTOCOL */ extern const struct efi_unicode_collation_protocol - efi_unicode_collation_protocol; + efi_unicode_collation_protocol2; extern const struct efi_hii_config_routing_protocol efi_hii_config_routing; extern const struct efi_hii_config_access_protocol efi_hii_config_access; extern const struct efi_hii_database_protocol efi_hii_database; @@ -146,7 +146,7 @@ extern const efi_guid_t efi_file_info_guid; extern const efi_guid_t efi_file_system_info_guid; extern const efi_guid_t efi_guid_device_path_utilities_protocol; /* GUID of the Unicode collation protocol */ -extern const efi_guid_t efi_guid_unicode_collation_protocol; +extern const efi_guid_t efi_guid_unicode_collation_protocol2; extern const efi_guid_t efi_guid_hii_config_routing_protocol; extern const efi_guid_t efi_guid_hii_config_access_protocol; extern const efi_guid_t efi_guid_hii_database_protocol; -- cgit v1.3.1 From b1b782d30608701d1901c1a83702ee9671a1d012 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Thu, 16 May 2019 18:19:00 +0200 Subject: efi_loader: implement deprecated Unicode collation protocol In EFI 1.10 a version of the Unicode collation protocol using ISO 639-2 language codes existed. This protocol is not part of the UEFI specification any longer. Unfortunately it is required to run the UEFI Self Certification Test (SCT) II, version 2.6, 2017. So we implement it here for the sole purpose of running the SCT. It can be removed once a compliant SCT is available. The configuration option defaults to no. Signed-off-by: Rob Clark Most of Rob's original patch is already merged. Only the deprecated protocol is missing. Rebase it and make it configurable. Signed-off-by: Heinrich Schuchardt --- include/efi_api.h | 5 +++++ include/efi_loader.h | 7 ++++++- lib/efi_loader/Kconfig | 11 +++++++++++ lib/efi_loader/efi_root_node.c | 7 ++++++- lib/efi_loader/efi_unicode_collation.c | 27 +++++++++++++++++++++++++++ 5 files changed, 55 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/efi_api.h b/include/efi_api.h index 755c4057939..7dcd82b6814 100644 --- a/include/efi_api.h +++ b/include/efi_api.h @@ -1425,6 +1425,11 @@ struct efi_driver_binding_protocol { efi_handle_t driver_binding_handle; }; +/* Deprecated version of the Unicode collation protocol */ +#define EFI_UNICODE_COLLATION_PROTOCOL_GUID \ + EFI_GUID(0x1d85cd7f, 0xf43d, 0x11d2, \ + 0x9a, 0x0c, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d) +/* Current version of the Unicode collation protocol */ #define EFI_UNICODE_COLLATION_PROTOCOL2_GUID \ EFI_GUID(0xa4c751fc, 0x23ae, 0x4c3e, \ 0x92, 0xe9, 0x49, 0x64, 0xcf, 0x63, 0xf3, 0x49) diff --git a/include/efi_loader.h b/include/efi_loader.h index 835007e1794..8167e6ffcbb 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -106,7 +106,10 @@ extern const struct efi_device_path_to_text_protocol efi_device_path_to_text; /* implementation of the EFI_DEVICE_PATH_UTILITIES_PROTOCOL */ extern const struct efi_device_path_utilities_protocol efi_device_path_utilities; -/* Implementation of the EFI_UNICODE_COLLATION_PROTOCOL */ +/* deprecated version of the EFI_UNICODE_COLLATION_PROTOCOL */ +extern const struct efi_unicode_collation_protocol + efi_unicode_collation_protocol; +/* current version of the EFI_UNICODE_COLLATION_PROTOCOL */ extern const struct efi_unicode_collation_protocol efi_unicode_collation_protocol2; extern const struct efi_hii_config_routing_protocol efi_hii_config_routing; @@ -145,6 +148,8 @@ extern const efi_guid_t efi_file_info_guid; /* GUID for file system information */ extern const efi_guid_t efi_file_system_info_guid; extern const efi_guid_t efi_guid_device_path_utilities_protocol; +/* GUID of the deprecated Unicode collation protocol */ +extern const efi_guid_t efi_guid_unicode_collation_protocol; /* GUID of the Unicode collation protocol */ extern const efi_guid_t efi_guid_unicode_collation_protocol2; extern const efi_guid_t efi_guid_hii_config_routing_protocol; diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig index 7e13ee54b25..fc04ea39d0a 100644 --- a/lib/efi_loader/Kconfig +++ b/lib/efi_loader/Kconfig @@ -54,6 +54,17 @@ config EFI_UNICODE_CAPITALIZATION set, only the the correct handling of the letters of the codepage used by the FAT file system is ensured. +config EFI_UNICODE_COLLATION_PROTOCOL + bool "Deprecated version of the Unicode collation protocol" + default n + help + In EFI 1.10 a version of the Unicode collation protocol using ISO + 639-2 language codes existed. This protocol is not part of the UEFI + specification any longer. Unfortunately it is required to run the + UEFI Self Certification Test (SCT) II, version 2.6, 2017. + + Choose this option for testing only. It is bound to be removed. + endif config EFI_LOADER_BOUNCE_BUFFER diff --git a/lib/efi_loader/efi_root_node.c b/lib/efi_loader/efi_root_node.c index 2b7277de05b..f68b0fdc610 100644 --- a/lib/efi_loader/efi_root_node.c +++ b/lib/efi_loader/efi_root_node.c @@ -61,7 +61,12 @@ efi_status_t efi_root_node_register(void) &efi_guid_device_path_utilities_protocol, (void *)&efi_device_path_utilities, #if CONFIG_IS_ENABLED(EFI_UNICODE_COLLATION_PROTOCOL2) - /* Unicode collation protocol */ +#if CONFIG_IS_ENABLED(EFI_UNICODE_COLLATION_PROTOCOL) + /* Deprecated Unicode collation protocol */ + &efi_guid_unicode_collation_protocol, + (void *)&efi_unicode_collation_protocol, +#endif + /* Current Unicode collation protocol */ &efi_guid_unicode_collation_protocol2, (void *)&efi_unicode_collation_protocol2, #endif diff --git a/lib/efi_loader/efi_unicode_collation.c b/lib/efi_loader/efi_unicode_collation.c index e04a4de5b7f..06fddca1c47 100644 --- a/lib/efi_loader/efi_unicode_collation.c +++ b/lib/efi_loader/efi_unicode_collation.c @@ -327,3 +327,30 @@ const struct efi_unicode_collation_protocol efi_unicode_collation_protocol2 = { .str_to_fat = efi_str_to_fat, .supported_languages = "en", }; + +/* + * In EFI 1.10 a version of the Unicode collation protocol using ISO 639-2 + * language codes existed. This protocol is not part of the UEFI specification + * any longer. Unfortunately it is required to run the UEFI Self Certification + * Test (SCT) II, version 2.6, 2017. So we implement it here for the sole + * purpose of running the SCT. It can be removed when a compliant SCT is + * available. + */ +#if CONFIG_IS_ENABLED(EFI_UNICODE_COLLATION_PROTOCOL) + +/* GUID of the EFI_UNICODE_COLLATION_PROTOCOL */ +const efi_guid_t efi_guid_unicode_collation_protocol = + EFI_UNICODE_COLLATION_PROTOCOL_GUID; + +const struct efi_unicode_collation_protocol efi_unicode_collation_protocol = { + .stri_coll = efi_stri_coll, + .metai_match = efi_metai_match, + .str_lwr = efi_str_lwr, + .str_upr = efi_str_upr, + .fat_to_str = efi_fat_to_str, + .str_to_fat = efi_str_to_fat, + /* ISO 639-2 language code */ + .supported_languages = "eng", +}; + +#endif -- cgit v1.3.1 From acee965263e8d04d07f9b36d54a4bc8bde30727c Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Sat, 18 May 2019 17:07:52 +0200 Subject: efi_loader: EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL.SetState() correct parameter KeyToggleState is a pointer according to UEFI spec 2.8. Signed-off-by: Heinrich Schuchardt --- include/efi_api.h | 2 +- lib/efi_loader/efi_console.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/efi_api.h b/include/efi_api.h index 7dcd82b6814..65584dd2d82 100644 --- a/include/efi_api.h +++ b/include/efi_api.h @@ -639,7 +639,7 @@ struct efi_simple_text_input_ex_protocol { struct efi_event *wait_for_key_ex; efi_status_t (EFIAPI *set_state) ( struct efi_simple_text_input_ex_protocol *this, - u8 key_toggle_state); + u8 *key_toggle_state); efi_status_t (EFIAPI *register_key_notify) ( struct efi_simple_text_input_ex_protocol *this, struct efi_key_data *key_data, diff --git a/lib/efi_loader/efi_console.c b/lib/efi_loader/efi_console.c index 051fc1d339f..909fd5c29ef 100644 --- a/lib/efi_loader/efi_console.c +++ b/lib/efi_loader/efi_console.c @@ -825,7 +825,7 @@ out: * efi_cin_set_state() - set toggle key state * * @this: instance of the EFI_SIMPLE_TEXT_INPUT_PROTOCOL - * @key_toggle_state: key toggle state + * @key_toggle_state: pointer to key toggle state * Return: status code * * This function implements the SetState service of the @@ -836,9 +836,9 @@ out: */ static efi_status_t EFIAPI efi_cin_set_state( struct efi_simple_text_input_ex_protocol *this, - u8 key_toggle_state) + u8 *key_toggle_state) { - EFI_ENTRY("%p, %u", this, key_toggle_state); + EFI_ENTRY("%p, %p", this, key_toggle_state); /* * U-Boot supports multiple console input sources like serial and * net console for which a key toggle state cannot be set at all. -- cgit v1.3.1