mirror of https://gitee.com/openkylin/qemu.git
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:
parent
6c36d3fa86
commit
31ade71508
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue