From patchwork Sun Sep 10 13:22:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 112151 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp2581897qgf; Sun, 10 Sep 2017 06:23:22 -0700 (PDT) X-Received: by 10.80.143.67 with SMTP id 61mr7037915edy.290.1505049801996; Sun, 10 Sep 2017 06:23:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505049801; cv=none; d=google.com; s=arc-20160816; b=NMsInHFN6KpI+JTyXLIEnfziaeTLPXrNlk9NfQSxPx8UK+iiMObXUQp3WIka2goI6K QtHL9tkmhkx+4TyK1trbPBm8mRtI0j2mQaVSXpBhM6llxtU98blF18JNa1Xh51zMGWFt W8kfH+UK1UB7/Sy1HhdGpoUhwEmRjX89arr0ikTcR3MGLsTHfPvhGay9JTV9jCe52Ind aec1Wjhdy3w44hwiJURtO7aWxAswWGNpubCkOOI+i5lckrSp8vuDifAyDxnVrakjeL+L Tnr05NeR+jJyi+NN+6bK2nNUTBCIySo+CMKGCgUneiF/8vcWJP2Skkqxz9IPhLwEh4Kk rUYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:dkim-signature:arc-authentication-results; bh=75QbsYMdJGaqwuKuJEUhQloOOSv+IqlNoSU/RIJbFuE=; b=Cv0aMSfK/vE/7ygnMqxiC/6G34eBoypb2D50030wwW/rm17xJdH+TiQM+HdW6J4EgP YJ9veOy9JpfKpe8CRgUUqlXkpfwRIOYblTV+sL1V7Twu5GoEYVrRyht9QR7FR9jFfxNk rm9pCXAcngHbRDawF5zDUaS4pP8P/uvf6HSP4QR57f5wr/rF95rpxlHMjq2hM5YLu4Vk 3cC4UyLe16olZNqlOTs90LFBRDCSJBVOtBmnMudsjfrC4TkI52BiF+Bresh03S8LGW4i 73y1A+CDBtfhicULwpTgx41sLLG+BHteDy1i1tWqoW/q+WnKCdOcr0OhuuYqPvK9WmR7 I0BA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=c3sdRb3v; 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=gmail.com Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id q2si6468350edd.140.2017.09.10.06.23.21; Sun, 10 Sep 2017 06:23:21 -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=@gmail.com header.s=20161025 header.b=c3sdRb3v; 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=gmail.com Received: by lists.denx.de (Postfix, from userid 105) id 96C61C21EA7; Sun, 10 Sep 2017 13:23:02 +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=FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, 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 281EEC21E57; Sun, 10 Sep 2017 13:22:58 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 0B39DC21F0A; Sun, 10 Sep 2017 13:22:53 +0000 (UTC) Received: from mail-qk0-f195.google.com (mail-qk0-f195.google.com [209.85.220.195]) by lists.denx.de (Postfix) with ESMTPS id A51C1C21E97 for ; Sun, 10 Sep 2017 13:22:49 +0000 (UTC) Received: by mail-qk0-f195.google.com with SMTP id r66so3910003qke.4 for ; Sun, 10 Sep 2017 06:22:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=RtPQLWKaPJcVpsEQKBXFnRvuG0rJRVtnOnItYqmzEuQ=; b=c3sdRb3v9rYMrP+6AfuezFgaGOaHzCUybvDA75chpZuhSZP7ZVCaI+WUu0m2jO2J1/ kPCdj7+6g0FaJQV+/0OfiTM2nCgsXf69fM4TLhXEFuWi3DDXoOoAUYVWoyLrcNxKPX9d yzmwrpSItIcVKTlQf5FAl8A1AERLVSbauAST9XQLg2ToPWNSs6qIHYy5b1sbIBZebwDn oJLmac9A1iBpZITVohmM4GBeigQxrSg64Mrs8MlmgQBrKwYbnwNDI3sIZMnNn7r22u+z cazjVSc6n0sdZRzfwuRAN50Qx4Ak/EX+QlZ/DZuvMGgFyC0dKzA1Gxhwx6h/SDJKTNVU OpLA== 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:in-reply-to :references; bh=RtPQLWKaPJcVpsEQKBXFnRvuG0rJRVtnOnItYqmzEuQ=; b=dXGpTmgawxYustKmDjFvJBX2HU0o3a1Oit2wq3Xgf4R0chSVQD/EMJCGaJCanoT9I1 wfCjKiGJeNN0UPSLj9ptup9u4MnkvlM+aR6qjzkKOddrGpWk+zz0hygNyf2xh6yFaXVC A37i4qiaV9AAEo3o7DD6TX/qEWYehImKwpIjT5zz9u4QjeahmKgVj4LZoNMAGY+m9c47 VB+zFELs+g6jrR19MftCBhy4guEbZ6RWtu8ZpS1hY9JiYNaBH2PEnyGSt5rhhkOfP55d 1QMS81dzFwAHNQkYXPh+bJuUyjZsmOgs2u19urKYHFaWnquomLrD0u4n7YnWgj3Qw8fO AN+w== X-Gm-Message-State: AHPjjUgqECY8tz0VYlwHNIwgtyWaPXc3dExpd94zyZ5It+wq3Dg/gC61 G8W9tDYBw6volaB5FJk= X-Google-Smtp-Source: AOwi7QDLfvYIj7/SDKKyF8vryzQNiRpcjIulVnNqCU9q1+sPIH0V45elGjYknIh1ELMPyD5mk8qcjA== X-Received: by 10.55.104.138 with SMTP id d132mr12032680qkc.151.1505049768178; Sun, 10 Sep 2017 06:22:48 -0700 (PDT) Received: from localhost ([2601:184:4780:aac0:25f8:dd96:a084:785a]) by smtp.gmail.com with ESMTPSA id p7sm4422690qke.78.2017.09.10.06.22.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 10 Sep 2017 06:22:47 -0700 (PDT) From: Rob Clark To: U-Boot Mailing List Date: Sun, 10 Sep 2017 09:22:23 -0400 Message-Id: <20170910132236.14318-3-robdclark@gmail.com> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170910132236.14318-1-robdclark@gmail.com> References: <20170910132236.14318-1-robdclark@gmail.com> Cc: Heinrich Schuchardt , Peter Jones , Leif Lindholm Subject: [U-Boot] [PATCH v1 02/12] efi_loader: add stub HII protocols 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: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Leif Lindholm EfiHiiConfigRoutingProtocolGuid EfiHiiDatabaseProtocol EfiHiiStringProtocol Signed-off-by: Leif Lindholm --- include/efi_api.h | 204 ++++++++++++++++++++++++++++ include/efi_loader.h | 6 + lib/efi_loader/Makefile | 2 +- lib/efi_loader/efi_boottime.c | 9 ++ lib/efi_loader/efi_hii.c | 303 ++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 523 insertions(+), 1 deletion(-) create mode 100644 lib/efi_loader/efi_hii.c diff --git a/include/efi_api.h b/include/efi_api.h index 57468dd972..932a3429a8 100644 --- a/include/efi_api.h +++ b/include/efi_api.h @@ -536,6 +536,210 @@ struct efi_device_path_utilities_protocol const struct efi_device_path *device_path); }; +#define EFI_HII_CONFIG_ROUTING_PROTOCOL_GUID \ + EFI_GUID(0x587e72d7, 0xcc50, 0x4f79, \ + 0x82, 0x09, 0xca, 0x29, 0x1f, 0xc1, 0xa1, 0x0f) + +struct efi_hii_config_routing_protocol +{ + efi_status_t(EFIAPI *extract_config)( + const struct efi_hii_config_routing_protocol *this, + const efi_string_t request, + efi_string_t *progress, + efi_string_t *results); + efi_status_t(EFIAPI *export_config)( + const struct efi_hii_config_routing_protocol *this, + efi_string_t *results); + efi_status_t(EFIAPI *route_config)( + const struct efi_hii_config_routing_protocol *this, + const efi_string_t configuration, + efi_string_t *progress); + efi_status_t(EFIAPI *block_to_config)( + const struct efi_hii_config_routing_protocol *this, + const efi_string_t config_request, + const uint8_t *block, + const UINTN block_size, + efi_string_t *config, + efi_string_t *progress); + efi_status_t(EFIAPI *config_to_block)( + const struct efi_hii_config_routing_protocol *this, + const efi_string_t config_resp, + const uint8_t *block, + const UINTN *block_size, + efi_string_t *progress); + efi_status_t(EFIAPI *get_alt_config)( + const struct efi_hii_config_routing_protocol *this, + const efi_string_t config_resp, + const efi_guid_t *guid, + const efi_string_t name, + const struct efi_device_path *device_path, + const efi_string_t alt_cfg_id, + efi_string_t *alt_cfg_resp); +}; + +#define EFI_HII_DATABASE_PROTOCOL_GUID \ + EFI_GUID(0xef9fc172, 0xa1b2, 0x4693, \ + 0xb3, 0x27, 0x6d, 0x32, 0xfc, 0x41, 0x60, 0x42) + +typedef enum { + EfiKeyLCtrl, EfiKeyA0, EfiKeyLAlt, EfiKeySpaceBar, + EfiKeyA2, EfiKeyA3, EfiKeyA4, EfiKeyRCtrl, EfiKeyLeftArrow, + EfiKeyDownArrow, EfiKeyRightArrow, EfiKeyZero, + EfiKeyPeriod, EfiKeyEnter, EfiKeyLShift, EfiKeyB0, + EfiKeyB1, EfiKeyB2, EfiKeyB3, EfiKeyB4, EfiKeyB5, EfiKeyB6, + EfiKeyB7, EfiKeyB8, EfiKeyB9, EfiKeyB10, EfiKeyRShift, + EfiKeyUpArrow, EfiKeyOne, EfiKeyTwo, EfiKeyThree, + EfiKeyCapsLock, EfiKeyC1, EfiKeyC2, EfiKeyC3, EfiKeyC4, + EfiKeyC5, EfiKeyC6, EfiKeyC7, EfiKeyC8, EfiKeyC9, + EfiKeyC10, EfiKeyC11, EfiKeyC12, EfiKeyFour, EfiKeyFive, + EfiKeySix, EfiKeyPlus, EfiKeyTab, EfiKeyD1, EfiKeyD2, + EfiKeyD3, EfiKeyD4, EfiKeyD5, EfiKeyD6, EfiKeyD7, EfiKeyD8, + EfiKeyD9, EfiKeyD10, EfiKeyD11, EfiKeyD12, EfiKeyD13, + EfiKeyDel, EfiKeyEnd, EfiKeyPgDn, EfiKeySeven, EfiKeyEight, + EfiKeyNine, EfiKeyE0, EfiKeyE1, EfiKeyE2, EfiKeyE3, + EfiKeyE4, EfiKeyE5, EfiKeyE6, EfiKeyE7, EfiKeyE8, EfiKeyE9, + EfiKeyE10, EfiKeyE11, EfiKeyE12, EfiKeyBackSpace, + EfiKeyIns, EfiKeyHome, EfiKeyPgUp, EfiKeyNLck, EfiKeySlash, + EfiKeyAsterisk, EfiKeyMinus, EfiKeyEsc, EfiKeyF1, EfiKeyF2, + EfiKeyF3, EfiKeyF4, EfiKeyF5, EfiKeyF6, EfiKeyF7, EfiKeyF8, + EfiKeyF9, EfiKeyF10, EfiKeyF11, EfiKeyF12, EfiKeyPrint, + EfiKeySLck, EfiKeyPause +} efi_key; + +struct efi_key_descriptor +{ + efi_key key; + uint16_t unicode; + uint16_t shifted_unicode; + uint16_t alt_gr_unicode; + uint16_t shifted_alt_gr_unicode; + uint16_t modifier; + uint16_t affected_attribute; +}; + +struct efi_hii_keyboard_layout +{ + uint16_t layout_length; + efi_guid_t guid; + uint32_t layout_descriptor_string_offset; + uint8_t descriptor_count; + struct efi_key_descriptor descriptors[]; +}; + +struct efi_hii_package_list_header +{ + efi_guid_t package_list_guid; + uint32_t package_length; +}; + +typedef void *efi_hii_handle_t; + +struct efi_hii_database_protocol +{ + efi_status_t(EFIAPI *new_package_list)( + const struct efi_hii_database_protocol *this, + const struct efi_hii_package_list_header *package_list, + const efi_handle_t driver_handle, + efi_hii_handle_t *handle); + efi_status_t(EFIAPI *remove_package_list)( + const struct efi_hii_database_protocol *this, + efi_hii_handle_t handle); + efi_status_t(EFIAPI *update_package_list)( + const struct efi_hii_database_protocol *this, + efi_hii_handle_t handle, + const struct efi_hii_package_list_header *package_list); + efi_status_t(EFIAPI *list_package_lists)( + const struct efi_hii_database_protocol *this, + uint8_t package_type, + const efi_guid_t *package_guid, + UINTN *handle_buffer_length, + efi_hii_handle_t *handle); + efi_status_t(EFIAPI *export_package_lists)( + const struct efi_hii_database_protocol *this, + efi_hii_handle_t handle, + UINTN *buffer_size, + struct efi_hii_package_list_header *buffer); + efi_status_t(EFIAPI *register_package_notify)( + const struct efi_hii_database_protocol *this, + uint8_t package_type, + const efi_guid_t *package_guid, + const void *package_notify_fn, + UINTN notify_type, + efi_handle_t *notify_handle); + efi_status_t(EFIAPI *unregister_package_notify)( + const struct efi_hii_database_protocol *this, + efi_handle_t notification_handle + ); + efi_status_t(EFIAPI *find_keyboard_layouts)( + const struct efi_hii_database_protocol *this, + uint16_t *key_guid_buffer_length, + efi_guid_t *key_guid_buffer); + efi_status_t(EFIAPI *get_keyboard_layout)( + const struct efi_hii_database_protocol *this, + efi_guid_t *key_guid, + uint16_t *keyboard_layout_length, + struct efi_hii_keyboard_layout *keyboard_layout); + efi_status_t(EFIAPI *set_keyboard_layout)( + const struct efi_hii_database_protocol *this, + efi_guid_t *key_guid); + efi_status_t(EFIAPI *get_package_list_handle)( + const struct efi_hii_database_protocol *this, + efi_hii_handle_t package_list_handle, + efi_handle_t *driver_handle); +}; + +#define EFI_HII_STRING_PROTOCOL_GUID \ + EFI_GUID(0x0fd96974, 0x23aa, 0x4cdc, \ + 0xb9, 0xcb, 0x98, 0xd1, 0x77, 0x50, 0x32, 0x2a) + +typedef uint32_t efi_hii_font_style_t; +typedef uint16_t efi_string_id_t; + +struct efi_font_info +{ + efi_hii_font_style_t font_style; + uint16_t font_size; + uint16_t font_name[1]; +}; + +struct efi_hii_string_protocol +{ + efi_status_t(EFIAPI *new_string)( + const struct efi_hii_string_protocol *this, + efi_hii_handle_t package_list, + efi_string_id_t *string_id, + const uint8_t *language, + const uint16_t *language_name, + const efi_string_t string, + const struct efi_font_info *string_font_info); + efi_status_t(EFIAPI *get_string)( + const struct efi_hii_string_protocol *this, + const uint8_t *language, + efi_hii_handle_t package_list, + efi_string_id_t string_id, + efi_string_t string, + UINTN *string_size, + struct efi_font_info **string_font_info); + efi_status_t(EFIAPI *set_string)( + const struct efi_hii_string_protocol *this, + efi_hii_handle_t package_list, + efi_string_id_t string_id, + const uint8_t *language, + const efi_string_t string, + const struct efi_font_info *string_font_info); + efi_status_t(EFIAPI *get_languages)( + const struct efi_hii_string_protocol *this, + efi_hii_handle_t package_list, + uint8_t *languages, + UINTN *languages_size); + efi_status_t(EFIAPI *get_secondary_languages)( + const struct efi_hii_string_protocol *this, + efi_hii_handle_t package_list, + const uint8_t *primary_language, + uint8_t *secondary_languages, + UINTN *secondary_languages_size); +}; + #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 c009828db9..a89bb2fcd9 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -59,6 +59,9 @@ extern struct efi_simple_input_interface efi_con_in; extern const struct efi_console_control_protocol efi_console_control; 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; +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; uint16_t *efi_dp_str(struct efi_device_path *dp); @@ -70,6 +73,9 @@ extern const efi_guid_t efi_guid_device_path_to_text_protocol; extern const efi_guid_t efi_simple_file_system_protocol_guid; extern const efi_guid_t efi_file_info_guid; 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 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 f5e69dd078..e8fd6823a3 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 +obj-y += efi_device_path_utilities.o efi_hii.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 8bb243d673..4d1a16051b 100644 --- a/lib/efi_loader/efi_boottime.c +++ b/lib/efi_loader/efi_boottime.c @@ -779,6 +779,15 @@ void efi_setup_loaded_image(struct efi_loaded_image *info, struct efi_object *ob obj->protocols[4].protocol_interface = (void *)&efi_device_path_utilities; + obj->protocols[5].guid = &efi_guid_hii_string_protocol; + obj->protocols[5].protocol_interface = (void *)&efi_hii_string; + + obj->protocols[6].guid = &efi_guid_hii_database_protocol; + obj->protocols[6].protocol_interface = (void *)&efi_hii_database; + + obj->protocols[7].guid = &efi_guid_hii_config_routing_protocol; + obj->protocols[7].protocol_interface = (void *)&efi_hii_config_routing; + info->file_path = file_path; info->device_handle = efi_dp_find_obj(device_path, NULL); diff --git a/lib/efi_loader/efi_hii.c b/lib/efi_loader/efi_hii.c new file mode 100644 index 0000000000..cc68a28d2b --- /dev/null +++ b/lib/efi_loader/efi_hii.c @@ -0,0 +1,303 @@ +/* + * EFI Human Interface Infrastructure ... interface + * + * Copyright (c) 2017 Leif Lindholm + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include +#include + +const efi_guid_t efi_guid_hii_config_routing_protocol = + EFI_HII_CONFIG_ROUTING_PROTOCOL_GUID; +const efi_guid_t efi_guid_hii_database_protocol = EFI_HII_DATABASE_PROTOCOL_GUID; +const efi_guid_t efi_guid_hii_string_protocol = EFI_HII_STRING_PROTOCOL_GUID; + + +/* + * EFI_HII_CONFIG_ROUTING_PROTOCOL + */ + +static efi_status_t extract_config( + const struct efi_hii_config_routing_protocol *this, + const efi_string_t request, + efi_string_t *progress, + efi_string_t *results) +{ + EFI_ENTRY("%p, \"%ls\", %p, %p", this, request, progress, results); + return EFI_EXIT(EFI_OUT_OF_RESOURCES); +} + +static efi_status_t export_config( + const struct efi_hii_config_routing_protocol *this, + efi_string_t *results) +{ + EFI_ENTRY("%p, %p", this, results); + return EFI_EXIT(EFI_OUT_OF_RESOURCES); +} + +static efi_status_t route_config( + const struct efi_hii_config_routing_protocol *this, + const efi_string_t configuration, + efi_string_t *progress) +{ + EFI_ENTRY("%p, \"%ls\", %p", this, configuration, progress); + return EFI_EXIT(EFI_OUT_OF_RESOURCES); +} + +static efi_status_t block_to_config( + const struct efi_hii_config_routing_protocol *this, + const efi_string_t config_request, + const uint8_t *block, + const UINTN block_size, + efi_string_t *config, + efi_string_t *progress) +{ + EFI_ENTRY("%p, \"%ls\", %p, %lu, %p, %p", this, config_request, block, + block_size, config, progress); + return EFI_EXIT(EFI_OUT_OF_RESOURCES); +} + +static efi_status_t config_to_block( + const struct efi_hii_config_routing_protocol *this, + const efi_string_t config_resp, + const uint8_t *block, + const UINTN *block_size, + efi_string_t *progress) +{ + EFI_ENTRY("%p, \"%ls\", %p, %p, %p", this, config_resp, block, + block_size, progress); + return EFI_EXIT(EFI_OUT_OF_RESOURCES); +} + +static efi_status_t get_alt_config( + const struct efi_hii_config_routing_protocol *this, + const efi_string_t config_resp, + const efi_guid_t *guid, + const efi_string_t name, + const struct efi_device_path *device_path, + const efi_string_t alt_cfg_id, + efi_string_t *alt_cfg_resp) +{ + EFI_ENTRY("%p, \"%ls\", %pUl, \"%ls\", %p, \"%ls\", %p", this, + config_resp, guid, name, device_path, alt_cfg_id, + alt_cfg_resp); + return EFI_EXIT(EFI_OUT_OF_RESOURCES); +} + + +/* + * EFI_HII_DATABASE_PROTOCOL + */ + +static efi_status_t new_package_list( + const struct efi_hii_database_protocol *this, + const struct efi_hii_package_list_header *package_list, + const efi_handle_t driver_handle, + efi_hii_handle_t *handle) +{ + /* Current shell start failure. */ + /* Invoked from MdeModulePkg/Library/UefiHiiLib/HiiLib.c : HiiAddPackages */ + /* (Via autogenerated .c file.) */ + EFI_ENTRY("%p, %p, %p, %p", this, package_list, driver_handle, handle); + return EFI_EXIT(EFI_OUT_OF_RESOURCES); +} + +static efi_status_t remove_package_list( + const struct efi_hii_database_protocol *this, + efi_hii_handle_t handle) +{ + EFI_ENTRY("%p, %p", this, handle); + return EFI_EXIT(EFI_NOT_FOUND); +} + +static efi_status_t update_package_list( + const struct efi_hii_database_protocol *this, + efi_hii_handle_t handle, + const struct efi_hii_package_list_header *package_list) +{ + EFI_ENTRY("%p, %p, %p", this, handle, package_list); + return EFI_EXIT(EFI_NOT_FOUND); +} + +static efi_status_t list_package_lists( + const struct efi_hii_database_protocol *this, + uint8_t package_type, + const efi_guid_t *package_guid, + UINTN *handle_buffer_length, + efi_hii_handle_t *handle) +{ + EFI_ENTRY("%p, %u, %pUl, %p, %p", this, package_type, package_guid, + handle_buffer_length, handle); + return EFI_EXIT(EFI_NOT_FOUND); +} + +static efi_status_t export_package_lists( + const struct efi_hii_database_protocol *this, + efi_hii_handle_t handle, + UINTN *buffer_size, + struct efi_hii_package_list_header *buffer) +{ + EFI_ENTRY("%p, %p, %p, %p", this, handle, buffer_size, buffer); + return EFI_EXIT(EFI_NOT_FOUND); +} + +static efi_status_t register_package_notify( + const struct efi_hii_database_protocol *this, + uint8_t package_type, + const efi_guid_t *package_guid, + const void *package_notify_fn, + UINTN notify_type, + efi_handle_t *notify_handle) +{ + EFI_ENTRY("%p, %u, %pUl, %p, %lu, %p", this, package_type, + package_guid, package_notify_fn, notify_type, + notify_handle); + return EFI_EXIT(EFI_OUT_OF_RESOURCES); +} + +static efi_status_t unregister_package_notify( + const struct efi_hii_database_protocol *this, + efi_handle_t notification_handle) +{ + EFI_ENTRY("%p, %p", this, notification_handle); + return EFI_EXIT(EFI_NOT_FOUND); +} + +static efi_status_t find_keyboard_layouts( + const struct efi_hii_database_protocol *this, + uint16_t *key_guid_buffer_length, + efi_guid_t *key_guid_buffer) +{ + EFI_ENTRY("%p, %p, %p", this, key_guid_buffer_length, key_guid_buffer); + return EFI_EXIT(EFI_NOT_FOUND); /* Invalid */ +} + +static efi_status_t get_keyboard_layout( + const struct efi_hii_database_protocol *this, + efi_guid_t *key_guid, + uint16_t *keyboard_layout_length, + struct efi_hii_keyboard_layout *keyboard_layout) +{ + EFI_ENTRY("%p, %pUl, %p, %p", this, key_guid, keyboard_layout_length, + keyboard_layout); + return EFI_EXIT(EFI_NOT_FOUND); +} + +static efi_status_t set_keyboard_layout( + const struct efi_hii_database_protocol *this, + efi_guid_t *key_guid) +{ + EFI_ENTRY("%p, %pUl", this, key_guid); + return EFI_EXIT(EFI_NOT_FOUND); +} + +static efi_status_t get_package_list_handle( + const struct efi_hii_database_protocol *this, + efi_hii_handle_t package_list_handle, + efi_handle_t *driver_handle) +{ + EFI_ENTRY("%p, %p, %p", this, package_list_handle, driver_handle); + return EFI_EXIT(EFI_INVALID_PARAMETER); +} + + +/* + * EFI_HII_STRING_PROTOCOL + */ + +static efi_status_t new_string( + const struct efi_hii_string_protocol *this, + efi_hii_handle_t package_list, + efi_string_id_t *string_id, + const uint8_t *language, + const uint16_t *language_name, + const efi_string_t string, + const struct efi_font_info *string_font_info) +{ + EFI_ENTRY("%p, %p, %p, %p, %p, \"%ls\", %p", this, package_list, + string_id, language, language_name, string, + string_font_info); + return EFI_EXIT(EFI_NOT_FOUND); +} + +static efi_status_t get_string( + const struct efi_hii_string_protocol *this, + const uint8_t *language, + efi_hii_handle_t package_list, + efi_string_id_t string_id, + efi_string_t string, + UINTN *string_size, + struct efi_font_info **string_font_info) +{ + EFI_ENTRY("%p, %p, %p, %u, \"%ls\", %p, %p", this, language, + package_list, string_id, string, string_size, + string_font_info); + return EFI_EXIT(EFI_NOT_FOUND); +} + +static efi_status_t set_string( + const struct efi_hii_string_protocol *this, + efi_hii_handle_t package_list, + efi_string_id_t string_id, + const uint8_t *language, + const efi_string_t string, + const struct efi_font_info *string_font_info) +{ + EFI_ENTRY("%p, %p, %u, %p, \"%ls\", %p", this, package_list, string_id, + language, string, string_font_info); + return EFI_EXIT(EFI_NOT_FOUND); +} + +static efi_status_t get_languages( + const struct efi_hii_string_protocol *this, + efi_hii_handle_t package_list, + uint8_t *languages, + UINTN *languages_size) +{ + EFI_ENTRY("%p, %p, %p, %p", this, package_list, languages, + languages_size); + return EFI_EXIT(EFI_NOT_FOUND); +} + +static efi_status_t get_secondary_languages( + const struct efi_hii_string_protocol *this, + efi_hii_handle_t package_list, + const uint8_t *primary_language, + uint8_t *secondary_languages, + UINTN *secondary_languages_size) +{ + EFI_ENTRY("%p, %p, %p, %p, %p", this, package_list, primary_language, + secondary_languages, secondary_languages_size); + return EFI_EXIT(EFI_NOT_FOUND); +} + +const struct efi_hii_config_routing_protocol efi_hii_config_routing = { + .extract_config = extract_config, + .export_config = export_config, + .route_config = route_config, + .block_to_config = block_to_config, + .config_to_block = config_to_block, + .get_alt_config = get_alt_config +}; +const struct efi_hii_database_protocol efi_hii_database = { + .new_package_list = new_package_list, + .remove_package_list = remove_package_list, + .update_package_list = update_package_list, + .list_package_lists = list_package_lists, + .export_package_lists = export_package_lists, + .register_package_notify = register_package_notify, + .unregister_package_notify = unregister_package_notify, + .find_keyboard_layouts = find_keyboard_layouts, + .get_keyboard_layout = get_keyboard_layout, + .set_keyboard_layout = set_keyboard_layout, + .get_package_list_handle = get_package_list_handle +}; +const struct efi_hii_string_protocol efi_hii_string = { + .new_string = new_string, + .get_string = get_string, + .set_string = set_string, + .get_languages = get_languages, + .get_secondary_languages = get_secondary_languages +};