Module: xenomai-2.6 Branch: master Commit: 3b679a488823d347605cdc19e08c120da533dd4e URL: http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=3b679a488823d347605cdc19e08c120da533dd4e
Author: Philippe Gerum <r...@xenomai.org> Date: Tue Apr 24 15:40:28 2012 +0200 hal/powerpc: fixup for refactored timers (take #2) --- include/asm-powerpc/hal.h | 9 +++++++++ ksrc/arch/powerpc/hal.c | 18 +++--------------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/include/asm-powerpc/hal.h b/include/asm-powerpc/hal.h index 9cf6134..aea960c 100644 --- a/include/asm-powerpc/hal.h +++ b/include/asm-powerpc/hal.h @@ -31,7 +31,12 @@ #include <asm-generic/xenomai/hal.h> /* Read the generic bits. */ +#ifdef CONFIG_IPIPE_CORE +#include <linux/ipipe_tickdev.h> +#define RTHAL_TIMER_DEVICE ipipe_timer_name() +#else #define RTHAL_TIMER_DEVICE "decrementer" +#endif #define RTHAL_CLOCK_DEVICE "timebase" typedef unsigned long long rthal_time_t; @@ -84,6 +89,9 @@ static inline unsigned long long rthal_rdtsc(void) static inline void rthal_timer_program_shot(unsigned long delay) { +#ifdef CONFIG_IPIPE_CORE + ipipe_timer_set(delay); +#else /* !CONFIG_IPIPE_CORE */ if (delay < 3) rthal_schedule_irq_head(RTHAL_TIMER_IRQ); else { @@ -99,6 +107,7 @@ static inline void rthal_timer_program_shot(unsigned long delay) set_dec((int)delay); #endif /* CONFIG_40x */ } +#endif /* !CONFIG_IPIPE_CORE */ } static inline struct mm_struct *rthal_get_active_mm(void) diff --git a/ksrc/arch/powerpc/hal.c b/ksrc/arch/powerpc/hal.c index df76568..ad1b04a 100644 --- a/ksrc/arch/powerpc/hal.c +++ b/ksrc/arch/powerpc/hal.c @@ -66,11 +66,6 @@ static int cpu_timers_requested; #ifdef CONFIG_IPIPE_CORE -#define rthal_setup_oneshot_dec() do { } while (0) -#define rthal_setup_periodic_dec() do { } while (0) -#define rthal_timer_set_oneshot(rt_mode) do { } while (0) -#define rthal_timer_set_periodic() do { } while (0) - static inline int rthal_tickdev_request(void (*tick_handler)(void), void (*mode_emul)(enum clock_event_mode mode, @@ -126,8 +121,6 @@ int rthal_tickdev_request(void (*tick_handler)(void), if (ret) return ret; #endif - rthal_timer_set_oneshot(1); - return tickval; } @@ -141,14 +134,9 @@ static inline void rthal_tickdev_release(int cpu) #ifdef CONFIG_SMP rthal_irq_release(RTHAL_TIMER_IPI); #endif /* CONFIG_SMP */ - - if (rthal_ktimer_saved_mode == KTIMER_MODE_PERIODIC) - rthal_timer_set_periodic(); - else if (rthal_ktimer_saved_mode == KTIMER_MODE_ONESHOT) - rthal_timer_set_oneshot(0); } -static inline int rthal_tickdev_enum(void) +static inline int rthal_tickdev_select(void) { return ipipe_timers_request(); } @@ -332,7 +320,7 @@ static inline void rthal_tickdev_release(int cpu) rthal_timer_set_oneshot(0); } -static inline int rthal_tickdev_enum(void) +static inline int rthal_tickdev_select(void) { return 0; } @@ -559,7 +547,7 @@ int rthal_arch_init(void) } #endif /* CONFIG_ALTIVEC */ - ret = rthal_tickdev_enum(); + ret = rthal_tickdev_select(); if (ret) return ret; _______________________________________________ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git