From 1a726423b1a9322e96b8a2ef486419de19074364 Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Mon, 7 Apr 2008 18:45:27 +0000 Subject: Hardware monitor address should be 8-byte aligned. ok deraadt@ --- sys/dev/isa/wbsio.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/dev/isa/wbsio.c b/sys/dev/isa/wbsio.c index a987d0c9f1c..8e4b7110f4b 100644 --- a/sys/dev/isa/wbsio.c +++ b/sys/dev/isa/wbsio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wbsio.c,v 1.2 2008/03/31 17:56:41 deraadt Exp $ */ +/* $OpenBSD: wbsio.c,v 1.3 2008/04/07 18:45:26 kettenis Exp $ */ /* * Copyright (c) 2008 Mark Kettenis * @@ -198,9 +198,15 @@ wbsio_attach(struct device *parent, struct device *self, void *aux) /* Select HM logical device */ wbsio_conf_write(sc->sc_iot, sc->sc_ioh, WBSIO_LDN, WBSIO_LDN_HM); + /* + * The address should be 8-byte aligned, but it seems some + * BIOSes ignore this. They get away with it, because + * Apparently the hardware simply ignores the lower three + * bits. We do the same here. + */ reg0 = wbsio_conf_read(sc->sc_iot, sc->sc_ioh, WBSIO_HM_ADDR_LSB); reg1 = wbsio_conf_read(sc->sc_iot, sc->sc_ioh, WBSIO_HM_ADDR_MSB); - iobase = (reg1 << 8) | reg0; + iobase = (reg1 << 8) | (reg0 & ~0x7); printf("\n"); -- cgit v1.2.3