All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heinrich Schuchardt <xypron.glpk@gmx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/6] efi_loader: global symbol for code page 437
Date: Sun,  9 Sep 2018 07:56:59 +0200	[thread overview]
Message-ID: <20180909055704.1994-2-xypron.glpk@gmx.de> (raw)
In-Reply-To: <20180909055704.1994-1-xypron.glpk@gmx.de>

We require code page 437 both for text input and for the Unicode collation
protocol. We should have the translation table to Unicode only once.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 include/charset.h                      | 6 ++++++
 lib/charset.c                          | 3 +++
 lib/efi_loader/efi_unicode_collation.c | 3 +--
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/include/charset.h b/include/charset.h
index 686db5a1fe..32cc66bf5c 100644
--- a/include/charset.h
+++ b/include/charset.h
@@ -13,6 +13,12 @@
 
 #define MAX_UTF8_PER_UTF16 3
 
+/**
+ * codepage_437[] - Unicode code points for characters 0x80-0xff of
+ *		    code page 437.
+ */
+extern const u16 codepage_437[];
+
 /**
  * utf8_get() - get next UTF-8 code point from buffer
  *
diff --git a/lib/charset.c b/lib/charset.c
index 72c808ce64..f7ec2d25d3 100644
--- a/lib/charset.c
+++ b/lib/charset.c
@@ -7,6 +7,7 @@
 
 #include <charset.h>
 #include <capitalization.h>
+#include <cp437.h>
 #include <malloc.h>
 
 static struct capitalization_table capitalization_table[] =
@@ -18,6 +19,8 @@ static struct capitalization_table capitalization_table[] =
 	CP437_CAPITALIZATION_TABLE;
 #endif
 
+const u16 codepage_437[] = CP437;
+
 s32 utf8_get(const char **src)
 {
 	s32 code = 0;
diff --git a/lib/efi_loader/efi_unicode_collation.c b/lib/efi_loader/efi_unicode_collation.c
index 7f3ea3c77e..e005f345a9 100644
--- a/lib/efi_loader/efi_unicode_collation.c
+++ b/lib/efi_loader/efi_unicode_collation.c
@@ -8,7 +8,6 @@
 #include <common.h>
 #include <charset.h>
 #include <cp1250.h>
-#include <cp437.h>
 #include <efi_loader.h>
 
 /* Characters that may not be used in file names */
@@ -23,7 +22,7 @@ static const char illegal[] = "<>:\"/\\|?*";
 static const u16 codepage[] = CP1250;
 #else
 /* Unicode code points for code page 437 characters 0x80 - 0xff */
-static const u16 codepage[] = CP437;
+static const u16 *codepage = codepage_437;
 #endif
 
 /* GUID of the EFI_UNICODE_COLLATION_PROTOCOL */
-- 
2.18.0

  reply	other threads:[~2018-09-09  5:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-09  5:56 [U-Boot] [PATCH 0/6] efi_loader: fixes for EFI_SIMPLE_TEXT_INPUT_PROTOCOL Heinrich Schuchardt
2018-09-09  5:56 ` Heinrich Schuchardt [this message]
2018-09-09  5:57 ` [U-Boot] [PATCH 2/6] efi_loader: support Unicode text input Heinrich Schuchardt
2018-09-10 10:05   ` Alexander Graf
2018-09-10 13:01     ` Alexander Graf
2018-09-09  5:57 ` [U-Boot] [PATCH 3/6] test/py: Unicode w/ EFI_SIMPLE_TEXT_INPUT_PROTOCOL Heinrich Schuchardt
2018-09-09  5:57 ` [U-Boot] [PATCH 4/6] efi_selftest: refactor text input test Heinrich Schuchardt
2018-09-09  5:57 ` [U-Boot] [PATCH 5/6] efi_loader: rework event handling for console Heinrich Schuchardt
2018-09-09  5:57 ` [U-Boot] [PATCH 6/6] efi_selftest: use WaitForKey to test text input Heinrich Schuchardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180909055704.1994-2-xypron.glpk@gmx.de \
    --to=xypron.glpk@gmx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.