mips: Expire late timers when reading cp0_count
authorEdgar E. Iglesias <edgar.iglesias@gmail.com>
Mon, 17 Jan 2011 23:12:22 +0000 (00:12 +0100)
committerEdgar E. Iglesias <edgar.iglesias@gmail.com>
Tue, 18 Jan 2011 11:28:32 +0000 (12:28 +0100)
commit6bb57f8f76d2ae1fe7385b4e119163c83dd3c259
tree303e47d1bb4fff04647449409e67e464dabee573
parentdaea15cb68acd4b3cbe99ebe2cc16c7c3cb28e8e
mips: Expire late timers when reading cp0_count

When reading cp0_count from a timer with a late trigger that should
already have expired, expire it and raise the timer irq.

This makes it possible for guest code (e.g, Linux) that first read
cp0_count, then compare it with cp0_compare and check for raised
timer interrupt lines to run reliably.

Acked-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
hw/mips_timer.c