Resend: [PATCH 2/9] traps: x86_64: make math_state_restore more like i386

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Alexander van Heukelum
Date: Friday, October 3, 2008 - 2:16 pm

- rename variable me -> tsk
 - get thread and tsk like i386
 - expand used_math()
 - copy comment

Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm>
---
 arch/x86/kernel/traps_64.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

It looks like patches 2 and 7 have been eaten along the way... Trying
those again.

Greetings,
    Alexander

diff --git a/arch/x86/kernel/traps_64.c b/arch/x86/kernel/traps_64.c
index 8cf590b..a7aef2d 100644
--- a/arch/x86/kernel/traps_64.c
+++ b/arch/x86/kernel/traps_64.c
@@ -609,14 +609,15 @@ asmlinkage void __attribute__((weak)) mce_threshold_interrupt(void)
  */
 asmlinkage void math_state_restore(void)
 {
-	struct task_struct *me = current;
+	struct thread_info *thread = current_thread_info();
+	struct task_struct *tsk = thread->task;
 
-	if (!used_math()) {
+	if (!tsk_used_math(tsk)) {
 		local_irq_enable();
 		/*
 		 * does a slab alloc which can sleep
 		 */
-		if (init_fpu(me)) {
+		if (init_fpu(tsk)) {
 			/*
 			 * ran out of memory!
 			 */
@@ -630,13 +631,13 @@ asmlinkage void math_state_restore(void)
 	/*
 	 * Paranoid restore. send a SIGSEGV if we fail to restore the state.
 	 */
-	if (unlikely(restore_fpu_checking(me))) {
+	if (unlikely(restore_fpu_checking(tsk))) {
 		stts();
-		force_sig(SIGSEGV, me);
+		force_sig(SIGSEGV, tsk);
 		return;
 	}
-	task_thread_info(me)->status |= TS_USEDFPU;
-	me->fpu_counter++;
+	thread->status |= TS_USEDFPU;	/* So we fnsave on switch_to() */
+	tsk->fpu_counter++;
 }
 EXPORT_SYMBOL_GPL(math_state_restore);
 
-- 
1.5.4.3
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/9] traps: x86: finalize unification of traps.c, Alexander van Heukelum, (Fri Oct 3, 1:00 pm)
[PATCH 1/9] traps: x86: converge trap_init functions, Alexander van Heukelum, (Fri Oct 3, 1:00 pm)
[PATCH 2/9] traps: x86_64: make math_state_restore more li ..., Alexander van Heukelum, (Fri Oct 3, 1:00 pm)
[PATCH 3/9] traps: i386: use preempt_conditional_sti/cli i ..., Alexander van Heukelum, (Fri Oct 3, 1:00 pm)
[PATCH 4/9] traps: x86_64: make io_check_error equal to th ..., Alexander van Heukelum, (Fri Oct 3, 1:00 pm)
[PATCH 5/9] traps: i386: expand clear_mem_error and remove ..., Alexander van Heukelum, (Fri Oct 3, 1:00 pm)
[PATCH 6/9] traps: x86_64: use task_pid_nr(tsk) instead of ..., Alexander van Heukelum, (Fri Oct 3, 1:00 pm)
[PATCH 7/9] traps: x86: various noop-changes preparing for ..., Alexander van Heukelum, (Fri Oct 3, 1:00 pm)
[PATCH 8/9] traps: x86: make traps_32.c and traps_64.c equal, Alexander van Heukelum, (Fri Oct 3, 1:00 pm)
[PATCH 9/9] traps: x86: finalize unification of traps.c, Alexander van Heukelum, (Fri Oct 3, 1:00 pm)
Resend: [PATCH 2/9] traps: x86_64: make math_state_restore ..., Alexander van Heukelum, (Fri Oct 3, 2:16 pm)
Resend: [PATCH 7/9] traps: x86: various noop-changes prepa ..., Alexander van Heukelum, (Fri Oct 3, 2:17 pm)