From patchwork Tue May 31 04:43:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 68863 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp1727782qge; Mon, 30 May 2016 21:50:32 -0700 (PDT) X-Received: by 10.31.72.66 with SMTP id v63mr11647271vka.29.1464670232178; Mon, 30 May 2016 21:50:32 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id f60si22803621uaf.5.2016.05.30.21.50.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 May 2016 21:50:32 -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 1b7bcP-0008M4-Cm; Tue, 31 May 2016 04:49:29 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b7bcO-0008Ll-IJ for xen-devel@lists.xen.org; Tue, 31 May 2016 04:49:28 +0000 Received: from [193.109.254.147] by server-6.bemta-14.messagelabs.com id BB/97-31829-7D71D475; Tue, 31 May 2016 04:49:27 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrGIsWRWlGSWpSXmKPExsVSPpHPSfe6uG+ 4wdNPohZLPi5mcWD0OLr7N1MAYxRrZl5SfkUCa8bbld9ZCrZzVyyb69/AuJWzi5GLQ0jgDKPE yWdnmSGcPYwSD05dZOpi5ORgE9CV+LhxCjuILSIgK7G6aw47SBGzwCZGibYvF1lAEsIC1hKXV sxg62Lk4GARUJU4fiQOJMwr4CnxcfphZhBbQkBDYmXvBLByTqD4+YkvweJCAh4S+5adZoSoF5 Q4OfMJWA2zgITEwRcvoHoVJdrWn2SDsCUlDq64wQJyg4TAKUaJr8vXQSVMJd6efsAygVFwFpJ Zs5DMWsDItIpRvTi1qCy1SNdcL6koMz2jJDcxM0fX0NBELze1uDgxPTUnMalYLzk/dxMjMDwZ gGAH45clzocYJTmYlER5rX77hAvxJeWnVGYkFmfEF5XmpBYfYpTh4FCS4K0Q8w0XEixKTU+tS MvMAUYKTFqCg0dJhNcCJM1bXJCYW5yZDpE6xagoJc67ACQhAJLIKM2Da4NF5yVGWSlhXkagQ4 R4ClKLcjNLUOVfMYpzMCoJ824FmcKTmVcCN/0V0GImoMXxGT4gi0sSEVJSDYzTjNa+idxau8o p+1ZtS4ed1IMZrRvdLPvnMVa2CH6QOWPBseebefsh5ZOmZ7N05kq3sHxos3VaxWaodyVr6YST P5894m6X2/n2+LPu2muKmyoSbJwZz160L3P/ErNx7ZmPQUXhXI8cvlxuVX0ps2fOzLksLk/dV gpJpT73OV3Z5R0zu/ig/y8lluKMREMt5qLiRADaI7oIyQIAAA== X-Env-Sender: zhaoshenglong@huawei.com X-Msg-Ref: server-8.tower-27.messagelabs.com!1464670165!41091090!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 18681 invoked from network); 31 May 2016 04:49:26 -0000 Received: from szxga03-in.huawei.com (HELO szxga03-in.huawei.com) (119.145.14.66) by server-8.tower-27.messagelabs.com with SMTP; 31 May 2016 04:49:26 -0000 Received: from 172.24.1.137 (EHLO szxeml428-hub.china.huawei.com) ([172.24.1.137]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id CCK66904; Tue, 31 May 2016 12:44:47 +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:39 +0800 From: Shannon Zhao To: Date: Tue, 31 May 2016 12:43:32 +0800 Message-ID: <1464669816-11476-11-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.574D170C.0003, 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: 8def9ae83b7cee25e6dbb31a61e8e550 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 10/14] libxl/arm: Construct ACPI RSDP table 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 Signed-off-by: Shannon Zhao --- tools/libxl/libxl_arm.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tools/libxl/libxl_arm.c b/tools/libxl/libxl_arm.c index 84ea8b6..1bef9b0 100644 --- a/tools/libxl/libxl_arm.c +++ b/tools/libxl/libxl_arm.c @@ -1082,6 +1082,23 @@ static void make_acpi_xsdt(libxl__gc *gc, struct xc_dom_image *dom) dom->acpitable_size += dom->acpitable_blob->xsdt.size; } +static void make_acpi_rsdp(libxl__gc *gc, struct xc_dom_image *dom) +{ + struct acpi_rsdp_descriptor *rsdp; + + rsdp = libxl__zalloc(gc, sizeof(*rsdp)); + memcpy(&rsdp->signature, "RSD PTR ", sizeof(rsdp->signature)); + memcpy(rsdp->oem_id, ACPI_BUILD_APPNAME6, sizeof(rsdp->oem_id)); + rsdp->length = sizeof(*rsdp); + rsdp->revision = 0x02; + rsdp->checksum = 0; + + dom->acpitable_blob->rsdp.table = (void *)rsdp; + /* Align to 64bit. */ + dom->acpitable_blob->rsdp.size = sizeof(*rsdp); + dom->acpitable_size += dom->acpitable_blob->rsdp.size; +} + static int prepare_acpi(libxl__gc *gc, libxl_domain_build_info *info, libxl__domain_build_state *state, struct xc_dom_image *dom) @@ -1111,6 +1128,7 @@ static int prepare_acpi(libxl__gc *gc, libxl_domain_build_info *info, return rc; make_acpi_xsdt(gc, dom); + make_acpi_rsdp(gc, dom); return 0; }