Merge branch 'sh/dwarf-unwinder' of git://github.com/mfleming/linux-2.6 into sh/dwarf...
authorPaul Mundt <lethal@linux-sh.org>
Fri, 21 Aug 2009 18:49:58 +0000 (03:49 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Fri, 21 Aug 2009 18:49:58 +0000 (03:49 +0900)
1  2 
arch/sh/kernel/unwinder.c

@@@ -157,8 -159,25 +160,26 @@@ void unwind_stack(struct task_struct *t
        }
  
        curr_unwinder->dump(task, regs, sp, ops, data);
+ }
+ /*
+  * Trap handler for UWINDER_BUG() statements. We must switch to the
+  * unwinder with the next highest rating.
+  */
+ BUILD_TRAP_HANDLER(unwinder)
+ {
+       insn_size_t insn;
+       TRAP_HANDLER_DECL;
+       /* Rewind */
+       regs->pc -= instruction_size(ctrl_inw(regs->pc - 4));
+       insn = *(insn_size_t *)instruction_pointer(regs);
+       /* Switch unwinders when unwind_stack() is called */
+       unwinder_faulted = 1;
  
-       atomic_dec(&unwinder_running);
+ #ifdef CONFIG_BUG
+       handle_BUG(regs);
+ #endif
  }
 +EXPORT_SYMBOL_GPL(unwind_stack);