Module: xenomai-forge
Branch: next
Commit: 6c4afa5bc3990b7d842451c3894fc50d23771b76
URL:    
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=6c4afa5bc3990b7d842451c3894fc50d23771b76

Author: Gilles Chanteperdrix <gilles.chanteperd...@xenomai.org>
Date:   Sun Oct 27 12:18:06 2013 +0100

cobalt: allow architectures to track thread_info

Even without unlocked context switches

---

 kernel/cobalt/arch/arm/Kconfig                     |    3 +++
 kernel/cobalt/arch/powerpc/Kconfig                 |    4 ++++
 kernel/cobalt/include/asm-generic/xenomai/thread.h |    3 +--
 kernel/cobalt/sched.c                              |    2 +-
 kernel/cobalt/thread.c                             |    6 +++---
 5 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/kernel/cobalt/arch/arm/Kconfig b/kernel/cobalt/arch/arm/Kconfig
index 0feab1f..001ed1d 100644
--- a/kernel/cobalt/arch/arm/Kconfig
+++ b/kernel/cobalt/arch/arm/Kconfig
@@ -8,6 +8,9 @@ config IPIPE_WANT_PREEMPTIBLE_SWITCH
 config IPIPE_WANT_ACTIVE_MM
        def_bool y
 
+config XENO_HW_WANT_TIP
+       def_bool y
+
 config XENO_HW_FPU
        bool "FPU support"
        default y
diff --git a/kernel/cobalt/arch/powerpc/Kconfig 
b/kernel/cobalt/arch/powerpc/Kconfig
index 680f38b..d0cc003 100644
--- a/kernel/cobalt/arch/powerpc/Kconfig
+++ b/kernel/cobalt/arch/powerpc/Kconfig
@@ -13,6 +13,9 @@ config IPIPE_WANT_PREEMPTIBLE_SWITCH
        default y if XENO_HW_UNLOCKED_SWITCH
        default n if !XENO_HW_UNLOCKED_SWITCH
 
+config XENO_HW_WANT_TIP
+       bool
+
 config XENO_HW_FPU
        bool "FPU support"
        depends on PPC_FPU
@@ -29,6 +32,7 @@ config XENO_HW_FPU
 config XENO_HW_UNLOCKED_SWITCH
        bool "Unlocked context switch"
        depends on IPIPE_HAVE_PREEMPTIBLE_SWITCH
+       select XENO_HW_WANT_TIP
        default y
        help
 
diff --git a/kernel/cobalt/include/asm-generic/xenomai/thread.h 
b/kernel/cobalt/include/asm-generic/xenomai/thread.h
index e1c1e8b..1734bd3 100644
--- a/kernel/cobalt/include/asm-generic/xenomai/thread.h
+++ b/kernel/cobalt/include/asm-generic/xenomai/thread.h
@@ -34,9 +34,8 @@ struct xntcb {
        struct mm_struct *mm;
        struct mm_struct *active_mm;
        struct thread_struct ts;
-#ifdef CONFIG_XENO_HW_UNLOCKED_SWITCH
+#ifdef CONFIG_XENO_HW_WANT_TIP
        struct thread_info *tip;
-       struct thread_info ti;
 #endif
 #ifdef CONFIG_XENO_HW_FPU
        struct task_struct *user_fpu_owner;
diff --git a/kernel/cobalt/sched.c b/kernel/cobalt/sched.c
index 2e11826..a7051c9 100644
--- a/kernel/cobalt/sched.c
+++ b/kernel/cobalt/sched.c
@@ -743,7 +743,7 @@ static inline void leave_root(struct xnthread *root)
        rootcb->core.host_task = p;
        rootcb->core.tsp = &p->thread;
        rootcb->core.mm = rootcb->core.active_mm = ipipe_get_active_mm();
-#ifdef CONFIG_XENO_HW_UNLOCKED_SWITCH
+#ifdef CONFIG_XENO_HW_WANT_TIP
        rootcb->core.tip = task_thread_info(p);
 #endif
        xnarch_leave_root(rootcb);
diff --git a/kernel/cobalt/thread.c b/kernel/cobalt/thread.c
index c5825ef..dbac21c 100644
--- a/kernel/cobalt/thread.c
+++ b/kernel/cobalt/thread.c
@@ -219,7 +219,7 @@ void xnthread_init_shadow_tcb(struct xnthread *thread, 
struct task_struct *task)
        tcb->core.tsp = &task->thread;
        tcb->core.mm = task->mm;
        tcb->core.active_mm = task->mm;
-#ifdef CONFIG_XENO_HW_UNLOCKED_SWITCH
+#ifdef CONFIG_XENO_HW_WANT_TIP
        tcb->core.tip = task_thread_info(task);
 #endif
 #ifdef CONFIG_XENO_HW_FPU
@@ -236,8 +236,8 @@ void xnthread_init_root_tcb(struct xnthread *thread)
        tcb->core.host_task = current;
        tcb->core.tsp = &tcb->core.ts;
        tcb->core.mm = current->mm;
-#ifdef CONFIG_XENO_HW_UNLOCKED_SWITCH
-       tcb->core.tip = &tcb->core.ti;
+#ifdef CONFIG_XENO_HW_WANT_TIP
+       tcb->core.tip = NULL;
 #endif
        xnarch_init_root_tcb(tcb);
 }


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git

Reply via email to