Define and use CPU pause/resume IPI messages (until such times that I know

what the prom supplied versions actually do).
This commit is contained in:
pk 1998-10-24 08:12:55 +00:00
parent c85c920d03
commit de51cf3531
3 changed files with 30 additions and 12 deletions

View File

@ -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);
}
}

View File

@ -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

View File

@ -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();