As LOCAL_TIMER_VECTOR != RTHAL_APIC_TIMER_VECTOR (Philippe, what was the motivation for this?), we need to update __ipipe_tick_irq when we reprogram the APIC. Otherwise, I-pipe will not be able to capture and forward the related IRQ registers.
At this chance, refactor some references to Xenomai's own APIC timer IRQ. Merry Christmas and all the best for 2008 to everyone! Jan
Index: xenomai/ksrc/arch/x86/hal-common.c
===================================================================
--- xenomai/ksrc/arch/x86/hal-common.c (Revision 3301)
+++ xenomai/ksrc/arch/x86/hal-common.c (Arbeitskopie)
@@ -54,7 +54,7 @@
case RTHAL_SET_ONESHOT_LINUX:
rthal_setup_oneshot_apic(LOCAL_TIMER_VECTOR);
/* We need to keep the timing cycle alive for the kernel. */
- rthal_trigger_irq(ipipe_apic_vector_irq(LOCAL_TIMER_VECTOR));
+ rthal_trigger_irq(RTHAL_HOST_TICK_IRQ);
break;
case RTHAL_SET_PERIODIC:
@@ -71,11 +71,14 @@
if (rt_mode) {
rthal_sync_op = RTHAL_SET_ONESHOT_XENOMAI;
rthal_setup_oneshot_apic(RTHAL_APIC_TIMER_VECTOR);
+ if (rthal_ktimer_saved_mode != KTIMER_MODE_UNUSED)
+ __ipipe_tick_irq = RTHAL_TIMER_IRQ;
} else {
rthal_sync_op = RTHAL_SET_ONESHOT_LINUX;
rthal_setup_oneshot_apic(LOCAL_TIMER_VECTOR);
+ __ipipe_tick_irq = RTHAL_HOST_TICK_IRQ;
/* We need to keep the timing cycle alive for the kernel. */
- rthal_trigger_irq(ipipe_apic_vector_irq(LOCAL_TIMER_VECTOR));
+ rthal_trigger_irq(RTHAL_HOST_TICK_IRQ);
}
rthal_critical_exit(flags);
}
@@ -87,6 +90,7 @@
flags = rthal_critical_enter(&rthal_critical_sync);
rthal_sync_op = RTHAL_SET_PERIODIC;
rthal_setup_periodic_apic(RTHAL_APIC_ICOUNT, LOCAL_TIMER_VECTOR);
+ __ipipe_tick_irq = RTHAL_HOST_TICK_IRQ;
rthal_critical_exit(flags);
}
@@ -112,7 +116,7 @@
#ifdef CONFIG_SMP
send_IPI_all(LOCAL_TIMER_VECTOR);
#else
- rthal_trigger_irq(ipipe_apic_vector_irq(LOCAL_TIMER_VECTOR));
+ rthal_trigger_irq(RTHAL_HOST_TICK_IRQ);
#endif
return IRQ_HANDLED;
}
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Xenomai-core mailing list [email protected] https://mail.gna.org/listinfo/xenomai-core
