Commit 4e588a4d authored by bellard's avatar bellard
Browse files

negative decr fix

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162
parent a368741b
......@@ -107,13 +107,16 @@ uint32_t cpu_ppc_load_decr (CPUState *env)
ppc_tb_t *tb_env = env->tb_env;
uint32_t decr;
int64_t diff;
decr = muldiv64(tb_env->decr_next - qemu_get_clock(vm_clock),
tb_env->tb_freq, ticks_per_sec);
diff = tb_env->decr_next - qemu_get_clock(vm_clock);
if (diff >= 0)
decr = muldiv64(diff, tb_env->tb_freq, ticks_per_sec);
decr = -muldiv64(-diff, tb_env->tb_freq, ticks_per_sec);
#if defined(DEBUG_TB)
printf("%s: 0x%08x\n", __func__, decr);
return decr;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment