Module: xenomai-2.6 Branch: master Commit: cd75fb56de7b4f78d18b13187ccc3cdcb25aa316 URL: http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=cd75fb56de7b4f78d18b13187ccc3cdcb25aa316
Author: Gilles Chanteperdrix <gilles.chanteperd...@xenomai.org> Date: Tue Jul 31 23:25:34 2012 +0200 hal: use ipipe_head_switch_mm as provided by newer I-pipe patches --- include/asm-arm/bits/pod.h | 2 +- include/asm-blackfin/bits/pod.h | 2 +- include/asm-generic/hal.h | 4 ++-- include/asm-generic/wrappers.h | 20 ++++++++++++++++++-- include/asm-nios2/bits/pod.h | 2 +- include/asm-powerpc/bits/pod.h | 2 +- include/asm-sh/bits/pod.h | 2 +- include/asm-x86/bits/pod_64.h | 2 +- 8 files changed, 26 insertions(+), 10 deletions(-) diff --git a/include/asm-arm/bits/pod.h b/include/asm-arm/bits/pod.h index 0fd9aba..53a692e 100644 --- a/include/asm-arm/bits/pod.h +++ b/include/asm-arm/bits/pod.h @@ -86,7 +86,7 @@ static inline void xnarch_switch_to(xnarchtcb_t *out_tcb, xnarchtcb_t *in_tcb) if (prev_mm != in_tcb->active_mm) { /* Switch to new user-space thread? */ if (in_tcb->active_mm) - switch_mm(prev_mm, in_tcb->active_mm, next); + wrap_switch_mm(prev_mm, in_tcb->active_mm, next); if (!next->mm) enter_lazy_tlb(prev_mm, next); } diff --git a/include/asm-blackfin/bits/pod.h b/include/asm-blackfin/bits/pod.h index 806dfa5..754a668 100644 --- a/include/asm-blackfin/bits/pod.h +++ b/include/asm-blackfin/bits/pod.h @@ -80,7 +80,7 @@ static inline void mpu_switch(struct task_struct *prev, { if (next && next != prev) { struct mm_struct *oldmm = prev->active_mm; - switch_mm(oldmm, next->active_mm, next); + wrap_switch_mm(oldmm, next->active_mm, next); } } diff --git a/include/asm-generic/hal.h b/include/asm-generic/hal.h index 9672f96..8c667d7 100644 --- a/include/asm-generic/hal.h +++ b/include/asm-generic/hal.h @@ -62,11 +62,11 @@ #define RTHAL_HRTIMER_IPI IPIPE_HRTIMER_IPI #define RTHAL_RESCHEDULE_IPI IPIPE_RESCHEDULE_IPI #define RTHAL_CRITICAL_IPI IPIPE_CRITICAL_IPI -#else +#else /* !I-pipe core */ #define RTHAL_HRTIMER_IPI IPIPE_SERVICE_IPI0 #define RTHAL_RESCHEDULE_IPI IPIPE_SERVICE_IPI1 #define RTHAL_CRITICAL_IPI IPIPE_CRITICAL_IPI -#endif +#endif /* !I-pipe core */ enum rthal_ktimer_mode { /* <!> Must follow enum clock_event_mode */ KTIMER_MODE_UNUSED = 0, diff --git a/include/asm-generic/wrappers.h b/include/asm-generic/wrappers.h index fb2a13d..0a5f528 100644 --- a/include/asm-generic/wrappers.h +++ b/include/asm-generic/wrappers.h @@ -424,8 +424,24 @@ static inline void *kzalloc(size_t size, int flags) #define pgprot_noncached(p) (p) #endif /* !pgprot_noncached */ -#define wrap_switch_mm(prev,next,task) \ - switch_mm(prev,next,task) +#ifdef CONFIG_IPIPE_CORE +#if IPIPE_CORE_APIREV >= 2 +#define wrap_switch_mm(prev, next, tsk) \ + ipipe_head_switch_mm(prev, next, tsk) +#else /* IPIPE_CORE_APIREV < 2 */ +#define wrap_switch_mm(prev, next, tsk) \ + __switch_mm(prev, next, tsk) +#endif /* IPIPE_CORE_APIREV < 2 */ +#else /* !I-pipe core */ +#ifdef __IPIPE_FEATURE_HARDENED_SWITCHMM +#define wrap_switch_mm(prev, next, tsk) \ + __switch_mm(prev, next, tsk) +#else /* !__IPIPE_FEATURE_HARDENED_SWITCHMM */ +#define wrap_switch_mm(prev, next, tsk) \ + switch_mm(prev, next, tsk) +#endif /* !__IPIPE_FEATURE_HARDENED_SWITCHMM */ +#endif /* !I-pipe core */ + #define wrap_enter_lazy_tlb(mm,task) \ enter_lazy_tlb(mm,task) diff --git a/include/asm-nios2/bits/pod.h b/include/asm-nios2/bits/pod.h index 8eb581c..afa8c95 100644 --- a/include/asm-nios2/bits/pod.h +++ b/include/asm-nios2/bits/pod.h @@ -79,7 +79,7 @@ static inline void xnarch_switch_to(struct xnarchtcb *out_tcb, struct xnarchtcb next_mm = in_tcb->active_mm; if (next_mm && likely(prev_mm != next_mm)) - __switch_mm(prev_mm, next_mm, next); + wrap_switch_mm(prev_mm, next_mm, next); rthal_thread_switch(out_tcb->tsp, in_tcb->tsp, next == NULL); barrier(); diff --git a/include/asm-powerpc/bits/pod.h b/include/asm-powerpc/bits/pod.h index e80fea6..47ca8e1 100644 --- a/include/asm-powerpc/bits/pod.h +++ b/include/asm-powerpc/bits/pod.h @@ -125,7 +125,7 @@ static inline void xnarch_switch_to(xnarchtcb_t *out_tcb, #ifdef __IPIPE_FEATURE_HARDENED_SWITCHMM if (next_mm && likely(prev_mm != next_mm)) - __switch_mm(prev_mm, next_mm, next); + wrap_switch_mm(prev_mm, next_mm, next); #else /* !__IPIPE_FEATURE_HARDENED_SWITCHMM */ if (likely(prev_mm != next_mm)) { #ifdef CONFIG_ALTIVEC diff --git a/include/asm-sh/bits/pod.h b/include/asm-sh/bits/pod.h index b77fa7a..085ed89 100644 --- a/include/asm-sh/bits/pod.h +++ b/include/asm-sh/bits/pod.h @@ -80,7 +80,7 @@ static inline void xnarch_switch_to(xnarchtcb_t *out_tcb, next_mm = in_tcb->active_mm; if (next_mm && likely(prev_mm != next_mm)) - __switch_mm(prev_mm, next_mm, next); + wrap_switch_mm(prev_mm, next_mm, next); xnarch_switch_threads(out_tcb, in_tcb, prev, next); } diff --git a/include/asm-x86/bits/pod_64.h b/include/asm-x86/bits/pod_64.h index 5ee7022..d67097c 100644 --- a/include/asm-x86/bits/pod_64.h +++ b/include/asm-x86/bits/pod_64.h @@ -86,7 +86,7 @@ static inline void xnarch_switch_to(xnarchtcb_t *out_tcb, xnarchtcb_t *in_tcb) if (next && next != prev) { struct mm_struct *oldmm = prev->active_mm; - switch_mm(oldmm, next->active_mm, next); + wrap_switch_mm(oldmm, next->active_mm, next); if (next->mm == NULL) enter_lazy_tlb(oldmm, next); } _______________________________________________ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git