From patchwork Tue May 31 04:43:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 68874 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp1728300qge; Mon, 30 May 2016 21:52:24 -0700 (PDT) X-Received: by 10.159.35.200 with SMTP id 66mr5167498uao.116.1464670344429; Mon, 30 May 2016 21:52:24 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id c7si22914228uac.154.2016.05.30.21.52.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 May 2016 21:52:24 -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 1b7be8-0001Pc-LI; Tue, 31 May 2016 04:51:16 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b7be7-0001Os-L6 for xen-devel@lists.xen.org; Tue, 31 May 2016 04:51:15 +0000 Received: from [193.109.254.147] by server-4.bemta-14.messagelabs.com id 33/24-09542-2481D475; Tue, 31 May 2016 04:51:14 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrGIsWRWlGSWpSXmKPExsVi9XuGg66ThG+ 4QfNyXoslHxezODB6HN39mymAMYo1My8pvyKBNaN51w72gjX8FU3PZrI0MH7g6mLk4hASOMMo MevHBpYuRk4gZw+jxIeFmiA2m4CuxMeNU9hBbBEBWYnVXXPYQRqYBTYxSrR9uQjWICzgKjF7y T8mEJtFQFVi2+cDQHEODl4BD4n3C/RAwhICGhIreyeAlXMKeEqcn/iSGWKXh8S+ZacZQWxeAU GJkzOfgNUwC0hIHHzxghmiV1Gibf1JNghbUuLgihssIDdICJxilHg78ywbyC4JAVOJz9vNJzA KzkIyahaSUQsYmVYxahSnFpWlFukaGuklFWWmZ5TkJmbm6BoamujlphYXJ6an5iQmFesl5+du YgSGJwMQ7GA8O835EKMkB5OSKK/Vb59wIb6k/JTKjMTijPii0pzU4kOMMhwcShK8N8V8w4UEi 1LTUyvSMnOAkQKTluDgURLhVRIHSvMWFyTmFmemQ6ROMSpKifMuAOkTAElklObBtcGi8xKjrJ QwLyPQIUI8BalFuZklqPKvGMU5GJWEeb+CTOHJzCuBm/4KaDET0OL4DB+QxSWJCCmpBsZS+zt 5fmtF8qJXz+wrf55S1fjF7oIdnw2rtmz3zNnrZl5qn55j77VqT8qm7JqYS/wlCrftn8+5X/24 WmBBUuEunkXS32c2z7fZ+3++/S6ZT4Uf+MUEZgWJLLkx4dOyD3Hdh+4U1wV7ckzl+XNs54kuk z3NOtXaCwIF8ms/vjt1olbkoND/KAUlluKMREMt5qLiRACcmPo1yQIAAA== X-Env-Sender: zhaoshenglong@huawei.com X-Msg-Ref: server-2.tower-27.messagelabs.com!1464670269!42813775!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.46; banners=-,-,- X-VirusChecked: Checked Received: (qmail 10497 invoked from network); 31 May 2016 04:51:13 -0000 Received: from szxga01-in.huawei.com (HELO szxga01-in.huawei.com) (58.251.152.64) by server-2.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 31 May 2016 04:51:13 -0000 Received: from 172.24.1.137 (EHLO szxeml428-hub.china.huawei.com) ([172.24.1.137]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id DLK67800; Tue, 31 May 2016 12:44:42 +0800 (CST) Received: from HGHY1Z002260041.china.huawei.com (10.177.16.142) by szxeml428-hub.china.huawei.com (10.82.67.183) with Microsoft SMTP Server id 14.3.235.1; Tue, 31 May 2016 12:44:33 +0800 From: Shannon Zhao To: Date: Tue, 31 May 2016 12:43:24 +0800 Message-ID: <1464669816-11476-3-git-send-email-zhaoshenglong@huawei.com> X-Mailer: git-send-email 1.9.0.msysgit.0 In-Reply-To: <1464669816-11476-1-git-send-email-zhaoshenglong@huawei.com> References: <1464669816-11476-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.574D16BB.0084, 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: 38083bb072bb8c4dd3c53fdc6044733b Cc: sstabellini@kernel.org, ian.jackson@eu.citrix.com, peter.huangpeng@huawei.com, julien.grall@arm.com, shannon.zhao@linaro.org, wei.liu2@citrix.comg Subject: [Xen-devel] [PATCH 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) {