diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2008-04-07 18:45:27 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2008-04-07 18:45:27 +0000 |
commit | 1a726423b1a9322e96b8a2ef486419de19074364 (patch) | |
tree | b3ba81b8e6a7eeb16e93cb0d6a62ba93da710e62 /sys | |
parent | 713ed9c1da7a6d8c732c45b7d7ed3be6e9a65dc7 (diff) |
Hardware monitor address should be 8-byte aligned.
ok deraadt@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/isa/wbsio.c | 10 |
1 files 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 <kettenis@openbsd.org> * @@ -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"); |