aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/vfp
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-03-01 12:15:15 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-03-01 12:15:15 -0500
commitac0f6f927db539e03e1f3f61bcd4ed57d5cde7a9 (patch)
tree816e5ac643b15c2050c64a7075f0f7e13d86ea09 /arch/arm/vfp
parentb1bf9368407ae7e89d8a005bb40beb70a41df539 (diff)
parent9f33be2c3a80bdc2cc08342dd77fac87652e0548 (diff)
Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm: (100 commits) ARM: Eliminate decompressor -Dstatic= PIC hack ARM: 5958/1: ARM: U300: fix inverted clk round rate ARM: 5956/1: misplaced parentheses ARM: 5955/1: ep93xx: move timer defines into core.c and document ARM: 5954/1: ep93xx: move gpio interrupt support to gpio.c ARM: 5953/1: ep93xx: fix broken build of clock.c ARM: 5952/1: ARM: MM: Add ARM_L1_CACHE_SHIFT_6 for handle inside each ARCH Kconfig ARM: 5949/1: NUC900 add gpio virtual memory map ARM: 5948/1: Enable timer0 to time4 clock support for nuc910 ARM: 5940/2: ARM: MMCI: remove custom DBG macro and printk ARM: make_coherent(): fix problems with highpte, part 2 MM: Pass a PTE pointer to update_mmu_cache() rather than the PTE itself ARM: 5945/1: ep93xx: include correct irq.h in core.c ARM: 5933/1: amba-pl011: support hardware flow control ARM: 5930/1: Add PKMAP area description to memory.txt. ARM: 5929/1: Add checks to detect overlap of memory regions. ARM: 5928/1: Change type of VMALLOC_END to unsigned long. ARM: 5927/1: Make delimiters of DMA area globally visibly. ARM: 5926/1: Add "Virtual kernel memory..." printout. ARM: 5920/1: OMAP4: Enable L2 Cache ... Fix up trivial conflict in arch/arm/mach-mx25/clock.c
Diffstat (limited to 'arch/arm/vfp')
-rw-r--r--arch/arm/vfp/vfpmodule.c55
1 files changed, 36 insertions, 19 deletions
diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
index a63c4be99b36..7f3f59fcaa21 100644
--- a/arch/arm/vfp/vfpmodule.c
+++ b/arch/arm/vfp/vfpmodule.c
@@ -433,7 +433,11 @@ static inline void vfp_pm_init(void) { }
433 * saved one. This function is used by the ptrace mechanism. 433 * saved one. This function is used by the ptrace mechanism.
434 */ 434 */
435#ifdef CONFIG_SMP 435#ifdef CONFIG_SMP
436void vfp_sync_state(struct thread_info *thread) 436void vfp_sync_hwstate(struct thread_info *thread)
437{
438}
439
440void vfp_flush_hwstate(struct thread_info *thread)
437{ 441{
438 /* 442 /*
439 * On SMP systems, the VFP state is automatically saved at every 443 * On SMP systems, the VFP state is automatically saved at every
@@ -444,35 +448,48 @@ void vfp_sync_state(struct thread_info *thread)
444 thread->vfpstate.hard.cpu = NR_CPUS; 448 thread->vfpstate.hard.cpu = NR_CPUS;
445} 449}
446#else 450#else
447void vfp_sync_state(struct thread_info *thread) 451void vfp_sync_hwstate(struct thread_info *thread)
448{ 452{
449 unsigned int cpu = get_cpu(); 453 unsigned int cpu = get_cpu();
450 u32 fpexc = fmrx(FPEXC);
451 454
452 /* 455 /*
453 * If VFP is enabled, the previous state was already saved and 456 * If the thread we're interested in is the current owner of the
454 * last_VFP_context updated. 457 * hardware VFP state, then we need to save its state.
455 */ 458 */
456 if (fpexc & FPEXC_EN) 459 if (last_VFP_context[cpu] == &thread->vfpstate) {
457 goto out; 460 u32 fpexc = fmrx(FPEXC);
458 461
459 if (!last_VFP_context[cpu]) 462 /*
460 goto out; 463 * Save the last VFP state on this CPU.
464 */
465 fmxr(FPEXC, fpexc | FPEXC_EN);
466 vfp_save_state(&thread->vfpstate, fpexc | FPEXC_EN);
467 fmxr(FPEXC, fpexc);
468 }
461 469
462 /* 470 put_cpu();
463 * Save the last VFP state on this CPU. 471}
464 */ 472
465 fmxr(FPEXC, fpexc | FPEXC_EN); 473void vfp_flush_hwstate(struct thread_info *thread)
466 vfp_save_state(last_VFP_context[cpu], fpexc); 474{
467 fmxr(FPEXC, fpexc); 475 unsigned int cpu = get_cpu();
468 476
469 /* 477 /*
470 * Set the context to NULL to force a reload the next time the thread 478 * If the thread we're interested in is the current owner of the
471 * uses the VFP. 479 * hardware VFP state, then we need to save its state.
472 */ 480 */
473 last_VFP_context[cpu] = NULL; 481 if (last_VFP_context[cpu] == &thread->vfpstate) {
482 u32 fpexc = fmrx(FPEXC);
483
484 fmxr(FPEXC, fpexc & ~FPEXC_EN);
485
486 /*
487 * Set the context to NULL to force a reload the next time
488 * the thread uses the VFP.
489 */
490 last_VFP_context[cpu] = NULL;
491 }
474 492
475out:
476 put_cpu(); 493 put_cpu();
477} 494}
478#endif 495#endif