diff options
author | edgar_igl <edgar_igl@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-03-14 01:08:09 +0000 |
---|---|---|
committer | edgar_igl <edgar_igl@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-03-14 01:08:09 +0000 |
commit | 786c02f1acb73ca68ecdc4fa93911495dc1147c6 (patch) | |
tree | 0af7a4fd67683e1f6531d56c3da62a943b8ee801 /target-cris/op.c | |
parent | e62b5b133b97e07711741e2a4e2bf3e4dbc254f8 (diff) |
Model more parts of the ETRAX mmu (still alot missing).
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4056 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-cris/op.c')
-rw-r--r-- | target-cris/op.c | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/target-cris/op.c b/target-cris/op.c index aeb80de4a3..d44185c4d4 100644 --- a/target-cris/op.c +++ b/target-cris/op.c @@ -153,7 +153,7 @@ void OPPROTO op_break_im(void) { - env->trapnr = PARAM1; + env->trap_vector = PARAM1; env->exception_index = EXCP_BREAK; cpu_loop_exit(); } @@ -196,7 +196,7 @@ void OPPROTO op_ccs_rshift (void) /* Apply the ccs shift. */ ccs = env->pregs[PR_CCS]; - ccs = (ccs & 0xc0000000) | (ccs >> 10); + ccs = (ccs & 0xc0000000) | ((ccs & 0x0fffffff) >> 10); env->pregs[PR_CCS] = ccs; RETURN(); } @@ -269,28 +269,41 @@ void OPPROTO op_movl_sreg_T0 (void) RETURN(); } +void OPPROTO op_movl_tlb_hi_T0 (void) +{ + uint32_t srs; + srs = env->pregs[PR_SRS]; + if (srs == 1 || srs == 2) + { + /* Writes to tlb-hi write to mm_cause as a side effect. */ + env->sregs[SFR_RW_MM_TLB_HI] = T0; + env->sregs[SFR_R_MM_CAUSE] = T0; + } + RETURN(); +} + void OPPROTO op_movl_tlb_lo_T0 (void) { - int srs; + uint32_t srs; srs = env->pregs[PR_SRS]; if (srs == 1 || srs == 2) { - int set; - int idx; + uint32_t set; + uint32_t idx; uint32_t lo, hi; idx = set = env->sregs[SFR_RW_MM_TLB_SEL]; set >>= 4; set &= 3; - idx &= 31; + idx &= 15; /* We've just made a write to tlb_lo. */ lo = env->sregs[SFR_RW_MM_TLB_LO]; - hi = env->sregs[SFR_RW_MM_TLB_HI]; + /* Writes are done via r_mm_cause. */ + hi = env->sregs[SFR_R_MM_CAUSE]; env->tlbsets[srs - 1][set][idx].lo = lo; env->tlbsets[srs - 1][set][idx].hi = hi; } - RETURN(); } |