diff options
author | Heiko Carstens | 2016-01-31 17:06:16 +0100 |
---|---|---|
committer | Martin Schwidefsky | 2016-02-23 08:56:18 +0100 |
commit | 76737ce17ab4c88f14e4452076610474108246d7 (patch) | |
tree | 59d00defd69cc30c427c5eb637553bc74e5406c8 /arch/s390/kernel/stacktrace.c | |
parent | 77ec8a545136272ca3056ca3759836df0cfee5e5 (diff) |
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/stacktrace.c')
-rw-r--r-- | arch/s390/kernel/stacktrace.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/arch/s390/kernel/stacktrace.c b/arch/s390/kernel/stacktrace.c index 3872d14fe1a1..7dd8360b1c39 100644 --- a/arch/s390/kernel/stacktrace.c +++ b/arch/s390/kernel/stacktrace.c @@ -77,10 +77,9 @@ static void __save_stack_trace(struct stack_trace *trace, unsigned long sp) void save_stack_trace(struct stack_trace *trace) { - register unsigned long r15 asm ("15"); unsigned long sp; - sp = r15; + sp = current_stack_pointer(); __save_stack_trace(trace, sp); if (trace->nr_entries < trace->max_entries) trace->entries[trace->nr_entries++] = ULONG_MAX; @@ -92,10 +91,8 @@ void save_stack_trace_tsk(struct task_struct *tsk, struct stack_trace *trace) unsigned long sp, low, high; sp = tsk->thread.ksp; - if (tsk == current) { - /* Get current stack pointer. */ - asm volatile("la %0,0(15)" : "=a" (sp)); - } + if (tsk == current) + sp = current_stack_pointer(); low = (unsigned long) task_stack_page(tsk); high = (unsigned long) task_pt_regs(tsk); save_context_stack(trace, sp, low, high, 1); |