diff options
author | Behan Webster <behanw@converseincode.com> | 2014-09-27 00:31:04 +0100 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2014-11-13 23:58:00 +0000 |
commit | 0abc08baf2ddf61a37d375a9fb832be612f9c5a5 (patch) | |
tree | 6816254445cec2b457592a43c89dfb21fdce7005 /arch/arm/include/asm | |
parent | 2d605a3029726b881fc9df7fae75e6bf08d8a526 (diff) | |
download | linux-0abc08baf2ddf61a37d375a9fb832be612f9c5a5.tar.bz2 |
ARM: 8170/1: Add global named register current_stack_pointer for ARM
Define a global named register for current_stack_pointer. The use of this new
variable guarantees that both gcc and clang can access this register in C code.
Signed-off-by: Behan Webster <behanw@converseincode.com>
Reviewed-by: Jan-Simon Möller <dl9pf@gmx.de>
Reviewed-by: Mark Charlebois <charlebm@gmail.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/include/asm')
-rw-r--r-- | arch/arm/include/asm/thread_info.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/arm/include/asm/thread_info.h b/arch/arm/include/asm/thread_info.h index fc44d3761f9e..bb435152189f 100644 --- a/arch/arm/include/asm/thread_info.h +++ b/arch/arm/include/asm/thread_info.h @@ -101,6 +101,11 @@ struct thread_info { #define init_stack (init_thread_union.stack) /* + * how to get the current stack pointer in C + */ +register unsigned long current_stack_pointer asm ("sp"); + +/* * how to get the thread information struct from C */ static inline struct thread_info *current_thread_info(void) __attribute_const__; |