]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/sh/kernel/traps_32.c
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux...
[linux-2.6-omap-h63xx.git] / arch / sh / kernel / traps_32.c
index 4901f673216210b5b5f26bf39fa7604a1c16377d..1e5c74efbacc35d4f729b17cb08b342bbca2045f 100644 (file)
@@ -26,6 +26,7 @@
 #include <asm/system.h>
 #include <asm/uaccess.h>
 #include <asm/fpu.h>
+#include <asm/kprobes.h>
 
 #ifdef CONFIG_SH_KGDB
 #include <asm/kgdb.h>
@@ -104,6 +105,8 @@ void die(const char * str, struct pt_regs * regs, long err)
                dump_mem("Stack: ", regs->regs[15], THREAD_SIZE +
                         (unsigned long)task_stack_page(current));
 
+       notify_die(DIE_OOPS, str, regs, err, 255, SIGSEGV);
+
        bust_spinlocks(0);
        add_taint(TAINT_DIE);
        spin_unlock_irq(&die_lock);
@@ -513,14 +516,6 @@ int handle_unaligned_access(opcode_t instruction, struct pt_regs *regs,
        return ret;
 }
 
-#ifdef CONFIG_CPU_HAS_SR_RB
-#define lookup_exception_vector(x)     \
-       __asm__ __volatile__ ("stc r2_bank, %0\n\t" : "=r" ((x)))
-#else
-#define lookup_exception_vector(x)     \
-       __asm__ __volatile__ ("mov r4, %0\n\t" : "=r" ((x)))
-#endif
-
 /*
  * Handle various address error exceptions:
  *  - instruction address error:
@@ -544,7 +539,7 @@ asmlinkage void do_address_error(struct pt_regs *regs,
 
        /* Intentional ifdef */
 #ifdef CONFIG_CPU_HAS_SR_RB
-       lookup_exception_vector(error_code);
+       error_code = lookup_exception_vector();
 #endif
 
        oldfs = get_fs();
@@ -685,7 +680,7 @@ asmlinkage void do_reserved_inst(unsigned long r4, unsigned long r5,
        }
 #endif
 
-       lookup_exception_vector(error_code);
+       error_code = lookup_exception_vector();
 
        local_irq_enable();
        CHK_REMOTE_DEBUG(regs);
@@ -741,11 +736,13 @@ asmlinkage void do_illegal_slot_inst(unsigned long r4, unsigned long r5,
                                struct pt_regs __regs)
 {
        struct pt_regs *regs = RELOC_HIDE(&__regs, 0);
-       unsigned long error_code;
+       unsigned long inst;
        struct task_struct *tsk = current;
-#ifdef CONFIG_SH_FPU_EMU
-       unsigned short inst = 0;
 
+       if (kprobe_handle_illslot(regs->pc) == 0)
+               return;
+
+#ifdef CONFIG_SH_FPU_EMU
        get_user(inst, (unsigned short *)regs->pc + 1);
        if (!do_fpu_inst(inst, regs)) {
                get_user(inst, (unsigned short *)regs->pc);
@@ -756,12 +753,12 @@ asmlinkage void do_illegal_slot_inst(unsigned long r4, unsigned long r5,
        /* not a FPU inst. */
 #endif
 
-       lookup_exception_vector(error_code);
+       inst = lookup_exception_vector();
 
        local_irq_enable();
        CHK_REMOTE_DEBUG(regs);
        force_sig(SIGILL, tsk);
-       die_if_no_fixup("illegal slot instruction", regs, error_code);
+       die_if_no_fixup("illegal slot instruction", regs, inst);
 }
 
 asmlinkage void do_exception_error(unsigned long r4, unsigned long r5,
@@ -771,7 +768,7 @@ asmlinkage void do_exception_error(unsigned long r4, unsigned long r5,
        struct pt_regs *regs = RELOC_HIDE(&__regs, 0);
        long ex;
 
-       lookup_exception_vector(ex);
+       ex = lookup_exception_vector();
        die_if_kernel("exception", regs, ex);
 }