diff mbox

[Xen-devel,07/14] libxl/arm: Construct ACPI DSDT table

Message ID 1464669816-11476-8-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>

Currently there is only the table header in DSDT table.

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

Patch

diff --git a/tools/libxl/libxl_arm.c b/tools/libxl/libxl_arm.c
index c3b8fb4..7949635 100644
--- a/tools/libxl/libxl_arm.c
+++ b/tools/libxl/libxl_arm.c
@@ -944,6 +944,20 @@  static void make_acpi_fadt(libxl__gc *gc, struct xc_dom_image *dom)
     dom->acpitable_size += dom->acpitable_blob->fadt.size;
 }
 
+static void make_acpi_dsdt(libxl__gc *gc, struct xc_dom_image *dom)
+{
+    struct acpi_table_header *dsdt;
+
+    /* Currently there is only the table header in DSDT table. */
+    dsdt = libxl__zalloc(gc, sizeof(*dsdt));
+    make_acpi_header((void *)dsdt, "DSDT", sizeof(*dsdt), 2);
+
+    dom->acpitable_blob->dsdt.table = (void *)dsdt;
+    /* Align to 64bit. */
+    dom->acpitable_blob->dsdt.size = ROUNDUP(sizeof(*dsdt), 3);
+    dom->acpitable_size += ROUNDUP(dom->acpitable_blob->dsdt.size, 3);
+}
+
 static int prepare_acpi(libxl__gc *gc, libxl_domain_build_info *info,
                         libxl__domain_build_state *state,
                         struct xc_dom_image *dom)
@@ -966,6 +980,7 @@  static int prepare_acpi(libxl__gc *gc, libxl_domain_build_info *info,
 
     make_acpi_gtdt(gc, dom);
     make_acpi_fadt(gc, dom);
+    make_acpi_dsdt(gc, dom);
 
     return 0;
 }