[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] sparc32: fix count calculation when limit = 0
From: |
Robert Reif |
Subject: |
[Qemu-devel] [PATCH] sparc32: fix count calculation when limit = 0 |
Date: |
Mon, 17 Dec 2007 21:28:31 -0500 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.2) Gecko/20040308 |
Fix count calculation when counter limit set to 0.
diff -p -u -r1.23 slavio_timer.c
--- hw/slavio_timer.c 17 Dec 2007 18:21:57 -0000 1.23
+++ hw/slavio_timer.c 18 Dec 2007 02:23:37 -0000
@@ -97,9 +97,14 @@ static int slavio_timer_is_user(SLAVIO_T
// Convert from ptimer countdown units
static void slavio_timer_get_out(SLAVIO_TIMERState *s)
{
- uint64_t count;
+ uint64_t count, limit;
- count = s->limit - PERIODS_TO_LIMIT(ptimer_get_count(s->timer));
+ if (s->limit == 0) /* free-run processor or system counter */
+ limit = TIMER_MAX_COUNT32;
+ else
+ limit = s->limit;
+
+ count = limit - PERIODS_TO_LIMIT(ptimer_get_count(s->timer));
DPRINTF("get_out: limit %" PRIx64 " count %x%08x\n", s->limit,
s->counthigh, s->count);
s->count = count & TIMER_COUNT_MASK32;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Qemu-devel] [PATCH] sparc32: fix count calculation when limit = 0,
Robert Reif <=