mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-03-23 05:25:11 +00:00
target/m68k: add reset
The instruction traps if the CPU is not in Supervisor state but the helper is empty because there is no easy way to reset all the peripherals without resetting the CPU itself. Backports commit 0bdb2b3bf5660f892ddbfa09baea56cdca57ad1d from qemu
This commit is contained in:
parent
c5643956e3
commit
b82fe8b95c
|
@ -586,3 +586,10 @@ void HELPER(set_mac_extu)(CPUM68KState *env, uint32_t val, uint32_t acc)
|
|||
res |= (uint64_t)(val & 0xffff0000) << 16;
|
||||
env->macc[acc + 1] = res;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_SOFTMMU)
|
||||
void HELPER(reset)(CPUM68KState *env)
|
||||
{
|
||||
/* FIXME: reset all except CPU */
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -98,3 +98,7 @@ DEF_HELPER_FLAGS_4(bfffo_mem, TCG_CALL_NO_WG, i64, env, i32, s32, i32)
|
|||
|
||||
DEF_HELPER_3(chk, void, env, s32, s32)
|
||||
DEF_HELPER_4(chk2, void, env, s32, s32, s32)
|
||||
|
||||
#if defined(CONFIG_SOFTMMU)
|
||||
DEF_HELPER_FLAGS_1(reset, TCG_CALL_NO_RWG, void, env)
|
||||
#endif
|
||||
|
|
|
@ -2848,6 +2848,20 @@ DISAS_INSN(unlk)
|
|||
tcg_temp_free(tcg_ctx, src);
|
||||
}
|
||||
|
||||
#if defined(CONFIG_SOFTMMU)
|
||||
DISAS_INSN(reset)
|
||||
{
|
||||
TCGContext *tcg_ctx = s->uc->tcg_ctx;
|
||||
|
||||
if (IS_USER(s)) {
|
||||
gen_exception(s, s->insn_pc, EXCP_PRIVILEGE);
|
||||
return;
|
||||
}
|
||||
|
||||
gen_helper_reset(tcg_ctx, tcg_ctx->cpu_env);
|
||||
}
|
||||
#endif
|
||||
|
||||
DISAS_INSN(nop)
|
||||
{
|
||||
}
|
||||
|
@ -5779,6 +5793,7 @@ void register_m68k_insns (CPUM68KState *env)
|
|||
#if defined(CONFIG_SOFTMMU)
|
||||
INSN(move_to_usp, 4e60, fff8, USP);
|
||||
INSN(move_from_usp, 4e68, fff8, USP);
|
||||
INSN(reset, 4e70, ffff, M68000);
|
||||
BASE(stop, 4e72, ffff);
|
||||
BASE(rte, 4e73, ffff);
|
||||
INSN(movec, 4e7b, ffff, CF_ISA_A);
|
||||
|
|
Loading…
Reference in a new issue