Source-Changes-HG archive

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

[src/netbsd-1-4]: src/sys/arch/macppc/pci pullup 1.8->1.9 (thorpej)



details:   https://anonhg.NetBSD.org/src/rev/b549d8ced60f
branches:  netbsd-1-4
changeset: 468672:b549d8ced60f
user:      perry <perry%NetBSD.org@localhost>
date:      Thu May 06 02:22:03 1999 +0000

description:
pullup 1.8->1.9 (thorpej)

diffstat:

 sys/arch/macppc/pci/pci_machdep.c |  27 ++++++++++++++++++---------
 1 files changed, 18 insertions(+), 9 deletions(-)

diffs (104 lines):

diff -r e74914978814 -r b549d8ced60f sys/arch/macppc/pci/pci_machdep.c
--- a/sys/arch/macppc/pci/pci_machdep.c Thu May 06 02:20:56 1999 +0000
+++ b/sys/arch/macppc/pci/pci_machdep.c Thu May 06 02:22:03 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pci_machdep.c,v 1.8 1999/03/15 03:03:10 tsubai Exp $   */
+/*     $NetBSD: pci_machdep.c,v 1.8.2.1 1999/05/06 02:22:03 perry Exp $        */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
@@ -88,6 +88,8 @@
        struct device *parent, *self;
        struct pcibus_attach_args *pba;
 {
+
+       /* Nothing to do. */
 }
 
 int
@@ -113,6 +115,7 @@
        if (bus >= 256 || device >= 32 || function >= 8)
                panic("pci_make_tag: bad request");
 
+       /* XXX magic number */
        tag = 0x80000000 | (bus << 16) | (device << 11) | (function << 8);
 
        return tag;
@@ -124,14 +127,13 @@
        pcitag_t tag;
        int *bp, *dp, *fp;
 {
+
        if (bp != NULL)
                *bp = (tag >> 16) & 0xff;
        if (dp != NULL)
                *dp = (tag >> 11) & 0x1f;
        if (fp != NULL)
-               *fp = (tag >> 8) & 0x7;
-
-       return;
+               *fp = (tag >> 8) & 0x07;
 }
 
 pcireg_t
@@ -142,6 +144,9 @@
 {
        pcireg_t data;
        struct pci_bridge *r;
+       int bus, dev, func, s;
+
+       s = splhigh();
 
        if (pc == PCI_CHIPSET_MPC106) {
                r = &pci_bridges[0];
@@ -152,8 +157,6 @@
                        data = in32rb(r->data);
                out32rb(r->addr, 0);
        } else {
-               int bus, dev, func;
-
                pci_decompose_tag(pc, tag, &bus, &dev, &func);
 
                r = &pci_bridges[pc];
@@ -184,6 +187,8 @@
                DELAY(10);
        }
 
+       splx(s);
+
        return data;
 }
 
@@ -194,7 +199,10 @@
        int reg;
        pcireg_t data;
 {
-       struct pci_bridge *r = &pci_bridges[pc];
+       struct pci_bridge *r;
+       int bus, dev, func, s;
+
+       s = splhigh();
 
        if (pc == PCI_CHIPSET_MPC106) {
                r = &pci_bridges[0];
@@ -203,10 +211,9 @@
                out32rb(r->data, data);
                out32rb(r->addr, 0);
        } else {
-               int bus, dev, func;
+               r = &pci_bridges[pc];
 
                pci_decompose_tag(pc, tag, &bus, &dev, &func);
-               r = &pci_bridges[pc];
 
                if (func > 7)
                        panic("pci_conf_write: func > 7");
@@ -223,6 +230,8 @@
                out32rb(r->addr, 0);
                DELAY(10);
        }
+
+       splx(s);
 }
 
 int



Home | Main Index | Thread Index | Old Index