Fix Qemu division by zero triggered by NetBSD

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2825 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
blueswir1 2007-05-17 19:32:20 +00:00
parent 6c36d3fa86
commit 31ade71508
1 changed files with 4 additions and 6 deletions

View File

@ -80,13 +80,11 @@ static void slavio_timer_get_out(SLAVIO_TIMERState *s)
out = (ticks > s->expire_time);
if (out)
s->reached = 0x80000000;
if (!s->limit)
limit = 0x7fffffff;
else
limit = s->limit;
// Convert register units to counter ticks
limit = limit >> 9;
limit = s->limit >> 9;
if (!limit)
limit = 0x7fffffff >> 9;
// Convert cpu ticks to counter ticks
diff = muldiv64(ticks - s->count_load_time, CNT_FREQ, ticks_per_sec);