From patchwork Tue Jul 5 03:12:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 71372 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp91297qgy; Mon, 4 Jul 2016 20:17:09 -0700 (PDT) X-Received: by 10.107.4.195 with SMTP id 186mr12789819ioe.143.1467688629603; Mon, 04 Jul 2016 20:17:09 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id m140si1517933itm.74.2016.07.04.20.17.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Jul 2016 20:17:09 -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 1bKGoc-0008Le-GJ; Tue, 05 Jul 2016 03:14:26 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bKGob-0008LV-EL for xen-devel@lists.xen.org; Tue, 05 Jul 2016 03:14:25 +0000 Received: from [193.109.254.147] by server-1.bemta-14.messagelabs.com id B8/A0-14454-0162B775; Tue, 05 Jul 2016 03:14:24 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrOIsWRWlGSWpSXmKPExsVSPpHPSZdfrTr c4NZTa4slHxezODB6HN39mymAMYo1My8pvyKBNePi81tsBY/4K/o3v2RsYFzE3cXIxSEkcIZR 4vqiJewQzm5GiYc/drN0MXJysAnoSnzcOIUdxBYRkJVY3TUHzGYW+MAocWq2BIgtLOAhcfb7P EYQm0VARWLitfesIDYvUHxlz1ewORICGhIreyeA2ZwCnhJfb0LYQkA1/QfWQ9ULSpyc+YQFYr 6ExMEXL5ghehUl2tafZIOwJSUOrrjBAnKohMApRonTiyZDLTCVOL+7jXECo+AsJLNmIZm1gJF pFaN6cWpRWWqRrqVeUlFmekZJbmJmjq6hoYlebmpxcWJ6ak5iUrFecn7uJkZggDIAwQ7G/inO hxglOZiURHlf/asKF+JLyk+pzEgszogvKs1JLT7EKMPBoSTBu1alOlxIsCg1PbUiLTMHGCswa QkOHiUR3mcgad7igsTc4sx0iNQpRkUpcd4FIAkBkERGaR5cGyw+LzHKSgnzMgIdIsRTkFqUm1 mCKv+KUZyDUUmYdzXIFJ7MvBK46a+AFjMBLWaNLQdZXJKIkJJqYHSMK2YJi9hW9eDa9GaBTw6 bw3y88y7Ktm3YspzV7rST1uODRVOWqXBM6RULs7D6zzXj5lbrl2de1s2cccfg1vetS3/Erbs6 e8Fd76o97Qtn7DvNtenw4vN5Vd1Tz/XE7pN4+UzgvJ/qh+kbt7upMBrPSbslYZDz3z6n67XtW /HnOyuDdAwvNMgqsRRnJBpqMRcVJwIABPNZN8oCAAA= X-Env-Sender: zhaoshenglong@huawei.com X-Msg-Ref: server-14.tower-27.messagelabs.com!1467688459!39690551!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 23452 invoked from network); 5 Jul 2016 03:14:23 -0000 Received: from szxga03-in.huawei.com (HELO szxga03-in.huawei.com) (119.145.14.66) by server-14.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 5 Jul 2016 03:14:23 -0000 Received: from 172.24.1.136 (EHLO SZXEML429-HUB.china.huawei.com) ([172.24.1.136]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id CEI04827; Tue, 05 Jul 2016 11:14:04 +0800 (CST) Received: from HGHY1Z002260041.china.huawei.com (10.177.16.142) by SZXEML429-HUB.china.huawei.com (10.82.67.184) with Microsoft SMTP Server id 14.3.235.1; Tue, 5 Jul 2016 11:13:53 +0800 From: Shannon Zhao To: Date: Tue, 5 Jul 2016 11:12:31 +0800 Message-ID: <1467688367-17320-2-git-send-email-zhaoshenglong@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 In-Reply-To: <1467688367-17320-1-git-send-email-zhaoshenglong@huawei.com> References: <1467688367-17320-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.0A090204.577B25FD.0104, 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: 861ff651ded65b136ab744145795a3d9 Cc: hangaohuai@huawei.com, 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 v3 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 ddd80aa..4a57dd7 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) {