Deleted Added
full compact
mp_machdep.c (176994) mp_machdep.c (178048)
1/*-
2 * Copyright (c) 1997 Berkeley Software Design, Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

--- 15 unchanged lines hidden (view full) ---

24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 *
28 * from BSDI: locore.s,v 1.36.2.15 1999/08/23 22:34:41 cp Exp
29 */
30/*-
31 * Copyright (c) 2002 Jake Burkholder.
1/*-
2 * Copyright (c) 1997 Berkeley Software Design, Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

--- 15 unchanged lines hidden (view full) ---

24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 *
28 * from BSDI: locore.s,v 1.36.2.15 1999/08/23 22:34:41 cp Exp
29 */
30/*-
31 * Copyright (c) 2002 Jake Burkholder.
32 * Copyright (c) 2007 Marius Strobl <marius@FreeBSD.org>
32 * All rights reserved.
33 *
34 * Redistribution and use in source and binary forms, with or without
35 * modification, are permitted provided that the following conditions
36 * are met:
37 * 1. Redistributions of source code must retain the above copyright
38 * notice, this list of conditions and the following disclaimer.
39 * 2. Redistributions in binary form must reproduce the above copyright

--- 9 unchanged lines hidden (view full) ---

49 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
50 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
51 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
52 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
53 * SUCH DAMAGE.
54 */
55
56#include <sys/cdefs.h>
33 * All rights reserved.
34 *
35 * Redistribution and use in source and binary forms, with or without
36 * modification, are permitted provided that the following conditions
37 * are met:
38 * 1. Redistributions of source code must retain the above copyright
39 * notice, this list of conditions and the following disclaimer.
40 * 2. Redistributions in binary form must reproduce the above copyright

--- 9 unchanged lines hidden (view full) ---

50 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
51 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
52 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
53 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
54 * SUCH DAMAGE.
55 */
56
57#include <sys/cdefs.h>
57__FBSDID("$FreeBSD: head/sys/sparc64/sparc64/mp_machdep.c 176994 2008-03-09 15:53:34Z marius $");
58__FBSDID("$FreeBSD: head/sys/sparc64/sparc64/mp_machdep.c 178048 2008-04-09 21:14:01Z marius $");
58
59#include <sys/param.h>
60#include <sys/systm.h>
61#include <sys/lock.h>
62#include <sys/kdb.h>
63#include <sys/kernel.h>
64#include <sys/ktr.h>
65#include <sys/mutex.h>

--- 20 unchanged lines hidden (view full) ---

86#include <machine/pcb.h>
87#include <machine/smp.h>
88#include <machine/tick.h>
89#include <machine/tlb.h>
90#include <machine/tte.h>
91#include <machine/ver.h>
92
93static ih_func_t cpu_ipi_ast;
59
60#include <sys/param.h>
61#include <sys/systm.h>
62#include <sys/lock.h>
63#include <sys/kdb.h>
64#include <sys/kernel.h>
65#include <sys/ktr.h>
66#include <sys/mutex.h>

--- 20 unchanged lines hidden (view full) ---

87#include <machine/pcb.h>
88#include <machine/smp.h>
89#include <machine/tick.h>
90#include <machine/tlb.h>
91#include <machine/tte.h>
92#include <machine/ver.h>
93
94static ih_func_t cpu_ipi_ast;
95static ih_func_t cpu_ipi_preempt;
94static ih_func_t cpu_ipi_stop;
95
96/*
97 * Argument area used to pass data to non-boot processors as they start up.
98 * This must be statically initialized with a known invalid CPU module ID,
99 * since the other processors will use it before the boot CPU enters the
100 * kernel.
101 */

--- 150 unchanged lines hidden (view full) ---

252 int cpuid;
253
254 mtx_init(&ipi_mtx, "ipi", NULL, MTX_SPIN);
255
256 intr_setup(PIL_AST, cpu_ipi_ast, -1, NULL, NULL);
257 intr_setup(PIL_RENDEZVOUS, (ih_func_t *)smp_rendezvous_action,
258 -1, NULL, NULL);
259 intr_setup(PIL_STOP, cpu_ipi_stop, -1, NULL, NULL);
96static ih_func_t cpu_ipi_stop;
97
98/*
99 * Argument area used to pass data to non-boot processors as they start up.
100 * This must be statically initialized with a known invalid CPU module ID,
101 * since the other processors will use it before the boot CPU enters the
102 * kernel.
103 */

--- 150 unchanged lines hidden (view full) ---

254 int cpuid;
255
256 mtx_init(&ipi_mtx, "ipi", NULL, MTX_SPIN);
257
258 intr_setup(PIL_AST, cpu_ipi_ast, -1, NULL, NULL);
259 intr_setup(PIL_RENDEZVOUS, (ih_func_t *)smp_rendezvous_action,
260 -1, NULL, NULL);
261 intr_setup(PIL_STOP, cpu_ipi_stop, -1, NULL, NULL);
262 intr_setup(PIL_PREEMPT, cpu_ipi_preempt, -1, NULL, NULL);
260
261 cpuid_to_mid[curcpu] = PCPU_GET(mid);
262
263 csa = &cpu_start_args;
264 for (child = OF_child(OF_peer(0)); child != 0 && mp_ncpus <= MAXCPU;
265 child = OF_peer(child)) {
266 if (OF_getprop(child, "device_type", buf, sizeof(buf)) <= 0 ||
267 strcmp(buf, "cpu") != 0)

--- 167 unchanged lines hidden (view full) ---

435 }
436 }
437 atomic_clear_rel_int(&started_cpus, PCPU_GET(cpumask));
438 atomic_clear_rel_int(&stopped_cpus, PCPU_GET(cpumask));
439 CTR2(KTR_SMP, "%s: restarted %d", __func__, curcpu);
440}
441
442static void
263
264 cpuid_to_mid[curcpu] = PCPU_GET(mid);
265
266 csa = &cpu_start_args;
267 for (child = OF_child(OF_peer(0)); child != 0 && mp_ncpus <= MAXCPU;
268 child = OF_peer(child)) {
269 if (OF_getprop(child, "device_type", buf, sizeof(buf)) <= 0 ||
270 strcmp(buf, "cpu") != 0)

--- 167 unchanged lines hidden (view full) ---

438 }
439 }
440 atomic_clear_rel_int(&started_cpus, PCPU_GET(cpumask));
441 atomic_clear_rel_int(&stopped_cpus, PCPU_GET(cpumask));
442 CTR2(KTR_SMP, "%s: restarted %d", __func__, curcpu);
443}
444
445static void
446cpu_ipi_preempt(struct trapframe *tf)
447{
448
449 sched_preempt(curthread);
450}
451
452static void
443spitfire_ipi_selected(u_int cpus, u_long d0, u_long d1, u_long d2)
444{
445 u_int cpu;
446
447 KASSERT((cpus & (1 << curcpu)) == 0,
448 ("%s: CPU can't IPI itself", __func__));
449 while (cpus) {
450 cpu = ffs(cpus) - 1;

--- 144 unchanged lines hidden ---
453spitfire_ipi_selected(u_int cpus, u_long d0, u_long d1, u_long d2)
454{
455 u_int cpu;
456
457 KASSERT((cpus & (1 << curcpu)) == 0,
458 ("%s: CPU can't IPI itself", __func__));
459 while (cpus) {
460 cpu = ffs(cpus) - 1;

--- 144 unchanged lines hidden ---