Source-Changes-HG archive

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

[src/trunk]: src/sys/arch Don't use the global variable pci_mode, but use a l...



details:   https://anonhg.NetBSD.org/src/rev/34a7fbd1a5ac
branches:  trunk
changeset: 752117:34a7fbd1a5ac
user:      dyoung <dyoung%NetBSD.org@localhost>
date:      Mon Feb 15 23:53:07 2010 +0000

description:
Don't use the global variable pci_mode, but use a local copy of
the return value of pci_mode_detect(), instead.

diffstat:

 sys/arch/amd64/amd64/mainbus.c |  11 ++++++-----
 sys/arch/i386/i386/mainbus.c   |  13 ++++++++-----
 sys/arch/xen/x86/mainbus.c     |  11 +++++++----
 3 files changed, 21 insertions(+), 14 deletions(-)

diffs (136 lines):

diff -r 23834d0a13e8 -r 34a7fbd1a5ac sys/arch/amd64/amd64/mainbus.c
--- a/sys/arch/amd64/amd64/mainbus.c    Mon Feb 15 23:04:11 2010 +0000
+++ b/sys/arch/amd64/amd64/mainbus.c    Mon Feb 15 23:53:07 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mainbus.c,v 1.29 2009/08/18 16:41:02 jmcneill Exp $    */
+/*     $NetBSD: mainbus.c,v 1.30 2010/02/15 23:53:07 dyoung Exp $      */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.29 2009/08/18 16:41:02 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.30 2010/02/15 23:53:07 dyoung Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -151,6 +151,7 @@
 mainbus_attach(device_t parent, device_t self, void *aux)
 {
 #if NPCI > 0
+       int mode;
        union mainbus_attach_args mba;
 #endif
 #if NACPICA > 0
@@ -176,9 +177,9 @@
        /*
         * ACPI needs to be able to access PCI configuration space.
         */
-       pci_mode = pci_mode_detect();
+       mode = pci_mode_detect();
 #if defined(PCI_BUS_FIXUP)
-       if (pci_mode != 0) {
+       if (mode != 0) {
                pci_maxbus = pci_bus_fixup(NULL, 0);
                aprint_debug("PCI bus max, after pci_bus_fixup: %i\n",
                    pci_maxbus);
@@ -252,7 +253,7 @@
 #endif
 
 #if NPCI > 0
-       if (pci_mode != 0) {
+       if (mode != 0) {
                int npcibus = 0;
 
                mba.mba_pba.pba_iot = X86_BUS_SPACE_IO;
diff -r 23834d0a13e8 -r 34a7fbd1a5ac sys/arch/i386/i386/mainbus.c
--- a/sys/arch/i386/i386/mainbus.c      Mon Feb 15 23:04:11 2010 +0000
+++ b/sys/arch/i386/i386/mainbus.c      Mon Feb 15 23:53:07 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mainbus.c,v 1.88 2010/01/08 00:09:44 dyoung Exp $      */
+/*     $NetBSD: mainbus.c,v 1.89 2010/02/15 23:53:07 dyoung Exp $      */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.88 2010/01/08 00:09:44 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.89 2010/02/15 23:53:07 dyoung Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -211,6 +211,9 @@
 void
 mainbus_attach(device_t parent, device_t self, void *aux)
 {
+#if NPCI > 0
+       int mode;
+#endif
        struct mainbus_softc *sc = device_private(self);
        union mainbus_attach_args mba;
 #ifdef MPBIOS
@@ -234,9 +237,9 @@
        /*
         * ACPI needs to be able to access PCI configuration space.
         */
-       pci_mode = pci_mode_detect();
+       mode = pci_mode_detect();
 #if defined(PCI_BUS_FIXUP)
-       if (pci_mode != 0) {
+       if (mode != 0) {
                pci_maxbus = pci_bus_fixup(NULL, 0);
                aprint_debug("PCI bus max, after pci_bus_fixup: %i\n",
                    pci_maxbus);
@@ -390,7 +393,7 @@
         * XXX that's not currently possible.
         */
 #if NPCI > 0
-       if (pci_mode != 0 && ifattr_match(ifattr, "pcibus")) {
+       if (pci_mode_detect() != 0 && ifattr_match(ifattr, "pcibus")) {
                int npcibus = 0;
 
                mba.mba_pba.pba_iot = X86_BUS_SPACE_IO;
diff -r 23834d0a13e8 -r 34a7fbd1a5ac sys/arch/xen/x86/mainbus.c
--- a/sys/arch/xen/x86/mainbus.c        Mon Feb 15 23:04:11 2010 +0000
+++ b/sys/arch/xen/x86/mainbus.c        Mon Feb 15 23:53:07 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mainbus.c,v 1.9 2009/08/18 16:41:03 jmcneill Exp $     */
+/*     $NetBSD: mainbus.c,v 1.10 2010/02/15 23:53:56 dyoung Exp $      */
 /*     NetBSD: mainbus.c,v 1.53 2003/10/27 14:11:47 junyoung Exp       */
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.9 2009/08/18 16:41:03 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.10 2010/02/15 23:53:56 dyoung Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -134,6 +134,9 @@
 void
 mainbus_attach(device_t parent, device_t self, void *aux)
 {
+#if NPCI > 0
+       int mode;
+#endif
        union mainbus_attach_args mba;
 #if defined(DOM0OPS)
        int numcpus = 0;
@@ -155,9 +158,9 @@
 #endif
 #if NPCI > 0
                /* ACPI needs to be able to access PCI configuration space. */
-               pci_mode = pci_mode_detect();
+               mode = pci_mode_detect();
 #ifdef PCI_BUS_FIXUP
-               if (pci_mode != 0) {
+               if (mode != 0) {
                        pci_maxbus = pci_bus_fixup(NULL, 0);
                        aprint_debug_dev(self, "PCI bus max, after "
                            "pci_bus_fixup: %i\n", pci_maxbus);



Home | Main Index | Thread Index | Old Index