diff options
author | Artyom Tarasenko <atar4qemu@gmail.com> | 2016-11-01 21:57:01 +0100 |
---|---|---|
committer | Artyom Tarasenko <atar4qemu@gmail.com> | 2017-01-18 22:03:44 +0100 |
commit | c9b459aab8c5775a21dd913fc8820b736181e7be (patch) | |
tree | 41948f34dfda9cd68bfcff46c48319c87a6fe1d1 /target/sparc/cpu.h | |
parent | 1ceca928538a3633b74a7dc718a05ce6767f2f76 (diff) | |
download | qemu-c9b459aab8c5775a21dd913fc8820b736181e7be.zip qemu-c9b459aab8c5775a21dd913fc8820b736181e7be.tar.gz qemu-c9b459aab8c5775a21dd913fc8820b736181e7be.tar.bz2 |
target-sparc: store cpu super- and hypervisor flags in TB
Suggested-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com>
Diffstat (limited to 'target/sparc/cpu.h')
-rw-r--r-- | target/sparc/cpu.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/target/sparc/cpu.h b/target/sparc/cpu.h index e815a19..1e65c94 100644 --- a/target/sparc/cpu.h +++ b/target/sparc/cpu.h @@ -670,6 +670,11 @@ static inline int cpu_supervisor_mode(CPUSPARCState *env1) { return env1->pstate & PS_PRIV; } +#else +static inline int cpu_supervisor_mode(CPUSPARCState *env1) +{ + return env1->psrs; +} #endif static inline int cpu_mmu_index(CPUSPARCState *env, bool ifetch) @@ -736,6 +741,8 @@ trap_state* cpu_tsptr(CPUSPARCState* env); #define TB_FLAG_MMU_MASK 7 #define TB_FLAG_FPU_ENABLED (1 << 4) #define TB_FLAG_AM_ENABLED (1 << 5) +#define TB_FLAG_SUPER (1 << 6) +#define TB_FLAG_HYPER (1 << 7) #define TB_FLAG_ASI_SHIFT 24 static inline void cpu_get_tb_cpu_state(CPUSPARCState *env, target_ulong *pc, @@ -745,7 +752,17 @@ static inline void cpu_get_tb_cpu_state(CPUSPARCState *env, target_ulong *pc, *pc = env->pc; *cs_base = env->npc; flags = cpu_mmu_index(env, false); +#ifndef CONFIG_USER_ONLY + if (cpu_supervisor_mode(env)) { + flags |= TB_FLAG_SUPER; + } +#endif #ifdef TARGET_SPARC64 +#ifndef CONFIG_USER_ONLY + if (cpu_hypervisor_mode(env)) { + flags |= TB_FLAG_HYPER; + } +#endif if (env->pstate & PS_AM) { flags |= TB_FLAG_AM_ENABLED; } |