diff mbox

[Xen-devel,10/14] libxl/arm: Construct ACPI RSDP table

Message ID 1464669816-11476-11-git-send-email-zhaoshenglong@huawei.com
State Superseded
Headers show

Commit Message

Shannon Zhao May 31, 2016, 4:43 a.m. UTC
From: Shannon Zhao <shannon.zhao@linaro.org>

Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
---
 tools/libxl/libxl_arm.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
diff mbox

Patch

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;
 }