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:
Sebastian Macke 2013-10-03 16:04:46 +08:00 committed by Jia Liu
parent a684f3cf9b
commit bf961b5278
1 changed files with 1 additions and 1 deletions

View 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)) {