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