Source-Changes-HG archive

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

[src/trunk]: src/sys/arch Use the base space tag from the attach args, don't ...



details:   https://anonhg.NetBSD.org/src/rev/fa4b63bf167d
branches:  trunk
changeset: 535270:fa4b63bf167d
user:      simonb <simonb%NetBSD.org@localhost>
date:      Tue Aug 13 06:15:15 2002 +0000

description:
Use the base space tag from the attach args, don't recreate it all the
time.
Clean up some include files.

diffstat:

 sys/arch/powerpc/ibm4xx/dev/if_emac.c |   4 ++--
 sys/arch/powerpc/ibm4xx/dev/opb.c     |  13 +++++--------
 sys/arch/walnut/dev/pbus.c            |  16 ++++++++--------
 sys/arch/walnut/dev/pckbc_pbus.c      |  13 ++++++-------
 sys/arch/walnut/pci/pchb.c            |   4 ++--
 sys/arch/walnut/pci/pci_machdep.c     |   7 +------
 6 files changed, 24 insertions(+), 33 deletions(-)

diffs (200 lines):

diff -r 1d10cbcfde41 -r fa4b63bf167d sys/arch/powerpc/ibm4xx/dev/if_emac.c
--- a/sys/arch/powerpc/ibm4xx/dev/if_emac.c     Tue Aug 13 05:52:11 2002 +0000
+++ b/sys/arch/powerpc/ibm4xx/dev/if_emac.c     Tue Aug 13 06:15:15 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_emac.c,v 1.8 2002/08/13 05:43:24 simonb Exp $       */
+/*     $NetBSD: if_emac.c,v 1.9 2002/08/13 06:15:15 simonb Exp $       */
 
 /*
  * Copyright 2001, 2002 Wasabi Systems, Inc.
@@ -297,7 +297,7 @@
        bus_dma_segment_t seg;
        int error, i, nseg;
 
-       sc->sc_st = ibm4xx_make_bus_space_tag(0, 0);
+       sc->sc_st = oaa->opb_bt;
        sc->sc_sh = oaa->opb_addr;
        sc->sc_dmat = oaa->opb_dmat;
 
diff -r 1d10cbcfde41 -r fa4b63bf167d sys/arch/powerpc/ibm4xx/dev/opb.c
--- a/sys/arch/powerpc/ibm4xx/dev/opb.c Tue Aug 13 05:52:11 2002 +0000
+++ b/sys/arch/powerpc/ibm4xx/dev/opb.c Tue Aug 13 06:15:15 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: opb.c,v 1.4 2002/08/13 05:43:25 simonb Exp $ */
+/* $NetBSD: opb.c,v 1.5 2002/08/13 06:15:15 simonb Exp $ */
 
 /*
  * Copyright 2001,2002 Wasabi Systems, Inc.
@@ -70,14 +70,10 @@
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/device.h>
-#include <sys/extent.h>
-#include <sys/malloc.h>
-
-#define _IBM4XX_BUS_DMA_PRIVATE
-#include <machine/walnut.h>
 
 #include <powerpc/spr.h>
 #include <powerpc/ibm4xx/dev/opbvar.h>
+#include <powerpc/ibm4xx/dev/plbvar.h>
 #include <powerpc/ibm4xx/ibm405gp.h>
 
 /*
@@ -141,6 +137,7 @@
 static void
 opb_attach(struct device *parent, struct device *self, void *aux)
 {
+       struct plb_attach_args *paa = aux;
        struct opb_attach_args oaa;
        int i, pvr;
 
@@ -153,8 +150,8 @@
                oaa.opb_name = opb_devs[i].name;
                oaa.opb_addr = opb_devs[i].addr;
                oaa.opb_irq = opb_devs[i].irq;
-               oaa.opb_bt = ibm4xx_make_bus_space_tag(0, 0);
-               oaa.opb_dmat = &ibm4xx_default_bus_dma_tag;
+               oaa.opb_bt = paa->plb_bt;
+               oaa.opb_dmat = paa->plb_dmat;
 
                (void) config_found_sm(self, &oaa, opb_print, opb_submatch);
        }
diff -r 1d10cbcfde41 -r fa4b63bf167d sys/arch/walnut/dev/pbus.c
--- a/sys/arch/walnut/dev/pbus.c        Tue Aug 13 05:52:11 2002 +0000
+++ b/sys/arch/walnut/dev/pbus.c        Tue Aug 13 06:15:15 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pbus.c,v 1.2 2002/08/13 05:43:25 simonb Exp $ */
+/* $NetBSD: pbus.c,v 1.3 2002/08/13 06:15:16 simonb Exp $ */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -71,15 +71,14 @@
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/device.h>
-#include <sys/extent.h>
-#include <sys/malloc.h>
 
-#define _IBM4XX_BUS_DMA_PRIVATE
-#include <arch/walnut/dev/pbusvar.h>
 #include <machine/bus.h>
 #include <machine/walnut.h>
 
