diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2016-01-31 17:06:16 +0100 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2016-02-23 08:56:18 +0100 |
commit | 76737ce17ab4c88f14e4452076610474108246d7 (patch) | |
tree | 59d00defd69cc30c427c5eb637553bc74e5406c8 /arch/s390/kernel/dumpstack.c | |
parent | s390/stacktrace: use nosched instead of savesched parameter (diff) | |
download | linux-76737ce17ab4c88f14e4452076610474108246d7.tar.xz linux-76737ce17ab4c88f14e4452076610474108246d7.zip |
s390: add current_stack_pointer() helper function
Implement current_stack_pointer() helper function and use it
everywhere, instead of having several different inline assembly
variants.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Tested-by: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/kernel/dumpstack.c')
-rw-r--r-- | arch/s390/kernel/dumpstack.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/arch/s390/kernel/dumpstack.c b/arch/s390/kernel/dumpstack.c index 02bd02ff648b..feda48f243ef 100644 --- a/arch/s390/kernel/dumpstack.c +++ b/arch/s390/kernel/dumpstack.c @@ -67,12 +67,11 @@ static void show_trace(struct task_struct *task, unsigned long *stack) { const unsigned long frame_size = STACK_FRAME_OVERHEAD + sizeof(struct pt_regs); - register unsigned long __r15 asm ("15"); unsigned long sp; sp = (unsigned long) stack; if (!sp) - sp = task ? task->thread.ksp : __r15; + sp = task ? task->thread.ksp : current_stack_pointer(); printk("Call Trace:\n"); #ifdef CONFIG_CHECK_STACK sp = __show_trace(sp, @@ -95,15 +94,16 @@ static void show_trace(struct task_struct *task, unsigned long *stack) void show_stack(struct task_struct *task, unsigned long *sp) { - register unsigned long *__r15 asm ("15"); unsigned long *stack; int i; - if (!sp) - stack = task ? (unsigned long *) task->thread.ksp : __r15; - else - stack = sp; - + stack = sp; + if (!stack) { + if (!task) + stack = (unsigned long *)current_stack_pointer(); + else + stack = (unsigned long *)task->thread.ksp; + } for (i = 0; i < 20; i++) { if (((addr_t) stack & (THREAD_SIZE-1)) == 0) break; |