}
/* 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. */
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)
case SCHEDOP_block:
{
- ret = do_block();
+ vcpu_block_enable_events();
break;
}
case SCHEDOP_block:
{
- ret = do_block();
+ vcpu_block_enable_events();
break;
}
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);