Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 41396
b: refs/heads/master
c: 63dc68a
h: refs/heads/master
v: v3
  • Loading branch information
Ralf Baechle committed Nov 30, 2006
1 parent c9a6fe7 commit ffde48c
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 005985609ff72df3257fde6b29aa9d71342c2a6b
refs/heads/master: 63dc68a8cf60cb110b147dab1704d990808b39e2
14 changes: 10 additions & 4 deletions trunk/arch/mips/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -669,8 +669,6 @@ asmlinkage void do_bp(struct pt_regs *regs)
unsigned int opcode, bcode;
siginfo_t info;

die_if_kernel("Break instruction in kernel code", regs);

if (get_user(opcode, (unsigned int __user *) exception_epc(regs)))
goto out_sigsegv;

Expand All @@ -693,6 +691,7 @@ asmlinkage void do_bp(struct pt_regs *regs)
switch (bcode) {
case BRK_OVERFLOW << 10:
case BRK_DIVZERO << 10:
die_if_kernel("Break instruction in kernel code", regs);
if (bcode == (BRK_DIVZERO << 10))
info.si_code = FPE_INTDIV;
else
Expand All @@ -702,7 +701,11 @@ asmlinkage void do_bp(struct pt_regs *regs)
info.si_addr = (void __user *) regs->cp0_epc;
force_sig_info(SIGFPE, &info, current);
break;
case BRK_BUG:
die("Kernel bug detected", regs);
break;
default:
die_if_kernel("Break instruction in kernel code", regs);
force_sig(SIGTRAP, current);
}

Expand All @@ -715,8 +718,6 @@ asmlinkage void do_tr(struct pt_regs *regs)
unsigned int opcode, tcode = 0;
siginfo_t info;

die_if_kernel("Trap instruction in kernel code", regs);

if (get_user(opcode, (unsigned int __user *) exception_epc(regs)))
goto out_sigsegv;

Expand All @@ -733,6 +734,7 @@ asmlinkage void do_tr(struct pt_regs *regs)
switch (tcode) {
case BRK_OVERFLOW:
case BRK_DIVZERO:
die_if_kernel("Trap instruction in kernel code", regs);
if (tcode == BRK_DIVZERO)
info.si_code = FPE_INTDIV;
else
Expand All @@ -742,7 +744,11 @@ asmlinkage void do_tr(struct pt_regs *regs)
info.si_addr = (void __user *) regs->cp0_epc;
force_sig_info(SIGFPE, &info, current);
break;
case BRK_BUG:
die("Kernel bug detected", regs);
break;
default:
die_if_kernel("Trap instruction in kernel code", regs);
force_sig(SIGTRAP, current);
}

Expand Down
12 changes: 12 additions & 0 deletions trunk/include/asm-mips/bug.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef __ASM_BUG_H
#define __ASM_BUG_H

#include <asm/sgidefs.h>

#ifdef CONFIG_BUG

Expand All @@ -13,6 +14,17 @@ do { \

#define HAVE_ARCH_BUG

#if (_MIPS_ISA > _MIPS_ISA_MIPS1)

#define BUG_ON(condition) \
do { \
__asm__ __volatile__("tne $0, %0" : : "r" (condition)); \
} while (0)

#define HAVE_ARCH_BUG_ON

#endif /* _MIPS_ISA > _MIPS_ISA_MIPS1 */

#endif

#include <asm-generic/bug.h>
Expand Down
2 changes: 0 additions & 2 deletions trunk/include/asm-mips/ptrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ struct pt_regs {
#define instruction_pointer(regs) ((regs)->cp0_epc)
#define profile_pc(regs) instruction_pointer(regs)

extern void show_regs(struct pt_regs *);

extern asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit);

#endif
Expand Down

0 comments on commit ffde48c

Please sign in to comment.