target-openrisc: Correct handling of page faults.
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 <sebastian@macke.de> Reviewed-by: Jia Liu <proljc@gmail.com>
This commit is contained in:
parent
a684f3cf9b
commit
bf961b5278
@ -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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user