aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um
diff options
context:
space:
mode:
authorRichard Weinberger <richard@nod.at>2011-04-27 18:26:54 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-04-28 14:28:21 -0400
commit534e3adbd22efa327e6ff27cf2d8ebaad8382ecd (patch)
treeb45ec4d6debc312616e8d0590dacaed0b87e849f /arch/um
parent365a0deae2b6743b3263a71871bbd8c9f66ac34c (diff)
um: adjust current_thread_info() for newer gcc versions
In some cases gcc >= 4.5.2 will optimize away current_thread_info(). To prevent gcc from doing so the stack address has to be obtained via inline asm. Signed-off-by: Richard Weinberger <richard@nod.at> Acked-by: Kirill A. Shutemov <kirill@shutemov.name> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um')
-rw-r--r--arch/um/include/asm/thread_info.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/um/include/asm/thread_info.h b/arch/um/include/asm/thread_info.h
index e2cf786bda0a..5bd1bad33fab 100644
--- a/arch/um/include/asm/thread_info.h
+++ b/arch/um/include/asm/thread_info.h
@@ -49,7 +49,10 @@ static inline struct thread_info *current_thread_info(void)
49{ 49{
50 struct thread_info *ti; 50 struct thread_info *ti;
51 unsigned long mask = THREAD_SIZE - 1; 51 unsigned long mask = THREAD_SIZE - 1;
52 ti = (struct thread_info *) (((unsigned long) &ti) & ~mask); 52 void *p;
53
54 asm volatile ("" : "=r" (p) : "0" (&ti));
55 ti = (struct thread_info *) (((unsigned long)p) & ~mask);
53 return ti; 56 return ti;
54} 57}
55 58