All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] um: Adjust current_thread_info() for gcc-4.6
@ 2011-04-20 11:34 Richard Weinberger
  2011-04-20 11:34 ` [uml-devel] [PATCH 2/3] um: Add support for 64 bit atomic operations Richard Weinberger
  2011-04-20 11:34 ` [PATCH 3/3] uml: fix hppfs build Richard Weinberger
  0 siblings, 2 replies; 8+ messages in thread
From: Richard Weinberger @ 2011-04-20 11:34 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel, user-mode-linux-devel, Richard Weinberger

In some cases gcc-4.6 will optimize away current_thread_info().
To prevent gcc from doing so the stack address has to be obtained
via inline asm.

LKML-Reference: http://marc.info/?i=201104132150.05623.richard@nod.at

Signed-off-by: Richard Weinberger <richard@nod.at>
---
 arch/um/include/asm/thread_info.h |    5 ++++-
 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 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;
 }
 
-- 
1.7.4.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-04-20 14:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-20 11:34 [PATCH 1/3] um: Adjust current_thread_info() for gcc-4.6 Richard Weinberger
2011-04-20 11:34 ` [uml-devel] [PATCH 2/3] um: Add support for 64 bit atomic operations Richard Weinberger
2011-04-20 14:27   ` [uml-devel] [stable] " Greg KH
2011-04-20 14:27     ` Greg KH
2011-04-20 14:29     ` Richard Weinberger
2011-04-20 14:34       ` Greg KH
2011-04-20 14:36         ` Richard Weinberger
2011-04-20 11:34 ` [PATCH 3/3] uml: fix hppfs build Richard Weinberger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.