patch-2.2.17 linux/include/asm-s390/uaccess.h

Next file: linux/include/asm-s390/ucontext.h
Previous file: linux/include/asm-s390/string.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.16/include/asm-s390/uaccess.h linux/include/asm-s390/uaccess.h
@@ -84,15 +84,14 @@
 {
         int err;
 
-        __asm__ __volatile__ (  "   iac   1\n"
-				"   sr    %1,%1\n"
+        __asm__ __volatile__ (  "   sr    %1,%1\n"
 				"   la    4,%0\n"
                                 "   sacf  512\n"
                                 "0: st    %2,0(4)\n"
-                                "   sacf  0(1)\n"
+                                "   sacf  0\n"
 				"1:\n"
 				".section .fixup,\"ax\"\n"
-				"2: sacf  0(1)\n"
+				"2: sacf  0\n"
 				"   lhi   %1,%h3\n"
 				"   bras  4,3f\n"
 				"   .long 1b\n"
@@ -105,7 +104,7 @@
 				".previous"
                                 : "=m" (*((__u32*) ptr)) , "=&d" (err)
                                 : "d" (x), "K" (-EFAULT)
-                                : "1", "4" );
+                                : "4" );
         return err;
 }
 
@@ -113,15 +112,14 @@
 {
         int err;
 
-        __asm__ __volatile__ (  "   iac   1\n"
-				"   sr    %1,%1\n"
+        __asm__ __volatile__ (  "   sr    %1,%1\n"
 				"   la    4,%0\n"
                                 "   sacf  512\n"
                                 "0: sth   %2,0(4)\n"
-                                "   sacf  0(1)\n"
+                                "   sacf  0\n"
 				"1:\n"
 				".section .fixup,\"ax\"\n"
-				"2: sacf  0(1)\n"
+				"2: sacf  0\n"
 				"   lhi   %1,%h3\n"
 				"   bras  4,3f\n"
 				"   .long 1b\n"
@@ -134,7 +132,7 @@
 				".previous"
                                 : "=m" (*((__u16*) ptr)) , "=&d" (err)
                                 : "d" (x), "K" (-EFAULT)
-                                : "1", "4" );
+                                : "4" );
         return err;
 }
 
@@ -142,15 +140,14 @@
 {
         int err;
 
-        __asm__ __volatile__ (  "   iac   1\n"
-				"   sr    %1,%1\n"
+        __asm__ __volatile__ (  "   sr    %1,%1\n"
 				"   la    4,%0\n"
                                 "   sacf  512\n"
                                 "0: stc   %2,0(4)\n"
-                                "   sacf  0(1)\n"
+                                "   sacf  0\n"
 				"1:\n"
 				".section .fixup,\"ax\"\n"
-				"2: sacf  0(1)\n"
+				"2: sacf  0\n"
 				"   lhi   %1,%h3\n"
 				"   bras  4,3f\n"
 				"   .long 1b\n"
@@ -163,7 +160,7 @@
 				".previous"
                                 : "=m" (*((__u8*) ptr)) , "=&d" (err)
                                 : "d" (x), "K" (-EFAULT)
-                                : "1", "4" );
+                                : "4" );
         return err;
 }
 
