From: Rob Clark <robdclark@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v1 03/12] efi_loader: add EFI_UNICODE_COLLATION_PROTOCOL stub
Date: Sun, 10 Sep 2017 09:22:24 -0400 [thread overview]
Message-ID: <20170910132236.14318-4-robdclark@gmail.com> (raw)
In-Reply-To: <20170910132236.14318-1-robdclark@gmail.com>
From: Leif Lindholm <leif.lindholm@linaro.org>
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
---
include/efi_api.h | 33 +++++++++++++++++++
include/efi_loader.h | 2 ++
lib/efi_loader/Makefile | 2 +-
lib/efi_loader/efi_boottime.c | 3 ++
lib/efi_loader/efi_unicode.c | 73 +++++++++++++++++++++++++++++++++++++++++++
5 files changed, 112 insertions(+), 1 deletion(-)
create mode 100644 lib/efi_loader/efi_unicode.c
diff --git a/include/efi_api.h b/include/efi_api.h
index 932a3429a8..25f774f253 100644
--- a/include/efi_api.h
+++ b/include/efi_api.h
@@ -740,6 +740,39 @@ struct efi_hii_string_protocol
UINTN *secondary_languages_size);
};
+#define EFI_UNICODE_COLLATION_PROTOCOL2_GUID \
+ EFI_GUID(0xa4c751fc, 0x23ae, 0x4c3e, \
+ 0x92, 0xe9, 0x49, 0x64, 0xcf, 0x63, 0xf3, 0x49)
+
+struct efi_unicode_collation_protocol
+{
+ INTN(EFIAPI *stri_coll)(
+ struct efi_unicode_collation_protocol *this,
+ efi_string_t s1,
+ efi_string_t s2);
+ bool(EFIAPI *metai_match)(
+ struct efi_unicode_collation_protocol *this,
+ efi_string_t string,
+ efi_string_t pattern);
+ void(EFIAPI *str_lwr)(
+ struct efi_unicode_collation_protocol *this,
+ efi_string_t string);
+ void(EFIAPI *str_upr)(
+ struct efi_unicode_collation_protocol *this,
+ efi_string_t string);
+ void(EFIAPI *fat_to_str)(
+ struct efi_unicode_collation_protocol *this,
+ UINTN fat_size,
+ uint8_t *fat,
+ efi_string_t string);
+ bool(EFIAPI *str_to_fat)(
+ struct efi_unicode_collation_protocol *this,
+ efi_string_t string,
+ UINTN fat_size,
+ uint8_t *fat);
+ uint8_t *supported_languages;
+};
+
#define EFI_GOP_GUID \
EFI_GUID(0x9042a9de, 0x23dc, 0x4a38, \
0x96, 0xfb, 0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a)
diff --git a/include/efi_loader.h b/include/efi_loader.h
index a89bb2fcd9..6668338d0b 100644
--- a/include/efi_loader.h
+++ b/include/efi_loader.h
@@ -62,6 +62,7 @@ extern const struct efi_device_path_utilities_protocol efi_device_path_utilities
extern const struct efi_hii_config_routing_protocol efi_hii_config_routing;
extern const struct efi_hii_database_protocol efi_hii_database;
extern const struct efi_hii_string_protocol efi_hii_string;
+extern const struct efi_unicode_collation_protocol efi_unicode_collation;
uint16_t *efi_dp_str(struct efi_device_path *dp);
@@ -76,6 +77,7 @@ extern const efi_guid_t efi_guid_device_path_utilities_protocol;
extern const efi_guid_t efi_guid_hii_config_routing_protocol;
extern const efi_guid_t efi_guid_hii_database_protocol;
extern const efi_guid_t efi_guid_hii_string_protocol;
+extern const efi_guid_t efi_guid_unicode_collation_protocol2;
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 e8fd6823a3..82b703bb39 100644
--- a/lib/efi_loader/Makefile
+++ b/lib/efi_loader/Makefile
@@ -16,7 +16,7 @@ always := $(efiprogs-y)
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_hii.o
+obj-y += efi_device_path_utilities.o efi_hii.o efi_unicode.o
obj-y += efi_file.o efi_variable.o efi_bootmgr.o
obj-$(CONFIG_LCD) += efi_gop.o
obj-$(CONFIG_DM_VIDEO) += efi_gop.o
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index 4d1a16051b..04358e8aca 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -788,6 +788,9 @@ void efi_setup_loaded_image(struct efi_loaded_image *info, struct efi_object *ob
obj->protocols[7].guid = &efi_guid_hii_config_routing_protocol;
obj->protocols[7].protocol_interface = (void *)&efi_hii_config_routing;
+ obj->protocols[8].guid = &efi_guid_unicode_collation_protocol2;
+ obj->protocols[8].protocol_interface = (void *)&efi_unicode_collation;
+
info->file_path = file_path;
info->device_handle = efi_dp_find_obj(device_path, NULL);
diff --git a/lib/efi_loader/efi_unicode.c b/lib/efi_loader/efi_unicode.c
new file mode 100644
index 0000000000..fdf1a99812
--- /dev/null
+++ b/lib/efi_loader/efi_unicode.c
@@ -0,0 +1,73 @@
+/*
+* EFI Unicode interface
+ *
+ * Copyright (c) 2017 Leif Lindholm
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include <common.h>
+#include <efi_loader.h>
+
+const efi_guid_t efi_guid_unicode_collation_protocol2 =
+ EFI_UNICODE_COLLATION_PROTOCOL2_GUID;
+
+INTN stri_coll(struct efi_unicode_collation_protocol *this,
+ efi_string_t s1,
+ efi_string_t s2)
+{
+ EFI_ENTRY("%p, \"%ls\", \"%ls\"", this, s1, s2);
+ return EFI_EXIT(0);
+}
+
+bool metai_match(struct efi_unicode_collation_protocol *this,
+ efi_string_t string,
+ efi_string_t pattern)
+{
+ EFI_ENTRY("%p, \"%ls\", \"%ls\"", this, string, pattern);
+ return EFI_EXIT(false);
+}
+
+void str_lwr(struct efi_unicode_collation_protocol *this,
+ efi_string_t string)
+{
+ EFI_ENTRY("%p, \"%ls\"", this, string);
+ EFI_EXIT(0);
+ return;
+}
+
+void str_upr(struct efi_unicode_collation_protocol *this,
+ efi_string_t string)
+{
+ EFI_ENTRY("%p, \"%ls\"", this, string);
+ EFI_EXIT(0);
+ return;
+}
+
+void fat_to_str(struct efi_unicode_collation_protocol *this,
+ UINTN fat_size,
+ uint8_t *fat,
+ efi_string_t string)
+{
+ EFI_ENTRY("%p, %lu, \"%s\", %p", this, fat_size, fat, string);
+ EFI_EXIT(0);
+ return;
+}
+
+bool str_to_fat(struct efi_unicode_collation_protocol *this,
+ efi_string_t string,
+ UINTN fat_size,
+ uint8_t *fat)
+{
+ EFI_ENTRY("%p, \"%ls\", %lu, %p", this, string, fat_size, fat);
+ return EFI_EXIT(false);
+}
+
+const struct efi_unicode_collation_protocol efi_unicode_collation = {
+ .stri_coll = stri_coll,
+ .metai_match = metai_match,
+ .str_lwr = str_lwr,
+ .str_upr = str_upr,
+ .fat_to_str = fat_to_str,
+ .str_to_fat = str_to_fat
+};
--
2.13.5
next prev parent reply other threads:[~2017-09-10 13:22 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-10 13:22 [U-Boot] [PATCH v1 00/12] efi_loader+video: support for Shell.efi Rob Clark
2017-09-10 13:22 ` [U-Boot] [PATCH v1 01/12] efi_loader: add stub EFI_DEVICE_PATH_UTILITIES_PROTOCOL Rob Clark
2017-10-04 17:13 ` Heinrich Schuchardt
2017-10-04 17:29 ` Heinrich Schuchardt
2017-10-04 18:00 ` Heinrich Schuchardt
2017-09-10 13:22 ` [U-Boot] [PATCH v1 02/12] efi_loader: add stub HII protocols Rob Clark
2017-10-04 17:45 ` Heinrich Schuchardt
2017-10-04 17:59 ` Heinrich Schuchardt
2017-09-10 13:22 ` Rob Clark [this message]
2017-10-04 17:57 ` [U-Boot] [PATCH v1 03/12] efi_loader: add EFI_UNICODE_COLLATION_PROTOCOL stub Heinrich Schuchardt
2017-10-04 18:35 ` Rob Clark
2017-10-04 18:57 ` Heinrich Schuchardt
2017-10-04 19:02 ` Heinrich Schuchardt
2017-10-04 19:01 ` Peter Jones
2017-09-10 13:22 ` [U-Boot] [PATCH v1 04/12] efi_loader: start fleshing out HII Rob Clark
2017-09-10 13:22 ` [U-Boot] [PATCH v1 05/12] efi_loader: flesh out unicode protocol Rob Clark
2017-09-10 13:22 ` [U-Boot] [PATCH v1 06/12] efi_loader: start fleshing out efi_device_path_utilities Rob Clark
2017-09-10 13:22 ` [U-Boot] [PATCH v1 07/12] efi_loader: SIMPLE_TEXT_INPUT_EX plus wire up objects properly Rob Clark
2017-09-10 13:22 ` [U-Boot] [PATCH v1 08/12] efi_loader: console support for color attributes Rob Clark
2017-10-04 18:53 ` Heinrich Schuchardt
2017-10-04 20:54 ` Rob Clark
2017-10-04 22:01 ` Heinrich Schuchardt
2017-10-04 23:19 ` Rob Clark
2017-10-04 23:53 ` Heinrich Schuchardt
2017-10-05 0:00 ` Rob Clark
2017-10-05 0:12 ` Rob Clark
2017-10-05 0:33 ` Heinrich Schuchardt
2017-09-10 13:22 ` [U-Boot] [PATCH v1 09/12] dm: video: Fix cache flushes Rob Clark
2017-10-04 19:29 ` Heinrich Schuchardt
2017-09-10 13:22 ` [U-Boot] [PATCH v1 10/12] dm: video: Add basic ANSI escape sequence support Rob Clark
2017-09-12 12:30 ` Simon Glass
2017-09-12 13:06 ` Rob Clark
2017-09-10 13:22 ` [U-Boot] [PATCH v1 11/12] dm: video: Add color " Rob Clark
2017-09-10 13:22 ` [U-Boot] [PATCH v1 12/12] HACK: efi_loader: hacks for SCT Rob Clark
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=20170910132236.14318-4-robdclark@gmail.com \
--to=robdclark@gmail.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox