aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>2013-04-23 12:19:26 +0100
committerIan Campbell <ian.campbell@citrix.com>2013-04-30 11:32:04 +0100
commit7be7b15dde4364b6f524aa9330a283c60b7708ea (patch)
tree77e049f18e037a09132ab6f993811f497a8ad70b
parent11d8866da50a75ef5089faebdfa37164bdcb7545 (diff)
downloadxen-7be7b15dde4364b6f524aa9330a283c60b7708ea.tar.gz
xen-7be7b15dde4364b6f524aa9330a283c60b7708ea.tar.bz2
xen-7be7b15dde4364b6f524aa9330a283c60b7708ea.zip
xen: introduce vcpu_block
Rename do_block to vcpu_block. Move the call to local_event_delivery_enable out of vcpu_block, to a new static function called vcpu_block_enable_events. Use vcpu_block_enable_events instead of do_block throughout in schedule.c Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Keir Fraser <keir@xen.org>
-rw-r--r--xen/common/schedule.c13
-rw-r--r--xen/include/xen/sched.h1
2 files changed, 9 insertions, 5 deletions
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index c1cd3d0f15..e52660236a 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -677,11 +677,10 @@ int vcpu_set_affinity(struct vcpu *v, const cpumask_t *affinity)
}
/* Block the currently-executing domain until a pertinent event occurs. */
-static long do_block(void)
+void vcpu_block(void)
{
struct vcpu *v = current;
- local_event_delivery_enable();
set_bit(_VPF_blocked, &v->pause_flags);
/* Check for events /after/ blocking: avoids wakeup waiting race. */
@@ -694,8 +693,12 @@ static long do_block(void)
TRACE_2D(TRC_SCHED_BLOCK, v->domain->domain_id, v->vcpu_id);
raise_softirq(SCHEDULE_SOFTIRQ);
}
+}
- return 0;
+static void vcpu_block_enable_events(void)
+{
+ local_event_delivery_enable();
+ vcpu_block();
}
static long do_poll(struct sched_poll *sched_poll)
@@ -870,7 +873,7 @@ long do_sched_op_compat(int cmd, unsigned long arg)
case SCHEDOP_block:
{
- ret = do_block();
+ vcpu_block_enable_events();
break;
}
@@ -907,7 +910,7 @@ ret_t do_sched_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
case SCHEDOP_block:
{
- ret = do_block();
+ vcpu_block_enable_events();
break;
}
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index ad971d22fe..beadc429f9 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -690,6 +690,7 @@ static inline int vcpu_runnable(struct vcpu *v)
atomic_read(&v->domain->pause_count));
}
+void vcpu_block(void);
void vcpu_unblock(struct vcpu *v);
void vcpu_pause(struct vcpu *v);
void vcpu_pause_nosync(struct vcpu *v);