* [Qemu-devel] [PATCH] sparc32: fix setting counter limit to 0
@ 2007-12-16 23:38 Robert Reif
2007-12-17 18:24 ` Blue Swirl
0 siblings, 1 reply; 2+ messages in thread
From: Robert Reif @ 2007-12-16 23:38 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 36 bytes --]
Set the proper limit when set to 0.
[-- Attachment #2: timer1.diff.txt --]
[-- Type: text/plain, Size: 1765 bytes --]
Index: hw/slavio_timer.c
===================================================================
RCS file: /sources/qemu/qemu/hw/slavio_timer.c,v
retrieving revision 1.21
diff -p -u -r1.21 slavio_timer.c
--- hw/slavio_timer.c 1 Dec 2007 15:58:22 -0000 1.21
+++ hw/slavio_timer.c 16 Dec 2007 23:28:13 -0000
@@ -174,7 +175,6 @@ static void slavio_timer_mem_writel(void
{
SLAVIO_TIMERState *s = opaque;
uint32_t saddr;
- int reload = 0;
DPRINTF("write " TARGET_FMT_plx " %08x\n", addr, val);
saddr = (addr & TIMER_MAXADDR) >> 2;
@@ -190,9 +190,10 @@ static void slavio_timer_mem_writel(void
// set limit, reset counter
qemu_irq_lower(s->irq);
s->limit = val & TIMER_MAX_COUNT32;
- if (!s->limit)
- s->limit = TIMER_MAX_COUNT32;
- ptimer_set_limit(s->timer, s->limit >> 9, 1);
+ if (s->limit == 0) /* free-run */
+ ptimer_set_limit(s->timer, LIMIT_TO_PERIODS(TIMER_MAX_COUNT32), 1);
+ else
+ ptimer_set_limit(s->timer, LIMIT_TO_PERIODS(s->limit), 1);
}
break;
case TIMER_COUNTER:
@@ -208,9 +209,10 @@ static void slavio_timer_mem_writel(void
case TIMER_COUNTER_NORST:
// set limit without resetting counter
s->limit = val & TIMER_MAX_COUNT32;
- if (!s->limit)
- s->limit = TIMER_MAX_COUNT32;
- ptimer_set_limit(s->timer, LIMIT_TO_PERIODS(s->limit), reload);
+ if (s->limit == 0) /* free-run */
+ ptimer_set_limit(s->timer, LIMIT_TO_PERIODS(TIMER_MAX_COUNT32), 0);
+ else
+ ptimer_set_limit(s->timer, LIMIT_TO_PERIODS(s->limit), 0);
break;
case TIMER_STATUS:
if (slavio_timer_is_user(s)) {
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] sparc32: fix setting counter limit to 0
2007-12-16 23:38 [Qemu-devel] [PATCH] sparc32: fix setting counter limit to 0 Robert Reif
@ 2007-12-17 18:24 ` Blue Swirl
0 siblings, 0 replies; 2+ messages in thread
From: Blue Swirl @ 2007-12-17 18:24 UTC (permalink / raw)
To: qemu-devel
On 12/17/07, Robert Reif <reif@earthlink.net> wrote:
> Set the proper limit when set to 0.
Thanks, applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-12-17 18:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-16 23:38 [Qemu-devel] [PATCH] sparc32: fix setting counter limit to 0 Robert Reif
2007-12-17 18:24 ` Blue Swirl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).