aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/time.c
diff options
context:
space:
mode:
authorCatalin Marinas <catalin.marinas@arm.com>2009-02-11 07:07:53 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-02-12 08:21:17 -0500
commit2d7c11bfc91637e5f9bc5f8c9a82aaffcc0e97aa (patch)
tree0bb67dae38b1185089b6c9813769689cb79c5ee3 /arch/arm/kernel/time.c
parent67a94c23bb7338c321ae71aa33f8d398c94e1d0c (diff)
[ARM] 5382/1: unwind: Reorganise the stacktrace support
This patch changes the walk_stacktrace and its callers for easier integration of stack unwinding. The arch/arm/kernel/stacktrace.h file is also moved to arch/arm/include/asm/stacktrace.h. Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/kernel/time.c')
-rw-r--r--arch/arm/kernel/time.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c
index c68b44aa88d2..4cdc4a0bd02d 100644
--- a/arch/arm/kernel/time.c
+++ b/arch/arm/kernel/time.c
@@ -33,6 +33,7 @@
33 33
34#include <asm/leds.h> 34#include <asm/leds.h>
35#include <asm/thread_info.h> 35#include <asm/thread_info.h>
36#include <asm/stacktrace.h>
36#include <asm/mach/time.h> 37#include <asm/mach/time.h>
37 38
38/* 39/*
@@ -55,14 +56,22 @@ EXPORT_SYMBOL(rtc_lock);
55#ifdef CONFIG_SMP 56#ifdef CONFIG_SMP
56unsigned long profile_pc(struct pt_regs *regs) 57unsigned long profile_pc(struct pt_regs *regs)
57{ 58{
58 unsigned long fp, pc = instruction_pointer(regs); 59 struct stackframe frame;
59 60
60 if (in_lock_functions(pc)) { 61 if (!in_lock_functions(regs->ARM_pc))
61 fp = regs->ARM_fp; 62 return regs->ARM_pc;
62 pc = ((unsigned long *)fp)[-1]; 63
63 } 64 frame.fp = regs->ARM_fp;
65 frame.sp = regs->ARM_sp;
66 frame.lr = regs->ARM_lr;
67 frame.pc = regs->ARM_pc;
68 do {
69 int ret = unwind_frame(&frame);
70 if (ret < 0)
71 return 0;
72 } while (in_lock_functions(frame.pc));
64 73
65 return pc; 74 return frame.pc;
66} 75}
67EXPORT_SYMBOL(profile_pc); 76EXPORT_SYMBOL(profile_pc);
68#endif 77#endif