From patchwork Fri Sep 2 02:55:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 75277 Delivered-To: patch@linaro.org Received: by 10.140.29.8 with SMTP id a8csp623899qga; Thu, 1 Sep 2016 19:59:13 -0700 (PDT) X-Received: by 10.36.134.194 with SMTP id u185mr1669001itd.23.1472785139088; Thu, 01 Sep 2016 19:58:59 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id 3si1976976ity.43.2016.09.01.19.58.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Sep 2016 19:58:59 -0700 (PDT) Received-SPF: neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) smtp.mailfrom=xen-devel-bounces@lists.xen.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bfeeu-0006uf-VP; Fri, 02 Sep 2016 02:56:48 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bfeeu-0006tm-6P for xen-devel@lists.xen.org; Fri, 02 Sep 2016 02:56:48 +0000 Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id 2D/CD-29579-F6AE8C75; Fri, 02 Sep 2016 02:56:47 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrJIsWRWlGSWpSXmKPExsVi9XuGg27eqxP hBu/emVgs+biYxYHR4+ju30wBjFGsmXlJ+RUJrBk7Tm5iLTjHXXGv/yt7A+Mszi5GLg4hgVOM Enu3n2SFcHYzSky6fY2xi5GTg01AV+LjxinsILaIgKzE6q457CBFzALXGSXuvN/GCpIQFoiWW HBtApjNIqAisXjvPbAGXgFPiZmfDjCB2BICGhIreyewgNicQPG3qz6B1QgJeEg8fvWICaJeUO LkzCdgNcwCEhIHX7xghuhVlGhbf5INwpaUOLjiBgvIERIgZx/6+xJqganEyauzWCYwCs5CMms WklkLGJlWMWoUpxaVpRbpGprpJRVlpmeU5CZm5ugaGhjr5aYWFyemp+YkJhXrJefnbmIEBikD EOxgXLXd8xCjJAeTkihv/pMT4UJ8SfkplRmJxRnxRaU5qcWHGGU4OJQkeI1eAuUEi1LTUyvSM nOA8QKTluDgURLhNQNJ8xYXJOYWZ6ZDpE4xKkqJ8754AZQQAElklObBtcFi9BKjrJQwLyPQIU I8BalFuZklqPKvGMU5GJWEeQNAxvNk5pXATX8FtJgJaHHJteMgi0sSEVJSDYwrAjcoVRjO+z2 J44zF5f0as646XTmiz79i/rtvl2WbBO7mFEfxxu/b9+TBqjss6sc/HLiwxSjr3AVvabkcFrez FveNVTXUuP9Jb1Bs/b5mQ8SUq4f9Plz8sLZBLWlfWnx4Qe7eZcu5FTd8/Hegbckz6zu5s9/yX D+RdEE/sT92S0Ggg3r3lLRzSizFGYmGWsxFxYkARxm4NMwCAAA= X-Env-Sender: zhaoshenglong@huawei.com X-Msg-Ref: server-15.tower-31.messagelabs.com!1472785002!54622187!1 X-Originating-IP: [58.251.152.64] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.84; banners=-,-,- X-VirusChecked: Checked Received: (qmail 54099 invoked from network); 2 Sep 2016 02:56:46 -0000 Received: from szxga01-in.huawei.com (HELO szxga01-in.huawei.com) (58.251.152.64) by server-15.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 2 Sep 2016 02:56:46 -0000 Received: from 172.24.1.60 (EHLO szxeml431-hub.china.huawei.com) ([172.24.1.60]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id DQM36330; Fri, 02 Sep 2016 10:56:21 +0800 (CST) Received: from HGHY1Z002260041.china.huawei.com (10.177.16.142) by szxeml431-hub.china.huawei.com (10.82.67.208) with Microsoft SMTP Server id 14.3.235.1; Fri, 2 Sep 2016 10:56:09 +0800 From: Shannon Zhao To: Date: Fri, 2 Sep 2016 10:55:35 +0800 Message-ID: <1472784939-14404-13-git-send-email-zhaoshenglong@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 In-Reply-To: <1472784939-14404-1-git-send-email-zhaoshenglong@huawei.com> References: <1472784939-14404-1-git-send-email-zhaoshenglong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.177.16.142] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A0B0208.57C8EA57.004B, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: fc98e8354abc096041ed82590f9a5501 Cc: sstabellini@kernel.org, wei.liu2@citrix.com, ian.jackson@eu.citrix.com, peter.huangpeng@huawei.com, julien.grall@arm.com, shannon.zhao@linaro.org, boris.ostrovsky@oracle.com Subject: [Xen-devel] [PATCH v5 12/16] libxl/arm: Factor finalise_one_memory_node as a gerneric function X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" From: Shannon Zhao Rename finalise_one_memory_node to finalise_one_node and pass the node name via function parameter. This is useful for adding ACPI module which will be added by a later patch. Signed-off-by: Shannon Zhao Acked-by: Julien Grall --- tools/libxl/libxl_arm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/libxl/libxl_arm.c b/tools/libxl/libxl_arm.c index 2a4577c..f7f2c60 100644 --- a/tools/libxl/libxl_arm.c +++ b/tools/libxl/libxl_arm.c @@ -905,11 +905,11 @@ out: return rc; } -static void finalise_one_memory_node(libxl__gc *gc, void *fdt, - uint64_t base, uint64_t size) +static void finalise_one_node(libxl__gc *gc, void *fdt, const char *uname, + uint64_t base, uint64_t size) { int node, res; - const char *name = GCSPRINTF("/memory@%"PRIx64, base); + const char *name = GCSPRINTF("%s@%"PRIx64, uname, base); node = fdt_path_offset(fdt, name); assert(node > 0); @@ -972,7 +972,7 @@ int libxl__arch_domain_finalise_hw_description(libxl__gc *gc, for (i = 0; i < GUEST_RAM_BANKS; i++) { const uint64_t size = (uint64_t)dom->rambank_size[i] << XC_PAGE_SHIFT; - finalise_one_memory_node(gc, fdt, bankbase[i], size); + finalise_one_node(gc, fdt, "/memory", bankbase[i], size); } debug_dump_fdt(gc, fdt);