diff options
| author | Attilio Rao <attilio@FreeBSD.org> | 2011-05-05 14:39:14 +0000 |
|---|---|---|
| committer | Attilio Rao <attilio@FreeBSD.org> | 2011-05-05 14:39:14 +0000 |
| commit | 71a19bdc640eb9d54e7db3d1d135753888f3469c (patch) | |
| tree | e5d54bcefbf1fe0c4c6804bdc5c4852b1b64518a /sys/dev/xen | |
| parent | a7a347967f3856b66bc2358cf86ee8ee957fc5bf (diff) | |
Notes
Diffstat (limited to 'sys/dev/xen')
| -rw-r--r-- | sys/dev/xen/control/control.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/sys/dev/xen/control/control.c b/sys/dev/xen/control/control.c index c03d5365530b..0f4418142684 100644 --- a/sys/dev/xen/control/control.c +++ b/sys/dev/xen/control/control.c @@ -203,24 +203,29 @@ xctrl_suspend() unsigned long max_pfn, start_info_mfn; #ifdef SMP - cpumask_t map; + struct thread *td; + cpuset_t map; /* * Bind us to CPU 0 and stop any other VCPUs. */ - thread_lock(curthread); - sched_bind(curthread, 0); - thread_unlock(curthread); + td = curthread; + thread_lock(td); + sched_bind(td, 0); + thread_unlock(td); KASSERT(PCPU_GET(cpuid) == 0, ("xen_suspend: not running on cpu 0")); - map = PCPU_GET(other_cpus) & ~stopped_cpus; - if (map) + sched_pin(); + map = PCPU_GET(other_cpus); + sched_unpin(); + CPU_NAND(&map, &stopped_cpus); + if (!CPU_EMPTY(&map)) stop_cpus(map); #endif if (DEVICE_SUSPEND(root_bus) != 0) { printf("xen_suspend: device_suspend failed\n"); #ifdef SMP - if (map) + if (!CPU_EMPTY(&map)) restart_cpus(map); #endif return; @@ -289,7 +294,7 @@ xctrl_suspend() thread_lock(curthread); sched_unbind(curthread); thread_unlock(curthread); - if (map) + if (!CPU_EMPTY(&map)) restart_cpus(map); #endif } |
