From patchwork Fri Aug 16 21:05:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 19252 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f69.google.com (mail-vb0-f69.google.com [209.85.212.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 007F225A1B for ; Fri, 16 Aug 2013 21:06:13 +0000 (UTC) Received: by mail-vb0-f69.google.com with SMTP id e13sf2760585vbg.8 for ; Fri, 16 Aug 2013 14:06:13 -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=ivknO7AAfQisZv3L24A0uV7JjnO/MjLmJdaKjDhOzo8=; b=DmOpv2Wk1MGSmzI9CcdWLEaswc3dQ8ORAuAK0F/lmE6x64kaY8xxF3NwrYJtrlgSli A1elHh3Ovf3hmQfBvuugzVfc8lVP6GzKrS8d1tJB6hGNg++eSCUzArmrLMJfJI7mVlr2 wxO61yX1aE1G5ySMxvQKK9pTMeG4MkIDoJ4VkZ42q/Sh+VzpPHcEBSpqV5I1Nw8QmiwI 4RYnPUTbz+GvwyyNMMw2UEZNtajS4C508gzHfwvkaAgN+Jafxs75dnJtUDn4jYoYjE10 UuRcmCXQL1vkT2qVYhKWnceCqdnzVqG6LMxhtF2M6CMqoMfRqti/FUqcQ6ef/yM9w6CT aTeQ== X-Received: by 10.236.200.135 with SMTP id z7mr1281976yhn.41.1376687173423; Fri, 16 Aug 2013 14:06:13 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.82.202 with SMTP id k10ls918068qey.10.gmail; Fri, 16 Aug 2013 14:06:13 -0700 (PDT) X-Received: by 10.220.166.19 with SMTP id k19mr11276vcy.42.1376687173273; Fri, 16 Aug 2013 14:06:13 -0700 (PDT) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by mx.google.com with ESMTPS id ml6si787635vec.2.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 16 Aug 2013 14:06:13 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.181 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.181; Received: by mail-vc0-f181.google.com with SMTP id hz10so1833058vcb.12 for ; Fri, 16 Aug 2013 14:06:13 -0700 (PDT) X-Gm-Message-State: ALoCoQluB5Skr4YjiOWnQ7c283j+COSM2VrHeeqq6un/h9Jp/o8auhpoCYVUA4PKc7W1tl02DE7+ X-Received: by 10.52.94.78 with SMTP id da14mr1867776vdb.28.1376687173177; Fri, 16 Aug 2013 14:06:13 -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 u4csp89437vcz; Fri, 16 Aug 2013 14:06:12 -0700 (PDT) X-Received: by 10.180.185.166 with SMTP id fd6mr671998wic.5.1376687172194; Fri, 16 Aug 2013 14:06:12 -0700 (PDT) Received: from mail-we0-f182.google.com (mail-we0-f182.google.com [74.125.82.182]) by mx.google.com with ESMTPS id ur6si1296237wjc.38.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 16 Aug 2013 14:06:12 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.182 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=74.125.82.182; Received: by mail-we0-f182.google.com with SMTP id q59so1825882wes.27 for ; Fri, 16 Aug 2013 14:06:11 -0700 (PDT) X-Received: by 10.180.9.66 with SMTP id x2mr578938wia.35.1376687171763; Fri, 16 Aug 2013 14:06:11 -0700 (PDT) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id b13sm797327wic.9.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 16 Aug 2013 14:06:11 -0700 (PDT) From: Julien Grall To: stefano.stabellini@eu.citrix.com, ian.campbell@citrix.com Cc: patches@linaro.org, andre.przywara@linaro.org, xen-devel@lists.xen.org, Julien Grall Subject: [RFC 04/24] xen/dts: Constify device_tree_flattened Date: Fri, 16 Aug 2013 22:05:36 +0100 Message-Id: <1376687156-6737-5-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1376687156-6737-1-git-send-email-julien.grall@linaro.org> References: <1376687156-6737-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.181 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 01492bb..a324c3b 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 1ec5e38..c9534fd 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 51f23eb..b96ae33 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 5a2a5c6..7cd9e19 100644 --- a/xen/include/xen/device_tree.h +++ b/xen/include/xen/device_tree.h @@ -158,7 +158,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);