From patchwork Sat Nov 24 04:29:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1002576 X-Patchwork-Delegate: sjg@chromium.org 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=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="du5WqiAS"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 4320ds5SnRz9s7W for ; Sat, 24 Nov 2018 15:32:33 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 68B2BC22460; Sat, 24 Nov 2018 04:31:17 +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=RCVD_IN_MSPIKE_H2, 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 58C90C2244A; Sat, 24 Nov 2018 04:30:26 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 3CFD2C22469; Sat, 24 Nov 2018 04:30:09 +0000 (UTC) Received: from mail-oi1-f199.google.com (mail-oi1-f199.google.com [209.85.167.199]) by lists.denx.de (Postfix) with ESMTPS id E121FC22462 for ; Sat, 24 Nov 2018 04:30:05 +0000 (UTC) Received: by mail-oi1-f199.google.com with SMTP id r131so1666831oia.7 for ; Fri, 23 Nov 2018 20:30:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=FB0YuxatEYWiZHZUSP6EOKTF1/a/rhMZEDuPqClxmNY=; b=du5WqiAS2c4sgVGTUXFJp7I7rzuNXzEz9e7JIsA9jcWJtsvJH5yvGDZgpCbf5YTbh/ 57QLsHhI6QehnoARMhef7QClBTi4sxvqzZEBh0XPClmLvL93RocxVSmyj6fIO0e/Q/Xg KwrTqS/fRLddzS47eTevHFXWLbtqLQtrw2atI= 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=FB0YuxatEYWiZHZUSP6EOKTF1/a/rhMZEDuPqClxmNY=; b=biZ2l6tSD1lHueoNPG4GfKFfn0+eVRIGFt1KQJTPTPavkT/4FX4lBRF/d8lO4pwFVH cK5qxfClunAnOZtqM4tjh7977VmC76xiWUzgrPjtOgAlxXC/9TP8v3gS+nJPLsAh+j9r dn4k0r7xexpC31fRLDcVmZnX3S5sJDlP9Xv3QZX9i/ghrqxq0q6jRvUCeF0db0iQKgp0 OucrnPdkcq3ksgjGFEae76dLwJMvW/6hVuNNk+cAqn9l5XV1mV5J+8fZEtFXHSJv2//P NhYqXb7weRSGW+jlSzN4FGHbZR3Xa3csa1k829hz6GjInNqtkDaudv94M5baNcWAgRR/ QMaA== X-Gm-Message-State: AGRZ1gJGaj86BZs9nXtbesRkozzZZFhw+TGigv9tWP7kod+E/FCPm8LS IV+RQ6EhtkUQZ6vwv3ff6o83Mn20dpk5yKg8 X-Google-Smtp-Source: AJdET5fXYDBVTNbXG2UWW/8kZly1lWngBOFWevmfgq7E32E/WQSCasHWs/Nq5DIETj2J+fJ8qeYmmo0qSC/yKcIx X-Received: by 2002:aca:3106:: with SMTP id x6mr12286155oix.42.1543033804602; Fri, 23 Nov 2018 20:30:04 -0800 (PST) Date: Fri, 23 Nov 2018 21:29:26 -0700 In-Reply-To: <20181124042944.239106-1-sjg@chromium.org> Message-Id: <20181124042944.239106-4-sjg@chromium.org> Mime-Version: 1.0 References: <20181124042944.239106-1-sjg@chromium.org> X-Mailer: git-send-email 2.20.0.rc0.387.gc7a69e6b6c-goog From: Simon Glass To: U-Boot Mailing List Subject: [U-Boot] [PATCH 03/21] sandbox: physmem: Use mapping to support sandbox 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" Replace the raw cast with a map_sysmem() call so this code works with sandbox. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- lib/physmem.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/physmem.c b/lib/physmem.c index f21ac243edc..84b191dae3e 100644 --- a/lib/physmem.c +++ b/lib/physmem.c @@ -9,14 +9,16 @@ */ #include +#include #include #include phys_addr_t __weak arch_phys_memset(phys_addr_t s, int c, phys_size_t n) { - void *s_ptr = (void *)(uintptr_t)s; + void *s_ptr = map_sysmem(s, n); assert(((phys_addr_t)(uintptr_t)s) == s); assert(((phys_addr_t)(uintptr_t)(s + n)) == s + n); + return (phys_addr_t)(uintptr_t)memset(s_ptr, c, n); }