aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAlexander van Heukelum <heukelum@mailshack.com>2008-10-03 17:16:12 -0400
committerIngo Molnar <mingo@elte.hu>2008-10-13 04:33:22 -0400
commit091d30c8f7744f43b0bb507fd30ceb95f9ff9e1b (patch)
tree277346d53056a92013f9c01260cc23617dd1cc33 /arch
parent699d2937d45d9dabc1772d0d07501ccc43885c23 (diff)
traps: x86_64: make math_state_restore more like i386
- rename variable me -> tsk - get thread and tsk like i386 - expand used_math() - copy comment Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/traps_64.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/arch/x86/kernel/traps_64.c b/arch/x86/kernel/traps_64.c
index ea091dfe0cd3..00406c99aee4 100644
--- a/arch/x86/kernel/traps_64.c
+++ b/arch/x86/kernel/traps_64.c
@@ -604,14 +604,15 @@ asmlinkage void __attribute__((weak)) mce_threshold_interrupt(void)
604 */ 604 */
605asmlinkage void math_state_restore(void) 605asmlinkage void math_state_restore(void)
606{ 606{
607 struct task_struct *me = current; 607 struct thread_info *thread = current_thread_info();
608 struct task_struct *tsk = thread->task;
608 609
609 if (!used_math()) { 610 if (!tsk_used_math(tsk)) {
610 local_irq_enable(); 611 local_irq_enable();
611 /* 612 /*
612 * does a slab alloc which can sleep 613 * does a slab alloc which can sleep
613 */ 614 */
614 if (init_fpu(me)) { 615 if (init_fpu(tsk)) {
615 /* 616 /*
616 * ran out of memory! 617 * ran out of memory!
617 */ 618 */
@@ -625,13 +626,13 @@ asmlinkage void math_state_restore(void)
625 /* 626 /*
626 * Paranoid restore. send a SIGSEGV if we fail to restore the state. 627 * Paranoid restore. send a SIGSEGV if we fail to restore the state.
627 */ 628 */
628 if (unlikely(restore_fpu_checking(me))) { 629 if (unlikely(restore_fpu_checking(tsk))) {
629 stts(); 630 stts();
630 force_sig(SIGSEGV, me); 631 force_sig(SIGSEGV, tsk);
631 return; 632 return;
632 } 633 }
633 task_thread_info(me)->status |= TS_USEDFPU; 634 thread->status |= TS_USEDFPU; /* So we fnsave on switch_to() */
634 me->fpu_counter++; 635 tsk->fpu_counter++;
635} 636}
636EXPORT_SYMBOL_GPL(math_state_restore); 637EXPORT_SYMBOL_GPL(math_state_restore);
637 638