minios: fix and enforce block_domain atomicity
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.
Signed-off-by Samuel Thibault <[email protected]>
extras/mini-os/arch/x86/time.c +2 -0
@@ -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 (); } }