summaryrefslogtreecommitdiff
path: root/target-lm32
diff options
context:
space:
mode:
authorMarcelo Tosatti <mtosatti@redhat.com>2011-05-03 20:16:18 -0300
committerMarcelo Tosatti <mtosatti@redhat.com>2011-05-03 20:16:18 -0300
commit28262112181f27f302b5186f0df6428df6b513e7 (patch)
treec1a12fd82d869eb8c57da3e3314abb3437f3a8a1 /target-lm32
parent70757dcaa40e14978bf287084d8fab9efb815a2d (diff)
parent4eb1a092e5810298b2baf4b12d9f52ea0d52322f (diff)
Merge branch 'upstream-merge'HEADmaster
* upstream-merge: (197 commits) NBD: Avoid leaking a couple of strings when the NBD device is closed qemu-progress.c: printf isn't signal safe ide/atapi: fix set but unused atapi: Explain why we need a 'media not present' state atapi: Move comment to proper place qemu-img resize: Fix option parsing lm32: add Milkymist Minimac2 support milkymist-sysctl: fix timers milkymist-vgafb: fix console resizing lm32: fix exception handling kvm: use qemu_free consistently kvm: Install specialized interrupt handler fix crash in migration, 32-bit userspace on 64-bit host Redirect cpu_interrupt to callback handler Break up user and system cpu_interrupt implementations kvm: create kvmclock when one of the flags are present kvm: add kvmclock to its second bit x86: Allow multiple cpu feature matches of lookup_feature kvm: use kernel-provided para_features instead of statically coming up with new capabilities Don't zero out buffer in sched_getaffinity ... Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'target-lm32')
-rw-r--r--target-lm32/helper.c6
-rw-r--r--target-lm32/op_helper.c2
-rw-r--r--target-lm32/translate.c29
3 files changed, 3 insertions, 34 deletions
diff --git a/target-lm32/helper.c b/target-lm32/helper.c
index 318e2cf6e..4f3e7e0fc 100644
--- a/target-lm32/helper.c
+++ b/target-lm32/helper.c
@@ -76,11 +76,7 @@ void do_interrupt(CPUState *env)
env->regs[R_BA] = env->pc;
env->ie |= (env->ie & IE_IE) ? IE_BIE : 0;
env->ie &= ~IE_IE;
- if (env->dc & DC_RE) {
- env->pc = env->deba + (env->exception_index * 32);
- } else {
- env->pc = env->eba + (env->exception_index * 32);
- }
+ env->pc = env->deba + (env->exception_index * 32);
log_cpu_state_mask(CPU_LOG_INT, env, 0);
break;
default:
diff --git a/target-lm32/op_helper.c b/target-lm32/op_helper.c
index e84ba488b..c72b1df47 100644
--- a/target-lm32/op_helper.c
+++ b/target-lm32/op_helper.c
@@ -95,7 +95,7 @@ void tlb_fill(target_ulong addr, int is_write, int mmu_idx, void *retaddr)
if (tb) {
/* the PC is inside the translated code. It means that we have
a virtual CPU fault */
- cpu_restore_state(tb, env, pc, NULL);
+ cpu_restore_state(tb, env, pc);
}
}
cpu_loop_exit();
diff --git a/target-lm32/translate.c b/target-lm32/translate.c
index efc9b5a85..bcd52fe73 100644
--- a/target-lm32/translate.c
+++ b/target-lm32/translate.c
@@ -598,36 +598,10 @@ static void dec_scall(DisasContext *dc)
t0 = tcg_temp_new();
l1 = gen_new_label();
- /* save IE.IE */
- tcg_gen_andi_tl(t0, cpu_ie, IE_IE);
-
- /* IE.IE = 0 */
- tcg_gen_andi_tl(cpu_ie, cpu_ie, ~IE_IE);
-
if (dc->imm5 == 7) {
- /* IE.EIE = IE.IE */
- tcg_gen_ori_tl(cpu_ie, cpu_ie, IE_EIE);
- tcg_gen_brcondi_tl(TCG_COND_EQ, t0, IE_IE, l1);
- tcg_gen_andi_tl(cpu_ie, cpu_ie, ~IE_EIE);
- gen_set_label(l1);
-
- /* gpr[ea] = PC */
- tcg_gen_movi_tl(cpu_R[R_EA], dc->pc);
- tcg_temp_free(t0);
-
tcg_gen_movi_tl(cpu_pc, dc->pc);
t_gen_raise_exception(dc, EXCP_SYSTEMCALL);
} else {
- /* IE.BIE = IE.IE */
- tcg_gen_ori_tl(cpu_ie, cpu_ie, IE_BIE);
- tcg_gen_brcondi_tl(TCG_COND_EQ, t0, IE_IE, l1);
- tcg_gen_andi_tl(cpu_ie, cpu_ie, ~IE_BIE);
- gen_set_label(l1);
-
- /* gpr[ba] = PC */
- tcg_gen_movi_tl(cpu_R[R_BA], dc->pc);
- tcg_temp_free(t0);
-
tcg_gen_movi_tl(cpu_pc, dc->pc);
t_gen_raise_exception(dc, EXCP_BREAKPOINT);
}
@@ -1212,8 +1186,7 @@ void cpu_dump_state(CPUState *env, FILE *f, fprintf_function cpu_fprintf,
cpu_fprintf(f, "\n\n");
}
-void gen_pc_load(CPUState *env, struct TranslationBlock *tb,
- unsigned long searched_pc, int pc_pos, void *puc)
+void restore_state_to_opc(CPUState *env, TranslationBlock *tb, int pc_pos)
{
env->pc = gen_opc_pc[pc_pos];
}