From 4260b00a7c5cb4248e4290baaba0b452153eb1e0 Mon Sep 17 00:00:00 2001 From: Nate Lawson Date: Mon, 27 Dec 2004 06:15:03 +0000 Subject: [PATCH] Restore the cpu_reset proxy code. It is needed if you want to reset the system from an AP at runtime (i.e., calling cpu_reset from ddb). Someday, if we move to an NMI for stopping cpus instead, we can do away with this. Requested by: jhb --- sys/i386/i386/vm_machdep.c | 42 +++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/sys/i386/i386/vm_machdep.c b/sys/i386/i386/vm_machdep.c index 10e262334d8..06da6e384cd 100644 --- a/sys/i386/i386/vm_machdep.c +++ b/sys/i386/i386/vm_machdep.c @@ -100,6 +100,11 @@ __FBSDID("$FreeBSD$"); #endif static void cpu_reset_real(void); +#ifdef SMP +static void cpu_reset_proxy(void); +static u_int cpu_reset_proxyid; +static volatile u_int cpu_reset_proxy_active; +#endif static void sf_buf_init(void *arg); SYSINIT(sock_sf, SI_SUB_MBUF, SI_ORDER_ANY, sf_buf_init, NULL) @@ -474,11 +479,26 @@ kvtop(void *addr) return (pa); } +#ifdef SMP +static void +cpu_reset_proxy() +{ + + cpu_reset_proxy_active = 1; + while (cpu_reset_proxy_active == 1) + ; /* Wait for other cpu to see that we've started */ + stop_cpus((1<