From: Behan Webster Date: Fri, 26 Sep 2014 23:31:04 +0000 (+0100) Subject: ARM: 8170/1: Add global named register current_stack_pointer for ARM X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=0abc08baf2ddf61a37d375a9fb832be612f9c5a5;p=linux-beck.git 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 Reviewed-by: Jan-Simon Möller Reviewed-by: Mark Charlebois Acked-by: Will Deacon Acked-by: Nicolas Pitre Signed-off-by: Russell King --- 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 @@ -100,6 +100,11 @@ struct thread_info { #define init_thread_info (init_thread_union.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 */