[U-Boot] [PATCH v3 4/5] efi_loader: EFI_UNICODE_COLLATION_PROTOCOL
Alexander Graf
agraf at suse.de
Mon Sep 3 21:26:01 UTC 2018
On 03.09.18 23:24, Heinrich Schuchardt wrote:
> On 09/03/2018 11:09 PM, Alexander Graf wrote:
>>
>>
>> On 03.09.18 18:35, Heinrich Schuchardt wrote:
>>> The patch implements the EFI_UNICODE_COLLATION_PROTOCOL.
>>>
>>> Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
>>> ---
>>> v3:
>>> no change
>>> v2:
>>> add more comments
>>> ---
>>> MAINTAINERS | 2 +
>>> include/cp1250.h | 40 +++
>>> include/cp437.h | 40 +++
>>> include/efi_api.h | 21 ++
>>> include/efi_loader.h | 5 +
>>> lib/efi_loader/Makefile | 18 +-
>>> lib/efi_loader/efi_boottime.c | 6 +
>>> lib/efi_loader/efi_unicode_collation.c | 329 +++++++++++++++++++++++++
>>> 8 files changed, 457 insertions(+), 4 deletions(-)
>>> create mode 100644 include/cp1250.h
>>> create mode 100644 include/cp437.h
>>> create mode 100644 lib/efi_loader/efi_unicode_collation.c
>>>
[...]
>>> @@ -127,6 +130,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 Unicode collation protocol */
>>> +extern const efi_guid_t efi_guid_unicode_collation_protocol;
>>>
>>> extern unsigned int __efi_runtime_start, __efi_runtime_stop;
>>> extern unsigned int __efi_runtime_rel_start, __efi_runtime_rel_stop;
>>> diff --git a/lib/efi_loader/Makefile b/lib/efi_loader/Makefile
>>> index 1ffbf52a89..0769df20f7 100644
>>> --- a/lib/efi_loader/Makefile
>>> +++ b/lib/efi_loader/Makefile
>>> @@ -17,10 +17,20 @@ always += helloworld.efi
>>> endif
>>>
>>> obj-$(CONFIG_CMD_BOOTEFI_HELLO) += helloworld_efi.o
>>> -obj-y += efi_image_loader.o efi_boottime.o efi_runtime.o efi_console.o
>>> -obj-y += efi_memory.o efi_device_path_to_text.o efi_device_path.o
>>> -obj-y += efi_device_path_utilities.o efi_file.o efi_variable.o efi_bootmgr.o
>>> -obj-y += efi_watchdog.o
>>> +obj-y += \
>>> +efi_bootmgr.o \
>>> +efi_boottime.o \
>>> +efi_console.o \
>>> +efi_device_path.o \
>>> +efi_device_path_to_text.o \
>>> +efi_device_path_utilities.o \
>>> +efi_file.o \
>>> +efi_image_loader.o \
>>> +efi_memory.o \
>>> +efi_runtime.o \
>>> +efi_unicode_collation.o \
>>> +efi_variable.o \
>>> +efi_watchdog.o
>>
>> Instead of line breaking them, just make each line an obj-y += line.
>>
[...]
>>> +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,
>>> + .supported_languages = "en-US",
>>
>> I have to admit I'm slightly puzzled on the supported language field.
>> The spec says quite clearly in appendix M what to do, but everyone seems
>> to interpret the specs differently:
>>
>> edk2 provides "en"
>> appendix M example is "en-us"
>> your patch provides "en-US"
>>
>> I'm not sure which one of them is correct :).
>>
>
> The spec refers to RFC 4646. RFC 4646 refers to ISO 3166 which uses
> capital letters for the two letter region codes.
>
> In RFC 4646 you can find the following example:
>
> en-US (English as used in the United States)
>
> The value from edk2 complies with RFC 4646. It simply does not specify a
> region.
>
> So should I change the value to match edk2?
I think that would remove a potential pitfall, yes. And please change
the Makefile according to my comment above :).
Alex
More information about the U-Boot
mailing list