[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen master] libxl/arm: Construct ACPI XSDT table
commit 0382b0830d7b653d3d0f0f0d59e8f21f451c1930 Author: Shannon Zhao <shannon.zhao@xxxxxxxxxx> AuthorDate: Wed Sep 28 18:18:52 2016 -0700 Commit: Wei Liu <wei.liu2@xxxxxxxxxx> CommitDate: Fri Sep 30 11:47:26 2016 +0100 libxl/arm: Construct ACPI XSDT table Signed-off-by: Shannon Zhao <shannon.zhao@xxxxxxxxxx> Acked-by: Julien Grall <julien.grall@xxxxxxx> Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx> --- tools/libxl/libxl_arm_acpi.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/tools/libxl/libxl_arm_acpi.c b/tools/libxl/libxl_arm_acpi.c index 0512630..ab68bf8 100644 --- a/tools/libxl/libxl_arm_acpi.c +++ b/tools/libxl/libxl_arm_acpi.c @@ -161,6 +161,35 @@ static void make_acpi_rsdp(libxl__gc *gc, struct xc_dom_image *dom, acpitables[RSDP].size); } +static void make_acpi_header(struct acpi_table_header *h, const char *sig, + size_t len, uint8_t rev) +{ + memcpy(h->signature, sig, 4); + h->length = len; + h->revision = rev; + memcpy(h->oem_id, ACPI_OEM_ID, sizeof(h->oem_id)); + memcpy(h->oem_table_id, ACPI_OEM_TABLE_ID, sizeof(h->oem_table_id)); + h->oem_revision = 0; + memcpy(h->asl_compiler_id, ACPI_ASL_COMPILER_ID, + sizeof(h->asl_compiler_id)); + h->asl_compiler_revision = 0; + h->checksum = 0; +} + +static void make_acpi_xsdt(libxl__gc *gc, struct xc_dom_image *dom, + struct acpitable acpitables[]) +{ + uint64_t offset = acpitables[XSDT].addr - GUEST_ACPI_BASE; + struct acpi_table_xsdt *xsdt = (void *)dom->acpi_modules[0].data + offset; + + xsdt->table_offset_entry[0] = acpitables[MADT].addr; + xsdt->table_offset_entry[1] = acpitables[GTDT].addr; + xsdt->table_offset_entry[2] = acpitables[FADT].addr; + make_acpi_header(&xsdt->header, "XSDT", acpitables[XSDT].size, 1); + calculate_checksum(xsdt, offsetof(struct acpi_table_header, checksum), + acpitables[XSDT].size); +} + int libxl__prepare_acpi(libxl__gc *gc, libxl_domain_build_info *info, struct xc_dom_image *dom) { @@ -186,6 +215,7 @@ int libxl__prepare_acpi(libxl__gc *gc, libxl_domain_build_info *info, goto out; make_acpi_rsdp(gc, dom, acpitables); + make_acpi_xsdt(gc, dom, acpitables); out: return rc; -- generated by git-patchbot for /home/xen/git/xen.git#master _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx https://lists.xenproject.org/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |