Hsuan-ting Chen has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/75330?usp=email )
Change subject: lib: Support localized text of memory_training_desc in ux_locales.c ......................................................................
Patch Set 9:
(2 comments)
Commit Message:
https://review.coreboot.org/c/coreboot/+/75330/comment/3a3668ff_5facddb4 : PS9, Line 13: The preram_locales file follows the format:
I have a few questions about the format. […]
First of all, let me list my concerns: * Make the file as compact as possible * Make the parsing logic in coreboot as simple as possible * Make the read-only region compatible with some `string.h` functions
---
For 1. I haven't find an easy logic to parse your structures, let me know if there's one I am not awared of.
I have another idea: prepend one "type byte" in front of each strings. e.g.
\x00 \x01 string_name_1 \x00 \x02 locale_id_1 \x00 \x03 localized_string_1 ...
Hence our `search_for` will always point to the "type byte"
and we could easily parse them by type enum
``` enum content_type { CONTENT_TYPE_STRING_NAME = 0x01, CONTENT_TYPE_LOCALE_ID = 0x02, CONTENT_TYPE_LOCALIZED = 0x03, }; ```
---
For 2. Adding version byte (maybe two bytes?) seems reasonable, I am not sure if we want a checksum -- If so, we might follow the similiar logic of ELOG? e.g. adding SIGNATURE, VERSION, CHEKCSUM
File src/lib/ux_locales.c:
https://review.coreboot.org/c/coreboot/+/75330/comment/615fe052_047a7046 : PS9, Line 101: const char *ux_locales_get_text(const char *name)
Add a unit test for this?
I'll take a look at adding this.