MIPS: Changed current_thread_info() to an equivalent supported by both clang and GCC
authorDaniel Sanders <[email protected]>
Tue, 24 Feb 2015 15:02:57 +0000 (15:02 +0000)
committerRalf Baechle <[email protected]>
Wed, 1 Apr 2015 15:21:45 +0000 (17:21 +0200)
Without this, a 'break' instruction is executed very early in the boot and
the boot hangs.

The problem is that clang doesn't honour named registers on local variables
and silently treats them as normal uninitialized variables. However, it
does honour them on global variables.

Signed-off-by: Daniel Sanders <[email protected]>
Cc: Ralf Baechle <[email protected]>
Cc: Paul Burton <[email protected]>
Cc: Markos Chandras <[email protected]>
Cc: James Hogan <[email protected]>
Cc: [email protected]
Cc: Sergei Shtylyov <[email protected]>
Cc: David Daney <[email protected]>
Acked-by: Behan Webster <[email protected]>
Patchwork: https://patchwork.linux-mips.org/patch/9311/
Signed-off-by: Ralf Baechle <[email protected]>
arch/mips/include/asm/thread_info.h

index 55ed6602204cae5ae1219ee15f5a98b2c9f2813e..2f0dba36e0a84a40effb2f1ee05f12acf3676503 100644 (file)
@@ -55,10 +55,10 @@ struct thread_info {
 #define init_stack             (init_thread_union.stack)
 
 /* How to get the thread information struct from C.  */
+register struct thread_info *__current_thread_info __asm__("$28");
+
 static inline struct thread_info *current_thread_info(void)
 {
-       register struct thread_info *__current_thread_info __asm__("$28");
-
        return __current_thread_info;
 }