summaryrefslogtreecommitdiff
path: root/arch/mips/include
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2022-02-23 22:04:32 -0800
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>2022-03-01 16:57:55 +0100
commit200ed341b8646ea893d5466974d6e107c46237ba (patch)
tree2d383f792532c602e251a3316a141c9e3d4c563d /arch/mips/include
parent455481fc9a807798eca05f6fb0918ab88109d845 (diff)
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 <tsbogend@alpha.franken.de> Cc: Marc Zyngier <maz@kernel.org> Cc: Guenter Roeck <linux@roeck-us.net> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Yanteng Si <siyanteng01@gmail.com> Cc: linux-mips@vger.kernel.org Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Diffstat (limited to 'arch/mips/include')
-rw-r--r--arch/mips/include/asm/thread_info.h2
1 files changed, 2 insertions, 0 deletions
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 */