From patchwork Thu Jun 23 03:16:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 70713 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp217283qgy; Wed, 22 Jun 2016 20:20:34 -0700 (PDT) X-Received: by 10.107.46.132 with SMTP id u4mr46461568iou.184.1466652026898; Wed, 22 Jun 2016 20:20:26 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id i93si5333814ioo.53.2016.06.22.20.20.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Jun 2016 20:20:26 -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 1bFv9R-00008h-MJ; Thu, 23 Jun 2016 03:17:57 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bFv9Q-00008J-AS for xen-devel@lists.xen.org; Thu, 23 Jun 2016 03:17:56 +0000 Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id 28/E4-13025-3E45B675; Thu, 23 Jun 2016 03:17:55 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrJIsWRWlGSWpSXmKPExsVSPpHPSfdRSHa 4wcZZZhZLPi5mcWD0OLr7N1MAYxRrZl5SfkUCa8bVyduYCx7xV/x9fpO9gXERdxcjF4eQwBlG iebWdnYIZw+jxJSdd5i7GDk52AR0JT5unMIOYosIyEqs7poDVsQscJ1R4s77bawgCWEBD4k/P 9aygNgsAqoSJ95cYAKxeQXcJZZs7QWLSwhoSKzsnQBmcwLVn5z1BGyBEFDNnDV7WSDqBSVOzn wCZjMLSEgcfPGCGaJXUaJt/Uk2CFtS4uCKGywgR0gInGKUOLy5ix0iYSpx+vhc5gmMgrOQzJq FZNYCRqZVjBrFqUVlqUW6RmZ6SUWZ6RkluYmZObqGBqZ6uanFxYnpqTmJScV6yfm5mxiBQVrP wMC4g/H2ZL9DjJIcTEqivFYO2eFCfEn5KZUZicUZ8UWlOanFhxhlODiUJHgdg4FygkWp6akVa Zk5wHiBSUtw8CiJ8EqApHmLCxJzizPTIVKnGBWlxHntQRICIImM0jy4NliMXmKUlRLmZWRgYB DiKUgtys0sQZV/xSjOwagkzLsWZApPZl4J3PRXQIuZgBYv608HWVySiJCSamDk4dNfnptxl6t 0c4nOjcSw52w1RlsWhPbOuHe5Z6//S/ejX3wSKopn7ZDyabD287Z89avAfEv+A+UNl46032+2 2spz/bBbFU/gvZdsGZOes9a9OvN0nvzlq8/vCj8Lma/Pkr3OcH1Qxu/wKVt1zz/9t93r3L91p 1P6jLon59x+dvLlkvAnHbrXlViKMxINtZiLihMB5RR4aMwCAAA= X-Env-Sender: zhaoshenglong@huawei.com X-Msg-Ref: server-14.tower-206.messagelabs.com!1466651871!9871542!1 X-Originating-IP: [119.145.14.66] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTE5LjE0NS4xNC42NiA9PiA4NTI3\n X-StarScan-Received: X-StarScan-Version: 8.46; banners=-,-,- X-VirusChecked: Checked Received: (qmail 28957 invoked from network); 23 Jun 2016 03:17:53 -0000 Received: from szxga03-in.huawei.com (HELO szxga03-in.huawei.com) (119.145.14.66) by server-14.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 23 Jun 2016 03:17:53 -0000 Received: from 172.24.1.136 (EHLO szxeml430-hub.china.huawei.com) ([172.24.1.136]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id CDT13151; Thu, 23 Jun 2016 11:17:33 +0800 (CST) Received: from HGHY1Z002260041.china.huawei.com (10.177.16.142) by szxeml430-hub.china.huawei.com (10.82.67.185) with Microsoft SMTP Server id 14.3.235.1; Thu, 23 Jun 2016 11:17:25 +0800 From: Shannon Zhao To: Date: Thu, 23 Jun 2016 11:16:48 +0800 Message-ID: <1466651824-6964-2-git-send-email-zhaoshenglong@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 In-Reply-To: <1466651824-6964-1-git-send-email-zhaoshenglong@huawei.com> References: <1466651824-6964-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.0A090202.576B54D0.0055, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 6e1ff8a371722e8b81f7fce12d3bf073 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 v2 01/17] libxl/arm: Factor out codes for generating DTB 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 Factor out codes for generating DTB to prepare for adding ACPI tables generation codes. Signed-off-by: Shannon Zhao Acked-by: Wei Liu --- tools/libxl/libxl_arm.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/tools/libxl/libxl_arm.c b/tools/libxl/libxl_arm.c index c6d77e3..8f15d9b 100644 --- a/tools/libxl/libxl_arm.c +++ b/tools/libxl/libxl_arm.c @@ -747,10 +747,9 @@ static int copy_partial_fdt(libxl__gc *gc, void *fdt, void *pfdt) #define FDT_MAX_SIZE (1<<20) -int libxl__arch_domain_init_hw_description(libxl__gc *gc, - libxl_domain_build_info *info, - libxl__domain_build_state *state, - struct xc_dom_image *dom) +static int libxl__prepare_dtb(libxl__gc *gc, libxl_domain_build_info *info, + libxl__domain_build_state *state, + struct xc_dom_image *dom) { void *fdt = NULL; void *pfdt = NULL; @@ -764,8 +763,6 @@ int libxl__arch_domain_init_hw_description(libxl__gc *gc, /* convenience aliases */ xc_domain_configuration_t *xc_config = &state->config; - assert(info->type == LIBXL_DOMAIN_TYPE_PV); - vers = libxl_get_version_info(CTX); if (vers == NULL) return ERROR_FAIL; @@ -883,6 +880,15 @@ out: return rc; } +int libxl__arch_domain_init_hw_description(libxl__gc *gc, + libxl_domain_build_info *info, + libxl__domain_build_state *state, + struct xc_dom_image *dom) +{ + assert(info->type == LIBXL_DOMAIN_TYPE_PV); + return libxl__prepare_dtb(gc, info, state, dom); +} + static void finalise_one_memory_node(libxl__gc *gc, void *fdt, uint64_t base, uint64_t size) {