aboutsummaryrefslogtreecommitdiff
path: root/target-cris
diff options
context:
space:
mode:
authoredgar_igl <edgar_igl@c046a42c-6fe2-441c-8c8c-71466251a162>2008-10-08 14:22:17 +0000
committeredgar_igl <edgar_igl@c046a42c-6fe2-441c-8c8c-71466251a162>2008-10-08 14:22:17 +0000
commitcddffe373928480e501f4d9b28b427e157b38f7d (patch)
treeed1e1976752b24be3a26edc9ab13911c7b53441a /target-cris
parentdd20fcd0ac20c4357f4d96786ab957c88c6cbe05 (diff)
CRIS: Partial EXS reg support and fixes for SPC.
* Add partial support for the EXS (exception status) register. * Update SPC after each singlestep exception. * Remove special treatment of break 8. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5448 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-cris')
-rw-r--r--target-cris/helper.c3
-rw-r--r--target-cris/translate.c12
2 files changed, 5 insertions, 10 deletions
diff --git a/target-cris/helper.c b/target-cris/helper.c
index 7770403ace..2aa5a8e7d2 100644
--- a/target-cris/helper.c
+++ b/target-cris/helper.c
@@ -143,6 +143,9 @@ void do_interrupt(CPUState *env)
break;
}
+ /* Fill in the IDX field. */
+ env->pregs[PR_EXS] = (ex_vec & 0xff) << 8;
+
if (env->dslot) {
D(fprintf(logfile, "excp isr=%x PC=%x ds=%d SP=%x"
" ERP=%x pid=%x ccs=%x cc=%d %x\n",
diff --git a/target-cris/translate.c b/target-cris/translate.c
index c030631696..86c455c4e8 100644
--- a/target-cris/translate.c
+++ b/target-cris/translate.c
@@ -196,10 +196,6 @@ static inline void t_gen_mov_TN_preg(TCGv tn, int r)
tcg_gen_mov_tl(tn, tcg_const_tl(0));
else if (r == PR_VR)
tcg_gen_mov_tl(tn, tcg_const_tl(32));
- else if (r == PR_EXS) {
- printf("read from EXS!\n");
- tcg_gen_mov_tl(tn, cpu_PR[r]);
- }
else if (r == PR_EDA) {
printf("read from EDA!\n");
tcg_gen_mov_tl(tn, cpu_PR[r]);
@@ -2811,12 +2807,7 @@ static unsigned int dec_rfe_etc(DisasContext *dc)
DIS(fprintf(logfile, "break %d\n", dc->op1));
cris_evaluate_flags (dc);
/* break. */
- if (dc->op1 == 8) {
- /* TODO: Find out whats special with brk8. */
- tcg_gen_movi_tl(env_pc, dc->pc);
- }
- else
- tcg_gen_movi_tl(env_pc, dc->pc + 2);
+ tcg_gen_movi_tl(env_pc, dc->pc + 2);
/* Breaks start at 16 in the exception vector. */
t_gen_mov_env_TN(trap_vector,
@@ -3005,6 +2996,7 @@ cris_decoder(DisasContext *dc)
cris_evaluate_flags (dc);
t_gen_mov_env_TN(trap_vector, tcg_const_tl(3));
tcg_gen_movi_tl(env_pc, dc->pc + insn_len);
+ tcg_gen_movi_tl(cpu_PR[PR_SPC], dc->pc + insn_len);
t_gen_raise_exception(EXCP_BREAK);
gen_set_label(l1);
}