diff mbox

[Xen-devel,RESEND,09/14] libxl/arm: Construct ACPI XSDT table

Message ID 1464670986-10256-10-git-send-email-zhaoshenglong@huawei.com
State New
Headers show

Commit Message

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

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

Patch

diff --git a/tools/libxl/libxl_arm.c b/tools/libxl/libxl_arm.c
index f72f692..84ea8b6 100644
--- a/tools/libxl/libxl_arm.c
+++ b/tools/libxl/libxl_arm.c
@@ -1061,6 +1061,27 @@  static int make_acpi_madt(libxl__gc *gc, struct xc_dom_image *dom, int nr_cpus,
     return 0;
 }
 
+static void make_acpi_xsdt(libxl__gc *gc, struct xc_dom_image *dom)
+{
+    uint32_t size;
+    struct acpi_xsdt_descriptor *xsdt;
+
+    /*
+     * Currently only 3 tables(GTDT, FADT, MADT) are pointed by XSDT. Alloc
+     * entries for them but the entry values will be specified when they are
+     * copied to the guest memory.
+     */
+    size = sizeof(*xsdt) + sizeof(uint64_t) * 3;
+    xsdt = libxl__zalloc(gc, size);
+
+    make_acpi_header(&xsdt->header, "XSDT", size, 1);
+
+    dom->acpitable_blob->xsdt.table = (void *)xsdt;
+    /* Align to 64bit. */
+    dom->acpitable_blob->xsdt.size = size;
+    dom->acpitable_size += dom->acpitable_blob->xsdt.size;
+}
+
 static int prepare_acpi(libxl__gc *gc, libxl_domain_build_info *info,
                         libxl__domain_build_state *state,
                         struct xc_dom_image *dom)
@@ -1089,6 +1110,8 @@  static int prepare_acpi(libxl__gc *gc, libxl_domain_build_info *info,
     if (rc)
 	return rc;
 
+    make_acpi_xsdt(gc, dom);
+
     return 0;
 }