Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 113506
b: refs/heads/master
c: f8e0870
h: refs/heads/master
v: v3
  • Loading branch information
Alexander van Heukelum authored and Ingo Molnar committed Oct 13, 2008
1 parent 4c8a829 commit db7da5b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 52 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: b939bde2788a7f16741e563ee90f6f3ad38935cf
refs/heads/master: f8e0870f589cfa45575dc7333cdf1b8f769e7900
66 changes: 15 additions & 51 deletions trunk/arch/x86/kernel/traps_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -530,56 +530,6 @@ do_trap(int trapnr, int signr, char *str, int vm86, struct pt_regs *regs,
return;
}

#define DO_TRAP(trapnr, signr, str, name) \
void do_##name(struct pt_regs *regs, long error_code) \
{ \
trace_hardirqs_fixup(); \
if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \
== NOTIFY_STOP) \
return; \
do_trap(trapnr, signr, str, 0, regs, error_code, NULL); \
}

#define DO_TRAP_INFO(trapnr, signr, str, name, sicode, siaddr, irq) \
void do_##name(struct pt_regs *regs, long error_code) \
{ \
siginfo_t info; \
if (irq) \
local_irq_enable(); \
info.si_signo = signr; \
info.si_errno = 0; \
info.si_code = sicode; \
info.si_addr = (void __user *)siaddr; \
if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \
== NOTIFY_STOP) \
return; \
do_trap(trapnr, signr, str, 0, regs, error_code, &info); \
}

#define DO_VM86_TRAP(trapnr, signr, str, name) \
void do_##name(struct pt_regs *regs, long error_code) \
{ \
if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \
== NOTIFY_STOP) \
return; \
do_trap(trapnr, signr, str, 1, regs, error_code, NULL); \
}

#define DO_VM86_TRAP_INFO(trapnr, signr, str, name, sicode, siaddr) \
void do_##name(struct pt_regs *regs, long error_code) \
{ \
siginfo_t info; \
info.si_signo = signr; \
info.si_errno = 0; \
info.si_code = sicode; \
info.si_addr = (void __user *)siaddr; \
trace_hardirqs_fixup(); \
if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \
== NOTIFY_STOP) \
return; \
do_trap(trapnr, signr, str, 1, regs, error_code, &info); \
}

#define DO_ERROR(trapnr, signr, str, name) \
void do_##name(struct pt_regs *regs, long error_code) \
{ \
Expand Down Expand Up @@ -643,7 +593,6 @@ DO_ERROR(10, SIGSEGV, "invalid TSS", invalid_TSS)
DO_ERROR(11, SIGBUS, "segment not present", segment_not_present)
DO_ERROR(12, SIGBUS, "stack segment", stack_segment)
DO_ERROR_INFO(17, SIGBUS, "alignment check", alignment_check, BUS_ADRALN, 0, 0)
DO_TRAP_INFO(32, SIGILL, "iret exception", iret_error, ILL_BADSTK, 0, 1)

void __kprobes
do_general_protection(struct pt_regs *regs, long error_code)
Expand Down Expand Up @@ -1263,6 +1212,21 @@ void __kprobes do_machine_check(struct pt_regs *regs, long error)
}
#endif

void do_iret_error(struct pt_regs *regs, long error_code)
{
siginfo_t info;
local_irq_enable();

info.si_signo = SIGILL;
info.si_errno = 0;
info.si_code = ILL_BADSTK;
info.si_addr = 0;
if (notify_die(DIE_TRAP, "iret exception",
regs, error_code, 32, SIGILL) == NOTIFY_STOP)
return;
do_trap(32, SIGILL, "iret exception", 0, regs, error_code, &info);
}

void __init trap_init(void)
{
int i;
Expand Down

0 comments on commit db7da5b

Please sign in to comment.