Signed-off-by: Philippe Gerum <r...@xenomai.org>
---
 arch/blackfin/include/asm/mmu_context.h |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/arch/blackfin/include/asm/mmu_context.h 
b/arch/blackfin/include/asm/mmu_context.h
index ae87c45..ae8ef4f 100644
--- a/arch/blackfin/include/asm/mmu_context.h
+++ b/arch/blackfin/include/asm/mmu_context.h
@@ -95,14 +95,22 @@ static inline void __switch_mm(struct mm_struct *prev_mm, 
struct mm_struct *next
 #endif
 }
 
+#ifdef CONFIG_IPIPE
+#define lock_mm_switch(flags)  local_irq_save_hw_cond(flags)
+#define unlock_mm_switch(flags)        local_irq_restore_hw_cond(flags)
+#else
+#define lock_mm_switch(flags)  do { (void)(flags); } while (0)
+#define unlock_mm_switch(flags)        do { (void)(flags); } while (0)
+#endif /* CONFIG_IPIPE */
+
 #ifdef CONFIG_MPU
 static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
                             struct task_struct *tsk)
 {
        unsigned long flags;
-       local_irq_save_hw_cond(flags);
+       lock_mm_switch(flags);
        __switch_mm(prev, next, tsk);
-       local_irq_restore_hw_cond(flags);
+       unlock_mm_switch(flags);
 }
 
 static inline void protect_page(struct mm_struct *mm, unsigned long addr,
-- 
1.6.3.3

_______________________________________________
Uclinux-dist-devel mailing list
Uclinux-dist-devel@blackfin.uclinux.org
https://blackfin.uclinux.org/mailman/listinfo/uclinux-dist-devel

Reply via email to