Module: xenomai-head Branch: master Commit: b12eaf7ab6f7fa364e06173b4bd67177cb6e1cc7 URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=b12eaf7ab6f7fa364e06173b4bd67177cb6e1cc7
Author: Gilles Chanteperdrix <[email protected]> Date: Wed May 25 21:18:49 2011 +0200 arm: install handler for timer IPI --- include/asm-arm/bits/timer.h | 8 ++++++-- include/asm-arm/hal.h | 4 ++++ ksrc/arch/arm/hal.c | 11 +++++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/include/asm-arm/bits/timer.h b/include/asm-arm/bits/timer.h index 6c25ec4..ba8c8f8 100644 --- a/include/asm-arm/bits/timer.h +++ b/include/asm-arm/bits/timer.h @@ -33,13 +33,17 @@ extern rthal_u32frac_t rthal_tsc_to_timer; static inline void xnarch_program_timer_shot(unsigned long delay) { - rthal_timer_program_shot(rthal_nodiv_imuldiv_ceil(delay, - rthal_tsc_to_timer)); + rthal_timer_program_shot( + rthal_nodiv_imuldiv_ceil(delay, rthal_tsc_to_timer)); } static inline int xnarch_send_timer_ipi(xnarch_cpumask_t mask) { +#ifdef CONFIG_SMP + return rthal_send_ipi(RTHAL_TIMER_IPI, mask); +#else /* !CONFIG_SMP */ return 0; +#endif /* !CONFIG_SMP */ } #endif /* !_XENO_ASM_ARM_BITS_TIMER_H */ diff --git a/include/asm-arm/hal.h b/include/asm-arm/hal.h index 4d782f4..e9c1efe 100644 --- a/include/asm-arm/hal.h +++ b/include/asm-arm/hal.h @@ -137,6 +137,10 @@ static inline __attribute_const__ unsigned long ffnz (unsigned long ul) #endif /* __IPIPE_FEATURE_SYSINFO_V2 */ #endif /* RTHAL_TIMER_IRQ */ +#ifndef RTHAL_TIMER_IPI +#define RTHAL_TIMER_IPI RTHAL_SERVICE_IPI3 +#endif /* RTHAL_TIMER_IPI */ + #ifdef __IPIPE_FEATURE_SYSINFO_V2 #define RTHAL_TSC_INFO(p) ((p)->arch_tsc) #else diff --git a/ksrc/arch/arm/hal.c b/ksrc/arch/arm/hal.c index 62791dd..31606c1 100644 --- a/ksrc/arch/arm/hal.c +++ b/ksrc/arch/arm/hal.c @@ -262,6 +262,14 @@ int rthal_timer_request( if (ret) return ret; +#ifdef CONFIG_SMP + ret = rthal_irq_request(RTHAL_TIMER_IPI, + (rthal_irq_handler_t)tick_handler, + NULL, NULL); + if (ret) + return ret; +#endif /* CONFIG_SMP */ + rthal_timer_set_oneshot(1); out: return tickval; @@ -275,6 +283,9 @@ void rthal_timer_release(int cpu) return; rthal_irq_release(RTHAL_TIMER_IRQ); +#ifdef CONFIG_SMP + rthal_irq_release(RTHAL_TIMER_IPI); +#endif /* CONFIG_SMP */ if (rthal_ktimer_saved_mode == KTIMER_MODE_PERIODIC) rthal_timer_set_periodic(); _______________________________________________ Xenomai-git mailing list [email protected] https://mail.gna.org/listinfo/xenomai-git
