]> xenbits.xensource.com Git - people/liuw/mini-os.git/commitdiff
minios: fix and enforce block_domain atomicity
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 8 May 2008 12:14:27 +0000 (13:14 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 8 May 2008 12:14:27 +0000 (13:14 +0100)
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 <samuel.thibault@eu.citrix.com>
arch/x86/time.c

index a396dc279f72ce5ef8112cce8e29d860cef7a9bf..d7b387f95f86a0224dde189010713c64624e0f18 100644 (file)
@@ -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();
     }
 }