patch-2.3.23 linux/include/asm-arm/current.h

Next file: linux/include/asm-arm/elf.h
Previous file: linux/include/asm-arm/cpu-single.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.22/linux/include/asm-arm/current.h linux/include/asm-arm/current.h
@@ -8,12 +8,19 @@
 	return sp;
 }
 
-//static inline struct task_struct *get_current(void) __attribute__ (( __const__ ));
+/* Old compilers seem to generate bad code if we allow `current' to be
+   non volatile.  */
+#if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ > 90)
+static inline struct task_struct *get_current(void) __attribute__ (( __const__ ));
+#define __VOLATILE_CURRENT
+#else
+#define __VOLATILE_CURRENT volatile
+#endif
 
 static inline struct task_struct *get_current(void)
 {
 	struct task_struct *ts;
-	__asm__ __volatile__ (
+	__asm__ __VOLATILE_CURRENT (
 	"bic	%0, sp, #0x1f00		@ get_current
 	bic	%0, %0, #0x00ff" 
 	: "=r" (ts));

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