tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[patch] PCI memory & i/o enables



Here is a patch that changes the way that the PCI subsystem and drivers
use PCI_FLAGS_IO_ENABLED and PCI_FLAGS_MEM_ENABLED.  I went ahead and
renamed the flags in order to poison old-fashioned uses.  Now they're
called PCI_FLAGS_IO_OKAY and PCI_FLAGS_MEM_OKAY.

For simplicity's sake, I'll just write of PCI_FLAGS_IO_ENABLED, below,
but the same discussion applies to PCI_FLAGS_MEM_ENABLED.

Traditionally, if PCI_FLAGS_IO_ENABLED is set in the
pci_attach_args.pa_flags, it tells a PCI device driver, "the bridges
upstream forward PCI I/O transactions to this device, *and* I/O
transactions are enabled in the device's PCI CSR."  Some drivers,
finding that neither PCI_FLAGS_IO_ENABLED nor the corresponding PCI CSR
bit is set set both pa_flags and the CSR themselves.  Those drivers
assume that the upstream bridges are forwarding I/O transactions, which
may or may not be true.  They have to assume, though, because the
information in pa_flags is not specific.

My patch makes the PCI_FLAGS_IO_OKAY condition more specific: it tells a
PCI device driver, "the bridges upstream forward PCI I/O transactions to
this device".  If the flag isn't set, the driver has no business setting
it.  Also, if the flag isn't set, there's not much use in the driver
setting the corresponding bit in the PCI CSR.

Comments?

Dave

-- 
David Young             OJC Technologies
dyoung%ojctech.com@localhost      Urbana, IL * (217) 344-0444 x24
Index: sys/arch/algor/dev/bonito_mainbus.c
===================================================================
RCS file: /cvsroot/src/sys/arch/algor/dev/bonito_mainbus.c,v
retrieving revision 1.11
diff -u -p -r1.11 bonito_mainbus.c
--- sys/arch/algor/dev/bonito_mainbus.c 28 Apr 2008 20:23:10 -0000      1.11
+++ sys/arch/algor/dev/bonito_mainbus.c 8 Apr 2011 14:43:39 -0000
@@ -94,7 +94,7 @@ bonito_mainbus_attach(struct device *par
            BONITO_REV_FPGA(rev) ? "FPGA" : "ASIC",
            BONITO_REV_MAJOR(rev), BONITO_REV_MINOR(rev));
 
-       pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
+       pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY;
        pba.pba_bus = 0;
        pba.pba_bridgetag = NULL;
 
