Mon Jul 20 17:21:31 2009 UTC ()
Use CFATTACH_DECL_NEW(). (no softc)


(tsutsui)
diff -r1.39 -r1.40 src/sys/arch/pmax/pmax/mainbus.c

cvs diff -r1.39 -r1.40 src/sys/arch/pmax/pmax/mainbus.c (expand / switch to unified diff)

--- src/sys/arch/pmax/pmax/mainbus.c 2009/07/20 17:05:13 1.39
+++ src/sys/arch/pmax/pmax/mainbus.c 2009/07/20 17:21:31 1.40
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: mainbus.c,v 1.39 2009/07/20 17:05:13 tsutsui Exp $ */ 1/* $NetBSD: mainbus.c,v 1.40 2009/07/20 17:21:31 tsutsui Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1994, 1995 Carnegie-Mellon University. 4 * Copyright (c) 1994, 1995 Carnegie-Mellon University.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Author: Chris G. Demetriou 7 * Author: Chris G. Demetriou
8 * DECstation port: Jonathan Stone 8 * DECstation port: Jonathan Stone
9 * 9 *
10 * Permission to use, copy, modify and distribute this software and 10 * Permission to use, copy, modify and distribute this software and
11 * its documentation is hereby granted, provided that both the copyright 11 * its documentation is hereby granted, provided that both the copyright
12 * notice and this permission notice appear in all copies of the 12 * notice and this permission notice appear in all copies of the
13 * software, derivative works or modified versions, and any portions 13 * software, derivative works or modified versions, and any portions
14 * thereof, and that both notices appear in supporting documentation. 14 * thereof, and that both notices appear in supporting documentation.
@@ -19,65 +19,65 @@ @@ -19,65 +19,65 @@
19 *  19 *
20 * Carnegie Mellon requests users of this software to return to 20 * Carnegie Mellon requests users of this software to return to
21 * 21 *
22 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 22 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
23 * School of Computer Science 23 * School of Computer Science
24 * Carnegie Mellon University 24 * Carnegie Mellon University
25 * Pittsburgh PA 15213-3890 25 * Pittsburgh PA 15213-3890
26 * 26 *
27 * any improvements or extensions that they make and grant Carnegie the 27 * any improvements or extensions that they make and grant Carnegie the
28 * rights to redistribute these changes. 28 * rights to redistribute these changes.
29 */ 29 */
30 30
31#include <sys/cdefs.h> 31#include <sys/cdefs.h>
32__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.39 2009/07/20 17:05:13 tsutsui Exp $"); 32__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.40 2009/07/20 17:21:31 tsutsui Exp $");
33 33
34#include <sys/param.h> 34#include <sys/param.h>
35#include <sys/systm.h> 35#include <sys/systm.h>
36#include <sys/device.h> 36#include <sys/device.h>
37 37
38#include <machine/sysconf.h> 38#include <machine/sysconf.h>
39#include <machine/autoconf.h> 39#include <machine/autoconf.h>
40 40
41/* Definition of the mainbus driver. */ 41/* Definition of the mainbus driver. */
42static int mbmatch(struct device *, struct cfdata *, void *); 42static int mbmatch(device_t, cfdata_t, void *);
43static void mbattach(struct device *, struct device *, void *); 43static void mbattach(device_t, device_t, void *);
44static int mbprint(void *, const char *); 44static int mbprint(void *, const char *);
45 45
46CFATTACH_DECL(mainbus, sizeof(struct device), 46CFATTACH_DECL_NEW(mainbus, 0,
47 mbmatch, mbattach, NULL, NULL); 47 mbmatch, mbattach, NULL, NULL);
48 48
49static int mainbus_found; 49static int mainbus_found;
50 50
51static int 51static int
52mbmatch(struct device *parent, struct cfdata *cf, void *aux) 52mbmatch(device_t parent, cfdata_t cf, void *aux)
53{ 53{
54 54
55 if (mainbus_found) 55 if (mainbus_found)
56 return 0; 56 return 0;
57 57
58 return 1; 58 return 1;
59} 59}
60 60
61int ncpus = 0; /* only support uniprocessors, for now */ 61int ncpus = 0; /* only support uniprocessors, for now */
62 62
63static void 63static void
64mbattach(struct device *parent, struct device *self, void *aux) 64mbattach(device_t parent, device_t self, void *aux)
65{ 65{
66 struct mainbus_attach_args ma; 66 struct mainbus_attach_args ma;
67 67
68 mainbus_found = 1; 68 mainbus_found = 1;
69 69
70 printf("\n"); 70 aprint_normal("\n");
71 71
72 /* 72 /*
73 * if we ever support multi-processor DECsystem (5800 family), 73 * if we ever support multi-processor DECsystem (5800 family),
74 * the Alpha port's mainbus.c has an example of attaching 74 * the Alpha port's mainbus.c has an example of attaching
75 * multiple CPUs. 75 * multiple CPUs.
76 * 76 *
77 * For now, we only have one. Attach it directly. 77 * For now, we only have one. Attach it directly.
78 */ 78 */
79 ma.ma_name = "cpu"; 79 ma.ma_name = "cpu";
80 ma.ma_slot = 0; 80 ma.ma_slot = 0;
81 config_found(self, &ma, mbprint); 81 config_found(self, &ma, mbprint);
82 82
83 ma.ma_name = platform.iobus; 83 ma.ma_name = platform.iobus;