[ARM] 3486/1: Mark memory as clobbered by the ARM _syscallX() macros
authorMarkus Gutschke <markus@google.com>
Sun, 30 Apr 2006 14:34:29 +0000 (15:34 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Sun, 30 Apr 2006 14:34:29 +0000 (15:34 +0100)
Patch from Markus Gutschke

In order to prevent gcc from making incorrect optimizations, all asm()
statements that define system calls should report memory as
clobbered. Recent versions of the headers for i386 have been changed
accordingly, but the ARM headers are still defective.

This patch fixes the bug tracked at
http://bugzilla.kernel.org/show_bug.cgi?id=6205

Signed-off-by: Markus Gutschke <markus@google.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
drivers/input/touchscreen/corgi_ts.c
include/asm-arm/unistd.h

index 1042987856f7227012be466649e8336fd3b062c8..5013703db0e6261808872d4ac9cfb05153b1fb7a 100644 (file)
@@ -17,7 +17,7 @@
 #include <linux/interrupt.h>
 #include <linux/module.h>
 #include <linux/slab.h>
-#include <asm/irq.h>
+//#include <asm/irq.h>
 
 #include <asm/arch/sharpsl.h>
 #include <asm/arch/hardware.h>
index ee8dfea549bc324239b1e60f0cdd9ef984e75dfb..26f2f4828e03f323cbfbba8aaee686c1e4442fef 100644 (file)
@@ -410,7 +410,8 @@ type name(void) {                                                   \
   __asm__ __volatile__ (                                               \
   __syscall(name)                                                      \
        : "=r" (__res_r0)                                               \
-       : __SYS_REG_LIST() );                                           \
+       : __SYS_REG_LIST()                                              \
+       : "memory" );                                                   \
   __res = __res_r0;                                                    \
   __syscall_return(type,__res);                                                \
 }
@@ -424,7 +425,8 @@ type name(type1 arg1) {                                             \
   __asm__ __volatile__ (                                               \
   __syscall(name)                                                      \
        : "=r" (__res_r0)                                               \
-       : __SYS_REG_LIST( "0" (__r0) ) );                               \
+       : __SYS_REG_LIST( "0" (__r0) )                                  \
+       : "memory" );                                                   \
   __res = __res_r0;                                                    \
   __syscall_return(type,__res);                                                \
 }
@@ -439,7 +441,8 @@ type name(type1 arg1,type2 arg2) {                                  \
   __asm__ __volatile__ (                                               \
   __syscall(name)                                                      \
        : "=r" (__res_r0)                                               \
-       : __SYS_REG_LIST( "0" (__r0), "r" (__r1) ) );                   \
+       : __SYS_REG_LIST( "0" (__r0), "r" (__r1) )                      \
+       : "memory" );                                                   \
   __res = __res_r0;                                                    \
   __syscall_return(type,__res);                                                \
 }
@@ -456,7 +459,8 @@ type name(type1 arg1,type2 arg2,type3 arg3) {                               \
   __asm__ __volatile__ (                                               \
   __syscall(name)                                                      \
        : "=r" (__res_r0)                                               \
-       : __SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2) ) );       \
+       : __SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2) )          \
+       : "memory" );                                                   \
   __res = __res_r0;                                                    \
   __syscall_return(type,__res);                                                \
 }
@@ -474,7 +478,8 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4) {         \
   __asm__ __volatile__ (                                               \
   __syscall(name)                                                      \
        : "=r" (__res_r0)                                               \
-       : __SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2), "r" (__r3) ) ); \
+       : __SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2), "r" (__r3) ) \
+       : "memory" );                                                   \
   __res = __res_r0;                                                    \
   __syscall_return(type,__res);                                                \
 }
@@ -494,7 +499,8 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) {     \
   __syscall(name)                                                      \
        : "=r" (__res_r0)                                               \
        : __SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2),           \
-                         "r" (__r3), "r" (__r4) ) );                   \
+                         "r" (__r3), "r" (__r4) )                      \
+       : "memory" );                                                   \
   __res = __res_r0;                                                    \
   __syscall_return(type,__res);                                                \
 }
@@ -514,7 +520,8 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6
   __syscall(name)                                                      \
        : "=r" (__res_r0)                                               \
        : __SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2),           \
-                         "r" (__r3), "r" (__r4), "r" (__r5) ) );       \
+                         "r" (__r3), "r" (__r4), "r" (__r5) )          \
+       : "memory" );                                                   \
   __res = __res_r0;                                                    \
   __syscall_return(type,__res);                                                \
 }