Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 534e3adb authored by Richard Weinberger's avatar Richard Weinberger Committed by Linus Torvalds
Browse files

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: default avatarRichard Weinberger <richard@nod.at>
Acked-by: default avatarKirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 365a0dea
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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;
}