Revision 98c1b82b target-mips/helper.c
b/target-mips/helper.c | ||
---|---|---|
50 | 50 |
/* TLB match */ |
51 | 51 |
n = (address >> 12) & 1; |
52 | 52 |
/* Check access rights */ |
53 |
if ((tlb->V[n] & 2) && (rw == 0 || (tlb->D[n] & 4))) { |
|
53 |
if (!(n ? tlb->V1 : tlb->V0)) |
|
54 |
return -3; |
|
55 |
if (rw == 0 || (n ? tlb->D1 : tlb->D0)) { |
|
54 | 56 |
*physical = tlb->PFN[n] | (address & 0xFFF); |
55 | 57 |
*prot = PAGE_READ; |
56 |
if (tlb->D[n])
|
|
58 |
if (n ? tlb->D1 : tlb->D0)
|
|
57 | 59 |
*prot |= PAGE_WRITE; |
58 | 60 |
return 0; |
59 |
} else if (!(tlb->V[n] & 2)) { |
|
60 |
return -3; |
|
61 |
} else { |
|
62 |
return -4; |
|
63 | 61 |
} |
62 |
return -4; |
|
64 | 63 |
} |
65 | 64 |
} |
66 | 65 |
|
Also available in: Unified diff