From patchwork Mon Oct 4 03:44:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 515145 Delivered-To: patch@linaro.org Received: by 2002:ac0:890a:0:0:0:0:0 with SMTP id 10csp1062678imy; Sun, 3 Oct 2021 20:48:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw66urcaHLJw0k19MZOTUsNTQ4oy/zGCclHtchrY/g99vfRIG8h93I9tTBn0lCZHs5NDZ/M X-Received: by 2002:a50:8e59:: with SMTP id 25mr4678659edx.160.1633319296072; Sun, 03 Oct 2021 20:48:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633319296; cv=none; d=google.com; s=arc-20160816; b=cpYCAOuaVZHxU9byfiQEtU/F6YuWKZUF3KTr9hFr8NYLWHW4j5sBVtybTQbqlPO61/ kCYk1h5Fk3n2gPKOxnV9m8vmpm+ik+CsS5VwQNNWtRcE7Nop2Zr+Oe/avCz45Jx5iQbl JhAL5RNCaXgn+7KRVf4nGSFLWfmO05skvBSKxMi0Wa+pp64bF8CJKpKtpBrtP1hXYer0 nADpgzzwoyFYcwB6tFkn+txgCgYP0vHco9olThO7JAMWBRTdj/XaJ+FbCYQIEo+sckpC J6sCbG8vg2s3M6pafNZjJ3B3qyFes2MuRWEvYgac/P1i1A4uI025hy+6O9SyA4u58RWi tNbQ== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=L0tO99RHHL4KQN7RYjqTxDr3uBNsF0Bss6lY1EesGwM=; b=W8T0YfFOXim/hXcP2ClCOcPbWwVnFzmPkjMLZDQuwQy0yWq34+x+s84gofQ5wZfl/u vtWUaLIm+DPCZmobZo7xMMthK/4tHtO+x4vYyWGQyadyCSPf8k0ca5NZGBGXYBvcTQSv DnagWg4os+CgvwIV5kI1JP4FKJc+T7lhim1E2pljfNj1jrkcaw2psWSk5grFsg6QnrT9 +br0JgCK4TviQCD25ZsNJ8LAFab6I3JQVU1p2nmf3zCd04XF9kW9dSMNlRIbIglzXo74 FEYcMRxDZYvgXMYKTXNzbDvk4Hqk4EToAjjXGFlgZv+m1JwARGS+qNTnG/mT97PwrRDt uSEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LdIej5Xb; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id q9si15856155ejn.647.2021.10.03.20.48.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Oct 2021 20:48:16 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LdIej5Xb; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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 636C3835AD; Mon, 4 Oct 2021 05:46:53 +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="LdIej5Xb"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 37F1483563; Mon, 4 Oct 2021 05:46:28 +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-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) (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 A48C78358C for ; Mon, 4 Oct 2021 05:46:22 +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=takahiro.akashi@linaro.org Received: by mail-pf1-x434.google.com with SMTP id s16so13364805pfk.0 for ; Sun, 03 Oct 2021 20:46:22 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=L0tO99RHHL4KQN7RYjqTxDr3uBNsF0Bss6lY1EesGwM=; b=LdIej5XbcrSMzGwpQ6oegmEU1KS+SPKB4eDqjlR4AEeTE9WK6+YPTD66//H5HjLX41 QwjyQNXx3H3wz8ZEYnyqQ2F1p5NCzh8YWg3zY2rLWZqSk9GuVEqJokozvdJX1rCIfWxV ls4FKqE4P5bVZMcCY8Ske7p0JBKLwkmhWeUPWhO5u16ktngzjWzDq8Zdmkw0YWOU5GuG MFsXjJOprbo85iYuOIc+XEqJJz2hkwLX6H3HlKfNssXBviiiixn4auLYcyNyijDnbXZ3 Pp81NL6InD8VjhRJ3aY3V1z0b8JmcdpmzLjOU4wBw7G42uHyvmY4l2oV48JUtzXd2I9O oCCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=L0tO99RHHL4KQN7RYjqTxDr3uBNsF0Bss6lY1EesGwM=; b=jAtn26Mvr28b/01rkQJrIh2bzAYQH0keuPbOdekVI7VitI9mH8mYciX7ilJ9y8+98V HOy7sY6Ppwq3T/jScsB/YX9vPr7jL1Spe1sVFkUtw2z+CZXnVFyW5dIsn0pj/2a2ZT09 pNIfRHus5ahuFofMosoB9AM2ZzfUOIGOoECzG/CbAgrgUVJQXaJuI6BVfxPraIdk1Lkx TLFwpUF7+TZlNzM88IQej2SkPvw19Ovrjfi+4d4WKZ6susw7z0tMeH8rQZ51r0jXGBlL p+F5K8xjecCryzKLW7qFf8fdS9z1KTi4+lJTGCuYk4aOw2DMXNo4B8WN2n35hOrHg8pG DtwQ== X-Gm-Message-State: AOAM532MvUXWYVtRFOqJUdOSjWRrVlAangH28qCd9infTKw9MefzzmHs 10Q6r9LxXcwqiU8yC/IfRQ54jw== X-Received: by 2002:a62:6383:0:b0:447:7fc:3eee with SMTP id x125-20020a626383000000b0044707fc3eeemr23914250pfb.86.1633319181012; Sun, 03 Oct 2021 20:46:21 -0700 (PDT) Received: from localhost.localdomain (61-205-96-147m5.grp4.mineo.jp. [61.205.96.147]) by smtp.gmail.com with ESMTPSA id a11sm11863515pgj.75.2021.10.03.20.46.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Oct 2021 20:46:20 -0700 (PDT) From: AKASHI Takahiro To: xypron.glpk@gmx.de, agraf@csgraf.de, sjg@chromium.org, ilias.apalodimas@linaro.org Cc: u-boot@lists.denx.de, AKASHI Takahiro Subject: [resent RFC 17/22] efi_loader: add efi_remove_handle() Date: Mon, 4 Oct 2021 12:44:25 +0900 Message-Id: <20211004034430.41355-18-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211004034430.41355-1-takahiro.akashi@linaro.org> References: <20211004034430.41355-1-takahiro.akashi@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean This function is a counterpart of efi_add_handle() and will be used in order to remove an efi_disk object in a later patch. Signed-off-by: AKASHI Takahiro --- include/efi_loader.h | 2 ++ lib/efi_loader/efi_boottime.c | 8 ++++++++ 2 files changed, 10 insertions(+) -- 2.33.0 diff --git a/include/efi_loader.h b/include/efi_loader.h index cfbe1fe659ef..50f4119dcdfb 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -579,6 +579,8 @@ void efi_save_gd(void); void efi_runtime_relocate(ulong offset, struct efi_mem_desc *map); /* Add a new object to the object list. */ void efi_add_handle(efi_handle_t obj); +/* Remove a object from the object list. */ +void efi_remove_handle(efi_handle_t obj); /* Create handle */ efi_status_t efi_create_handle(efi_handle_t *handle); /* Delete handle */ diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c index f0283b539e46..b2503b74233b 100644 --- a/lib/efi_loader/efi_boottime.c +++ b/lib/efi_loader/efi_boottime.c @@ -503,6 +503,14 @@ void efi_add_handle(efi_handle_t handle) list_add_tail(&handle->link, &efi_obj_list); } +void efi_remove_handle(efi_handle_t handle) +{ + if (!handle) + return; + + list_del(&handle->link); +} + /** * efi_create_handle() - create handle * @handle: new handle