+#include <arch/walnut/dev/pbusvar.h>
+
 #include <powerpc/ibm4xx/ibm405gp.h>
+#include <powerpc/ibm4xx/dev/plbvar.h>
 
 /*
  * The devices built in to the 405GP cpu.
@@ -137,11 +136,12 @@
 static void
 pbus_attach(struct device *parent, struct device *self, void *aux)
 {
+       struct plb_attach_args *paa = aux;
        struct pbus_attach_args pba;
        int i;
 #if NPCKBC > 0
        bus_space_handle_t ioh_fpga;
-       bus_space_tag_t iot_fpga = ibm4xx_make_bus_space_tag(0, 0);
+       bus_space_tag_t iot_fpga = paa->plb_bt;
        uint8_t fpga_reg;
 #endif
 
@@ -151,8 +151,8 @@
                pba.pb_name = pbus_devs[i].name;
                pba.pb_addr = pbus_devs[i].addr;
                pba.pb_irq = pbus_devs[i].irq;
-               pba.pb_bt = ibm4xx_make_bus_space_tag(0, 0);
-               pba.pb_dmat = &ibm4xx_default_bus_dma_tag;
+               pba.pb_bt = paa->plb_bt;
+               pba.pb_dmat = paa->plb_dmat;
 
                (void) config_found_sm(self, &pba, pbus_print, pbus_submatch);
        }
diff -r 1d10cbcfde41 -r fa4b63bf167d sys/arch/walnut/dev/pckbc_pbus.c
--- a/sys/arch/walnut/dev/pckbc_pbus.c  Tue Aug 13 05:52:11 2002 +0000
+++ b/sys/arch/walnut/dev/pckbc_pbus.c  Tue Aug 13 06:15:15 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pckbc_pbus.c,v 1.2 2002/08/13 05:43:25 simonb Exp $ */
+/* $NetBSD: pckbc_pbus.c,v 1.3 2002/08/13 06:15:16 simonb Exp $ */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -38,15 +38,14 @@
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/kernel.h>
-#include <sys/proc.h>
 #include <sys/device.h>
 #include <sys/malloc.h> 
-#include <sys/errno.h>
-#include <sys/queue.h>
+
+#include <machine/intr.h>
+#include <machine/walnut.h>
 
 #include <arch/walnut/dev/pbusvar.h>
-#include <machine/intr.h>
-#include <machine/walnut.h>
+#include <powerpc/ibm4xx/dev/plbvar.h>
 
 #include <dev/ic/i8042reg.h>
 #include <dev/ic/pckbcvar.h> 
@@ -92,7 +91,7 @@
        struct pbus_attach_args *paa = aux;
        struct pckbc_internal *t;
        bus_space_handle_t ioh_d, ioh_c;
-       bus_space_tag_t iot = ibm4xx_make_bus_space_tag(0, 0);
+       bus_space_tag_t iot = paa->pb_bt;
        u_long addr = paa->pb_addr;
        
        /*
diff -r 1d10cbcfde41 -r fa4b63bf167d sys/arch/walnut/pci/pchb.c
--- a/sys/arch/walnut/pci/pchb.c        Tue Aug 13 05:52:11 2002 +0000
+++ b/sys/arch/walnut/pci/pchb.c        Tue Aug 13 06:15:15 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pchb.c,v 1.6 2002/08/13 05:43:26 simonb Exp $  */
+/*     $NetBSD: pchb.c,v 1.7 2002/08/13 06:15:16 simonb Exp $  */
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@
        sizeof(struct device), pchbmatch, pchbattach
 };
 
-int pcifound = 0;
+static int pcifound = 0;
 
 static int
 pchbmatch(struct device *parent, struct cfdata *cf, void *aux)
diff -r 1d10cbcfde41 -r fa4b63bf167d sys/arch/walnut/pci/pci_machdep.c
--- a/sys/arch/walnut/pci/pci_machdep.c Tue Aug 13 05:52:11 2002 +0000
+++ b/sys/arch/walnut/pci/pci_machdep.c Tue Aug 13 06:15:15 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pci_machdep.c,v 1.9 2002/08/13 05:43:26 simonb Exp $   */
+/*     $NetBSD: pci_machdep.c,v 1.10 2002/08/13 06:15:16 simonb Exp $  */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
@@ -52,11 +52,7 @@
 
 #include <uvm/uvm_extern.h>
 
-#define _IBM4XX_BUS_DMA_PRIVATE
 #include <machine/bus.h>
-
-#include <machine/bus.h>
-#include <machine/pio.h>
 #include <machine/intr.h>
 
 #include <dev/pci/pcivar.h>
@@ -64,7 +60,6 @@
 #include <dev/pci/pcidevs.h>
 #include <dev/pci/pciconf.h>
 
-#include <machine/walnut.h>
 #include <powerpc/ibm4xx/ibm405gp.h>
 #include <powerpc/ibm4xx/dev/pcicreg.h>
 



Home | Main Index | Thread Index | Old Index