summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorEdgar E. Iglesias <edgar.iglesias@gmail.com>2010-01-11 14:41:53 +0100
committerEdgar E. Iglesias <edgar.iglesias@gmail.com>2010-01-14 14:42:08 +0100
commitc5b9729ae918b890905e00870ffc08c9b56e6d17 (patch)
treedb7d822f2e60e19fd7a3dfc730144c4a061a3582
parentf25359cd87d181ceb62875aa893eed7d241418ad (diff)
downloadfocaccia-qemu-c5b9729ae918b890905e00870ffc08c9b56e6d17.tar.gz
focaccia-qemu-c5b9729ae918b890905e00870ffc08c9b56e6d17.zip
ppc-40x: Correct check for Endian swapping TLB entries.
Bailout on 40x TLB entries with endianess swapping only if the entry
is valid.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
-rw-r--r--target-ppc/op_helper.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/target-ppc/op_helper.c b/target-ppc/op_helper.c
index 3575b29317..f905c647a9 100644
--- a/target-ppc/op_helper.c
+++ b/target-ppc/op_helper.c
@@ -3981,13 +3981,15 @@ void helper_4xx_tlbwe_hi (target_ulong entry, target_ulong val)
                   tlb->size, TARGET_PAGE_SIZE, (int)((val >> 7) & 0x7));
     }
     tlb->EPN = val & ~(tlb->size - 1);
-    if (val & 0x40)
+    if (val & 0x40) {
         tlb->prot |= PAGE_VALID;
-    else
+        if (val & 0x20) {
+            /* XXX: TO BE FIXED */
+            cpu_abort(env,
+                      "Little-endian TLB entries are not supported by now\n");
+        }
+    } else {
         tlb->prot &= ~PAGE_VALID;
-    if (val & 0x20) {
-        /* XXX: TO BE FIXED */
-        cpu_abort(env, "Little-endian TLB entries are not supported by now\n");
     }
     tlb->PID = env->spr[SPR_40x_PID]; /* PID */
     LOG_SWTLB("%s: set up TLB %d RPN " TARGET_FMT_plx " EPN " TARGET_FMT_lx