From 200ed341b8646ea893d5466974d6e107c46237ba Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Wed, 23 Feb 2022 22:04:32 -0800 Subject: mips: Implement "current_stack_pointer" To follow the existing per-arch conventions replace open-coded uses of asm "sp" as "current_stack_pointer". This will let it be used in non-arch places (like HARDENED_USERCOPY). Cc: Thomas Bogendoerfer Cc: Marc Zyngier Cc: Guenter Roeck Cc: Mark Rutland Cc: Yanteng Si Cc: linux-mips@vger.kernel.org Signed-off-by: Kees Cook Signed-off-by: Thomas Bogendoerfer --- arch/mips/include/asm/thread_info.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'arch/mips/include') diff --git a/arch/mips/include/asm/thread_info.h b/arch/mips/include/asm/thread_info.h index 0b17aaa9e012..4463348d2372 100644 --- a/arch/mips/include/asm/thread_info.h +++ b/arch/mips/include/asm/thread_info.h @@ -69,6 +69,8 @@ static inline struct thread_info *current_thread_info(void) return __current_thread_info; } +register unsigned long current_stack_pointer __asm__("sp"); + #endif /* !__ASSEMBLY__ */ /* thread information allocation */ -- cgit v1.2.1