summaryrefslogtreecommitdiff
path: root/sys/arch/macppc/pci
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>2002-03-27 15:26:12 +0000
committerJason Wright <jason@cvs.openbsd.org>2002-03-27 15:26:12 +0000
commita614430c90b37ff00f4ae00a69cba4490a887121 (patch)
tree80aaafa1c4bb5d5098c1fe0feaaafed05b6e308f /sys/arch/macppc/pci
parent00962034ebe310d45e612838009cac33fa943b8d (diff)
Don't use magic constants to the loop over the BAR, also, include the
politically correct check for whether this is an io or mem mapping space.
Diffstat (limited to 'sys/arch/macppc/pci')
-rw-r--r--sys/arch/macppc/pci/vgafb_pci.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/arch/macppc/pci/vgafb_pci.c b/sys/arch/macppc/pci/vgafb_pci.c
index 352e8332fab..0488a7b2186 100644
--- a/sys/arch/macppc/pci/vgafb_pci.c
+++ b/sys/arch/macppc/pci/vgafb_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vgafb_pci.c,v 1.4 2002/03/26 16:51:43 drahn Exp $ */
+/* $OpenBSD: vgafb_pci.c,v 1.5 2002/03/27 15:26:11 jason Exp $ */
/* $NetBSD: vga_pci.c,v 1.4 1996/12/05 01:39:38 cgd Exp $ */
/*
@@ -104,13 +104,14 @@ vgafb_pci_probe(pa, id, ioaddr, iosize, memaddr, memsize, cacheable, mmioaddr, m
*iosize = 0x0;
*memsize = 0x0;
*mmiosize = 0x0;
- for (i = 0x10; i <= 0x18; i += 4) {
+ for (i = PCI_MAPREG_START; i <= PCI_MAPREG_PPB_END; i += 4) {
#ifdef DEBUG_VGAFB
printf("vgafb confread %x %x\n",
i, pci_conf_read(pc, pa->pa_tag, i));
#endif
/* need to check more than just two base addresses? */
- if (0x1 & pci_conf_read(pc, pa->pa_tag, i) ) {
+ if (PCI_MAPREG_TYPE(pci_conf_read(pc, pa->pa_tag, i)) ==
+ PCI_MAPREG_TYPE_IO)
retval = pci_io_find(pc, pa->pa_tag, i,
&addr, &size);
if (retval) {