Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/acorn32 device_t, cfdata_t, device_private, device_...



details:   https://anonhg.NetBSD.org/src/rev/5dae9fbcbac9
branches:  trunk
changeset: 765703:5dae9fbcbac9
user:      matt <matt%NetBSD.org@localhost>
date:      Fri Jun 03 07:35:37 2011 +0000

description:
device_t, cfdata_t, device_private, device_xname cleanup
CFATTACH_DECL_NEW for struct device only devices
bump SYMTAB_SPACE for EB7500ATX

diffstat:

 sys/arch/acorn32/acorn32/autoconf.c          |   6 ++--
 sys/arch/acorn32/conf/EB7500ATX              |   6 ++--
 sys/arch/acorn32/eb7500atx/rsbus.c           |  23 +++++++--------
 sys/arch/acorn32/include/podulebus_machdep.h |   6 ++--
 sys/arch/acorn32/mainbus/com_pioc.c          |   8 ++--
 sys/arch/acorn32/mainbus/fd.c                |  41 ++++++++++++++-------------
 sys/arch/acorn32/mainbus/lpt_pioc.c          |   8 ++--
 sys/arch/acorn32/mainbus/pioc.c              |  32 ++++++++++----------
 sys/arch/acorn32/mainbus/wdc_pioc.c          |   8 ++--
 sys/arch/acorn32/podulebus/amps.c            |  18 ++++++------
 sys/arch/acorn32/podulebus/asc.c             |  12 ++++----
 sys/arch/acorn32/podulebus/cosc.c            |  28 ++++++++----------
 sys/arch/acorn32/podulebus/csc.c             |  12 ++++----
 sys/arch/acorn32/podulebus/if_ie.c           |  18 ++++++------
 sys/arch/acorn32/podulebus/netslot.c         |   6 ++--
 sys/arch/acorn32/podulebus/podulebus.c       |  29 +++++++++----------
 sys/arch/acorn32/podulebus/ptsc.c            |  26 ++++++++---------
 17 files changed, 141 insertions(+), 146 deletions(-)

diffs (truncated from 1009 to 300 lines):

diff -r c95872ecb6fd -r 5dae9fbcbac9 sys/arch/acorn32/acorn32/autoconf.c
--- a/sys/arch/acorn32/acorn32/autoconf.c       Fri Jun 03 07:21:32 2011 +0000
+++ b/sys/arch/acorn32/acorn32/autoconf.c       Fri Jun 03 07:35:37 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: autoconf.c,v 1.16 2009/05/12 06:56:59 cegger Exp $     */
+/*     $NetBSD: autoconf.c,v 1.17 2011/06/03 07:35:37 matt Exp $       */
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -43,7 +43,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.16 2009/05/12 06:56:59 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.17 2011/06/03 07:35:37 matt Exp $");
 
 #include "opt_md.h"
 
@@ -185,7 +185,7 @@
 }
 
 void
-device_register(struct device *dev, void *aux)
+device_register(device_t dev, void *aux)
 {
 }
 /* End of autoconf.c */
diff -r c95872ecb6fd -r 5dae9fbcbac9 sys/arch/acorn32/conf/EB7500ATX
--- a/sys/arch/acorn32/conf/EB7500ATX   Fri Jun 03 07:21:32 2011 +0000
+++ b/sys/arch/acorn32/conf/EB7500ATX   Fri Jun 03 07:35:37 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: EB7500ATX,v 1.42 2011/03/06 17:08:18 bouyer Exp $
+#      $NetBSD: EB7500ATX,v 1.43 2011/06/03 07:35:37 matt Exp $
 #
 #      EB7500ATX --- NetBSD/acorn32 complete configuration
 #
@@ -22,7 +22,7 @@
 
 options        INCLUDE_CONFIG_FILE     # embed config file in kernel binary
 
-#ident         "EB7500ATX-$Revision: 1.42 $"
+#ident         "EB7500ATX-$Revision: 1.43 $"
 
 # estimated number of users
 maxusers       32
@@ -144,7 +144,7 @@
 options        USERCONF        # userconf(4) support
 #options       PIPE_SOCKETPAIR # smaller, but slower pipe(2)
 #options       SYSCTL_INCLUDE_DESCR    # Include sysctl descriptions in kernel
-options                SYMTAB_SPACE=262144
+options                SYMTAB_SPACE=275000
 
 # Enable experimental buffer queue strategy for better responsiveness under 
 # high disk I/O load. Use it with caution - it's not proven to be stable yet.
diff -r c95872ecb6fd -r 5dae9fbcbac9 sys/arch/acorn32/eb7500atx/rsbus.c
--- a/sys/arch/acorn32/eb7500atx/rsbus.c        Fri Jun 03 07:21:32 2011 +0000
+++ b/sys/arch/acorn32/eb7500atx/rsbus.c        Fri Jun 03 07:35:37 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rsbus.c,v 1.7 2009/10/21 16:16:24 rmind Exp $ */
+/* $NetBSD: rsbus.c,v 1.8 2011/06/03 07:35:37 matt Exp $ */
 
 /*
  * Copyright (c) 2002
@@ -29,7 +29,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(0, "$NetBSD: rsbus.c,v 1.7 2009/10/21 16:16:24 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rsbus.c,v 1.8 2011/06/03 07:35:37 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -45,25 +45,25 @@
 
 /* Declare prototypes */
 
