Module: xenomai-head Branch: master Commit: b3c6f100200d192f6ca5eee5bc8854b222af0c1f URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=b3c6f100200d192f6ca5eee5bc8854b222af0c1f
Author: Philippe Gerum <r...@xenomai.org> Date: Wed Jun 17 10:55:09 2009 +0200 powerpc: make thread_info reference depend on CONFIG_IPIPE_UNMASKED_CONTEXT_SWITCH --- include/asm-powerpc/bits/pod.h | 6 +++++- include/asm-powerpc/bits/sched.h | 2 ++ include/asm-powerpc/bits/shadow.h | 2 ++ include/asm-powerpc/bits/thread.h | 2 ++ include/asm-powerpc/system.h | 4 +++- 5 files changed, 14 insertions(+), 2 deletions(-) diff --git a/include/asm-powerpc/bits/pod.h b/include/asm-powerpc/bits/pod.h index 6baf881..145fd4f 100644 --- a/include/asm-powerpc/bits/pod.h +++ b/include/asm-powerpc/bits/pod.h @@ -47,7 +47,9 @@ static inline void xnarch_leave_root(xnarchtcb_t * rootcb) rootcb->user_task = rootcb->active_task = current; rootcb->tsp = ¤t->thread; rootcb->mm = rootcb->active_mm = rthal_get_active_mm(); +#ifdef CONFIG_IPIPE_UNMASKED_CONTEXT_SWITCH rootcb->tip = task_thread_info(current); +#endif #ifdef CONFIG_XENO_HW_FPU rootcb->user_fpu_owner = rthal_get_fpu_owner(rootcb->user_task); /* So that xnarch_save_fpu() will operate on the right FPU area. */ @@ -104,7 +106,7 @@ static inline void xnarch_switch_to(xnarchtcb_t *out_tcb, } rthal_thread_switch(out_tcb->tsp, in_tcb->tsp, next == NULL); #else /* PPC32 */ - if (likely(next_mm)) { + if (likely(next_mm != NULL)) { next->thread.pgdir = next_mm->pgd; #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29) get_mmu_context(next_mm); @@ -134,7 +136,9 @@ static inline void xnarch_init_root_tcb(xnarchtcb_t *tcb, tcb->tsp = &tcb->ts; tcb->mm = current->mm; tcb->active_mm = NULL; +#ifdef CONFIG_IPIPE_UNMASKED_CONTEXT_SWITCH tcb->tip = &tcb->ti; +#endif #ifdef CONFIG_XENO_HW_FPU tcb->user_fpu_owner = NULL; tcb->fpup = NULL; diff --git a/include/asm-powerpc/bits/sched.h b/include/asm-powerpc/bits/sched.h index 262f03b..3f9f09c 100644 --- a/include/asm-powerpc/bits/sched.h +++ b/include/asm-powerpc/bits/sched.h @@ -29,7 +29,9 @@ static inline void xnarch_init_root_tcb(xnarchtcb_t *tcb, tcb->tsp = &tcb->ts; tcb->mm = current->mm; tcb->active_mm = NULL; +#ifdef CONFIG_IPIPE_UNMASKED_CONTEXT_SWITCH tcb->tip = &tcb->ti; +#endif #ifdef CONFIG_XENO_HW_FPU tcb->user_fpu_owner = NULL; tcb->fpup = NULL; diff --git a/include/asm-powerpc/bits/shadow.h b/include/asm-powerpc/bits/shadow.h index 1117e2d..baf702b 100644 --- a/include/asm-powerpc/bits/shadow.h +++ b/include/asm-powerpc/bits/shadow.h @@ -38,7 +38,9 @@ static inline void xnarch_init_shadow_tcb(xnarchtcb_t * tcb, tcb->tsp = &task->thread; tcb->mm = task->mm; tcb->active_mm = NULL; +#ifdef CONFIG_IPIPE_UNMASKED_CONTEXT_SWITCH tcb->tip = task_thread_info(task); +#endif #ifdef CONFIG_XENO_HW_FPU tcb->user_fpu_owner = task; tcb->fpup = (rthal_fpenv_t *) & task->thread.fpr[0]; diff --git a/include/asm-powerpc/bits/thread.h b/include/asm-powerpc/bits/thread.h index a33fa53..65ff73b 100644 --- a/include/asm-powerpc/bits/thread.h +++ b/include/asm-powerpc/bits/thread.h @@ -34,7 +34,9 @@ static inline void xnarch_init_tcb(xnarchtcb_t * tcb) tcb->tsp = &tcb->ts; tcb->mm = NULL; tcb->active_mm = NULL; +#ifdef CONFIG_IPIPE_UNMASKED_CONTEXT_SWITCH tcb->tip = &tcb->ti; +#endif /* Note: .pgdir(ppc32) == NULL for a Xenomai kthread. */ memset(&tcb->ts, 0, sizeof(tcb->ts)); #ifdef CONFIG_XENO_HW_FPU diff --git a/include/asm-powerpc/system.h b/include/asm-powerpc/system.h index bb01d38..04e0943 100644 --- a/include/asm-powerpc/system.h +++ b/include/asm-powerpc/system.h @@ -51,11 +51,13 @@ typedef struct xnarchtcb { /* Per-thread arch-dependent block */ struct thread_struct *tsp; /* Pointer to the active thread struct (&ts or &user->thread). */ struct mm_struct *mm; struct mm_struct *active_mm; - struct thread_info *tip; /* Pointer to the active thread info (ti or user->thread_info). */ /* Kernel mode side */ struct thread_struct ts; /* Holds kernel-based thread context. */ +#ifdef CONFIG_IPIPE_UNMASKED_CONTEXT_SWITCH + struct thread_info *tip; /* Pointer to the active thread info (ti or user->thread_info). */ struct thread_info ti; /* Holds kernel-based thread info */ +#endif #ifdef CONFIG_XENO_HW_FPU /* We only care for basic FPU handling in kernel-space; Altivec and SPE are not available to kernel-based nucleus threads. */ _______________________________________________ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git