Commit f55e9d9a authored by Tristan Gingold's avatar Tristan Gingold Committed by Aurelien Jarno
Browse files

target-ppc: fix typo in _cpu_ppc_load_decr



Use parameter 'next' to fix the hdecr case.
Also pass 'next' by value instead of pointer (more easy to read and no
performance issue for an always_inline function).

Signed-off-by: default avatarTristan Gingold <gingold@adacore.com>
Signed-off-by: default avatarAurelien Jarno <aurelien@aurel32.net>
parent d27cf0ae
...@@ -551,13 +551,13 @@ static void cpu_ppc_tb_start (CPUState *env) ...@@ -551,13 +551,13 @@ static void cpu_ppc_tb_start (CPUState *env)
} }
static always_inline uint32_t _cpu_ppc_load_decr (CPUState *env, static always_inline uint32_t _cpu_ppc_load_decr (CPUState *env,
uint64_t *next) uint64_t next)
{ {
ppc_tb_t *tb_env = env->tb_env; ppc_tb_t *tb_env = env->tb_env;
uint32_t decr; uint32_t decr;
int64_t diff; int64_t diff;
diff = tb_env->decr_next - qemu_get_clock(vm_clock); diff = next - qemu_get_clock(vm_clock);
if (diff >= 0) if (diff >= 0)
decr = muldiv64(diff, tb_env->decr_freq, ticks_per_sec); decr = muldiv64(diff, tb_env->decr_freq, ticks_per_sec);
else else
...@@ -571,14 +571,14 @@ uint32_t cpu_ppc_load_decr (CPUState *env) ...@@ -571,14 +571,14 @@ uint32_t cpu_ppc_load_decr (CPUState *env)
{ {
ppc_tb_t *tb_env = env->tb_env; ppc_tb_t *tb_env = env->tb_env;
return _cpu_ppc_load_decr(env, &tb_env->decr_next); return _cpu_ppc_load_decr(env, tb_env->decr_next);
} }
uint32_t cpu_ppc_load_hdecr (CPUState *env) uint32_t cpu_ppc_load_hdecr (CPUState *env)
{ {
ppc_tb_t *tb_env = env->tb_env; ppc_tb_t *tb_env = env->tb_env;
return _cpu_ppc_load_decr(env, &tb_env->hdecr_next); return _cpu_ppc_load_decr(env, tb_env->hdecr_next);
} }
uint64_t cpu_ppc_load_purr (CPUState *env) uint64_t cpu_ppc_load_purr (CPUState *env)
......
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