Commit f55e9d9a40acd3b0e364844017fa14f3aab76645
Committed by
Aurelien Jarno
1 parent
d27cf0ae
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: Tristan Gingold <gingold@adacore.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Showing
1 changed file
with
4 additions
and
4 deletions
hw/ppc.c
... | ... | @@ -551,13 +551,13 @@ static void cpu_ppc_tb_start (CPUState *env) |
551 | 551 | } |
552 | 552 | |
553 | 553 | static always_inline uint32_t _cpu_ppc_load_decr (CPUState *env, |
554 | - uint64_t *next) | |
554 | + uint64_t next) | |
555 | 555 | { |
556 | 556 | ppc_tb_t *tb_env = env->tb_env; |
557 | 557 | uint32_t decr; |
558 | 558 | int64_t diff; |
559 | 559 | |
560 | - diff = tb_env->decr_next - qemu_get_clock(vm_clock); | |
560 | + diff = next - qemu_get_clock(vm_clock); | |
561 | 561 | if (diff >= 0) |
562 | 562 | decr = muldiv64(diff, tb_env->decr_freq, ticks_per_sec); |
563 | 563 | else |
... | ... | @@ -571,14 +571,14 @@ uint32_t cpu_ppc_load_decr (CPUState *env) |
571 | 571 | { |
572 | 572 | ppc_tb_t *tb_env = env->tb_env; |
573 | 573 | |
574 | - return _cpu_ppc_load_decr(env, &tb_env->decr_next); | |
574 | + return _cpu_ppc_load_decr(env, tb_env->decr_next); | |
575 | 575 | } |
576 | 576 | |
577 | 577 | uint32_t cpu_ppc_load_hdecr (CPUState *env) |
578 | 578 | { |
579 | 579 | ppc_tb_t *tb_env = env->tb_env; |
580 | 580 | |
581 | - return _cpu_ppc_load_decr(env, &tb_env->hdecr_next); | |
581 | + return _cpu_ppc_load_decr(env, tb_env->hdecr_next); | |
582 | 582 | } |
583 | 583 | |
584 | 584 | uint64_t cpu_ppc_load_purr (CPUState *env) | ... | ... |