@@ -208,15 +205,14 @@
 
 #define __get_user_asm_4(x, ptr, err)                                   \
 ({                                                                      \
-        __asm__ __volatile__ (  "   iac   1\n"                          \
-                                "   sr    %1,%1\n"                      \
+        __asm__ __volatile__ (  "   sr    %1,%1\n"                      \
                                 "   la    4,%2\n"                       \
                                 "   sacf  512\n"                        \
                                 "0: l     %0,0(4)\n"                    \
-                                "   sacf  0(1)\n"                       \
+                                "   sacf  0\n"                          \
                                 "1:\n"                                  \
                                 ".section .fixup,\"ax\"\n"              \
-                                "2: sacf  0(1)\n"                       \
+                                "2: sacf  0\n"                          \
                                 "   lhi   %1,%h3\n"                     \
                                 "   bras  4,3f\n"                       \
                                 "   .long 1b\n"                         \
@@ -229,20 +225,19 @@
                                 ".previous"                             \
                                 : "=d" (x) , "=&d" (err)                \
                                 : "m" (*(__u32*) ptr), "K" (-EFAULT)    \
-                                : "1", "4" );                           \
+                                : "4" );                                \
 })
 
 #define __get_user_asm_2(x, ptr, err)                                   \
 ({                                                                      \
-        __asm__ __volatile__ (  "   iac   1\n"                          \
-                                "   sr    %1,%1\n"                      \
+        __asm__ __volatile__ (  "   sr    %1,%1\n"                      \
                                 "   la    4,%2\n"                       \
                                 "   sacf  512\n"                        \
                                 "0: lh    %0,0(4)\n"                    \
-                                "   sacf  0(1)\n"                       \
+                                "   sacf  0\n"                          \
                                 "1:\n"                                  \
                                 ".section .fixup,\"ax\"\n"              \
-                                "2: sacf  0(1)\n"                       \
+                                "2: sacf  0\n"                          \
                                 "   lhi   %1,%h3\n"                     \
                                 "   bras  4,3f\n"                       \
                                 "   .long 1b\n"                         \
@@ -255,21 +250,20 @@
                                 ".previous"                             \
                                 : "=d" (x) , "=&d" (err)                \
                                 : "m" (*(__u16*) ptr), "K" (-EFAULT)    \
-                                : "1", "4" );                           \
+                                : "4" );                                \
 })
 
 #define __get_user_asm_1(x, ptr, err)                                   \
 ({                                                                      \
-        __asm__ __volatile__ (  "   iac   1\n"                          \
-                                "   sr    %1,%1\n"                      \
+        __asm__ __volatile__ (  "   sr    %1,%1\n"                      \
                                 "   la    4,%2\n"                       \
                                 "   sr    %0,%0\n"                      \
                                 "   sacf  512\n"                        \
                                 "0: ic    %0,0(4)\n"                    \
-                                "   sacf  0(1)\n"                       \
+                                "   sacf  0\n"                          \
                                 "1:\n"                                  \
                                 ".section .fixup,\"ax\"\n"              \
-                                "2: sacf  0(1)\n"                       \
+                                "2: sacf  0\n"                          \
                                 "   lhi   %1,%h3\n"                     \
                                 "   bras  4,3f\n"                       \
                                 "   .long 1b\n"                         \
@@ -282,7 +276,7 @@
                                 ".previous"                             \
                                 : "=d" (x) , "=&d" (err)                \
                                 : "m" (*(__u8*) ptr), "K" (-EFAULT)     \
-                                : "1", "4" );                           \
+                                : "4" );                                \
 })
 
 #define __get_user(x, ptr)                                      \
@@ -345,22 +339,32 @@
 __copy_to_user_asm(void* to, const void* from,  long n)
 {
 
-        __asm__ __volatile__ (  "   iac   1\n"
-                                "   lr    2,%2\n"
+        __asm__ __volatile__ (  "   lr    2,%2\n"
                                 "   lr    4,%1\n"
                                 "   lr    3,%0\n"
                                 "   lr    5,3\n"
                                 "   sacf  512\n"
                                 "0: mvcle 4,2,0\n"
                                 "   jo    0b\n"
-                                "1: sacf  0(1)\n"
-                                "   lr    %0,3\n"
+                                "   sacf  0\n"
+                                "1: lr    %0,3\n"
+                                ".section .fixup,\"ax\"\n"
+                                "2: lhi   5,-4096\n"
+                                "   n     5,0x90\n"
+                                "   sr    5,4\n"
+                                "   mvcle 4,2,0\n"
+                                "   sacf  0\n"
+                                "   basr  4,0\n"
+                                "   l     4,3f-.(4)\n"
+                                "   br    4\n"
+                                "3: .long 1b\n"
+                                ".previous\n"
 				".section __ex_table,\"a\"\n"
 				"   .align 4\n"
-				"   .long  0b,1b\n"
+				"   .long  0b,2b\n"
 				".previous"
                                 : "+&d" (n) : "d" (to), "d" (from)
-                                : "1", "2", "3", "4", "5" );
+                                : "2", "3", "4", "5" );
         return n;
 }
 
@@ -384,26 +388,35 @@
 extern inline unsigned long
 __copy_from_user_asm(void* to, const void* from,  long n)
 {
-        __asm__ __volatile__ (  "   iac   1\n"
-				"   lr    2,%1\n"
+        __asm__ __volatile__ (  "   lr    2,%1\n"
                                 "   lr    4,%2\n"
                                 "   lr    3,%0\n"
                                 "   lr    5,3\n"
                                 "   sacf  512\n"
                                 "0: mvcle 2,4,0\n"
                                 "   jo    0b\n"
-                                "1: sacf  0(1)\n"
-                                "   lr    %0,3\n"
+                                "   sacf  0\n"
+                                "1: lr    %0,5\n"
+                                ".section .fixup,\"ax\"\n"
+                                "2: lhi   3,-4096\n"
+                                "   n     3,0x90\n"
+                                "   sr    3,4\n"
+                                "   mvcle 2,4,0\n"
+                                "   sacf  0\n"
+                                "   basr  4,0\n"
+                                "   l     4,3f-.(4)\n"
+                                "   br    4\n"
+                                "3: .long 1b\n"
+                                ".previous\n"
 				".section __ex_table,\"a\"\n"
 				"   .align 4\n"
-				"   .long  0b,1b\n"
+				"   .long  0b,2b\n"
 				".previous"
                                 : "+&d" (n) : "d" (to), "d" (from)
-                                : "1", "2", "3", "4", "5" );
+                                : "2", "3", "4", "5" );
         return n;
 }
 
