From patchwork Thu Jun 14 18:22:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 138605 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp2454409lji; Thu, 14 Jun 2018 11:26:32 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIEkZ8QhtloFLNYIrBwN4QQsQqV3+ay2lLs4l6lx1Fn9ccKn267oIC1EgRxQw3C63yFKlb+ X-Received: by 2002:a50:bc16:: with SMTP id j22-v6mr3551568edh.240.1529000792597; Thu, 14 Jun 2018 11:26:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529000792; cv=none; d=google.com; s=arc-20160816; b=JTYcXZY0Ofhp6iLClka2/+Y/qfwet+4p03vlHnau1uMhb6vizxb5QGqENjNEuOlboD b8t8PfIaUYVFwN+7cqfaj8Sew/xsBKEF2k/bSjTZYh9eLK2EzG9BbVuIEMvBJwn8pSqe NvIlxULu7vrqkrALRq61G0gu19/phTY4m3R1f1QJ9rFrhzX8fBHQycHDM/gv9xS4DEhk Hz9yBXHQXBgQjczApsVy6ItUom3WFz6NI9deT2aoZrZUj6RfHHrJc1D4GAGtyQKvxuCC Rs3XMzGGqYdhFhxuVOqXFGVpG+83r4zEuHSgrbDniVOE3juTKlZ0a6r330gtKiBKGnSN 16FA== 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=wfyu6bLfYDi7GyIsoVa2Co+230ZovcaJgMEgSgwQ7Q8=; b=EOfqiauexi9EKcQNsq7cQmcLCd09QPZ+HARPb5vR3m+algCO6JVd4IvcDhLDbcQ0D7 87t05BgwU2xN9xq5/g8BAPS2ohZrLLfRJ5mu/cbB2mfP+PXLIed1VFmbUz1I0QLg/sEF XRl22vTrU0KuPLlUCMTqTWIs0zeoiKo5Okd9GTIo7tyobkKRTGi7wAbDMSebsCuady5E Gix+ffowsUVnjx8aIsbs7O61Hy5BhGMYGKOgAvgmZ48KXVvddjXop1lYukakxyBi9qSe KNWob70RGtm0EidOpSQndBr8m3qHz3kmRUcm8GFAalJ+mDFBoORdzJs5Y8p84UdZEPV4 4wAA== 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 s48-v6si2115925edm.333.2018.06.14.11.26.32; Thu, 14 Jun 2018 11:26:32 -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 37792C21DAF; Thu, 14 Jun 2018 18:23:33 +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 5AA78C21DB5; Thu, 14 Jun 2018 18:22:40 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id C40FCC21C2C; Thu, 14 Jun 2018 18:22:35 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by lists.denx.de (Postfix) with ESMTPS id 5F711C21D8E for ; Thu, 14 Jun 2018 18:22:35 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id A4365AFB3; Thu, 14 Jun 2018 18:22:34 +0000 (UTC) From: Alexander Graf To: u-boot@lists.denx.de Date: Thu, 14 Jun 2018 20:22:31 +0200 Message-Id: <20180614182232.78201-11-agraf@suse.de> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20180614182232.78201-1-agraf@suse.de> References: <20180614182232.78201-1-agraf@suse.de> Cc: Heinrich Schuchardt , Andy Shevchenko Subject: [U-Boot] [PATCH v2 10/11] 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 --- v1 -> v2: - Clarify address vs pointer - include mapmem.h --- 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;