Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b3a5acc17c4ad9c28c00ee5e5271de1b1285d22b
Commit:     b3a5acc17c4ad9c28c00ee5e5271de1b1285d22b
Parent:     318aa296c329625916c47703eab906d6ebf13930
Author:     Harvey Harrison <[EMAIL PROTECTED]>
AuthorDate: Wed Jan 30 13:32:59 2008 +0100
Committer:  Ingo Molnar <[EMAIL PROTECTED]>
CommitDate: Wed Jan 30 13:32:59 2008 +0100

    x86: use fixup_exception() in traps_64.c
    
    Use the fixup_exception() helper instead of the open-coded
    search_extable() users.
    
    Signed-off-by: Harvey Harrison <[EMAIL PROTECTED]>
    Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>
    Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]>
---
 arch/x86/kernel/traps_64.c |   47 ++++++++++++++-----------------------------
 1 files changed, 15 insertions(+), 32 deletions(-)

diff --git a/arch/x86/kernel/traps_64.c b/arch/x86/kernel/traps_64.c
index 7118fa0..37b07d0 100644
--- a/arch/x86/kernel/traps_64.c
+++ b/arch/x86/kernel/traps_64.c
@@ -601,19 +601,12 @@ static void __kprobes do_trap(int trapnr, int signr, char 
*str,
        }
 
 
-       /* kernel trap */ 
-       {            
-               const struct exception_table_entry *fixup;
-               fixup = search_exception_tables(regs->ip);
-               if (fixup)
-                       regs->ip = fixup->fixup;
-               else {
-                       tsk->thread.error_code = error_code;
-                       tsk->thread.trap_no = trapnr;
-                       die(str, regs, error_code);
-               }
-               return;
+       if (!fixup_exception(regs)) {
+               tsk->thread.error_code = error_code;
+               tsk->thread.trap_no = trapnr;
+               die(str, regs, error_code);
        }
+       return;
 }
 
 #define DO_ERROR(trapnr, signr, str, name) \
@@ -703,22 +696,15 @@ asmlinkage void __kprobes do_general_protection(struct 
pt_regs * regs,
                return;
        } 
 
-       /* kernel gp */
-       {
-               const struct exception_table_entry *fixup;
-               fixup = search_exception_tables(regs->ip);
-               if (fixup) {
-                       regs->ip = fixup->fixup;
-                       return;
-               }
+       if (fixup_exception(regs))
+               return;
 
-               tsk->thread.error_code = error_code;
-               tsk->thread.trap_no = 13;
-               if (notify_die(DIE_GPF, "general protection fault", regs,
-                                       error_code, 13, SIGSEGV) == NOTIFY_STOP)
-                       return;
-               die("general protection fault", regs, error_code);
-       }
+       tsk->thread.error_code = error_code;
+       tsk->thread.trap_no = 13;
+       if (notify_die(DIE_GPF, "general protection fault", regs,
+                               error_code, 13, SIGSEGV) == NOTIFY_STOP)
+               return;
+       die("general protection fault", regs, error_code);
 }
 
 static __kprobes void
@@ -910,12 +896,9 @@ clear_TF_reenable:
 
 static int kernel_math_error(struct pt_regs *regs, const char *str, int trapnr)
 {
-       const struct exception_table_entry *fixup;
-       fixup = search_exception_tables(regs->ip);
-       if (fixup) {
-               regs->ip = fixup->fixup;
+       if (fixup_exception(regs))
                return 1;
-       }
+
        notify_die(DIE_GPF, str, regs, 0, trapnr, SIGFPE);
        /* Illegal floating point operation in the kernel */
        current->thread.trap_no = trapnr;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to