From patchwork Fri Jun 22 12:44:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 139609 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp829373lji; Fri, 22 Jun 2018 05:44:28 -0700 (PDT) X-Google-Smtp-Source: ADUXVKI8KdSjR82LgpiLBTsaSrCRBgDs+VAd4CGgoCQs8lIgZt3KIV5TU79r1T6RqiB3mqvb9qGi X-Received: by 2002:a50:9ae2:: with SMTP id p89-v6mr1747453edb.112.1529671468644; Fri, 22 Jun 2018 05:44:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529671468; cv=none; d=google.com; s=arc-20160816; b=ue7vzWj44V7wra6mTTmCa20IHCaqk7EDKaQ+aA8/i6cKl2rgZUbYb9A4Vj1wuXwdwB Y47dAkW/gt2Baw+xuvqmHHhQtv7RUB+0XuIx0UvpmfjkTLd2X0GDx/o0X4WUQaMQanXY rbhbEABgDVd8lQDr+xxuYxx4tXxMEbS2GfiGFN2xCC/+1eUdU5KXjv5v3kMisQeZnj5W 0aT4SPcDGmLRpRNAy4v3h5p6YtdkJUzsOatYpyQ74gva3p0QtZiq615beGuilwXkTMeR jEAxddOQH1hKWu1pG8286u0XFJdfBySyhQs18wsFaa0QwSRU5gFUII3hKmlRjaN72SEA YaEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:arc-authentication-results; bh=v7/nTGGIcfELhkjy5S4ccAatm3+Yjpo54JlBv+5HqMk=; b=Gc7I7NZMoVwsvZG4nP/g2Aw16Y9r/jNMcUEdCr1GtmXV+ePGFfkkbi40ZTgIV7to9Y Gf2DPpFNhoLpY24AR0vxxn3/4ouZmvcu5aTp/Suh6RMqkvUyVd697+gf9o/NX5DGfb1P 3tL8WMx/dTjnG6wqt41WN5e52dSvluLnjGlA3ZqeNMDWA+8vrZN2Vjtsdz6zw1tBBHA3 qZxVtqfJKUQiaLN1wHrRSBb/q3BcmOW4oNmtZLQfnrXPEwjLLy4Whl+B94qevf62L1Is NoYW6Jir/7z13KEGk6atELeryXziaoe+cE/VPA+3Xgbf/iK/BHPHxh4LSGYUjQHiTY3M Pkxg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id w17-v6si3488173edr.238.2018.06.22.05.44.28; Fri, 22 Jun 2018 05:44:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id E40F6C22058; Fri, 22 Jun 2018 12:44:24 +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=none 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 1BAD1C21C2C; Fri, 22 Jun 2018 12:44:22 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id DBBEBC21F2A; Fri, 22 Jun 2018 12:44:20 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id 743F5C21C2C for ; Fri, 22 Jun 2018 12:44:20 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id CF9C6ACF9; Fri, 22 Jun 2018 12:44:19 +0000 (UTC) From: Alexander Graf To: u-boot@lists.denx.de Date: Fri, 22 Jun 2018 14:44:11 +0200 Message-Id: <20180622124418.52892-4-agraf@suse.de> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20180622124418.52892-1-agraf@suse.de> References: <20180622124418.52892-1-agraf@suse.de> Cc: Heinrich Schuchardt , Andy Shevchenko Subject: [U-Boot] [PATCH v5 03/10] efi_loader: Pass address to fs_read() 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: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The fs_read() function wants to get an address rather than the pointer to a buffer. So let's convert the passed buffer from pointer back a the address to make efi_loader on sandbox happier. Signed-off-by: Alexander Graf Reviewed-by: Simon Glass Signed-off-by: Simon Glass --- lib/efi_loader/efi_file.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/efi_loader/efi_file.c b/lib/efi_loader/efi_file.c index e6a15bcb52..2107730ba5 100644 --- a/lib/efi_loader/efi_file.c +++ b/lib/efi_loader/efi_file.c @@ -9,6 +9,7 @@ #include #include #include +#include #include /* GUID for file system information */ @@ -232,8 +233,10 @@ static efi_status_t file_read(struct file_handle *fh, u64 *buffer_size, void *buffer) { loff_t actread; + /* fs_read expects buffer address, not pointer */ + uintptr_t buffer_addr = (uintptr_t)map_to_sysmem(buffer); - if (fs_read(fh->path, (ulong)buffer, fh->offset, + if (fs_read(fh->path, buffer_addr, fh->offset, *buffer_size, &actread)) return EFI_DEVICE_ERROR;