| #include <linux/kdebug.h> |
| #include <linux/signal.h> |
| static void handle_BUG(struct pt_regs *regs) |
| tt = report_bug(regs->pc, regs); |
| if (tt == BUG_TRAP_TYPE_WARN) { |
| regs->pc += instruction_size(regs->pc); |
| die("Kernel BUG", regs, TRAPA_BUG_OPCODE & 0xff); |
| int is_valid_bugaddr(unsigned long addr) |
| return addr >= PAGE_OFFSET; |
| BUILD_TRAP_HANDLER(debug) |
| regs->pc -= instruction_size(ctrl_inw(regs->pc - 4)); |
| if (notify_die(DIE_TRAP, "debug trap", regs, 0, vec & 0xff, |
| force_sig(SIGTRAP, current); |
| * Special handler for BUG() traps. |
| regs->pc -= instruction_size(ctrl_inw(regs->pc - 4)); |
| if (notify_die(DIE_TRAP, "bug trap", regs, 0, TRAPA_BUG_OPCODE & 0xff, |
| if (__kernel_text_address(instruction_pointer(regs))) { |
| opcode_t insn = *(opcode_t *)instruction_pointer(regs); |
| if (insn == TRAPA_BUG_OPCODE) |
| force_sig(SIGTRAP, current); |