]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - arch/powerpc/include/asm/mmu_context.h
powerpc: Add Initiate Coprocessor Store Word (icswx) support
[mirror_ubuntu-zesty-kernel.git] / arch / powerpc / include / asm / mmu_context.h
index 8e13f65b498ce53b188d2d5cdde05211795452ed..a73668a5f30d339a5b0513ac234536d1206caaa7 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
         */