@@ -339,9 +339,9 @@ InstructionTLBMiss:
mfspr r11, SPRN_MD_TWC /* ....and get the pte address */
lwz r10, 0(r11) /* Get the pte */
- /* r10=(r10&~_PAGE_PRESENT)|((r10&_PAGE_ACCESSED)>>5) */
- rlwimi. r10, r10, 27, 31, 31
- beq- cr0, 2f /* Can be removed, costs a ITLB Err */
+ andi. r11, r10, _PAGE_ACCESSED | _PAGE_PRESENT
+ cmpwi cr0, r11, _PAGE_ACCESSED | _PAGE_PRESENT
+ bne- cr0, 2f
#if 0 /* Dont' bother with PP lsb, bit 21 for now */
/* r10 = (r10 & ~0x0400) | ((r10 & _PAGE_EXEC) << 7) */
@@ -429,9 +429,11 @@ DataStoreTLBMiss:
/* Need to know if load/store -> force a TLB Error
* by copying ACCESSED to PRESENT.
*/
- /* r10=(r10&~_PAGE_PRESENT)|((r10&_PAGE_ACCESSED)>>5) */
- rlwimi r10, r10, 27, 31, 31
-
+ andi. r11, r10, _PAGE_ACCESSED | _PAGE_PRESENT
+ cmpwi cr0, r11, _PAGE_ACCESSED | _PAGE_PRESENT
+ beq+ cr0, 6f
+ rlwinm r10, r10, 0, 0, 30 /* Clear _PAGE_PRESENT */
+6:
#if 0 /* Not yet */
/* Honour kernel RO, User NA */
andi. r11, r10, _PAGE_USER | _PAGE_RW
@@ -492,7 +494,7 @@ DataTLBError:
cmpwi cr0, r10, 0x00f0
beq- FixDAR /* must be a buggy dcbX, icbi insn. */
DARFix: /* Return from dcbx instruction bug workaround, r10 holds value of DAR */
-
+ b 2f /* Do DIRTY in C */
mfspr r11, SPRN_DSISR
andis. r11, r11, 0x4800 /* !translation or protection */
bne 2f /* branch if either is set */