summaryrefslogtreecommitdiffstats
path: root/usr.sbin/acpidump
diff options
context:
space:
mode:
authormarco <marco@openbsd.org>2008-06-06 10:16:03 +0000
committermarco <marco@openbsd.org>2008-06-06 10:16:03 +0000
commite037dca56f8852cffadfc52d7c74581199f5eb33 (patch)
tree4cb18e50ed82305acfa931c56b234d3b261e5b56 /usr.sbin/acpidump
parentShrink acpi some more for floppies and while here re-enable acpi on the (diff)
downloadwireguard-openbsd-e037dca56f8852cffadfc52d7c74581199f5eb33.tar.xz
wireguard-openbsd-e037dca56f8852cffadfc52d7c74581199f5eb33.zip
Fix alignment on some machines where crc cehck failed.
code from jordan
Diffstat (limited to 'usr.sbin/acpidump')
-rw-r--r--usr.sbin/acpidump/acpi_user.c6
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)));
}
}