Commit cddffe373928480e501f4d9b28b427e157b38f7d
1 parent
dd20fcd0
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
Showing
2 changed files
with
5 additions
and
10 deletions
target-cris/helper.c
... | ... | @@ -143,6 +143,9 @@ void do_interrupt(CPUState *env) |
143 | 143 | break; |
144 | 144 | } |
145 | 145 | |
146 | + /* Fill in the IDX field. */ | |
147 | + env->pregs[PR_EXS] = (ex_vec & 0xff) << 8; | |
148 | + | |
146 | 149 | if (env->dslot) { |
147 | 150 | D(fprintf(logfile, "excp isr=%x PC=%x ds=%d SP=%x" |
148 | 151 | " ERP=%x pid=%x ccs=%x cc=%d %x\n", | ... | ... |
target-cris/translate.c
... | ... | @@ -196,10 +196,6 @@ static inline void t_gen_mov_TN_preg(TCGv tn, int r) |
196 | 196 | tcg_gen_mov_tl(tn, tcg_const_tl(0)); |
197 | 197 | else if (r == PR_VR) |
198 | 198 | tcg_gen_mov_tl(tn, tcg_const_tl(32)); |
199 | - else if (r == PR_EXS) { | |
200 | - printf("read from EXS!\n"); | |
201 | - tcg_gen_mov_tl(tn, cpu_PR[r]); | |
202 | - } | |
203 | 199 | else if (r == PR_EDA) { |
204 | 200 | printf("read from EDA!\n"); |
205 | 201 | tcg_gen_mov_tl(tn, cpu_PR[r]); |
... | ... | @@ -2811,12 +2807,7 @@ static unsigned int dec_rfe_etc(DisasContext *dc) |
2811 | 2807 | DIS(fprintf(logfile, "break %d\n", dc->op1)); |
2812 | 2808 | cris_evaluate_flags (dc); |
2813 | 2809 | /* break. */ |
2814 | - if (dc->op1 == 8) { | |
2815 | - /* TODO: Find out whats special with brk8. */ | |
2816 | - tcg_gen_movi_tl(env_pc, dc->pc); | |
2817 | - } | |
2818 | - else | |
2819 | - tcg_gen_movi_tl(env_pc, dc->pc + 2); | |
2810 | + tcg_gen_movi_tl(env_pc, dc->pc + 2); | |
2820 | 2811 | |
2821 | 2812 | /* Breaks start at 16 in the exception vector. */ |
2822 | 2813 | t_gen_mov_env_TN(trap_vector, |
... | ... | @@ -3005,6 +2996,7 @@ cris_decoder(DisasContext *dc) |
3005 | 2996 | cris_evaluate_flags (dc); |
3006 | 2997 | t_gen_mov_env_TN(trap_vector, tcg_const_tl(3)); |
3007 | 2998 | tcg_gen_movi_tl(env_pc, dc->pc + insn_len); |
2999 | + tcg_gen_movi_tl(cpu_PR[PR_SPC], dc->pc + insn_len); | |
3008 | 3000 | t_gen_raise_exception(EXCP_BREAK); |
3009 | 3001 | gen_set_label(l1); |
3010 | 3002 | } | ... | ... |