Xenomai 2.1: Add SMP timer support for powerpc
PATCH 1/1 Xenomai 2.1: Add SMP timer support for powerpc
Add SMP timer support code for the powerpc arch in Xenomai 2.1. Still a bit rough, but I'll clean it up as I go. Compiled and tested on G5 UP, SMP (I-pipe 2.6.14 0.9-02) and G4 UP (I-pipe 2.6.14 1.0-07). Doesn't seem to break anything. On a G5, SMP seems to bring a 2-3usec latency penalty.
-- Heikki Lindholm
include/asm-powerpc/hal.h +5 -1
@@ -138,6 +138,10 @@#define RTHAL_TIMER_IRQ ADEOS_TIMER_VIRQ#else /* !CONFIG_ADEOS_CORE */ #define RTHAL_TIMER_IRQ IPIPE_TIMER_VIRQ +#ifdef CONFIG_SMP +#define RTHAL_TIMER_IPI IPIPE_SERVICE_IPI3 +#define RTHAL_HOST_TIMER_IPI IPIPE_SERVICE_IPI4 +#endif /* CONFIG_SMP */ #endif /* CONFIG_ADEOS_CORE */ #define rthal_irq_descp (irq) (&irq_desc[(irq)])
@@ -204,7 +208,7 @@#ifdef CONFIG_40xmtspr (SPRN_PIT ,delay);#else /* !CONFIG_40x */ -set_dec (delay); +set_dec ((int )delay);/* decrementer is only 32-bits */ #endif /* CONFIG_40x */ }
include/asm-powerpc/system.h +7 -5
@@ -581,12 +581,11 @@ }static inline int xnarch_send_timer_ipi (xnarch_cpumask_t mask) - {#ifdef CONFIG_SMP -return -1 ;/* FIXME */ +return rthal_send_ipi (RTHAL_TIMER_IPI , mask);#else /* ! CONFIG_SMP */ -return 0 ; +return 0 ;#endif /* CONFIG_SMP */ }
@@ -595,9 +594,12 @@#ifdef XENO_INTR_MODULE static inline void xnarch_relay_tick (void ) - { -rthal_irq_host_pend (RTHAL_TIMER_IRQ ); +#ifdef CONFIG_SMP +rthal_send_ipi (RTHAL_HOST_TIMER_IPI , cpu_online_map); +#else /* !CONFIG_SMP */ +rthal_irq_host_pend (RTHAL_TIMER_IRQ ); +#endif /* CONFIG_SMP */ }static inline void xnarch_announce_tick (void )
ksrc/arch/powerpc/hal.c +197 -43
278 lines not on this page · raw message
Philippe Gerum
AppliedQuoted 2 lines · Heikki Lindholm
Add SMP timer support code for the powerpc arch in Xenomai 2.1. Still a bit rough, but I'll clean it up as I go. Compiled and tested on G5 UP, SMP (I-pipe 2.6.14 0.9-02) and G4 UP (I-pipe 2.6.14 1.0-07). Doesn't seem to break anything. On a G5, SMP seems to bring a 2-3usec latency penalty.
Applied, thanks.
Signature · 1 line
Philippe.