Sun Jun 5 17:03:19 2011 UTC ()
struct device * -> device_t, struct cfdata * -> cfdata_t
CFATTACH_DECL(*, sizeof(struct device), -> CFATTACH_DECL_NEW(&, 0


(matt)
diff -r1.21 -r1.22 src/sys/arch/algor/dev/mainbus.c
diff -r1.1 -r1.2 src/sys/arch/amigappc/amigappc/cpu.c
diff -r1.2 -r1.3 src/sys/arch/amigappc/amigappc/mainbus.c
diff -r1.10 -r1.11 src/sys/arch/arm/mainbus/cpu_mainbus.c
diff -r1.16 -r1.17 src/sys/arch/arm/mainbus/mainbus.c
diff -r1.1 -r1.2 src/sys/arch/emips/emips/mainbus.c
diff -r1.6 -r1.7 src/sys/arch/evbppc/ev64260/mainbus.c
diff -r1.3 -r1.4 src/sys/arch/evbppc/pmppc/mainbus.c
diff -r1.8 -r1.9 src/sys/arch/luna68k/luna68k/mainbus.c
diff -r1.20 -r1.21 src/sys/arch/mac68k/mac68k/mainbus.c
diff -r1.55 -r1.56 src/sys/arch/macppc/macppc/cpu.c
diff -r1.20 -r1.21 src/sys/arch/macppc/macppc/mainbus.c
diff -r1.8 -r1.9 src/sys/arch/mmeye/mmeye/mainbus.c
diff -r1.20 -r1.21 src/sys/arch/mvme68k/dev/mainbus.c
diff -r1.8 -r1.9 src/sys/arch/mvmeppc/mvmeppc/cpu.c
diff -r1.12 -r1.13 src/sys/arch/mvmeppc/mvmeppc/mainbus.c
diff -r1.10 -r1.11 src/sys/arch/next68k/next68k/mainbus.c
diff -r1.14 -r1.15 src/sys/arch/ofppc/ofppc/cpu.c
diff -r1.26 -r1.27 src/sys/arch/ofppc/ofppc/mainbus.c
diff -r1.28 -r1.29 src/sys/arch/powerpc/ibm4xx/cpu.c
diff -r1.15 -r1.16 src/sys/arch/prep/prep/cpu.c
diff -r1.30 -r1.31 src/sys/arch/prep/prep/mainbus.c
diff -r1.2 -r1.3 src/sys/arch/rs6000/rs6000/cpu.c
diff -r1.3 -r1.4 src/sys/arch/rs6000/rs6000/mainbus.c
diff -r1.22 -r1.23 src/sys/arch/sandpoint/sandpoint/mainbus.c
diff -r1.7 -r1.8 src/sys/arch/shark/ofw/cpu_ofbus.c

cvs diff -r1.21 -r1.22 src/sys/arch/algor/dev/mainbus.c (expand / switch to unified diff)

--- src/sys/arch/algor/dev/mainbus.c 2011/02/20 07:51:21 1.21
+++ src/sys/arch/algor/dev/mainbus.c 2011/06/05 17:03:18 1.22
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: mainbus.c,v 1.21 2011/02/20 07:51:21 matt Exp $ */ 1/* $NetBSD: mainbus.c,v 1.22 2011/06/05 17:03:18 matt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2001 The NetBSD Foundation, Inc. 4 * Copyright (c) 2001 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe. 8 * by Jason R. Thorpe.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -20,27 +20,27 @@ @@ -20,27 +20,27 @@
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.21 2011/02/20 07:51:21 matt Exp $"); 33__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.22 2011/06/05 17:03:18 matt Exp $");
34 34
35#include "opt_algor_p4032.h" 35#include "opt_algor_p4032.h"
36#include "opt_algor_p5064.h" 36#include "opt_algor_p5064.h"
37#include "opt_algor_p6032.h" 37#include "opt_algor_p6032.h"
38 38
39#include "opt_pci.h" 39#include "opt_pci.h"
40 40
41#include <sys/param.h> 41#include <sys/param.h>
42#include <sys/systm.h> 42#include <sys/systm.h>
43#include <sys/conf.h> 43#include <sys/conf.h>
44#include <sys/reboot.h> 44#include <sys/reboot.h>
45#include <sys/device.h> 45#include <sys/device.h>
46#include <sys/malloc.h> 46#include <sys/malloc.h>
@@ -53,34 +53,34 @@ __KERNEL_RCSID(0, "$NetBSD: mainbus.c,v  @@ -53,34 +53,34 @@ __KERNEL_RCSID(0, "$NetBSD: mainbus.c,v
53 53
54#include <dev/pci/pcivar.h> 54#include <dev/pci/pcivar.h>
55#include <dev/pci/pciconf.h> 55#include <dev/pci/pciconf.h>
56 56
57#if defined(PCI_NETBSD_CONFIGURE) && defined(PCI_NETBSD_ENABLE_IDE) 57#if defined(PCI_NETBSD_CONFIGURE) && defined(PCI_NETBSD_ENABLE_IDE)
58#if defined(ALGOR_P5064) || defined(ALGOR_P6032) 58#if defined(ALGOR_P5064) || defined(ALGOR_P6032)
59#include <dev/pci/pciide_piix_reg.h> 59#include <dev/pci/pciide_piix_reg.h>
60#endif /* ALGOR_P5064 || ALGOR_P6032 */ 60#endif /* ALGOR_P5064 || ALGOR_P6032 */
61#endif /* PCI_NETBSD_CONFIGURE && PCI_NETBSD_ENABLE_IDE */ 61#endif /* PCI_NETBSD_CONFIGURE && PCI_NETBSD_ENABLE_IDE */
62 62
63#include "locators.h" 63#include "locators.h"
64#include "pci.h" 64#include "pci.h"
65 65
66int mainbus_match(struct device *, struct cfdata *, void *); 66int mainbus_match(device_t, cfdata_t, void *);
67void mainbus_attach(struct device *, struct device *, void *); 67void mainbus_attach(device_t, device_t, void *);
68 68
69CFATTACH_DECL(mainbus, sizeof(struct device), 69CFATTACH_DECL_NEW(mainbus, 0,
70 mainbus_match, mainbus_attach, NULL, NULL); 70 mainbus_match, mainbus_attach, NULL, NULL);
71 71
72int mainbus_print(void *, const char *); 72int mainbus_print(void *, const char *);
73int mainbus_submatch(struct device *, struct cfdata *, 73int mainbus_submatch(device_t, cfdata_t,
74 const int *, void *); 74 const int *, void *);
75 75
76/* There can be only one. */ 76/* There can be only one. */
77int mainbus_found; 77int mainbus_found;
78 78
79struct mainbusdev { 79struct mainbusdev {
80 const char *md_name; 80 const char *md_name;
81 bus_addr_t md_addr; 81 bus_addr_t md_addr;
82 int md_irq; 82 int md_irq;
83}; 83};
84 84
85#if defined(ALGOR_P4032) 85#if defined(ALGOR_P4032)
86#include <algor/algor/algor_p4032reg.h> 86#include <algor/algor/algor_p4032reg.h>
@@ -115,37 +115,37 @@ struct mainbusdev mainbusdevs[] = { @@ -115,37 +115,37 @@ struct mainbusdev mainbusdevs[] = {
115#if defined(ALGOR_P6032) 115#if defined(ALGOR_P6032)
116#include <algor/algor/algor_p6032reg.h> 116#include <algor/algor/algor_p6032reg.h>
117#include <algor/algor/algor_p6032var.h> 117#include <algor/algor/algor_p6032var.h>
118 118
119struct mainbusdev mainbusdevs[] = { 119struct mainbusdev mainbusdevs[] = {
120 { "cpu", -1, -1 }, 120 { "cpu", -1, -1 },
121 { "bonito", BONITO_REG_BASE, -1 }, 121 { "bonito", BONITO_REG_BASE, -1 },
122 122
123 { NULL, 0, 0 }, 123 { NULL, 0, 0 },
124}; 124};
125#endif /* ALGOR_P6032 */ 125#endif /* ALGOR_P6032 */
126 126
127int 127int
128mainbus_match(struct device *parent, struct cfdata *cf, void *aux) 128mainbus_match(device_t parent, cfdata_t cf, void *aux)
129{ 129{
130 130
131 if (mainbus_found) 131 if (mainbus_found)
132 return (0); 132 return (0);
133 133
134 return (1); 134 return (1);
135} 135}
136 136
137void 137void
138mainbus_attach(struct device *parent, struct device *self, void *aux) 138mainbus_attach(device_t parent, device_t self, void *aux)
139{ 139{
140 struct mainbus_attach_args ma; 140 struct mainbus_attach_args ma;
141 struct mainbusdev *md; 141 struct mainbusdev *md;
142 bus_space_tag_t st; 142 bus_space_tag_t st;
143#if defined(PCI_NETBSD_CONFIGURE) 143#if defined(PCI_NETBSD_CONFIGURE)
144 struct extent *ioext, *memext; 144 struct extent *ioext, *memext;
145 pci_chipset_tag_t pc; 145 pci_chipset_tag_t pc;
146#if defined(PCI_NETBSD_ENABLE_IDE) 146#if defined(PCI_NETBSD_ENABLE_IDE)
147 pcitag_t idetag; 147 pcitag_t idetag;
148 pcireg_t idetim; 148 pcireg_t idetim;
149#endif 149#endif
150#endif 150#endif
151 151
@@ -237,24 +237,24 @@ int @@ -237,24 +237,24 @@ int
237mainbus_print(void *aux, const char *pnp) 237mainbus_print(void *aux, const char *pnp)
238{ 238{
239 struct mainbus_attach_args *ma = aux; 239 struct mainbus_attach_args *ma = aux;
240 240
241 if (pnp) 241 if (pnp)
242 aprint_normal("%s at %s", ma->ma_name, pnp); 242 aprint_normal("%s at %s", ma->ma_name, pnp);
243 if (ma->ma_addr != (bus_addr_t) -1) 243 if (ma->ma_addr != (bus_addr_t) -1)
244 aprint_normal(" addr 0x%lx", ma->ma_addr); 244 aprint_normal(" addr 0x%lx", ma->ma_addr);
245 245
246 return (UNCONF); 246 return (UNCONF);
247} 247}
248 248
249int 249int
250mainbus_submatch(struct device *parent, struct cfdata *cf, 250mainbus_submatch(device_t parent, cfdata_t cf,
251 const int *ldesc, void *aux) 251 const int *ldesc, void *aux)
252{ 252{
253 struct mainbus_attach_args *ma = aux; 253 struct mainbus_attach_args *ma = aux;
254 254
255 if (cf->cf_loc[MAINBUSCF_ADDR] != MAINBUSCF_ADDR_DEFAULT && 255 if (cf->cf_loc[MAINBUSCF_ADDR] != MAINBUSCF_ADDR_DEFAULT &&
256 cf->cf_loc[MAINBUSCF_ADDR] != ma->ma_addr) 256 cf->cf_loc[MAINBUSCF_ADDR] != ma->ma_addr)
257 return (0); 257 return (0);
258 258
259 return (config_match(parent, cf, aux)); 259 return (config_match(parent, cf, aux));
260} 260}

cvs diff -r1.1 -r1.2 src/sys/arch/amigappc/amigappc/cpu.c (expand / switch to unified diff)

--- src/sys/arch/amigappc/amigappc/cpu.c 2009/07/21 09:49:15 1.1
+++ src/sys/arch/amigappc/amigappc/cpu.c 2011/06/05 17:03:16 1.2
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: cpu.c,v 1.1 2009/07/21 09:49:15 phx Exp $ */ 1/* $NetBSD: cpu.c,v 1.2 2011/06/05 17:03:16 matt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2008,2009 Frank Wille. 4 * Copyright (c) 2008,2009 Frank Wille.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Written by Frank Wille for The NetBSD Project. 7 * Written by Frank Wille for The NetBSD Project.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -19,51 +19,51 @@ @@ -19,51 +19,51 @@
19 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 19 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 20 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 21 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 * POSSIBILITY OF SUCH DAMAGE. 28 * POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31#include <sys/cdefs.h> 31#include <sys/cdefs.h>
32__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.1 2009/07/21 09:49:15 phx Exp $"); 32__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.2 2011/06/05 17:03:16 matt 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/autoconf.h> 38#include <machine/autoconf.h>
39#include <machine/bus.h> 39#include <machine/bus.h>
40#include <machine/cpu.h> 40#include <machine/cpu.h>
41 41
42#include <amiga/amiga/device.h> 42#include <amiga/amiga/device.h>
43 43
44int cpu_match(struct device *, struct cfdata *, void *); 44int cpu_match(device_t, cfdata_t, void *);
45void cpu_attach(struct device *, struct device *, void *); 45void cpu_attach(device_t, device_t, void *);
46 46
47CFATTACH_DECL(cpu, sizeof(struct device), 47CFATTACH_DECL_NEW(cpu, 0,
48 cpu_match, cpu_attach, NULL, NULL); 48 cpu_match, cpu_attach, NULL, NULL);
49 49
50extern struct cfdriver cpu_cd; 50extern struct cfdriver cpu_cd;
51 51
52int 52int
53cpu_match(struct device *parent, struct cfdata *cf, void *aux) 53cpu_match(device_t parent, cfdata_t cf, void *aux)
54{ 54{
55 55
56 if (strcmp((char *)aux, cpu_cd.cd_name) != 0) 56 if (strcmp((char *)aux, cpu_cd.cd_name) != 0)
57 return 0; 57 return 0;
58 if (amiga_realconfig == 0 || cpu_info[0].ci_dev != NULL) 58 if (amiga_realconfig == 0 || cpu_info[0].ci_dev != NULL)
59 return 0; 59 return 0;
60 return 1; 60 return 1;
61} 61}
62 62
63void 63void
64cpu_attach(struct device *parent, struct device *self, void *aux) 64cpu_attach(device_t parent, device_t self, void *aux)
65{ 65{
66 66
67 if (amiga_realconfig) 67 if (amiga_realconfig)
68 (void)cpu_attach_common(self, 0); 68 (void)cpu_attach_common(self, 0);
69} 69}

cvs diff -r1.2 -r1.3 src/sys/arch/amigappc/amigappc/mainbus.c (expand / switch to unified diff)

--- src/sys/arch/amigappc/amigappc/mainbus.c 2010/05/21 12:52:14 1.2
+++ src/sys/arch/amigappc/amigappc/mainbus.c 2011/06/05 17:03:16 1.3
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: mainbus.c,v 1.2 2010/05/21 12:52:14 phx Exp $ */ 1/* $NetBSD: mainbus.c,v 1.3 2011/06/05 17:03:16 matt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2008,2009 Frank Wille. 4 * Copyright (c) 2008,2009 Frank Wille.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Written by Frank Wille for The NetBSD Project. 7 * Written by Frank Wille for The NetBSD Project.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -48,63 +48,63 @@ @@ -48,63 +48,63 @@
48 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 48 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
49 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 49 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
50 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 50 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
51 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 51 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
52 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 52 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
53 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 53 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
54 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 54 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
55 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 55 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
56 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 56 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
57 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 57 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
58 */ 58 */
59 59
60#include <sys/cdefs.h> 60#include <sys/cdefs.h>
61__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.2 2010/05/21 12:52:14 phx Exp $"); 61__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.3 2011/06/05 17:03:16 matt Exp $");
62 62
63#include <sys/param.h> 63#include <sys/param.h>
64#include <sys/device.h> 64#include <sys/device.h>
65#include <sys/malloc.h> 65#include <sys/malloc.h>
66#include <sys/systm.h> 66#include <sys/systm.h>
67 67
68#include <machine/autoconf.h> 68#include <machine/autoconf.h>
69#include <machine/bus.h> 69#include <machine/bus.h>
70 70
71#include <amiga/amiga/cfdev.h> 71#include <amiga/amiga/cfdev.h>
72#include <amiga/amiga/device.h> 72#include <amiga/amiga/device.h>
73 73
74#if 0 74#if 0
75#include "mainbus.h" 75#include "mainbus.h"
76 76
77#if NCPU == 0 77#if NCPU == 0
78#error A cpu device is now required 78#error A cpu device is now required
79#endif 79#endif
80#endif 80#endif
81 81
82void mbattach(struct device *, struct device *, void *); 82void mbattach(device_t, device_t, void *);
83int mbprint(void *, const char *); 83int mbprint(void *, const char *);
84int mbmatch(struct device *, struct cfdata *, void *); 84int mbmatch(device_t, cfdata_t, void *);
85 85
86CFATTACH_DECL(mainbus, sizeof(struct device), 86CFATTACH_DECL_NEW(mainbus, 0,
87 mbmatch, mbattach, NULL, NULL); 87 mbmatch, mbattach, NULL, NULL);
88 88
89int 89int
90mbmatch(struct device *parent, struct cfdata *cfp, void *aux) 90mbmatch(device_t parent, cfdata_t cfp, void *aux)
91{ 91{
92 92
93 return 1; 93 return 1;
94} 94}
95 95
96void 96void
97mbattach(struct device *parent, struct device *self, void *aux) 97mbattach(device_t parent, device_t self, void *aux)
98{ 98{
99 99
100 printf("\n"); 100 printf("\n");
101 101
102 /* 102 /*
103 * Always find the CPU 103 * Always find the CPU
104 */ 104 */
105 config_found_ia(self, "mainbus", __UNCONST("cpu"), mbprint); 105 config_found_ia(self, "mainbus", __UNCONST("cpu"), mbprint);
106 106
107 /* 107 /*
108 * "find" all the things that should be there. 108 * "find" all the things that should be there.
109 */ 109 */
110 if (is_a3000() || is_a4000()) 110 if (is_a3000() || is_a4000())

cvs diff -r1.10 -r1.11 src/sys/arch/arm/mainbus/cpu_mainbus.c (expand / switch to unified diff)

--- src/sys/arch/arm/mainbus/cpu_mainbus.c 2009/03/14 15:36:02 1.10
+++ src/sys/arch/arm/mainbus/cpu_mainbus.c 2011/06/05 17:03:16 1.11
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: cpu_mainbus.c,v 1.10 2009/03/14 15:36:02 dsl Exp $ */ 1/* $NetBSD: cpu_mainbus.c,v 1.11 2011/06/05 17:03:16 matt Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1995 Mark Brinicombe. 4 * Copyright (c) 1995 Mark Brinicombe.
5 * Copyright (c) 1995 Brini. 5 * Copyright (c) 1995 Brini.
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
11 * 1. Redistributions of source code must retain the above copyright 11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer. 12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright 13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the 14 * notice, this list of conditions and the following disclaimer in the
@@ -32,64 +32,64 @@ @@ -32,64 +32,64 @@
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE. 33 * SUCH DAMAGE.
34 * 34 *
35 * RiscBSD kernel project 35 * RiscBSD kernel project
36 * 36 *
37 * cpu.c 37 * cpu.c
38 * 38 *
39 * Probing and configuration for the master cpu 39 * Probing and configuration for the master cpu
40 * 40 *
41 * Created : 10/10/95 41 * Created : 10/10/95
42 */ 42 */
43 43
44#include <sys/cdefs.h> 44#include <sys/cdefs.h>
45__KERNEL_RCSID(0, "$NetBSD: cpu_mainbus.c,v 1.10 2009/03/14 15:36:02 dsl Exp $"); 45__KERNEL_RCSID(0, "$NetBSD: cpu_mainbus.c,v 1.11 2011/06/05 17:03:16 matt Exp $");
46 46
47#include <sys/param.h> 47#include <sys/param.h>
48#include <sys/systm.h> 48#include <sys/systm.h>
49#include <sys/malloc.h> 49#include <sys/malloc.h>
50#include <sys/device.h> 50#include <sys/device.h>
51#include <sys/proc.h> 51#include <sys/proc.h>
52#if 0 52#if 0
53#include <sys/conf.h> 53#include <sys/conf.h>
54#include <uvm/uvm_extern.h> 54#include <uvm/uvm_extern.h>
55#include <machine/io.h> 55#include <machine/io.h>
56#endif 56#endif
57#include <machine/cpu.h> 57#include <machine/cpu.h>
58#if 0 58#if 0
59#include <arm/cpus.h> 59#include <arm/cpus.h>
60#include <arm/undefined.h> 60#include <arm/undefined.h>
61#endif 61#endif
62 62
63/* 63/*
64 * Prototypes 64 * Prototypes
65 */ 65 */
66static int cpu_mainbus_match(struct device *, struct cfdata *, void *); 66static int cpu_mainbus_match(device_t, cfdata_t, void *);
67static void cpu_mainbus_attach(struct device *, struct device *, void *); 67static void cpu_mainbus_attach(device_t, device_t, void *);
68  68
69/* 69/*
70 * int cpumatch(struct device *parent, struct cfdata *cf, void *aux) 70 * int cpumatch(device_t parent, cfdata_t cf, void *aux)
71 * 71 *
72 * Probe for the main cpu. Currently all this does is return 1 to 72 * Probe for the main cpu. Currently all this does is return 1 to
73 * indicate that the cpu was found. 73 * indicate that the cpu was found.
74 */  74 */
75  75
76static int 76static int
77cpu_mainbus_match(struct device *parent, struct cfdata *cf, void *aux) 77cpu_mainbus_match(device_t parent, cfdata_t cf, void *aux)
78{ 78{
79 return(1); 79 return(1);
80} 80}
81 81
82/* 82/*
83 * void cpusattach(struct device *parent, struct device *dev, void *aux) 83 * void cpusattach(device_t parent, device_t dev, void *aux)
84 * 84 *
85 * Attach the main cpu 85 * Attach the main cpu
86 */ 86 */
87  87
88static void 88static void
89cpu_mainbus_attach(struct device *parent, struct device *self, void *aux) 89cpu_mainbus_attach(device_t parent, device_t self, void *aux)
90{ 90{
91 cpu_attach(self); 91 cpu_attach(self);
92} 92}
93 93
94CFATTACH_DECL(cpu_mainbus, sizeof(struct device), 94CFATTACH_DECL_NEW(cpu_mainbus, 0,
95 cpu_mainbus_match, cpu_mainbus_attach, NULL, NULL); 95 cpu_mainbus_match, cpu_mainbus_attach, NULL, NULL);

cvs diff -r1.16 -r1.17 src/sys/arch/arm/mainbus/mainbus.c (expand / switch to unified diff)

--- src/sys/arch/arm/mainbus/mainbus.c 2009/03/14 15:36:02 1.16
+++ src/sys/arch/arm/mainbus/mainbus.c 2011/06/05 17:03:16 1.17
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: mainbus.c,v 1.16 2009/03/14 15:36:02 dsl Exp $ */ 1/* $NetBSD: mainbus.c,v 1.17 2011/06/05 17:03:16 matt Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1994,1995 Mark Brinicombe. 4 * Copyright (c) 1994,1995 Mark Brinicombe.
5 * Copyright (c) 1994 Brini. 5 * Copyright (c) 1994 Brini.
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
11 * 1. Redistributions of source code must retain the above copyright 11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer. 12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright 13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the 14 * notice, this list of conditions and the following disclaimer in the
@@ -32,71 +32,71 @@ @@ -32,71 +32,71 @@
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE. 33 * SUCH DAMAGE.
34 * 34 *
35 * RiscBSD kernel project 35 * RiscBSD kernel project
36 * 36 *
37 * mainbus.c 37 * mainbus.c
38 * 38 *
39 * mainbus configuration 39 * mainbus configuration
40 * 40 *
41 * Created : 15/12/94 41 * Created : 15/12/94
42 */ 42 */
43 43
44#include <sys/cdefs.h> 44#include <sys/cdefs.h>
45__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.16 2009/03/14 15:36:02 dsl Exp $"); 45__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.17 2011/06/05 17:03:16 matt Exp $");
46 46
47#include <sys/param.h> 47#include <sys/param.h>
48#include <sys/systm.h> 48#include <sys/systm.h>
49#include <sys/kernel.h> 49#include <sys/kernel.h>
50#include <sys/conf.h> 50#include <sys/conf.h>
51#include <sys/malloc.h> 51#include <sys/malloc.h>
52#include <sys/device.h> 52#include <sys/device.h>
53 53
54#if defined(arm32) /* XXX */ 54#if defined(arm32) /* XXX */
55#include <machine/io.h> 55#include <machine/io.h>
56#endif 56#endif
57#include <machine/bus.h> 57#include <machine/bus.h>
58#include <arm/mainbus/mainbus.h> 58#include <arm/mainbus/mainbus.h>
59#include "locators.h" 59#include "locators.h"
60 60
61/* 61/*
62 * mainbus is a root device so we a bus space tag to pass to children 62 * mainbus is a root device so we a bus space tag to pass to children
63 * 63 *
64 * The tag is provided by mainbus_io.c and mainbus_io_asm.S 64 * The tag is provided by mainbus_io.c and mainbus_io_asm.S
65 */ 65 */
66 66
67extern struct bus_space mainbus_bs_tag; 67extern struct bus_space mainbus_bs_tag;
68 68
69/* Prototypes for functions provided */ 69/* Prototypes for functions provided */
70 70
71static int mainbusmatch(struct device *, struct cfdata *, void *); 71static int mainbusmatch(device_t, cfdata_t, void *);
72static void mainbusattach(struct device *, struct device *, void *); 72static void mainbusattach(device_t, device_t, void *);
73static int mainbusprint(void *aux, const char *mainbus); 73static int mainbusprint(void *aux, const char *mainbus);
74static int mainbussearch(struct device *, struct cfdata *, 74static int mainbussearch(device_t, cfdata_t,
75 const int *, void *); 75 const int *, void *);
76 76
77/* attach and device structures for the device */ 77/* attach and device structures for the device */
78 78
79CFATTACH_DECL(mainbus, sizeof(struct device), 79CFATTACH_DECL_NEW(mainbus, 0,
80 mainbusmatch, mainbusattach, NULL, NULL); 80 mainbusmatch, mainbusattach, NULL, NULL);
81 81
82/* 82/*
83 * int mainbusmatch(struct device *parent, struct cfdata *cf, void *aux) 83 * int mainbusmatch(device_t parent, cfdata_t cf, void *aux)
84 * 84 *
85 * Always match for unit 0 85 * Always match for unit 0
86 */ 86 */
87 87
88static int 88static int
89mainbusmatch(struct device *parent, struct cfdata *cf, void *aux) 89mainbusmatch(device_t parent, cfdata_t cf, void *aux)
90{ 90{
91 return (1); 91 return (1);
92} 92}
93 93
94/* 94/*
95 * int mainbusprint(void *aux, const char *mainbus) 95 * int mainbusprint(void *aux, const char *mainbus)
96 * 96 *
97 * print routine used during config of children 97 * print routine used during config of children
98 */ 98 */
99 99
100static int 100static int
101mainbusprint(void *aux, const char *mainbus) 101mainbusprint(void *aux, const char *mainbus)
102{ 102{
@@ -106,33 +106,33 @@ mainbusprint(void *aux, const char *main @@ -106,33 +106,33 @@ mainbusprint(void *aux, const char *main
106 aprint_normal(" base 0x%x", mb->mb_iobase); 106 aprint_normal(" base 0x%x", mb->mb_iobase);
107 if (mb->mb_iosize > 1) 107 if (mb->mb_iosize > 1)
108 aprint_normal("-0x%x", mb->mb_iobase + mb->mb_iosize - 1); 108 aprint_normal("-0x%x", mb->mb_iobase + mb->mb_iosize - 1);
109 if (mb->mb_irq != -1) 109 if (mb->mb_irq != -1)
110 aprint_normal(" irq %d", mb->mb_irq); 110 aprint_normal(" irq %d", mb->mb_irq);
111 if (mb->mb_drq != -1) 111 if (mb->mb_drq != -1)
112 aprint_normal(" drq 0x%08x", mb->mb_drq); 112 aprint_normal(" drq 0x%08x", mb->mb_drq);
113 113
114/* XXXX print flags */ 114/* XXXX print flags */
115 return (QUIET); 115 return (QUIET);
116} 116}
117 117
118/* 118/*
119 * int mainbussearch(struct device *parent, struct device *self, void *aux) 119 * int mainbussearch(device_t parent, device_t self, void *aux)
120 * 120 *
121 * search routine used during the config of children 121 * search routine used during the config of children
122 */ 122 */
123 123
124static int 124static int
125mainbussearch(struct device *parent, struct cfdata *cf, const int *ldesc, void *aux) 125mainbussearch(device_t parent, cfdata_t cf, const int *ldesc, void *aux)
126{ 126{
127 struct mainbus_attach_args mb; 127 struct mainbus_attach_args mb;
128 int tryagain; 128 int tryagain;
129 129
130 do { 130 do {
131 if (cf->cf_loc[MAINBUSCF_BASE] == MAINBUSCF_BASE_DEFAULT) { 131 if (cf->cf_loc[MAINBUSCF_BASE] == MAINBUSCF_BASE_DEFAULT) {
132 mb.mb_iobase = MAINBUSCF_BASE_DEFAULT; 132 mb.mb_iobase = MAINBUSCF_BASE_DEFAULT;
133 mb.mb_iosize = 0; 133 mb.mb_iosize = 0;
134 mb.mb_drq = MAINBUSCF_DACK_DEFAULT; 134 mb.mb_drq = MAINBUSCF_DACK_DEFAULT;
135 mb.mb_irq = MAINBUSCF_IRQ_DEFAULT; 135 mb.mb_irq = MAINBUSCF_IRQ_DEFAULT;
136 } else {  136 } else {
137 mb.mb_iobase = cf->cf_loc[MAINBUSCF_BASE]; 137 mb.mb_iobase = cf->cf_loc[MAINBUSCF_BASE];
138#if defined(arm32) && !defined(EB7500ATX) 138#if defined(arm32) && !defined(EB7500ATX)
@@ -145,28 +145,28 @@ mainbussearch(struct device *parent, str @@ -145,28 +145,28 @@ mainbussearch(struct device *parent, str
145 mb.mb_iot = &mainbus_bs_tag; 145 mb.mb_iot = &mainbus_bs_tag;
146 146
147 tryagain = 0; 147 tryagain = 0;
148 if (config_match(parent, cf, &mb) > 0) { 148 if (config_match(parent, cf, &mb) > 0) {
149 config_attach(parent, cf, &mb, mainbusprint); 149 config_attach(parent, cf, &mb, mainbusprint);
150/* tryagain = (cf->cf_fstate == FSTATE_STAR);*/ 150/* tryagain = (cf->cf_fstate == FSTATE_STAR);*/
151 } 151 }
152 } while (tryagain); 152 } while (tryagain);
153 153
154 return (0); 154 return (0);
155} 155}
156 156
157/* 157/*
158 * void mainbusattach(struct device *parent, struct device *self, void *aux) 158 * void mainbusattach(device_t parent, device_t self, void *aux)
159 * 159 *
160 * probe and attach all children 160 * probe and attach all children
161 */ 161 */
162 162
163static void 163static void
164mainbusattach(struct device *parent, struct device *self, void *aux) 164mainbusattach(device_t parent, device_t self, void *aux)
165{ 165{
166 aprint_naive("\n"); 166 aprint_naive("\n");
167 aprint_normal("\n"); 167 aprint_normal("\n");
168 168
169 config_search_ia(mainbussearch, self, "mainbus", NULL); 169 config_search_ia(mainbussearch, self, "mainbus", NULL);
170} 170}
171 171
172/* End of mainbus.c */ 172/* End of mainbus.c */

cvs diff -r1.1 -r1.2 src/sys/arch/emips/emips/mainbus.c (expand / switch to unified diff)

--- src/sys/arch/emips/emips/mainbus.c 2011/01/26 01:18:50 1.1
+++ src/sys/arch/emips/emips/mainbus.c 2011/06/05 17:03:16 1.2
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: mainbus.c,v 1.1 2011/01/26 01:18:50 pooka Exp $ */ 1/* $NetBSD: mainbus.c,v 1.2 2011/06/05 17:03:16 matt 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,59 +19,59 @@ @@ -19,59 +19,59 @@
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.1 2011/01/26 01:18:50 pooka Exp $"); 32__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.2 2011/06/05 17:03:16 matt 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 printf("\n");
71 71
72 /* Interrupt initialization, phase 1 */ 72 /* Interrupt initialization, phase 1 */
73 intr_init(1); 73 intr_init(1);
74 74
75 ma.ma_name = "cpu"; 75 ma.ma_name = "cpu";
76 ma.ma_slot = 0; 76 ma.ma_slot = 0;
77 config_found(self, &ma, mbprint); 77 config_found(self, &ma, mbprint);

cvs diff -r1.6 -r1.7 src/sys/arch/evbppc/ev64260/mainbus.c (expand / switch to unified diff)

--- src/sys/arch/evbppc/ev64260/mainbus.c 2010/04/28 13:51:55 1.6
+++ src/sys/arch/evbppc/ev64260/mainbus.c 2011/06/05 17:03:18 1.7
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: mainbus.c,v 1.6 2010/04/28 13:51:55 kiyohara Exp $ */ 1/* $NetBSD: mainbus.c,v 1.7 2011/06/05 17:03:18 matt Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. 4 * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 3. All advertising materials mentioning features or use of this software 14 * 3. All advertising materials mentioning features or use of this software
@@ -21,50 +21,50 @@ @@ -21,50 +21,50 @@
21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 22 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 23 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 24 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */ 31 */
32 32
33#include <sys/cdefs.h> 33#include <sys/cdefs.h>
34__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.6 2010/04/28 13:51:55 kiyohara Exp $"); 34__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.7 2011/06/05 17:03:18 matt Exp $");
35 35
36#include "mainbus.h" 36#include "mainbus.h"
37#include "opt_multiprocessor.h" 37#include "opt_multiprocessor.h"
38 38
39#include <sys/param.h> 39#include <sys/param.h>
40#include <sys/bus.h> 40#include <sys/bus.h>
41#include <sys/device.h> 41#include <sys/device.h>
42#include <sys/errno.h> 42#include <sys/errno.h>
43 43
44#include <evbppc/ev64260/ev64260.h> 44#include <evbppc/ev64260/ev64260.h>
45 45
46#include "locators.h" 46#include "locators.h"
47 47
48#if NCPU == 0 48#if NCPU == 0
49#error A cpu device is now required 49#error A cpu device is now required
50#endif 50#endif
51 51
52 52
53int mainbus_match(device_t, cfdata_t, void *); 53int mainbus_match(device_t, cfdata_t, void *);
54void mainbus_attach(device_t, device_t, void *); 54void mainbus_attach(device_t, device_t, void *);
55int mainbus_cfprint(void *, const char *); 55int mainbus_cfprint(void *, const char *);
56 56
57CFATTACH_DECL(mainbus, sizeof(struct device), 57CFATTACH_DECL_NEW(mainbus, 0,
58 mainbus_match, mainbus_attach, NULL, NULL); 58 mainbus_match, mainbus_attach, NULL, NULL);
59 59
60/* 60/*
61 * Probe for the mainbus; always succeeds. 61 * Probe for the mainbus; always succeeds.
62 */ 62 */
63int 63int
64mainbus_match(device_t parent, cfdata_t match, void *aux) 64mainbus_match(device_t parent, cfdata_t match, void *aux)
65{ 65{
66 66
67 return 1; 67 return 1;
68} 68}
69 69
70/* 70/*
@@ -115,27 +115,27 @@ mainbus_cfprint(void *aux, const char *p @@ -115,27 +115,27 @@ mainbus_cfprint(void *aux, const char *p
115 if (pnp) 115 if (pnp)
116 aprint_normal("%s at %s", mba->mba_name, pnp); 116 aprint_normal("%s at %s", mba->mba_name, pnp);
117 if (mba->mba_unit != -1) 117 if (mba->mba_unit != -1)
118 aprint_normal(" unit %d", mba->mba_unit); 118 aprint_normal(" unit %d", mba->mba_unit);
119 if (mba->mba_addr != MAINBUSCF_ADDR_DEFAULT) 119 if (mba->mba_addr != MAINBUSCF_ADDR_DEFAULT)
120 aprint_normal(" addr 0x%08x", mba->mba_addr); 120 aprint_normal(" addr 0x%08x", mba->mba_addr);
121 return UNCONF; 121 return UNCONF;
122} 122}
123 123
124 124
125static int cpu_match(device_t, cfdata_t, void *); 125static int cpu_match(device_t, cfdata_t, void *);
126static void cpu_attach(device_t, device_t, void *); 126static void cpu_attach(device_t, device_t, void *);
127 127
128CFATTACH_DECL(cpu, sizeof(struct device), cpu_match, cpu_attach, NULL, NULL); 128CFATTACH_DECL_NEW(cpu, 0, cpu_match, cpu_attach, NULL, NULL);
129 129
130int 130int
131cpu_match(device_t parent, cfdata_t cf, void *aux) 131cpu_match(device_t parent, cfdata_t cf, void *aux)
132{ 132{
133 struct mainbus_attach_args *mba = aux; 133 struct mainbus_attach_args *mba = aux;
134 134
135 if (strcmp(mba->mba_name, "cpu") != 0) 135 if (strcmp(mba->mba_name, "cpu") != 0)
136 return 0; 136 return 0;
137 137
138 return 1; 138 return 1;
139} 139}
140 140
141void 141void

cvs diff -r1.3 -r1.4 src/sys/arch/evbppc/pmppc/mainbus.c (expand / switch to unified diff)

--- src/sys/arch/evbppc/pmppc/mainbus.c 2008/04/28 20:23:17 1.3
+++ src/sys/arch/evbppc/pmppc/mainbus.c 2011/06/05 17:03:18 1.4
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: mainbus.c,v 1.3 2008/04/28 20:23:17 martin Exp $ */ 1/* $NetBSD: mainbus.c,v 1.4 2011/06/05 17:03:18 matt Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2002 The NetBSD Foundation, Inc. 4 * Copyright (c) 2002 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Lennart Augustsson (lennart@augustsson.net) at Sandburst Corp. 8 * by Lennart Augustsson (lennart@augustsson.net) at Sandburst Corp.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -20,65 +20,65 @@ @@ -20,65 +20,65 @@
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.3 2008/04/28 20:23:17 martin Exp $"); 33__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.4 2011/06/05 17:03:18 matt Exp $");
34 34
35#include <sys/param.h> 35#include <sys/param.h>
36#include <sys/device.h> 36#include <sys/device.h>
37#include <sys/systm.h> 37#include <sys/systm.h>
38 38
39#include <machine/bus.h> 39#include <machine/bus.h>
40#include <machine/pmppc.h> 40#include <machine/pmppc.h>
41#include <arch/evbppc/pmppc/dev/mainbus.h> 41#include <arch/evbppc/pmppc/dev/mainbus.h>
42 42
43#include <dev/ic/cpc700reg.h> 43#include <dev/ic/cpc700reg.h>
44 44
45#include "locators.h" 45#include "locators.h"
46#include "mainbus.h" 46#include "mainbus.h"
47 47
48#if NCPU == 0 48#if NCPU == 0
49#error A cpu device is now required 49#error A cpu device is now required
50#endif 50#endif
51 51
52int mainbus_match(struct device *, struct cfdata *, void *); 52int mainbus_match(device_t, cfdata_t, void *);
53void mainbus_attach(struct device *, struct device *, void *); 53void mainbus_attach(device_t, device_t, void *);
54 54
55CFATTACH_DECL(mainbus, sizeof(struct device), 55CFATTACH_DECL_NEW(mainbus, 0,
56 mainbus_match, mainbus_attach, NULL, NULL); 56 mainbus_match, mainbus_attach, NULL, NULL);
57 57
58static int mainbus_print(void *, const char *); 58static int mainbus_print(void *, const char *);
59 59
60/* 60/*
61 * Probe for the mainbus; always succeeds. 61 * Probe for the mainbus; always succeeds.
62 */ 62 */
63int 63int
64mainbus_match(struct device *parent, struct cfdata *match, void *aux) 64mainbus_match(device_t parent, cfdata_t match, void *aux)
65{ 65{
66 66
67 return 1; 67 return 1;
68} 68}
69 69
70static int 70static int
71mainbus_submatch(struct device *parent, struct cfdata *cf, 71mainbus_submatch(device_t parent, cfdata_t cf,
72 const int *ldesc, void *aux) 72 const int *ldesc, void *aux)
73{ 73{
74 struct mainbus_attach_args *maa = aux; 74 struct mainbus_attach_args *maa = aux;
75 75
76 if (cf->cf_loc[MAINBUSCF_ADDR] != maa->mb_addr) 76 if (cf->cf_loc[MAINBUSCF_ADDR] != maa->mb_addr)
77 return (0); 77 return (0);
78 78
79 return (config_match(parent, cf, aux)); 79 return (config_match(parent, cf, aux));
80} 80}
81 81
82static int 82static int
83mainbus_print(void *aux, const char *pnp) 83mainbus_print(void *aux, const char *pnp)
84{ 84{
@@ -87,27 +87,27 @@ mainbus_print(void *aux, const char *pnp @@ -87,27 +87,27 @@ mainbus_print(void *aux, const char *pnp
87 if (pnp) 87 if (pnp)
88 aprint_normal("%s at %s", mba->mb_name, pnp); 88 aprint_normal("%s at %s", mba->mb_name, pnp);
89 if (mba->mb_addr != MAINBUSCF_ADDR_DEFAULT) 89 if (mba->mb_addr != MAINBUSCF_ADDR_DEFAULT)
90 aprint_normal(" addr 0x%08lx", mba->mb_addr); 90 aprint_normal(" addr 0x%08lx", mba->mb_addr);
91 if (mba->mb_irq != MAINBUSCF_IRQ_DEFAULT) 91 if (mba->mb_irq != MAINBUSCF_IRQ_DEFAULT)
92 aprint_normal(" irq %d", mba->mb_irq); 92 aprint_normal(" irq %d", mba->mb_irq);
93 return (UNCONF); 93 return (UNCONF);
94} 94}
95 95
96/* 96/*
97 * Attach the mainbus. 97 * Attach the mainbus.
98 */ 98 */
99void 99void
100mainbus_attach(struct device *parent, struct device *self, void *aux) 100mainbus_attach(device_t parent, device_t self, void *aux)
101{ 101{
102 struct mainbus_attach_args maa; 102 struct mainbus_attach_args maa;
103 103
104 printf(": Artesyn PM/PPC\n"); 104 printf(": Artesyn PM/PPC\n");
105 printf("%s: %sPCI bus Monarch\n", self->dv_xname, 105 printf("%s: %sPCI bus Monarch\n", self->dv_xname,
106 a_config.a_is_monarch ? "" : "not"); 106 a_config.a_is_monarch ? "" : "not");
107 printf("%s: boot from %s, %sECC, %s L2 cache\n", 107 printf("%s: boot from %s, %sECC, %s L2 cache\n",
108 self->dv_xname, 108 self->dv_xname,
109 a_config.a_boot_device == A_BOOT_ROM ? "ROM" : "flash", 109 a_config.a_boot_device == A_BOOT_ROM ? "ROM" : "flash",
110 a_config.a_has_ecc ? "" : "no ", 110 a_config.a_has_ecc ? "" : "no ",
111 a_config.a_l2_cache == A_CACHE_PARITY ? "parity" : 111 a_config.a_l2_cache == A_CACHE_PARITY ? "parity" :
112 a_config.a_l2_cache == A_CACHE_NO_PARITY ? "no-parity" : "no"); 112 a_config.a_l2_cache == A_CACHE_NO_PARITY ? "no-parity" : "no");
113 113
@@ -140,40 +140,40 @@ mainbus_attach(struct device *parent, st @@ -140,40 +140,40 @@ mainbus_attach(struct device *parent, st
140 maa.mb_irq = MAINBUSCF_IRQ_DEFAULT; 140 maa.mb_irq = MAINBUSCF_IRQ_DEFAULT;
141 maa.u.mb_flash.size = a_config.a_flash_size; 141 maa.u.mb_flash.size = a_config.a_flash_size;
142 maa.u.mb_flash.width = a_config.a_flash_width; 142 maa.u.mb_flash.width = a_config.a_flash_width;
143 config_found_sm_loc(self, "mainbus", NULL, &maa, mainbus_print, 143 config_found_sm_loc(self, "mainbus", NULL, &maa, mainbus_print,
144 mainbus_submatch); 144 mainbus_submatch);
145 } 145 }
146 146
147 maa.mb_name = "cpc"; 147 maa.mb_name = "cpc";
148 maa.mb_addr = MAINBUSCF_ADDR_DEFAULT; 148 maa.mb_addr = MAINBUSCF_ADDR_DEFAULT;
149 maa.mb_irq = MAINBUSCF_IRQ_DEFAULT; 149 maa.mb_irq = MAINBUSCF_IRQ_DEFAULT;
150 config_found(self, &maa, mainbus_print); 150 config_found(self, &maa, mainbus_print);
151} 151}
152 152
153static int cpu_match(struct device *, struct cfdata *, void *); 153static int cpu_match(device_t, cfdata_t, void *);
154static void cpu_attach(struct device *, struct device *, void *); 154static void cpu_attach(device_t, device_t, void *);
155 155
156CFATTACH_DECL(cpu, sizeof(struct device), 156CFATTACH_DECL_NEW(cpu, 0,
157 cpu_match, cpu_attach, NULL, NULL); 157 cpu_match, cpu_attach, NULL, NULL);
158 158
159extern struct cfdriver cpu_cd; 159extern struct cfdriver cpu_cd;
160 160
161int 161int
162cpu_match(struct device *parent, struct cfdata *cf, void *aux) 162cpu_match(device_t parent, cfdata_t cf, void *aux)
163{ 163{
164 struct mainbus_attach_args *maa = aux; 164 struct mainbus_attach_args *maa = aux;
165 165
166 if (strcmp(maa->mb_name, cpu_cd.cd_name) != 0) 166 if (strcmp(maa->mb_name, cpu_cd.cd_name) != 0)
167 return 0; 167 return 0;
168 168
169 if (cpu_info[0].ci_dev != NULL) 169 if (cpu_info[0].ci_dev != NULL)
170 return 0; 170 return 0;
171 171
172 return 1; 172 return 1;
173} 173}
174 174
175void 175void
176cpu_attach(struct device *parent, struct device *self, void *aux) 176cpu_attach(device_t parent, device_t self, void *aux)
177{ 177{
178 (void) cpu_attach_common(self, 0); 178 (void) cpu_attach_common(self, 0);
179} 179}

cvs diff -r1.8 -r1.9 src/sys/arch/luna68k/luna68k/mainbus.c (expand / switch to unified diff)

--- src/sys/arch/luna68k/luna68k/mainbus.c 2009/03/14 21:04:11 1.8
+++ src/sys/arch/luna68k/luna68k/mainbus.c 2011/06/05 17:03:18 1.9
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: mainbus.c,v 1.8 2009/03/14 21:04:11 dsl Exp $ */ 1/* $NetBSD: mainbus.c,v 1.9 2011/06/05 17:03:18 matt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2000 The NetBSD Foundation, Inc. 4 * Copyright (c) 2000 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Tohru Nishimura. 8 * by Tohru Nishimura.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -21,66 +21,66 @@ @@ -21,66 +21,66 @@
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33 33
34__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.8 2009/03/14 21:04:11 dsl Exp $"); 34__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.9 2011/06/05 17:03:18 matt Exp $");
35 35
36#include <sys/param.h> 36#include <sys/param.h>
37#include <sys/systm.h> 37#include <sys/systm.h>
38#include <sys/device.h> 38#include <sys/device.h>
39 39
40#include <machine/cpu.h> 40#include <machine/cpu.h>
41#include <machine/autoconf.h> 41#include <machine/autoconf.h>
42 42
43static struct mainbus_attach_args devs[] = { 43static struct mainbus_attach_args devs[] = {
44 { "clock", 0x45000000, -1 }, /* Mostek/Dallas TimeKeeper */ 44 { "clock", 0x45000000, -1 }, /* Mostek/Dallas TimeKeeper */
45 { "le", 0xf1000000, 3 }, /* Am7990 */ 45 { "le", 0xf1000000, 3 }, /* Am7990 */
46 { "sio", 0x51000000, 6 }, /* uPD7201A */ 46 { "sio", 0x51000000, 6 }, /* uPD7201A */
47 { "fb", 0xc1100000, -1 }, /* BrookTree RAMDAC */ 47 { "fb", 0xc1100000, -1 }, /* BrookTree RAMDAC */
48 { "spc", 0xe1000000, 2 }, /* MB89352 */ 48 { "spc", 0xe1000000, 2 }, /* MB89352 */
49#if 0 49#if 0
50 { "spc", 0xe1000040, 2 }, /* ditto */ 50 { "spc", 0xe1000040, 2 }, /* ditto */
51#endif 51#endif
52}; 52};
53 53
54static void mainbus_attach(struct device *, struct device *, void *); 54static void mainbus_attach(device_t, device_t, void *);
55static int mainbus_match(struct device *, struct cfdata *, void *); 55static int mainbus_match(device_t, cfdata_t, void *);
56static int mainbus_print(void *, const char *); 56static int mainbus_print(void *, const char *);
57 57
58CFATTACH_DECL(mainbus, sizeof(struct device), 58CFATTACH_DECL_NEW(mainbus, 0,
59 mainbus_match, mainbus_attach, NULL, NULL); 59 mainbus_match, mainbus_attach, NULL, NULL);
60 60
61static int 61static int
62mainbus_match(struct device *parent, struct cfdata *cf, void *args) 62mainbus_match(device_t parent, cfdata_t cf, void *args)
63{ 63{
64 static int mainbus_matched; 64 static int mainbus_matched;
65 65
66 if (mainbus_matched) 66 if (mainbus_matched)
67 return (0); 67 return (0);
68 68
69 return ((mainbus_matched = 1)); 69 return ((mainbus_matched = 1));
70} 70}
71 71
72static void 72static void
73mainbus_attach(struct device *parent, struct device *self, void *args) 73mainbus_attach(device_t parent, device_t self, void *args)
74{ 74{
75 int i; 75 int i;
76  76
77 if (machtype == LUNA_II) 77 if (machtype == LUNA_II)
78 devs[1].ma_addr = 0xf0000000; 78 devs[1].ma_addr = 0xf0000000;
79 printf("\n"); 79 printf("\n");
80 for (i = 0; i < sizeof(devs)/sizeof(devs[0]); i++) 80 for (i = 0; i < sizeof(devs)/sizeof(devs[0]); i++)
81 config_found(self, (void *)&devs[i], mainbus_print); 81 config_found(self, (void *)&devs[i], mainbus_print);
82} 82}
83 83
84static int 84static int
85mainbus_print(void *aux, const char *pnp) 85mainbus_print(void *aux, const char *pnp)
86{ 86{

cvs diff -r1.20 -r1.21 src/sys/arch/mac68k/mac68k/mainbus.c (expand / switch to unified diff)

--- src/sys/arch/mac68k/mac68k/mainbus.c 2008/04/28 20:23:27 1.20
+++ src/sys/arch/mac68k/mac68k/mainbus.c 2011/06/05 17:03:18 1.21
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: mainbus.c,v 1.20 2008/04/28 20:23:27 martin Exp $ */ 1/* $NetBSD: mainbus.c,v 1.21 2011/06/05 17:03:18 matt Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1996 The NetBSD Foundation, Inc. 4 * Copyright (c) 1996 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe. 8 * by Jason R. Thorpe.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -20,86 +20,86 @@ @@ -20,86 +20,86 @@
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.20 2008/04/28 20:23:27 martin Exp $"); 33__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.21 2011/06/05 17:03:18 matt Exp $");
34 34
35#include <sys/param.h> 35#include <sys/param.h>
36#include <sys/device.h> 36#include <sys/device.h>
37#include <sys/systm.h> 37#include <sys/systm.h>
38 38
39#define _M68K_BUS_DMA_PRIVATE 39#define _M68K_BUS_DMA_PRIVATE
40#include <machine/autoconf.h> 40#include <machine/autoconf.h>
41 41
42static int mainbus_match(struct device *, struct cfdata *, void *); 42static int mainbus_match(device_t, cfdata_t, void *);
43static void mainbus_attach(struct device *, struct device *, void *); 43static void mainbus_attach(device_t, device_t, void *);
44static int mainbus_search(struct device *, struct cfdata *, 44static int mainbus_search(device_t, cfdata_t,
45 const int *ldesc, void *); 45 const int *ldesc, void *);
46 46
47CFATTACH_DECL(mainbus, sizeof(struct device), 47CFATTACH_DECL_NEW(mainbus, 0,
48 mainbus_match, mainbus_attach, NULL, NULL); 48 mainbus_match, mainbus_attach, NULL, NULL);
49 49
50struct m68k_bus_dma_tag mac68k_bus_dma_tag = { 50struct m68k_bus_dma_tag mac68k_bus_dma_tag = {
51 NULL, /* _cookie */ 51 NULL, /* _cookie */
52 52
53 0, /* _boundary */ 53 0, /* _boundary */
54 54
55 _bus_dmamap_create, /* _dmamap_create */ 55 _bus_dmamap_create, /* _dmamap_create */
56 _bus_dmamap_destroy, /* _dmamap_destroy */ 56 _bus_dmamap_destroy, /* _dmamap_destroy */
57 _bus_dmamap_load_direct, /* _dmamap_load */ 57 _bus_dmamap_load_direct, /* _dmamap_load */
58 _bus_dmamap_load_mbuf_direct, /* _dmamap_load_mbuf */ 58 _bus_dmamap_load_mbuf_direct, /* _dmamap_load_mbuf */
59 _bus_dmamap_load_uio_direct, /* _dmamap_load_uio */ 59 _bus_dmamap_load_uio_direct, /* _dmamap_load_uio */
60 _bus_dmamap_load_raw_direct, /* _dmamap_load_raw */ 60 _bus_dmamap_load_raw_direct, /* _dmamap_load_raw */
61 _bus_dmamap_unload, /* _dmamap_unload */ 61 _bus_dmamap_unload, /* _dmamap_unload */
62 _bus_dmamap_sync, /* _dmamap_sync */ 62 _bus_dmamap_sync, /* _dmamap_sync */
63  63
64 _bus_dmamem_alloc, /* _dmamem_alloc */ 64 _bus_dmamem_alloc, /* _dmamem_alloc */
65 _bus_dmamem_free, /* _dmamem_free */ 65 _bus_dmamem_free, /* _dmamem_free */
66 _bus_dmamem_map, /* _dmamem_map */ 66 _bus_dmamem_map, /* _dmamem_map */
67 _bus_dmamem_unmap, /* _dmamem_unmap */ 67 _bus_dmamem_unmap, /* _dmamem_unmap */
68 _bus_dmamem_mmap /* _dmamem_mmap */ 68 _bus_dmamem_mmap /* _dmamem_mmap */
69}; 69};
70 70
71static int 71static int
72mainbus_match(struct device *parent, struct cfdata *cf, void *aux) 72mainbus_match(device_t parent, cfdata_t cf, void *aux)
73{ 73{
74 static int mainbus_matched = 0; 74 static int mainbus_matched = 0;
75 75
76 /* Allow only one instance. */ 76 /* Allow only one instance. */
77 if (mainbus_matched) 77 if (mainbus_matched)
78 return (0); 78 return (0);
79 79
80 mainbus_matched = 1; 80 mainbus_matched = 1;
81 return 1; 81 return 1;
82} 82}
83 83
84static void 84static void
85mainbus_attach(struct device *parent, struct device *self, void *aux) 85mainbus_attach(device_t parent, device_t self, void *aux)
86{ 86{
87 struct mainbus_attach_args mba; 87 struct mainbus_attach_args mba;
88 88
89 printf("\n"); 89 printf("\n");
90 90
91 mba.mba_bst = MAC68K_BUS_SPACE_MEM; 91 mba.mba_bst = MAC68K_BUS_SPACE_MEM;
92 mba.mba_dmat = &mac68k_bus_dma_tag; 92 mba.mba_dmat = &mac68k_bus_dma_tag;
93 93
94 /* Search for and attach children. */ 94 /* Search for and attach children. */
95 config_search_ia(mainbus_search, self, "mainbus", &mba); 95 config_search_ia(mainbus_search, self, "mainbus", &mba);
96} 96}
97 97
98static int 98static int
99mainbus_search(struct device *parent, struct cfdata *cf, 99mainbus_search(device_t parent, cfdata_t cf,
100 const int *ldesc, void *aux) 100 const int *ldesc, void *aux)
101{ 101{
102 if (config_match(parent, cf, aux) > 0) 102 if (config_match(parent, cf, aux) > 0)
103 config_attach(parent, cf, aux, NULL); 103 config_attach(parent, cf, aux, NULL);
104 return 0; 104 return 0;
105} 105}

cvs diff -r1.55 -r1.56 src/sys/arch/macppc/macppc/cpu.c (expand / switch to unified diff)

--- src/sys/arch/macppc/macppc/cpu.c 2011/06/05 16:52:24 1.55
+++ src/sys/arch/macppc/macppc/cpu.c 2011/06/05 17:03:16 1.56
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: cpu.c,v 1.55 2011/06/05 16:52:24 matt Exp $ */ 1/* $NetBSD: cpu.c,v 1.56 2011/06/05 17:03:16 matt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2001 Tsubai Masanari. 4 * Copyright (c) 2001 Tsubai Masanari.
5 * Copyright (c) 1998, 1999, 2001 Internet Research Institute, Inc. 5 * Copyright (c) 1998, 1999, 2001 Internet Research Institute, Inc.
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
11 * 1. Redistributions of source code must retain the above copyright 11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer. 12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright 13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the 14 * notice, this list of conditions and the following disclaimer in the
@@ -23,27 +23,27 @@ @@ -23,27 +23,27 @@
23 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 23 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
24 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 24 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
25 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 25 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
26 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 26 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
27 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 27 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
28 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */ 33 */
34 34
35#include <sys/cdefs.h> 35#include <sys/cdefs.h>
36__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.55 2011/06/05 16:52:24 matt Exp $"); 36__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.56 2011/06/05 17:03:16 matt Exp $");
37 37
38#include "opt_ppcparam.h" 38#include "opt_ppcparam.h"
39#include "opt_multiprocessor.h" 39#include "opt_multiprocessor.h"
40#include "opt_interrupt.h" 40#include "opt_interrupt.h"
41#include "opt_altivec.h" 41#include "opt_altivec.h"
42 42
43#include <sys/param.h> 43#include <sys/param.h>
44#include <sys/systm.h> 44#include <sys/systm.h>
45#include <sys/device.h> 45#include <sys/device.h>
46#include <sys/types.h> 46#include <sys/types.h>
47#include <sys/lwp.h> 47#include <sys/lwp.h>
48 48
49#include <dev/ofw/openfirm.h> 49#include <dev/ofw/openfirm.h>
@@ -65,48 +65,48 @@ __KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.55 @@ -65,48 +65,48 @@ __KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.55
65#include <machine/fpu.h> 65#include <machine/fpu.h>
66#include <machine/pcb.h> 66#include <machine/pcb.h>
67#include <machine/pio.h> 67#include <machine/pio.h>
68#include <machine/trap.h> 68#include <machine/trap.h>
69 69
70#include "pic_openpic.h" 70#include "pic_openpic.h"
71 71
72#ifndef OPENPIC 72#ifndef OPENPIC
73#if NPIC_OPENPIC > 0 73#if NPIC_OPENPIC > 0
74#define OPENPIC 74#define OPENPIC
75#endif /* NOPENPIC > 0 */ 75#endif /* NOPENPIC > 0 */
76#endif /* OPENPIC */ 76#endif /* OPENPIC */
77 77
78int cpumatch(struct device *, struct cfdata *, void *); 78int cpumatch(device_t, cfdata_t, void *);
79void cpuattach(struct device *, struct device *, void *); 79void cpuattach(device_t, device_t, void *);
80 80
81void identifycpu(char *); 81void identifycpu(char *);
82static void ohare_init(void); 82static void ohare_init(void);
83 83
84CFATTACH_DECL(cpu, sizeof(struct device), 84CFATTACH_DECL_NEW(cpu, 0,
85 cpumatch, cpuattach, NULL, NULL); 85 cpumatch, cpuattach, NULL, NULL);
86 86
87extern struct cfdriver cpu_cd; 87extern struct cfdriver cpu_cd;
88 88
89#define HH_INTR_SECONDARY 0xf80000c0 89#define HH_INTR_SECONDARY 0xf80000c0
90#define HH_ARBCONF 0xf8000090 90#define HH_ARBCONF 0xf8000090
91 91
92extern uint32_t ticks_per_intr; 92extern uint32_t ticks_per_intr;
93 93
94#ifdef OPENPIC 94#ifdef OPENPIC
95extern void openpic_set_priority(int, int); 95extern void openpic_set_priority(int, int);
96#endif 96#endif
97 97
98int 98int
99cpumatch(struct device *parent, struct cfdata *cf, void *aux) 99cpumatch(device_t parent, cfdata_t cf, void *aux)
100{ 100{
101 struct confargs *ca = aux; 101 struct confargs *ca = aux;
102 int *reg = ca->ca_reg; 102 int *reg = ca->ca_reg;
103 int node; 103 int node;
104 104
105 if (strcmp(ca->ca_name, cpu_cd.cd_name) != 0) 105 if (strcmp(ca->ca_name, cpu_cd.cd_name) != 0)
106 return 0; 106 return 0;
107 107
108 node = OF_finddevice("/cpus"); 108 node = OF_finddevice("/cpus");
109 if (node != -1) { 109 if (node != -1) {
110 for (node = OF_child(node); node != 0; node = OF_peer(node)) { 110 for (node = OF_child(node); node != 0; node = OF_peer(node)) {
111 uint32_t cpunum; 111 uint32_t cpunum;
112 int l; 112 int l;
@@ -118,53 +118,53 @@ cpumatch(struct device *parent, struct c @@ -118,53 +118,53 @@ cpumatch(struct device *parent, struct c
118 switch (reg[0]) { 118 switch (reg[0]) {
119 case 0: /* primary CPU */ 119 case 0: /* primary CPU */
120 return 1; 120 return 1;
121 case 1: /* secondary CPU */ 121 case 1: /* secondary CPU */
122 if (OF_finddevice("/hammerhead") != -1) 122 if (OF_finddevice("/hammerhead") != -1)
123 if (in32rb(HH_ARBCONF) & 0x02) 123 if (in32rb(HH_ARBCONF) & 0x02)
124 return 1; 124 return 1;
125 break; 125 break;
126 } 126 }
127 127
128 return 0; 128 return 0;
129} 129}
130 130
131void cpu_OFgetspeed(struct device *, struct cpu_info *); 131void cpu_OFgetspeed(device_t, struct cpu_info *);
132 132
133void 133void
134cpu_OFgetspeed(struct device *self, struct cpu_info *ci) 134cpu_OFgetspeed(device_t self, struct cpu_info *ci)
135{ 135{
136 int node; 136 int node;
137 137
138 node = OF_finddevice("/cpus"); 138 node = OF_finddevice("/cpus");
139 if (node != -1) { 139 if (node != -1) {
140 for (node = OF_child(node); node; node = OF_peer(node)) { 140 for (node = OF_child(node); node; node = OF_peer(node)) {
141 uint32_t cpunum; 141 uint32_t cpunum;
142 int l; 142 int l;
143 l = OF_getprop(node, "reg", &cpunum, sizeof(cpunum)); 143 l = OF_getprop(node, "reg", &cpunum, sizeof(cpunum));
144 if (l == 4 && ci->ci_cpuid == cpunum) { 144 if (l == 4 && ci->ci_cpuid == cpunum) {
145 uint32_t cf; 145 uint32_t cf;
146 l = OF_getprop(node, "clock-frequency", 146 l = OF_getprop(node, "clock-frequency",
147 &cf, sizeof(cf)); 147 &cf, sizeof(cf));
148 if (l == 4) 148 if (l == 4)
149 ci->ci_khz = cf / 1000; 149 ci->ci_khz = cf / 1000;
150 break; 150 break;
151 } 151 }
152 } 152 }
153 } 153 }
154} 154}
155 155
156void 156void
157cpuattach(struct device *parent, struct device *self, void *aux) 157cpuattach(device_t parent, device_t self, void *aux)
158{ 158{
159 struct cpu_info *ci; 159 struct cpu_info *ci;
160 struct confargs *ca = aux; 160 struct confargs *ca = aux;
161 int id = ca->ca_reg[0]; 161 int id = ca->ca_reg[0];
162 162
163 ci = cpu_attach_common(self, id); 163 ci = cpu_attach_common(self, id);
164 if (ci == NULL) 164 if (ci == NULL)
165 return; 165 return;
166 166
167 if (ci->ci_khz == 0) { 167 if (ci->ci_khz == 0) {
168 cpu_OFgetspeed(self, ci); 168 cpu_OFgetspeed(self, ci);
169 } 169 }
170 170

cvs diff -r1.20 -r1.21 src/sys/arch/macppc/macppc/mainbus.c (expand / switch to unified diff)

--- src/sys/arch/macppc/macppc/mainbus.c 2009/03/14 21:04:12 1.20
+++ src/sys/arch/macppc/macppc/mainbus.c 2011/06/05 17:03:16 1.21
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: mainbus.c,v 1.20 2009/03/14 21:04:12 dsl Exp $ */ 1/* $NetBSD: mainbus.c,v 1.21 2011/06/05 17:03:16 matt Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. 4 * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 3. All advertising materials mentioning features or use of this software 14 * 3. All advertising materials mentioning features or use of this software
@@ -21,59 +21,59 @@ @@ -21,59 +21,59 @@
21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 22 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 23 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 24 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */ 31 */
32 32
33#include <sys/cdefs.h> 33#include <sys/cdefs.h>
34__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.20 2009/03/14 21:04:12 dsl Exp $"); 34__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.21 2011/06/05 17:03:16 matt Exp $");
35 35
36#include <sys/param.h> 36#include <sys/param.h>
37#include <sys/device.h> 37#include <sys/device.h>
38#include <sys/systm.h> 38#include <sys/systm.h>
39 39
40#include <dev/pci/pcivar.h> 40#include <dev/pci/pcivar.h>
41#include <dev/ofw/openfirm.h> 41#include <dev/ofw/openfirm.h>
42 42
43#include <machine/autoconf.h> 43#include <machine/autoconf.h>
44 44
45#include <powerpc/pic/picvar.h> 45#include <powerpc/pic/picvar.h>
46 46
47int mainbus_match(struct device *, struct cfdata *, void *); 47int mainbus_match(device_t, cfdata_t, void *);
48void mainbus_attach(struct device *, struct device *, void *); 48void mainbus_attach(device_t, device_t, void *);
49 49
50CFATTACH_DECL(mainbus, sizeof(struct device), 50CFATTACH_DECL_NEW(mainbus, 0,
51 mainbus_match, mainbus_attach, NULL, NULL); 51 mainbus_match, mainbus_attach, NULL, NULL);
52 52
53/* 53/*
54 * Probe for the mainbus; always succeeds. 54 * Probe for the mainbus; always succeeds.
55 */ 55 */
56int 56int
57mainbus_match(struct device *parent, struct cfdata *cf, void *aux) 57mainbus_match(device_t parent, cfdata_t cf, void *aux)
58{ 58{
59 return 1; 59 return 1;
60} 60}
61 61
62/* 62/*
63 * Attach the mainbus. 63 * Attach the mainbus.
64 */ 64 */
65void 65void
66mainbus_attach(struct device *parent, struct device *self, void *aux) 66mainbus_attach(device_t parent, device_t self, void *aux)
67{ 67{
68 struct ofbus_attach_args oba; 68 struct ofbus_attach_args oba;
69 struct confargs ca; 69 struct confargs ca;
70 int node, i; 70 int node, i;
71 u_int32_t reg[4]; 71 u_int32_t reg[4];
72 char name[32]; 72 char name[32];
73 73
74 printf("\n"); 74 printf("\n");
75 75
76 for (i = 0; i < 2; i++) { 76 for (i = 0; i < 2; i++) {
77 ca.ca_name = "cpu"; 77 ca.ca_name = "cpu";
78 ca.ca_reg = reg; 78 ca.ca_reg = reg;
79 reg[0] = i; 79 reg[0] = i;

cvs diff -r1.8 -r1.9 src/sys/arch/mmeye/mmeye/mainbus.c (expand / switch to unified diff)

--- src/sys/arch/mmeye/mmeye/mainbus.c 2011/02/19 10:46:29 1.8
+++ src/sys/arch/mmeye/mmeye/mainbus.c 2011/06/05 17:03:18 1.9
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: mainbus.c,v 1.8 2011/02/19 10:46:29 kiyohara Exp $ */ 1/* $NetBSD: mainbus.c,v 1.9 2011/06/05 17:03:18 matt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2002 The NetBSD Foundation, Inc. 4 * Copyright (c) 2002 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -17,45 +17,45 @@ @@ -17,45 +17,45 @@
17 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
18 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 18 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 * POSSIBILITY OF SUCH DAMAGE. 26 * POSSIBILITY OF SUCH DAMAGE.
27 */ 27 */
28 28
29#include <sys/cdefs.h> 29#include <sys/cdefs.h>
30__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.8 2011/02/19 10:46:29 kiyohara Exp $"); 30__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.9 2011/06/05 17:03:18 matt Exp $");
31 31
32#include <sys/param.h> 32#include <sys/param.h>
33#include <sys/systm.h> 33#include <sys/systm.h>
34#include <sys/device.h> 34#include <sys/device.h>
35#include <machine/autoconf.h> 35#include <machine/autoconf.h>
36 36
37#include "locators.h" 37#include "locators.h"
38 38
39static int mainbus_match(device_t, struct cfdata *, void *); 39static int mainbus_match(device_t, cfdata_t, void *);
40static void mainbus_attach(device_t, device_t, void *); 40static void mainbus_attach(device_t, device_t, void *);
41static int mainbus_search(device_t, cfdata_t, const int *, void *); 41static int mainbus_search(device_t, cfdata_t, const int *, void *);
42static int mainbus_print(void *, const char *); 42static int mainbus_print(void *, const char *);
43 43
44CFATTACH_DECL(mainbus, sizeof(struct device), 44CFATTACH_DECL_NEW(mainbus, 0,
45 mainbus_match, mainbus_attach, NULL, NULL); 45 mainbus_match, mainbus_attach, NULL, NULL);
46 46
47static int 47static int
48mainbus_match(device_t parent, struct cfdata *cf, void *aux) 48mainbus_match(device_t parent, cfdata_t cf, void *aux)
49{ 49{
50 50
51 return 1; 51 return 1;
52} 52}
53 53
54static void 54static void
55mainbus_attach(device_t parent, device_t self, void *aux) 55mainbus_attach(device_t parent, device_t self, void *aux)
56{ 56{
57 struct mainbus_attach_args maa; 57 struct mainbus_attach_args maa;
58 58
59 aprint_naive("\n"); 59 aprint_naive("\n");
60 aprint_normal("\n"); 60 aprint_normal("\n");
61 61

cvs diff -r1.20 -r1.21 src/sys/arch/mvme68k/dev/mainbus.c (expand / switch to unified diff)

--- src/sys/arch/mvme68k/dev/mainbus.c 2008/04/28 20:23:29 1.20
+++ src/sys/arch/mvme68k/dev/mainbus.c 2011/06/05 17:03:19 1.21
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: mainbus.c,v 1.20 2008/04/28 20:23:29 martin Exp $ */ 1/* $NetBSD: mainbus.c,v 1.21 2011/06/05 17:03:19 matt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2000 The NetBSD Foundation, Inc. 4 * Copyright (c) 2000 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Steve C. Woodford 8 * by Steve C. Woodford
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -24,57 +24,57 @@ @@ -24,57 +24,57 @@
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32/* 32/*
33 * Derived from the mainbus code in mvme68k/autoconf.c by Chuck Cranor. 33 * Derived from the mainbus code in mvme68k/autoconf.c by Chuck Cranor.
34 */ 34 */
35 35
36#include <sys/cdefs.h> 36#include <sys/cdefs.h>
37__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.20 2008/04/28 20:23:29 martin Exp $"); 37__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.21 2011/06/05 17:03:19 matt Exp $");
38 38
39#include "vmetwo.h" 39#include "vmetwo.h"
40 40
41#include <sys/param.h> 41#include <sys/param.h>
42#include <sys/kernel.h> 42#include <sys/kernel.h>
43#include <sys/systm.h> 43#include <sys/systm.h>
44#include <sys/device.h> 44#include <sys/device.h>
45 45
46#define _MVME68K_BUS_DMA_PRIVATE 46#define _MVME68K_BUS_DMA_PRIVATE
47#define _MVME68K_BUS_SPACE_PRIVATE 47#define _MVME68K_BUS_SPACE_PRIVATE
48#include <machine/bus.h> 48#include <machine/bus.h>
49#undef _MVME68K_BUS_DMA_PRIVATE 49#undef _MVME68K_BUS_DMA_PRIVATE
50#undef _MVME68K_BUS_SPACE_PRIVATE 50#undef _MVME68K_BUS_SPACE_PRIVATE
51#include <machine/cpu.h> 51#include <machine/cpu.h>
52 52
53#include <mvme68k/dev/mainbus.h> 53#include <mvme68k/dev/mainbus.h>
54 54
55#if defined(MVME162) || defined(MVME172) || defined(MVME167) || defined(MVME177) 55#if defined(MVME162) || defined(MVME172) || defined(MVME167) || defined(MVME177)
56#if NVMETWO == 0 56#if NVMETWO == 0
57#include <dev/vme/vmevar.h> 57#include <dev/vme/vmevar.h>
58#include <dev/mvme/mvmebus.h> 58#include <dev/mvme/mvmebus.h>
59#include <dev/mvme/vme_twovar.h> 59#include <dev/mvme/vme_twovar.h>
60#endif 60#endif
61#endif 61#endif
62 62
63void mainbus_attach(struct device *, struct device *, void *); 63void mainbus_attach(device_t, device_t, void *);
64int mainbus_match(struct device *, struct cfdata *, void *); 64int mainbus_match(device_t, cfdata_t, void *);
65int mainbus_print(void *, const char *); 65int mainbus_print(void *, const char *);
66 66
67CFATTACH_DECL(mainbus, sizeof(struct device), 67CFATTACH_DECL_NEW(mainbus, 0,
68 mainbus_match, mainbus_attach, NULL, NULL); 68 mainbus_match, mainbus_attach, NULL, NULL);
69 69
70 70
71struct mainbus_devices { 71struct mainbus_devices {
72 const char *md_name; 72 const char *md_name;
73 bus_addr_t md_offset; 73 bus_addr_t md_offset;
74}; 74};
75 75
76#ifdef MVME147 76#ifdef MVME147
77static struct mainbus_devices mainbusdevs_147[] = { 77static struct mainbus_devices mainbusdevs_147[] = {
78 {"pcc", MAINBUS_PCC_OFFSET}, 78 {"pcc", MAINBUS_PCC_OFFSET},
79 {"timekeeper", MAINBUS_TK147_OFFSET}, 79 {"timekeeper", MAINBUS_TK147_OFFSET},
80 {NULL, 0} 80 {NULL, 0}
@@ -112,39 +112,39 @@ struct mvme68k_bus_space_tag _mainbus_sp @@ -112,39 +112,39 @@ struct mvme68k_bus_space_tag _mainbus_sp
112 _bus_space_map, 112 _bus_space_map,
113 _bus_space_unmap, 113 _bus_space_unmap,
114 _bus_space_peek_1, 114 _bus_space_peek_1,
115 _bus_space_peek_2, 115 _bus_space_peek_2,
116 _bus_space_peek_4, 116 _bus_space_peek_4,
117 _bus_space_poke_1, 117 _bus_space_poke_1,
118 _bus_space_poke_2, 118 _bus_space_poke_2,
119 _bus_space_poke_4 119 _bus_space_poke_4
120}; 120};
121 121
122 122
123/* ARGSUSED */ 123/* ARGSUSED */
124int 124int
125mainbus_match(struct device *parent, struct cfdata *cf, void *args) 125mainbus_match(device_t parent, cfdata_t cf, void *args)
126{ 126{
127 static int mainbus_matched; 127 static int mainbus_matched;
128 128
129 if (mainbus_matched) 129 if (mainbus_matched)
130 return 0; 130 return 0;
131 131
132 return (mainbus_matched = 1); 132 return (mainbus_matched = 1);
133} 133}
134 134
135/* ARGSUSED */ 135/* ARGSUSED */
136void 136void
137mainbus_attach(struct device *parent, struct device *self, void *args) 137mainbus_attach(device_t parent, device_t self, void *args)
138{ 138{
139 struct mainbus_attach_args ma; 139 struct mainbus_attach_args ma;
140 struct mainbus_devices *devices; 140 struct mainbus_devices *devices;
141 int i; 141 int i;
142 142
143 printf("\n"); 143 printf("\n");
144 144
145 /* 145 /*
146 * Attach children appropriate for this CPU. 146 * Attach children appropriate for this CPU.
147 */ 147 */
148 switch (machineid) { 148 switch (machineid) {
149#ifdef MVME147 149#ifdef MVME147
150 case MVME_147: 150 case MVME_147:

cvs diff -r1.8 -r1.9 src/sys/arch/mvmeppc/mvmeppc/cpu.c (expand / switch to unified diff)

--- src/sys/arch/mvmeppc/mvmeppc/cpu.c 2008/04/28 20:23:29 1.8
+++ src/sys/arch/mvmeppc/mvmeppc/cpu.c 2011/06/05 17:03:16 1.9
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: cpu.c,v 1.8 2008/04/28 20:23:29 martin Exp $ */ 1/* $NetBSD: cpu.c,v 1.9 2011/06/05 17:03:16 matt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc. 4 * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by NONAKA Kimihiro. 8 * by NONAKA Kimihiro.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -20,48 +20,48 @@ @@ -20,48 +20,48 @@
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.8 2008/04/28 20:23:29 martin Exp $"); 33__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.9 2011/06/05 17:03:16 matt Exp $");
34 34
35#include <sys/param.h> 35#include <sys/param.h>
36#include <sys/systm.h> 36#include <sys/systm.h>
37#include <sys/device.h> 37#include <sys/device.h>
38 38
39#include <machine/autoconf.h> 39#include <machine/autoconf.h>
40#include <machine/bus.h> 40#include <machine/bus.h>
41#include <machine/cpu.h> 41#include <machine/cpu.h>
42#include <machine/platform.h> 42#include <machine/platform.h>
43 43
44int cpumatch(struct device *, struct cfdata *, void *); 44int cpumatch(device_t, cfdata_t, void *);
45void cpuattach(struct device *, struct device *, void *); 45void cpuattach(device_t, device_t, void *);
46 46
47CFATTACH_DECL(cpu, sizeof(struct device), 47CFATTACH_DECL_NEW(cpu, 0,
48 cpumatch, cpuattach, NULL, NULL); 48 cpumatch, cpuattach, NULL, NULL);
49 49
50extern struct cfdriver cpu_cd; 50extern struct cfdriver cpu_cd;
51 51
52int 52int
53cpumatch(struct device *parent, struct cfdata *cfdata, void *aux) 53cpumatch(device_t parent, cfdata_t cfdata, void *aux)
54{ 54{
55 55
56 if (cpu_info[0].ci_dev != NULL) 56 if (cpu_info[0].ci_dev != NULL)
57 return (0); 57 return (0);
58 return (1); 58 return (1);
59} 59}
60 60
61void 61void
62cpuattach(struct device *parent, struct device *self, void *aux) 62cpuattach(device_t parent, device_t self, void *aux)
63{ 63{
64 cpu_attach_common(self, 0); 64 cpu_attach_common(self, 0);
65 65
66 (*platform->cpu_setup)(self); 66 (*platform->cpu_setup)(self);
67} 67}

cvs diff -r1.12 -r1.13 src/sys/arch/mvmeppc/mvmeppc/mainbus.c (expand / switch to unified diff)

--- src/sys/arch/mvmeppc/mvmeppc/mainbus.c 2011/05/17 17:34:51 1.12
+++ src/sys/arch/mvmeppc/mvmeppc/mainbus.c 2011/06/05 17:03:16 1.13
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: mainbus.c,v 1.12 2011/05/17 17:34:51 dyoung Exp $ */ 1/* $NetBSD: mainbus.c,v 1.13 2011/06/05 17:03:16 matt Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. 4 * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 3. All advertising materials mentioning features or use of this software 14 * 3. All advertising materials mentioning features or use of this software
@@ -21,75 +21,75 @@ @@ -21,75 +21,75 @@
21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 22 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 23 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 24 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */ 31 */
32 32
33#include <sys/cdefs.h> 33#include <sys/cdefs.h>
34__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.12 2011/05/17 17:34:51 dyoung Exp $"); 34__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.13 2011/06/05 17:03:16 matt Exp $");
35 35
36#include <sys/param.h> 36#include <sys/param.h>
37#include <sys/extent.h> 37#include <sys/extent.h>
38#include <sys/systm.h> 38#include <sys/systm.h>
39#include <sys/device.h> 39#include <sys/device.h>
40#include <sys/malloc.h> 40#include <sys/malloc.h>
41 41
42#include <machine/autoconf.h> 42#include <machine/autoconf.h>
43#include <machine/bus.h> 43#include <machine/bus.h>
44 44
45#include "pci.h" 45#include "pci.h"
46#include "opt_pci.h" 46#include "opt_pci.h"
47#include <dev/pci/pcivar.h> 47#include <dev/pci/pcivar.h>
48#include <dev/pci/pciconf.h> 48#include <dev/pci/pciconf.h>
49#include <machine/pci_machdep.h> 49#include <machine/pci_machdep.h>
50#include <machine/isa_machdep.h> 50#include <machine/isa_machdep.h>
51 51
52int mainbus_match(struct device *, struct cfdata *, void *); 52int mainbus_match(device_t, cfdata_t, void *);
53void mainbus_attach(struct device *, struct device *, void *); 53void mainbus_attach(device_t, device_t, void *);
54 54
55CFATTACH_DECL(mainbus, sizeof(struct device), 55CFATTACH_DECL_NEW(mainbus, 0,
56 mainbus_match, mainbus_attach, NULL, NULL); 56 mainbus_match, mainbus_attach, NULL, NULL);
57 57
58int mainbus_print(void *, const char *); 58int mainbus_print(void *, const char *);
59 59
60 60
61/* There can be only one */ 61/* There can be only one */
62static int mainbus_found; 62static int mainbus_found;
63struct powerpc_isa_chipset genppc_ict; 63struct powerpc_isa_chipset genppc_ict;
64struct genppc_pci_chipset *genppc_pct; 64struct genppc_pci_chipset *genppc_pct;
65 65
66/* 66/*
67 * Probe for the mainbus; always succeeds. 67 * Probe for the mainbus; always succeeds.
68 */ 68 */
69int 69int
70mainbus_match(struct device *parent, struct cfdata *match, void *aux) 70mainbus_match(device_t parent, cfdata_t match, void *aux)
71{ 71{
72 72
73 if (mainbus_found) 73 if (mainbus_found)
74 return 0; 74 return 0;
75 return 1; 75 return 1;
76} 76}
77 77
78/* 78/*
79 * Attach the mainbus. 79 * Attach the mainbus.
80 */ 80 */
81void 81void
82mainbus_attach(struct device *parent, struct device *self, void *aux) 82mainbus_attach(device_t parent, device_t self, void *aux)
83{ 83{
84 struct pcibus_attach_args pba; 84 struct pcibus_attach_args pba;
85#if NPCI > 0 85#if NPCI > 0
86 struct genppc_pci_chipset_businfo *pbi; 86 struct genppc_pci_chipset_businfo *pbi;
87#endif 87#endif
88#ifdef PCI_NETBSD_CONFIGURE 88#ifdef PCI_NETBSD_CONFIGURE
89 struct extent *ioext, *memext; 89 struct extent *ioext, *memext;
90#endif 90#endif
91 91
92 mainbus_found = 1; 92 mainbus_found = 1;
93 93
94 aprint_normal("\n"); 94 aprint_normal("\n");
95 95

cvs diff -r1.10 -r1.11 src/sys/arch/next68k/next68k/mainbus.c (expand / switch to unified diff)

--- src/sys/arch/next68k/next68k/mainbus.c 2008/04/28 20:23:30 1.10
+++ src/sys/arch/next68k/next68k/mainbus.c 2011/06/05 17:03:19 1.11
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: mainbus.c,v 1.10 2008/04/28 20:23:30 martin Exp $ */ 1/* $NetBSD: mainbus.c,v 1.11 2011/06/05 17:03:19 matt Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1996 The NetBSD Foundation, Inc. 4 * Copyright (c) 1996 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe. 8 * by Jason R. Thorpe.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -20,86 +20,86 @@ @@ -20,86 +20,86 @@
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.10 2008/04/28 20:23:30 martin Exp $"); 33__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.11 2011/06/05 17:03:19 matt Exp $");
34 34
35#include <sys/param.h> 35#include <sys/param.h>
36#include <sys/device.h> 36#include <sys/device.h>
37#include <sys/systm.h> 37#include <sys/systm.h>
38 38
39#define _M68K_BUS_DMA_PRIVATE 39#define _M68K_BUS_DMA_PRIVATE
40#include <machine/autoconf.h> 40#include <machine/autoconf.h>
41 41
42static int mainbus_match(struct device *, struct cfdata *, void *); 42static int mainbus_match(device_t, cfdata_t, void *);
43static void mainbus_attach(struct device *, struct device *, void *); 43static void mainbus_attach(device_t, device_t, void *);
44static int mainbus_search(struct device *, struct cfdata *, 44static int mainbus_search(device_t, cfdata_t,
45 const int *, void *); 45 const int *, void *);
46 46
47CFATTACH_DECL(mainbus, sizeof(struct device), 47CFATTACH_DECL_NEW(mainbus, 0,
48 mainbus_match, mainbus_attach, NULL, NULL); 48 mainbus_match, mainbus_attach, NULL, NULL);
49 49
50struct m68k_bus_dma_tag next68k_bus_dma_tag = { 50struct m68k_bus_dma_tag next68k_bus_dma_tag = {
51 NULL, /* _cookie */ 51 NULL, /* _cookie */
52 52
53 0, /* _boundary */ 53 0, /* _boundary */
54 54
55 _bus_dmamap_create, /* _dmamap_create */ 55 _bus_dmamap_create, /* _dmamap_create */
56 _bus_dmamap_destroy, /* _dmamap_destroy */ 56 _bus_dmamap_destroy, /* _dmamap_destroy */
57 _bus_dmamap_load_direct, /* _dmamap_load */ 57 _bus_dmamap_load_direct, /* _dmamap_load */
58 _bus_dmamap_load_mbuf_direct, /* _dmamap_load_mbuf */ 58 _bus_dmamap_load_mbuf_direct, /* _dmamap_load_mbuf */
59 _bus_dmamap_load_uio_direct, /* _dmamap_load_uio */ 59 _bus_dmamap_load_uio_direct, /* _dmamap_load_uio */
60 _bus_dmamap_load_raw_direct, /* _dmamap_load_raw */ 60 _bus_dmamap_load_raw_direct, /* _dmamap_load_raw */
61 _bus_dmamap_unload, /* _dmamap_unload */ 61 _bus_dmamap_unload, /* _dmamap_unload */
62 _bus_dmamap_sync, /* _dmamap_sync */ 62 _bus_dmamap_sync, /* _dmamap_sync */
63  63
64 _bus_dmamem_alloc, /* _dmamem_alloc */ 64 _bus_dmamem_alloc, /* _dmamem_alloc */
65 _bus_dmamem_free, /* _dmamem_free */ 65 _bus_dmamem_free, /* _dmamem_free */
66 _bus_dmamem_map, /* _dmamem_map */ 66 _bus_dmamem_map, /* _dmamem_map */
67 _bus_dmamem_unmap, /* _dmamem_unmap */ 67 _bus_dmamem_unmap, /* _dmamem_unmap */
68 _bus_dmamem_mmap /* _dmamem_mmap */ 68 _bus_dmamem_mmap /* _dmamem_mmap */
69}; 69};
70 70
71static int mainbus_attached = 0; 71static int mainbus_attached = 0;
72 72
73static int 73static int
74mainbus_match(struct device *parent, struct cfdata *cf, void *aux) 74mainbus_match(device_t parent, cfdata_t cf, void *aux)
75{ 75{
76 /* Allow only one instance. */ 76 /* Allow only one instance. */
77 if (mainbus_attached) 77 if (mainbus_attached)
78 return (0); 78 return (0);
79 79
80 return 1; 80 return 1;
81} 81}
82 82
83static void 83static void
84mainbus_attach(struct device *parent, struct device *self, void *aux) 84mainbus_attach(device_t parent, device_t self, void *aux)
85{ 85{
86 struct mainbus_attach_args mba; 86 struct mainbus_attach_args mba;
87 87
88 printf("\n"); 88 printf("\n");
89 89
90 mba.mba_dmat = &next68k_bus_dma_tag; 90 mba.mba_dmat = &next68k_bus_dma_tag;
91 91
92 /* Search for and attach children. */ 92 /* Search for and attach children. */
93 config_search_ia(mainbus_search, self, "mainbus", &mba); 93 config_search_ia(mainbus_search, self, "mainbus", &mba);
94 94
95 mainbus_attached = 1; 95 mainbus_attached = 1;
96} 96}
97 97
98static int 98static int
99mainbus_search(struct device *parent, struct cfdata *cf, 99mainbus_search(device_t parent, cfdata_t cf,
100 const int *ldesc, void *aux) 100 const int *ldesc, void *aux)
101{ 101{
102 if (config_match(parent, cf, aux) > 0) 102 if (config_match(parent, cf, aux) > 0)
103 config_attach(parent, cf, aux, NULL); 103 config_attach(parent, cf, aux, NULL);
104 return 0; 104 return 0;
105} 105}

cvs diff -r1.14 -r1.15 src/sys/arch/ofppc/ofppc/cpu.c (expand / switch to unified diff)

--- src/sys/arch/ofppc/ofppc/cpu.c 2011/06/05 16:52:24 1.14
+++ src/sys/arch/ofppc/ofppc/cpu.c 2011/06/05 17:03:16 1.15
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: cpu.c,v 1.14 2011/06/05 16:52:24 matt Exp $ */ 1/* $NetBSD: cpu.c,v 1.15 2011/06/05 17:03:16 matt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc. 4 * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by NONAKA Kimihiro; by Jason R. Thorpe. 8 * by NONAKA Kimihiro; by Jason R. Thorpe.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -20,27 +20,27 @@ @@ -20,27 +20,27 @@
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.14 2011/06/05 16:52:24 matt Exp $"); 33__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.15 2011/06/05 17:03:16 matt Exp $");
34 34
35#include "opt_ppcparam.h" 35#include "opt_ppcparam.h"
36#include "opt_multiprocessor.h" 36#include "opt_multiprocessor.h"
37#include "opt_interrupt.h" 37#include "opt_interrupt.h"
38#include "opt_altivec.h" 38#include "opt_altivec.h"
39 39
40#include <sys/param.h> 40#include <sys/param.h>
41#include <sys/systm.h> 41#include <sys/systm.h>
42#include <sys/device.h> 42#include <sys/device.h>
43 43
44#include <dev/ofw/openfirm.h> 44#include <dev/ofw/openfirm.h>
45 45
46#include <powerpc/openpic.h> 46#include <powerpc/openpic.h>
@@ -63,64 +63,64 @@ __KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.14 @@ -63,64 +63,64 @@ __KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.14
63#include <machine/fpu.h> 63#include <machine/fpu.h>
64#include <machine/pcb.h> 64#include <machine/pcb.h>
65#include <machine/pio.h> 65#include <machine/pio.h>
66#include <machine/trap.h> 66#include <machine/trap.h>
67 67
68#include "pic_openpic.h" 68#include "pic_openpic.h"
69 69
70#ifndef OPENPIC 70#ifndef OPENPIC
71#if NPIC_OPENPIC > 0 71#if NPIC_OPENPIC > 0
72#define OPENPIC 72#define OPENPIC
73#endif /* NOPENPIC > 0 */ 73#endif /* NOPENPIC > 0 */
74#endif /* OPENPIC */ 74#endif /* OPENPIC */
75 75
76static int cpu_match(struct device *, struct cfdata *, void *); 76static int cpu_match(device_t, cfdata_t, void *);
77static void cpu_attach(struct device *, struct device *, void *); 77static void cpu_attach(device_t, device_t, void *);
78void cpu_OFgetspeed(struct device *, struct cpu_info *); 78void cpu_OFgetspeed(device_t, struct cpu_info *);
79 79
80CFATTACH_DECL(cpu, sizeof(struct device), 80CFATTACH_DECL_NEW(cpu, 0,
81 cpu_match, cpu_attach, NULL, NULL); 81 cpu_match, cpu_attach, NULL, NULL);
82 82
83extern struct cfdriver cpu_cd; 83extern struct cfdriver cpu_cd;
84extern int machine_has_rtas; 84extern int machine_has_rtas;
85 85
86int 86int
87cpu_match(struct device *parent, struct cfdata *cfdata, void *aux) 87cpu_match(device_t parent, cfdata_t cfdata, void *aux)
88{ 88{
89 struct confargs *ca = aux; 89 struct confargs *ca = aux;
90 int *reg = ca->ca_reg; 90 int *reg = ca->ca_reg;
91 int node; 91 int node;
92 92
93 if (strcmp(ca->ca_name, cpu_cd.cd_name) != 0) 93 if (strcmp(ca->ca_name, cpu_cd.cd_name) != 0)
94 return 0; 94 return 0;
95 95
96 node = OF_finddevice("/cpus"); 96 node = OF_finddevice("/cpus");
97 if (node != -1) { 97 if (node != -1) {
98 for (node = OF_child(node); node != 0; node = OF_peer(node)) { 98 for (node = OF_child(node); node != 0; node = OF_peer(node)) {
99 uint32_t cpunum; 99 uint32_t cpunum;
100 int l; 100 int l;
101 101
102 l = OF_getprop(node, "reg", &cpunum, sizeof(cpunum)); 102 l = OF_getprop(node, "reg", &cpunum, sizeof(cpunum));
103 if (l == 4 && reg[0] == cpunum) 103 if (l == 4 && reg[0] == cpunum)
104 return 1; 104 return 1;
105 } 105 }
106 } 106 }
107 if (reg[0] == 0) 107 if (reg[0] == 0)
108 return 1; 108 return 1;
109 return 0; 109 return 0;
110} 110}
111 111
112void 112void
113cpu_OFgetspeed(struct device *self, struct cpu_info *ci) 113cpu_OFgetspeed(device_t self, struct cpu_info *ci)
114{ 114{
115 int node; 115 int node;
116 node = OF_finddevice("/cpus"); 116 node = OF_finddevice("/cpus");
117 if (node != -1) { 117 if (node != -1) {
118 for (node = OF_child(node); node; node = OF_peer(node)) { 118 for (node = OF_child(node); node; node = OF_peer(node)) {
119 uint32_t cpunum; 119 uint32_t cpunum;
120 int l; 120 int l;
121 121
122 l = OF_getprop(node, "reg", &cpunum, sizeof(cpunum)); 122 l = OF_getprop(node, "reg", &cpunum, sizeof(cpunum));
123 if (l == sizeof(uint32_t) && ci->ci_cpuid == cpunum) { 123 if (l == sizeof(uint32_t) && ci->ci_cpuid == cpunum) {
124 uint32_t cf; 124 uint32_t cf;
125 125
126 l = OF_getprop(node, "clock-frequency", 126 l = OF_getprop(node, "clock-frequency",
@@ -158,27 +158,27 @@ cpu_OFprintcacheinfo(int node) @@ -158,27 +158,27 @@ cpu_OFprintcacheinfo(int node)
158 if (OF_getprop(node, "cache-unified", &l, sizeof(l)) != -1) { 158 if (OF_getprop(node, "cache-unified", &l, sizeof(l)) != -1) {
159 aprint_normal("cache "); 159 aprint_normal("cache ");
160 cpu_print_cache_config(icache, iline); 160 cpu_print_cache_config(icache, iline);
161 } else { 161 } else {
162 aprint_normal("I-cache "); 162 aprint_normal("I-cache ");
163 cpu_print_cache_config(icache, iline); 163 cpu_print_cache_config(icache, iline);
164 aprint_normal(", D-cache "); 164 aprint_normal(", D-cache ");
165 cpu_print_cache_config(dcache, dline); 165 cpu_print_cache_config(dcache, dline);
166 } 166 }
167 aprint_normal("\n"); 167 aprint_normal("\n");
168} 168}
169 169
170static void 170static void
171cpu_OFgetcache(struct device *self, struct cpu_info *ci) 171cpu_OFgetcache(device_t self, struct cpu_info *ci)
172{ 172{
173 int node, cpu=-1; 173 int node, cpu=-1;
174 char name[32]; 174 char name[32];
175 175
176 node = OF_finddevice("/cpus"); 176 node = OF_finddevice("/cpus");
177 if (node == -1) 177 if (node == -1)
178 return; 178 return;
179 179
180 for (node = OF_child(node); node; node = OF_peer(node)) { 180 for (node = OF_child(node); node; node = OF_peer(node)) {
181 uint32_t cpunum; 181 uint32_t cpunum;
182 int l; 182 int l;
183 183
184 l = OF_getprop(node, "reg", &cpunum, sizeof(cpunum)); 184 l = OF_getprop(node, "reg", &cpunum, sizeof(cpunum));
@@ -197,27 +197,27 @@ cpu_OFgetcache(struct device *self, stru @@ -197,27 +197,27 @@ cpu_OFgetcache(struct device *self, stru
197 if (strcmp("l2-cache", name) == 0) { 197 if (strcmp("l2-cache", name) == 0) {
198 aprint_normal_dev(self, "L2 "); 198 aprint_normal_dev(self, "L2 ");
199 cpu_OFprintcacheinfo(node); 199 cpu_OFprintcacheinfo(node);
200 } else if (strcmp("l3-cache", name) == 0) { 200 } else if (strcmp("l3-cache", name) == 0) {
201 aprint_normal_dev(self, "L3 "); 201 aprint_normal_dev(self, "L3 ");
202 cpu_OFprintcacheinfo(node); 202 cpu_OFprintcacheinfo(node);
203 } 203 }
204 } 204 }
205 } 205 }
206} 206}
207 207
208 208
209void 209void
210cpu_attach(struct device *parent, struct device *self, void *aux) 210cpu_attach(device_t parent, device_t self, void *aux)
211{ 211{
212 struct cpu_info *ci; 212 struct cpu_info *ci;
213 struct confargs *ca = aux; 213 struct confargs *ca = aux;
214 int id = ca->ca_reg[0]; 214 int id = ca->ca_reg[0];
215 215
216 ci = cpu_attach_common(self, id); 216 ci = cpu_attach_common(self, id);
217 if (ci == NULL) 217 if (ci == NULL)
218 return; 218 return;
219 219
220 if (id > 0) 220 if (id > 0)
221#ifdef MULTIPROCESSOR 221#ifdef MULTIPROCESSOR
222 cpu_spinup(self, ci); 222 cpu_spinup(self, ci);
223#endif 223#endif

cvs diff -r1.26 -r1.27 src/sys/arch/ofppc/ofppc/mainbus.c (expand / switch to unified diff)

--- src/sys/arch/ofppc/ofppc/mainbus.c 2010/06/09 04:41:42 1.26
+++ src/sys/arch/ofppc/ofppc/mainbus.c 2011/06/05 17:03:16 1.27
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: mainbus.c,v 1.26 2010/06/09 04:41:42 kiyohara Exp $ */ 1/* $NetBSD: mainbus.c,v 1.27 2011/06/05 17:03:16 matt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2007 The NetBSD Foundation, Inc. 4 * Copyright (c) 2007 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Tim Rightnour 8 * by Tim Rightnour
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -20,52 +20,52 @@ @@ -20,52 +20,52 @@
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.26 2010/06/09 04:41:42 kiyohara Exp $"); 33__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.27 2011/06/05 17:03:16 matt Exp $");
34 34
35#include "opt_interrupt.h" 35#include "opt_interrupt.h"
36#include "opt_multiprocessor.h" 36#include "opt_multiprocessor.h"
37 37
38#include <sys/param.h> 38#include <sys/param.h>
39#include <sys/device.h> 39#include <sys/device.h>
40#include <sys/systm.h> 40#include <sys/systm.h>
41 41
42#include <dev/pci/pcivar.h> 42#include <dev/pci/pcivar.h>
43#include <dev/ofw/openfirm.h> 43#include <dev/ofw/openfirm.h>
44#include <dev/ofw/ofw_pci.h> 44#include <dev/ofw/ofw_pci.h>
45#include <arch/powerpc/pic/picvar.h> 45#include <arch/powerpc/pic/picvar.h>
46#ifdef MULTIPROCESSOR 46#ifdef MULTIPROCESSOR
47#include <arch/powerpc/pic/ipivar.h> 47#include <arch/powerpc/pic/ipivar.h>
48#endif 48#endif
49#include <machine/pci_machdep.h> 49#include <machine/pci_machdep.h>
50#include <machine/autoconf.h> 50#include <machine/autoconf.h>
51 51
52#include <dev/isa/isareg.h> 52#include <dev/isa/isareg.h>
53#include <dev/isa/isavar.h> 53#include <dev/isa/isavar.h>
54 54
55int mainbus_match(struct device *, struct cfdata *, void *); 55int mainbus_match(device_t, cfdata_t, void *);
56void mainbus_attach(struct device *, struct device *, void *); 56void mainbus_attach(device_t, device_t, void *);
57 57
58CFATTACH_DECL(mainbus, sizeof(struct device), 58CFATTACH_DECL_NEW(mainbus, 0,
59 mainbus_match, mainbus_attach, NULL, NULL); 59 mainbus_match, mainbus_attach, NULL, NULL);
60 60
61int mainbus_found = 0; 61int mainbus_found = 0;
62struct pic_ops *isa_pic; 62struct pic_ops *isa_pic;
63 63
64#ifdef PIC_PREPIVR 64#ifdef PIC_PREPIVR
65vaddr_t prep_intr_reg; 65vaddr_t prep_intr_reg;
66uint32_t prep_intr_reg_off; 66uint32_t prep_intr_reg_off;
67#endif 67#endif
68 68
69extern ofw_pic_node_t picnodes[8]; 69extern ofw_pic_node_t picnodes[8];
70extern int nrofpics; 70extern int nrofpics;
71extern int primary_pic; 71extern int primary_pic;
@@ -198,38 +198,38 @@ init_openpic(int node) @@ -198,38 +198,38 @@ init_openpic(int node)
198 } 198 }
199#endif 199#endif
200 return TRUE; 200 return TRUE;
201#endif 201#endif
202 aprint_error("PIC support not present or PIC error\n"); 202 aprint_error("PIC support not present or PIC error\n");
203 return FALSE; 203 return FALSE;
204} 204}
205 205
206 206
207/* 207/*
208 * Probe for the mainbus; always succeeds. 208 * Probe for the mainbus; always succeeds.
209 */ 209 */
210int 210int
211mainbus_match(struct device *parent, struct cfdata *cf, void *aux) 211mainbus_match(device_t parent, cfdata_t cf, void *aux)
212{ 212{
213 if (mainbus_found) 213 if (mainbus_found)
214 return 0; 214 return 0;
215 return 1; 215 return 1;
216} 216}
217 217
218/* 218/*
219 * Attach the mainbus. 219 * Attach the mainbus.
220 */ 220 */
221void 221void
222mainbus_attach(struct device *parent, struct device *self, void *aux) 222mainbus_attach(device_t parent, device_t self, void *aux)
223{ 223{
224 struct ofbus_attach_args oba; 224 struct ofbus_attach_args oba;
225 struct confargs ca; 225 struct confargs ca;
226 int node, rtnode, i; 226 int node, rtnode, i;
227 u_int32_t reg[4]; 227 u_int32_t reg[4];
228 char name[32]; 228 char name[32];
229 229
230 mainbus_found = 1; 230 mainbus_found = 1;
231 231
232 aprint_normal("\n"); 232 aprint_normal("\n");
233 233
234 /* Find rtas first */ 234 /* Find rtas first */
235 rtnode = OF_finddevice("/rtas"); 235 rtnode = OF_finddevice("/rtas");

cvs diff -r1.28 -r1.29 src/sys/arch/powerpc/ibm4xx/cpu.c (expand / switch to unified diff)

--- src/sys/arch/powerpc/ibm4xx/cpu.c 2010/03/18 13:47:05 1.28
+++ src/sys/arch/powerpc/ibm4xx/cpu.c 2011/06/05 17:03:17 1.29
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: cpu.c,v 1.28 2010/03/18 13:47:05 kiyohara Exp $ */ 1/* $NetBSD: cpu.c,v 1.29 2011/06/05 17:03:17 matt Exp $ */
2 2
3/* 3/*
4 * Copyright 2001 Wasabi Systems, Inc. 4 * Copyright 2001 Wasabi Systems, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Written by Eduardo Horvath and Simon Burge for Wasabi Systems, Inc. 7 * Written by Eduardo Horvath and Simon Burge for Wasabi Systems, Inc.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -26,27 +26,27 @@ @@ -26,27 +26,27 @@
26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 26 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
27 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 27 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC 28 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC
29 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 29 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 30 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 31 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 32 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 33 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 34 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 * POSSIBILITY OF SUCH DAMAGE. 35 * POSSIBILITY OF SUCH DAMAGE.
36 */ 36 */
37 37
38#include <sys/cdefs.h> 38#include <sys/cdefs.h>
39__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.28 2010/03/18 13:47:05 kiyohara Exp $"); 39__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.29 2011/06/05 17:03:17 matt Exp $");
40 40
41#include <sys/param.h> 41#include <sys/param.h>
42#include <sys/systm.h> 42#include <sys/systm.h>
43#include <sys/device.h> 43#include <sys/device.h>
44#include <sys/evcnt.h> 44#include <sys/evcnt.h>
45 45
46#include <uvm/uvm_extern.h> 46#include <uvm/uvm_extern.h>
47 47
48#include <prop/proplib.h> 48#include <prop/proplib.h>
49 49
50#include <machine/cpu.h> 50#include <machine/cpu.h>
51#include <powerpc/ibm4xx/dev/plbvar.h> 51#include <powerpc/ibm4xx/dev/plbvar.h>
52 52
@@ -62,69 +62,69 @@ static struct cputab models[] = { @@ -62,69 +62,69 @@ static struct cputab models[] = {
62 { PVR_401D2, 0xffff0000, "401D2" }, 62 { PVR_401D2, 0xffff0000, "401D2" },
63 { PVR_401E2, 0xffff0000, "401E2" }, 63 { PVR_401E2, 0xffff0000, "401E2" },
64 { PVR_401F2, 0xffff0000, "401F2" }, 64 { PVR_401F2, 0xffff0000, "401F2" },
65 { PVR_401G2, 0xffff0000, "401G2" }, 65 { PVR_401G2, 0xffff0000, "401G2" },
66 { PVR_403, 0xffff0000, "403" }, 66 { PVR_403, 0xffff0000, "403" },
67 { PVR_405GP, 0xffff0000, "405GP" }, 67 { PVR_405GP, 0xffff0000, "405GP" },
68 { PVR_405GPR, 0xffff0000, "405GPr" }, 68 { PVR_405GPR, 0xffff0000, "405GPr" },
69 { PVR_405D5X1, 0xfffff000, "Xilinx Virtex II Pro" }, 69 { PVR_405D5X1, 0xfffff000, "Xilinx Virtex II Pro" },
70 { PVR_405D5X2, 0xfffff000, "Xilinx Virtex 4 FX" }, 70 { PVR_405D5X2, 0xfffff000, "Xilinx Virtex 4 FX" },
71 { PVR_405EX, 0xffff0000, "405EX" }, 71 { PVR_405EX, 0xffff0000, "405EX" },
72 { 0, 0, NULL } 72 { 0, 0, NULL }
73}; 73};
74 74
75static int cpumatch(struct device *, struct cfdata *, void *); 75static int cpumatch(device_t, cfdata_t, void *);
76static void cpuattach(struct device *, struct device *, void *); 76static void cpuattach(device_t, device_t, void *);
77 77
78CFATTACH_DECL(cpu, sizeof(struct device), 78CFATTACH_DECL_NEW(cpu, 0,
79 cpumatch, cpuattach, NULL, NULL); 79 cpumatch, cpuattach, NULL, NULL);
80 80
81int ncpus; 81int ncpus;
82 82
83struct cpu_info cpu_info[1] = { 83struct cpu_info cpu_info[1] = {
84 { 84 {
85 /* XXX add more ci_ev_* as we teach 4xx about them */ 85 /* XXX add more ci_ev_* as we teach 4xx about them */
86 .ci_ev_clock = EVCNT_INITIALIZER(EVCNT_TYPE_INTR, 86 .ci_ev_clock = EVCNT_INITIALIZER(EVCNT_TYPE_INTR,
87 NULL, "cpu0", "clock"), 87 NULL, "cpu0", "clock"),
88 .ci_ev_statclock = EVCNT_INITIALIZER(EVCNT_TYPE_INTR, 88 .ci_ev_statclock = EVCNT_INITIALIZER(EVCNT_TYPE_INTR,
89 NULL, "cpu0", "stat clock"), 89 NULL, "cpu0", "stat clock"),
90 .ci_ev_softclock = EVCNT_INITIALIZER(EVCNT_TYPE_INTR, 90 .ci_ev_softclock = EVCNT_INITIALIZER(EVCNT_TYPE_INTR,
91 NULL, "cpu0", "soft clock"), 91 NULL, "cpu0", "soft clock"),
92 .ci_ev_softnet = EVCNT_INITIALIZER(EVCNT_TYPE_INTR, 92 .ci_ev_softnet = EVCNT_INITIALIZER(EVCNT_TYPE_INTR,
93 NULL, "cpu0", "soft net"), 93 NULL, "cpu0", "soft net"),
94 .ci_ev_softserial = EVCNT_INITIALIZER(EVCNT_TYPE_INTR, 94 .ci_ev_softserial = EVCNT_INITIALIZER(EVCNT_TYPE_INTR,
95 NULL, "cpu0", "soft serial"), 95 NULL, "cpu0", "soft serial"),
96 .ci_curlwp = &lwp0, 96 .ci_curlwp = &lwp0,
97 } 97 }
98}; 98};
99 99
100char cpu_model[80]; 100char cpu_model[80];
101 101
102int cpufound = 0; 102int cpufound = 0;
103 103
104static int 104static int
105cpumatch(struct device *parent, struct cfdata *cf, void *aux) 105cpumatch(device_t parent, cfdata_t cf, void *aux)
106{ 106{
107 struct plb_attach_args *paa = aux; 107 struct plb_attach_args *paa = aux;
108 108
109 /* make sure that we're looking for a CPU */ 109 /* make sure that we're looking for a CPU */
110 if (strcmp(paa->plb_name, cf->cf_name) != 0) 110 if (strcmp(paa->plb_name, cf->cf_name) != 0)
111 return (0); 111 return (0);
112 112
113 return !cpufound; 113 return !cpufound;
114} 114}
115 115
116static void 116static void
117cpuattach(struct device *parent, struct device *self, void *aux) 117cpuattach(device_t parent, device_t self, void *aux)
118{ 118{
119 struct cputab *cp = models; 119 struct cputab *cp = models;
120 u_int pvr; 120 u_int pvr;
121 u_int processor_freq; 121 u_int processor_freq;
122 prop_number_t freq; 122 prop_number_t freq;
123 123
124 freq = prop_dictionary_get(board_properties, "processor-frequency"); 124 freq = prop_dictionary_get(board_properties, "processor-frequency");
125 KASSERT(freq != NULL); 125 KASSERT(freq != NULL);
126 processor_freq = (unsigned int) prop_number_integer_value(freq); 126 processor_freq = (unsigned int) prop_number_integer_value(freq);
127 127
128 cpufound++; 128 cpufound++;
129 ncpus++; 129 ncpus++;
130 130

cvs diff -r1.15 -r1.16 src/sys/arch/prep/prep/cpu.c (expand / switch to unified diff)

--- src/sys/arch/prep/prep/cpu.c 2008/04/28 20:23:33 1.15
+++ src/sys/arch/prep/prep/cpu.c 2011/06/05 17:03:17 1.16
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: cpu.c,v 1.15 2008/04/28 20:23:33 martin Exp $ */ 1/* $NetBSD: cpu.c,v 1.16 2011/06/05 17:03:17 matt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc. 4 * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by NONAKA Kimihiro. 8 * by NONAKA Kimihiro.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -20,70 +20,70 @@ @@ -20,70 +20,70 @@
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.15 2008/04/28 20:23:33 martin Exp $"); 33__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.16 2011/06/05 17:03:17 matt Exp $");
34 34
35#include <sys/param.h> 35#include <sys/param.h>
36#include <sys/systm.h> 36#include <sys/systm.h>
37#include <sys/device.h> 37#include <sys/device.h>
38 38
39#include <machine/autoconf.h> 39#include <machine/autoconf.h>
40#include <machine/bus.h> 40#include <machine/bus.h>
41#include <machine/cpu.h> 41#include <machine/cpu.h>
42#include <machine/platform.h> 42#include <machine/platform.h>
43 43
44#ifdef MULTIPROCESSOR 44#ifdef MULTIPROCESSOR
45#include <arch/powerpc/pic/picvar.h> 45#include <arch/powerpc/pic/picvar.h>
46#include <arch/powerpc/pic/ipivar.h> 46#include <arch/powerpc/pic/ipivar.h>
47#include <powerpc/openpic.h> 47#include <powerpc/openpic.h>
48#include <powerpc/trap.h> 48#include <powerpc/trap.h>
49 49
50extern void openpic_set_priority(int, int); 50extern void openpic_set_priority(int, int);
51#endif 51#endif
52 52
53int cpumatch(struct device *, struct cfdata *, void *); 53int cpumatch(device_t, cfdata_t, void *);
54void cpuattach(struct device *, struct device *, void *); 54void cpuattach(device_t, device_t, void *);
55 55
56CFATTACH_DECL(cpu, sizeof(struct device), 56CFATTACH_DECL_NEW(cpu, 0,
57 cpumatch, cpuattach, NULL, NULL); 57 cpumatch, cpuattach, NULL, NULL);
58 58
59extern struct cfdriver cpu_cd; 59extern struct cfdriver cpu_cd;
60 60
61int 61int
62cpumatch(struct device *parent, struct cfdata *cfdata, void *aux) 62cpumatch(device_t parent, cfdata_t cfdata, void *aux)
63{ 63{
64 struct confargs *ca = aux; 64 struct confargs *ca = aux;
65 65
66 if (strcmp(ca->ca_name, cpu_cd.cd_name) != 0) 66 if (strcmp(ca->ca_name, cpu_cd.cd_name) != 0)
67 return (0); 67 return (0);
68#if 0 68#if 0
69 if (cpu_info[0].ci_dev != NULL) 69 if (cpu_info[0].ci_dev != NULL)
70 return (0); 70 return (0);
71#endif 71#endif
72 return (1); 72 return (1);
73} 73}
74 74
75void 75void
76cpuattach(struct device *parent, struct device *self, void *aux) 76cpuattach(device_t parent, device_t self, void *aux)
77{ 77{
78 struct cpu_info *ci; 78 struct cpu_info *ci;
79 struct confargs *ca = aux; 79 struct confargs *ca = aux;
80 int id = ca->ca_node; 80 int id = ca->ca_node;
81 81
82 ci = cpu_attach_common(self, id); 82 ci = cpu_attach_common(self, id);
83 if (ci == NULL) 83 if (ci == NULL)
84 return; 84 return;
85 85
86#ifdef MULTIPROCESSOR 86#ifdef MULTIPROCESSOR
87 if (id > 0) { 87 if (id > 0) {
88 cpu_spinup(self, ci); 88 cpu_spinup(self, ci);
89 return; 89 return;

cvs diff -r1.30 -r1.31 src/sys/arch/prep/prep/mainbus.c (expand / switch to unified diff)

--- src/sys/arch/prep/prep/mainbus.c 2011/05/17 17:34:52 1.30
+++ src/sys/arch/prep/prep/mainbus.c 2011/06/05 17:03:17 1.31
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: mainbus.c,v 1.30 2011/05/17 17:34:52 dyoung Exp $ */ 1/* $NetBSD: mainbus.c,v 1.31 2011/06/05 17:03:17 matt Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. 4 * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 3. All advertising materials mentioning features or use of this software 14 * 3. All advertising materials mentioning features or use of this software
@@ -21,89 +21,89 @@ @@ -21,89 +21,89 @@
21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 22 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 23 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 24 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */ 31 */
32 32
33#include <sys/cdefs.h> 33#include <sys/cdefs.h>
34__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.30 2011/05/17 17:34:52 dyoung Exp $"); 34__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.31 2011/06/05 17:03:17 matt Exp $");
35 35
36#include "opt_pci.h" 36#include "opt_pci.h"
37#include "opt_residual.h" 37#include "opt_residual.h"
38 38
39#include "pnpbus.h" 39#include "pnpbus.h"
40#include "pci.h" 40#include "pci.h"
41#include "isa.h" 41#include "isa.h"
42 42
43#include <sys/param.h> 43#include <sys/param.h>
44#include <sys/extent.h> 44#include <sys/extent.h>
45#include <sys/systm.h> 45#include <sys/systm.h>
46#include <sys/device.h> 46#include <sys/device.h>
47#include <sys/malloc.h> 47#include <sys/malloc.h>
48 48
49#include <machine/autoconf.h> 49#include <machine/autoconf.h>
50#include <machine/bus.h> 50#include <machine/bus.h>
51#include <machine/isa_machdep.h> 51#include <machine/isa_machdep.h>
52 52
53#include <dev/pci/pcivar.h> 53#include <dev/pci/pcivar.h>
54#include <dev/pci/pciconf.h> 54#include <dev/pci/pciconf.h>
55 55
56#include <prep/pnpbus/pnpbusvar.h> 56#include <prep/pnpbus/pnpbusvar.h>
57 57
58#include <machine/platform.h> 58#include <machine/platform.h>
59#include <machine/residual.h> 59#include <machine/residual.h>
60 60
61int mainbus_match(struct device *, struct cfdata *, void *); 61int mainbus_match(device_t, cfdata_t, void *);
62void mainbus_attach(struct device *, struct device *, void *); 62void mainbus_attach(device_t, device_t, void *);
63 63
64CFATTACH_DECL(mainbus, sizeof(struct device), 64CFATTACH_DECL_NEW(mainbus, 0,
65 mainbus_match, mainbus_attach, NULL, NULL); 65 mainbus_match, mainbus_attach, NULL, NULL);
66 66
67int mainbus_print(void *, const char *); 67int mainbus_print(void *, const char *);
68 68
69union mainbus_attach_args { 69union mainbus_attach_args {
70 const char *mba_busname; /* first elem of all */ 70 const char *mba_busname; /* first elem of all */
71 struct pcibus_attach_args mba_pba; 71 struct pcibus_attach_args mba_pba;
72 struct pnpbus_attach_args mba_paa; 72 struct pnpbus_attach_args mba_paa;
73}; 73};
74 74
75/* There can be only one. */ 75/* There can be only one. */
76int mainbus_found = 0; 76int mainbus_found = 0;
77struct powerpc_isa_chipset genppc_ict; 77struct powerpc_isa_chipset genppc_ict;
78struct genppc_pci_chipset *genppc_pct; 78struct genppc_pci_chipset *genppc_pct;
79 79
80/* 80/*
81 * Probe for the mainbus; always succeeds. 81 * Probe for the mainbus; always succeeds.
82 */ 82 */
83int 83int
84mainbus_match(struct device *parent, struct cfdata *match, void *aux) 84mainbus_match(device_t parent, cfdata_t match, void *aux)
85{ 85{
86 86
87 if (mainbus_found) 87 if (mainbus_found)
88 return 0; 88 return 0;
89 return 1; 89 return 1;
90} 90}
91 91
92/* 92/*
93 * Attach the mainbus. 93 * Attach the mainbus.
94 */ 94 */
95void 95void
96mainbus_attach(struct device *parent, struct device *self, void *aux) 96mainbus_attach(device_t parent, device_t self, void *aux)
97{ 97{
98 union mainbus_attach_args mba; 98 union mainbus_attach_args mba;
99 struct confargs ca; 99 struct confargs ca;
100 int i; 100 int i;
101#if NPCI > 0 101#if NPCI > 0
102 struct genppc_pci_chipset_businfo *pbi; 102 struct genppc_pci_chipset_businfo *pbi;
103#ifdef PCI_NETBSD_CONFIGURE 103#ifdef PCI_NETBSD_CONFIGURE
104 struct extent *ioext, *memext; 104 struct extent *ioext, *memext;
105#endif 105#endif
106#endif 106#endif
107 107
108 mainbus_found = 1; 108 mainbus_found = 1;
109 109

cvs diff -r1.2 -r1.3 src/sys/arch/rs6000/rs6000/cpu.c (expand / switch to unified diff)

--- src/sys/arch/rs6000/rs6000/cpu.c 2008/04/28 20:23:34 1.2
+++ src/sys/arch/rs6000/rs6000/cpu.c 2011/06/05 17:03:17 1.3
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: cpu.c,v 1.2 2008/04/28 20:23:34 martin Exp $ */ 1/* $NetBSD: cpu.c,v 1.3 2011/06/05 17:03:17 matt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc. 4 * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by NONAKA Kimihiro. 8 * by NONAKA Kimihiro.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -20,54 +20,54 @@ @@ -20,54 +20,54 @@
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.2 2008/04/28 20:23:34 martin Exp $"); 33__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.3 2011/06/05 17:03:17 matt Exp $");
34 34
35#include <sys/param.h> 35#include <sys/param.h>
36#include <sys/systm.h> 36#include <sys/systm.h>
37#include <sys/device.h> 37#include <sys/device.h>
38 38
39#include <machine/autoconf.h> 39#include <machine/autoconf.h>
40#include <machine/bus.h> 40#include <machine/bus.h>
41#include <machine/cpu.h> 41#include <machine/cpu.h>
42 42
43int cpumatch(struct device *, struct cfdata *, void *); 43int cpumatch(device_t, cfdata_t, void *);
44void cpuattach(struct device *, struct device *, void *); 44void cpuattach(device_t, device_t, void *);
45 45
46CFATTACH_DECL(cpu, sizeof(struct device), 46CFATTACH_DECL_NEW(cpu, 0,
47 cpumatch, cpuattach, NULL, NULL); 47 cpumatch, cpuattach, NULL, NULL);
48 48
49extern struct cfdriver cpu_cd; 49extern struct cfdriver cpu_cd;
50 50
51int 51int
52cpumatch(struct device *parent, struct cfdata *cfdata, void *aux) 52cpumatch(device_t parent, cfdata_t cfdata, void *aux)
53{ 53{
54 struct confargs *ca = aux; 54 struct confargs *ca = aux;
55 55
56 if (strcmp(ca->ca_name, cpu_cd.cd_name) != 0) 56 if (strcmp(ca->ca_name, cpu_cd.cd_name) != 0)
57 return (0); 57 return (0);
58 if (cpu_info[0].ci_dev != NULL) 58 if (cpu_info[0].ci_dev != NULL)
59 return (0); 59 return (0);
60 return (1); 60 return (1);
61} 61}
62 62
63void 63void
64cpuattach(struct device *parent, struct device *self, void *aux) 64cpuattach(device_t parent, device_t self, void *aux)
65{ 65{
66 struct cpu_info *ci; 66 struct cpu_info *ci;
67 67
68 ci = cpu_attach_common(self, 0); 68 ci = cpu_attach_common(self, 0);
69 if (ci == NULL) 69 if (ci == NULL)
70 return; 70 return;
71 71
72/* cpu_setup_prep_generic(self);*/ 72/* cpu_setup_prep_generic(self);*/
73} 73}

cvs diff -r1.3 -r1.4 src/sys/arch/rs6000/rs6000/mainbus.c (expand / switch to unified diff)

--- src/sys/arch/rs6000/rs6000/mainbus.c 2009/01/18 16:46:12 1.3
+++ src/sys/arch/rs6000/rs6000/mainbus.c 2011/06/05 17:03:17 1.4
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: mainbus.c,v 1.3 2009/01/18 16:46:12 christos Exp $ */ 1/* $NetBSD: mainbus.c,v 1.4 2011/06/05 17:03:17 matt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2007 The NetBSD Foundation, Inc. 4 * Copyright (c) 2007 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Tim Rightnour 8 * by Tim Rightnour
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -20,79 +20,79 @@ @@ -20,79 +20,79 @@
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#include <sys/cdefs.h> 32#include <sys/cdefs.h>
33__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.3 2009/01/18 16:46:12 christos Exp $"); 33__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.4 2011/06/05 17:03:17 matt Exp $");
34 34
35#include <sys/param.h> 35#include <sys/param.h>
36#include <sys/extent.h> 36#include <sys/extent.h>
37#include <sys/systm.h> 37#include <sys/systm.h>
38#include <sys/device.h> 38#include <sys/device.h>
39#include <sys/malloc.h> 39#include <sys/malloc.h>
40 40
41#include <machine/autoconf.h> 41#include <machine/autoconf.h>
42#include <powerpc/pio.h> 42#include <powerpc/pio.h>
43#include <machine/bus.h> 43#include <machine/bus.h>
44 44
45#include "mca.h" 45#include "mca.h"
46 46
47#if NMCA > 0 47#if NMCA > 0
48#include <dev/mca/mcavar.h> 48#include <dev/mca/mcavar.h>
49#endif 49#endif
50 50
51int mainbus_match(struct device *, struct cfdata *, void *); 51int mainbus_match(device_t, cfdata_t, void *);
52void mainbus_attach(struct device *, struct device *, void *); 52void mainbus_attach(device_t, device_t, void *);
53 53
54CFATTACH_DECL(mainbus, sizeof(struct device), 54CFATTACH_DECL_NEW(mainbus, 0,
55 mainbus_match, mainbus_attach, NULL, NULL); 55 mainbus_match, mainbus_attach, NULL, NULL);
56 56
57int mainbus_print(void *, const char *); 57int mainbus_print(void *, const char *);
58 58
59union mainbus_attach_args { 59union mainbus_attach_args {
60 const char *mba_busname; /* first elem of all */ 60 const char *mba_busname; /* first elem of all */
61#if NMCA > 0 61#if NMCA > 0
62 struct mcabus_attach_args mba_mba; 62 struct mcabus_attach_args mba_mba;
63#endif 63#endif
64}; 64};
65 65
66/* There can be only one. */ 66/* There can be only one. */
67int mainbus_found = 0; 67int mainbus_found = 0;
68 68
69/* 69/*
70 * Probe for the mainbus; always succeeds. 70 * Probe for the mainbus; always succeeds.
71 */ 71 */
72int 72int
73mainbus_match(struct device *parent, struct cfdata *match, void *aux) 73mainbus_match(device_t parent, cfdata_t match, void *aux)
74{ 74{
75 75
76 if (mainbus_found) 76 if (mainbus_found)
77 return 0; 77 return 0;
78 return 1; 78 return 1;
79} 79}
80 80
81/* 81/*
82 * Attach the mainbus. 82 * Attach the mainbus.
83 */ 83 */
84void 84void
85mainbus_attach(struct device *parent, struct device *self, void *aux) 85mainbus_attach(device_t parent, device_t self, void *aux)
86{ 86{
87 union mainbus_attach_args mba; 87 union mainbus_attach_args mba;
88 struct confargs ca; 88 struct confargs ca;
89#if DEBUG 89#if DEBUG
90 int slot; 90 int slot;
91#endif 91#endif
92 mainbus_found = 1; 92 mainbus_found = 1;
93 93
94 aprint_normal("\n"); 94 aprint_normal("\n");
95 95
96 ca.ca_name = "cpu"; 96 ca.ca_name = "cpu";
97 ca.ca_node = 0; 97 ca.ca_node = 0;
98 config_found_ia(self, "mainbus", &ca, mainbus_print); 98 config_found_ia(self, "mainbus", &ca, mainbus_print);

cvs diff -r1.22 -r1.23 src/sys/arch/sandpoint/sandpoint/mainbus.c (expand / switch to unified diff)

--- src/sys/arch/sandpoint/sandpoint/mainbus.c 2011/05/17 17:34:52 1.22
+++ src/sys/arch/sandpoint/sandpoint/mainbus.c 2011/06/05 17:03:19 1.23
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: mainbus.c,v 1.22 2011/05/17 17:34:52 dyoung Exp $ */ 1/* $NetBSD: mainbus.c,v 1.23 2011/06/05 17:03:19 matt Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. 4 * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 3. All advertising materials mentioning features or use of this software 14 * 3. All advertising materials mentioning features or use of this software
@@ -21,71 +21,71 @@ @@ -21,71 +21,71 @@
21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 22 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 23 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 24 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */ 31 */
32 32
33#include <sys/cdefs.h> 33#include <sys/cdefs.h>
34__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.22 2011/05/17 17:34:52 dyoung Exp $"); 34__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.23 2011/06/05 17:03:19 matt Exp $");
35 35
36#include "opt_pci.h" 36#include "opt_pci.h"
37#include "pci.h" 37#include "pci.h"
38 38
39#include <sys/param.h> 39#include <sys/param.h>
40#include <sys/extent.h> 40#include <sys/extent.h>
41#include <sys/device.h> 41#include <sys/device.h>
42#include <sys/malloc.h> 42#include <sys/malloc.h>
43#include <sys/systm.h> 43#include <sys/systm.h>
44 44
45#include <machine/bus.h> 45#include <machine/bus.h>
46#include <machine/isa_machdep.h> 46#include <machine/isa_machdep.h>
47 47
48#include <dev/pci/pcivar.h> 48#include <dev/pci/pcivar.h>
49#include <dev/pci/pciconf.h> 49#include <dev/pci/pciconf.h>
50 50
51struct conf_args { 51struct conf_args {
52 const char *ca_name; 52 const char *ca_name;
53}; 53};
54 54
55int mainbus_match(struct device *, struct cfdata *, void *); 55int mainbus_match(device_t, cfdata_t, void *);
56void mainbus_attach(struct device *, struct device *, void *); 56void mainbus_attach(device_t, device_t, void *);
57int mainbus_print(void *, const char *); 57int mainbus_print(void *, const char *);
58 58
59CFATTACH_DECL(mainbus, sizeof(struct device), 59CFATTACH_DECL_NEW(mainbus, 0,
60 mainbus_match, mainbus_attach, NULL, NULL); 60 mainbus_match, mainbus_attach, NULL, NULL);
61 61
62struct powerpc_isa_chipset genppc_ict; 62struct powerpc_isa_chipset genppc_ict;
63 63
64/* 64/*
65 * Probe for the mainbus; always succeeds. 65 * Probe for the mainbus; always succeeds.
66 */ 66 */
67int 67int
68mainbus_match(struct device *parent, struct cfdata *match, void *aux) 68mainbus_match(device_t parent, cfdata_t match, void *aux)
69{ 69{
70 70
71 return 1; 71 return 1;
72} 72}
73 73
74/* 74/*
75 * Attach the mainbus. 75 * Attach the mainbus.
76 */ 76 */
77void 77void
78mainbus_attach(struct device *parent, struct device *self, void *aux) 78mainbus_attach(device_t parent, device_t self, void *aux)
79{ 79{
80 struct conf_args ca; 80 struct conf_args ca;
81 struct pcibus_attach_args pba; 81 struct pcibus_attach_args pba;
82#if defined(PCI_NETBSD_CONFIGURE) 82#if defined(PCI_NETBSD_CONFIGURE)
83 struct extent *ioext, *memext; 83 struct extent *ioext, *memext;
84#endif 84#endif
85 85
86 printf("\n"); 86 printf("\n");
87 87
88 ca.ca_name = "cpu"; 88 ca.ca_name = "cpu";
89 config_found_ia(self, "mainbus", &ca, mainbus_print); 89 config_found_ia(self, "mainbus", &ca, mainbus_print);
90 ca.ca_name = "eumb"; 90 ca.ca_name = "eumb";
91 config_found_ia(self, "mainbus", &ca, mainbus_print); 91 config_found_ia(self, "mainbus", &ca, mainbus_print);
@@ -112,49 +112,49 @@ mainbus_attach(struct device *parent, st @@ -112,49 +112,49 @@ mainbus_attach(struct device *parent, st
112 pba.pba_iot = &sandpoint_io_space_tag; 112 pba.pba_iot = &sandpoint_io_space_tag;
113 pba.pba_memt = &sandpoint_mem_space_tag; 113 pba.pba_memt = &sandpoint_mem_space_tag;
114 pba.pba_dmat = &pci_bus_dma_tag; 114 pba.pba_dmat = &pci_bus_dma_tag;
115 pba.pba_dmat64 = NULL; 115 pba.pba_dmat64 = NULL;
116 pba.pba_bus = 0; 116 pba.pba_bus = 0;
117 pba.pba_pc = 0; 117 pba.pba_pc = 0;
118 pba.pba_bridgetag = NULL; 118 pba.pba_bridgetag = NULL;
119 pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY; 119 pba.pba_flags = PCI_FLAGS_IO_OKAY | PCI_FLAGS_MEM_OKAY;
120 120
121 config_found_ia(self, "pcibus", &pba, pcibusprint); 121 config_found_ia(self, "pcibus", &pba, pcibusprint);
122#endif 122#endif
123} 123}
124 124
125static int cpu_match(struct device *, struct cfdata *, void *); 125static int cpu_match(device_t, cfdata_t, void *);
126static void cpu_attach(struct device *, struct device *, void *); 126static void cpu_attach(device_t, device_t, void *);
127 127
128CFATTACH_DECL(cpu, sizeof(struct device), 128CFATTACH_DECL_NEW(cpu, 0,
129 cpu_match, cpu_attach, NULL, NULL); 129 cpu_match, cpu_attach, NULL, NULL);
130 130
131extern struct cfdriver cpu_cd; 131extern struct cfdriver cpu_cd;
132 132
133int 133int
134cpu_match(struct device *parent, struct cfdata *cf, void *aux) 134cpu_match(device_t parent, cfdata_t cf, void *aux)
135{ 135{
136 struct conf_args *ca = aux; 136 struct conf_args *ca = aux;
137 137
138 if (strcmp(ca->ca_name, cpu_cd.cd_name) != 0) 138 if (strcmp(ca->ca_name, cpu_cd.cd_name) != 0)
139 return 0; 139 return 0;
140 if (cpu_info[0].ci_dev != NULL) 140 if (cpu_info[0].ci_dev != NULL)
141 return 0; 141 return 0;
142 142
143 return 1; 143 return 1;
144} 144}
145 145
146void 146void
147cpu_attach(struct device *parent, struct device *self, void *aux) 147cpu_attach(device_t parent, device_t self, void *aux)
148{ 148{
149 149
150 (void) cpu_attach_common(self, 0); 150 (void) cpu_attach_common(self, 0);
151} 151}
152 152
153int 153int
154mainbus_print(void *aux, const char *pnp) 154mainbus_print(void *aux, const char *pnp)
155{ 155{
156 struct conf_args *ca = aux; 156 struct conf_args *ca = aux;
157 157
158 if (pnp) 158 if (pnp)
159 aprint_normal("%s at %s", ca->ca_name, pnp); 159 aprint_normal("%s at %s", ca->ca_name, pnp);
160 return (UNCONF); 160 return (UNCONF);

cvs diff -r1.7 -r1.8 src/sys/arch/shark/ofw/cpu_ofbus.c (expand / switch to unified diff)

--- src/sys/arch/shark/ofw/cpu_ofbus.c 2009/03/14 15:36:13 1.7
+++ src/sys/arch/shark/ofw/cpu_ofbus.c 2011/06/05 17:03:18 1.8
@@ -1,47 +1,47 @@ @@ -1,47 +1,47 @@
1/* $NetBSD: cpu_ofbus.c,v 1.7 2009/03/14 15:36:13 dsl Exp $ */ 1/* $NetBSD: cpu_ofbus.c,v 1.8 2011/06/05 17:03:18 matt Exp $ */
2 2
3#include <sys/cdefs.h> 3#include <sys/cdefs.h>
4__KERNEL_RCSID(0, "$NetBSD: cpu_ofbus.c,v 1.7 2009/03/14 15:36:13 dsl Exp $"); 4__KERNEL_RCSID(0, "$NetBSD: cpu_ofbus.c,v 1.8 2011/06/05 17:03:18 matt Exp $");
5 5
6#include <sys/param.h> 6#include <sys/param.h>
7#include <sys/systm.h> 7#include <sys/systm.h>
8#include <sys/device.h> 8#include <sys/device.h>
9 9
10#include <machine/cpu.h> 10#include <machine/cpu.h>
11 11
12#include <dev/ofw/openfirm.h> 12#include <dev/ofw/openfirm.h>
13 13
14/* 14/*
15 * int cpu_ofbus_match(struct device *parent, struct cfdata *cf, void *aux) 15 * int cpu_ofbus_match(device_t parent, cfdata_t cf, void *aux)
16 * 16 *
17 * Probe for the main cpu. Currently all this does is return 1 to 17 * Probe for the main cpu. Currently all this does is return 1 to
18 * indicate that the cpu was found. 18 * indicate that the cpu was found.
19 */  19 */
20  20
21static int 21static int
22cpu_ofbus_match(struct device *parent, struct cfdata *cf, void *aux) 22cpu_ofbus_match(device_t parent, cfdata_t cf, void *aux)
23{ 23{
24 struct ofbus_attach_args *aa = aux; 24 struct ofbus_attach_args *aa = aux;
25 char buf[32]; 25 char buf[32];
26 26
27 if (OF_getprop(aa->oba_phandle, "device_type", buf, sizeof(buf)) < 0) 27 if (OF_getprop(aa->oba_phandle, "device_type", buf, sizeof(buf)) < 0)
28 return (0); 28 return (0);
29 if (strcmp("cpu", buf)) 29 if (strcmp("cpu", buf))
30 return (0); 30 return (0);
31 return(1); 31 return(1);
32} 32}
33 33
34/* 34/*
35 * void cpu_ofbus_attach(struct device *parent, struct device *dev, void *aux) 35 * void cpu_ofbus_attach(device_t parent, device_t dev, void *aux)
36 * 36 *
37 * Attach the main cpu 37 * Attach the main cpu
38 */ 38 */
39  39
40static void 40static void
41cpu_ofbus_attach(struct device *parent, struct device *self, void *aux) 41cpu_ofbus_attach(device_t parent, device_t self, void *aux)
42{ 42{
43 cpu_attach(self); 43 cpu_attach(self);
44} 44}
45 45
46CFATTACH_DECL(cpu_ofbus, sizeof(struct device), 46CFATTACH_DECL_NEW(cpu_ofbus, 0,
47 cpu_ofbus_match, cpu_ofbus_attach, NULL, NULL); 47 cpu_ofbus_match, cpu_ofbus_attach, NULL, NULL);