From patchwork Wed Aug 28 14:47:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 19567 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f69.google.com (mail-yh0-f69.google.com [209.85.213.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0BDF825E58 for ; Wed, 28 Aug 2013 14:48:09 +0000 (UTC) Received: by mail-yh0-f69.google.com with SMTP id f10sf5055704yha.0 for ; Wed, 28 Aug 2013 07:48:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=cgm1Kg7eWEQLmsiZ1v8h3IoMBlTOHHtAhI5CPCWbivM=; b=AObbV7PgbPhX+1lK82xlqZfu6VXZPy2iWwMLekvmYJMy48W/sbGU/03EowONVLPzH9 QpIOPZxqemFzyQVmtwpl+/dTV8+LUKLRQZvKPjDo0Z0LUxqm0+zt3Ue15GujZJvGATK2 Lm0axouRo3pHn006EVIsXbD14/8gUM8wDjg1N5jTrPQHf9vOLKqdrZuUSc0UwuT3iATz i5KyKTtRs+J2ZgPT2S59RPRqEuO7B7euPqugdoQD1QqJA3r+Rklr9Fpwf/JtLkFi5h45 eFCSqDJ4AxEbS4fiEHHf6sNQ4gIHQWjFKIuHPKKBuGoiyEc2hPD1w95LakcE3wvZIB1t ovdg== X-Received: by 10.236.161.137 with SMTP id w9mr5512207yhk.49.1377701288826; Wed, 28 Aug 2013 07:48:08 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.35.10 with SMTP id d10ls412749qej.19.gmail; Wed, 28 Aug 2013 07:48:08 -0700 (PDT) X-Received: by 10.220.16.73 with SMTP id n9mr7268096vca.24.1377701288714; Wed, 28 Aug 2013 07:48:08 -0700 (PDT) Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by mx.google.com with ESMTPS id mj10si6602819vcb.87.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 28 Aug 2013 07:48:08 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.177 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.177; Received: by mail-vc0-f177.google.com with SMTP id gf12so4071745vcb.36 for ; Wed, 28 Aug 2013 07:48:08 -0700 (PDT) X-Gm-Message-State: ALoCoQkqwa6D44rlEGMFkzpdZQSM5m6ozhD4LQbKnc+Mo2BSENystwM4aOWmFtGmSnVsHC18AtbP X-Received: by 10.58.215.15 with SMTP id oe15mr2133566vec.25.1377701288606; Wed, 28 Aug 2013 07:48:08 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp359933vcz; Wed, 28 Aug 2013 07:48:08 -0700 (PDT) X-Received: by 10.194.241.228 with SMTP id wl4mr20818798wjc.2.1377701287532; Wed, 28 Aug 2013 07:48:07 -0700 (PDT) Received: from mail-wg0-f47.google.com (mail-wg0-f47.google.com [74.125.82.47]) by mx.google.com with ESMTPS id ck1si1814778wib.68.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 28 Aug 2013 07:48:07 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.47 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=74.125.82.47; Received: by mail-wg0-f47.google.com with SMTP id f11so1173773wgh.26 for ; Wed, 28 Aug 2013 07:48:07 -0700 (PDT) X-Received: by 10.194.176.163 with SMTP id cj3mr20471383wjc.8.1377701286868; Wed, 28 Aug 2013 07:48:06 -0700 (PDT) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id a8sm5590498wie.6.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 28 Aug 2013 07:48:06 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Cc: stefano.stabellini@eu.citrix.com, ian.campbell@citrix.com, patches@linaro.org, andre.przywara@linaro.org, Julien Grall Subject: [PATCH V1 04/29] xen/dts: Constify device_tree_flattened Date: Wed, 28 Aug 2013 15:47:18 +0100 Message-Id: <1377701263-3319-5-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1377701263-3319-1-git-send-email-julien.grall@linaro.org> References: <1377701263-3319-1-git-send-email-julien.grall@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.177 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The Flat Device Tree is given by the bootloader. Xen doesn't need to modify it. Signed-off-by: Julien Grall Acked-by: Ian Campbell --- xen/arch/arm/domain_build.c | 2 +- xen/arch/arm/setup.c | 6 ++++-- xen/common/device_tree.c | 2 +- xen/include/xen/device_tree.h | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index 9ca663a..345f0f7 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -475,7 +475,7 @@ static int map_devices_from_device_tree(struct domain *d) static int prepare_dtb(struct domain *d, struct kernel_info *kinfo) { - void *fdt; + const void *fdt; int new_size; int ret; paddr_t end; diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c index 4b31623..137a65e 100644 --- a/xen/arch/arm/setup.c +++ b/xen/arch/arm/setup.c @@ -289,6 +289,7 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size) unsigned long dtb_pages; unsigned long boot_mfn_start, boot_mfn_end; int i = 0; + void *fdt; /* TODO: Handle non-contiguous memory bank */ if ( !early_info.mem.nr_banks ) @@ -363,8 +364,9 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size) * * TODO: handle other payloads too. */ - device_tree_flattened = mfn_to_virt(alloc_boot_pages(dtb_pages, 1)); - copy_from_paddr(device_tree_flattened, dtb_paddr, dtb_size, BUFFERABLE); + fdt = mfn_to_virt(alloc_boot_pages(dtb_pages, 1)); + copy_from_paddr(fdt, dtb_paddr, dtb_size, BUFFERABLE); + device_tree_flattened = fdt; /* Add non-xenheap memory */ s = ram_start; diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c index c4f0f2c..a5abdaa 100644 --- a/xen/common/device_tree.c +++ b/xen/common/device_tree.c @@ -26,7 +26,7 @@ #include struct dt_early_info __initdata early_info; -void *device_tree_flattened; +const void *device_tree_flattened; dt_irq_xlate_func dt_irq_xlate; /* Host device tree */ struct dt_device_node *dt_host; diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h index 402cef2..69ee0cd 100644 --- a/xen/include/xen/device_tree.h +++ b/xen/include/xen/device_tree.h @@ -164,7 +164,7 @@ typedef int (*device_tree_node_func)(const void *fdt, void *data); extern struct dt_early_info early_info; -extern void *device_tree_flattened; +extern const void *device_tree_flattened; size_t __init device_tree_early_init(const void *fdt);