On 09/12/2012 11:33 PM, address@hidden wrote:
+uint32_t HELPER(move_from_usp)(CPUM68KState * env)
+{
+ return env->sp[M68K_USP];
+}
You don't need helpers for these.
DISAS_INSN(move_from_usp)
{
+ TCGv reg;
if (IS_USER(s)) {
gen_exception(s, s->pc - 2, EXCP_PRIVILEGE);
return;
}
- /* TODO: Implement USP. */
- gen_exception(s, s->pc - 2, EXCP_ILLEGAL);
+ reg = AREG(insn, 0);
+ gen_helper_move_from_usp(reg, cpu_env);
tcg_gen_ld_i32(AREG(insn, 0), offsetof(CPUM68KState, sp[M68K_USP]));
DISAS_INSN(move_to_usp)
{
+ TCGv reg;
if (IS_USER(s)) {
gen_exception(s, s->pc - 2, EXCP_PRIVILEGE);
return;
}
- /* TODO: Implement USP. */
- gen_exception(s, s->pc - 2, EXCP_ILLEGAL);
+ reg = AREG(insn, 0);
+ gen_helper_move_to_usp(cpu_env, reg);
tcg_gen_st_i32(AREG(insn, 0), offsetof(CPUM68KState, sp[M68K_USP]));