Index: sys/arch/algor/dev/vtpbc_mainbus.c
===================================================================
RCS file: /cvsroot/src/sys/arch/algor/dev/vtpbc_mainbus.c,v
retrieving revision 1.15
diff -u -p -r1.15 vtpbc_mainbus.c
--- sys/arch/algor/dev/vtpbc_mainbus.c  28 Apr 2008 20:23:10 -0000      1.15
+++ sys/arch/algor/dev/vtpbc_mainbus.c  8 Apr 2011 14:43:39 -0000
@@ -100,12 +100,12 @@ vtpbc_mainbus_attach(struct device *pare
        printf("%s: PCI DMA window base: 0x%08lx\n", sc->sc_dev.dv_xname,
            (u_long) vt->vt_dma_winbase);
 
-       pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
+       pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY;
        pba.pba_bus = 0;
        pba.pba_bridgetag = NULL;
 
        if (vt->vt_pci_iobase == (bus_addr_t) -1)
-               pba.pba_flags &= ~PCI_FLAGS_IO_ENABLED;
+               pba.pba_flags &= ~PCI_FLAGS_IO_OKAY;
 
 #if defined(ALGOR_P4032)
            {
Index: sys/arch/alpha/pci/a12c.c
===================================================================
RCS file: /cvsroot/src/sys/arch/alpha/pci/a12c.c,v
retrieving revision 1.22
diff -u -p -r1.22 a12c.c
--- sys/arch/alpha/pci/a12c.c   15 Dec 2010 01:27:18 -0000      1.22
+++ sys/arch/alpha/pci/a12c.c   8 Apr 2011 14:43:40 -0000
@@ -146,7 +146,7 @@ a12cattach(struct device *parent, struct
        pba.pba_pc = &ccp->ac_pc;
        pba.pba_bus = 0;
        pba.pba_bridgetag = NULL;
-       pba.pba_flags = PCI_FLAGS_MEM_ENABLED |
+       pba.pba_flags = PCI_FLAGS_MEM_OKAY |
            PCI_FLAGS_MRL_OKAY | PCI_FLAGS_MRM_OKAY | PCI_FLAGS_MWI_OKAY;
 
        config_found_ia(self, "pcibus", &pba, pcibusprint);
Index: sys/arch/alpha/pci/apecs.c
===================================================================
RCS file: /cvsroot/src/sys/arch/alpha/pci/apecs.c,v
retrieving revision 1.51
diff -u -p -r1.51 apecs.c
--- sys/arch/alpha/pci/apecs.c  15 Dec 2010 01:27:18 -0000      1.51
+++ sys/arch/alpha/pci/apecs.c  8 Apr 2011 14:43:40 -0000
@@ -228,7 +228,7 @@ apecsattach(device_t parent, device_t se
        pba.pba_pc = &acp->ac_pc;
        pba.pba_bus = 0;
        pba.pba_bridgetag = NULL;
-       pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED |
+       pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY |
            PCI_FLAGS_MRL_OKAY | PCI_FLAGS_MRM_OKAY | PCI_FLAGS_MWI_OKAY;
        config_found_ia(self, "pcibus", &pba, pcibusprint);
 }
Index: sys/arch/alpha/pci/cia.c
===================================================================
RCS file: /cvsroot/src/sys/arch/alpha/pci/cia.c,v
retrieving revision 1.70
diff -u -p -r1.70 cia.c
--- sys/arch/alpha/pci/cia.c    15 Dec 2010 01:27:18 -0000      1.70
+++ sys/arch/alpha/pci/cia.c    8 Apr 2011 14:43:40 -0000
@@ -400,7 +400,7 @@ ciaattach(struct device *parent, struct 
        pba.pba_pc = &ccp->cc_pc;
        pba.pba_bus = 0;
        pba.pba_bridgetag = NULL;
-       pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
+       pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY;
        if ((ccp->cc_flags & CCF_PYXISBUG) == 0)
                pba.pba_flags |= PCI_FLAGS_MRL_OKAY | PCI_FLAGS_MRM_OKAY |
                    PCI_FLAGS_MWI_OKAY;
Index: sys/arch/alpha/pci/dwlpx.c
===================================================================
RCS file: /cvsroot/src/sys/arch/alpha/pci/dwlpx.c,v
retrieving revision 1.35
diff -u -p -r1.35 dwlpx.c
--- sys/arch/alpha/pci/dwlpx.c  15 Dec 2010 01:27:18 -0000      1.35
+++ sys/arch/alpha/pci/dwlpx.c  8 Apr 2011 14:43:40 -0000
@@ -175,7 +175,7 @@ dwlpxattach(struct device *parent, struc
        pba.pba_pc = &sc->dwlpx_cc.cc_pc;
        pba.pba_bus = 0;
        pba.pba_bridgetag = NULL;
-       pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED |
+       pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY |
            PCI_FLAGS_MRL_OKAY | PCI_FLAGS_MRM_OKAY | PCI_FLAGS_MWI_OKAY;
        config_found_ia(self, "pcibus", &pba, pcibusprint);
 }
Index: sys/arch/alpha/pci/irongate.c
===================================================================
RCS file: /cvsroot/src/sys/arch/alpha/pci/irongate.c,v
retrieving revision 1.14
diff -u -p -r1.14 irongate.c
--- sys/arch/alpha/pci/irongate.c       28 Apr 2008 20:23:11 -0000      1.14
+++ sys/arch/alpha/pci/irongate.c       8 Apr 2011 14:43:40 -0000
@@ -177,7 +177,7 @@ irongate_attach(struct device *parent, s
        pba.pba_pc = &icp->ic_pc;
        pba.pba_bus = 0;
        pba.pba_bridgetag = NULL;
-       pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED |
+       pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY |
            PCI_FLAGS_MRL_OKAY | PCI_FLAGS_MRM_OKAY | PCI_FLAGS_MWI_OKAY;
 
        if (pci_get_capability(&icp->ic_pc, tag, PCI_CAP_AGP,
Index: sys/arch/alpha/pci/lca.c
===================================================================
RCS file: /cvsroot/src/sys/arch/alpha/pci/lca.c,v
retrieving revision 1.48
diff -u -p -r1.48 lca.c
--- sys/arch/alpha/pci/lca.c    15 Dec 2010 01:27:19 -0000      1.48
+++ sys/arch/alpha/pci/lca.c    8 Apr 2011 14:43:40 -0000
@@ -234,7 +234,7 @@ lcaattach(struct device *parent, struct 
        pba.pba_pc = &lcp->lc_pc;
        pba.pba_bus = 0;
        pba.pba_bridgetag = NULL;
-       pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED |
+       pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY |
            PCI_FLAGS_MRL_OKAY | PCI_FLAGS_MRM_OKAY | PCI_FLAGS_MWI_OKAY;
        config_found_ia(self, "pcibus", &pba, pcibusprint);
 }
Index: sys/arch/alpha/pci/mcpcia.c
===================================================================
RCS file: /cvsroot/src/sys/arch/alpha/pci/mcpcia.c,v
retrieving revision 1.26
diff -u -p -r1.26 mcpcia.c
--- sys/arch/alpha/pci/mcpcia.c 18 Mar 2009 10:22:22 -0000      1.26
+++ sys/arch/alpha/pci/mcpcia.c 8 Apr 2011 14:43:40 -0000
@@ -187,7 +187,7 @@ mcpciaattach(struct device *parent, stru
        pba.pba_pc = &ccp->cc_pc;
        pba.pba_bus = 0;
        pba.pba_bridgetag = NULL;
-       pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED |
+       pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY |
            PCI_FLAGS_MRL_OKAY | PCI_FLAGS_MRM_OKAY | PCI_FLAGS_MWI_OKAY;
        (void) config_found_ia(self, "pcibus", &pba, pcibusprint);
 
Index: sys/arch/alpha/pci/tsc.c
===================================================================
RCS file: /cvsroot/src/sys/arch/alpha/pci/tsc.c,v
retrieving revision 1.18
diff -u -p -r1.18 tsc.c
--- sys/arch/alpha/pci/tsc.c    7 Oct 2010 19:55:02 -0000       1.18
+++ sys/arch/alpha/pci/tsc.c    8 Apr 2011 14:43:40 -0000
@@ -183,7 +183,7 @@ tspattach(device_t parent, device_t self
        pba.pba_pc = &pcp->pc_pc;
        pba.pba_bus = 0;
        pba.pba_bridgetag = NULL;
-       pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED |
+       pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY |
            PCI_FLAGS_MRL_OKAY | PCI_FLAGS_MRM_OKAY | PCI_FLAGS_MWI_OKAY;
        config_found_ia(self, "pcibus", &pba, pcibusprint);
 }
Index: sys/arch/alpha/pci/ttwoga.c
===================================================================
RCS file: /cvsroot/src/sys/arch/alpha/pci/ttwoga.c,v
retrieving revision 1.11
diff -u -p -r1.11 ttwoga.c
--- sys/arch/alpha/pci/ttwoga.c 28 Apr 2008 20:23:11 -0000      1.11
+++ sys/arch/alpha/pci/ttwoga.c 8 Apr 2011 14:43:40 -0000
@@ -259,7 +259,7 @@ ttwopciattach(struct device *parent, str
        npba.pba_pc = &tcp->tc_pc;
        npba.pba_bus = 0;
        npba.pba_bridgetag = NULL;
-       npba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
+       npba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY;
 
        /*
         * Hose 0 has the STDIO module.
Index: sys/arch/amd64/amd64/mainbus.c
===================================================================
RCS file: /cvsroot/src/sys/arch/amd64/amd64/mainbus.c,v
retrieving revision 1.32
diff -u -p -r1.32 mainbus.c
--- sys/arch/amd64/amd64/mainbus.c      22 Feb 2011 07:12:29 -0000      1.32
+++ sys/arch/amd64/amd64/mainbus.c      8 Apr 2011 14:43:40 -0000
@@ -237,7 +237,7 @@ mainbus_attach(device_t parent, device_t
                mba.mba_acpi.aa_memt = x86_bus_space_mem;
                mba.mba_acpi.aa_pc = NULL;
                mba.mba_acpi.aa_pciflags =
-                   PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED |
+                   PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY |
                    PCI_FLAGS_MRL_OKAY | PCI_FLAGS_MRM_OKAY |
                    PCI_FLAGS_MWI_OKAY;
                mba.mba_acpi.aa_ic = &x86_isa_chipset;
Index: sys/arch/arc/pci/necpb.c
===================================================================
RCS file: /cvsroot/src/sys/arch/arc/pci/necpb.c,v
retrieving revision 1.35
diff -u -p -r1.35 necpb.c
--- sys/arch/arc/pci/necpb.c    4 Apr 2011 20:37:45 -0000       1.35
+++ sys/arch/arc/pci/necpb.c    8 Apr 2011 14:43:40 -0000
@@ -262,7 +262,7 @@ necpbattach(device_t parent, device_t se
        pba.pba_dmat = &sc->sc_ncp->nc_dmat;
        pba.pba_dmat64 = NULL;
        pba.pba_pc = pc;
-       pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
+       pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY;
        pba.pba_bus = 0;
        pba.pba_bridgetag = NULL;
 
Index: sys/arch/arm/footbridge/footbridge.c
===================================================================
RCS file: /cvsroot/src/sys/arch/arm/footbridge/footbridge.c,v
retrieving revision 1.23
diff -u -p -r1.23 footbridge.c
--- sys/arch/arm/footbridge/footbridge.c        18 Nov 2010 18:01:20 -0000      
1.23
+++ sys/arch/arm/footbridge/footbridge.c        8 Apr 2011 14:43:40 -0000
@@ -241,7 +241,7 @@ footbridge_attach(device_t parent, devic
        fba.fba_pba.pba_memt = &footbridge_pci_mem_bs_tag;
        fba.fba_pba.pba_dmat = &footbridge_pci_bus_dma_tag;
        fba.fba_pba.pba_dmat64 = NULL;
-       fba.fba_pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
+       fba.fba_pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY;
        fba.fba_pba.pba_bus = 0;
        fba.fba_pba.pba_bridgetag = NULL;
        config_found_ia(self, "pcibus", &fba.fba_pba, pcibusprint);
Index: sys/arch/arm/gemini/gemini_obio.c
===================================================================
RCS file: /cvsroot/src/sys/arch/arm/gemini/gemini_obio.c,v
retrieving revision 1.8
diff -u -p -r1.8 gemini_obio.c
--- sys/arch/arm/gemini/gemini_obio.c   5 Jan 2010 13:14:56 -0000       1.8
+++ sys/arch/arm/gemini/gemini_obio.c   8 Apr 2011 14:43:40 -0000
@@ -219,7 +219,7 @@ obio_attach(device_t parent, device_t se
        pba.pba_bridgetag = NULL;
        pba.pba_intrswiz = 0;
        pba.pba_intrtag = 0;
-       pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED |
+       pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY |
            PCI_FLAGS_MRL_OKAY | PCI_FLAGS_MRM_OKAY | PCI_FLAGS_MWI_OKAY;
 
        (void) config_found_ia(sc->sc_dev, "pcibus", &pba, pcibusprint);
Index: sys/arch/arm/ixp12x0/ixp12x0.c
===================================================================
RCS file: /cvsroot/src/sys/arch/arm/ixp12x0/ixp12x0.c,v
retrieving revision 1.16
diff -u -p -r1.16 ixp12x0.c
--- sys/arch/arm/ixp12x0/ixp12x0.c      21 Oct 2009 14:15:50 -0000      1.16
+++ sys/arch/arm/ixp12x0/ixp12x0.c      8 Apr 2011 14:43:40 -0000
@@ -174,7 +174,7 @@ ixp12x0_attach(struct ixp12x0_softc *sc)
        pba.pba_bus = 0;        /* bus number = 0 */
        pba.pba_intrswiz = 0;   /* XXX */
        pba.pba_intrtag = 0;
-       pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED |
+       pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY |
                PCI_FLAGS_MRL_OKAY | PCI_FLAGS_MRM_OKAY | PCI_FLAGS_MWI_OKAY;
        (void) config_found_ia(&sc->sc_dev, "pcibus", &pba, pcibusprint);
 }
Index: sys/arch/arm/s3c2xx0/s3c2800_pci.c
===================================================================
RCS file: /cvsroot/src/sys/arch/arm/s3c2xx0/s3c2800_pci.c,v
retrieving revision 1.14
diff -u -p -r1.14 s3c2800_pci.c
--- sys/arch/arm/s3c2xx0/s3c2800_pci.c  4 Apr 2011 20:37:46 -0000       1.14
+++ sys/arch/arm/s3c2xx0/s3c2800_pci.c  8 Apr 2011 14:43:41 -0000
@@ -325,7 +325,7 @@ sspci_attach(struct device *parent, stru
        pci_pba.pba_memt = &sspci_mem_tag;
        pci_pba.pba_dmat = pci_dma_tag;
        pci_pba.pba_dmat64 = NULL;
-       pci_pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
+       pci_pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY;
        pci_pba.pba_bus = 0;
        pci_pba.pba_bridgetag = NULL;
 
Index: sys/arch/arm/xscale/becc.c
===================================================================
RCS file: /cvsroot/src/sys/arch/arm/xscale/becc.c,v
retrieving revision 1.12
diff -u -p -r1.12 becc.c
--- sys/arch/arm/xscale/becc.c  24 Dec 2005 20:06:52 -0000      1.12
+++ sys/arch/arm/xscale/becc.c  8 Apr 2011 14:43:41 -0000
@@ -208,7 +208,7 @@ becc_attach(struct becc_softc *sc)
        pba.pba_bridgetag = NULL;
        pba.pba_intrswiz = 0;
        pba.pba_intrtag = 0;
-       pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED |
+       pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY |
            PCI_FLAGS_MRL_OKAY | PCI_FLAGS_MRM_OKAY | PCI_FLAGS_MWI_OKAY;
        (void) config_found_ia(&sc->sc_dev, "pcibus", &pba, pcibusprint);
 }
Index: sys/arch/arm/xscale/i80312.c
===================================================================
RCS file: /cvsroot/src/sys/arch/arm/xscale/i80312.c,v
retrieving revision 1.19
diff -u -p -r1.19 i80312.c
--- sys/arch/arm/xscale/i80312.c        25 Feb 2006 02:28:56 -0000      1.19
+++ sys/arch/arm/xscale/i80312.c        8 Apr 2011 14:43:41 -0000
@@ -317,7 +317,7 @@ i80312_attach(struct i80312_softc *sc)
        pba.pba_intrswiz = 3;
        pba.pba_intrtag = 0;
        /* XXX MRL/MRM/MWI seem to have problems, at the moment. */
-       pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED /* |
+       pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY /* |
            PCI_FLAGS_MRL_OKAY | PCI_FLAGS_MRM_OKAY | PCI_FLAGS_MWI_OKAY */;
        (void) config_found_ia(&sc->sc_dev, "pcibus", &pba, pcibusprint);
 }
Index: sys/arch/arm/xscale/i80321.c
===================================================================
RCS file: /cvsroot/src/sys/arch/arm/xscale/i80321.c,v
retrieving revision 1.20
diff -u -p -r1.20 i80321.c
--- sys/arch/arm/xscale/i80321.c        17 Oct 2007 19:53:43 -0000      1.20
+++ sys/arch/arm/xscale/i80321.c        8 Apr 2011 14:43:41 -0000
@@ -286,7 +286,7 @@ i80321_attach(struct i80321_softc *sc)
        pba.pba_bridgetag = NULL;
        pba.pba_intrswiz = 0;   /* XXX what if busno != 0? */
        pba.pba_intrtag = 0;
-       pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED |
+       pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY |
            PCI_FLAGS_MRL_OKAY | PCI_FLAGS_MRM_OKAY | PCI_FLAGS_MWI_OKAY;
        (void) config_found_ia(&sc->sc_dev, "pcibus", &pba, pcibusprint);
 }
Index: sys/arch/arm/xscale/ixp425.c
===================================================================
RCS file: /cvsroot/src/sys/arch/arm/xscale/ixp425.c,v
retrieving revision 1.13
diff -u -p -r1.13 ixp425.c
--- sys/arch/arm/xscale/ixp425.c        21 Oct 2009 14:15:50 -0000      1.13
+++ sys/arch/arm/xscale/ixp425.c        8 Apr 2011 14:43:41 -0000
@@ -103,7 +103,7 @@ ixp425_attach(struct ixp425_softc *sc)
        pba.pba_bridgetag = NULL;
        pba.pba_intrswiz = 0;   /* XXX */
        pba.pba_intrtag = 0;
-       pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED |
+       pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY |
                        PCI_FLAGS_MRL_OKAY   | PCI_FLAGS_MRM_OKAY |
                        PCI_FLAGS_MWI_OKAY;
        (void) config_found_ia(&sc->sc_dev, "pcibus", &pba, pcibusprint);
Index: sys/arch/atari/pci/pci_machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/atari/pci/pci_machdep.c,v
retrieving revision 1.49
diff -u -p -r1.49 pci_machdep.c
--- sys/arch/atari/pci/pci_machdep.c    4 Apr 2011 20:37:46 -0000       1.49
+++ sys/arch/atari/pci/pci_machdep.c    8 Apr 2011 14:43:41 -0000
@@ -169,7 +169,7 @@ pcibusattach(struct device *pdp, struct 
        pba.pba_pc      = NULL;
        pba.pba_bus     = 0;
        pba.pba_bridgetag = NULL;
-       pba.pba_flags   = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
+       pba.pba_flags   = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY;
        pba.pba_dmat    = &pci_bus_dma_tag;
        pba.pba_iot     = leb_alloc_bus_space_tag(&bs_storage[0]);
        pba.pba_memt    = leb_alloc_bus_space_tag(&bs_storage[1]);
Index: sys/arch/bebox/bebox/mainbus.c
===================================================================
RCS file: /cvsroot/src/sys/arch/bebox/bebox/mainbus.c,v
retrieving revision 1.24
diff -u -p -r1.24 mainbus.c
--- sys/arch/bebox/bebox/mainbus.c      18 Mar 2009 16:00:10 -0000      1.24
+++ sys/arch/bebox/bebox/mainbus.c      8 Apr 2011 14:43:41 -0000
@@ -153,7 +153,7 @@ mainbus_attach(struct device *parent, st
        mba.mba_pba.pba_pc = genppc_pct;
        mba.mba_pba.pba_bus = 0;
        mba.mba_pba.pba_bridgetag = NULL;
-       mba.mba_pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
+       mba.mba_pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY;
        config_found_ia(self, "pcibus", &mba.mba_pba, pcibusprint);
 #endif /* NPCI */
 
Index: sys/arch/cobalt/dev/gt.c
===================================================================
RCS file: /cvsroot/src/sys/arch/cobalt/dev/gt.c,v
retrieving revision 1.23
diff -u -p -r1.23 gt.c
--- sys/arch/cobalt/dev/gt.c    20 Feb 2011 07:54:11 -0000      1.23
+++ sys/arch/cobalt/dev/gt.c    8 Apr 2011 14:43:41 -0000
@@ -135,10 +135,9 @@ gt_attach(device_t parent, device_t self
 #endif
        pba.pba_dmat = &pci_bus_dma_tag;
        pba.pba_dmat64 = NULL;
-       pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
        pba.pba_bus = 0;
        pba.pba_bridgetag = NULL;
-       pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED |
+       pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY |
                PCI_FLAGS_MRL_OKAY | /*PCI_FLAGS_MRM_OKAY|*/ PCI_FLAGS_MWI_OKAY;
        pba.pba_pc = pc;
        config_found_ia(self, "pcibus", &pba, gt_print);
Index: sys/arch/dreamcast/dev/g2/gapspci.c
===================================================================
RCS file: /cvsroot/src/sys/arch/dreamcast/dev/g2/gapspci.c,v
retrieving revision 1.17
diff -u -p -r1.17 gapspci.c
--- sys/arch/dreamcast/dev/g2/gapspci.c 21 Nov 2010 16:11:32 -0000      1.17
+++ sys/arch/dreamcast/dev/g2/gapspci.c 8 Apr 2011 14:43:41 -0000
@@ -126,7 +126,7 @@ gaps_attach(device_t parent, device_t se
        pba.pba_dmat64 = NULL;
        pba.pba_bus = 0;
        pba.pba_bridgetag = NULL;
-       pba.pba_flags = PCI_FLAGS_MEM_ENABLED;
+       pba.pba_flags = PCI_FLAGS_MEM_OKAY;
        pba.pba_pc = &sc->sc_pc;
 
        (void)config_found_ia(self, "pcibus", &pba, pcibusprint);
Index: sys/arch/evbarm/ifpga/ifpga.c
===================================================================
RCS file: /cvsroot/src/sys/arch/evbarm/ifpga/ifpga.c,v
retrieving revision 1.23
diff -u -p -r1.23 ifpga.c
--- sys/arch/evbarm/ifpga/ifpga.c       21 Jul 2009 16:04:16 -0000      1.23
+++ sys/arch/evbarm/ifpga/ifpga.c       8 Apr 2011 14:43:41 -0000
@@ -325,7 +325,7 @@ ifpga_attach(device_t parent, device_t s
        pci_pba.pba_memt = &ifpga_pci_mem_tag;
        pci_pba.pba_dmat = &ifpga_pci_bus_dma_tag;
        pci_pba.pba_dmat64 = NULL;
-       pci_pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
+       pci_pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY;
        pci_pba.pba_bus = 0;
        pci_pba.pba_bridgetag = NULL;
        
Index: sys/arch/evbmips/gdium/bonito_mainbus.c
===================================================================
RCS file: /cvsroot/src/sys/arch/evbmips/gdium/bonito_mainbus.c,v
retrieving revision 1.1
diff -u -p -r1.1 bonito_mainbus.c
--- sys/arch/evbmips/gdium/bonito_mainbus.c     6 Aug 2009 00:50:25 -0000       
1.1
+++ sys/arch/evbmips/gdium/bonito_mainbus.c     8 Apr 2011 14:43:41 -0000
@@ -82,7 +82,7 @@ bonito_mainbus_attach(device_t parent, d
            BONITO_REV_FPGA(rev) ? "FPGA" : "ASIC",
            BONITO_REV_MAJOR(rev), BONITO_REV_MINOR(rev));
 
-       pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
+       pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY;
        pba.pba_bus = 0;
        pba.pba_bridgetag = NULL;
 
Index: sys/arch/evbmips/malta/dev/gt.c
===================================================================
RCS file: /cvsroot/src/sys/arch/evbmips/malta/dev/gt.c,v
retrieving revision 1.11
diff -u -p -r1.11 gt.c
--- sys/arch/evbmips/malta/dev/gt.c     14 Mar 2009 15:36:06 -0000      1.11
+++ sys/arch/evbmips/malta/dev/gt.c     8 Apr 2011 14:43:41 -0000
@@ -109,7 +109,7 @@ gt_attach(struct device *parent, struct 
        printf("\n");
 
 #if NPCI > 0
-       pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
+       pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY;
        pba.pba_bus = 0;
        pba.pba_bridgetag = NULL;
        pba.pba_iot = &mcp->mc_iot;
Index: sys/arch/evbppc/walnut/pci/pchb.c
===================================================================
RCS file: /cvsroot/src/sys/arch/evbppc/walnut/pci/pchb.c,v
retrieving revision 1.8
diff -u -p -r1.8 pchb.c
--- sys/arch/evbppc/walnut/pci/pchb.c   3 May 2008 23:19:17 -0000       1.8
+++ sys/arch/evbppc/walnut/pci/pchb.c   8 Apr 2011 14:43:41 -0000
@@ -183,7 +183,7 @@ pchbattach(struct device *parent, struct
        pba.pba_dmat64 = NULL;
        pba.pba_bus = 0;
        pba.pba_bridgetag = NULL;
-       pba.pba_flags = PCI_FLAGS_MEM_ENABLED | PCI_FLAGS_IO_ENABLED;
+       pba.pba_flags = PCI_FLAGS_MEM_OKAY | PCI_FLAGS_IO_OKAY;
        config_found_ia(self, "pcibus", &pba, pchbprint);
 }
 
Index: sys/arch/hp700/dev/dino.c
===================================================================
RCS file: /cvsroot/src/sys/arch/hp700/dev/dino.c,v
retrieving revision 1.31
diff -u -p -r1.31 dino.c
--- sys/arch/hp700/dev/dino.c   4 Apr 2011 20:37:50 -0000       1.31
+++ sys/arch/hp700/dev/dino.c   8 Apr 2011 14:43:42 -0000
@@ -1729,7 +1729,7 @@ dinoattach(device_t parent, device_t sel
        pba.pba_dmat = &sc->sc_dmatag;
        pba.pba_pc = &sc->sc_pc;
        pba.pba_bus = 0;
-       pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
+       pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY;
        config_found_ia(self, "pcibus", &pba, pcibusprint);
 }
 
Index: sys/arch/hp700/dev/elroy.c
===================================================================
RCS file: /cvsroot/src/sys/arch/hp700/dev/elroy.c,v
retrieving revision 1.10
diff -u -p -r1.10 elroy.c
--- sys/arch/hp700/dev/elroy.c  8 Nov 2010 23:10:24 -0000       1.10
+++ sys/arch/hp700/dev/elroy.c  8 Apr 2011 14:43:42 -0000
@@ -1305,7 +1305,7 @@ le64toh(r->eio_base), le64toh(r->eio_mas
        pba.pba_dmat = &sc->sc_dmatag;
        pba.pba_pc = &sc->sc_pc;
        pba.pba_bus = 0; /* (le32toh(elroy_read32(&r->busnum)) & 0xff) >> 4; */
-       pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
+       pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY;
 
        config_found_ia(self, "pcibus", &pba, pcibusprint);
 }
Index: sys/arch/hpcmips/vr/vrc4172pci.c
===================================================================
RCS file: /cvsroot/src/sys/arch/hpcmips/vr/vrc4172pci.c,v
retrieving revision 1.13
diff -u -p -r1.13 vrc4172pci.c
--- sys/arch/hpcmips/vr/vrc4172pci.c    11 Dec 2005 12:17:34 -0000      1.13
+++ sys/arch/hpcmips/vr/vrc4172pci.c    8 Apr 2011 14:43:42 -0000
@@ -200,7 +200,7 @@ vrc4172pci_attach(struct device *parent,
        pba.pba_dmat64 = NULL;
        pba.pba_bus = 0;
        pba.pba_bridgetag = NULL;
-       pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED |
+       pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY |
            PCI_FLAGS_MRL_OKAY;
        pba.pba_pc = pc;
 
Index: sys/arch/hpcmips/vr/vrpciu.c
===================================================================
RCS file: /cvsroot/src/sys/arch/hpcmips/vr/vrpciu.c,v
retrieving revision 1.17
diff -u -p -r1.17 vrpciu.c
--- sys/arch/hpcmips/vr/vrpciu.c        11 Dec 2005 12:17:35 -0000      1.17
+++ sys/arch/hpcmips/vr/vrpciu.c        8 Apr 2011 14:43:42 -0000
@@ -318,7 +318,7 @@ vrpciu_attach(struct device *parent, str
                               0x11200000);
        }
 
-       pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED |
+       pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY |
            PCI_FLAGS_MRL_OKAY;
        pba.pba_pc = pc;
 
Index: sys/arch/i386/i386/mainbus.c
===================================================================
RCS file: /cvsroot/src/sys/arch/i386/i386/mainbus.c,v
retrieving revision 1.90
diff -u -p -r1.90 mainbus.c
--- sys/arch/i386/i386/mainbus.c        28 Apr 2010 19:17:03 -0000      1.90
+++ sys/arch/i386/i386/mainbus.c        8 Apr 2011 14:43:42 -0000
@@ -346,7 +346,7 @@ mainbus_rescan(device_t self, const char
                mba.mba_acpi.aa_memt = x86_bus_space_mem;
                mba.mba_acpi.aa_pc = NULL;
                mba.mba_acpi.aa_pciflags =
-                   PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED |
+                   PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY |
                    PCI_FLAGS_MRL_OKAY | PCI_FLAGS_MRM_OKAY |
                    PCI_FLAGS_MWI_OKAY;
                mba.mba_acpi.aa_ic = &x86_isa_chipset;
Index: sys/arch/ia64/ia64/mainbus.c
===================================================================
RCS file: /cvsroot/src/sys/arch/ia64/ia64/mainbus.c,v
retrieving revision 1.8
diff -u -p -r1.8 mainbus.c
--- sys/arch/ia64/ia64/mainbus.c        17 May 2010 11:46:19 -0000      1.8
+++ sys/arch/ia64/ia64/mainbus.c        8 Apr 2011 14:43:42 -0000
@@ -120,7 +120,7 @@ mainbus_attach(device_t parent, device_t
        aaa.aa_memt = IA64_BUS_SPACE_MEM;
        aaa.aa_pc = 0;
        aaa.aa_pciflags =
-           PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED |
+           PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY |
            PCI_FLAGS_MRL_OKAY | PCI_FLAGS_MRM_OKAY |
            PCI_FLAGS_MWI_OKAY;
        aaa.aa_ic = 0;
Index: sys/arch/ibmnws/ibmnws/mainbus.c
===================================================================
RCS file: /cvsroot/src/sys/arch/ibmnws/ibmnws/mainbus.c,v
retrieving revision 1.8
diff -u -p -r1.8 mainbus.c
--- sys/arch/ibmnws/ibmnws/mainbus.c    18 Mar 2009 16:00:13 -0000      1.8
+++ sys/arch/ibmnws/ibmnws/mainbus.c    8 Apr 2011 14:43:42 -0000
@@ -143,7 +143,7 @@ mainbus_attach(device_t parent, device_t
        mba.mba_pba.pba_pc = genppc_pct;
        mba.mba_pba.pba_bus = 0;
        mba.mba_pba.pba_bridgetag = NULL;
-       mba.mba_pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
+       mba.mba_pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY;
        config_found_ia(self, "pcibus", &mba.mba_pba, pcibusprint);
 #endif
 
Index: sys/arch/macppc/pci/bandit.c
===================================================================
RCS file: /cvsroot/src/sys/arch/macppc/pci/bandit.c,v
retrieving revision 1.26
diff -u -p -r1.26 bandit.c
--- sys/arch/macppc/pci/bandit.c        17 Oct 2007 19:55:34 -0000      1.26
+++ sys/arch/macppc/pci/bandit.c        8 Apr 2011 14:43:42 -0000
@@ -142,7 +142,7 @@ bandit_attach(struct device *parent, str
        pba.pba_bus = pc->pc_bus;
        pba.pba_bridgetag = NULL;
        pba.pba_pc = pc;
-       pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
+       pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY;
 
        config_found_ia(self, "pcibus", &pba, pcibusprint);
 }
Index: sys/arch/macppc/pci/grackle.c
===================================================================
RCS file: /cvsroot/src/sys/arch/macppc/pci/grackle.c,v
retrieving revision 1.11
diff -u -p -r1.11 grackle.c
--- sys/arch/macppc/pci/grackle.c       17 Oct 2007 19:55:34 -0000      1.11
+++ sys/arch/macppc/pci/grackle.c       8 Apr 2011 14:43:42 -0000
@@ -142,7 +142,7 @@ grackle_attach(struct device *parent, st
        pba.pba_bus = pc->pc_bus;
        pba.pba_bridgetag = NULL;
        pba.pba_pc = pc;
-       pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
+       pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY;
 
        config_found_ia(self, "pcibus", &pba, pcibusprint);
 }
Index: sys/arch/macppc/pci/u3.c
===================================================================
RCS file: /cvsroot/src/sys/arch/macppc/pci/u3.c,v
retrieving revision 1.2
diff -u -p -r1.2 u3.c
--- sys/arch/macppc/pci/u3.c    17 Oct 2007 19:55:35 -0000      1.2
+++ sys/arch/macppc/pci/u3.c    8 Apr 2011 14:43:42 -0000
@@ -152,7 +152,7 @@ ibmcpc_attach(struct device *parent, str
                pba.pba_bridgetag = NULL;
                pba.pba_pc = pc;
                pba.pba_bus = pc->pc_bus;
-               pba.pba_flags = PCI_FLAGS_MEM_ENABLED | PCI_FLAGS_IO_ENABLED;
+               pba.pba_flags = PCI_FLAGS_MEM_OKAY | PCI_FLAGS_IO_OKAY;
                config_found_ia(self, "pcibus", &pba, pcibusprint);
 
                pc++;
Index: sys/arch/macppc/pci/uninorth.c
===================================================================
RCS file: /cvsroot/src/sys/arch/macppc/pci/uninorth.c,v
retrieving revision 1.12
diff -u -p -r1.12 uninorth.c
--- sys/arch/macppc/pci/uninorth.c      17 Oct 2007 19:55:35 -0000      1.12
+++ sys/arch/macppc/pci/uninorth.c      8 Apr 2011 14:43:42 -0000
@@ -154,7 +154,7 @@ uninorth_attach(struct device *parent, s
        pba.pba_bus = pc->pc_bus;
        pba.pba_bridgetag = NULL;
        pba.pba_pc = pc;
-       pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
+       pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY;
 
        config_found_ia(self, "pcibus", &pba, pcibusprint);
 }
Index: sys/arch/mips/adm5120/dev/admpci.c
===================================================================
RCS file: /cvsroot/src/sys/arch/mips/adm5120/dev/admpci.c,v
retrieving revision 1.5
diff -u -p -r1.5 admpci.c
--- sys/arch/mips/adm5120/dev/admpci.c  4 Apr 2011 20:37:51 -0000       1.5
+++ sys/arch/mips/adm5120/dev/admpci.c  8 Apr 2011 14:43:43 -0000
@@ -260,7 +260,7 @@ admpciattach(struct device *parent, stru
        pba.pba_dmat = ma->ma_dmat;
        pba.pba_dmat64 = NULL;
        pba.pba_pc = &sc->sc_pc;
-       pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
+       pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY;
        pba.pba_bus = 0;
        pba.pba_bridgetag = NULL;
 
Index: sys/arch/mips/alchemy/dev/aupci.c
===================================================================
RCS file: /cvsroot/src/sys/arch/mips/alchemy/dev/aupci.c,v
retrieving revision 1.9
diff -u -p -r1.9 aupci.c
--- sys/arch/mips/alchemy/dev/aupci.c   20 Feb 2011 07:48:36 -0000      1.9
+++ sys/arch/mips/alchemy/dev/aupci.c   8 Apr 2011 14:43:43 -0000
@@ -281,7 +281,7 @@ aupciattach(struct device *parent, struc
        pba.pba_dmat = aa->aa_dt;
        pba.pba_dmat64 = NULL;
        pba.pba_pc = &sc->sc_pc;
-       pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
+       pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY;
        pba.pba_bus = 0;
        pba.pba_bridgetag = NULL;
 
Index: sys/arch/mips/rmi/rmixl_pcie.c
===================================================================
RCS file: /cvsroot/src/sys/arch/mips/rmi/rmixl_pcie.c,v
retrieving revision 1.4
diff -u -p -r1.4 rmixl_pcie.c
--- sys/arch/mips/rmi/rmixl_pcie.c      4 Apr 2011 20:37:52 -0000       1.4
+++ sys/arch/mips/rmi/rmixl_pcie.c      8 Apr 2011 14:43:43 -0000
@@ -395,7 +395,7 @@ rmixl_pcie_attach(device_t parent, devic
        pba.pba_bridgetag = NULL;
        pba.pba_intrswiz = 0;
        pba.pba_intrtag = 0;
-       pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED |
+       pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY |
                PCI_FLAGS_MRL_OKAY | PCI_FLAGS_MRM_OKAY | PCI_FLAGS_MWI_OKAY;
 
        (void) config_found_ia(self, "pcibus", &pba, pcibusprint);
Index: sys/arch/mips/rmi/rmixl_pcix.c
===================================================================
RCS file: /cvsroot/src/sys/arch/mips/rmi/rmixl_pcix.c,v
retrieving revision 1.3
diff -u -p -r1.3 rmixl_pcix.c
--- sys/arch/mips/rmi/rmixl_pcix.c      4 Apr 2011 20:37:52 -0000       1.3
+++ sys/arch/mips/rmi/rmixl_pcix.c      8 Apr 2011 14:43:43 -0000
@@ -468,7 +468,7 @@ rmixl_pcix_attach(device_t parent, devic
        pba.pba_bridgetag = NULL;
        pba.pba_intrswiz = 0;
        pba.pba_intrtag = 0;
-       pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED |
+       pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY |
                PCI_FLAGS_MRL_OKAY | PCI_FLAGS_MRM_OKAY | PCI_FLAGS_MWI_OKAY;
 
        (void) config_found_ia(self, "pcibus", &pba, pcibusprint);
Index: sys/arch/mips/sibyte/pci/sbbrz.c
===================================================================
RCS file: /cvsroot/src/sys/arch/mips/sibyte/pci/sbbrz.c,v
retrieving revision 1.2
diff -u -p -r1.2 sbbrz.c
--- sys/arch/mips/sibyte/pci/sbbrz.c    17 Feb 2011 14:24:12 -0000      1.2
+++ sys/arch/mips/sibyte/pci/sbbrz.c    8 Apr 2011 14:43:43 -0000
@@ -199,7 +199,7 @@ sbbrz_attach(device_t parent, device_t s
        pba.pba_pc = &sc->sc_pc;
        pba.pba_bus = 0;
        pba.pba_bridgetag = NULL;
-       pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED |
+       pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY |
            PCI_FLAGS_MRL_OKAY | PCI_FLAGS_MRM_OKAY | PCI_FLAGS_MWI_OKAY;
        config_found(self, &pba, sbbrz_print);
 }
Index: sys/arch/mvmeppc/mvmeppc/mainbus.c
===================================================================
RCS file: /cvsroot/src/sys/arch/mvmeppc/mvmeppc/mainbus.c,v
retrieving revision 1.11
diff -u -p -r1.11 mainbus.c
--- sys/arch/mvmeppc/mvmeppc/mainbus.c  14 Mar 2009 15:36:11 -0000      1.11
+++ sys/arch/mvmeppc/mvmeppc/mainbus.c  8 Apr 2011 14:43:43 -0000
@@ -136,7 +136,7 @@ mainbus_attach(struct device *parent, st
        pba.pba_pc = genppc_pct;
        pba.pba_bus = 0;
        pba.pba_bridgetag = NULL;
-       pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
+       pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY;
        config_found_ia(self, "pcibus", &pba, pcibusprint);
 #endif
 }
Index: sys/arch/ofppc/pci/ofwpci.c
===================================================================
RCS file: /cvsroot/src/sys/arch/ofppc/pci/ofwpci.c,v
retrieving revision 1.8
diff -u -p -r1.8 ofwpci.c
--- sys/arch/ofppc/pci/ofwpci.c 28 Apr 2008 20:23:31 -0000      1.8
+++ sys/arch/ofppc/pci/ofwpci.c 8 Apr 2011 14:43:43 -0000
@@ -218,6 +218,6 @@ ofwpci_attach(struct device *parent, str
        pba.pba_bus = pc->pc_bus;
        pba.pba_bridgetag = NULL;
        pba.pba_pc = pc;
-       pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
+       pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY;
        config_found_ia(self, "pcibus", &pba, pcibusprint);
 }
Index: sys/arch/powerpc/booke/pci/pq3pci.c
===================================================================
RCS file: /cvsroot/src/sys/arch/powerpc/booke/pci/pq3pci.c,v
retrieving revision 1.5
diff -u -p -r1.5 pq3pci.c
--- sys/arch/powerpc/booke/pci/pq3pci.c 4 Apr 2011 20:37:52 -0000       1.5
+++ sys/arch/powerpc/booke/pci/pq3pci.c 8 Apr 2011 14:43:44 -0000
@@ -413,7 +413,7 @@ pq3pci_owin_setup(struct pq3pci_softc *s
        }
        aprint_debug_dev(sc->sc_dev, "bus space %s created\n", bs->bs_name);
        sc->sc_pba_flags |=
-           io_win ? PCI_FLAGS_IO_ENABLED : PCI_FLAGS_MEM_ENABLED;
+           io_win ? PCI_FLAGS_IO_OKAY : PCI_FLAGS_MEM_OKAY;
        return true;
 }
 
@@ -874,9 +874,9 @@ pq3pci_cpunode_attach(device_t parent, d
 
        pba.pba_flags = sc->sc_pba_flags | PCI_FLAGS_MSI_OKAY
            | PCI_FLAGS_MSIX_OKAY;
-       if (pba.pba_flags & PCI_FLAGS_IO_ENABLED)
+       if (pba.pba_flags & PCI_FLAGS_IO_OKAY)
                pba.pba_iot = pc->pc_iot;
-       if (pba.pba_flags & PCI_FLAGS_MEM_ENABLED)
+       if (pba.pba_flags & PCI_FLAGS_MEM_OKAY)
                pba.pba_memt = pc->pc_memt;
        pba.pba_dmat = cna->cna_dmat;
        pba.pba_pc = pc;
Index: sys/arch/powerpc/ibm4xx/pci/pchb.c
===================================================================
RCS file: /cvsroot/src/sys/arch/powerpc/ibm4xx/pci/pchb.c,v
retrieving revision 1.6
diff -u -p -r1.6 pchb.c
--- sys/arch/powerpc/ibm4xx/pci/pchb.c  4 May 2008 00:08:45 -0000       1.6
+++ sys/arch/powerpc/ibm4xx/pci/pchb.c  8 Apr 2011 14:43:44 -0000
@@ -179,7 +179,7 @@ pchbattach(struct device *parent, struct
        pba.pba_pc = pc;
        pba.pba_bus = 0;
        pba.pba_bridgetag = NULL;
-       pba.pba_flags = PCI_FLAGS_MEM_ENABLED | PCI_FLAGS_IO_ENABLED;
+       pba.pba_flags = PCI_FLAGS_MEM_OKAY | PCI_FLAGS_IO_OKAY;
        config_found_ia(self, "pcibus", &pba, pchbprint);
 }
 
Index: sys/arch/prep/prep/mainbus.c
===================================================================
RCS file: /cvsroot/src/sys/arch/prep/prep/mainbus.c,v
retrieving revision 1.29
diff -u -p -r1.29 mainbus.c
--- sys/arch/prep/prep/mainbus.c        18 Mar 2009 16:00:14 -0000      1.29
+++ sys/arch/prep/prep/mainbus.c        8 Apr 2011 14:43:44 -0000
@@ -176,7 +176,7 @@ mainbus_attach(struct device *parent, st
        mba.mba_pba.pba_pc = genppc_pct;
        mba.mba_pba.pba_bus = 0;
        mba.mba_pba.pba_bridgetag = NULL;
-       mba.mba_pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
+       mba.mba_pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY;
        config_found_ia(self, "pcibus", &mba.mba_pba, pcibusprint);
 #endif /* NPCI */
 
Index: sys/arch/sandpoint/sandpoint/mainbus.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sandpoint/sandpoint/mainbus.c,v
retrieving revision 1.21
diff -u -p -r1.21 mainbus.c
--- sys/arch/sandpoint/sandpoint/mainbus.c      14 Mar 2009 21:04:15 -0000      
1.21
+++ sys/arch/sandpoint/sandpoint/mainbus.c      8 Apr 2011 14:43:44 -0000
@@ -116,7 +116,7 @@ mainbus_attach(struct device *parent, st
        pba.pba_bus = 0;
        pba.pba_pc = 0;
        pba.pba_bridgetag = NULL;
-       pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
+       pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY;
 
        config_found_ia(self, "pcibus", &pba, pcibusprint);
 #endif
Index: sys/arch/sgimips/gio/pci_gio.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sgimips/gio/pci_gio.c,v
retrieving revision 1.6
diff -u -p -r1.6 pci_gio.c
--- sys/arch/sgimips/gio/pci_gio.c      20 Feb 2011 07:59:50 -0000      1.6
+++ sys/arch/sgimips/gio/pci_gio.c      8 Apr 2011 14:43:44 -0000
@@ -222,7 +222,7 @@ giopci_attach(struct device *parent, str
        pba.pba_memt    = SGIMIPS_BUS_SPACE_MEM;
        pba.pba_dmat    = ga->ga_dmat;
        pba.pba_pc      = pc;
-       pba.pba_flags   = PCI_FLAGS_MEM_ENABLED;
+       pba.pba_flags   = PCI_FLAGS_MEM_OKAY;
        /* NB: do not set PCI_FLAGS_{MRL,MRM,MWI}_OKAY  -- true ?! */
 
        config_found_ia(self, "pcibus", &pba, pcibusprint);
Index: sys/arch/sgimips/mace/pci_mace.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sgimips/mace/pci_mace.c,v
retrieving revision 1.10
diff -u -p -r1.10 pci_mace.c
--- sys/arch/sgimips/mace/pci_mace.c    20 Feb 2011 07:59:51 -0000      1.10
+++ sys/arch/sgimips/mace/pci_mace.c    8 Apr 2011 14:43:44 -0000
@@ -157,13 +157,13 @@ macepci_attach(struct device *parent, st
        pba.pba_dmat64 = NULL;
        pba.pba_bus = 0;
        pba.pba_bridgetag = NULL;
-       pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED |
+       pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY |
            PCI_FLAGS_MRL_OKAY | PCI_FLAGS_MRM_OKAY | PCI_FLAGS_MWI_OKAY;
        pba.pba_pc = pc;
 
 #ifdef MACEPCI_IO_WAS_BUGGY
        if (rev == 0)
-               pba.pba_flags &= ~PCI_FLAGS_IO_ENABLED;         /* Buggy? */
+               pba.pba_flags &= ~PCI_FLAGS_IO_OKAY;            /* Buggy? */
 #endif
 
        cpu_intr_establish(maa->maa_intr, IPL_NONE, macepci_intr, sc);
Index: sys/arch/sh3/dev/shpcic.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sh3/dev/shpcic.c,v
retrieving revision 1.13
diff -u -p -r1.13 shpcic.c
--- sys/arch/sh3/dev/shpcic.c   2 Aug 2009 00:06:44 -0000       1.13
+++ sys/arch/sh3/dev/shpcic.c   8 Apr 2011 14:43:44 -0000
@@ -248,7 +248,7 @@ shpcic_attach(device_t parent, device_t 
        pba.pba_pc = NULL;
        pba.pba_bus = 0;
        pba.pba_bridgetag = NULL;
-       pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
+       pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY;
        config_found(self, &pba, NULL);
 }
 
Index: sys/arch/sparc/sparc/msiiep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sparc/sparc/msiiep.c,v
retrieving revision 1.39
diff -u -p -r1.39 msiiep.c
--- sys/arch/sparc/sparc/msiiep.c       3 Jan 2010 23:03:21 -0000       1.39
+++ sys/arch/sparc/sparc/msiiep.c       8 Apr 2011 14:43:44 -0000
@@ -352,7 +352,7 @@ mspcic_attach(struct device *parent, str
        pba.pba_dmat = sc->sc_dmat;
        pba.pba_dmat64 = NULL;
        pba.pba_pc = &mspcic_pc_tag;
-       pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
+       pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY;
 
        config_found_ia(self, "pcibus", &pba, mspcic_print);
 }
Index: sys/arch/sparc64/dev/psycho.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sparc64/dev/psycho.c,v
retrieving revision 1.105
diff -u -p -r1.105 psycho.c
--- sys/arch/sparc64/dev/psycho.c       4 Apr 2011 20:37:54 -0000       1.105
+++ sys/arch/sparc64/dev/psycho.c       8 Apr 2011 14:43:45 -0000
@@ -476,8 +476,8 @@ found:
        pp->pp_memt = psycho_alloc_mem_tag(pp);
        pp->pp_iot = psycho_alloc_io_tag(pp);
        pp->pp_dmat = psycho_alloc_dma_tag(pp);
-       pp->pp_flags = (pp->pp_memt ? PCI_FLAGS_MEM_ENABLED : 0) |
-                      (pp->pp_iot ? PCI_FLAGS_IO_ENABLED : 0);
+       pp->pp_flags = (pp->pp_memt ? PCI_FLAGS_MEM_OKAY : 0) |
+                      (pp->pp_iot ? PCI_FLAGS_IO_OKAY : 0);
 
        /* allocate a chipset for this */
        pp->pp_pc = psycho_alloc_chipset(pp, sc->sc_node, &_sparc_pci_chipset);
Index: sys/arch/sparc64/dev/pyro.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sparc64/dev/pyro.c,v
retrieving revision 1.4
diff -u -p -r1.4 pyro.c
--- sys/arch/sparc64/dev/pyro.c 4 Apr 2011 20:37:54 -0000       1.4
+++ sys/arch/sparc64/dev/pyro.c 8 Apr 2011 14:43:45 -0000
@@ -208,8 +208,8 @@ pyro_init(struct pyro_softc *sc, int bus
        pbm->pp_iot = pyro_alloc_io_tag(pbm);
        pbm->pp_cfgt = pyro_alloc_config_tag(pbm);
        pbm->pp_dmat = pyro_alloc_dma_tag(pbm);
-       pbm->pp_flags = (pbm->pp_memt ? PCI_FLAGS_MEM_ENABLED : 0) |
-                       (pbm->pp_iot ? PCI_FLAGS_IO_ENABLED : 0);
+       pbm->pp_flags = (pbm->pp_memt ? PCI_FLAGS_MEM_OKAY : 0) |
+                       (pbm->pp_iot ? PCI_FLAGS_IO_OKAY : 0);
 
        if (bus_space_map(pbm->pp_cfgt, 0, 0x10000000, 0, &pbm->pp_cfgh))
                panic("pyro: can't map config space");
Index: sys/arch/sparc64/dev/schizo.c
===================================================================
RCS file: /cvsroot/src/sys/arch/sparc64/dev/schizo.c,v
retrieving revision 1.19
diff -u -p -r1.19 schizo.c
--- sys/arch/sparc64/dev/schizo.c       4 Apr 2011 20:37:54 -0000       1.19
+++ sys/arch/sparc64/dev/schizo.c       8 Apr 2011 14:43:45 -0000
@@ -241,8 +241,8 @@ schizo_attach(struct device *parent, str
        pbm->sp_iot = schizo_alloc_io_tag(pbm);
        pbm->sp_cfgt = schizo_alloc_config_tag(pbm);
        pbm->sp_dmat = schizo_alloc_dma_tag(pbm);
-       pbm->sp_flags = (pbm->sp_memt ? PCI_FLAGS_MEM_ENABLED : 0) |
-                       (pbm->sp_iot ? PCI_FLAGS_IO_ENABLED : 0);
+       pbm->sp_flags = (pbm->sp_memt ? PCI_FLAGS_MEM_OKAY : 0) |
+                       (pbm->sp_iot ? PCI_FLAGS_IO_OKAY : 0);
 
        if (bus_space_map(pbm->sp_cfgt, 0, 0x1000000, 0, &pbm->sp_cfgh))
                panic("schizo: could not map config space");
Index: sys/arch/x86/pci/pchb.c
===================================================================
RCS file: /cvsroot/src/sys/arch/x86/pci/pchb.c,v
retrieving revision 1.24
diff -u -p -r1.24 pchb.c
--- sys/arch/x86/pci/pchb.c     24 Feb 2011 20:02:20 -0000      1.24
+++ sys/arch/x86/pci/pchb.c     8 Apr 2011 14:43:45 -0000
@@ -152,7 +152,7 @@ void
 pchbattach(device_t parent, device_t self, void *aux)
 {
        struct pchb_softc *sc = device_private(self);
-       struct pci_attach_args *pa = aux;
+       const struct pci_attach_args *pa = aux;
        char devinfo[256];
        struct pcibus_attach_args pba;
        struct agpbus_attach_args apa;
@@ -224,12 +224,12 @@ pchbattach(device_t parent, device_t sel
                case PCI_PRODUCT_SERVERWORKS_CIOB_X2:
                case PCI_PRODUCT_SERVERWORKS_CIOB_E:
                        switch (attachflags &
-                           (PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED)) {
+                           (PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY)) {
                        case 0:
                                /* Doesn't smell like there's anything there. */
                                break;
-                       case PCI_FLAGS_MEM_ENABLED:
-                               attachflags |= PCI_FLAGS_IO_ENABLED;
+                       case PCI_FLAGS_MEM_OKAY:
+                               attachflags |= PCI_FLAGS_IO_OKAY;
                                /* FALLTHROUGH */
                        default:
                                doattach = 1;
@@ -327,9 +327,9 @@ pchbattach(device_t parent, device_t sel
                         * at the MIOC, but less aesthetical imho.)
                         */
                        if ((attachflags &
-                           (PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED)) ==
-                           PCI_FLAGS_MEM_ENABLED)
-                               attachflags |= PCI_FLAGS_IO_ENABLED;
+                           (PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY)) ==
+                           PCI_FLAGS_MEM_OKAY)
+                               attachflags |= PCI_FLAGS_IO_OKAY;
 
                        pbnum = 0;
                        switch (pa->pa_device) {
Index: sys/arch/x86/pci/pci_machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/x86/pci/pci_machdep.c,v
retrieving revision 1.44
diff -u -p -r1.44 pci_machdep.c
--- sys/arch/x86/pci/pci_machdep.c      30 Apr 2010 21:05:27 -0000      1.44
+++ sys/arch/x86/pci/pci_machdep.c      8 Apr 2011 14:43:45 -0000
@@ -644,7 +644,7 @@ not2:
 int
 pci_bus_flags(void)
 {
-       int rval = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED |
+       int rval = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY |
            PCI_FLAGS_MRL_OKAY | PCI_FLAGS_MRM_OKAY | PCI_FLAGS_MWI_OKAY;
        int device, maxndevs;
        pcitag_t tag;
@@ -678,7 +678,7 @@ pci_bus_flags(void)
  disable_mem:
        printf("Warning: broken PCI-Host bridge detected; "
            "disabling memory-mapped access\n");
-       rval &= ~(PCI_FLAGS_MEM_ENABLED|PCI_FLAGS_MRL_OKAY|PCI_FLAGS_MRM_OKAY|
+       rval &= ~(PCI_FLAGS_MEM_OKAY|PCI_FLAGS_MRL_OKAY|PCI_FLAGS_MRM_OKAY|
            PCI_FLAGS_MWI_OKAY);
        return (rval);
 }
Index: sys/arch/xen/xen/hypervisor.c
===================================================================
RCS file: /cvsroot/src/sys/arch/xen/xen/hypervisor.c,v
retrieving revision 1.53
diff -u -p -r1.53 hypervisor.c
--- sys/arch/xen/xen/hypervisor.c       7 Aug 2010 21:58:34 -0000       1.53
+++ sys/arch/xen/xen/hypervisor.c       8 Apr 2011 14:43:45 -0000
@@ -249,7 +249,7 @@ hypervisor_attach(device_t parent, devic
                hac.hac_acpi.aa_memt = x86_bus_space_mem;
                hac.hac_acpi.aa_pc = NULL;
                hac.hac_acpi.aa_pciflags =
-                       PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED |
+                       PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY |
                        PCI_FLAGS_MRL_OKAY | PCI_FLAGS_MRM_OKAY |
                        PCI_FLAGS_MWI_OKAY;
                hac.hac_acpi.aa_ic = &x86_isa_chipset;
@@ -265,7 +265,7 @@ hypervisor_attach(device_t parent, devic
 #else
        hac.hac_pba.pba_dmat64 = NULL;
 #endif /* _LP64 */
-       hac.hac_pba.pba_flags = PCI_FLAGS_MEM_ENABLED | PCI_FLAGS_IO_ENABLED;
+       hac.hac_pba.pba_flags = PCI_FLAGS_MEM_OKAY | PCI_FLAGS_IO_OKAY;
        hac.hac_pba.pba_bridgetag = NULL;
        hac.hac_pba.pba_bus = 0;
 #if NACPICA > 0 && defined(ACPI_SCANPCI)
Index: sys/arch/xen/xen/xpci_xenbus.c
===================================================================
RCS file: /cvsroot/src/sys/arch/xen/xen/xpci_xenbus.c,v
retrieving revision 1.5
diff -u -p -r1.5 xpci_xenbus.c
--- sys/arch/xen/xen/xpci_xenbus.c      4 Apr 2011 20:37:55 -0000       1.5
+++ sys/arch/xen/xen/xpci_xenbus.c      8 Apr 2011 14:43:45 -0000
@@ -390,7 +390,7 @@ xpci_attach_pcibus(int domain, int busn)
 #else
        pba.pba_dmat64 = NULL;
 #endif /* _LP64 */
-       pba.pba_flags = PCI_FLAGS_MEM_ENABLED | PCI_FLAGS_IO_ENABLED |
+       pba.pba_flags = PCI_FLAGS_MEM_OKAY | PCI_FLAGS_IO_OKAY |
            PCI_FLAGS_MRL_OKAY | PCI_FLAGS_MRM_OKAY | PCI_FLAGS_MWI_OKAY;
        pba.pba_bridgetag = NULL;
        pba.pba_bus = busn;
Index: sys/dev/cardbus/rbus_ppb.c
===================================================================
RCS file: /cvsroot/src/sys/dev/cardbus/rbus_ppb.c,v
retrieving revision 1.39
diff -u -p -r1.39 rbus_ppb.c
--- sys/dev/cardbus/rbus_ppb.c  5 Mar 2010 22:47:03 -0000       1.39
+++ sys/dev/cardbus/rbus_ppb.c  8 Apr 2011 14:43:47 -0000
@@ -719,7 +719,7 @@ ppb_cardbus_attach(device_t parent, devi
        pba.pba_memt = ca->ca_memt;
        pba.pba_dmat = ca->ca_dmat;
        pba.pba_pc   = psc->sc_pc;
-       pba.pba_flags    = PCI_FLAGS_IO_ENABLED|PCI_FLAGS_MEM_ENABLED;
+       pba.pba_flags    = PCI_FLAGS_IO_OKAY|PCI_FLAGS_MEM_OKAY;
        pba.pba_bus      = PPB_BUSINFO_SECONDARY(busdata);
        pba.pba_bridgetag = &csc->sc_tag;
        /*pba.pba_intrswiz = parent_sc->sc_intrswiz; */
Index: sys/dev/ic/cpc700.c
===================================================================
RCS file: /cvsroot/src/sys/dev/ic/cpc700.c,v
retrieving revision 1.17
diff -u -p -r1.17 cpc700.c
--- sys/dev/ic/cpc700.c 10 Dec 2010 00:38:49 -0000      1.17
+++ sys/dev/ic/cpc700.c 8 Apr 2011 14:43:47 -0000
@@ -174,7 +174,7 @@ cpc_attach(device_t self, pci_chipset_ta
        aa.pba.pba_memt = mem;
        aa.pba.pba_dmat = dma;
        aa.pba.pba_pc = pc;
-       aa.pba.pba_flags = PCI_FLAGS_MEM_ENABLED | PCI_FLAGS_IO_ENABLED;
+       aa.pba.pba_flags = PCI_FLAGS_MEM_OKAY | PCI_FLAGS_IO_OKAY;
        aa.pba.pba_bus = 0;
 
        /* Save PCI error condition reg. */
Index: sys/dev/marvell/gtpci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/marvell/gtpci.c,v
retrieving revision 1.27
diff -u -p -r1.27 gtpci.c
--- sys/dev/marvell/gtpci.c     1 Aug 2010 06:57:06 -0000       1.27
+++ sys/dev/marvell/gtpci.c     8 Apr 2011 14:43:47 -0000
@@ -483,16 +483,16 @@ gtpci_pci_config(struct gtpci_softc *sc,
                if (iot == NULL)
                        aprint_error("io ");
                else
-                       pba.pba_flags |= PCI_FLAGS_IO_ENABLED;
+                       pba.pba_flags |= PCI_FLAGS_IO_OKAY;
                if (iot == NULL && memt == NULL)
                        aprint_error("and ");
                if (memt == NULL)
                        aprint_error("mem");
                else
-                       pba.pba_flags |= PCI_FLAGS_MEM_ENABLED;
+                       pba.pba_flags |= PCI_FLAGS_MEM_OKAY;
                aprint_error(" access disabled\n");
        } else
-               pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
+               pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY;
        command = GTPCI_READ(sc, GTPCI_C);
        if (command & GTPCI_C_MRDMUL)
                pba.pba_flags |= PCI_FLAGS_MRM_OKAY;
Index: sys/dev/marvell/mvpex.c
===================================================================
RCS file: /cvsroot/src/sys/dev/marvell/mvpex.c,v
retrieving revision 1.4
diff -u -p -r1.4 mvpex.c
--- sys/dev/marvell/mvpex.c     4 Apr 2011 20:37:56 -0000       1.4
+++ sys/dev/marvell/mvpex.c     8 Apr 2011 14:43:47 -0000
@@ -440,7 +440,7 @@ mvpex_pci_config(struct mvpex_softc *sc,
        pba.pba_dmat = dmat;
        pba.pba_dmat64 = NULL;
        pba.pba_pc = pc;
-       pba.pba_flags = PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
+       pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY;
        pba.pba_bus = MVPEX_STAT_PEXBUSNUM(stat);
        pba.pba_bridgetag = NULL;
        config_found_ia(sc->sc_dev, "pcibus", &pba, NULL);
Index: sys/dev/pci/chipsfb.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/chipsfb.c,v
retrieving revision 1.28
diff -u -p -r1.28 chipsfb.c
--- sys/dev/pci/chipsfb.c       5 Apr 2011 23:25:00 -0000       1.28
+++ sys/dev/pci/chipsfb.c       8 Apr 2011 14:43:48 -0000
@@ -69,7 +69,11 @@ CFATTACH_DECL_NEW(chipsfb_pci, sizeof(st
 static int
 chipsfb_pci_match(device_t parent, cfdata_t match, void *aux)
 {
-       struct pci_attach_args *pa = (struct pci_attach_args *)aux;
+       const struct pci_attach_args *pa = (struct pci_attach_args *)aux;
+
+       if ((pa->pa_flags & (PCI_FLAGS_MEM_OKAY|PCI_FLAGS_IO_OKAY)) !=
+           (PCI_FLAGS_MEM_OKAY|PCI_FLAGS_IO_OKAY))
+               return 0;
 
        if (PCI_CLASS(pa->pa_class) != PCI_CLASS_DISPLAY ||
            PCI_SUBCLASS(pa->pa_class) != PCI_SUBCLASS_DISPLAY_VGA)
Index: sys/dev/pci/if_fxp_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_fxp_pci.c,v
retrieving revision 1.74
diff -u -p -r1.74 if_fxp_pci.c
--- sys/dev/pci/if_fxp_pci.c    22 Mar 2010 16:17:43 -0000      1.74
+++ sys/dev/pci/if_fxp_pci.c    8 Apr 2011 14:43:48 -0000
@@ -267,7 +267,7 @@ fxp_pci_attach(device_t parent, device_t
 {
        struct fxp_pci_softc *psc = device_private(self);
        struct fxp_softc *sc = &psc->psc_fxp;
-       struct pci_attach_args *pa = aux;
+       const struct pci_attach_args *pa = aux;
        pci_chipset_tag_t pc = pa->pa_pc;
        pci_intr_handle_t ih;
        const struct fxp_pci_product *fpp;
@@ -315,7 +315,7 @@ fxp_pci_attach(device_t parent, device_t
         */
        memh_valid = 0;
        memt = pa->pa_memt;
-       if (((pa->pa_flags & PCI_FLAGS_MEM_ENABLED) != 0) &&
+       if (((pa->pa_flags & PCI_FLAGS_MEM_OKAY) != 0) &&
            pci_mapreg_info(pa->pa_pc, pa->pa_tag, FXP_PCI_MMBA,
            PCI_MAPREG_TYPE_MEM|PCI_MAPREG_MEM_TYPE_32BIT,
            &addr, &sc->sc_size, &flags) == 0) {
Index: sys/dev/pci/if_hme_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_hme_pci.c,v
retrieving revision 1.35
diff -u -p -r1.35 if_hme_pci.c
--- sys/dev/pci/if_hme_pci.c    23 Mar 2010 21:54:23 -0000      1.35
+++ sys/dev/pci/if_hme_pci.c    8 Apr 2011 14:43:48 -0000
@@ -155,12 +155,10 @@ hmeattach_pci(device_t parent, device_t 
         */
        switch (type) {
        case PCI_MAPREG_TYPE_MEM:
-               pa->pa_flags |= PCI_FLAGS_MEM_ENABLED;
                csr |= PCI_COMMAND_MEM_ENABLE;
                sc->sc_bustag = pa->pa_memt;
                break;
        case PCI_MAPREG_TYPE_IO:
-               pa->pa_flags |= PCI_FLAGS_IO_ENABLED;
                csr |= PCI_COMMAND_IO_ENABLE;
                sc->sc_bustag = pa->pa_iot;
                break;
Index: sys/dev/pci/if_ne_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_ne_pci.c,v
retrieving revision 1.34
diff -u -p -r1.34 if_ne_pci.c
--- sys/dev/pci/if_ne_pci.c     6 May 2009 10:34:32 -0000       1.34
+++ sys/dev/pci/if_ne_pci.c     8 Apr 2011 14:43:48 -0000
@@ -293,7 +293,7 @@ ne_pci_ipkdb_attach(struct ipkdb_if *kip
        pa.pa_pc = pc;
        pa.pa_device = dev;
        pa.pa_function = 0;
-       pa.pa_flags = PCI_FLAGS_IO_ENABLED;
+       pa.pa_flags = PCI_FLAGS_IO_OKAY;
        pa.pa_tag = pci_make_tag(pc, bus, dev, /*func*/0);
        pa.pa_id = pci_conf_read(pc, pa.pa_tag, PCI_ID_REG);
        pa.pa_class = pci_conf_read(pc, pa.pa_tag, PCI_CLASS_REG);
Index: sys/dev/pci/if_ral_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_ral_pci.c,v
retrieving revision 1.15
diff -u -p -r1.15 if_ral_pci.c
--- sys/dev/pci/if_ral_pci.c    19 Jan 2010 22:07:01 -0000      1.15
+++ sys/dev/pci/if_ral_pci.c    8 Apr 2011 14:43:48 -0000
@@ -100,7 +100,10 @@ int
 ral_pci_match(device_t parent, cfdata_t cfdata,
     void *aux)
 {
-       struct pci_attach_args *pa = aux;
+       const struct pci_attach_args *pa = aux;
+
+       if ((pa->pa_flags & PCI_FLAGS_MEM_OKAY) == 0)
+               return 0;
 
        if (PCI_VENDOR(pa->pa_id) == PCI_VENDOR_RALINK) {
                switch (PCI_PRODUCT(pa->pa_id)) {
@@ -122,7 +125,7 @@ ral_pci_attach(device_t parent, device_t
 {
        struct ral_pci_softc *psc = device_private(self);
        struct rt2560_softc *sc = &psc->sc_sc;
-       struct pci_attach_args *pa = aux;
+       const struct pci_attach_args *pa = aux;
        const char *intrstr;
        char devinfo[256];
        bus_addr_t base;
@@ -144,7 +147,6 @@ ral_pci_attach(device_t parent, device_t
        reg = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG);
        reg |= PCI_COMMAND_MASTER_ENABLE | PCI_COMMAND_MEM_ENABLE;
        pci_conf_write(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG, reg);
-       pa->pa_flags |= PCI_FLAGS_MEM_ENABLED;
 
        /* map control/status registers */
        error = pci_mapreg_map(pa, RAL_PCI_BAR0, PCI_MAPREG_TYPE_MEM |
Index: sys/dev/pci/machfb.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/machfb.c,v
retrieving revision 1.63
diff -u -p -r1.63 machfb.c
--- sys/dev/pci/machfb.c        22 Jan 2011 15:14:28 -0000      1.63
+++ sys/dev/pci/machfb.c        8 Apr 2011 14:43:48 -0000
@@ -488,6 +488,10 @@ mach64_match(device_t parent, cfdata_t m
            PCI_SUBCLASS(pa->pa_class) != PCI_SUBCLASS_DISPLAY_VGA)
                return 0;
 
+       if ((pa->pa_flags & (PCI_FLAGS_IO_OKAY|PCI_FLAGS_MEM_OKAY)) !=
+           (PCI_FLAGS_IO_OKAY|PCI_FLAGS_MEM_OKAY))
+               return 0;
+
        for (i = 0; i < __arraycount(mach64_info); i++)
                if (PCI_PRODUCT(pa->pa_id) == mach64_info[i].chip_id) {
                        mach64_chip_id = PCI_PRODUCT(pa->pa_id);
@@ -513,6 +517,7 @@ mach64_attach(device_t parent, device_t 
        int setmode, width, height;
        pcireg_t screg;
        uint32_t reg;
+       const pcireg_t enables = PCI_COMMAND_MEM_ENABLE|PCI_COMMAND_IO_ENABLE;
 
        sc->sc_dev = self;
        sc->sc_pc = pa->pa_pc;
@@ -535,9 +540,8 @@ mach64_attach(device_t parent, device_t 
        
        /* enable memory and disable IO access */
        screg = pci_conf_read(sc->sc_pc, sc->sc_pcitag, PCI_COMMAND_STATUS_REG);
-       if ((screg & PCI_FLAGS_MEM_ENABLED) == 0) {
-               screg |= PCI_FLAGS_IO_ENABLED;
-               screg |= PCI_FLAGS_MEM_ENABLED;
+       if ((screg & enables) != enables) {
+               screg |= enables;
                pci_conf_write(sc->sc_pc, sc->sc_pcitag,
                    PCI_COMMAND_STATUS_REG, screg);
        }
Index: sys/dev/pci/pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/pci.c,v
retrieving revision 1.138
diff -u -p -r1.138 pci.c
--- sys/dev/pci/pci.c   5 Apr 2011 23:10:52 -0000       1.138
+++ sys/dev/pci/pci.c   8 Apr 2011 15:03:50 -0000
@@ -148,8 +148,8 @@ pciattach(device_t parent, device_t self
        aprint_naive("\n");
        aprint_normal("\n");
 
-       io_enabled = (pba->pba_flags & PCI_FLAGS_IO_ENABLED);
-       mem_enabled = (pba->pba_flags & PCI_FLAGS_MEM_ENABLED);
+       io_enabled = (pba->pba_flags & PCI_FLAGS_IO_OKAY);
+       mem_enabled = (pba->pba_flags & PCI_FLAGS_MEM_OKAY);
        mrl_enabled = (pba->pba_flags & PCI_FLAGS_MRL_OKAY);
        mrm_enabled = (pba->pba_flags & PCI_FLAGS_MRM_OKAY);
        mwi_enabled = (pba->pba_flags & PCI_FLAGS_MWI_OKAY);
@@ -247,8 +247,8 @@ pciprint(void *aux, const char *pnp)
                    (long)pa->pa_intrswiz, (long)pa->pa_intrpin);
 #endif
                printf(", i/o %s, mem %s,",
-                   pa->pa_flags & PCI_FLAGS_IO_ENABLED ? "on" : "off",
-                   pa->pa_flags & PCI_FLAGS_MEM_ENABLED ? "on" : "off");
+                   pa->pa_flags & PCI_FLAGS_IO_OKAY ? "on" : "off",
+                   pa->pa_flags & PCI_FLAGS_MEM_OKAY ? "on" : "off");
                qd = pci_lookup_quirkdata(PCI_VENDOR(pa->pa_id),
                    PCI_PRODUCT(pa->pa_id));
                if (qd == NULL) {
@@ -370,10 +370,6 @@ pci_probe_device(struct pci_softc *sc, p
         * as appropriate.
         */
        pa.pa_flags = sc->sc_flags;
-       if ((csr & PCI_COMMAND_IO_ENABLE) == 0)
-               pa.pa_flags &= ~PCI_FLAGS_IO_ENABLED;
-       if ((csr & PCI_COMMAND_MEM_ENABLE) == 0)
-               pa.pa_flags &= ~PCI_FLAGS_MEM_ENABLED;
 
        /*
         * If the cache line size is not configured, then
Index: sys/dev/pci/pci_map.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/pci_map.c,v
retrieving revision 1.28
diff -u -p -r1.28 pci_map.c
--- sys/dev/pci/pci_map.c       4 Apr 2011 20:37:56 -0000       1.28
+++ sys/dev/pci/pci_map.c       8 Apr 2011 14:43:48 -0000
@@ -291,14 +291,14 @@ pci_mapreg_submap(const struct pci_attac
        int flags;
 
        if (PCI_MAPREG_TYPE(type) == PCI_MAPREG_TYPE_IO) {
-               if ((pa->pa_flags & PCI_FLAGS_IO_ENABLED) == 0)
+               if ((pa->pa_flags & PCI_FLAGS_IO_OKAY) == 0)
                        return 1;
                if (pci_io_find(pa->pa_pc, pa->pa_tag, reg, type, &base,
                    &size, &flags))
                        return 1;
                tag = pa->pa_iot;
        } else {
-               if ((pa->pa_flags & PCI_FLAGS_MEM_ENABLED) == 0)
+               if ((pa->pa_flags & PCI_FLAGS_MEM_OKAY) == 0)
                        return 1;
                if (pci_mem_find(pa->pa_pc, pa->pa_tag, reg, type, &base,
                    &size, &flags))
Index: sys/dev/pci/pciide_common.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/pciide_common.c,v
retrieving revision 1.49
diff -u -p -r1.49 pciide_common.c
--- sys/dev/pci/pciide_common.c 4 Apr 2011 20:37:56 -0000       1.49
+++ sys/dev/pci/pciide_common.c 8 Apr 2011 14:43:48 -0000
@@ -266,13 +266,15 @@ pciide_chipen(struct pciide_softc *sc, c
 {
        pcireg_t csr;
 
-       if ((pa->pa_flags & PCI_FLAGS_IO_ENABLED) == 0) {
-               csr = pci_conf_read(sc->sc_pc, sc->sc_tag,
-                   PCI_COMMAND_STATUS_REG);
+       if ((pa->pa_flags & PCI_FLAGS_IO_OKAY) == 0) {
+               aprint_normal_dev(sc->sc_wdcdev.sc_atac.atac_dev,
+                   "I/O access disabled at bridge\n");
+               return 0;
+       }
+       csr = pci_conf_read(sc->sc_pc, sc->sc_tag, PCI_COMMAND_STATUS_REG);
+       if ((csr & PCI_COMMAND_IO_ENABLE) == 0) {
                aprint_normal_dev(sc->sc_wdcdev.sc_atac.atac_dev,
-                   "device disabled (at %s)\n",
-                  (csr & PCI_COMMAND_IO_ENABLE) == 0 ?
-                  "device" : "bridge");
+                   "I/O access disabled at device\n");
                return 0;
        }
        return 1;
Index: sys/dev/pci/pcivar.h
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/pcivar.h,v
retrieving revision 1.92
diff -u -p -r1.92 pcivar.h
--- sys/dev/pci/pcivar.h        4 Apr 2011 20:37:56 -0000       1.92
+++ sys/dev/pci/pcivar.h        8 Apr 2011 14:43:48 -0000
@@ -154,8 +154,8 @@ struct pci_attach_args {
 /*
  * Flags given in the bus and device attachment args.
  */
-#define        PCI_FLAGS_IO_ENABLED    0x01            /* I/O space is enabled 
*/
-#define        PCI_FLAGS_MEM_ENABLED   0x02            /* memory space is 
enabled */
+#define        PCI_FLAGS_IO_OKAY       0x01            /* I/O space is okay */
+#define        PCI_FLAGS_MEM_OKAY      0x02            /* memory space is okay 
*/
 #define        PCI_FLAGS_MRL_OKAY      0x04            /* Memory Read Line 
okay */
 #define        PCI_FLAGS_MRM_OKAY      0x08            /* Memory Read Multiple 
okay */
 #define        PCI_FLAGS_MWI_OKAY      0x10            /* Memory Write and 
Invalidate
Index: sys/dev/pci/radeonfb.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/radeonfb.c,v
retrieving revision 1.42
diff -u -p -r1.42 radeonfb.c
--- sys/dev/pci/radeonfb.c      6 Feb 2011 23:25:17 -0000       1.42
+++ sys/dev/pci/radeonfb.c      8 Apr 2011 14:43:48 -0000
@@ -416,9 +416,13 @@ CFATTACH_DECL(radeonfb, sizeof (struct r
 static int
 radeonfb_match(device_t parent, cfdata_t match, void *aux)
 {
-       struct pci_attach_args  *pa = aux;
+       const struct pci_attach_args    *pa = aux;
        int                     i;
 
+       if ((pa->pa_flags & (PCI_FLAGS_MEM_OKAY|PCI_FLAGS_IO_OKAY)) !=
+           (PCI_FLAGS_MEM_OKAY|PCI_FLAGS_IO_OKAY))
+               return 0;
+
        if (PCI_VENDOR(pa->pa_id) != PCI_VENDOR_ATI)
                return 0;
 
@@ -464,7 +468,7 @@ radeonfb_attach(device_t parent, device_
 
        /* enable memory and IO access */
        screg = pci_conf_read(sc->sc_pc, sc->sc_pt, PCI_COMMAND_STATUS_REG);
-       screg |= PCI_FLAGS_IO_ENABLED | PCI_FLAGS_MEM_ENABLED;
+       screg |= PCI_COMMAND_IO_ENABLE | PCI_COMMAND_MEM_ENABLE;
        pci_conf_write(sc->sc_pc, sc->sc_pt, PCI_COMMAND_STATUS_REG, screg);
 
        /*
Index: sys/dev/pci/viaide.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/viaide.c,v
retrieving revision 1.72
diff -u -p -r1.72 viaide.c
--- sys/dev/pci/viaide.c        4 Apr 2011 20:37:56 -0000       1.72
+++ sys/dev/pci/viaide.c        8 Apr 2011 14:43:49 -0000
@@ -837,6 +837,7 @@ pio:                /* setup PIO mode */
 static int
 via_sata_chip_map_common(struct pciide_softc *sc, struct pci_attach_args *pa)
 {
+       pcireg_t csr;
        int maptype, ret;
 
        if (pciide_chipen(sc, pa) == 0)
@@ -877,12 +878,11 @@ via_sata_chip_map_common(struct pciide_s
                /*
                 * Enable memory-space access if it isn't already there.
                 */
-               if ((pa->pa_flags & PCI_FLAGS_MEM_ENABLED) == 0) {
-                       pcireg_t csr;
+               csr = pci_conf_read(pa->pa_pc, pa->pa_tag,
+                   PCI_COMMAND_STATUS_REG);
+               if ((csr & PCI_COMMAND_MEM_ENABLE) == 0 &&
+                   (pa->pa_flags & PCI_FLAGS_MEM_OKAY) != 0) {
 
-                       pa->pa_flags |= PCI_FLAGS_MEM_ENABLED;
-                       csr = pci_conf_read(pa->pa_pc, pa->pa_tag,
-                           PCI_COMMAND_STATUS_REG);
                        pci_conf_write(pa->pa_pc, pa->pa_tag,
                            PCI_COMMAND_STATUS_REG,
                            csr | PCI_COMMAND_MEM_ENABLE);


Home | Main Index | Thread Index | Old Index