Commit a556ee12 authored by Behan Webster's avatar Behan Webster Committed by Russell King

ARM: 8171/1: Use current_stack_pointer for return_address

Use the global current_stack_pointer to get the value of the stack pointer.
This change supports being able to compile the kernel with both gcc and Clang.
Signed-off-by: default avatarBehan Webster <behanw@converseincode.com>
Reviewed-by: default avatarMark Charlebois <charlebm@gmail.com>
Reviewed-by: default avatarJan-Simon Möller <dl9pf@gmx.de>
Acked-by: default avatarWill Deacon <will.deacon@arm.com>
Acked-by: default avatarNicolas Pitre <nico@linaro.org>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 0abc08ba
...@@ -39,13 +39,12 @@ void *return_address(unsigned int level) ...@@ -39,13 +39,12 @@ void *return_address(unsigned int level)
{ {
struct return_address_data data; struct return_address_data data;
struct stackframe frame; struct stackframe frame;
register unsigned long current_sp asm ("sp");
data.level = level + 2; data.level = level + 2;
data.addr = NULL; data.addr = NULL;
frame.fp = (unsigned long)__builtin_frame_address(0); frame.fp = (unsigned long)__builtin_frame_address(0);
frame.sp = current_sp; frame.sp = current_stack_pointer;
frame.lr = (unsigned long)__builtin_return_address(0); frame.lr = (unsigned long)__builtin_return_address(0);
frame.pc = (unsigned long)return_address; frame.pc = (unsigned long)return_address;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment