From patchwork Thu Jun 23 03:16:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 70716 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp217317qgy; Wed, 22 Jun 2016 20:20:41 -0700 (PDT) X-Received: by 10.107.132.28 with SMTP id g28mr47931137iod.34.1466652029632; Wed, 22 Jun 2016 20:20:29 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id h134si3007729ita.58.2016.06.22.20.20.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Jun 2016 20:20:29 -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 1bFv9Y-00009R-Ti; Thu, 23 Jun 2016 03:18:04 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bFv9X-000090-OC for xen-devel@lists.xen.org; Thu, 23 Jun 2016 03:18:03 +0000 Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id CF/BD-18304-AE45B675; Thu, 23 Jun 2016 03:18:02 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrGIsWRWlGSWpSXmKPExsVSPpHPSfdlSHa 4walDVhZLPi5mcWD0OLr7N1MAYxRrZl5SfkUCa8aqzkuMBR3cFUsObWBuYGzg7GLk5BASOMUo sflyVhcjF5C9h1Fi2YvlLCAJNgFdiY8bp7CD2CICshKru+awgxQxC1xnlLjzfhtrFyMHh7CAn cSxiyYgNSwCqhIXnjQygti8Au4SJ+/eYgOxJQQ0JFb2TgCbySngIXFy1hNmiMXuEnPW7GWBqB eUODnzCZjNLCAhcfDFC2aIXkWJtvUnoeZIShxccYMF5AYJkKOPvlzMCJEwlZj1/RHbBEbBWUh mzUIyawEj0ypG9eLUorLUIl1TvaSizPSMktzEzBxdQwNjvdzU4uLE9NScxKRiveT83E2MwPCs Z2Bg3MF4+avTIUZJDiYlUV4rh+xwIb6k/JTKjMTijPii0pzU4kOMMhwcShK8x4KBcoJFqempF WmZOcBIgUlLcPAoifA6A6NFiLe4IDG3ODMdInWKUVFKnPcQSJ8ASCKjNA+uDRadlxhlpYR5GR kYGIR4ClKLcjNLUOVfMYpzMCoJ864FmcKTmVcCN/0V0GImoMXL+tNBFpckIqSkGhiZVirPmDh tQxb70WU6GY3ds9J7nk5z3NehXsY482enU9DK/5deTH3ucPZ+3LY9J/LmmR39K7dU1HY+84nH 4VP3fK52SQvSsmOcWrTQQHLG9Pc/pafnZS1vPc+6L+JTSFlbXdB8qfo8l8BV3NsrXr3fEaOt+ OGV3oOSG0cPP7399/vWtDNrHH9IK7EUZyQaajEXFScCANi4c4bJAgAA X-Env-Sender: zhaoshenglong@huawei.com X-Msg-Ref: server-10.tower-31.messagelabs.com!1466651877!46046538!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 27616 invoked from network); 23 Jun 2016 03:18:00 -0000 Received: from szxga03-in.huawei.com (HELO szxga03-in.huawei.com) (119.145.14.66) by server-10.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 23 Jun 2016 03:18:00 -0000 Received: from 172.24.1.36 (EHLO szxeml430-hub.china.huawei.com) ([172.24.1.36]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id CDT13164; Thu, 23 Jun 2016 11:17:38 +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:28 +0800 From: Shannon Zhao To: Date: Thu, 23 Jun 2016 11:16:52 +0800 Message-ID: <1466651824-6964-6-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.0A090204.576B54D2.007E, 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: 8e0cc0ce331fe34fd5fda7f0b5194772 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 05/17] 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_acpi.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tools/libxl/libxl_arm_acpi.c b/tools/libxl/libxl_arm_acpi.c index 60c31f9..5f332fa 100644 --- a/tools/libxl/libxl_arm_acpi.c +++ b/tools/libxl/libxl_arm_acpi.c @@ -53,6 +53,24 @@ struct acpitable { static struct acpitable acpitables[NUMS]; +static void make_acpi_rsdp(libxl__gc *gc, struct xc_dom_image *dom) +{ + struct acpi_table_rsdp *rsdp; + size_t size = sizeof(*rsdp); + + rsdp = libxl__zalloc(gc, size); + memcpy(rsdp->signature, "RSD PTR ", sizeof(rsdp->signature)); + memcpy(rsdp->oem_id, ACPI_BUILD_APPNAME6, sizeof(rsdp->oem_id)); + rsdp->length = size; + rsdp->revision = 0x02; + rsdp->checksum = 0; + + acpitables[RSDP].table = rsdp; + acpitables[RSDP].size = size; + /* Align to 64 bit. */ + dom->acpitable_size += ROUNDUP(acpitables[RSDP].size, 3); +} + int libxl__prepare_acpi(libxl__gc *gc, libxl_domain_build_info *info, libxl__domain_build_state *state, struct xc_dom_image *dom) @@ -73,6 +91,8 @@ int libxl__prepare_acpi(libxl__gc *gc, libxl_domain_build_info *info, dom->acpitable_blob = NULL; dom->acpitable_size = 0; + make_acpi_rsdp(gc, dom); + return 0; }