From patchwork Fri Apr 19 03:22:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 1087936 X-Patchwork-Delegate: xypron.glpk@gmx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="rpJV0Iwu"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 44lhDS3CDyz9s4V for ; Fri, 19 Apr 2019 13:24:56 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 06F9BC21DD3; Fri, 19 Apr 2019 03:23: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=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 172EFC21DF9; Fri, 19 Apr 2019 03:23:50 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 6C1D9C21E0D; Fri, 19 Apr 2019 03:23:40 +0000 (UTC) Received: from mail-yw1-f66.google.com (mail-yw1-f66.google.com [209.85.161.66]) by lists.denx.de (Postfix) with ESMTPS id F0E10C21E1E for ; Fri, 19 Apr 2019 03:23:36 +0000 (UTC) Received: by mail-yw1-f66.google.com with SMTP id z9so1479084ywd.6 for ; Thu, 18 Apr 2019 20:23:36 -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=0TSYAFv1gZIPvDmCP5wUUYhb5V6QIe1sYBzOYcLtrKY=; b=rpJV0Iwuli1Ubn8EkEUcHNzorf/nZPAgL4qFh6RYQAebdQV9GU5NUq6yIO5s6WoRfq eFbuILD/9SrpmeHoFpTrfwDdwLRrGd1g6LQm4YqrqpgjkxDHz7kiMjoi3nJ6unzV8Mbs LeeE6Jobsr7YDUkmsFLkKHcqoNznMVqM6+TkYavxi+qaEpcfg+prEpuvmTKxXLQfiYmn 8M7FrlcokvQ0DTlCBUSmlnEpDMq8k1aXDb3hWPWg4g5j/8usKs1tkH3AeH6EIzuXR+3E MlBYFPrXe+3VqjF+Dz9HaC6raexsoEhxSWo1bncVsRnggmVLslVZ2QOp+L16zL6M9WMV LpqQ== 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:mime-version:content-transfer-encoding; bh=0TSYAFv1gZIPvDmCP5wUUYhb5V6QIe1sYBzOYcLtrKY=; b=sazEVbA7BBdgImU+zJ27QQ5qd2hCzx50IEfWcqCwKNspyfj47mG3TtnnPiVwL82IZp 9YPQLwP2xmD9USGzmTshs39g7IByKfI21MOYJzfOcH/YxMH2WLybBYup+U1WabvKrUBL 7gLWzE+5hysEoL4gWlPHENDrIL3nnDVabmjutcCoXzRvw7hlLb0diG3ZRIOIfuOHLjCj JhLxNKamm+ImuZqjGXBtMie48y8LwisOg90hOGlx56lVDVIQIyOH6j9zs6bYRnQ12Gzb e2ndv7DA1045Rx8+N/IR4kJyrvEP5+zpm4Xp/o8MQjo8P7vNF1ec1bzZj3Qv9Ubcz3xf PC5w== X-Gm-Message-State: APjAAAVZFZTdB/xWDjvldh/jJmJ7ErvT6sx5R4Ql7ZXk/Nd5KrrXCe55 0ri2a3/Pxitn8U9lL8VRGR2ncg8k5DY= X-Google-Smtp-Source: APXvYqyiqkEYE0LCzIDhrGaf1xdsuqhiHk9S86yf24ki93Db9XewS6/+ZUn9RJfRPEGS6hpzuBcrBA== X-Received: by 2002:a0d:d9d6:: with SMTP id b205mr931055ywe.508.1555644215986; Thu, 18 Apr 2019 20:23:35 -0700 (PDT) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id z193sm1432948ywa.70.2019.04.18.20.23.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Apr 2019 20:23:35 -0700 (PDT) From: AKASHI Takahiro To: xypron.glpk@gmx.de, agraf@csgraf.de Date: Fri, 19 Apr 2019 12:22:32 +0900 Message-Id: <20190419032236.8242-6-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190419032236.8242-1-takahiro.akashi@linaro.org> References: <20190419032236.8242-1-takahiro.akashi@linaro.org> MIME-Version: 1.0 Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH 5/9] cmd: bootefi: move do_bootefi_bootmgr_exec() forward 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" This is a preparatory patch for reworking do_bootefi() in later patch. Signed-off-by: AKASHI Takahiro Reviewed-by: Heinrich Schuchardt --- cmd/bootefi.c | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/cmd/bootefi.c b/cmd/bootefi.c index e73b4cb563cd..d8ddd770e031 100644 --- a/cmd/bootefi.c +++ b/cmd/bootefi.c @@ -329,6 +329,27 @@ err_add_protocol: return ret; } +static int do_bootefi_bootmgr_exec(void) +{ + struct efi_device_path *device_path, *file_path; + void *addr; + efi_status_t r; + + addr = efi_bootmgr_load(&device_path, &file_path); + if (!addr) + return 1; + + printf("## Starting EFI application at %p ...\n", addr); + r = do_bootefi_exec(addr, device_path, file_path); + printf("## Application terminated, r = %lu\n", + r & ~EFI_ERROR_MASK); + + if (r != EFI_SUCCESS) + return 1; + + return 0; +} + #ifdef CONFIG_CMD_BOOTEFI_SELFTEST static efi_status_t bootefi_run_prepare(const char *load_options_path, struct efi_device_path *device_path, @@ -452,27 +473,6 @@ static int do_efi_selftest(const char *fdt_opt) } #endif /* CONFIG_CMD_BOOTEFI_SELFTEST */ -static int do_bootefi_bootmgr_exec(void) -{ - struct efi_device_path *device_path, *file_path; - void *addr; - efi_status_t r; - - addr = efi_bootmgr_load(&device_path, &file_path); - if (!addr) - return 1; - - printf("## Starting EFI application at %p ...\n", addr); - r = do_bootefi_exec(addr, device_path, file_path); - printf("## Application terminated, r = %lu\n", - r & ~EFI_ERROR_MASK); - - if (r != EFI_SUCCESS) - return 1; - - return 0; -} - /* Interpreter command to boot an arbitrary EFI image from memory */ static int do_bootefi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) {