diff options
author | Marco Peereboom <marco@cvs.openbsd.org> | 2008-06-06 10:16:04 +0000 |
---|---|---|
committer | Marco Peereboom <marco@cvs.openbsd.org> | 2008-06-06 10:16:04 +0000 |
commit | 41990d11a0c098c154dbd6485ed81669d89c868e (patch) | |
tree | 6c3d38a44997f6cb90e04290f18195449e032255 /usr.sbin/acpidump/acpi_user.c | |
parent | bcfa54984abf61ecf962481ea84fcea30d4b7a8c (diff) |
Fix alignment on some machines where crc cehck failed.
code from jordan
Diffstat (limited to 'usr.sbin/acpidump/acpi_user.c')
-rw-r--r-- | usr.sbin/acpidump/acpi_user.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/acpidump/acpi_user.c b/usr.sbin/acpidump/acpi_user.c index 56190771bf0..3fbe4901051 100644 --- a/usr.sbin/acpidump/acpi_user.c +++ b/usr.sbin/acpidump/acpi_user.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpi_user.c,v 1.5 2007/04/03 10:43:33 jsg Exp $ */ +/* $OpenBSD: acpi_user.c,v 1.6 2008/06/06 10:16:03 marco Exp $ */ /*- * Copyright (c) 1999 Doug Rabson * Copyright (c) 2000 Mitsuru IWASAKI <iwasaki@FreeBSD.org> @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: acpi_user.c,v 1.5 2007/04/03 10:43:33 jsg Exp $ + * $Id: acpi_user.c,v 1.6 2008/06/06 10:16:03 marco Exp $ * $FreeBSD: src/usr.sbin/acpi/acpidump/acpi_user.c,v 1.3 2000/11/08 02:37:00 iwasaki Exp $ */ #include <sys/types.h> @@ -107,6 +107,7 @@ acpi_find_rsd_ptr() acpi_user_init(); for (i = 0; i < 1024 * 1024; i += 16) { + lseek(acpi_mem_fd, i, SEEK_SET); read(acpi_mem_fd, buf, 16); if (!memcmp(buf, "RSD PTR ", 8)) { /* Read the rest of the structure */ @@ -115,6 +116,7 @@ acpi_find_rsd_ptr() /* Verify checksum before accepting it. */ if (acpi_checksum(buf, sizeof(struct ACPIrsdp))) continue; + return (acpi_map_physical(i, sizeof(struct ACPIrsdp))); } } |