summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorattilio <attilio@FreeBSD.org>2011-07-04 12:04:52 +0000
committerattilio <attilio@FreeBSD.org>2011-07-04 12:04:52 +0000
commit364d0522f778b206262efce0932d6cea821879c6 (patch)
treef85bc4cd83b575a0c42f08d746e644f6dfc0e2ef /sys/dev
parent95ca970257de274a90a1a867048c5ace5acf532d (diff)
downloadFreeBSD-src-364d0522f778b206262efce0932d6cea821879c6.zip
FreeBSD-src-364d0522f778b206262efce0932d6cea821879c6.tar.gz
With retirement of cpumask_t and usage of cpuset_t for representing a
mask of CPUs, pc_other_cpus and pc_cpumask become highly inefficient. Remove them and replace their usage with custom pc_cpuid magic (as, atm, pc_cpumask can be easilly represented by (1 << pc_cpuid) and pc_other_cpus by (all_cpus & ~(1 << pc_cpuid))). This change is not targeted for MFC because of struct pcpu members removal and dependency by cpumask_t retirement. MD review by: marcel, marius, alc Tested by: pluknet MD testing by: marcel, marius, gonzo, andreast
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/xen/control/control.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/dev/xen/control/control.c b/sys/dev/xen/control/control.c
index bc59fa0..301d4e8 100644
--- a/sys/dev/xen/control/control.c
+++ b/sys/dev/xen/control/control.c
@@ -197,6 +197,7 @@ extern void xencons_resume(void);
static void
xctrl_suspend()
{
+ u_int cpuid;
int i, j, k, fpp;
unsigned long max_pfn, start_info_mfn;
@@ -210,11 +211,11 @@ xctrl_suspend()
thread_lock(td);
sched_bind(td, 0);
thread_unlock(td);
- KASSERT(PCPU_GET(cpuid) == 0, ("xen_suspend: not running on cpu 0"));
+ cpuid = PCPU_GET(cpuid);
+ KASSERT(cpuid == 0, ("xen_suspend: not running on cpu 0"));
- sched_pin();
- map = PCPU_GET(other_cpus);
- sched_unpin();
+ map = all_cpus;
+ CPU_CLR(cpuid, &map);
CPU_NAND(&map, &stopped_cpus);
if (!CPU_EMPTY(&map))
stop_cpus(map);
OpenPOWER on IntegriCloud