Date: Wed, 3 Sep 2003 23:04:50 -0700 (PDT) From: Marcel Moolenaar <marcel@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 37483 for review Message-ID: <200309040604.h8464oHx064196@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=37483 Change 37483 by marcel@marcel_nfs on 2003/09/03 23:04:00 Keep track of the patches I'm sending to njl@. This patch refines the way we print the RSD PTR and properly detects the RSDT or XSDT, depending on the revision. Affected files ... .. //depot/projects/ia64/usr.sbin/acpi/acpidump/acpi.c#14 edit Differences ... ==== //depot/projects/ia64/usr.sbin/acpi/acpidump/acpi.c#14 (text+ko) ==== @@ -425,11 +425,22 @@ static void acpi_print_rsd_ptr(struct ACPIrsdp *rp) { + const char *version; printf(BEGIN_COMMENT); - printf(" RSD PTR: Checksum=%d, OEMID=", rp->sum); + printf(" RSD PTR: OEM="); acpi_print_string(rp->oem, 6); - printf(", RsdtAddress=0x%08x\n", rp->rsdt_addr); + switch (rp->revision) { + case 0: version = "ACPI 1.0"; break; + case 2: version = "ACPI 2.0"; break; + default: version = "unknown"; break; + } + printf(", rev=%s (%d)\n", version, rp->revision); + if (rp->revision >= 2) + printf("\tXSDT=0x%08lx, length=%u, cksum=%u\n", + (u_long)rp->xsdt_addr, rp->length, rp->xsum); + else + printf("\tRSDT=0x%08x, cksum=%u\n", rp->rsdt_addr, rp->sum); printf(END_COMMENT); } @@ -469,11 +480,17 @@ if (tflag) acpi_print_rsd_ptr(rp); - rsdp = (struct ACPIsdt *)acpi_map_sdt(rp->rsdt_addr); - if (memcmp(rsdp->signature, "RSDT", 4) != 0 || - acpi_checksum(rsdp, rsdp->len) != 0) - errx(1, "RSDT is corrupted"); - + if (rp->revision < 2) { + rsdp = (struct ACPIsdt *)acpi_map_sdt(rp->rsdt_addr); + if (memcmp(rsdp->signature, "RSDT", 4) != 0 || + acpi_checksum(rsdp, rsdp->len) != 0) + errx(1, "RSDT is corrupted"); + } else { + rsdp = (struct ACPIsdt *)acpi_map_sdt(rp->xsdt_addr); + if (memcmp(rsdp->signature, "XSDT", 4) != 0 || + acpi_checksum(rsdp, rsdp->len) != 0) + errx(1, "XSDT is corrupted"); + } return (rsdp); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200309040604.h8464oHx064196>