Module: xenomai-forge
Branch: master
Commit: 37ca257af466e7e5fbfb402b39f088487d048fd5
URL:    
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=37ca257af466e7e5fbfb402b39f088487d048fd5

Author: Gilles Chanteperdrix <gilles.chanteperd...@xenomai.org>
Date:   Sun Apr  1 20:19:02 2012 +0200

nucleus: allow timer to use different irqs on different cpus

---

 include/asm-generic/hal.h    |    5 +++++
 include/asm-generic/system.h |    1 +
 kernel/cobalt/nucleus/intr.c |   17 +++++++++++------
 3 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/include/asm-generic/hal.h b/include/asm-generic/hal.h
index 5a55444..7662d06 100644
--- a/include/asm-generic/hal.h
+++ b/include/asm-generic/hal.h
@@ -66,6 +66,11 @@ extern struct rthal_archdata rthal_archdata;
 
 #define RTHAL_TIMER_FREQ       (rthal_archdata.timer_freq)
 #define RTHAL_CLOCK_FREQ       (rthal_archdata.clock_freq)
+#ifdef CONFIG_IPIPE_CORE
+#define RTHAL_PERCPU_TIMER_IRQ(cpu) per_cpu(ipipe_percpu.hrtimer_irq, cpu)
+#else /* !CONFIG_IPIPE_CORE */
+#define RTHAL_PERCPU_TIMER_IRQ(cpu) RTHAL_TIMER_IRQ
+#endif /* !CONFIG_IPIPE_CORE */
 
 #include <asm-generic/xenomai/ipipe/wrappers.h>
 
diff --git a/include/asm-generic/system.h b/include/asm-generic/system.h
index b6ff6ca..4af9f39 100644
--- a/include/asm-generic/system.h
+++ b/include/asm-generic/system.h
@@ -165,6 +165,7 @@ static inline int xnlock_dbg_release(struct xnlock *lock)
 #define XNARCH_TIMER_IRQ               RTHAL_TIMER_IRQ
 #define XNARCH_TIMER_DEVICE            RTHAL_TIMER_DEVICE
 #define XNARCH_CLOCK_DEVICE            RTHAL_CLOCK_DEVICE
+#define XNARCH_PERCPU_TIMER_IRQ(cpu)   RTHAL_PERCPU_TIMER_IRQ(cpu)
 
 #define XNARCH_PROMPT "Xenomai: "
 #define xnarch_loginfo(fmt, args...)   printk(KERN_INFO XNARCH_PROMPT fmt, 
##args)
diff --git a/kernel/cobalt/nucleus/intr.c b/kernel/cobalt/nucleus/intr.c
index aa02040..ffbd2a5 100644
--- a/kernel/cobalt/nucleus/intr.c
+++ b/kernel/cobalt/nucleus/intr.c
@@ -970,14 +970,19 @@ static inline int format_irq_proc(unsigned int irq,
 {
        struct xnintr *intr;
        spl_t s;
+       int cpu;
 
-       if (irq == XNARCH_TIMER_IRQ) {
-               xnvfile_puts(it, "         [timer]");
-               return 0;
-       }
+       for_each_online_cpu(cpu)
+               if (irq == XNARCH_PERCPU_TIMER_IRQ(cpu)) {
+                       xnvfile_printf(it, "         [timer%d]", cpu);
+                       return 0;
+               }
 
        switch (irq) {
 #ifdef CONFIG_SMP
+       case IPIPE_HRTIMER_IPI:
+               xnvfile_puts(it, "         [timer-ipi]");
+               return 0;
        case IPIPE_RESCHEDULE_IPI:
                xnvfile_puts(it, "         [reschedule]");
                return 0;
@@ -1017,7 +1022,7 @@ static int irq_vfile_show(struct xnvfile_regular_iterator 
*it,
 
        /* FIXME: We assume the entire output fits in a single page. */
 
-       xnvfile_puts(it, "IRQ ");
+       xnvfile_puts(it, "  IRQ ");
 
        for_each_online_cpu(cpu)
                xnvfile_printf(it, "        CPU%d", cpu);
@@ -1026,7 +1031,7 @@ static int irq_vfile_show(struct xnvfile_regular_iterator 
*it,
                if (__ipipe_irq_handler(&rthal_archdata.domain, irq) == NULL)
                        continue;
 
-               xnvfile_printf(it, "\n%3d:", irq);
+               xnvfile_printf(it, "\n%5d:", irq);
 
                for_each_online_cpu(cpu) {
                        xnvfile_printf(it, "%12lu",


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

Reply via email to