From 99bcc83ce1339b98eee8a5c1b17647fedf1a5a6e Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Wed, 13 Aug 2008 17:17:52 -0700 Subject: [PATCH] --- yaml --- r: 108354 b: refs/heads/master c: 6f63e781eaf6a741fc65f773017154b20ed4ce3b h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/arch/sparc64/kernel/kstack.h | 38 ++++++++++++++------------ trunk/arch/sparc64/kernel/stacktrace.c | 3 +- 3 files changed, 22 insertions(+), 21 deletions(-) diff --git a/[refs] b/[refs] index 74412acb3168..414c58dfdf7d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 4f70f7a91bffdcc39f088748dc678953eb9a3fbd +refs/heads/master: 6f63e781eaf6a741fc65f773017154b20ed4ce3b diff --git a/trunk/arch/sparc64/kernel/kstack.h b/trunk/arch/sparc64/kernel/kstack.h index 43909d5680ea..4248d969272f 100644 --- a/trunk/arch/sparc64/kernel/kstack.h +++ b/trunk/arch/sparc64/kernel/kstack.h @@ -15,15 +15,16 @@ static inline bool kstack_valid(struct thread_info *tp, unsigned long sp) sp <= (base + THREAD_SIZE - sizeof(struct sparc_stackf))) return true; - base = (unsigned long) hardirq_stack[tp->cpu]; - if (sp >= base && - sp <= (base + THREAD_SIZE - sizeof(struct sparc_stackf))) - return true; - base = (unsigned long) softirq_stack[tp->cpu]; - if (sp >= base && - sp <= (base + THREAD_SIZE - sizeof(struct sparc_stackf))) - return true; - + if (hardirq_stack[tp->cpu]) { + base = (unsigned long) hardirq_stack[tp->cpu]; + if (sp >= base && + sp <= (base + THREAD_SIZE - sizeof(struct sparc_stackf))) + return true; + base = (unsigned long) softirq_stack[tp->cpu]; + if (sp >= base && + sp <= (base + THREAD_SIZE - sizeof(struct sparc_stackf))) + return true; + } return false; } @@ -37,15 +38,16 @@ static inline bool kstack_is_trap_frame(struct thread_info *tp, struct pt_regs * addr <= (base + THREAD_SIZE - sizeof(*regs))) goto check_magic; - base = (unsigned long) hardirq_stack[tp->cpu]; - if (addr >= base && - addr <= (base + THREAD_SIZE - sizeof(*regs))) - goto check_magic; - base = (unsigned long) softirq_stack[tp->cpu]; - if (addr >= base && - addr <= (base + THREAD_SIZE - sizeof(*regs))) - goto check_magic; - + if (hardirq_stack[tp->cpu]) { + base = (unsigned long) hardirq_stack[tp->cpu]; + if (addr >= base && + addr <= (base + THREAD_SIZE - sizeof(*regs))) + goto check_magic; + base = (unsigned long) softirq_stack[tp->cpu]; + if (addr >= base && + addr <= (base + THREAD_SIZE - sizeof(*regs))) + goto check_magic; + } return false; check_magic: diff --git a/trunk/arch/sparc64/kernel/stacktrace.c b/trunk/arch/sparc64/kernel/stacktrace.c index 237e7f8a40ac..4e21d4a57d3b 100644 --- a/trunk/arch/sparc64/kernel/stacktrace.c +++ b/trunk/arch/sparc64/kernel/stacktrace.c @@ -9,8 +9,8 @@ void save_stack_trace(struct stack_trace *trace) { - unsigned long ksp, fp, thread_base; struct thread_info *tp = task_thread_info(current); + unsigned long ksp, fp; stack_trace_flush(); @@ -20,7 +20,6 @@ void save_stack_trace(struct stack_trace *trace) ); fp = ksp + STACK_BIAS; - thread_base = (unsigned long) tp; do { struct sparc_stackf *sf; struct pt_regs *regs;