[SPARC]: Fix TIF_USEDFPU flag atomicity

From: William Lee Irwin III <wli@holomorphy.com>

Signed-off-by: David S. Miller <davem@davemloft.net>

authored by William Lee Irwin III and committed by David S. Miller 54f565ea c0a79b22

+11 -11
+8 -8
arch/sparc/kernel/process.c
··· 348 348 #ifndef CONFIG_SMP 349 349 if(last_task_used_math == current) { 350 350 #else 351 - if(current_thread_info()->flags & _TIF_USEDFPU) { 351 + if (test_thread_flag(TIF_USEDFPU)) { 352 352 #endif 353 353 /* Keep process from leaving FPU in a bogon state. */ 354 354 put_psr(get_psr() | PSR_EF); ··· 357 357 #ifndef CONFIG_SMP 358 358 last_task_used_math = NULL; 359 359 #else 360 - current_thread_info()->flags &= ~_TIF_USEDFPU; 360 + clear_thread_flag(TIF_USEDFPU); 361 361 #endif 362 362 } 363 363 } ··· 371 371 #ifndef CONFIG_SMP 372 372 if(last_task_used_math == current) { 373 373 #else 374 - if(current_thread_info()->flags & _TIF_USEDFPU) { 374 + if (test_thread_flag(TIF_USEDFPU)) { 375 375 #endif 376 376 /* Clean the fpu. */ 377 377 put_psr(get_psr() | PSR_EF); ··· 380 380 #ifndef CONFIG_SMP 381 381 last_task_used_math = NULL; 382 382 #else 383 - current_thread_info()->flags &= ~_TIF_USEDFPU; 383 + clear_thread_flag(TIF_USEDFPU); 384 384 #endif 385 385 } 386 386 ··· 466 466 #ifndef CONFIG_SMP 467 467 if(last_task_used_math == current) { 468 468 #else 469 - if(current_thread_info()->flags & _TIF_USEDFPU) { 469 + if (test_thread_flag(TIF_USEDFPU)) { 470 470 #endif 471 471 put_psr(get_psr() | PSR_EF); 472 472 fpsave(&p->thread.float_regs[0], &p->thread.fsr, 473 473 &p->thread.fpqueue[0], &p->thread.fpqdepth); 474 474 #ifdef CONFIG_SMP 475 - current_thread_info()->flags &= ~_TIF_USEDFPU; 475 + clear_thread_flag(TIF_USEDFPU); 476 476 #endif 477 477 } 478 478 ··· 609 609 return 1; 610 610 } 611 611 #ifdef CONFIG_SMP 612 - if (current_thread_info()->flags & _TIF_USEDFPU) { 612 + if (test_thread_flag(TIF_USEDFPU)) { 613 613 put_psr(get_psr() | PSR_EF); 614 614 fpsave(&current->thread.float_regs[0], &current->thread.fsr, 615 615 &current->thread.fpqueue[0], &current->thread.fpqdepth); 616 616 if (regs != NULL) { 617 617 regs->psr &= ~(PSR_EF); 618 - current_thread_info()->flags &= ~(_TIF_USEDFPU); 618 + clear_thread_flag(TIF_USEDFPU); 619 619 } 620 620 } 621 621 #else
+3 -3
arch/sparc/kernel/traps.c
··· 259 259 } else { 260 260 fpload(&current->thread.float_regs[0], &current->thread.fsr); 261 261 } 262 - current_thread_info()->flags |= _TIF_USEDFPU; 262 + set_thread_flag(TIF_USEDFPU); 263 263 #endif 264 264 } 265 265 ··· 290 290 #ifndef CONFIG_SMP 291 291 if(!fpt) { 292 292 #else 293 - if(!(task_thread_info(fpt)->flags & _TIF_USEDFPU)) { 293 + if (!test_tsk_thread_flag(fpt, TIF_USEDFPU)) { 294 294 #endif 295 295 fpsave(&fake_regs[0], &fake_fsr, &fake_queue[0], &fake_depth); 296 296 regs->psr &= ~PSR_EF; ··· 333 333 /* nope, better SIGFPE the offending process... */ 334 334 335 335 #ifdef CONFIG_SMP 336 - task_thread_info(fpt)->flags &= ~_TIF_USEDFPU; 336 + clear_tsk_thread_flag(fpt, TIF_USEDFPU); 337 337 #endif 338 338 if(psr & PSR_PS) { 339 339 /* The first fsr store/load we tried trapped,