Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: 8175/1: Use current_stack_pointer to calculate pt_regs address

Use the global current_stack_pointer to calculate the end of the stack for
current_pt_regs()

Signed-off-by: Behan Webster <behanw@converseincode.com>
Reviewed-by: Mark Charlebois <charlebm@gmail.com>
Reviewed-by: Jan-Simon Möller <dl9pf@gmx.de>
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>

authored by

Behan Webster and committed by
Russell King
0ebc1f56 ccbd2da5

+2 -3
+2 -3
arch/arm/include/asm/ptrace.h
··· 154 154 return regs->ARM_sp; 155 155 } 156 156 157 - #define current_pt_regs(void) ({ \ 158 - register unsigned long sp asm ("sp"); \ 159 - (struct pt_regs *)((sp | (THREAD_SIZE - 1)) - 7) - 1; \ 157 + #define current_pt_regs(void) ({ (struct pt_regs *) \ 158 + ((current_stack_pointer | (THREAD_SIZE - 1)) - 7) - 1; \ 160 159 }) 161 160 162 161 #endif /* __ASSEMBLY__ */