From 2e71eb12574acd0412b4c1570535dbe121adb27b Mon Sep 17 00:00:00 2001 From: Nate Lawson Date: Sun, 14 Sep 2003 00:37:52 +0000 Subject: [PATCH] For dumping the DSDT (-o option), be sure to use the X_DSDT address if appropriate. This should be the last change to make ia64 work. --- usr.sbin/acpi/acpidump/acpi.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/usr.sbin/acpi/acpidump/acpi.c b/usr.sbin/acpi/acpidump/acpi.c index 91aec03acbea..9e6916661874 100644 --- a/usr.sbin/acpi/acpidump/acpi.c +++ b/usr.sbin/acpi/acpidump/acpi.c @@ -792,7 +792,13 @@ dsdt_from_fadt(struct FADTbody *fadt) { struct ACPIsdt *sdt; - sdt = (struct ACPIsdt *)acpi_map_sdt(fadt->dsdt_ptr); + /* Use the DSDT address if it is valid and version 2, else X_DSDT */ + if (addr_size == 4 || + (addr_size == 8 && fadt->dsdt_ptr != 0 && + (fadt->x_dsdt_ptr & 0xffffffff) != fadt->dsdt_ptr)) + sdt = (struct ACPIsdt *)acpi_map_sdt(fadt->dsdt_ptr); + else + sdt = (struct ACPIsdt *)acpi_map_sdt(fadt->x_dsdt_ptr); if (acpi_checksum(sdt, sdt->len)) errx(1, "DSDT is corrupt\n"); return (sdt);