summaryrefslogtreecommitdiff
path: root/usr.sbin/acpi
diff options
context:
space:
mode:
authorNate Lawson <njl@FreeBSD.org>2004-05-16 18:02:47 +0000
committerNate Lawson <njl@FreeBSD.org>2004-05-16 18:02:47 +0000
commit07c8b2af058402be4f301878402d614c8421acd1 (patch)
treed23ff49ed8545a9d1b7e4b092e380f607cf79c9c /usr.sbin/acpi
parentbe69fbd7aa73c73a3a16d1dcf106e9242d809698 (diff)
downloadsrc-test2-07c8b2af058402be4f301878402d614c8421acd1.tar.gz
src-test2-07c8b2af058402be4f301878402d614c8421acd1.zip
Notes
Diffstat (limited to 'usr.sbin/acpi')
-rw-r--r--usr.sbin/acpi/acpidump/acpi_user.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.sbin/acpi/acpidump/acpi_user.c b/usr.sbin/acpi/acpidump/acpi_user.c
index 91017f14d3db..7bb2d0af0b63 100644
--- a/usr.sbin/acpi/acpidump/acpi_user.c
+++ b/usr.sbin/acpi/acpidump/acpi_user.c
@@ -96,6 +96,7 @@ static struct ACPIrsdp *
acpi_get_rsdp(u_long addr)
{
struct ACPIrsdp rsdp;
+ size_t len;
/* Read in the table signature and check it. */
pread(acpi_mem_fd, &rsdp, 8, addr);
@@ -108,12 +109,16 @@ acpi_get_rsdp(u_long addr)
/* Run the checksum only over the version 1 header. */
if (acpi_checksum(&rsdp, 20))
return (NULL);
+
+ /* If the revision is 0, assume a version 1 length. */
if (rsdp.revision == 0)
- return (NULL);
+ len = 20;
+ else
+ len = rsdp.length;
/* XXX Should handle ACPI 2.0 RSDP extended checksum here. */
- return (acpi_map_physical(addr, rsdp.length));
+ return (acpi_map_physical(addr, len));
}
/*