diff options
author | Philippe Mathieu-Daudé <f4bug@amsat.org> | 2021-04-18 23:59:48 +0200 |
---|---|---|
committer | Philippe Mathieu-Daudé <f4bug@amsat.org> | 2021-05-02 16:49:34 +0200 |
commit | 533fc64feb96b6aafdb0d604cd1cd97877451878 (patch) | |
tree | 29719b38dc37c4e64a60f3ad01b72bf54b4b01a1 /target/mips/internal.h | |
parent | 4d169b9cce25bcef691d0c50a6c7d0d6350003ae (diff) |
target/mips: Declare mips_env_set_pc() inlined in "internal.h"
Rename set_pc() as mips_env_set_pc(), declare it inlined
and use it in cpu.c and op_helper.c.
Reported-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20210428170410.479308-9-f4bug@amsat.org>
Diffstat (limited to 'target/mips/internal.h')
-rw-r--r-- | target/mips/internal.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/target/mips/internal.h b/target/mips/internal.h index 57072a941e..04f4b3d661 100644 --- a/target/mips/internal.h +++ b/target/mips/internal.h @@ -219,6 +219,16 @@ bool mips_cpu_tlb_fill(CPUState *cs, vaddr address, int size, /* op_helper.c */ void update_pagemask(CPUMIPSState *env, target_ulong arg1, int32_t *pagemask); +static inline void mips_env_set_pc(CPUMIPSState *env, target_ulong value) +{ + env->active_tc.PC = value & ~(target_ulong)1; + if (value & 1) { + env->hflags |= MIPS_HFLAG_M16; + } else { + env->hflags &= ~(MIPS_HFLAG_M16); + } +} + static inline void restore_pamask(CPUMIPSState *env) { if (env->hflags & MIPS_HFLAG_ELPA) { |