diff options
Diffstat (limited to 'arch/arm/kernel/entry-armv.S')
-rw-r--r-- | arch/arm/kernel/entry-armv.S | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S index ab8e600c18c8..86c92523a346 100644 --- a/arch/arm/kernel/entry-armv.S +++ b/arch/arm/kernel/entry-armv.S | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <asm/glue.h> | 20 | #include <asm/glue.h> |
21 | #include <asm/vfpmacros.h> | 21 | #include <asm/vfpmacros.h> |
22 | #include <asm/arch/entry-macro.S> | 22 | #include <asm/arch/entry-macro.S> |
23 | #include <asm/thread_notify.h> | ||
23 | 24 | ||
24 | #include "entry-header.S" | 25 | #include "entry-header.S" |
25 | 26 | ||
@@ -560,10 +561,8 @@ ENTRY(__switch_to) | |||
560 | add ip, r1, #TI_CPU_SAVE | 561 | add ip, r1, #TI_CPU_SAVE |
561 | ldr r3, [r2, #TI_TP_VALUE] | 562 | ldr r3, [r2, #TI_TP_VALUE] |
562 | stmia ip!, {r4 - sl, fp, sp, lr} @ Store most regs on stack | 563 | stmia ip!, {r4 - sl, fp, sp, lr} @ Store most regs on stack |
563 | #ifndef CONFIG_MMU | 564 | #ifdef CONFIG_MMU |
564 | add r2, r2, #TI_CPU_DOMAIN | 565 | ldr r6, [r2, #TI_CPU_DOMAIN] |
565 | #else | ||
566 | ldr r6, [r2, #TI_CPU_DOMAIN]! | ||
567 | #endif | 566 | #endif |
568 | #if __LINUX_ARM_ARCH__ >= 6 | 567 | #if __LINUX_ARM_ARCH__ >= 6 |
569 | #ifdef CONFIG_CPU_32v6K | 568 | #ifdef CONFIG_CPU_32v6K |
@@ -585,21 +584,20 @@ ENTRY(__switch_to) | |||
585 | #ifdef CONFIG_MMU | 584 | #ifdef CONFIG_MMU |
586 | mcr p15, 0, r6, c3, c0, 0 @ Set domain register | 585 | mcr p15, 0, r6, c3, c0, 0 @ Set domain register |
587 | #endif | 586 | #endif |
588 | #ifdef CONFIG_VFP | ||
589 | @ Always disable VFP so we can lazily save/restore the old | ||
590 | @ state. This occurs in the context of the previous thread. | ||
591 | VFPFMRX r4, FPEXC | ||
592 | bic r4, r4, #FPEXC_ENABLE | ||
593 | VFPFMXR FPEXC, r4 | ||
594 | #endif | ||
595 | #if defined(CONFIG_IWMMXT) | 587 | #if defined(CONFIG_IWMMXT) |
596 | bl iwmmxt_task_switch | 588 | bl iwmmxt_task_switch |
597 | #elif defined(CONFIG_CPU_XSCALE) | 589 | #elif defined(CONFIG_CPU_XSCALE) |
598 | add r4, r2, #40 @ cpu_context_save->extra | 590 | add r4, r2, #TI_CPU_DOMAIN + 40 @ cpu_context_save->extra |
599 | ldmib r4, {r4, r5} | 591 | ldmib r4, {r4, r5} |
600 | mar acc0, r4, r5 | 592 | mar acc0, r4, r5 |
601 | #endif | 593 | #endif |
602 | ldmib r2, {r4 - sl, fp, sp, pc} @ Load all regs saved previously | 594 | mov r5, r0 |
595 | add r4, r2, #TI_CPU_SAVE | ||
596 | ldr r0, =thread_notify_head | ||
597 | mov r1, #THREAD_NOTIFY_SWITCH | ||
598 | bl atomic_notifier_call_chain | ||
599 | mov r0, r5 | ||
600 | ldmia r4, {r4 - sl, fp, sp, pc} @ Load all regs saved previously | ||
603 | 601 | ||
604 | __INIT | 602 | __INIT |
605 | 603 | ||