-static int     rsbus_match(struct device *, struct cfdata *, void *);
-static void    rsbus_attach(struct device *, struct device *, void *);
+static int     rsbus_match(device_t, cfdata_t, void *);
+static void    rsbus_attach(device_t, device_t, void *);
 static int     rsbus_print(void *, const char *);
-static int     rsbus_search(struct device *, struct cfdata *,
+static int     rsbus_search(device_t, cfdata_t,
                             const int *, void *);
 
 CFATTACH_DECL(rsbus, sizeof(struct rsbus_softc),
     rsbus_match, rsbus_attach, NULL, NULL);
  
 static int
-rsbus_match(struct device *parent, struct cfdata *cf, void *aux)
+rsbus_match(device_t parent, cfdata_t cf, void *aux)
 {
        return(1);
 }
 
 static void
-rsbus_attach(struct device *parent, struct device *self, void *aux)
+rsbus_attach(device_t parent, device_t self, void *aux)
 {
-       struct rsbus_softc *sc = (void *) self;
+       struct rsbus_softc *sc = device_private(self);
        sc->sc_iot = &rsbus_bs_tag;
 
        printf("\n");
@@ -75,9 +75,9 @@
 }
 
 static int
-rsbus_search(struct device *parent, struct cfdata *cf, const int *ldesc, void *aux)
+rsbus_search(device_t parent, cfdata_t cf, const int *ldesc, void *aux)
 {
-       struct rsbus_softc *sc = (struct rsbus_softc *)parent;
+       struct rsbus_softc *sc = device_private(parent);
        struct rsbus_attach_args sa;
 
        sa.sa_iot = sc->sc_iot;
@@ -94,7 +94,7 @@
 static int
 rsbus_print(void *aux, const char *name)
 {
-        struct rsbus_attach_args *sa = (struct rsbus_attach_args*)aux;
+        struct rsbus_attach_args *sa = aux;
 
        if (sa->sa_size)
                aprint_normal(" addr 0x%lx", sa->sa_addr);
@@ -105,4 +105,3 @@
 
        return (UNCONF);
 }
-
diff -r c95872ecb6fd -r 5dae9fbcbac9 sys/arch/acorn32/include/podulebus_machdep.h
--- a/sys/arch/acorn32/include/podulebus_machdep.h      Fri Jun 03 07:21:32 2011 +0000
+++ b/sys/arch/acorn32/include/podulebus_machdep.h      Fri Jun 03 07:35:37 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: podulebus_machdep.h,v 1.2 2009/03/14 14:45:51 dsl Exp $ */
+/* $NetBSD: podulebus_machdep.h,v 1.3 2011/06/03 07:35:37 matt Exp $ */
 
 /*
  * Copyright (c) 1995 Mark Brinicombe.
@@ -161,8 +161,8 @@
     bus_space_tag_t *);
 
 /* Used internally by the podulebus code */
-extern void netslotscan(struct device *);
-extern void poduleexamine(podule_t *, struct device *, int);
+extern void netslotscan(device_t);
+extern void poduleexamine(podule_t *, device_t, int);
 
 #endif
 
diff -r c95872ecb6fd -r 5dae9fbcbac9 sys/arch/acorn32/mainbus/com_pioc.c
--- a/sys/arch/acorn32/mainbus/com_pioc.c       Fri Jun 03 07:21:32 2011 +0000
+++ b/sys/arch/acorn32/mainbus/com_pioc.c       Fri Jun 03 07:35:37 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: com_pioc.c,v 1.14 2008/04/28 20:23:09 martin Exp $     */
+/*     $NetBSD: com_pioc.c,v 1.15 2011/06/03 07:35:37 matt Exp $       */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
 
 #include <sys/param.h>
 
-__KERNEL_RCSID(0, "$NetBSD: com_pioc.c,v 1.14 2008/04/28 20:23:09 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: com_pioc.c,v 1.15 2011/06/03 07:35:37 matt Exp $");
 
 #include <sys/systm.h>
 #include <sys/tty.h>
@@ -103,7 +103,7 @@
 extern bus_space_tag_t comconstag;     /* From pioc.c */
 
 /*
- * int com_pioc_probe(struct device *parent, struct cfdata *cf, void *aux)
+ * int com_pioc_probe(device_t parent, cfdata_t cf, void *aux)
  *
  * Make sure we are trying to attach a com device and then
  * probe for one.
@@ -141,7 +141,7 @@
 }
 
 /*
- * void com_pioc_attach(struct device *parent, struct device *self, void *aux)
+ * void com_pioc_attach(device_t parent, device_t self, void *aux)
  *
  * attach the com device
  */
diff -r c95872ecb6fd -r 5dae9fbcbac9 sys/arch/acorn32/mainbus/fd.c
--- a/sys/arch/acorn32/mainbus/fd.c     Fri Jun 03 07:21:32 2011 +0000
+++ b/sys/arch/acorn32/mainbus/fd.c     Fri Jun 03 07:35:37 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fd.c,v 1.49 2010/12/09 05:14:28 uebayasi Exp $ */
+/*     $NetBSD: fd.c,v 1.50 2011/06/03 07:35:37 matt Exp $     */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -82,7 +82,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.49 2010/12/09 05:14:28 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.50 2011/06/03 07:35:37 matt Exp $");
 
 #include "opt_ddb.h"
 
@@ -174,9 +174,9 @@
 };
 
 /* controller driver configuration */
-int fdcprobe(struct device *, struct cfdata *, void *);
+int fdcprobe(device_t, cfdata_t, void *);
 int fdprint(void *, const char *);
-void fdcattach(struct device *, struct device *, void *);
+void fdcattach(device_t, device_t, void *);
 
 CFATTACH_DECL(fdc, sizeof(struct fdc_softc),
     fdcprobe, fdcattach, NULL, NULL);
@@ -249,8 +249,8 @@
 };
 
 /* floppy driver configuration */
