aboutsummaryrefslogtreecommitdiff
path: root/target-mips/helper.c
diff options
context:
space:
mode:
authorpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2006-03-11 16:20:36 +0000
committerpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2006-03-11 16:20:36 +0000
commit98c1b82b6cf96d650bf07a6a2bf0414907924ffe (patch)
treea8b73acbd58c9f9da2e110ba28805ca152e7a1e9 /target-mips/helper.c
parent6d6f7c288dbd892fb85028cb7a7fe8812ac11135 (diff)
e bitfields in mips TLB structures (Thiemo Seufer).
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1774 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-mips/helper.c')
-rw-r--r--target-mips/helper.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/target-mips/helper.c b/target-mips/helper.c
index 8b4deb3ddc..62c53a0bf0 100644
--- a/target-mips/helper.c
+++ b/target-mips/helper.c
@@ -50,17 +50,16 @@ static int map_address (CPUState *env, target_ulong *physical, int *prot,
/* TLB match */
n = (address >> 12) & 1;
/* Check access rights */
- if ((tlb->V[n] & 2) && (rw == 0 || (tlb->D[n] & 4))) {
+ if (!(n ? tlb->V1 : tlb->V0))
+ return -3;
+ if (rw == 0 || (n ? tlb->D1 : tlb->D0)) {
*physical = tlb->PFN[n] | (address & 0xFFF);
*prot = PAGE_READ;
- if (tlb->D[n])
+ if (n ? tlb->D1 : tlb->D0)
*prot |= PAGE_WRITE;
return 0;
- } else if (!(tlb->V[n] & 2)) {
- return -3;
- } else {
- return -4;
}
+ return -4;
}
}