Module: xenomai-head
Branch: master
Commit: 58600daf4c8cfb18bdb3b3b264aacb3e87bc69f6
URL:    
http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=58600daf4c8cfb18bdb3b3b264aacb3e87bc69f6

Author: Philippe Gerum <r...@xenomai.org>
Date:   Mon Jul 20 12:21:07 2009 +0200

powerpc: align preemptible switch tunable with latest I-pipe support

Define CONFIG_IPIPE_WANT_PREEMPTIBLE_SWITCH whenever unmasked context
switching is wanted from the linux scheduler. Additionally, real-time
interrupts are allowed to preempt Xenomai context switches if
CONFIG_XENO_HW_UNLOCKED_SWITCH is enabled, which in turn depends on
CONFIG_IPIPE_HAVE_PREEMPTIBLE_SWITCH, as defined by the I-pipe
support.

Depending on whether we run,

- an older I-pipe patch that does not define
  CONFIG_IPIPE_HAVE_PREEMPTIBLE_SWITCH (i.e. < 2.6.30-2.7-00)
- an older Xenomai 2.5 release (i.e. < 2.5-rc3)

this change leads us to the following combinations:

- older I-pipe + older Xenomai => CONFIG_XENO_HW_UNLOCKED_SWITCH
  forced off.

- older I-pipe + newer Xenomai => CONFIG_XENO_HW_UNLOCKED_SWITCH
  forced off.

- newer I-pipe + older Xenomai => CONFIG_XENO_HW_UNLOCKED_SWITCH
  forced off.

- newer I-pipe + newer Xenomai => CONFIG_XENO_HW_UNLOCKED_SWITCH
  tunable, on/off.

---

 include/asm-powerpc/bits/pod.h    |    4 ++--
 include/asm-powerpc/bits/sched.h  |    2 +-
 include/asm-powerpc/bits/shadow.h |    2 +-
 include/asm-powerpc/bits/thread.h |    2 +-
 include/asm-powerpc/hal.h         |    2 +-
 include/asm-powerpc/system.h      |    2 +-
 ksrc/arch/powerpc/Kconfig         |    8 ++++----
 7 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/include/asm-powerpc/bits/pod.h b/include/asm-powerpc/bits/pod.h
index 52a0a9a..3265453 100644
--- a/include/asm-powerpc/bits/pod.h
+++ b/include/asm-powerpc/bits/pod.h
@@ -47,7 +47,7 @@ static inline void xnarch_leave_root(xnarchtcb_t * rootcb)
        rootcb->user_task = rootcb->active_task = current;
        rootcb->tsp = &current->thread;
        rootcb->mm = rootcb->active_mm = rthal_get_active_mm();
-#ifdef CONFIG_IPIPE_UNMASKED_CONTEXT_SWITCH
+#ifdef CONFIG_IPIPE_WANT_PREEMPTIBLE_SWITCH
        rootcb->tip = task_thread_info(current);
 #endif
 #ifdef CONFIG_XENO_HW_FPU
