diff options
author | Laurent Vivier <laurent@vivier.eu> | 2018-01-18 20:38:44 +0100 |
---|---|---|
committer | Laurent Vivier <laurent@vivier.eu> | 2018-01-25 16:02:24 +0100 |
commit | 5fa9f1f28321f7268e68e58cff8c61a2ab817f91 (patch) | |
tree | 5aa6b109d2d22fc37ab9738fa44c07ed62410976 /target/m68k/cpu.h | |
parent | 54e1e0b5b5ce4fc76335b1fbbf09cb8fdd5ab89d (diff) |
target/m68k: add moves
and introduce SFC and DFC control registers.
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20180118193846.24953-6-laurent@vivier.eu>
Diffstat (limited to 'target/m68k/cpu.h')
-rw-r--r-- | target/m68k/cpu.h | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/target/m68k/cpu.h b/target/m68k/cpu.h index 1c2bbac56d..cc1759bb5d 100644 --- a/target/m68k/cpu.h +++ b/target/m68k/cpu.h @@ -138,6 +138,8 @@ typedef struct CPUM68KState { uint32_t mbar; uint32_t rambar0; uint32_t cacr; + uint32_t sfc; + uint32_t dfc; int pending_vector; int pending_level; @@ -544,13 +546,26 @@ void m68k_cpu_unassigned_access(CPUState *cs, hwaddr addr, #include "exec/cpu-all.h" +/* TB flags */ +#define TB_FLAGS_MACSR 0x0f +#define TB_FLAGS_MSR_S_BIT 13 +#define TB_FLAGS_MSR_S (1 << TB_FLAGS_MSR_S_BIT) +#define TB_FLAGS_SFC_S_BIT 14 +#define TB_FLAGS_SFC_S (1 << TB_FLAGS_SFC_S_BIT) +#define TB_FLAGS_DFC_S_BIT 15 +#define TB_FLAGS_DFC_S (1 << TB_FLAGS_DFC_S_BIT) + static inline void cpu_get_tb_cpu_state(CPUM68KState *env, target_ulong *pc, target_ulong *cs_base, uint32_t *flags) { *pc = env->pc; *cs_base = 0; - *flags = (env->sr & SR_S) /* Bit 13 */ - | ((env->macsr >> 4) & 0xf); /* Bits 0-3 */ + *flags = (env->macsr >> 4) & TB_FLAGS_MACSR; + if (env->sr & SR_S) { + *flags |= TB_FLAGS_MSR_S; + *flags |= (env->sfc << (TB_FLAGS_SFC_S_BIT - 2)) & TB_FLAGS_SFC_S; + *flags |= (env->dfc << (TB_FLAGS_DFC_S_BIT - 2)) & TB_FLAGS_DFC_S; + } } #endif |