Module Name: src Committed By: tsutsui Date: Sun Jun 5 06:31:42 UTC 2011
Modified Files: src/sys/arch/atari/atari: autoconf.c src/sys/arch/atari/dev: grf.c kbd.c src/sys/arch/atari/pci: pci_machdep.c src/sys/arch/atari/vme: vme_machdep.c Log Message: - use CFATTACH_DECL_NEW() (no softc) - use device_t, cfdata_t etc. To generate a diff of this commit: cvs rdiff -u -r1.59 -r1.60 src/sys/arch/atari/atari/autoconf.c cvs rdiff -u -r1.44 -r1.45 src/sys/arch/atari/dev/grf.c cvs rdiff -u -r1.41 -r1.42 src/sys/arch/atari/dev/kbd.c cvs rdiff -u -r1.50 -r1.51 src/sys/arch/atari/pci/pci_machdep.c cvs rdiff -u -r1.19 -r1.20 src/sys/arch/atari/vme/vme_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/atari/atari/autoconf.c diff -u src/sys/arch/atari/atari/autoconf.c:1.59 src/sys/arch/atari/atari/autoconf.c:1.60 --- src/sys/arch/atari/atari/autoconf.c:1.59 Sat Apr 10 17:40:36 2010 +++ src/sys/arch/atari/atari/autoconf.c Sun Jun 5 06:31:41 2011 @@ -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 Index: src/sys/arch/atari/dev/grf.c diff -u src/sys/arch/atari/dev/grf.c:1.44 src/sys/arch/atari/dev/grf.c:1.45 --- src/sys/arch/atari/dev/grf.c:1.44 Tue Feb 8 20:20:10 2011 +++ src/sys/arch/atari/dev/grf.c Sun Jun 5 06:31:41 2011 @@ -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) Index: src/sys/arch/atari/dev/kbd.c diff -u src/sys/arch/atari/dev/kbd.c:1.41 src/sys/arch/atari/dev/kbd.c:1.42 --- src/sys/arch/atari/dev/kbd.c:1.41 Tue Apr 13 11:31:11 2010 +++ src/sys/arch/atari/dev/kbd.c Sun Jun 5 06:31:41 2011 @@ -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; Index: src/sys/arch/atari/pci/pci_machdep.c diff -u src/sys/arch/atari/pci/pci_machdep.c:1.50 src/sys/arch/atari/pci/pci_machdep.c:1.51 --- src/sys/arch/atari/pci/pci_machdep.c:1.50 Tue May 17 17:34:48 2011 +++ src/sys/arch/atari/pci/pci_machdep.c Sun Jun 5 06:31:41 2011 @@ -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); static void insert_into_list(PCI_MEMREG *head, struct pci_memreg *elem); static int overlap_pci_areas(struct pci_memreg *p, struct pci_memreg *self, u_int addr, u_int size, u_int what); -CFATTACH_DECL(pcib, sizeof(struct device), +CFATTACH_DECL_NEW(pcib, 0, pcibusmatch, pcibusattach, NULL, NULL); /* @@ -139,11 +139,11 @@ static struct atari_bus_space bs_storage[2]; /* 1 iot, 1 memt */ int -pcibusmatch(struct device *pdp, struct cfdata *cfp, void *auxp) +pcibusmatch(device_t parent, cfdata_t cf, void *aux) { static int nmatched = 0; - if (strcmp((char *)auxp, "pcib")) + if (strcmp((char *)aux, "pcib")) return 0; /* Wrong number... */ if (atari_realconfig == 0) @@ -162,7 +162,7 @@ } void -pcibusattach(struct device *pdp, struct device *dp, void *auxp) +pcibusattach(device_t parent, device_t self, void *aux) { struct pcibus_attach_args pba; @@ -180,7 +180,7 @@ pba.pba_iot->base = PCI_IO_PHYS; pba.pba_memt->base = PCI_MEM_PHYS; - if (dp == NULL) { + if (self == NULL) { /* * Scan the bus for a VGA-card that we support. If we * find one, try to initialize it to a 'standard' text @@ -198,11 +198,11 @@ printf("\n"); - config_found_ia(dp, "pcibus", &pba, ataripcibusprint); + config_found_ia(self, "pcibus", &pba, ataripcibusprint); } int -ataripcibusprint(void *auxp, const char *name) +ataripcibusprint(void *aux, const char *name) { if (name == NULL) @@ -211,7 +211,7 @@ } void -pci_attach_hook(struct device *parent, struct device *self, struct pcibus_attach_args *pba) +pci_attach_hook(device_t parent, device_t self, struct pcibus_attach_args *pba) { } Index: src/sys/arch/atari/vme/vme_machdep.c diff -u src/sys/arch/atari/vme/vme_machdep.c:1.19 src/sys/arch/atari/vme/vme_machdep.c:1.20 --- src/sys/arch/atari/vme/vme_machdep.c:1.19 Tue Apr 13 11:31:11 2010 +++ src/sys/arch/atari/vme/vme_machdep.c Sun Jun 5 06:31:42 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: vme_machdep.c,v 1.19 2010/04/13 11:31:11 tsutsui Exp $ */ +/* $NetBSD: vme_machdep.c,v 1.20 2011/06/05 06:31:42 tsutsui Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: vme_machdep.c,v 1.19 2010/04/13 11:31:11 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vme_machdep.c,v 1.20 2011/06/05 06:31:42 tsutsui Exp $"); #include <sys/types.h> #include <sys/param.h> @@ -46,28 +46,28 @@ #include <atari/atari/device.h> #include <atari/vme/vmevar.h> -static int vmebusprint(void *auxp, const char *); -static int vmebusmatch(struct device *, struct cfdata *, void *); -static void vmebusattach(struct device *, struct device *, void *); +static int vmebusprint(void *, const char *); +static int vmebusmatch(device_t, cfdata_t, void *); +static void vmebusattach(device_t, device_t, void *); -CFATTACH_DECL(avmebus, sizeof(struct device), +CFATTACH_DECL_NEW(avmebus, 0, vmebusmatch, vmebusattach, NULL, NULL); int vmebus_attached; int -vmebusmatch(struct device *pdp, struct cfdata *cfp, void *auxp) +vmebusmatch(device_t parent, cfdata_t cf, void *aux) { if (atari_realconfig == 0) return 0; - if (strcmp((char *)auxp, "avmebus") || vmebus_attached) + if (strcmp((char *)aux, "avmebus") || vmebus_attached) return 0; return (machineid & ATARI_FALCON) ? 0 : 1; } void -vmebusattach(struct device *pdp, struct device *dp, void *auxp) +vmebusattach(device_t parent, device_t self, void *aux) { struct vmebus_attach_args vba; @@ -88,11 +88,11 @@ vba.vba_memt->base = 0; printf("\n"); - config_found(dp, &vba, vmebusprint); + config_found(self, &vba, vmebusprint); } int -vmebusprint(void *auxp, const char *name) +vmebusprint(void *aux, const char *name) { if (name == NULL)