aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Sanders <daniel.sanders@imgtec.com>2015-01-09 10:54:22 +0000
committerBehan Webster <behanw@converseincode.com>2015-01-18 18:05:18 -0800
commit230b22d72454f0b9ed2cf1410771bbba7830f89e (patch)
tree28682f8334db1dfb59af1bf7098779425edd26e9
parent054b1768975a80c58499fa7fb46a0e0d90e81464 (diff)
downloadhikey-clang-llvmlinux-latest.tar.gz
MIPS: Changed current_thread_info() to an equivalent supported by both clang and GCCllvmlinux-latest
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 <daniel.sanders@imgtec.com>
-rw-r--r--arch/mips/include/asm/thread_info.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/mips/include/asm/thread_info.h b/arch/mips/include/asm/thread_info.h
index 99eea59604e9..2a2f3c45f86b 100644
--- a/arch/mips/include/asm/thread_info.h
+++ b/arch/mips/include/asm/thread_info.h
@@ -58,11 +58,11 @@ struct thread_info {
#define init_stack (init_thread_union.stack)
/* How to get the thread information struct from C. */
+register struct thread_info *current_gp_register asm("$28");
+
static inline struct thread_info *current_thread_info(void)
{
- register struct thread_info *__current_thread_info __asm__("$28");
-
- return __current_thread_info;
+ return current_gp_register;
}
#endif /* !__ASSEMBLY__ */