|
From: richard -r. w. <ric...@gm...> - 2012-05-27 10:34:01
|
So, you're using gcc 4.5. You have to apply the patch below to your UML kernel.
Anyway, consider using a recent UML kernel. Or at least one which an
active stable tree.
commit 534e3adbd22efa327e6ff27cf2d8ebaad8382ecd
Author: Richard Weinberger <ri...@no...>
Date: Wed Apr 27 15:26:54 2011 -0700
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 <ri...@no...>
Acked-by: Kirill A. Shutemov <ki...@sh...>
Signed-off-by: Andrew Morton <ak...@li...>
Signed-off-by: Linus Torvalds <tor...@li...>
diff --git a/arch/um/include/asm/thread_info.h
b/arch/um/include/asm/thread_info.h
index e2cf786..5bd1bad 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)
{
struct thread_info *ti;
unsigned long mask = THREAD_SIZE - 1;
- ti = (struct thread_info *) (((unsigned long) &ti) & ~mask);
+ void *p;
+
+ asm volatile ("" : "=r" (p) : "0" (&ti));
+ ti = (struct thread_info *) (((unsigned long)p) & ~mask);
return ti;
}
--
Thanks,
//richard
|