Skip to contentSkip to conversation

[5445] CRIS: Fix brk 8 and add S-flag emulation.

Qemu-devel Edgar E. Iglesias 1 participant 1 message Oct 7, 2008

lore
Share & tools
lore
#0 lore raw

Revision: 5445

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5445
Author:   edgar_igl
Date:     2008-10-07 22:48:41 +0000 (Tue, 07 Oct 2008)

Log Message:
-----------
CRIS: Fix brk 8 and add S-flag emulation.

* break 8 sets ERP to the current insn.
* First shot at S flag single-stepping.
* Make it easier to use the local disasm.

Modified Paths:
--------------
trunk/cpu-exec.c
trunk/target-cris/helper.c
trunk/target-cris/helper.h
trunk/target-cris/op_helper.c
trunk/target-cris/translate.c

Modified: trunk/cpu-exec.c
===================================================================

cpu-exec.c +1 -1
@@ -220,7 +220,7 @@
     cs_base = 0;
     pc = env->pc;
 #elif defined(TARGET_CRIS)
-    flags = env->pregs[PR_CCS] & (P_FLAG | U_FLAG | X_FLAG);
+    flags = env->pregs[PR_CCS] & (S_FLAG | P_FLAG | U_FLAG | X_FLAG);
     flags |= env->dslot;
     cs_base = 0;
     pc = env->pc;

Modified: trunk/target-cris/helper.c
===================================================================

target-cris/helper.c +1 -1
@@ -119,7 +119,7 @@
 			/* These exceptions are genereated by the core itself.
 			   ERP should point to the insn following the brk.  */
 			ex_vec = env->trap_vector;
-			env->pregs[PR_ERP] = env->pc + 2;
+			env->pregs[PR_ERP] = env->pc;
 			break;
 
 		case EXCP_NMI:

Modified: trunk/target-cris/helper.h
===================================================================

target-cris/helper.h +1 -0
@@ -2,6 +2,7 @@
 
 void TCG_HELPER_PROTO helper_raise_exception(uint32_t index);
 void TCG_HELPER_PROTO helper_tlb_flush_pid(uint32_t pid);
+void TCG_HELPER_PROTO helper_spc_write(uint32_t pid);
 void TCG_HELPER_PROTO helper_dump(uint32_t a0, uint32_t a1, uint32_t a2);
 void TCG_HELPER_PROTO helper_rfe(void);
 void TCG_HELPER_PROTO helper_rfn(void);

Modified: trunk/target-cris/op_helper.c
===================================================================

target-cris/op_helper.c +8 -0
@@ -97,6 +97,14 @@
 #endif
 }
 
+void helper_spc_write(uint32_t new_spc)
+{
+#if !defined(CONFIG_USER_ONLY)
+	tlb_flush_page(env, env->pregs[PR_SPC]);
+	tlb_flush_page(env, new_spc);
+#endif
+}
+
 void helper_dump(uint32_t a0, uint32_t a1, uint32_t a2)
 {
 	(fprintf(logfile, "%s: a0=%x a1=%x\n", __func__, a0, a1)); 

Modified: trunk/target-cris/translate.c
===================================================================

target-cris/translate.c +40 -16

146 lines not on this page · raw message