From e8a219f1fc996fe9cbf8c594c0ee92e8477acd22 Mon Sep 17 00:00:00 2001 From: njl Date: Mon, 27 Dec 2004 06:15:03 +0000 Subject: 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(-) (limited to 'sys/i386') diff --git a/sys/i386/i386/vm_machdep.c b/sys/i386/i386/vm_machdep.c index 10e2623..06da6e3 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<