aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdgar E. Iglesias <edgar.iglesias@gmail.com>2009-10-10 17:34:27 +0200
committerEdgar E. Iglesias <edgar.iglesias@gmail.com>2009-10-10 17:34:27 +0200
commit218951ef4dc8e973cd27f934fab34c6e78ed2941 (patch)
treee9434dde22bf8f613b68cf3443891a94f7a87014 /target-cris
parentFix Windows host breakage by 45a50b1668822c23afc2a89f724654e176518bc4 (TeLeMan) (diff)
downloadqemu-kvm-218951ef4dc8e973cd27f934fab34c6e78ed2941.tar.gz
qemu-kvm-218951ef4dc8e973cd27f934fab34c6e78ed2941.tar.bz2
qemu-kvm-218951ef4dc8e973cd27f934fab34c6e78ed2941.zip
CRIS: Segmented addressing only for kernel mode.
Segmented translation through the CRIS MMU is only done for accesses in kernel mode. In user-mode, all accesses are treated as paged regardless of the mode config in RW_MM_CFG. Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Diffstat (limited to 'target-cris')
-rw-r--r--target-cris/helper.c6
-rw-r--r--target-cris/mmu.c2
2 files changed, 5 insertions, 3 deletions
diff --git a/target-cris/helper.c b/target-cris/helper.c
index a12ac10ee..ff4f2fe1d 100644
--- a/target-cris/helper.c
+++ b/target-cris/helper.c
@@ -172,8 +172,6 @@ void do_interrupt(CPUState *env)
env->dslot = 0;
}
- env->pc = ldl_code(env->pregs[PR_EBP] + ex_vec * 4);
-
if (env->pregs[PR_CCS] & U_FLAG) {
/* Swap stack pointers. */
env->pregs[PR_USP] = env->regs[R_SP];
@@ -182,6 +180,10 @@ void do_interrupt(CPUState *env)
/* Apply the CRIS CCS shift. Clears U if set. */
cris_shift_ccs(env);
+
+ /* Now that we are in kernel mode, load the handlers address. */
+ env->pc = ldl_code(env->pregs[PR_EBP] + ex_vec * 4);
+
D_LOG("%s isr=%x vec=%x ccs=%x pid=%d erp=%x\n",
__func__, env->pc, ex_vec,
env->pregs[PR_CCS],
diff --git a/target-cris/mmu.c b/target-cris/mmu.c
index bc5b7105d..b6892bbbf 100644
--- a/target-cris/mmu.c
+++ b/target-cris/mmu.c
@@ -345,7 +345,7 @@ int cris_mmu_translate(struct cris_mmu_result *res,
}
seg = vaddr >> 28;
- if (cris_mmu_segmented_addr(seg, env->sregs[SFR_RW_MM_CFG]))
+ if (!is_user && cris_mmu_segmented_addr(seg, env->sregs[SFR_RW_MM_CFG]))
{
uint32_t base;