]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/sparc64/kernel/kstack.h
sparc64: Handle stack trace attempts before irqstacks are setup.
[linux-2.6-omap-h63xx.git] / arch / sparc64 / kernel / kstack.h
index 43909d5680ea2a4679fb6ad594bfc25e2da773d9..4248d969272f1f92a7470a15bc631c72bd628f24 100644 (file)
@@ -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: