Merge git://git.infradead.org/mtd-2.6
[pandora-kernel.git] / arch / sh / kernel / cpu / sh3 / entry.S
index d8e1229..3fe482d 100644 (file)
@@ -13,8 +13,9 @@
 #include <linux/linkage.h>
 #include <asm/asm-offsets.h>
 #include <asm/thread_info.h>
-#include <asm/cpu/mmu_context.h>
 #include <asm/unistd.h>
+#include <cpu/mmu_context.h>
+#include <asm/page.h>
 
 ! NOTE:
 ! GNU as (as of 2.9.1) changes bf/s into bt/s and bra, when the address
@@ -149,8 +150,7 @@ call_dpf:
         lds    r10, pr
        rts
         nop
-0:     sti
-       mov.l   3f, r0
+0:     mov.l   3f, r0
        mov     r9, r6
        mov     r8, r5
        jmp     @r0
@@ -410,6 +410,27 @@ ENTRY(handle_exception)
        ! Using k0, k1 for scratch registers (r0_bank1, r1_bank),
        ! save all registers onto stack.
        !
+
+#ifdef CONFIG_GUSA
+       ! Check for roll back gRB (User and Kernel)
+       mov     r15, k0
+       shll    k0
+       bf/s    1f
+        shll   k0
+       bf/s    1f
+        stc    spc, k1
+       stc     r0_bank, k0
+       cmp/hs  k0, k1          ! test k1 (saved PC) >= k0 (saved r0)
+       bt/s    2f
+        stc    r1_bank, k1
+
+       add     #-2, k0
+       add     r15, k0
+       ldc     k0, spc         ! PC = saved r0 + r15 - 2
+2:     mov     k1, r15         ! SP = r1
+1:
+#endif
+
        stc     ssr, k0         ! Is it from kernel space?
        shll    k0              ! Check MD bit (bit30) by shifting it into...
        shll    k0              !       ...the T bit