]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
x86, traps: split out math_error and simd_math_error
authorAlexander van Heukelum <heukelum@fastmail.fm>
Tue, 30 Sep 2008 16:41:34 +0000 (18:41 +0200)
committerIngo Molnar <mingo@elte.hu>
Mon, 13 Oct 2008 08:33:18 +0000 (10:33 +0200)
Split out math_error from do_coprocessor_error and simd_math_error
from do_simd_coprocessor_error, like on i386. While at it, add the
"error_code" parameter to do_coprocessor_error, do_simd_coprocessor_error
and do_spurious_interrupt_bug.

This does not change the generated code, but brings the declarations in
line with all the other trap handlers.

Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/kernel/traps_64.c
include/asm-x86/traps.h

index 1cd61ddd90be7e05a91daf622acbff40c2212d35..b295ebf0cb3f9d09e24dab3b41c9de41ba4f9abf 100644 (file)
@@ -452,18 +452,12 @@ static int kernel_math_error(struct pt_regs *regs, const char *str, int trapnr)
  * the correct behaviour even in the presence of the asynchronous
  * IRQ13 behaviour
  */
-asmlinkage void do_coprocessor_error(struct pt_regs *regs)
+void math_error(void __user *ip)
 {
-       void __user *ip = (void __user *)(regs->ip);
        struct task_struct *task;
        siginfo_t info;
        unsigned short cwd, swd;
 
-       conditional_sti(regs);
-       if (!user_mode(regs) &&
-           kernel_math_error(regs, "kernel x87 math error", 16))
-               return;
-
        /*
         * Save the info for the exception handler and clear the error.
         */
@@ -516,23 +510,26 @@ asmlinkage void do_coprocessor_error(struct pt_regs *regs)
        force_sig_info(SIGFPE, &info, task);
 }
 
+asmlinkage void do_coprocessor_error(struct pt_regs *regs, long error_code)
+{
+       conditional_sti(regs);
+       if (!user_mode(regs) &&
+           kernel_math_error(regs, "kernel x87 math error", 16))
+               return;
+       math_error((void __user *)regs->ip);
+}
+
 asmlinkage void bad_intr(void)
 {
        printk("bad interrupt");
 }
 
-asmlinkage void do_simd_coprocessor_error(struct pt_regs *regs)
+static void simd_math_error(void __user *ip)
 {
-       void __user *ip = (void __user *)(regs->ip);
        struct task_struct *task;
        siginfo_t info;
        unsigned short mxcsr;
 
-       conditional_sti(regs);
-       if (!user_mode(regs) &&
-                       kernel_math_error(regs, "kernel simd math error", 19))
-               return;
-
        /*
         * Save the info for the exception handler and clear the error.
         */
@@ -575,7 +572,16 @@ asmlinkage void do_simd_coprocessor_error(struct pt_regs *regs)
        force_sig_info(SIGFPE, &info, task);
 }
 
-asmlinkage void do_spurious_interrupt_bug(struct pt_regs *regs)
+asmlinkage void do_simd_coprocessor_error(struct pt_regs *regs, long error_code)
+{
+       conditional_sti(regs);
+       if (!user_mode(regs) &&
+                       kernel_math_error(regs, "kernel simd math error", 19))
+               return;
+       simd_math_error((void __user *)regs->ip);
+}
+
+asmlinkage void do_spurious_interrupt_bug(struct pt_regs *regs, long error_code)
 {
 }
 
index 7a692baa51ae1548cf255c514ec4521a77a815b3..c82c39c7b5ea38e767174438960eaf50eb4a811e 100644 (file)
@@ -72,9 +72,9 @@ asmlinkage void double_fault(void);
 asmlinkage void do_int3(struct pt_regs *, long);
 asmlinkage void do_stack_segment(struct pt_regs *, long);
 asmlinkage void do_debug(struct pt_regs *, unsigned long);
-asmlinkage void do_coprocessor_error(struct pt_regs *);
-asmlinkage void do_simd_coprocessor_error(struct pt_regs *);
-asmlinkage void do_spurious_interrupt_bug(struct pt_regs *);
+asmlinkage void do_coprocessor_error(struct pt_regs *, long);
+asmlinkage void do_simd_coprocessor_error(struct pt_regs *, long);
+asmlinkage void do_spurious_interrupt_bug(struct pt_regs *, long);
 
 asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code);