Commit 5bf8f1aba1ab727713edf4084e7bc841dd1e6732

Authored by edgar_igl
1 parent a7cfbba0

CRIS: Support RFN insn.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4718 c046a42c-6fe2-441c-8c8c-71466251a162
target-cris/helper.h
... ... @@ -5,6 +5,7 @@ void TCG_HELPER_PROTO helper_tlb_flush_pid(uint32_t pid);
5 5 void TCG_HELPER_PROTO helper_dump(uint32_t a0, uint32_t a1, uint32_t a2);
6 6 void TCG_HELPER_PROTO helper_dummy(void);
7 7 void TCG_HELPER_PROTO helper_rfe(void);
  8 +void TCG_HELPER_PROTO helper_rfn(void);
8 9 void TCG_HELPER_PROTO helper_store(uint32_t a0);
9 10  
10 11 void TCG_HELPER_PROTO helper_movl_sreg_reg (uint32_t sreg, uint32_t reg);
... ...
target-cris/op_helper.c
... ... @@ -220,6 +220,25 @@ void helper_rfe(void)
220 220 env->pregs[PR_CCS] |= P_FLAG;
221 221 }
222 222  
  223 +void helper_rfn(void)
  224 +{
  225 + int rflag = env->pregs[PR_CCS] & R_FLAG;
  226 +
  227 + D(fprintf(logfile, "rfn: erp=%x pid=%x ccs=%x btarget=%x\n",
  228 + env->pregs[PR_ERP], env->pregs[PR_PID],
  229 + env->pregs[PR_CCS],
  230 + env->btarget));
  231 +
  232 + cris_ccs_rshift(env);
  233 +
  234 + /* Set the P_FLAG only if the R_FLAG is not set. */
  235 + if (!rflag)
  236 + env->pregs[PR_CCS] |= P_FLAG;
  237 +
  238 + /* Always set the M flag. */
  239 + env->pregs[PR_CCS] |= M_FLAG;
  240 +}
  241 +
223 242 void helper_store(uint32_t a0)
224 243 {
225 244 if (env->pregs[PR_CCS] & P_FLAG )
... ...