Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/atari - use CFATTACH_DECL_NEW() (no softc)



details:   https://anonhg.NetBSD.org/src/rev/2b02b2299e71
branches:  trunk
changeset: 765756:2b02b2299e71
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Sun Jun 05 06:31:41 2011 +0000

description:
- use CFATTACH_DECL_NEW() (no softc)
- use device_t, cfdata_t etc.

diffstat:

 sys/arch/atari/atari/autoconf.c  |  51 +++++++++++++++++++--------------------
 sys/arch/atari/dev/grf.c         |  26 ++++++++++----------
 sys/arch/atari/dev/kbd.c         |  20 +++++++-------
 sys/arch/atari/pci/pci_machdep.c |  26 ++++++++++----------
 sys/arch/atari/vme/vme_machdep.c |  22 ++++++++--------
 5 files changed, 72 insertions(+), 73 deletions(-)

diffs (truncated from 432 to 300 lines):

diff -r d5b44f0b79f1 -r 2b02b2299e71 sys/arch/atari/atari/autoconf.c
--- a/sys/arch/atari/atari/autoconf.c   Sun Jun 05 05:49:54 2011 +0000
+++ b/sys/arch/atari/atari/autoconf.c   Sun Jun 05 06:31:41 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: autoconf.c,v 1.59 2010/04/10 17:40:36 tsutsui Exp $    */
+/*     $NetBSD: autoconf.c,v 1.60 2011/06/05 06:31:41 tsutsui Exp $    */
 
 /*
  * Copyright (c) 1995 Leo Weppelman
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.59 2010/04/10 17:40:36 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.60 2011/06/05 06:31:41 tsutsui Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -46,8 +46,8 @@
 #include <atari/atari/device.h>
 
 static void findroot(void);
-int mbmatch(struct device *, struct cfdata *, void *);
-void mbattach(struct device *, struct device *, void *);
+int mbmatch(device_t, cfdata_t, void *);
+void mbattach(device_t, device_t, void *);
 #if 0
 int mbprint(void *, const char *);
 #endif
@@ -93,11 +93,10 @@
  * by checking for NULL.
  */
 int
