From patchwork Sat Jul 11 22:05:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 1327429 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=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gmx.de Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=gmx.net header.i=@gmx.net header.a=rsa-sha256 header.s=badeba3b8450 header.b=E5JKkDnB; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4B43vt0Qcbz9s1x for ; Sun, 12 Jul 2020 08:08:41 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E95D782207; Sun, 12 Jul 2020 00:07:17 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=gmx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; secure) header.d=gmx.net header.i=@gmx.net header.b="E5JKkDnB"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B4AB681F80; Sun, 12 Jul 2020 00:06: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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FROM,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 7211282178 for ; Sun, 12 Jul 2020 00:06:07 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=gmx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=xypron.glpk@gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1594505166; bh=ba4ruLHscHNKf1MuZxHRhm14R5UJzE557khuVNrytEE=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=E5JKkDnBflMKExmf4n3Vl6jtWL4l/T21PLw61jtsqD0CuOkg8scM8ZlOWBLe7C3eW hb/7Xy6bDqlDU4GCwCfkUeYlOI8IsY4aWQth/uaXT/loOsx8lAg1dBiFXjjkMaNgpt KHyRBUwLgiVS/UnLcTF/JT/ZUlqXrxn/4CZUaoKc= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from LT02.fritz.box ([88.152.145.75]) by mail.gmx.com (mrgmx005 [212.227.17.184]) with ESMTPSA (Nemesis) id 1MNt0M-1kEEru1XSK-00OINl; Sun, 12 Jul 2020 00:06:06 +0200 From: Heinrich Schuchardt To: Alexander Graf Cc: Ilias Apalodimas , u-boot@lists.denx.de, AKASHI Takahiro , Heinrich Schuchardt Subject: [PATCH v4 11/17] efi_loader: export efi_convert_pointer() Date: Sun, 12 Jul 2020 00:05:38 +0200 Message-Id: <20200711220544.120976-12-xypron.glpk@gmx.de> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200711220544.120976-1-xypron.glpk@gmx.de> References: <20200711220544.120976-1-xypron.glpk@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:X6aSyKlnylVpUKFjCFQMmQrWFfWFtetbOEc+GFW9AEj2vmDST9T JP1XEks6aEIilbcdlqj4LkDJ5l3T8VZlqFnCnMSbDmrUENVlmPjm4ZFeqamdaCA8vXDeuhS noCvJtW78h2fTjpzKp4JR4sTZSySknFntjs1Ipo6XJhnXiuRF38on/lpVpkceiMuHJ8Y8hK paxHhoVGHeg440T06Kr2A== X-UI-Out-Filterresults: notjunk:1;V03:K0:zDxRGbyxLyI=:mD1pFQaSbZHswWp6nRefQ9 TTuBboH/dweIt8yHOTa/ZoDaPdzgpfraBI4jzWZ/BJbU1GVhx4XMSHZGklo03l9oZaR2NgAKy Vhro3Yn8NbFGqfYOqHgnbzLSQXlei7+ikdDVvHgEqIfwZ0RhB7VJBlTN2v9v8T9DKOpObCdlx kGdeX6W4+Kr8wLMBY1a4OB8kaQ12MxkL9nZ8HLO9VJdR7M1Oxii7V/l9P3PfAQK85ZiYhT6AO NhfRQPhEhg8ATTUw8eNdF9LwsPvg8kqFGKIl1qzPFkLLcYe0fCoZnwzNMPn9tTnutHypMeLZc Rv2vmvpLvbMTiZoP3Hzzz3L/wdeVbTJAgPleowjPm3YC46y2+5ElK9a+dUGF/e3vMgWZE8HfY 2oJQknE3FtJhTU8UHDO7t3kFVciaiYXfaKnlXiFDS1ppLsc5VFmzY+uDpdgRKtLWSl1vzVKKL 1sr/j7uOtvN9A1RmWHFO7Ek0Qehmaoa3y7AvwI5kcZCacOPUHFbAEv/DOnMZPgb7gsf5Ke1eP PY7wGf/C2tNNl8kh68FVIGa+JzG7d/xnAmai7+9HTSAOGLVcpoUf0rYExyG7Is958lBhn+ilh 8quXuGLwYBbJpU67G2+B5rwlYhTiulsHbaUwqwvHQzbGZcLPVLz2bYRrL25r7lI16sUfIAejt 6KHC0paVB3tbG/v4KXYGq1Itw1b4m4+2elZ268isWp3vBafOQ+utEwJvnv5HzcJOEwJAC5heo Loz4INU93PZirib1572GILyb7XCuzDJUdCyPYwh430t66dgBZe2FNKD3CY35NhsuAnDvV7Woo ZS3VSJoJ0LVADdFcD5Z4T+z4hbQ9s/L2rBASrL33X57X/TWD5SXKzYMfyUlF4R9B7JBmMUR/v y+9yczPXVjOzZe/GFiL9hOfGGCPn6XOV8pqghT/p/s3Uq7zTEQajERZCNMidvAMUXnH9u8rJO uWAoVVjza3rMSBMaQXJr2ZO6eJF4ODlFM61eNJvcm9RpAOf80b3BUErVQ6xpxBYHUZS7CNkUj lv4bhLN2X8GHg5z5fztg9iwHMUXAHWOhdw+5fyz90+Wn5BRP4H0aD+5gb9d9GAS5tLGdREK3y HFD5L0146baNYWg2Lb0Zey38uAWLzRrEHn6JRu192zIwT9T97nxbAwO55sfXWA9Kh3Hf2poGs 25Bmkf1/X0To2gRGxHLVHjh4oWGz/Punkj9J8FbQLkn/VK2uuRePE3sewqevRS9SPzVVKIkEA WxhhRg4abi4rmxyeMjOoPJ65JgWu1U/s2DI9z5A== 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.102.3 at phobos.denx.de X-Virus-Status: Clean We need ConvertPointer() to adjust pointers when implementing runtime services within U-Boot. After ExitBootServices() gd is not available anymore. So we should not use EFI_ENTRY() and EFI_EXIT(). Signed-off-by: Heinrich Schuchardt --- include/efi_loader.h | 3 +++ lib/efi_loader/efi_runtime.c | 8 +++----- 2 files changed, 6 insertions(+), 5 deletions(-) -- 2.27.0 diff --git a/include/efi_loader.h b/include/efi_loader.h index ceabbaadd0..be6cede92f 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -397,6 +397,9 @@ efi_status_t efi_root_node_register(void); efi_status_t efi_initialize_system_table(void); /* efi_runtime_detach() - detach unimplemented runtime functions */ void efi_runtime_detach(void); +/* efi_convert_pointer() - convert pointer to virtual address */ +efi_status_t EFIAPI efi_convert_pointer(efi_uintn_t debug_disposition, + void **address); /* Called by bootefi to make console interface available */ efi_status_t efi_console_register(void); /* Called by bootefi to make all disk storage accessible as EFI objects */ diff --git a/lib/efi_loader/efi_runtime.c b/lib/efi_loader/efi_runtime.c index 121e2f65c6..45baa2fd3e 100644 --- a/lib/efi_loader/efi_runtime.c +++ b/lib/efi_loader/efi_runtime.c @@ -496,15 +496,13 @@ static __efi_runtime efi_status_t EFIAPI efi_convert_pointer_runtime( * @address: pointer to be converted * Return: status code */ -static __efi_runtime efi_status_t EFIAPI efi_convert_pointer( - efi_uintn_t debug_disposition, void **address) +__efi_runtime efi_status_t EFIAPI +efi_convert_pointer(efi_uintn_t debug_disposition, void **address) { efi_physical_addr_t addr; efi_uintn_t i; efi_status_t ret = EFI_NOT_FOUND; - EFI_ENTRY("%zu %p", debug_disposition, address); - if (!efi_virtmap) { ret = EFI_UNSUPPORTED; goto out; @@ -533,7 +531,7 @@ static __efi_runtime efi_status_t EFIAPI efi_convert_pointer( } out: - return EFI_EXIT(ret); + return ret; } static __efi_runtime void efi_relocate_runtime_table(ulong offset)