Skip to content

vsprintf and short-wchar for EFI_LOADER

Rob Clark u-boot 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5Kconfig: add option to build with -fshort-wcharKconfig Makefile lib/efi_loader/Kconfig+13 -01 reply
2/5lib: add some utf16 handling helpersinclude/charset.h lib/Makefile lib/charset.c +1 more+140 -141 reply
3/5vsprintf.c: add UTF-16 string (%ls) supportexamples/api/Makefile lib/vsprintf.c+30 -21 reply
4/5vsprintf.c: add GUID printingexamples/api/Makefile include/config_fallbacks.h lib/vsprintf.c+46 -21 reply
5/5examples: add fallback memcpyexamples/api/glue.c+12 -00 replies

Reviews trailers per patch

1 of 5 patches has a Reviewed-by or Acked-by.

PatchSimon GlassHeinrich Schuchardt
1/5
2/5
3/5R-b
4/5T-b
5/5

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [U-Boot] [PATCH 0/5] vsprintf and short-wchar for EFI_LOADER

As requested, I've split this out of the larger EFI_LOADER patchset.

This adds two things that the later EFI_LOADER patchset depends on:

1) UUID/GUID support
2) %ls UTF string support, in particular UTF-16. In the UEFI API, all strings are UTF-16

I had started converting this over to using c11 + u"string" literals, instead of using -fshort-wchar + L"string" literals and %ls, but I ran into two problems:

1) we lose out on the printf (and friends) va_arg type checking if we roll our own custom printf fmt modifier for UTF-16 strings
2) and worse than that, we have to disable -Wformat warnings

So given that we have a significant downside for not just using -fshort-wchar, and I don't think any really strong argument against, I am back to thinking that we should just go with -fshort-wchar.

The current patchset has a Kconfig option to opt-in to -fshort-wchar, which EFI_LOADER selects. If the consensus is to enable -fshort-wchar for everything, I'll drop the kconfig part and make it unconditional.

The current version of this patchset and efi-loader patchset are at

https://github.com/robclark/u-boot.git vsprintf

and

https://github.com/robclark/u-boot.git enough-uefi-for-shim-2

I'll resend the enought-uefi-for-shim-2 patchset after I have a chance to figure out fs-test.sh and add tests for fs_readdir().

Rob Clark (5):
Kconfig: add option to build with -fshort-wchar
lib: add some utf16 handling helpers
vsprintf.c: add UTF-16 string (%ls) support
vsprintf.c: add GUID printing
examples: add fallback memcpy

 Kconfig                      |  8 +++++
 Makefile                     |  4 +++
 examples/api/Makefile        |  2 ++
 examples/api/glue.c          | 12 +++++++
 include/charset.h            | 55 ++++++++++++++++++++++++++++++
 include/config_fallbacks.h   |  1 +
 lib/Makefile                 |  1 +
 lib/charset.c                | 81 ++++++++++++++++++++++++++++++++++++++++++++
 lib/efi_loader/Kconfig       |  1 +
 lib/efi_loader/efi_console.c | 17 ++--------
 lib/vsprintf.c               | 77 ++++++++++++++++++++++++++++++++++++++---
 11 files changed, 241 insertions(+), 18 deletions(-)
 create mode 100644 include/charset.h
 create mode 100644 lib/charset.c
Signature · 1 line
2.13.0