From patchwork Sat Sep 15 06:50:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 146766 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp1512185ljw; Fri, 14 Sep 2018 23:58:00 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbEjkxhL+t7bB9lVm9lDBJ0CDCKTL/J3orVbBIjWS439AXBSuqn16Bqv+rkUQ1xAeg+M2YG X-Received: by 2002:a50:8ea1:: with SMTP id w30-v6mr25227564edw.197.1536994680360; Fri, 14 Sep 2018 23:58:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536994680; cv=none; d=google.com; s=arc-20160816; b=nvkNZPH6dq/wyR00D0tQP6UmcfSuKkU3uboQF7VaCW7kMB+u+mtuFJSqbwgz+64sMT aPZsGiOJOVQLP9iGV6tFU8LgMRuz8RZlbER4cbW9jnU34c7P+DJa+AMmR9PvNj1J1Ev3 z5zpOnQ2BXXLU0ohkKUvZ9hHNn7DVX68UlJljpwQmLLzLcA3DQ7+xD+9srpaENoB5W2y pOlrFcU1+N5nsg7VRDbqGxC0hTrFCTOpQ5QuHzzF8rwMHqT6CgBnIsORtPoLR5ZrdU52 UdnSWg+xAIQMndv6mT3H+9Wbgz72hWHNEMxGVf5wBLTwnv4UiV+Zx6Cq44Vonz3oFOWV 5kKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :cc:to:from:references:mime-version:message-id:in-reply-to:date; bh=dfjx9h0S37zBzm4YJH7GRcwxZYkc1m/bvJ0WH/+eL6Y=; b=OLEGI4OOM47E/4e8PT3m89lVn8RPuVGfqMZk0GrzDXw/zy193sjtxQ/9lRl4xJzkxb ByDDuDtln8aEOUHYgmFlJz7eCHf2t9FUekDmugoymSLFdGqim6bFeDX9pDSH0sJuEsyR I/4ibsbgG/Ubhu4UhtPUvU8BZKzEoErm80ousj6OAkKTRaEooEGWEA8ff66G2JbBjyVm Ffavt6d5FABGiqnbfPteO/JxyBAEXfZ4Vkd0s7z87KUSDCutRPFMwMtzf0wHSx6/uPi6 7GdFSB9PWL1LVMSg06vtvgXzEQ0YbHi4StXAberZr6PXeZ5cQQgjXiAWl0TxlHVBdD1D HIgA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id b19-v6si4440020edj.131.2018.09.14.23.57.59; Fri, 14 Sep 2018 23:58:00 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: by lists.denx.de (Postfix, from userid 105) id B9E5EC2207B; Sat, 15 Sep 2018 06:54:02 +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 5B1B3C22063; Sat, 15 Sep 2018 06:51:45 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id A478FC2203A; Sat, 15 Sep 2018 06:51:29 +0000 (UTC) Received: from mail-oi0-f74.google.com (mail-oi0-f74.google.com [209.85.218.74]) by lists.denx.de (Postfix) with ESMTPS id 81F3BC22014 for ; Sat, 15 Sep 2018 06:51:22 +0000 (UTC) Received: by mail-oi0-f74.google.com with SMTP id m21-v6so11859719oic.7 for ; Fri, 14 Sep 2018 23:51:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=UhYsHII8DjPeEB9HJl3yXTOtdfbYo/M+UIVWU36FY/0=; b=Zt0uGeiOTODIl9LdXVF9K8qjOhTHC+eGQpEzmwiCxtwVyzKWt/CdFl7aIHuz7EE7nF XSFY/HbrXj1bZGXY45JE2JoTU7L9lyqDjEFf031hgRkXK+KV68DbVJps6Xp8ia0TO6XJ p05cQE0JyV99fMitahcwM5XTgx3cYvSIlKHBhkqJfhLQnECcCBe9Eja8hJI7+jomneaX Hh9LicXIL0S6shHT5wyykXcQXP3yS0ZLJhZwU5xW8CLhlqrizsl6dMLqgHwXz/8ggy1M z+GzWUIv6oTdDf+HWKLliqFTnKSLcAnzE8zHNoF7r6fHWinzZAgzYM5uEKEikCuvu4SV vn0A== X-Gm-Message-State: APzg51CijcAllUCmINxDxN3nSRTLKp8rdtzzXaAka8jkg6/cjvr52Vyt 8OvQYdsjv7xITYSquG9PIjwGfHY= X-Received: by 2002:a9d:30a1:: with SMTP id s33-v6mr9298152otc.107.1536994280899; Fri, 14 Sep 2018 23:51:20 -0700 (PDT) Date: Sat, 15 Sep 2018 00:50:59 -0600 In-Reply-To: <20180915065101.164447-1-sjg@chromium.org> Message-Id: <20180915065101.164447-9-sjg@chromium.org> Mime-Version: 1.0 References: <20180915065101.164447-1-sjg@chromium.org> X-Mailer: git-send-email 2.19.0.397.gdd90340f6a-goog From: Simon Glass To: U-Boot Mailing List Cc: Andy Shevchenko , Heinrich Schuchardt , Alexander Graf Subject: [U-Boot] [PATCH v10 08/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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Alexander Graf 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 --- Changes in v10: None Changes in v9: None Changes in v8: None Changes in v7: None Changes in v6: None Changes in v4: None Changes in v3: None Changes in v2: None 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 e6a15bcb523..2107730ba5a 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;