-
 #define __copy_from_user(to, from, n)                           \
 ({                                                              \
         __copy_from_user_asm(to,from,n);                        \
@@ -433,8 +446,7 @@
 strncpy_from_user(char *dst, const char *src, long count)
 {
         long len;
-        __asm__ __volatile__ (  "   iac   1\n"
-				"   slr   %0,%0\n"
+        __asm__ __volatile__ (  "   slr   %0,%0\n"
 				"   lr    2,%1\n"
                                 "   lr    4,%2\n"
                                 "   slr   3,3\n"
@@ -446,7 +458,7 @@
                                 "   ahi   %0,1\n"
                                 "   clr   %0,%3\n"
                                 "   jl    0b\n"
-                                "2: sacf  0(1)\n"
+                                "2: sacf  0\n"
 				".section .fixup,\"ax\"\n"
                                 "3: lhi   %0,%h4\n"
 				"   basr  3,0\n"
@@ -462,7 +474,7 @@
                                 : "=&a" (len)
                                 : "a"  (dst), "d" (src), "d" (count),
                                   "K" (-EFAULT)
-                                : "1", "2", "3", "4", "memory" );
+                                : "2", "3", "4", "memory" );
         return len;
 }
 
@@ -474,8 +486,7 @@
 static inline unsigned long
 strnlen_user(const char * src, unsigned long n)
 {
-	__asm__ __volatile__ ("   iac   1\n"
-                              "   alr   %0,%1\n"
+	__asm__ __volatile__ ("   alr   %0,%1\n"
 			      "   slr   0,0\n"
 			      "   lr    4,%1\n"
 			      "   sacf  512\n"
@@ -483,10 +494,10 @@
 			      "   jo    0b\n"
 			      "   slr   %0,%1\n"
 			      "   ahi   %0,1\n"
-			      "   sacf  0(1)\n"
+			      "   sacf  0\n"
                               "1:\n"
                               ".section .fixup,\"ax\"\n"
-                              "2: sacf  0(1)\n"
+                              "2: sacf  0\n"
                               "   slr   %0,%0\n"
                               "   bras  4,3f\n"
                               "   .long 1b\n"
@@ -498,7 +509,7 @@
 			      "   .long  0b,2b\n"
 			      ".previous"
 			      : "+&a" (n) : "d" (src)
-			      : "cc", "0", "1", "4" );
+			      : "cc", "0", "4" );
         return n;
 }
 #define strlen_user(str) strnlen_user(str, ~0UL)
@@ -510,23 +521,33 @@
 static inline unsigned long
 clear_user(void *to, unsigned long n)
 {
-        __asm__ __volatile__ (  "   iac   1\n"
-                                "   sacf  512\n"
+        __asm__ __volatile__ (  "   sacf  512\n"
                                 "   lr    4,%1\n"
                                 "   lr    5,%0\n"
                                 "   sr    2,2\n"
                                 "   sr    3,3\n"
                                 "0: mvcle 4,2,0\n"
                                 "   jo    0b\n"
-                                "1: sacf  0(1)\n"
-                                "   lr    %0,5\n"
+                                "   sacf  0\n"
+                                "1: lr    %0,3\n"
+                                ".section .fixup,\"ax\"\n"
+                                "2: lhi   5,-4096\n"
+                                "   n     5,0x90\n"
+                                "   sr    5,4\n"
+                                "   mvcle 4,2,0\n"
+                                "   sacf  0\n"
+                                "   basr  4,0\n"
+                                "   l     4,3f-.(4)\n"
+                                "   br    4\n"
+                                "3: .long 1b\n"
+                                ".previous\n"
 				".section __ex_table,\"a\"\n"
 				"   .align 4\n"
-				"   .long  0b,1b\n"
+				"   .long  0b,2b\n"
 				".previous"
                                 : "+&a" (n)
                                 : "a"   (to)
-                                : "cc", "1", "2", "3", "4", "5" );
+                                : "cc", "2", "3", "4", "5" );
         return n;
 }
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)