-int fdprobe(struct device *, struct cfdata *, void *);
-void fdattach(struct device *, struct device *, void *);
+int fdprobe(device_t, cfdata_t, void *);
+void fdattach(device_t, device_t, void *);
 
 extern char floppy_read_fiq[], floppy_read_fiq_end[];
 extern char floppy_write_fiq[], floppy_write_fiq_end[];
@@ -289,7 +289,7 @@
 int fdcresult(struct fdc_softc *fdc);
 int out_fdc(bus_space_tag_t iot, bus_space_handle_t ioh, u_char x);
 void fdcstart(struct fdc_softc *fdc);
-void fdcstatus(struct device *dv, int n, const char *s);
+void fdcstatus(device_t dv, int n, const char *s);
 void fdctimeout(void *arg);
 void fdcpseudointr(void *arg);
 int fdcintr(void *);
@@ -299,7 +299,7 @@
 int fdformat(dev_t, struct ne7_fd_formb *, struct lwp *);
 
 int
-fdcprobe(struct device *parent, struct cfdata *cf, void *aux)
+fdcprobe(device_t parent, cfdata_t cf, void *aux)
 {
        struct pioc_attach_args *pa = aux;
        bus_space_tag_t iot;
@@ -361,9 +361,9 @@
 }
 
 void
-fdcattach(struct device *parent, struct device *self, void *aux)
+fdcattach(device_t parent, device_t self, void *aux)
 {
-       struct fdc_softc *fdc = (void *)self;
+       struct fdc_softc *fdc = device_private(self);
        bus_space_tag_t iot;
        bus_space_handle_t ioh;
        struct pioc_attach_args *pa = aux;
@@ -388,10 +388,10 @@
        callout_init(&fdc->sc_timo_ch, 0); 
        callout_init(&fdc->sc_intr_ch, 0);
 
-       fdc->sc_ih = intr_claim(pa->pa_irq, IPL_BIO, "fdc",
-           fdcintr, fdc);
+       fdc->sc_ih = intr_claim(pa->pa_irq, IPL_BIO, "fdc", fdcintr, fdc);
        if (!fdc->sc_ih)
-               panic("%s: Cannot claim IRQ %d", self->dv_xname, pa->pa_irq);
+               panic("%s: Cannot claim IRQ %d",
+                   device_xname(self), pa->pa_irq);
 
 #if 0
        /*
@@ -417,9 +417,9 @@
 }
 
 int
-fdprobe(struct device *parent, struct cfdata *cf, void *aux)
+fdprobe(device_t parent, cfdata_t cf, void *aux)
 {
-       struct fdc_softc *fdc = (void *)parent;
+       struct fdc_softc *fdc = device_private(parent);
        struct fdc_attach_args *fa = aux;
        int drive = fa->fa_drive;
        bus_space_tag_t iot = fdc->sc_iot;
@@ -472,10 +472,10 @@
  * Controller is working, and drive responded.  Attach it.
  */
 void
-fdattach(struct device *parent, struct device *self, void *aux)
+fdattach(device_t parent, device_t self, void *aux)
 {
-       struct fdc_softc *fdc = (void *)parent;
-       struct fd_softc *fd = (void *)self;
+       struct fdc_softc *fdc = device_private(parent);
+       struct fd_softc *fd = device_private(self);
        struct fdc_attach_args *fa = aux;
        struct fd_type *type = fa->fa_deftype;
        int drive = fa->fa_drive;
@@ -840,7 +840,7 @@
 }
 



Home | Main Index | Thread Index | Old Index