From patchwork Mon Oct 24 04:47:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahisa Kojima X-Patchwork-Id: 617833 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp2483082pvb; Sun, 23 Oct 2022 21:48:05 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6ooW+qZN3Sqyk6L1GVbWO2D5Jx0qBdPxaqV0MEUyUOzFu7/fQXLpjwMWvlHiRz+F4Rcuak X-Received: by 2002:aa7:c491:0:b0:461:7f0c:c573 with SMTP id m17-20020aa7c491000000b004617f0cc573mr9108982edq.8.1666586885510; Sun, 23 Oct 2022 21:48:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666586885; cv=none; d=google.com; s=arc-20160816; b=vegMtz6M2DoqTaWjc9J/2cXY5ECKkszV2Yib6ILPVXe90EGjQoOP8fykTfl2lghasU cKPLhcVUenE5IxCRZFkig5OHQX8ivG9LFRBdTagy3jJROj1GbkmPPwH+6rWhV0S197tP k+SwqHjNmaoRO/hPhoajUhj3+M7UU+O9lnEac+xNT+zWF4OaZ5nKaD9QZr7Y2T+KjOw/ +MS2a5y7mAAbjyzDnWPZH6Ccmva4I4yAsGRwvrGIDgy0+9CEn9tR7RpPmULdP6cmmaBr eheUnR9UXutYQiGndJWnRH2RqXcBEFmvRTvOgk7wAbScrgHqrhUpk0szpRsWLgli/Jmc 3K0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=0ERyheRvFp8/wHvmYCSbRcxDgU68ioohlTrwboamaxo=; b=NIEK0ebn8qIwyWk3CGjbxfCbeIezU/TqA2PPunIS+vvi9UP95vq/bNaT9LswCWi1TR 7yUV1I/t5UCmXt7gVNSmewdRDD4ojv1NnZ3tWWsa/WdA+qNDTXv+XVdns9IBz9v+fw5U uvNK95fvyo5RHJdDtieXzzHDVyVB6kDCQRtXrIPWaaNa+8T9XNuhjxf76NR5V6FsqbAw QBFaMr3ouOlWFgt2b8y48/fQtfOjna5tgNNe3yz30tldEN8qtkr56i6ecHCJ1a3eqZZV L7VuxzBujzcyyUID9DXcDBnx+kwjKVajMPLcTF9aaooLr0cl/BO87U6RrRLkeiPg/icw wCDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Z89oXIx7; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id e1-20020a17090618e100b00782af8d75fasi22452897ejf.252.2022.10.23.21.48.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Oct 2022 21:48:05 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Z89oXIx7; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5D8B984F50; Mon, 24 Oct 2022 06:47:49 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="Z89oXIx7"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id ECD7184F43; Mon, 24 Oct 2022 06:47:43 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com [IPv6:2607:f8b0:4864:20::52d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id DAEC984DE8 for ; Mon, 24 Oct 2022 06:47:39 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=masahisa.kojima@linaro.org Received: by mail-pg1-x52d.google.com with SMTP id b5so7774243pgb.6 for ; Sun, 23 Oct 2022 21:47:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=0ERyheRvFp8/wHvmYCSbRcxDgU68ioohlTrwboamaxo=; b=Z89oXIx77x/Yvd0L9G4LlabhfimsnWxEflbHQ0zk5FZ0KRqDYCOHNVqle1dKbixzGf yhHS6zvCBLiPZLoaQtg6F36aelLc85vE3gS52PSDg3CBXVY2bygMjwl3LLv61qQHotZ/ mnw+0jOc0jWjz+oR0BTUl0fQ+FZVp/Gm0tR3aKW/jVUFRvkGEm6ONJZDTsmNpFLKjTms KayKk2GiRrCOATsji8EKpciKgbHj40X3NWm2Sfpg3E91LHYiWjtg3Pt3BKxTmLx2vC8g 87eBsyCO4mLAIO/wsNyT5eyNiugdKO/epxOx/5XeueU6RvAF57LQNdHRgJVxOi/5lR1m 0l+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=0ERyheRvFp8/wHvmYCSbRcxDgU68ioohlTrwboamaxo=; b=WgdV8Wyt32Yxct2e3RBqzrKTFDOQdf2uy/YLw1WoaTfMhCvZ0QcBC+IqCJMX5pZinw WS+XybHHVKwKc+rJs8hPOsZI8V5JG15JAbtuyVsIW4dGawQb/byMr7O4rUTQSZKtiyOb g8t4JvMaajaRYhgoK6yT3oWtq6D5Is8a6DHUukdHgUr3nTwMoJ5MZ89XvH+wc7EdmBDI Kb2xYE74wLmqj605N3O+WyOPuJd+iMGr0K0GaQKQlyvMzvoygh5Fi/kksguLWLjc6ujW 7BHQoA0AqiZcvVmTb2AEmYAIGjhHiDHFKzwlih50Z+HWrlF1gCalsYKphdzUkvEjj3z/ 65Ew== X-Gm-Message-State: ACrzQf3+PBOQ3Zq/6vsPZIqUDc+sDyYo1iOLRB2hgAWj8yvj9M6ue5Tt 8SutaL7Gr7UVUSTSZs2Q8gZXCUBV8xNSiw== X-Received: by 2002:a05:6a00:23c5:b0:563:a0f0:e4d1 with SMTP id g5-20020a056a0023c500b00563a0f0e4d1mr31587351pfc.62.1666586857898; Sun, 23 Oct 2022 21:47:37 -0700 (PDT) Received: from localhost.localdomain ([240d:1a:cf7:5800:82fa:5bff:fe4b:26b1]) by smtp.gmail.com with ESMTPSA id i72-20020a62874b000000b0056b932f3280sm3213979pfe.103.2022.10.23.21.47.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Oct 2022 21:47:37 -0700 (PDT) From: Masahisa Kojima To: u-boot@lists.denx.de Cc: Heinrich Schuchardt , Ilias Apalodimas , Simon Glass , Takahiro Akashi , Masahisa Kojima Subject: [PATCH v4 2/7] eficonfig: expose append entry function Date: Mon, 24 Oct 2022 13:47:59 +0900 Message-Id: <20221024044804.3351-3-masahisa.kojima@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221024044804.3351-1-masahisa.kojima@linaro.org> References: <20221024044804.3351-1-masahisa.kojima@linaro.org> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean This commit exposes the eficonfig menu entry append function. Signed-off-by: Masahisa Kojima --- No change since v2 newly created in v2 cmd/eficonfig.c | 32 +++++++++++++++++--------------- include/efi_config.h | 5 +++++ 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/cmd/eficonfig.c b/cmd/eficonfig.c index f6a99bd01a..0cb0770ac3 100644 --- a/cmd/eficonfig.c +++ b/cmd/eficonfig.c @@ -263,7 +263,7 @@ efi_status_t eficonfig_process_quit(void *data) } /** - * append_entry() - append menu item + * eficonfig_append_menu_entry() - append menu item * * @efi_menu: pointer to the efimenu structure * @title: pointer to the entry title @@ -271,8 +271,9 @@ efi_status_t eficonfig_process_quit(void *data) * @data: pointer to the data to be passed to each entry callback * Return: status code */ -static efi_status_t append_entry(struct efimenu *efi_menu, - char *title, eficonfig_entry_func func, void *data) +efi_status_t eficonfig_append_menu_entry(struct efimenu *efi_menu, + char *title, eficonfig_entry_func func, + void *data) { struct eficonfig_entry *entry; @@ -295,12 +296,12 @@ static efi_status_t append_entry(struct efimenu *efi_menu, } /** - * append_quit_entry() - append quit entry + * eficonfig_append_quit_entry() - append quit entry * * @efi_menu: pointer to the efimenu structure * Return: status code */ -static efi_status_t append_quit_entry(struct efimenu *efi_menu) +efi_status_t eficonfig_append_quit_entry(struct efimenu *efi_menu) { char *title; efi_status_t ret; @@ -309,7 +310,7 @@ static efi_status_t append_quit_entry(struct efimenu *efi_menu) if (!title) return EFI_OUT_OF_RESOURCES; - ret = append_entry(efi_menu, title, eficonfig_process_quit, NULL); + ret = eficonfig_append_menu_entry(efi_menu, title, eficonfig_process_quit, NULL); if (ret != EFI_SUCCESS) free(title); @@ -341,7 +342,7 @@ void *eficonfig_create_fixed_menu(const struct eficonfig_item *items, int count) if (!title) goto out; - ret = append_entry(efi_menu, title, iter->func, iter->data); + ret = eficonfig_append_menu_entry(efi_menu, title, iter->func, iter->data); if (ret != EFI_SUCCESS) { free(title); goto out; @@ -634,14 +635,15 @@ static efi_status_t eficonfig_select_volume(struct eficonfig_select_file_info *f info->v = v; info->dp = device_path; info->file_info = file_info; - ret = append_entry(efi_menu, devname, eficonfig_volume_selected, info); + ret = eficonfig_append_menu_entry(efi_menu, devname, eficonfig_volume_selected, + info); if (ret != EFI_SUCCESS) { free(info); goto out; } } - ret = append_quit_entry(efi_menu); + ret = eficonfig_append_quit_entry(efi_menu); if (ret != EFI_SUCCESS) goto out; @@ -745,8 +747,8 @@ eficonfig_create_file_entry(struct efimenu *efi_menu, u32 count, (int (*)(const void *, const void *))sort_file); for (i = 0; i < entry_num; i++) { - ret = append_entry(efi_menu, tmp_infos[i]->file_name, - eficonfig_file_selected, tmp_infos[i]); + ret = eficonfig_append_menu_entry(efi_menu, tmp_infos[i]->file_name, + eficonfig_file_selected, tmp_infos[i]); if (ret != EFI_SUCCESS) goto out; } @@ -815,7 +817,7 @@ static efi_status_t eficonfig_select_file(struct eficonfig_select_file_info *fil if (ret != EFI_SUCCESS) goto err; - ret = append_quit_entry(efi_menu); + ret = eficonfig_append_quit_entry(efi_menu); if (ret != EFI_SUCCESS) goto err; @@ -1218,7 +1220,7 @@ static efi_status_t create_boot_option_entry(struct efimenu *efi_menu, char *tit utf16_utf8_strcpy(&p, val); } - return append_entry(efi_menu, buf, func, data); + return eficonfig_append_menu_entry(efi_menu, buf, func, data); } /** @@ -1677,7 +1679,7 @@ static efi_status_t eficonfig_add_boot_selection_entry(struct efimenu *efi_menu, utf16_utf8_strcpy(&p, lo.label); info->boot_index = boot_index; info->selected = selected; - ret = append_entry(efi_menu, buf, eficonfig_process_boot_selected, info); + ret = eficonfig_append_menu_entry(efi_menu, buf, eficonfig_process_boot_selected, info); if (ret != EFI_SUCCESS) { free(load_option); free(info); @@ -1736,7 +1738,7 @@ static efi_status_t eficonfig_show_boot_selection(unsigned int *selected) break; } - ret = append_quit_entry(efi_menu); + ret = eficonfig_append_quit_entry(efi_menu); if (ret != EFI_SUCCESS) goto out; diff --git a/include/efi_config.h b/include/efi_config.h index 098cac2115..86bc801211 100644 --- a/include/efi_config.h +++ b/include/efi_config.h @@ -95,4 +95,9 @@ efi_status_t eficonfig_get_unused_bootoption(u16 *buf, efi_status_t eficonfig_append_bootorder(u16 index); efi_status_t eficonfig_generate_media_device_boot_option(void); +efi_status_t eficonfig_append_menu_entry(struct efimenu *efi_menu, + char *title, eficonfig_entry_func func, + void *data); +efi_status_t eficonfig_append_quit_entry(struct efimenu *efi_menu); + #endif