aboutsummaryrefslogtreecommitdiff
path: root/arch/x86
diff options
context:
space:
mode:
authorBehan Webster <behanw@converseincode.com>2012-11-14 12:55:28 +0100
committerBehan Webster <behanw@converseincode.com>2014-03-31 00:07:19 -0700
commitd8423926186223a7596226c06c048671ecef1aac (patch)
treec42d02ed632f0e24df5b860ace47cb70b45b470e /arch/x86
parentb894633e7b00bcdb3e320b7ff0b995a08749441b (diff)
x86: LLVMLinux: Reimplement current_stack_pointer without register usage.
Use asm to make the globally named register work again for gcc and clang. Much more efficient than copying the stack pointer to a variable and back again. Signed-off-by: Behan Webster <behanw@converseincode.com>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/include/asm/thread_info.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h
index e1940c06ed0..e27ccc17c7d 100644
--- a/arch/x86/include/asm/thread_info.h
+++ b/arch/x86/include/asm/thread_info.h
@@ -163,10 +163,10 @@ struct thread_info {
*/
#ifndef __ASSEMBLY__
-#define current_stack_pointer ({ \
- unsigned long sp; \
- asm("mov %%esp,%0" : "=g" (sp)); \
- sp; \
+#define current_stack_pointer ({ \
+ register unsigned long sp asm("esp") __used; \
+ asm("" : "=r" (sp)); \
+ sp; \
})
/* how to get the thread information struct from C */