Skip to contentSkip to conversation

minios: fix and enforce block_domain atomicity

PATCH New Samuel Thibault 1 participant 1 message May 8, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 minios: fix and enforce block_domain atomicity

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.

extras/mini-os/arch/x86/time.c +2 -0
diff -r 4965e711fee8 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();
     }
 }