Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab...
[pandora-kernel.git] / arch / powerpc / include / asm / mmu_context.h
index 81fb412..a73668a 100644 (file)
@@ -32,6 +32,10 @@ extern void __destroy_context(unsigned long context_id);
 extern void mmu_context_init(void);
 #endif
 
+extern void switch_cop(struct mm_struct *next);
+extern int use_cop(unsigned long acop, struct mm_struct *mm);
+extern void drop_cop(unsigned long acop, struct mm_struct *mm);
+
 /*
  * switch_mm is the entry point called from the architecture independent
  * code in kernel/sched.c
@@ -55,6 +59,12 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
        if (prev == next)
                return;
 
+#ifdef CONFIG_PPC_ICSWX
+       /* Switch coprocessor context only if prev or next uses a coprocessor */
+       if (prev->context.acop || next->context.acop)
+               switch_cop(next);
+#endif /* CONFIG_PPC_ICSWX */
+
        /* We must stop all altivec streams before changing the HW
         * context
         */
@@ -67,7 +77,7 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
         * sub architectures.
         */
 #ifdef CONFIG_PPC_STD_MMU_64
-       if (cpu_has_feature(CPU_FTR_SLB))
+       if (mmu_has_feature(MMU_FTR_SLB))
                switch_slb(tsk, next);
        else
                switch_stab(tsk, next);