aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/traps_64.c
diff options
context:
space:
mode:
authorAlexander van Heukelum <heukelum@fastmail.fm>2008-09-30 12:41:34 -0400
committerIngo Molnar <mingo@elte.hu>2008-10-13 04:33:18 -0400
commita28680b4b821a262fd3b5e57a28c148b5f9e662a (patch)
tree9ec2e23d1993636e33c0a5a172b4743c4ed37bdd /arch/x86/kernel/traps_64.c
parent6fcbede3fdfbd83d8de97296286f5a9ff5a8f371 (diff)
x86, traps: split out math_error and simd_math_error
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>
Diffstat (limited to 'arch/x86/kernel/traps_64.c')
-rw-r--r--arch/x86/kernel/traps_64.c36
1 files changed, 21 insertions, 15 deletions
diff --git a/arch/x86/kernel/traps_64.c b/arch/x86/kernel/traps_64.c
index 1cd61ddd90be..b295ebf0cb3f 100644
--- a/arch/x86/kernel/traps_64.c
+++ b/arch/x86/kernel/traps_64.c
@@ -452,18 +452,12 @@ static int kernel_math_error(struct pt_regs *regs, const char *str, int trapnr)
452 * the correct behaviour even in the presence of the asynchronous 452 * the correct behaviour even in the presence of the asynchronous
453 * IRQ13 behaviour 453 * IRQ13 behaviour
454 */ 454 */
455asmlinkage void do_coprocessor_error(struct pt_regs *regs) 455void math_error(void __user *ip)
456{ 456{
457 void __user *ip = (void __user *)(regs->ip);
458 struct task_struct *task; 457 struct task_struct *task;
459 siginfo_t info; 458 siginfo_t info;
460 unsigned short cwd, swd; 459 unsigned short cwd, swd;
461 460
462 conditional_sti(regs);
463 if (!user_mode(regs) &&
464 kernel_math_error(regs, "kernel x87 math error", 16))
465 return;
466
467 /* 461 /*
468 * Save the info for the exception handler and clear the error. 462 * Save the info for the exception handler and clear the error.
469 */ 463 */
@@ -516,23 +510,26 @@ asmlinkage void do_coprocessor_error(struct pt_regs *regs)
516 force_sig_info(SIGFPE, &info, task); 510 force_sig_info(SIGFPE, &info, task);
517} 511}
518 512
513asmlinkage void do_coprocessor_error(struct pt_regs *regs, long error_code)
514{
515 conditional_sti(regs);
516 if (!user_mode(regs) &&
517 kernel_math_error(regs, "kernel x87 math error", 16))
518 return;
519 math_error((void __user *)regs->ip);
520}
521
519asmlinkage void bad_intr(void) 522asmlinkage void bad_intr(void)
520{ 523{
521 printk("bad interrupt"); 524 printk("bad interrupt");
522} 525}
523 526
524asmlinkage void do_simd_coprocessor_error(struct pt_regs *regs) 527static void simd_math_error(void __user *ip)
525{ 528{
526 void __user *ip = (void __user *)(regs->ip);
527 struct task_struct *task; 529 struct task_struct *task;
528 siginfo_t info; 530 siginfo_t info;
529 unsigned short mxcsr; 531 unsigned short mxcsr;
530 532
531 conditional_sti(regs);
532 if (!user_mode(regs) &&
533 kernel_math_error(regs, "kernel simd math error", 19))
534 return;
535
536 /* 533 /*
537 * Save the info for the exception handler and clear the error. 534 * Save the info for the exception handler and clear the error.
538 */ 535 */
@@ -575,7 +572,16 @@ asmlinkage void do_simd_coprocessor_error(struct pt_regs *regs)
575 force_sig_info(SIGFPE, &info, task); 572 force_sig_info(SIGFPE, &info, task);
576} 573}
577 574
578asmlinkage void do_spurious_interrupt_bug(struct pt_regs *regs) 575asmlinkage void do_simd_coprocessor_error(struct pt_regs *regs, long error_code)
576{
577 conditional_sti(regs);
578 if (!user_mode(regs) &&
579 kernel_math_error(regs, "kernel simd math error", 19))
580 return;
581 simd_math_error((void __user *)regs->ip);
582}
583
584asmlinkage void do_spurious_interrupt_bug(struct pt_regs *regs, long error_code)
579{ 585{
580} 586}
581 587