get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/956571/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 956571,
    "url": "http://patchwork.ozlabs.org/api/patches/956571/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20180811152820.26817-15-xypron.glpk@gmx.de/",
    "project": {
        "id": 18,
        "url": "http://patchwork.ozlabs.org/api/projects/18/?format=api",
        "name": "U-Boot",
        "link_name": "uboot",
        "list_id": "u-boot.lists.denx.de",
        "list_email": "u-boot@lists.denx.de",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20180811152820.26817-15-xypron.glpk@gmx.de>",
    "list_archive_url": null,
    "date": "2018-08-11T15:28:19",
    "name": "[U-Boot,14/15] efi_loader: EFI_UNICODE_COLLATION_PROTOCOL",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "d687fc4dcca12122e4db14b4e3b345fb1d650b55",
    "submitter": {
        "id": 61270,
        "url": "http://patchwork.ozlabs.org/api/people/61270/?format=api",
        "name": "Heinrich Schuchardt",
        "email": "xypron.glpk@gmx.de"
    },
    "delegate": {
        "id": 3400,
        "url": "http://patchwork.ozlabs.org/api/users/3400/?format=api",
        "username": "agraf",
        "first_name": "Alexander",
        "last_name": "Graf",
        "email": "agraf@suse.de"
    },
    "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20180811152820.26817-15-xypron.glpk@gmx.de/mbox/",
    "series": [
        {
            "id": 60397,
            "url": "http://patchwork.ozlabs.org/api/series/60397/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=60397",
            "date": "2018-08-11T15:28:06",
            "name": "efi_loader: EFI_UNICODE_COLLATION_PROTOCOL",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/60397/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/956571/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/956571/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<u-boot-bounces@lists.denx.de>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org",
        "Authentication-Results": [
            "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org;\n\tdmarc=none (p=none dis=none) header.from=gmx.de"
        ],
        "Received": [
            "from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 41nmPQ5XK5z9s89\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSun, 12 Aug 2018 01:39:06 +1000 (AEST)",
            "by lists.denx.de (Postfix, from userid 105)\n\tid 66F21C21DD9; Sat, 11 Aug 2018 15:33:47 +0000 (UTC)",
            "from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id A47B8C21E9F;\n\tSat, 11 Aug 2018 15:29:03 +0000 (UTC)",
            "by lists.denx.de (Postfix, from userid 105)\n\tid 0B801C21C51; Sat, 11 Aug 2018 15:28:53 +0000 (UTC)",
            "from mout.gmx.net (mout.gmx.net [212.227.17.21])\n\tby lists.denx.de (Postfix) with ESMTPS id 4D99BC21DD4\n\tfor <u-boot@lists.denx.de>; Sat, 11 Aug 2018 15:28:48 +0000 (UTC)",
            "from LT02.fritz.box ([88.152.14.153]) by mail.gmx.com (mrgmx102\n\t[212.227.17.174]) with ESMTPSA (Nemesis) id 0MGoU1-1fjtFP2OrB-00DYdS;\n\tSat, 11 Aug 2018 17:28:46 +0200"
        ],
        "X-Spam-Checker-Version": "SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de",
        "X-Spam-Level": "",
        "X-Spam-Status": "No, score=0.0 required=5.0 tests=FREEMAIL_FROM\n\tautolearn=unavailable autolearn_force=no version=3.4.0",
        "From": "Heinrich Schuchardt <xypron.glpk@gmx.de>",
        "To": "Alexander Graf <agraf@suse.de>",
        "Date": "Sat, 11 Aug 2018 17:28:19 +0200",
        "Message-Id": "<20180811152820.26817-15-xypron.glpk@gmx.de>",
        "X-Mailer": "git-send-email 2.18.0",
        "In-Reply-To": "<20180811152820.26817-1-xypron.glpk@gmx.de>",
        "References": "<20180811152820.26817-1-xypron.glpk@gmx.de>",
        "X-Provags-ID": "V03:K1:kxiCERwdAQtPwDt0ceWWtCpRIK/Dkga3VgKrIw/1AUHxwsn+1/b\n\tuGIh2ip0twawTXBQCe8fZo3Hc7mM6A/87L2bawrK/YFjFqsdGhfqfhSVV0ED1gKbTUwsGAK\n\tg4CvnlpoV3uXAFEJnOgiOO+YoH5BD4ybWxXkaVf7qhfb2ovgtKJMvfbp+ya4JK3Y0hafZTL\n\t4a10O4KEZepO3jontjXjA==",
        "X-UI-Out-Filterresults": "notjunk:1; V01:K0:anZWqVLg6zg=:THgfW5ruyKr36ak4cmpfXP\n\tKu5XNU43ePP2vsNfx6PZYqJ9Qscz+gSv8RJJkAuTAuEy/VKGmnIODV1KnQOQmL9eeyO1IAiFi\n\tIA1EN+YbVp9qTo3kJM3rMaFsmPcSt0YMzxydIYga2kdqwjNn9N//LZPOqIHm8TjviNcFFGiY7\n\tXRsPRI0j2c9oSE/aZ/OoCi+HqoMzZ4MY0jAhMYWj3TOEVznKptgSXrBoTDySmrFOlWsRAATxt\n\t+bDUlswxfnqzpl00gYDGUMEouQYmaRt2N6v6IsXHcJhx1u5I9JpZfaFftGWAjpvGC5kRqITy8\n\tDL5LYArONxHB4sNSW4uZ+LzYOrJo8YHmaVdWJrVMHxmqZJNv4sAkr8gBjM8hB8vlmyaPtkRYn\n\tS97GbhjOxJVnhhQYpbKiUNVDsIutlXNXzeqYZ+g3CQQJNSK07foAn8VmsmjMT1nUWepFehpIO\n\tihxRuqFWHVcP/RQnlAtFKVqMBaNJiYo6fHqHPiU5fmGxU0WgnBeD3GFu7huNpmGHZnwF3U+dc\n\tXuhzcMu08hqMv3GHWjOHS+bcODEQwaPVumJWTh1o6rMwnO4TaScw6dUPUH4tQoFZRNWbZT+v4\n\t1f1lLr9rjRcvhoQiTjYbPzBMll3rkw2VCvjKgGVelXWcr3ZmusSt/ArFAeTCyUfoSyidZlWHP\n\tCNIy8wshdhqjPtK5t5vCftOi6MESVECcUuDfRgJIi8cKP38ptqM1OnUC1qMXUjcJpB1AykvOi\n\tje+NlHt/26o+6Da1bdr6hOtSPHwCcVBUlBo3KdUhwuErNVJIyKvS06vyh88=",
        "Cc": "Heinrich Schuchardt <xypron.glpk@gmx.de>, u-boot@lists.denx.de",
        "Subject": "[U-Boot] [PATCH 14/15] efi_loader: EFI_UNICODE_COLLATION_PROTOCOL",
        "X-BeenThere": "u-boot@lists.denx.de",
        "X-Mailman-Version": "2.1.18",
        "Precedence": "list",
        "List-Id": "U-Boot discussion <u-boot.lists.denx.de>",
        "List-Unsubscribe": "<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>",
        "List-Archive": "<http://lists.denx.de/pipermail/u-boot/>",
        "List-Post": "<mailto:u-boot@lists.denx.de>",
        "List-Help": "<mailto:u-boot-request@lists.denx.de?subject=help>",
        "List-Subscribe": "<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "base64",
        "Errors-To": "u-boot-bounces@lists.denx.de",
        "Sender": "\"U-Boot\" <u-boot-bounces@lists.denx.de>"
    },
    "content": "The patch implements the EFI_UNICODE_COLLATION_PROTOCOL.\n\nSigned-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>\n---\n MAINTAINERS                            |   2 +\n include/cp1250.h                       |  40 +++++\n include/cp437.h                        |  40 +++++\n include/efi_api.h                      |  21 +++\n include/efi_loader.h                   |   5 +\n lib/efi_loader/Makefile                |  18 +-\n lib/efi_loader/efi_boottime.c          |   6 +\n lib/efi_loader/efi_unicode_collation.c | 218 +++++++++++++++++++++++++\n 8 files changed, 346 insertions(+), 4 deletions(-)\n create mode 100644 include/cp1250.h\n create mode 100644 include/cp437.h\n create mode 100644 lib/efi_loader/efi_unicode_collation.c",
    "diff": "diff --git a/MAINTAINERS b/MAINTAINERS\nindex 0a543309f2..33d5d545bd 100644\n--- a/MAINTAINERS\n+++ b/MAINTAINERS\n@@ -369,6 +369,8 @@ F:\tdoc/README.uefi\n F:\tdoc/README.iscsi\n F:\tDocumentation/efi.rst\n F:\tinclude/capitalization.h\n+F:\tinclude/cp1250.h\n+F:\tinclude/cp437.h\n F:\tinclude/efi*\n F:\tinclude/pe.h\n F:\tinclude/asm-generic/pe.h\ndiff --git a/include/cp1250.h b/include/cp1250.h\nnew file mode 100644\nindex 0000000000..adacf8a958\n--- /dev/null\n+++ b/include/cp1250.h\n@@ -0,0 +1,40 @@\n+/* SPDX-License-Identifier: GPL-2.0+ */\n+\n+/*\n+ * Constant CP1250 contains the Unicode code points for characters 0x80 - 0xff\n+ * of the code page 1250.\n+ */\n+#define CP1250 { \\\n+\t0x20ac, 0x0000, 0x201a, 0x0000, \\\n+\t0x201e, 0x2026, 0x2020, 0x2021, \\\n+\t0x0000, 0x2030, 0x0160, 0x2039, \\\n+\t0x015a, 0x0164, 0x017d, 0x0179, \\\n+\t0x0000, 0x2018, 0x2019, 0x201c, \\\n+\t0x201d, 0x2022, 0x2013, 0x2014, \\\n+\t0x0000, 0x2122, 0x0161, 0x203a, \\\n+\t0x015b, 0x0165, 0x017e, 0x017a, \\\n+\t0x00a0, 0x02c7, 0x02d8, 0x0141, \\\n+\t0x00a4, 0x0104, 0x00a6, 0x00a7, \\\n+\t0x00a8, 0x00a9, 0x015e, 0x00ab, \\\n+\t0x00ac, 0x00ad, 0x00ae, 0x017b, \\\n+\t0x00b0, 0x00b1, 0x02db, 0x0142, \\\n+\t0x00b4, 0x00b5, 0x00b6, 0x00b7, \\\n+\t0x00b8, 0x0105, 0x015f, 0x00bb, \\\n+\t0x013d, 0x02dd, 0x013e, 0x017c, \\\n+\t0x0154, 0x00c1, 0x00c2, 0x0102, \\\n+\t0x00c4, 0x0139, 0x0106, 0x00c7, \\\n+\t0x010c, 0x00c9, 0x0118, 0x00cb, \\\n+\t0x011a, 0x00cd, 0x00ce, 0x010e, \\\n+\t0x0110, 0x0143, 0x0147, 0x00d3, \\\n+\t0x00d4, 0x0150, 0x00d6, 0x00d7, \\\n+\t0x0158, 0x016e, 0x00da, 0x0170, \\\n+\t0x00dc, 0x00dd, 0x0162, 0x00df, \\\n+\t0x0155, 0x00e1, 0x00e2, 0x0103, \\\n+\t0x00e4, 0x013a, 0x0107, 0x00e7, \\\n+\t0x010d, 0x00e9, 0x0119, 0x00eb, \\\n+\t0x011b, 0x00ed, 0x00ee, 0x010f, \\\n+\t0x0111, 0x0144, 0x0148, 0x00f3, \\\n+\t0x00f4, 0x0151, 0x00f6, 0x00f7, \\\n+\t0x0159, 0x016f, 0x00fa, 0x0171, \\\n+\t0x00fc, 0x00fd, 0x0163, 0x02d9, \\\n+}\ndiff --git a/include/cp437.h b/include/cp437.h\nnew file mode 100644\nindex 0000000000..0b2b97132e\n--- /dev/null\n+++ b/include/cp437.h\n@@ -0,0 +1,40 @@\n+/* SPDX-License-Identifier: GPL-2.0+ */\n+\n+/*\n+ * Constant CP437 contains the Unicode code points for characters 0x80 - 0xff\n+ * of the code page 437.\n+ */\n+#define CP437 { \\\n+\t0x00c7, 0x00fc, 0x00e9, 0x00e2, \\\n+\t0x00e4, 0x00e0, 0x00e5, 0x00e7, \\\n+\t0x00ea, 0x00eb, 0x00e8, 0x00ef, \\\n+\t0x00ee, 0x00ec, 0x00c4, 0x00c5, \\\n+\t0x00c9, 0x00e6, 0x00c6, 0x00f4, \\\n+\t0x00f6, 0x00f2, 0x00fb, 0x00f9, \\\n+\t0x00ff, 0x00d6, 0x00dc, 0x00a2, \\\n+\t0x00a3, 0x00a5, 0x20a7, 0x0192, \\\n+\t0x00e1, 0x00ed, 0x00f3, 0x00fa, \\\n+\t0x00f1, 0x00d1, 0x00aa, 0x00ba, \\\n+\t0x00bf, 0x2310, 0x00ac, 0x00bd, \\\n+\t0x00bc, 0x00a1, 0x00ab, 0x00bb, \\\n+\t0x2591, 0x2592, 0x2593, 0x2502, \\\n+\t0x2524, 0x2561, 0x2562, 0x2556, \\\n+\t0x2555, 0x2563, 0x2551, 0x2557, \\\n+\t0x255d, 0x255c, 0x255b, 0x2510, \\\n+\t0x2514, 0x2534, 0x252c, 0x251c, \\\n+\t0x2500, 0x253c, 0x255e, 0x255f, \\\n+\t0x255a, 0x2554, 0x2569, 0x2566, \\\n+\t0x2560, 0x2550, 0x256c, 0x2567, \\\n+\t0x2568, 0x2564, 0x2565, 0x2559, \\\n+\t0x2558, 0x2552, 0x2553, 0x256b, \\\n+\t0x256a, 0x2518, 0x250c, 0x2588, \\\n+\t0x2584, 0x258c, 0x2590, 0x2580, \\\n+\t0x03b1, 0x00df, 0x0393, 0x03c0, \\\n+\t0x03a3, 0x03c3, 0x00b5, 0x03c4, \\\n+\t0x03a6, 0x0398, 0x03a9, 0x03b4, \\\n+\t0x221e, 0x03c6, 0x03b5, 0x2229, \\\n+\t0x2261, 0x00b1, 0x2265, 0x2264, \\\n+\t0x2320, 0x2321, 0x00f7, 0x2248, \\\n+\t0x00b0, 0x2219, 0x00b7, 0x221a, \\\n+\t0x207f, 0x00b2, 0x25a0, 0x00a0, \\\n+}\ndiff --git a/include/efi_api.h b/include/efi_api.h\nindex ebf2a3bc18..1efc448184 100644\n--- a/include/efi_api.h\n+++ b/include/efi_api.h\n@@ -31,6 +31,7 @@ enum efi_timer_delay {\n \tEFI_TIMER_RELATIVE = 2\n };\n \n+#define efi_intn_t ssize_t\n #define efi_uintn_t size_t\n typedef uint16_t *efi_string_t;\n \n@@ -958,4 +959,24 @@ struct efi_driver_binding_protocol {\n \tefi_handle_t driver_binding_handle;\n };\n \n+#define EFI_UNICODE_COLLATION_PROTOCOL2_GUID \\\n+\tEFI_GUID(0xa4c751fc, 0x23ae, 0x4c3e, \\\n+\t\t 0x92, 0xe9, 0x49, 0x64, 0xcf, 0x63, 0xf3, 0x49)\n+struct efi_unicode_collation_protocol {\n+\tefi_intn_t (EFIAPI *stri_coll)(\n+\t\tstruct efi_unicode_collation_protocol *this, u16 *s1, u16 *s2);\n+\tbool (EFIAPI *metai_match)(struct efi_unicode_collation_protocol *this,\n+\t\t\t\t   const u16 *string, const u16 *patter);\n+\tvoid (EFIAPI *str_lwr)(struct efi_unicode_collation_protocol\n+\t\t\t       *this, u16 *string);\n+\tvoid (EFIAPI *str_upr)(struct efi_unicode_collation_protocol *this,\n+\t\t\t       u16 *string);\n+\tvoid (EFIAPI *fat_to_str)(struct efi_unicode_collation_protocol *this,\n+\t\t\t\t  efi_uintn_t fat_size, char *fat, u16 *string);\n+\tbool (EFIAPI *str_to_fat)(struct efi_unicode_collation_protocol *this,\n+\t\t\t\t  const u16 *string, efi_uintn_t fat_size,\n+\t\t\t\t  char *fat);\n+\tchar *supported_languages;\n+};\n+\n #endif\ndiff --git a/include/efi_loader.h b/include/efi_loader.h\nindex f162adfff7..c5ae7c3c36 100644\n--- a/include/efi_loader.h\n+++ b/include/efi_loader.h\n@@ -98,6 +98,9 @@ extern const struct efi_device_path_to_text_protocol efi_device_path_to_text;\n /* implementation of the EFI_DEVICE_PATH_UTILITIES_PROTOCOL */\n extern const struct efi_device_path_utilities_protocol\n \t\t\t\t\tefi_device_path_utilities;\n+/* Implementation of the EFI_UNICODE_COLLATION_PROTOCOL */\n+extern const struct efi_unicode_collation_protocol\n+\t\t\t\t\tefi_unicode_collation_protocol;\n \n uint16_t *efi_dp_str(struct efi_device_path *dp);\n \n@@ -127,6 +130,8 @@ extern const efi_guid_t efi_file_info_guid;\n /* GUID for file system information */\n extern const efi_guid_t efi_file_system_info_guid;\n extern const efi_guid_t efi_guid_device_path_utilities_protocol;\n+/* GUID of the Unicode collation protocol */\n+extern const efi_guid_t efi_guid_unicode_collation_protocol;\n \n extern unsigned int __efi_runtime_start, __efi_runtime_stop;\n extern unsigned int __efi_runtime_rel_start, __efi_runtime_rel_stop;\ndiff --git a/lib/efi_loader/Makefile b/lib/efi_loader/Makefile\nindex 1ffbf52a89..0769df20f7 100644\n--- a/lib/efi_loader/Makefile\n+++ b/lib/efi_loader/Makefile\n@@ -17,10 +17,20 @@ always += helloworld.efi\n endif\n \n obj-$(CONFIG_CMD_BOOTEFI_HELLO) += helloworld_efi.o\n-obj-y += efi_image_loader.o efi_boottime.o efi_runtime.o efi_console.o\n-obj-y += efi_memory.o efi_device_path_to_text.o efi_device_path.o\n-obj-y += efi_device_path_utilities.o efi_file.o efi_variable.o efi_bootmgr.o\n-obj-y += efi_watchdog.o\n+obj-y += \\\n+efi_bootmgr.o \\\n+efi_boottime.o \\\n+efi_console.o \\\n+efi_device_path.o \\\n+efi_device_path_to_text.o \\\n+efi_device_path_utilities.o \\\n+efi_file.o \\\n+efi_image_loader.o \\\n+efi_memory.o \\\n+efi_runtime.o \\\n+efi_unicode_collation.o \\\n+efi_variable.o \\\n+efi_watchdog.o\n obj-$(CONFIG_LCD) += efi_gop.o\n obj-$(CONFIG_DM_VIDEO) += efi_gop.o\n obj-$(CONFIG_PARTITIONS) += efi_disk.o\ndiff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c\nindex 618e8a8d8c..8a0701e828 100644\n--- a/lib/efi_loader/efi_boottime.c\n+++ b/lib/efi_loader/efi_boottime.c\n@@ -1525,6 +1525,12 @@ efi_status_t efi_setup_loaded_image(\n \tif (ret != EFI_SUCCESS)\n \t\tgoto failure;\n \n+\tret = efi_add_protocol(obj->handle,\n+\t\t\t       &efi_guid_unicode_collation_protocol,\n+\t\t\t       (void *)&efi_unicode_collation_protocol);\n+\tif (ret != EFI_SUCCESS)\n+\t\tgoto failure;\n+\n \treturn ret;\n failure:\n \tprintf(\"ERROR: Failure to install protocols for loaded image\\n\");\ndiff --git a/lib/efi_loader/efi_unicode_collation.c b/lib/efi_loader/efi_unicode_collation.c\nnew file mode 100644\nindex 0000000000..9a16b6a8a0\n--- /dev/null\n+++ b/lib/efi_loader/efi_unicode_collation.c\n@@ -0,0 +1,218 @@\n+// SPDX-License-Identifier: GPL-2.0+\n+/*\n+ * EFI Unicode collation protocol\n+ *\n+ * Copyright (c) 2018 Heinrich Schuchardt <xypron.glpk@gmx.de>\n+ */\n+\n+#include <common.h>\n+#include <charset.h>\n+#include <cp1250.h>\n+#include <cp437.h>\n+#include <efi_loader.h>\n+\n+/* Characters that may not be used in file names */\n+static const char illegal[] = \"<>:\\\"/\\\\|?*\";\n+\n+/*\n+ * EDK2 assumes codepage 1250 when creating FAT 8.3 file names.\n+ * Linux defaults to codepage 437 for FAT 8.3 file names.\n+ */\n+#if CONFIG_FAT_DEFAULT_CODEPAGE == 1250\n+/* Unicode code points for code page 1250 characters 0x80 - 0xff */\n+static const u16 codepage[] = CP1250;\n+#else\n+/* Unicode code points for code page 437 characters 0x80 - 0xff */\n+static const u16 codepage[] = CP437;\n+#endif\n+\n+const efi_guid_t efi_guid_unicode_collation_protocol =\n+\tEFI_UNICODE_COLLATION_PROTOCOL2_GUID;\n+\n+static efi_intn_t EFIAPI efi_stri_coll(\n+\t\tstruct efi_unicode_collation_protocol *this, u16 *s1, u16 *s2)\n+{\n+\ts32 c1, c2;\n+\tefi_intn_t ret = 0;\n+\n+\tEFI_ENTRY(\"%p, %ls, %ls\", this, s1, s2);\n+\tfor (; *s1 | *s2; ++s1, ++s2) {\n+\t\tc1 = utf_to_lower(*s1);\n+\t\tc2 = utf_to_lower(*s2);\n+\t\tif (c1 < c2) {\n+\t\t\tret = -1;\n+\t\t\tgoto out;\n+\t\t} else if (c1 > c2) {\n+\t\t\tret = 1;\n+\t\t\tgoto out;\n+\t\t}\n+\t}\n+out:\n+\tEFI_EXIT(EFI_SUCCESS);\n+\treturn ret;\n+}\n+\n+static bool metai_match(const u16 *s, const u16 *p)\n+{\n+\tu16 first;\n+\n+\tfor (; *s && *p; ++s, ++p) {\n+\t\tswitch (*p) {\n+\t\tcase '*':\n+\t\t\t/* Match 0 or more characters */\n+\t\t\t++p;\n+\t\t\tfor (;; ++s) {\n+\t\t\t\tif (metai_match(s, p))\n+\t\t\t\t\treturn true;\n+\t\t\t\tif (!*s)\n+\t\t\t\t\treturn false;\n+\t\t\t}\n+\t\tcase '?':\n+\t\t\t/* Match any one character */\n+\t\t\tbreak;\n+\t\tcase '[':\n+\t\t\t/* Match any character in the set */\n+\t\t\t++p;\n+\t\t\tfirst = *p;\n+\t\t\tif (first == ']')\n+\t\t\t\t/* Empty set */\n+\t\t\t\treturn false;\n+\t\t\t++p;\n+\t\t\tif (*p == '-') {\n+\t\t\t\t/* Range */\n+\t\t\t\t++p;\n+\t\t\t\tif (*s < first || *s > *p)\n+\t\t\t\t\treturn false;\n+\t\t\t\t++p;\n+\t\t\t\tif (*p != ']')\n+\t\t\t\t\treturn false;\n+\t\t\t} else {\n+\t\t\t\t/* Set */\n+\t\t\t\tbool hit = false;\n+\n+\t\t\t\tif (*s == first)\n+\t\t\t\t\thit = true;\n+\t\t\t\tfor (; *p && *p != ']'; ++p) {\n+\t\t\t\t\tif (*p == *s)\n+\t\t\t\t\t\thit = true;\n+\t\t\t\t}\n+\t\t\t\tif (!hit || *p != ']')\n+\t\t\t\t\treturn false;\n+\t\t\t}\n+\t\t\tbreak;\n+\t\tdefault:\n+\t\t\t/* Match one character */\n+\t\t\tif (*p != *s)\n+\t\t\t\treturn false;\n+\t\t}\n+\t}\n+\tif (!*p && !*s)\n+\t\treturn true;\n+\treturn false;\n+}\n+\n+static bool EFIAPI efi_metai_match(struct efi_unicode_collation_protocol *this,\n+\t\t\t\t   const u16 *string, const u16 *pattern)\n+{\n+\tbool ret;\n+\n+\tEFI_ENTRY(\"%p, %ls, %ls\", this, string, pattern);\n+\tret =  metai_match(string, pattern);\n+\tEFI_EXIT(EFI_SUCCESS);\n+\treturn ret;\n+}\n+\n+static void EFIAPI efi_str_lwr(struct efi_unicode_collation_protocol *this,\n+\t\t\t       u16 *string)\n+{\n+\tEFI_ENTRY(\"%p, %ls\", this, string);\n+\tfor (; *string; ++string)\n+\t\t*string = utf_to_lower(*string);\n+\tEFI_EXIT(EFI_SUCCESS);\n+}\n+\n+static void EFIAPI efi_str_upr(struct efi_unicode_collation_protocol *this,\n+\t\t\t       u16 *string)\n+{\n+\tEFI_ENTRY(\"%p, %ls\", this, string);\n+\tfor (; *string; ++string)\n+\t\t*string = utf_to_upper(*string);\n+\tEFI_EXIT(EFI_SUCCESS);\n+}\n+\n+static void EFIAPI efi_fat_to_str(struct efi_unicode_collation_protocol *this,\n+\t\t\t\t  efi_uintn_t fat_size, char *fat, u16 *string)\n+{\n+\tefi_uintn_t i;\n+\tu16 c;\n+\n+\tEFI_ENTRY(\"%p, %zu, %s, %p\", this, fat_size, fat, string);\n+\tfor (i = 0; i < fat_size; ++i) {\n+\t\tc = (unsigned char)fat[i];\n+\t\tif (c > 0x80)\n+\t\t\tc = codepage[i - 0x80];\n+\t\tstring[i] = c;\n+\t\tif (!c)\n+\t\t\tbreak;\n+\t}\n+\tstring[i] = 0;\n+\tEFI_EXIT(EFI_SUCCESS);\n+}\n+\n+static bool EFIAPI efi_str_to_fat(struct efi_unicode_collation_protocol *this,\n+\t\t\t\t  const u16 *string, efi_uintn_t fat_size,\n+\t\t\t\t  char *fat)\n+{\n+\tefi_uintn_t i;\n+\ts32 c;\n+\tbool ret = false;\n+\n+\tEFI_ENTRY(\"%p, %ls, %zu, %p\", this, string, fat_size, fat);\n+\tfor (i = 0; i < fat_size;) {\n+\t\tc = utf16_get(&string);\n+\t\tswitch (c) {\n+\t\t/* Ignore period and space */\n+\t\tcase '.':\n+\t\tcase ' ':\n+\t\t\tcontinue;\n+\t\tcase 0:\n+\t\t\tbreak;\n+\t\t}\n+\t\tc = utf_to_upper(c);\n+\t\tif (c >= 0x80) {\n+\t\t\tint j;\n+\n+\t\t\t/* Look for codepage translation */\n+\t\t\tfor (j = 0; j < 0x80; ++j) {\n+\t\t\t\tif (c == codepage[j]) {\n+\t\t\t\t\tc = j + 0x80;\n+\t\t\t\t\tbreak;\n+\t\t\t\t}\n+\t\t\t}\n+\t\t\tif (j >= 0x80) {\n+\t\t\t\tc = '_';\n+\t\t\t\tret = true;\n+\t\t\t}\n+\t\t} else if (c && (c < 0x20 || strchr(illegal, c))) {\n+\t\t\tc = '_';\n+\t\t\tret = true;\n+\t\t}\n+\n+\t\tfat[i] = c;\n+\t\tif (!c)\n+\t\t\tbreak;\n+\t\t++i;\n+\t}\n+\tEFI_EXIT(EFI_SUCCESS);\n+\treturn ret;\n+}\n+\n+const struct efi_unicode_collation_protocol efi_unicode_collation_protocol = {\n+\t.stri_coll = efi_stri_coll,\n+\t.metai_match = efi_metai_match,\n+\t.str_lwr = efi_str_lwr,\n+\t.str_upr = efi_str_upr,\n+\t.fat_to_str = efi_fat_to_str,\n+\t.str_to_fat = efi_str_to_fat,\n+\t.supported_languages = \"en-US\",\n+};\n",
    "prefixes": [
        "U-Boot",
        "14/15"
    ]
}