aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64/kernel/stacktrace.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-08-12 21:33:56 -0400
committerDavid S. Miller <davem@davemloft.net>2008-08-12 21:33:56 -0400
commit4f70f7a91bffdcc39f088748dc678953eb9a3fbd (patch)
tree934591a9518fbed87c14b758a1744cc30c9dfbb8 /arch/sparc64/kernel/stacktrace.c
parente34456825de0d3ac4c4e8fe0bdc6b599404ea06f (diff)
sparc64: Implement IRQ stacks.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/kernel/stacktrace.c')
-rw-r--r--arch/sparc64/kernel/stacktrace.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/arch/sparc64/kernel/stacktrace.c b/arch/sparc64/kernel/stacktrace.c
index e9d7f0660f2e..237e7f8a40ac 100644
--- a/arch/sparc64/kernel/stacktrace.c
+++ b/arch/sparc64/kernel/stacktrace.c
@@ -5,6 +5,8 @@
5#include <asm/ptrace.h> 5#include <asm/ptrace.h>
6#include <asm/stacktrace.h> 6#include <asm/stacktrace.h>
7 7
8#include "kstack.h"
9
8void save_stack_trace(struct stack_trace *trace) 10void save_stack_trace(struct stack_trace *trace)
9{ 11{
10 unsigned long ksp, fp, thread_base; 12 unsigned long ksp, fp, thread_base;
@@ -24,17 +26,13 @@ void save_stack_trace(struct stack_trace *trace)
24 struct pt_regs *regs; 26 struct pt_regs *regs;
25 unsigned long pc; 27 unsigned long pc;
26 28
27 /* Bogus frame pointer? */ 29 if (!kstack_valid(tp, fp))
28 if (fp < (thread_base + sizeof(struct thread_info)) ||
29 fp > (thread_base + THREAD_SIZE - sizeof(struct sparc_stackf)))
30 break; 30 break;
31 31
32 sf = (struct sparc_stackf *) fp; 32 sf = (struct sparc_stackf *) fp;
33 regs = (struct pt_regs *) (sf + 1); 33 regs = (struct pt_regs *) (sf + 1);
34 34
35 if (((unsigned long)regs <= 35 if (kstack_is_trap_frame(tp, regs)) {
36 (thread_base + THREAD_SIZE - sizeof(*regs))) &&
37 (regs->magic & ~0x1ff) == PT_REGS_MAGIC) {
38 if (!(regs->tstate & TSTATE_PRIV)) 36 if (!(regs->tstate & TSTATE_PRIV))
39 break; 37 break;
40 pc = regs->tpc; 38 pc = regs->tpc;