aboutsummaryrefslogtreecommitdiff
path: root/target-cris
diff options
context:
space:
mode:
authoredgar_igl <edgar_igl@c046a42c-6fe2-441c-8c8c-71466251a162>2008-06-09 23:07:50 +0000
committeredgar_igl <edgar_igl@c046a42c-6fe2-441c-8c8c-71466251a162>2008-06-09 23:07:50 +0000
commit5bf8f1aba1ab727713edf4084e7bc841dd1e6732 (patch)
tree34909af89d28068859975abba7e72ddf8181129b /target-cris
parenta7cfbba0cf90e3a42f2fc05556dd5b1d614f4cad (diff)
CRIS: Support RFN insn.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4718 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-cris')
-rw-r--r--target-cris/helper.h1
-rw-r--r--target-cris/op_helper.c19
2 files changed, 20 insertions, 0 deletions
diff --git a/target-cris/helper.h b/target-cris/helper.h
index 34f6831f4e..4c96f0487b 100644
--- a/target-cris/helper.h
+++ b/target-cris/helper.h
@@ -5,6 +5,7 @@ void TCG_HELPER_PROTO helper_tlb_flush_pid(uint32_t pid);
void TCG_HELPER_PROTO helper_dump(uint32_t a0, uint32_t a1, uint32_t a2);
void TCG_HELPER_PROTO helper_dummy(void);
void TCG_HELPER_PROTO helper_rfe(void);
+void TCG_HELPER_PROTO helper_rfn(void);
void TCG_HELPER_PROTO helper_store(uint32_t a0);
void TCG_HELPER_PROTO helper_movl_sreg_reg (uint32_t sreg, uint32_t reg);
diff --git a/target-cris/op_helper.c b/target-cris/op_helper.c
index f5c0ed191f..0e7d3c37ff 100644
--- a/target-cris/op_helper.c
+++ b/target-cris/op_helper.c
@@ -220,6 +220,25 @@ void helper_rfe(void)
env->pregs[PR_CCS] |= P_FLAG;
}
+void helper_rfn(void)
+{
+ int rflag = env->pregs[PR_CCS] & R_FLAG;
+
+ D(fprintf(logfile, "rfn: erp=%x pid=%x ccs=%x btarget=%x\n",
+ env->pregs[PR_ERP], env->pregs[PR_PID],
+ env->pregs[PR_CCS],
+ env->btarget));
+
+ cris_ccs_rshift(env);
+
+ /* Set the P_FLAG only if the R_FLAG is not set. */
+ if (!rflag)
+ env->pregs[PR_CCS] |= P_FLAG;
+
+ /* Always set the M flag. */
+ env->pregs[PR_CCS] |= M_FLAG;
+}
+
void helper_store(uint32_t a0)
{
if (env->pregs[PR_CCS] & P_FLAG )