diff --git a/sys/arch/sparc/sparc/cpu.c b/sys/arch/sparc/sparc/cpu.c index 382df2c744bc..fd9e88f21eae 100644 --- a/sys/arch/sparc/sparc/cpu.c +++ b/sys/arch/sparc/sparc/cpu.c @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.c,v 1.85 1998/10/14 14:22:18 pk Exp $ */ +/* $NetBSD: cpu.c,v 1.86 1998/10/24 08:12:55 pk Exp $ */ /* * Copyright (c) 1996 @@ -429,13 +429,15 @@ void mp_pause_cpus() { int n; - struct cpu_info *cpi; for (n = 0; n < ncpu; n++) { - if ((cpi = cpus[n]) == NULL) + struct cpu_info *cpi = cpus[n]; + if (cpuinfo.mid == cpi->mid) continue; - if (cpuinfo.mid != cpi->mid) - rom_cpuidle(cpi->node); + + simple_lock(&cpi->msg.lock); + cpi->msg.tag = XPMSG_PAUSECPU; + raise_ipi(cpi); } } @@ -443,13 +445,15 @@ void mp_resume_cpus() { int n; - struct cpu_info *cpi; for (n = 0; n < ncpu; n++) { - if ((cpi = cpus[n]) == NULL) + struct cpu_info *cpi = cpus[n]; + if (cpuinfo.mid == cpi->mid) continue; - if (cpuinfo.mid != cpi->mid) - rom_cpuresume(cpi->node); + + simple_lock(&cpi->msg.lock); + cpi->msg.tag = XPMSG_RESUMECPU; + raise_ipi(cpi); } } diff --git a/sys/arch/sparc/sparc/cpuvar.h b/sys/arch/sparc/sparc/cpuvar.h index 55338ed9ae9d..adcdd3ff5a4b 100644 --- a/sys/arch/sparc/sparc/cpuvar.h +++ b/sys/arch/sparc/sparc/cpuvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: cpuvar.h,v 1.19 1998/10/19 11:56:43 pk Exp $ */ +/* $NetBSD: cpuvar.h,v 1.20 1998/10/24 08:12:55 pk Exp $ */ /* * Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -80,6 +80,8 @@ struct xpmsg { struct simplelock lock; int tag; #define XPMSG_SAVEFPU 1 +#define XPMSG_PAUSECPU 2 +#define XPMSG_RESUMECPU 3 #define XPMSG_DEMAP_TLB_PAGE 10 #define XPMSG_DEMAP_TLB_SEGMENT 11 #define XPMSG_DEMAP_TLB_REGION 12 diff --git a/sys/arch/sparc/sparc/intr.c b/sys/arch/sparc/sparc/intr.c index 413f80c4be58..600ecc9fa16e 100644 --- a/sys/arch/sparc/sparc/intr.c +++ b/sys/arch/sparc/sparc/intr.c @@ -1,4 +1,4 @@ -/* $NetBSD: intr.c,v 1.35 1998/10/13 13:37:14 pk Exp $ */ +/* $NetBSD: intr.c,v 1.36 1998/10/24 08:12:55 pk Exp $ */ /* * Copyright (c) 1992, 1993 @@ -272,7 +272,6 @@ nmi_hard() void nmi_soft() { - printf("Message interrupt on CPU %d\n", cpuinfo.mid); #ifdef MULTIPROCESSOR switch (cpuinfo.msg.tag) { @@ -280,6 +279,19 @@ nmi_soft() savefpstate(cpuinfo.fpproc->p_md.md_fpstate); } break; + case XPMSG_PAUSECPU: { + cpuinfo.flags |= 0x4000; + while (cpuinfo.flags & 0x4000) { + simple_unlock(&cpuinfo.msg.lock); + delay(1); + simple_lock(&cpuinfo.msg.lock); + } + } + break; + case XPMSG_RESUMECPU: { + cpuinfo.flags &= ~0x4000; + } + break; case XPMSG_VCACHE_FLUSH_PAGE: { struct xpmsg_flush_page *p = &cpuinfo.msg.u.xpmsg_flush_page; int ctx = getcontext();