m68k: implement move to/from usp register instruction

Fill out the code support for the move to/from usp instructions. They are
being decoded, but there is no code to support there actions. So add it.

Current versions of Linux running on the ColdFire 5208 use these instructions.

Backports commit 2a8327e8a8288e301a2f01bc3ca2d465a3a4ca78 from qemu
This commit is contained in:
Greg Ungerer 2018-02-13 17:06:42 -05:00 committed by Lioncash
parent 63e5f57bb2
commit 0a0383e2b5
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -2046,22 +2046,28 @@ DISAS_INSN(move_to_sr)
DISAS_INSN(move_from_usp)
{
TCGContext *tcg_ctx = s->uc->tcg_ctx;
if (IS_USER(s)) {
gen_exception(s, s->pc - 2, EXCP_PRIVILEGE);
return;
}
/* TODO: Implement USP. */
gen_exception(s, s->pc - 2, EXCP_ILLEGAL);
tcg_gen_ld_i32(tcg_ctx, AREG(insn, 0), tcg_ctx->cpu_env,
offsetof(CPUM68KState, sp[M68K_USP]));
}
DISAS_INSN(move_to_usp)
{
TCGContext *tcg_ctx = s->uc->tcg_ctx;
if (IS_USER(s)) {
gen_exception(s, s->pc - 2, EXCP_PRIVILEGE);
return;
}
/* TODO: Implement USP. */
gen_exception(s, s->pc - 2, EXCP_ILLEGAL);
tcg_gen_st_i32(tcg_ctx, AREG(insn, 0), tcg_ctx->cpu_env,
offsetof(CPUM68KState, sp[M68K_USP]));
}
DISAS_INSN(halt)