From patchwork Mon Oct 1 07:35:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 147871 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp3583343lji; Mon, 1 Oct 2018 00:34:56 -0700 (PDT) X-Google-Smtp-Source: ACcGV63Z4w4yd1xaVMpVXB9Eam0PZ+tFjt81m22OPs9Nan3XpcNKXwhHuf5Xx7VZaVlYOM2zKziM X-Received: by 2002:a50:be8d:: with SMTP id b13-v6mr10056533edk.157.1538379296693; Mon, 01 Oct 2018 00:34:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538379296; cv=none; d=google.com; s=arc-20160816; b=Z2Dji1PEuFIcejeWEem++szLP8SYl9C+nCDdl1WfpBElUkcWSqUuJkKqQm40UfLIl4 NAd9nc926Z5nN4FtUPHeBeNk5bOVRu4l8NIa5nCGt3dZypv4NCeSJEsTEnYT2wO0qXOf LcAEM5trCsx1d76VTpisp1//YWUSQSgdgogbVljd8b+aTYHFubwFvjPQIgsg31UmAyYc bh5NaOPD7XD+E0S99jymWtB7UVv3nGqGqBKU64bE6Qv3/Rm1LP6vjzIzH2HT9I1t9pFY +ldXbM0cdUaLOykbTus0AEnSIE+VfLYRf+T3H9tk7oeIjfFKzVP8QtBfVd8L/p9w6xQg 2XZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :cc:mime-version:message-id:date:to:from:dkim-signature; bh=1IgDQxCtrvhMoci1Nvs/961Qx6FHz7gkSupA0rWu6as=; b=U+WA0XD0mBZpUfDcHtCcuEN4QxAuWIhYFafKCMpixLoqqL6lfi4ixYaJtrJ5goyg0b wn0tFL6AWHLjslMQ/wnSZIlkvZqLTZFhz0CgluECUZN7aBCZoltRe1U7xVfq3pS+C8Em 50iZ4I9aMu2dA5DLWsEhQdYY20eaKsMDBF6u2/z2fQfh/HRBUPiVCvMFunFTO7FjqOWv aKzd79Gi1r9MOgOvUtIXGULnUmXkscNfQBzMz4c8FSl12xzd88U9yBdflcsZar0wRXhy sL3yuBQtTuP/9+wM1w/weY8hhUtanHq6guzE13d93/JG1XsO17bxwX+lExlRJBTyXysr gMBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Giooy9Nc; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id dc23-v6si404284ejb.269.2018.10.01.00.34.56; Mon, 01 Oct 2018 00:34:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Giooy9Nc; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.denx.de (Postfix, from userid 105) id D65F8C21ECA; Mon, 1 Oct 2018 07:34:51 +0000 (UTC) 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=RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id B08F8C21C51; Mon, 1 Oct 2018 07:34:49 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id D2570C21C51; Mon, 1 Oct 2018 07:34:47 +0000 (UTC) Received: from mail-pg1-f196.google.com (mail-pg1-f196.google.com [209.85.215.196]) by lists.denx.de (Postfix) with ESMTPS id 3389BC21C3F for ; Mon, 1 Oct 2018 07:34:47 +0000 (UTC) Received: by mail-pg1-f196.google.com with SMTP id i4-v6so8207179pgq.9 for ; Mon, 01 Oct 2018 00:34:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=bjZ3KXPSD8rUljVPOTpWjxsnS8mhi1c5DxIJvFDHFgU=; b=Giooy9NcGb2FCHE6XORPG1q/yPry7EIeDovcs2X4wC6NCTxf0GPl6bgc0qLVvjlyIb qXICkHrwA3G+qgtQZBDjATM5E2eaFsDwaQ1tvACQqMkVxxhBASp8XZz/hfgLyr8TPwYy BXsXuwK1XtqpiNUGA5Kwi8gDvjinCZURL6eNc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=bjZ3KXPSD8rUljVPOTpWjxsnS8mhi1c5DxIJvFDHFgU=; b=kJrg9wzFVlikuHIisOXQCvWDjen1L+NL/he53yxQ91JA010IkW6TgMBp2I5SSUjpR1 XITe12Mz4b7BWuhL02gT0Ut6qUmuK74ks9AgdD4szJwsmCF2K59jG/0Yy0ldejiG+/FH nHrrwQYMolZ/E94ER6acLxqUfvGlYowxfIMakmOWO6qgI637dlUOuKuNBWEyDvQ5VaRc CIMqRG/zyHX2nRLtEfhHnZ/ogBfvdET2Oi279hQXAkLXQgqIuUd8keSqQi+8P38FT+GV hO2YWIlHZMaMPkQ+wtq/2wK1aISZRE0Lk/5oUnVkfdcRV2CzD3/UgyMqdfN3WMxPxVyQ 6Z6Q== X-Gm-Message-State: ABuFfoj2BvSWuNtiCBXmuMVDraLd6Q+iC29eEFzyD4stsvM2Yom9icx6 L5SC1+7e3vUyZOJvpN8N64fhNg== X-Received: by 2002:a63:5ec5:: with SMTP id s188-v6mr8951373pgb.126.1538379285555; Mon, 01 Oct 2018 00:34:45 -0700 (PDT) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id 3-v6sm12368923pga.12.2018.10.01.00.34.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Oct 2018 00:34:44 -0700 (PDT) From: AKASHI Takahiro To: agraf@suse.de, xypron.glpk@gmx.de, leif.lindholm@linaro.org Date: Mon, 1 Oct 2018 16:35:56 +0900 Message-Id: <20181001073556.6246-1-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.19.0 MIME-Version: 1.0 Cc: u-boot@lists.denx.de Subject: [U-Boot] [RFC] efi: workaround for SCT (against unicode collation protocol) X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" UEFI SCT doesn't run on the latest u-boot (or Alex's efi-next). Among other issues, there are two problems around language handling: 1. SCT looks for efi_unicode_collation_protocol with an (old?) guid, {0x1d85cd7f, 0xf43d, 0x11d2, 0x9a, 0x0c, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d) 2. SCT uses a hard-coded language name, "eng," in SctInializeLib() These assumptions conflict with Heinrich's current unicode implementation. While this patch fixes them in a quick way, it's more of an informative one so that we will share and discuss them. Signed-off-by: AKASHI Takahiro --- include/efi_api.h | 3 +++ include/efi_loader.h | 3 +++ lib/efi_loader/efi_root_node.c | 2 ++ lib/efi_loader/efi_unicode_collation.c | 13 +++++++++++++ 4 files changed, 21 insertions(+) diff --git a/include/efi_api.h b/include/efi_api.h index daaaa78d72b0..841b680581c0 100644 --- a/include/efi_api.h +++ b/include/efi_api.h @@ -1262,6 +1262,9 @@ struct efi_driver_binding_protocol { efi_handle_t driver_binding_handle; }; +#define EFI_UNICODE_COLLATION_PROTOCOL_GUID \ + EFI_GUID(0x1d85cd7f, 0xf43d, 0x11d2, \ + 0x9a, 0x0c, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d) #define EFI_UNICODE_COLLATION_PROTOCOL2_GUID \ EFI_GUID(0xa4c751fc, 0x23ae, 0x4c3e, \ 0x92, 0xe9, 0x49, 0x64, 0xcf, 0x63, 0xf3, 0x49) diff --git a/include/efi_loader.h b/include/efi_loader.h index c8760bebd6bc..2d99eba15e32 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -104,6 +104,8 @@ extern const struct efi_device_path_to_text_protocol efi_device_path_to_text; extern const struct efi_device_path_utilities_protocol efi_device_path_utilities; /* Implementation of the EFI_UNICODE_COLLATION_PROTOCOL */ +extern const struct efi_unicode_collation_protocol + efi_unicode_collation_protocol_eng; extern const struct efi_unicode_collation_protocol efi_unicode_collation_protocol; extern const struct efi_hii_config_routing_protocol efi_hii_config_routing; @@ -142,6 +144,7 @@ extern const efi_guid_t efi_file_system_info_guid; extern const efi_guid_t efi_guid_device_path_utilities_protocol; /* GUID of the Unicode collation protocol */ extern const efi_guid_t efi_guid_unicode_collation_protocol; +extern const efi_guid_t efi_guid_unicode_collation_protocol2; 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; diff --git a/lib/efi_loader/efi_root_node.c b/lib/efi_loader/efi_root_node.c index b056ba3ee880..aadb47aba1cd 100644 --- a/lib/efi_loader/efi_root_node.c +++ b/lib/efi_loader/efi_root_node.c @@ -70,6 +70,8 @@ efi_status_t efi_root_node_register(void) /* Install Unicode collation protocol */ ret = efi_add_protocol(root, &efi_guid_unicode_collation_protocol, + (void *)&efi_unicode_collation_protocol_eng); + ret = efi_add_protocol(root, &efi_guid_unicode_collation_protocol2, (void *)&efi_unicode_collation_protocol); if (ret != EFI_SUCCESS) goto failure; diff --git a/lib/efi_loader/efi_unicode_collation.c b/lib/efi_loader/efi_unicode_collation.c index 7f3ea3c77e4e..932feb3a9984 100644 --- a/lib/efi_loader/efi_unicode_collation.c +++ b/lib/efi_loader/efi_unicode_collation.c @@ -28,6 +28,8 @@ static const u16 codepage[] = CP437; /* GUID of the EFI_UNICODE_COLLATION_PROTOCOL */ const efi_guid_t efi_guid_unicode_collation_protocol = + EFI_UNICODE_COLLATION_PROTOCOL_GUID; +const efi_guid_t efi_guid_unicode_collation_protocol2 = EFI_UNICODE_COLLATION_PROTOCOL2_GUID; /** @@ -318,6 +320,17 @@ static bool EFIAPI efi_str_to_fat(struct efi_unicode_collation_protocol *this, return ret; } +const +struct efi_unicode_collation_protocol efi_unicode_collation_protocol_eng = { + .stri_coll = efi_stri_coll, + .metai_match = efi_metai_match, + .str_lwr = efi_str_lwr, + .str_upr = efi_str_upr, + .fat_to_str = efi_fat_to_str, + .str_to_fat = efi_str_to_fat, + .supported_languages = "eng", +}; + const struct efi_unicode_collation_protocol efi_unicode_collation_protocol = { .stri_coll = efi_stri_coll, .metai_match = efi_metai_match,