From patchwork Tue May 31 05:02:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 68877 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp1732486qge; Mon, 30 May 2016 22:05:12 -0700 (PDT) X-Received: by 10.176.7.70 with SMTP id h64mr15864695uah.97.1464671112046; Mon, 30 May 2016 22:05:12 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id 93si22828349uaj.155.2016.05.30.22.05.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 May 2016 22:05:12 -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 1b7bqO-0003ED-Oo; Tue, 31 May 2016 05:03:56 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b7bqN-0003Dp-A9 for xen-devel@lists.xen.org; Tue, 31 May 2016 05:03:55 +0000 Received: from [193.109.254.147] by server-7.bemta-14.messagelabs.com id 55/88-25102-A3B1D475; Tue, 31 May 2016 05:03:54 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrBIsWRWlGSWpSXmKPExsVSPpHPUddS2jf c4H+njcWSj4tZHBg9ju7+zRTAGMWamZeUX5HAmtG8awd7wRr+iqZnM1kaGD9wdTFycQgJnGGU 6JnWzw7h7GGUeLX3A5DDycEmoCvxceMUMFtEQFZiddccsCJmgY2MEk/efmUDSQgL+Ehs2twGZ rMIqEpce94CZvMKeEjsav/JBGJLCGhIrOydwAJicwp4Shz5+BzMFgKqaW3cwQhRLyhxcuYTsD izgITEwRcvmCF6FSXa1p9kg7AlJQ6uuMECcoSEwClGie9vt0ItMJU4OuEd8wRGwVlIZs1CMms BI9MqRvXi1KKy1CJdY72kosz0jJLcxMwcXUNDE73c1OLixPTUnMSkYr3k/NxNjMAQZQCCHYx3 +5wPMUpyMCmJ8lr99gkX4kvKT6nMSCzOiC8qzUktPsQow8GhJMF7QNI3XEiwKDU9tSItMwcYL TBpCQ4eJRHenyBp3uKCxNzizHSI1ClGRSlx3rcgCQGQREZpHlwbLEIvMcpKCfMyAh0ixFOQWp SbWYIq/4pRnINRSZiXQwpoCk9mXgnc9FdAi5mAFsdn+IAsLklESEk1MJp9f7sp3OpnTtia0Nu c9ZtuyK15oLP8jj672QVv8w+H5u859/a3snQK6yf1nfKF72akif/34nWbn3a0e8mqfMY9Z62X a0U+3rfeuLhgYfBF9hvJh3lPlD/pjJY11w/delvB6LTOw6D1Wxu+sR6uNSvPiM59L1HUxa67y Lx4+zbPOz4F9Wv07yqxFGckGmoxFxUnAgBIn5B+ywIAAA== X-Env-Sender: zhaoshenglong@huawei.com X-Msg-Ref: server-2.tower-27.messagelabs.com!1464671029!42815176!1 X-Originating-IP: [119.145.14.65] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTE5LjE0NS4xNC42NSA9PiA3NzQ2Mw==\n X-StarScan-Received: X-StarScan-Version: 8.46; banners=-,-,- X-VirusChecked: Checked Received: (qmail 41317 invoked from network); 31 May 2016 05:03:53 -0000 Received: from szxga02-in.huawei.com (HELO szxga02-in.huawei.com) (119.145.14.65) by server-2.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 31 May 2016 05:03:53 -0000 Received: from 172.24.1.137 (EHLO SZXEML429-HUB.china.huawei.com) ([172.24.1.137]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id DHY49912; Tue, 31 May 2016 13:03:36 +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, 31 May 2016 13:03:25 +0800 From: Shannon Zhao To: Date: Tue, 31 May 2016 13:02:54 +0800 Message-ID: <1464670986-10256-3-git-send-email-zhaoshenglong@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 In-Reply-To: <1464670986-10256-1-git-send-email-zhaoshenglong@huawei.com> References: <1464670986-10256-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.0A020202.574D1B2A.000B, 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: 61dc4a88e487f23b253dab1029fefddc 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 Subject: [Xen-devel] [PATCH RESEND 02/14] 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 --- 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..9e99159 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 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 prepare_dtb(gc, info, state, dom); +} + static void finalise_one_memory_node(libxl__gc *gc, void *fdt, uint64_t base, uint64_t size) {