From 5991224aff6747d3d50e83da00659a0a277c9cc0 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Thu, 8 May 2008 13:14:27 +0100 Subject: minios: fix and enforce block_domain atomicity To ensure that the timer event is not lost, block_domain requires that event delivery is disabled. SCHEDOP_block re-enables them, so for coherency (and fixing a bug actually), we should re-disable them after. Also, make sure that the caller disabled them. Signed-off-by: Samuel Thibault --- extras/mini-os/arch/x86/time.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'extras/mini-os/arch') diff --git a/extras/mini-os/arch/x86/time.c b/extras/mini-os/arch/x86/time.c index a396dc279f..d7b387f95f 100644 --- a/extras/mini-os/arch/x86/time.c +++ b/extras/mini-os/arch/x86/time.c @@ -201,10 +201,12 @@ void block_domain(s_time_t until) { struct timeval tv; gettimeofday(&tv, NULL); + ASSERT(irqs_disabled()); if(monotonic_clock() < until) { HYPERVISOR_set_timer_op(until); HYPERVISOR_sched_op(SCHEDOP_block, 0); + local_irq_disable(); } } -- cgit v1.2.3