-atari_config_found(struct cfdata *pcfp, struct device *pdp, void *auxp,
-    cfprint_t pfn)
+atari_config_found(cfdata_t pcfp, device_t pdp, void *auxp, cfprint_t pfn)
 {
        struct device temp;
-       struct cfdata *cf;
+       cfdata_t cf;
        const struct cfattach *ca;
 
        if (atari_realconfig)
@@ -243,13 +242,13 @@
 /* 
  * mainbus driver 
  */
-CFATTACH_DECL(mainbus, sizeof(struct device),
+CFATTACH_DECL_NEW(mainbus, 0,
     mbmatch, mbattach, NULL, NULL);
 
 static int mb_attached;
 
 int
-mbmatch(struct device *pdp, struct cfdata *cfp, void *auxp)
+mbmatch(device_t parent, cfdata_t cf, void *aux)
 {
 
        if (mb_attached)
@@ -264,35 +263,35 @@
  * "find" all the things that should be there.
  */
 void
-mbattach(struct device *pdp, struct device *dp, void *auxp)
+mbattach(device_t parent, device_t self, void *aux)
 {
 
        mb_attached = 1;
 
        printf ("\n");
-       config_found(dp, __UNCONST("clock")   , simple_devprint);
-       config_found(dp, __UNCONST("grfbus")  , simple_devprint);
-       config_found(dp, __UNCONST("kbd")     , simple_devprint);
-       config_found(dp, __UNCONST("fdc")     , simple_devprint);
-       config_found(dp, __UNCONST("ser")     , simple_devprint);
-       config_found(dp, __UNCONST("zs")      , simple_devprint);
-       config_found(dp, __UNCONST("ncrscsi") , simple_devprint);
-       config_found(dp, __UNCONST("nvr")     , simple_devprint);
-       config_found(dp, __UNCONST("lpt")     , simple_devprint);
-       config_found(dp, __UNCONST("wdc")     , simple_devprint);
-       config_found(dp, __UNCONST("ne")      , simple_devprint);
-       config_found(dp, __UNCONST("isab")    , simple_devprint);
-       config_found(dp, __UNCONST("pcib")    , simple_devprint);
-       config_found(dp, __UNCONST("avmebus") , simple_devprint);
+       config_found(self, __UNCONST("clock")   , simple_devprint);
+       config_found(self, __UNCONST("grfbus")  , simple_devprint);
+       config_found(self, __UNCONST("kbd")     , simple_devprint);
+       config_found(self, __UNCONST("fdc")     , simple_devprint);
+       config_found(self, __UNCONST("ser")     , simple_devprint);
+       config_found(self, __UNCONST("zs")      , simple_devprint);
+       config_found(self, __UNCONST("ncrscsi") , simple_devprint);
+       config_found(self, __UNCONST("nvr")     , simple_devprint);
+       config_found(self, __UNCONST("lpt")     , simple_devprint);
+       config_found(self, __UNCONST("wdc")     , simple_devprint);
+       config_found(self, __UNCONST("ne")      , simple_devprint);
+       config_found(self, __UNCONST("isab")    , simple_devprint);
+       config_found(self, __UNCONST("pcib")    , simple_devprint);
+       config_found(self, __UNCONST("avmebus") , simple_devprint);
 }
 
 #if 0
 int
-mbprint(void *auxp, const char *pnp)
+mbprint(void *aux, const char *pnp)
 {
 
        if (pnp)
-               aprint_normal("%s at %s", (char *)auxp, pnp);
+               aprint_normal("%s at %s", (char *)aux, pnp);
        return UNCONF;
 }
 #endif
diff -r d5b44f0b79f1 -r 2b02b2299e71 sys/arch/atari/dev/grf.c
--- a/sys/arch/atari/dev/grf.c  Sun Jun 05 05:49:54 2011 +0000
+++ b/sys/arch/atari/dev/grf.c  Sun Jun 05 06:31:41 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: grf.c,v 1.44 2011/02/08 20:20:10 rmind Exp $   */
+/*     $NetBSD: grf.c,v 1.45 2011/06/05 06:31:41 tsutsui Exp $ */
 
 /*
  * Copyright (c) 1995 Leo Weppelman
@@ -46,7 +46,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: grf.c,v 1.44 2011/02/08 20:20:10 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: grf.c,v 1.45 2011/06/05 06:31:41 tsutsui Exp $");
 
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -90,16 +90,16 @@
 int grfoff(dev_t);
 int grfsinfo(dev_t, struct grfdyninfo *);
 
-int grfbusprint(void *auxp, const char *);
-int grfbusmatch(struct device *, struct cfdata *, void *);
-void grfbusattach(struct device *, struct device *, void *);
+int grfbusprint(void *, const char *);
+int grfbusmatch(device_t, cfdata_t, void *);
+void grfbusattach(device_t, device_t, void *);
 
 /*
  * pointers to grf drivers device structs 
  */
 struct grf_softc *grfsp[NGRF]; /* XXX */
 
-CFATTACH_DECL(grfbus, sizeof(struct device),
+CFATTACH_DECL_NEW(grfbus, 0,
     grfbusmatch, grfbusattach, NULL, NULL);
 
 dev_type_open(grfopen);
@@ -118,35 +118,35 @@
 static struct cfdata *cfdata_gbus  = NULL;
 
 int
-grfbusmatch(struct device *pdp, struct cfdata *cfp, void *auxp)
+grfbusmatch(device_t parent, cfdata_t cf, void *aux)
 {
 
-       if (strcmp(auxp, grfbus_cd.cd_name))
+       if (strcmp(aux, grfbus_cd.cd_name))
                return 0;
 
        if (atari_realconfig == 0)
-               cfdata_gbus = cfp;
+               cfdata_gbus = cf;
        return 1;       /* Always there */
 }
 
 void
-grfbusattach(struct device *pdp, struct device *dp, void *auxp)
+grfbusattach(device_t parent, device_t self, void *aux)
 {
        grf_auxp_t      grf_auxp;
 
        grf_auxp.busprint       = grfbusprint;
        grf_auxp.from_bus_match = 1;
 
-       if (dp == NULL) /* Console init */
+       if (self == NULL) /* Console init       */
                atari_config_found(cfdata_gbus, NULL, &grf_auxp, grfbusprint);
        else {
                printf("\n");
-               config_found(dp, &grf_auxp, grfbusprint);
+               config_found(self, &grf_auxp, grfbusprint);
        }
 }
 
 int
-grfbusprint(void *auxp, const char *name)
+grfbusprint(void *aux, const char *name)
 {
 
        if (name == NULL)
diff -r d5b44f0b79f1 -r 2b02b2299e71 sys/arch/atari/dev/kbd.c
--- a/sys/arch/atari/dev/kbd.c  Sun Jun 05 05:49:54 2011 +0000
+++ b/sys/arch/atari/dev/kbd.c  Sun Jun 05 06:31:41 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kbd.c,v 1.41 2010/04/13 11:31:11 tsutsui Exp $ */
+/*     $NetBSD: kbd.c,v 1.42 2011/06/05 06:31:41 tsutsui Exp $ */
 
 /*
  * Copyright (c) 1995 Leo Weppelman
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kbd.c,v 1.41 2010/04/13 11:31:11 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kbd.c,v 1.42 2011/06/05 06:31:41 tsutsui Exp $");
 
 #include "mouse.h"
 #include "ite.h"
@@ -117,15 +117,15 @@
 void   kbdintr(int);
 
 static void kbdsoft(void *);
-static void kbdattach(struct device *, struct device *, void *);
-static int  kbdmatch(struct device *, struct cfdata *, void *);
+static void kbdattach(device_t, device_t, void *);
+static int  kbdmatch(device_t, cfdata_t, void *);
 #if NITE>0
 static int  kbd_do_modifier(uint8_t);
 #endif
 static int  kbd_write_poll(const uint8_t *, int);
 static void kbd_pkg_start(struct kbd_softc *, uint8_t);
 
-CFATTACH_DECL(kbd, sizeof(struct device),
+CFATTACH_DECL_NEW(kbd, 0,
     kbdmatch, kbdattach, NULL, NULL);
 
 const struct cdevsw kbd_cdevsw = {
@@ -165,17 +165,17 @@
 
 /*ARGSUSED*/
 static int
-kbdmatch(struct device *pdp, struct cfdata *cfp, void *auxp)
+kbdmatch(device_t parent, cfdata_t cf, void *aux)
 {
 
-       if (!strcmp((char *)auxp, "kbd"))
+       if (!strcmp((char *)aux, "kbd"))
                return 1;
        return 0;
 }
 
 /*ARGSUSED*/
 static void
-kbdattach(struct device *pdp, struct device *dp, void *auxp)
+kbdattach(device_t parent, device_t self, void *aux)
 {
        int timeout;
        const uint8_t kbd_rst[]  = { 0x80, 0x01 };
@@ -222,7 +222,7 @@
        kbd_softc.k_sicookie = softint_establish(SOFTINT_SERIAL, kbdsoft, NULL);
 
 #if NWSKBD>0
-       if (dp != NULL) {
+       if (self != NULL) {
                /*
                 * Try to attach the wskbd.
                 */
@@ -235,7 +235,7 @@
                waa.keymap = &kbd_mapdata;
                waa.accessops = &kbd_accessops;
                waa.accesscookie = NULL;
-               kbd_softc.k_wskbddev = config_found(dp, &waa, wskbddevprint);
+               kbd_softc.k_wskbddev = config_found(self, &waa, wskbddevprint);
 
                kbd_softc.k_pollingmode = 0;
 
diff -r d5b44f0b79f1 -r 2b02b2299e71 sys/arch/atari/pci/pci_machdep.c
--- a/sys/arch/atari/pci/pci_machdep.c  Sun Jun 05 05:49:54 2011 +0000
+++ b/sys/arch/atari/pci/pci_machdep.c  Sun Jun 05 06:31:41 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pci_machdep.c,v 1.50 2011/05/17 17:34:48 dyoung Exp $  */
+/*     $NetBSD: pci_machdep.c,v 1.51 2011/06/05 06:31:41 tsutsui Exp $ */
 
 /*
  * Copyright (c) 1996 Leo Weppelman.  All rights reserved.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.50 2011/05/17 17:34:48 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_machdep.c,v 1.51 2011/06/05 06:31:41 tsutsui Exp $");
 
 #include "opt_mbtype.h"
 
@@ -120,16 +120,16 @@
        _bus_dmamap_sync,
 };
 
-int    ataripcibusprint(void *auxp, const char *);
-int    pcibusmatch(struct device *, struct cfdata *, void *);
-void   pcibusattach(struct device *, struct device *, void *);
+int    ataripcibusprint(void *, const char *);
+int    pcibusmatch(device_t, cfdata_t, void *);
+void   pcibusattach(device_t, device_t, void *);
 
 static void enable_pci_devices(void);



Home | Main Index | Thread Index | Old Index