From patchwork Fri Oct 1 05:02:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 515010 Delivered-To: patch@linaro.org Received: by 2002:a02:606e:0:0:0:0:0 with SMTP id d46csp454209jaf; Thu, 30 Sep 2021 22:09:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxurvrsaDe2SDebkYNSmIn8w3Smy0PJXWWzET76id4s5mJ3LcqubLGe7Vc1SL/ReXBLwHYg X-Received: by 2002:a50:e14c:: with SMTP id i12mr11912024edl.125.1633064950448; Thu, 30 Sep 2021 22:09:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633064950; cv=none; d=google.com; s=arc-20160816; b=jhMlUudBFCZZR+Y9npdDNyy6lmH9YLKE0eRfVkN7jRRjnhnvHL+tIBHopcNHGJObbo coyvl3/MiAHCv7w2LWR+ysYZY59In7R1JVGA8ZV1g5YhfNrXN9rkSpm5wQ1tJqoBoSBO eQgv0a3lJZg49XNNGjqJepHJT42E4rakblDfYu+2lmdgecBdWjDyBaCRPl3aWCiPMS9c FzC133iJRzUL2I5py4ASlg6+LgeQg4F7RngOyGOyGPwbgA6io2ySoZ/okPYM54S3+cEZ cUqjNBXBzMePQ8hhsWJ9RX+MYgR/AlQahfJ2/ggfMssXyEqkpwfNiCFnwcLdmKuu2nZn tcPg== 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=YbUKhczwc9BGVoe+b9XSP/w+j1dGLjLudX2C13i5CiMUnAlnfzsn+9UWfuN1NSnr5j F9MupFgsGUasb4nUO86qPjhHWSb25CjuS9TSNdbcCzIWzLp4JMQFk5N5OdMZ1PFwM4yn tYde7RxpxptLdH5zAkrrHXAxgGrpiSb3xVBGuFAju7dSIOGP97tYVYkakzjDFbdw/zV/ nSIbK9wNSZI1RnC0qnpmOwSK6y6RAPf7UKUu5SXtBcIy96ztYbfUyou8RzRs6tB6d+4Y swf77MrlOYtQ5vASBrZ+vi3dQsZ11TD3BJARRlUAQ37x83fq4oDB0ZRdQYDrXAZf0cqj 2PTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MvkuiY72; 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 b9si5789894edn.271.2021.09.30.22.09.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:09:10 -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=MvkuiY72; 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 6C97B8348E; Fri, 1 Oct 2021 07:05:29 +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="MvkuiY72"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2820281EE5; Fri, 1 Oct 2021 07:04:54 +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-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) (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 237E38344D for ; Fri, 1 Oct 2021 07:04:44 +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-pg1-x530.google.com with SMTP id g184so8368255pgc.6 for ; Thu, 30 Sep 2021 22:04:44 -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=MvkuiY72V2ngYAgrSvdQXWIoXQRyfLYFxin62zE23hCAeACcA2Sbr9sVBpUnimPPae igLZ8WYjMeYJPVobuRnXctlv7xvM3IKGlsDzAlEgiSaK/q3UuX3GWh+8hju2pUonFU31 dud4RMGed2Wutl8L14rh+Ws/ywaGcuJm/0gzskrdsVzJXjcksJfq0S8q+0Z2jLMwZc4y 7UvCy6p3PKwM+olXx0wP629cZ3gnMSWKf10w9LG475QgVxxVR3O836eb6ogxGRsFTbOL C6BBnha/a1Vg4plaNVe/DV5XWFC5RIRcrIJomlh1Le4CmHk3pwO0v2SzzPhd9un/VnCC caTg== 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=KTlozT6XgaZ8kX46v3S/K2yiOZ4qFIMCcA/3LBTEqGTlZKPbghOmYW5qA91T48lzJE j1OfX1AfCnLXq+3kl9M3VyCt1fYGwr8GvYkd3faqGwE1clR1eeGh6kzWcPmLNiKkTEn5 MlxEW4rzmKQcIUmJOURtUIgX0VA8fYlPK6RwZAvucvu1BWfVvcyBwu/+bEuk84IS7ta4 sUTRiML5c5VEGglJLMvkGD+W+N11xMo2kSPhK3hP6wIyDQgqpmShOLUxKelSWpEDTo2v g+Rl6vGQesCWuNHLo68qwQKpEBH3Z9+dTHmjK4FhjWqfBp2g+AJif4KJywQRQ+3ZIHPQ j4Qw== X-Gm-Message-State: AOAM53254H8ZE2kUcBLOM0VDdzVoqDYrMPtlkEjKC257xFxqyXPnCMQP mEfZPFT/+6/bJV2MGqeokhPOGw== X-Received: by 2002:a65:62d5:: with SMTP id m21mr8310723pgv.124.1633064682281; Thu, 30 Sep 2021 22:04:42 -0700 (PDT) Received: from localhost.localdomain (122-100-26-52m5.mineo.jp. [122.100.26.52]) by smtp.gmail.com with ESMTPSA id z8sm4615113pgc.53.2021.09.30.22.04.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:04:41 -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: [RFC 17/22] efi_loader: add efi_remove_handle() Date: Fri, 1 Oct 2021 14:02:17 +0900 Message-Id: <20211001050228.55183-34-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211001050228.55183-1-takahiro.akashi@linaro.org> References: <20211001050228.55183-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 Reviewed-by: Simon Glass 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