summaryrefslogtreecommitdiffstats
path: root/arch/csky/kernel
diff options
context:
space:
mode:
authorTong Tiangen <tongtiangen@huawei.com>2022-10-22 03:43:40 +0200
committerGuo Ren <guoren@linux.alibaba.com>2022-10-22 05:52:29 +0200
commitb203c67ebe752c8f2a2babf5e58d244c82680922 (patch)
treeef2e931ce17801419dcef1d083779be3e23c4829 /arch/csky/kernel
parentLinux 6.1-rc1 (diff)
downloadlinux-b203c67ebe752c8f2a2babf5e58d244c82680922.tar.xz
linux-b203c67ebe752c8f2a2babf5e58d244c82680922.zip
csky: add arch support current_stack_pointer
To follow the existing per-arch conventions, using "current_stack_pointer" to set sp. This will let it be used in non-arch places(like HARDENED_USERCOPY). Refer to the implementation of riscv commit fdecfea09328 ("riscv: Rename "sp_in_global" to "current_stack_pointer""). Link: https://lore.kernel.org/lkml/20220224060411.1855683-1-keescook@chromium.org/ Signed-off-by: Tong Tiangen <tongtiangen@huawei.com> Signed-off-by: Guo Ren <guoren@kernel.org>
Diffstat (limited to 'arch/csky/kernel')
-rw-r--r--arch/csky/kernel/stacktrace.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/arch/csky/kernel/stacktrace.c b/arch/csky/kernel/stacktrace.c
index 9f78f5d21511..27ecd63e321b 100644
--- a/arch/csky/kernel/stacktrace.c
+++ b/arch/csky/kernel/stacktrace.c
@@ -23,10 +23,9 @@ void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs,
sp = user_stack_pointer(regs);
pc = instruction_pointer(regs);
} else if (task == NULL || task == current) {
- const register unsigned long current_sp __asm__ ("sp");
const register unsigned long current_fp __asm__ ("r8");
fp = current_fp;
- sp = current_sp;
+ sp = current_stack_pointer;
pc = (unsigned long)walk_stackframe;
} else {
/* task blocked in __switch_to */
@@ -68,8 +67,7 @@ static void notrace walk_stackframe(struct task_struct *task,
sp = user_stack_pointer(regs);
pc = instruction_pointer(regs);
} else if (task == NULL || task == current) {
- const register unsigned long current_sp __asm__ ("sp");
- sp = current_sp;
+ sp = current_stack_pointer;
pc = (unsigned long)walk_stackframe;
} else {
/* task blocked in __switch_to */