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

m68k: Implement "current_stack_pointer"

To follow the existing per-arch conventions, add asm "sp" as
"current_stack_pointer". This will let it be used in non-arch places
(like HARDENED_USERCOPY).

Cc: linux-m68k@lists.linux-m68k.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Link: https://lore.kernel.org/lkml/CAMuHMdU6msvi0j=mS28GFYbm+uMRk7PkYe+zOM4sDmOVxeibLQ@mail.gmail.com

+4 -1
+1
arch/m68k/Kconfig
··· 4 4 default y 5 5 select ARCH_32BIT_OFF_T 6 6 select ARCH_HAS_BINFMT_FLAT 7 + select ARCH_HAS_CURRENT_STACK_POINTER 7 8 select ARCH_HAS_DMA_PREP_COHERENT if HAS_DMA && MMU && !COLDFIRE 8 9 select ARCH_HAS_SYNC_DMA_FOR_DEVICE if HAS_DMA 9 10 select ARCH_HAVE_NMI_SAFE_CMPXCHG if RMW_INSNS
+3 -1
arch/m68k/include/asm/current.h
··· 24 24 25 25 #define current get_current() 26 26 27 - #endif /* CONFNIG_MMU */ 27 + #endif /* CONFIG_MMU */ 28 + 29 + register unsigned long current_stack_pointer __asm__("sp"); 28 30 29 31 #endif /* !(_M68K_CURRENT_H) */