]> xenbits.xensource.com Git - people/iwj/xen.git/commitdiff
xen: introduce vcpu_block
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>
Tue, 23 Apr 2013 11:19:26 +0000 (12:19 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Tue, 30 Apr 2013 10:32:04 +0000 (11:32 +0100)
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>
xen/common/schedule.c
xen/include/xen/sched.h

index c1cd3d0f158983e8ff46b3e91f1eb9b1822d33f3..e52660236a1173900b5cc4e8fa5f714e51d045c3 100644 (file)
@@ -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;
     }
 
index ad971d22feeb53793719587718e6b96d484db541..beadc429f91d549777879e944ca31e73ecbf0754 100644 (file)
@@ -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);