aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-03-12 21:13:02 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-03-12 21:13:02 -0400
commit44a5085162f3d3231b359784319a207032e09523 (patch)
tree8edc17bb33586f4e05b06af8155ea8896bed6346 /arch
parent27d30b0f4e0c8e63f48ef400a64fc073b71bfe59 (diff)
parent54f565ea895b383b67a2d6e31d2e2fcac5e6c345 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6: [SPARC]: Fix TIF_USEDFPU flag atomicity [SPARC64]: Fix atomicity of TIF update in flush_thread() [BW2]: Fix section mismatch warnings. [CG14]: Fix section mismatch warnings. [SPARC]: We do not need OLD_GETRLIMIT.
Diffstat (limited to 'arch')
-rw-r--r--arch/sparc/kernel/process.c16
-rw-r--r--arch/sparc/kernel/traps.c6
-rw-r--r--arch/sparc64/kernel/process.c9
3 files changed, 18 insertions, 13 deletions
diff --git a/arch/sparc/kernel/process.c b/arch/sparc/kernel/process.c
index 113bd48a89bd..fc874e63a499 100644
--- a/arch/sparc/kernel/process.c
+++ b/arch/sparc/kernel/process.c
@@ -348,7 +348,7 @@ void exit_thread(void)
348#ifndef CONFIG_SMP 348#ifndef CONFIG_SMP
349 if(last_task_used_math == current) { 349 if(last_task_used_math == current) {
350#else 350#else
351 if(current_thread_info()->flags & _TIF_USEDFPU) { 351 if (test_thread_flag(TIF_USEDFPU)) {
352#endif 352#endif
353 /* Keep process from leaving FPU in a bogon state. */ 353 /* Keep process from leaving FPU in a bogon state. */
354 put_psr(get_psr() | PSR_EF); 354 put_psr(get_psr() | PSR_EF);
@@ -357,7 +357,7 @@ void exit_thread(void)
357#ifndef CONFIG_SMP 357#ifndef CONFIG_SMP
358 last_task_used_math = NULL; 358 last_task_used_math = NULL;
359#else 359#else
360 current_thread_info()->flags &= ~_TIF_USEDFPU; 360 clear_thread_flag(TIF_USEDFPU);
361#endif 361#endif
362 } 362 }
363} 363}
@@ -371,7 +371,7 @@ void flush_thread(void)
371#ifndef CONFIG_SMP 371#ifndef CONFIG_SMP
372 if(last_task_used_math == current) { 372 if(last_task_used_math == current) {
373#else 373#else
374 if(current_thread_info()->flags & _TIF_USEDFPU) { 374 if (test_thread_flag(TIF_USEDFPU)) {
375#endif 375#endif
376 /* Clean the fpu. */ 376 /* Clean the fpu. */
377 put_psr(get_psr() | PSR_EF); 377 put_psr(get_psr() | PSR_EF);
@@ -380,7 +380,7 @@ void flush_thread(void)
380#ifndef CONFIG_SMP 380#ifndef CONFIG_SMP
381 last_task_used_math = NULL; 381 last_task_used_math = NULL;
382#else 382#else
383 current_thread_info()->flags &= ~_TIF_USEDFPU; 383 clear_thread_flag(TIF_USEDFPU);
384#endif 384#endif
385 } 385 }
386 386
@@ -466,13 +466,13 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
466#ifndef CONFIG_SMP 466#ifndef CONFIG_SMP
467 if(last_task_used_math == current) { 467 if(last_task_used_math == current) {
468#else 468#else
469 if(current_thread_info()->flags & _TIF_USEDFPU) { 469 if (test_thread_flag(TIF_USEDFPU)) {
470#endif 470#endif
471 put_psr(get_psr() | PSR_EF); 471 put_psr(get_psr() | PSR_EF);
472 fpsave(&p->thread.float_regs[0], &p->thread.fsr, 472 fpsave(&p->thread.float_regs[0], &p->thread.fsr,
473 &p->thread.fpqueue[0], &p->thread.fpqdepth); 473 &p->thread.fpqueue[0], &p->thread.fpqdepth);
474#ifdef CONFIG_SMP 474#ifdef CONFIG_SMP
475 current_thread_info()->flags &= ~_TIF_USEDFPU; 475 clear_thread_flag(TIF_USEDFPU);
476#endif 476#endif
477 } 477 }
478 478
@@ -609,13 +609,13 @@ int dump_fpu (struct pt_regs * regs, elf_fpregset_t * fpregs)
609 return 1; 609 return 1;
610 } 610 }
611#ifdef CONFIG_SMP 611#ifdef CONFIG_SMP
612 if (current_thread_info()->flags & _TIF_USEDFPU) { 612 if (test_thread_flag(TIF_USEDFPU)) {
613 put_psr(get_psr() | PSR_EF); 613 put_psr(get_psr() | PSR_EF);
614 fpsave(&current->thread.float_regs[0], &current->thread.fsr, 614 fpsave(&current->thread.float_regs[0], &current->thread.fsr,
615 &current->thread.fpqueue[0], &current->thread.fpqdepth); 615 &current->thread.fpqueue[0], &current->thread.fpqdepth);
616 if (regs != NULL) { 616 if (regs != NULL) {
617 regs->psr &= ~(PSR_EF); 617 regs->psr &= ~(PSR_EF);
618 current_thread_info()->flags &= ~(_TIF_USEDFPU); 618 clear_thread_flag(TIF_USEDFPU);
619 } 619 }
620 } 620 }
621#else 621#else
diff --git a/arch/sparc/kernel/traps.c b/arch/sparc/kernel/traps.c
index 6a70d215fd04..527687afc1c4 100644
--- a/arch/sparc/kernel/traps.c
+++ b/arch/sparc/kernel/traps.c
@@ -259,7 +259,7 @@ void do_fpd_trap(struct pt_regs *regs, unsigned long pc, unsigned long npc,
259 } else { 259 } else {
260 fpload(&current->thread.float_regs[0], &current->thread.fsr); 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#endif 263#endif
264} 264}
265 265
@@ -290,7 +290,7 @@ void do_fpe_trap(struct pt_regs *regs, unsigned long pc, unsigned long npc,
290#ifndef CONFIG_SMP 290#ifndef CONFIG_SMP
291 if(!fpt) { 291 if(!fpt) {
292#else 292#else
293 if(!(task_thread_info(fpt)->flags & _TIF_USEDFPU)) { 293 if (!test_tsk_thread_flag(fpt, TIF_USEDFPU)) {
294#endif 294#endif
295 fpsave(&fake_regs[0], &fake_fsr, &fake_queue[0], &fake_depth); 295 fpsave(&fake_regs[0], &fake_fsr, &fake_queue[0], &fake_depth);
296 regs->psr &= ~PSR_EF; 296 regs->psr &= ~PSR_EF;
@@ -333,7 +333,7 @@ void do_fpe_trap(struct pt_regs *regs, unsigned long pc, unsigned long npc,
333 /* nope, better SIGFPE the offending process... */ 333 /* nope, better SIGFPE the offending process... */
334 334
335#ifdef CONFIG_SMP 335#ifdef CONFIG_SMP
336 task_thread_info(fpt)->flags &= ~_TIF_USEDFPU; 336 clear_tsk_thread_flag(fpt, TIF_USEDFPU);
337#endif 337#endif
338 if(psr & PSR_PS) { 338 if(psr & PSR_PS) {
339 /* The first fsr store/load we tried trapped, 339 /* The first fsr store/load we tried trapped,
diff --git a/arch/sparc64/kernel/process.c b/arch/sparc64/kernel/process.c
index 7d75cd4eb297..b291060c25a6 100644
--- a/arch/sparc64/kernel/process.c
+++ b/arch/sparc64/kernel/process.c
@@ -413,8 +413,13 @@ void flush_thread(void)
413 struct thread_info *t = current_thread_info(); 413 struct thread_info *t = current_thread_info();
414 struct mm_struct *mm; 414 struct mm_struct *mm;
415 415
416 if (t->flags & _TIF_ABI_PENDING) 416 if (test_ti_thread_flag(t, TIF_ABI_PENDING)) {
417 t->flags ^= (_TIF_ABI_PENDING | _TIF_32BIT); 417 clear_ti_thread_flag(t, TIF_ABI_PENDING);
418 if (test_ti_thread_flag(t, TIF_32BIT))
419 clear_ti_thread_flag(t, TIF_32BIT);
420 else
421 set_ti_thread_flag(t, TIF_32BIT);
422 }
418 423
419 mm = t->task->mm; 424 mm = t->task->mm;
420 if (mm) 425 if (mm)