aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include/xen/sched-if.h
diff options
context:
space:
mode:
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2006-08-08 13:55:22 +0100
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2006-08-08 13:55:22 +0100
commit62e16a8285b728d883b65a9e0c1b90099c1f6f48 (patch)
treeab57991511bb08f409f73dcd34989c92af789813 /xen/include/xen/sched-if.h
parent8513c2357d9c34664cdcebde1019860da850317b (diff)
downloadxen-62e16a8285b728d883b65a9e0c1b90099c1f6f48.tar.gz
xen-62e16a8285b728d883b65a9e0c1b90099c1f6f48.tar.bz2
xen-62e16a8285b728d883b65a9e0c1b90099c1f6f48.zip
[XEN] Make per-cpu schedule data explicitly PER_CPU.
Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'xen/include/xen/sched-if.h')
-rw-r--r--xen/include/xen/sched-if.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/xen/include/xen/sched-if.h b/xen/include/xen/sched-if.h
index ec082b37be..78f61a7b17 100644
--- a/xen/include/xen/sched-if.h
+++ b/xen/include/xen/sched-if.h
@@ -8,6 +8,8 @@
#ifndef __XEN_SCHED_IF_H__
#define __XEN_SCHED_IF_H__
+#include <xen/percpu.h>
+
struct schedule_data {
spinlock_t schedule_lock; /* spinlock protecting curr */
struct vcpu *curr; /* current task */
@@ -17,7 +19,7 @@ struct schedule_data {
unsigned long tick; /* current periodic 'tick' */
} __cacheline_aligned;
-extern struct schedule_data schedule_data[];
+DECLARE_PER_CPU(struct schedule_data, schedule_data);
static inline void vcpu_schedule_lock(struct vcpu *v)
{
@@ -26,10 +28,10 @@ static inline void vcpu_schedule_lock(struct vcpu *v)
for ( ; ; )
{
cpu = v->processor;
- spin_lock(&schedule_data[cpu].schedule_lock);
+ spin_lock(&per_cpu(schedule_data, cpu).schedule_lock);
if ( likely(v->processor == cpu) )
break;
- spin_unlock(&schedule_data[cpu].schedule_lock);
+ spin_unlock(&per_cpu(schedule_data, cpu).schedule_lock);
}
}
@@ -40,7 +42,7 @@ static inline void vcpu_schedule_lock(struct vcpu *v)
static inline void vcpu_schedule_unlock(struct vcpu *v)
{
- spin_unlock(&schedule_data[v->processor].schedule_lock);
+ spin_unlock(&per_cpu(schedule_data, v->processor).schedule_lock);
}
#define vcpu_schedule_unlock_irq(v) \