Module: xenomai-jki
Branch: for-upstream
Commit: 75529dfd53ef60a82100772509a16d0230a5ce7c
URL:    
http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=75529dfd53ef60a82100772509a16d0230a5ce7c

Author: Jan Kiszka <jan.kis...@siemens.com>
Date:   Fri Aug 30 21:10:21 2013 +0200

nucleus: Forward host ticks on non-real-time CPUs

In case the per-CPU timer of a non-real-time CPU shares its IRQ with a
real-time timer, we will receive Linux-originated IRQs on that CPU as
well. Properly forward them to avoid stuck Linux timers.

Signed-off-by: Jan Kiszka <jan.kis...@siemens.com>

---

 ksrc/nucleus/intr.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/ksrc/nucleus/intr.c b/ksrc/nucleus/intr.c
index 1cb05b8..ef36036 100644
--- a/ksrc/nucleus/intr.c
+++ b/ksrc/nucleus/intr.c
@@ -94,11 +94,16 @@ void xnintr_host_tick(struct xnsched *sched) /* Interrupts 
off. */
 void xnintr_clock_handler(void)
 {
        struct xnsched *sched = xnpod_current_sched();
+       unsigned int cpu = xnsched_cpu(sched);
        xnstat_exectime_t *prev;
 
-       prev = xnstat_exectime_switch(sched,
-               &nkclock.stat[xnsched_cpu(sched)].account);
-       xnstat_counter_inc(&nkclock.stat[xnsched_cpu(sched)].hits);
+       if (!cpu_isset(cpu, xnarch_supported_cpus)) {
+               xnarch_relay_tick();
+               return;
+       }
+
+       prev = xnstat_exectime_switch(sched, &nkclock.stat[cpu].account);
+       xnstat_counter_inc(&nkclock.stat[cpu].hits);
 
        trace_mark(xn_nucleus, irq_enter, "irq %u", XNARCH_TIMER_IRQ);
        trace_mark(xn_nucleus, tbase_tick, "base %s", nktbase.name);


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

Reply via email to