diff options
author | Owain Ainsworth <oga@cvs.openbsd.org> | 2008-12-04 23:05:33 +0000 |
---|---|---|
committer | Owain Ainsworth <oga@cvs.openbsd.org> | 2008-12-04 23:05:33 +0000 |
commit | c4452a7ce1561c195dbe49438eecc9b600020c6c (patch) | |
tree | c58b923e96d9830e26d1b9e95eccb37b7b1a6766 | |
parent | 528b753a02a8d9d99d2b32f9530524feaea1140b (diff) |
Don't hardcode the bus_space_tag to use, grab if from pci_attach_args
like you're supposed to. Makes this file slightly less horrible.
ok kettenis@, "yes" deraadt@.
-rw-r--r-- | sys/dev/pci/if_sis.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/sys/dev/pci/if_sis.c b/sys/dev/pci/if_sis.c index 08c2ee07e01..5a0c12e71d1 100644 --- a/sys/dev/pci/if_sis.c +++ b/sys/dev/pci/if_sis.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_sis.c,v 1.85 2008/11/28 02:44:18 brad Exp $ */ +/* $OpenBSD: if_sis.c,v 1.86 2008/12/04 23:05:32 oga Exp $ */ /* * Copyright (c) 1997, 1998, 1999 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. @@ -319,22 +319,15 @@ void sis_read_cmos(struct sis_softc *sc, struct pci_attach_args *pa, caddr_t dest, int off, int cnt) { - bus_space_tag_t btag; u_int32_t reg; int i; reg = pci_conf_read(pa->pa_pc, pa->pa_tag, 0x48); pci_conf_write(pa->pa_pc, pa->pa_tag, 0x48, reg | 0x40); -#if defined(__amd64__) - btag = X86_BUS_SPACE_IO; -#elif defined(__i386__) - btag = I386_BUS_SPACE_IO; -#endif - for (i = 0; i < cnt; i++) { - bus_space_write_1(btag, 0x0, 0x70, i + off); - *(dest + i) = bus_space_read_1(btag, 0x0, 0x71); + bus_space_write_1(pa->pa_iot, 0x0, 0x70, i + off); + *(dest + i) = bus_space_read_1(pa->pa_iot, 0x0, 0x71); } pci_conf_write(pa->pa_pc, pa->pa_tag, 0x48, reg & ~0x40); |