]> Git Repo - qemu.git/commitdiff
target-openrisc: Correct handling of page faults.
authorSebastian Macke <[email protected]>
Thu, 3 Oct 2013 08:04:46 +0000 (16:04 +0800)
committerJia Liu <[email protected]>
Thu, 3 Oct 2013 08:24:24 +0000 (16:24 +0800)
The result of (rw & 0) is always zero and therefore a logic false.
The whole comparison will therefore never be executed, it is a obvious bug,
we should use !(rw & 1) here.

Signed-off-by: Sebastian Macke <[email protected]>
Reviewed-by: Jia Liu <[email protected]>
target-openrisc/mmu.c

index 57f5616e9ca77f33356ba208b111e70db605b3bc..323a173a822fa642ddb40ebc3966ddbb52f9ab8e 100644 (file)
@@ -102,7 +102,7 @@ int cpu_openrisc_get_phys_data(OpenRISCCPU *cpu,
         }
     }
 
-    if ((rw & 0) && ((right & PAGE_READ) == 0)) {
+    if (!(rw & 1) && ((right & PAGE_READ) == 0)) {
         return TLBRET_BADADDR;
     }
     if ((rw & 1) && ((right & PAGE_WRITE) == 0)) {
This page took 0.025878 seconds and 4 git commands to generate.