fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / arch / sparc / lib / copy_user.S
index 0924f82..ef095b6 100644 (file)
@@ -14,6 +14,7 @@
 #include <asm/ptrace.h>
 #include <asm/asmmacro.h>
 #include <asm/page.h>
+#include <asm/thread_info.h>
 
 /* Work around cpp -rob */
 #define ALLOC #alloc
 
 /* Both these macros have to start with exactly the same insn */
 #define MOVE_BIGCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, t7) \
-       ldd     [%src + offset + 0x00], %t0; \
-       ldd     [%src + offset + 0x08], %t2; \
-       ldd     [%src + offset + 0x10], %t4; \
-       ldd     [%src + offset + 0x18], %t6; \
-       st      %t0, [%dst + offset + 0x00]; \
-       st      %t1, [%dst + offset + 0x04]; \
-       st      %t2, [%dst + offset + 0x08]; \
-       st      %t3, [%dst + offset + 0x0c]; \
-       st      %t4, [%dst + offset + 0x10]; \
-       st      %t5, [%dst + offset + 0x14]; \
-       st      %t6, [%dst + offset + 0x18]; \
-       st      %t7, [%dst + offset + 0x1c];
+       ldd     [%src + (offset) + 0x00], %t0; \
+       ldd     [%src + (offset) + 0x08], %t2; \
+       ldd     [%src + (offset) + 0x10], %t4; \
+       ldd     [%src + (offset) + 0x18], %t6; \
+       st      %t0, [%dst + (offset) + 0x00]; \
+       st      %t1, [%dst + (offset) + 0x04]; \
+       st      %t2, [%dst + (offset) + 0x08]; \
+       st      %t3, [%dst + (offset) + 0x0c]; \
+       st      %t4, [%dst + (offset) + 0x10]; \
+       st      %t5, [%dst + (offset) + 0x14]; \
+       st      %t6, [%dst + (offset) + 0x18]; \
+       st      %t7, [%dst + (offset) + 0x1c];
 
 #define MOVE_BIGALIGNCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, t7) \
-       ldd     [%src + offset + 0x00], %t0; \
-       ldd     [%src + offset + 0x08], %t2; \
-       ldd     [%src + offset + 0x10], %t4; \
-       ldd     [%src + offset + 0x18], %t6; \
-       std     %t0, [%dst + offset + 0x00]; \
-       std     %t2, [%dst + offset + 0x08]; \
-       std     %t4, [%dst + offset + 0x10]; \
-       std     %t6, [%dst + offset + 0x18];
+       ldd     [%src + (offset) + 0x00], %t0; \
+       ldd     [%src + (offset) + 0x08], %t2; \
+       ldd     [%src + (offset) + 0x10], %t4; \
+       ldd     [%src + (offset) + 0x18], %t6; \
+       std     %t0, [%dst + (offset) + 0x00]; \
+       std     %t2, [%dst + (offset) + 0x08]; \
+       std     %t4, [%dst + (offset) + 0x10]; \
+       std     %t6, [%dst + (offset) + 0x18];
 
 #define MOVE_LASTCHUNK(src, dst, offset, t0, t1, t2, t3) \
-       ldd     [%src - offset - 0x10], %t0; \
-       ldd     [%src - offset - 0x08], %t2; \
-       st      %t0, [%dst - offset - 0x10]; \
-       st      %t1, [%dst - offset - 0x0c]; \
-       st      %t2, [%dst - offset - 0x08]; \
-       st      %t3, [%dst - offset - 0x04];
+       ldd     [%src - (offset) - 0x10], %t0; \
+       ldd     [%src - (offset) - 0x08], %t2; \
+       st      %t0, [%dst - (offset) - 0x10]; \
+       st      %t1, [%dst - (offset) - 0x0c]; \
+       st      %t2, [%dst - (offset) - 0x08]; \
+       st      %t3, [%dst - (offset) - 0x04];
 
 #define MOVE_HALFCHUNK(src, dst, offset, t0, t1, t2, t3) \
-       lduh    [%src + offset + 0x00], %t0; \
-       lduh    [%src + offset + 0x02], %t1; \
-       lduh    [%src + offset + 0x04], %t2; \
-       lduh    [%src + offset + 0x06], %t3; \
-       sth     %t0, [%dst + offset + 0x00]; \
-       sth     %t1, [%dst + offset + 0x02]; \
-       sth     %t2, [%dst + offset + 0x04]; \
-       sth     %t3, [%dst + offset + 0x06];
+       lduh    [%src + (offset) + 0x00], %t0; \
+       lduh    [%src + (offset) + 0x02], %t1; \
+       lduh    [%src + (offset) + 0x04], %t2; \
+       lduh    [%src + (offset) + 0x06], %t3; \
+       sth     %t0, [%dst + (offset) + 0x00]; \
+       sth     %t1, [%dst + (offset) + 0x02]; \
+       sth     %t2, [%dst + (offset) + 0x04]; \
+       sth     %t3, [%dst + (offset) + 0x06];
 
 #define MOVE_SHORTCHUNK(src, dst, offset, t0, t1) \
-       ldub    [%src - offset - 0x02], %t0; \
-       ldub    [%src - offset - 0x01], %t1; \
-       stb     %t0, [%dst - offset - 0x02]; \
-       stb     %t1, [%dst - offset - 0x01];
+       ldub    [%src - (offset) - 0x02], %t0; \
+       ldub    [%src - (offset) - 0x01], %t1; \
+       stb     %t0, [%dst - (offset) - 0x02]; \
+       stb     %t1, [%dst - (offset) - 0x01];
 
        .text
        .align  4
@@ -366,6 +367,9 @@ fixupretl:
        blu     1f
         cmp    %o1, %g1
        bgeu    1f
+        ld     [%g6 + TI_PREEMPT], %g1
+       cmp     %g1, 0
+       bne     1f
         nop
        save    %sp, -64, %sp
        mov     %i0, %o0