Skip to contentSkip to conversation

SlavIO Counter-Timers fix

PATCH New Aurelien Jarno 1 participant 1 message Mar 17, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 SlavIO Counter-Timers fix

Hi all,

Currently, the time on the SPARC sun4m target running Linux goes about 30% too fast.

This is due to a bug in the SlavIO Counter-Timers emulation. When in system mode the counter must be reset when a new limit is written, but *not* when the current limit is read (which also clears the interrupt).

The patch below fixes that.

Bye,
Aurelien

Index: hw/slavio_timer.c
===================================================================
RCS file: /sources/qemu/qemu/hw/slavio_timer.c,v
retrieving revision 1.4

slavio_timer.c +0 -1
diff -u -d -p -r1.4 slavio_timer.c
@@ -131,7 +131,6 @@ static uint32_t slavio_timer_mem_readl(v
 	if (s->mode != 1) {
 	    // clear irq
 	    pic_set_irq_cpu(s->irq, 0, s->cpu);
-	    s->count_load_time = qemu_get_clock(vm_clock);
 	    s->reached = 0;
 	    return s->limit;
 	}
Signature · 4 lines
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   [email protected]         | [email protected]
   `-    people.debian.org/~aurel32 | www.aurel32.net