From 2e70f6efa8b960d3b5401373ad6fa98747bb9578 Mon Sep 17 00:00:00 2001 From: pbrook Date: Sun, 29 Jun 2008 01:03:05 +0000 Subject: Add instruction counter. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4799 c046a42c-6fe2-441c-8c8c-71466251a162 --- hw/mips_timer.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'hw/mips_timer.c') diff --git a/hw/mips_timer.c b/hw/mips_timer.c index 5b172ea424..5549e2483a 100644 --- a/hw/mips_timer.c +++ b/hw/mips_timer.c @@ -91,7 +91,12 @@ static void mips_timer_cb (void *opaque) if (env->CP0_Cause & (1 << CP0Ca_DC)) return; + /* ??? This callback should occur when the counter is exactly equal to + the comparator value. Offset the count by one to avoid immediately + retriggering the callback before any virtual time has passed. */ + env->CP0_Count++; cpu_mips_timer_update(env); + env->CP0_Count--; if (env->insn_flags & ISA_MIPS32R2) env->CP0_Cause |= 1 << CP0Ca_TI; qemu_irq_raise(env->irq[(env->CP0_IntCtl >> CP0IntCtl_IPTI) & 0x7]); -- cgit v1.2.3