@@ -60,7 +60,7 @@ static inline void xnarch_leave_root(xnarchtcb_t * rootcb)
 
 static inline void xnarch_enter_root(xnarchtcb_t * rootcb)
 {
-#ifdef CONFIG_IPIPE_UNMASKED_CONTEXT_SWITCH
+#ifdef CONFIG_IPIPE_WANT_PREEMPTIBLE_SWITCH
        if (!rootcb->mm)
                set_ti_thread_flag(rootcb->tip, TIF_MMSWITCH_INT);
 #endif
diff --git a/include/asm-powerpc/bits/sched.h b/include/asm-powerpc/bits/sched.h
index 3f9f09c..2253d8b 100644
--- a/include/asm-powerpc/bits/sched.h
+++ b/include/asm-powerpc/bits/sched.h
@@ -29,7 +29,7 @@ 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
+#ifdef CONFIG_IPIPE_WANT_PREEMPTIBLE_SWITCH
        tcb->tip = &tcb->ti;
 #endif
 #ifdef CONFIG_XENO_HW_FPU
diff --git a/include/asm-powerpc/bits/shadow.h 
b/include/asm-powerpc/bits/shadow.h
index 349f5cb..5287544 100644
--- a/include/asm-powerpc/bits/shadow.h
+++ b/include/asm-powerpc/bits/shadow.h
@@ -38,7 +38,7 @@ 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
+#ifdef CONFIG_IPIPE_WANT_PREEMPTIBLE_SWITCH
        tcb->tip = task_thread_info(task);
 #endif
 #ifdef CONFIG_XENO_HW_FPU
diff --git a/include/asm-powerpc/bits/thread.h 
b/include/asm-powerpc/bits/thread.h
index 31bc559..4ff0d98 100644
--- a/include/asm-powerpc/bits/thread.h
+++ b/include/asm-powerpc/bits/thread.h
@@ -34,7 +34,7 @@ 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
+#ifdef CONFIG_IPIPE_WANT_PREEMPTIBLE_SWITCH
        tcb->tip = &tcb->ti;
 #endif
        /* Note: .pgdir(ppc32) == NULL for a Xenomai kthread. */
diff --git a/include/asm-powerpc/hal.h b/include/asm-powerpc/hal.h
index 6836ad9..7539636 100644
--- a/include/asm-powerpc/hal.h
+++ b/include/asm-powerpc/hal.h
@@ -105,7 +105,7 @@ static inline void rthal_timer_program_shot(unsigned long 
delay)
 
 static inline struct mm_struct *rthal_get_active_mm(void)
 {
-#ifdef CONFIG_IPIPE_UNMASKED_CONTEXT_SWITCH
+#ifdef CONFIG_IPIPE_WANT_PREEMPTIBLE_SWITCH
        return per_cpu(ipipe_active_mm, smp_processor_id());
 #else
        return current->active_mm;
diff --git a/include/asm-powerpc/system.h b/include/asm-powerpc/system.h
index ba9629c..b4a11b7 100644
--- a/include/asm-powerpc/system.h
+++ b/include/asm-powerpc/system.h
@@ -54,7 +54,7 @@ typedef struct xnarchtcb {    /* Per-thread arch-dependent 
block */
 
        /* Kernel mode side */
        struct thread_struct ts;        /* Holds kernel-based thread context. */
-#ifdef CONFIG_IPIPE_UNMASKED_CONTEXT_SWITCH
+#ifdef CONFIG_IPIPE_WANT_PREEMPTIBLE_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
diff --git a/ksrc/arch/powerpc/Kconfig b/ksrc/arch/powerpc/Kconfig
index c868239..49a12cc 100644
--- a/ksrc/arch/powerpc/Kconfig
+++ b/ksrc/arch/powerpc/Kconfig
@@ -13,10 +13,10 @@ menu "Machine"
 
 depends on XENO_OPT_NUCLEUS
 
-config XENO_HW_WANTS_UNMASKED_CONTEXT_SWITCH
+config IPIPE_WANT_PREEMPTIBLE_SWITCH
         bool
-       select IPIPE_UNMASKED_CONTEXT_SWITCH
-       default y
+       default y if XENO_HW_UNLOCKED_SWITCH
+       default n if !XENO_HW_UNLOCKED_SWITCH
 
 config XENO_HW_FPU
        bool "Enable FPU support"
@@ -33,7 +33,7 @@ config XENO_HW_FPU
 
 config XENO_HW_UNLOCKED_SWITCH
        bool "Enable unlocked context switch"
-       depends on IPIPE_UNMASKED_CONTEXT_SWITCH
+       depends on IPIPE_HAVE_PREEMPTIBLE_SWITCH
        default y
        help
 


_______________________________________________
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git

Reply via email to