PERFORCE change 37483 for review
Marcel Moolenaar
marcel at FreeBSD.org
Wed Sep 3 23:04:52 PDT 2003
http://perforce.freebsd.org/chv.cgi?CH=37483
Change 37483 by marcel at marcel_nfs on 2003/09/03 23:04:00
Keep track of the patches I'm sending to njl at . 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);
}
More information about the p4-projects
mailing list