Module: xenomai-2.5 Branch: master Commit: 957bfd6acb444b3f44a453def9401dff49f7d17f URL: http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=957bfd6acb444b3f44a453def9401dff49f7d17f
Author: Philippe Gerum <r...@xenomai.org> Date: Sun May 2 12:19:26 2010 +0200 arm: convert to I-pipe sysinfo v2 --- include/asm-arm/bits/init.h | 2 +- include/asm-arm/bits/shadow.h | 22 +++++++++++----------- include/asm-arm/bits/timer.h | 2 +- include/asm-arm/hal.h | 17 ++++++++++++++++- ksrc/arch/arm/hal.c | 2 +- 5 files changed, 30 insertions(+), 15 deletions(-) diff --git a/include/asm-arm/bits/init.h b/include/asm-arm/bits/init.h index 2fd959f..a6ecc17 100644 --- a/include/asm-arm/bits/init.h +++ b/include/asm-arm/bits/init.h @@ -82,7 +82,7 @@ static inline int xnarch_init(void) set_cpus_allowed(current, cpumask_of_cpu(0)); #endif /* CONFIG_SMP && MODULE */ - xnarch_init_timeconv(RTHAL_CPU_FREQ); + xnarch_init_timeconv(RTHAL_CLOCK_FREQ); ret = xnarch_calibrate_sched(); if (ret) diff --git a/include/asm-arm/bits/shadow.h b/include/asm-arm/bits/shadow.h index 6625d92..a396510 100644 --- a/include/asm-arm/bits/shadow.h +++ b/include/asm-arm/bits/shadow.h @@ -138,26 +138,26 @@ static inline int xnarch_local_syscall(struct pt_regs *regs) if (error) return error; - switch (ipipe_info.archdep.tsc.type) { + switch (RTHAL_TSC_INFO(&ipipe_info).type) { case IPIPE_TSC_TYPE_FREERUNNING: info.type = __XN_TSC_TYPE_FREERUNNING, - info.u.fr.counter = ipipe_info.archdep.tsc.u.fr.counter; - info.u.fr.mask = ipipe_info.archdep.tsc.u.fr.mask; - info.u.fr.tsc = ipipe_info.archdep.tsc.u.fr.tsc; + info.u.fr.counter = RTHAL_TSC_INFO(&ipipe_info).u.fr.counter; + info.u.fr.mask = RTHAL_TSC_INFO(&ipipe_info).u.fr.mask; + info.u.fr.tsc = RTHAL_TSC_INFO(&ipipe_info).u.fr.tsc; break; case IPIPE_TSC_TYPE_DECREMENTER: info.type = __XN_TSC_TYPE_DECREMENTER, - info.u.dec.counter = ipipe_info.archdep.tsc.u.dec.counter; - info.u.dec.mask = ipipe_info.archdep.tsc.u.dec.mask; - info.u.dec.last_cnt = ipipe_info.archdep.tsc.u.dec.last_cnt; - info.u.dec.tsc = ipipe_info.archdep.tsc.u.dec.tsc; + info.u.dec.counter = RTHAL_TSC_INFO(&ipipe_info).u.dec.counter; + info.u.dec.mask = RTHAL_TSC_INFO(&ipipe_info).u.dec.mask; + info.u.dec.last_cnt = RTHAL_TSC_INFO(&ipipe_info).u.dec.last_cnt; + info.u.dec.tsc = RTHAL_TSC_INFO(&ipipe_info).u.dec.tsc; break; #ifdef IPIPE_TSC_TYPE_FREERUNNING_COUNTDOWN case IPIPE_TSC_TYPE_FREERUNNING_COUNTDOWN: info.type = __XN_TSC_TYPE_FREERUNNING_COUNTDOWN, - info.u.fr.counter = ipipe_info.archdep.tsc.u.fr.counter; - info.u.fr.mask = ipipe_info.archdep.tsc.u.fr.mask; - info.u.fr.tsc = ipipe_info.archdep.tsc.u.fr.tsc; + info.u.fr.counter = RTHAL_TSC_INFO(&ipipe_info).u.fr.counter; + info.u.fr.mask = RTHAL_TSC_INFO(&ipipe_info).u.fr.mask; + info.u.fr.tsc = RTHAL_TSC_INFO(&ipipe_info).u.fr.tsc; break; #endif /* IPIPE_TSC_TYPE_FREERUNNING_COUNTDOWN */ case IPIPE_TSC_TYPE_NONE: diff --git a/include/asm-arm/bits/timer.h b/include/asm-arm/bits/timer.h index c68e268..90e9de1 100644 --- a/include/asm-arm/bits/timer.h +++ b/include/asm-arm/bits/timer.h @@ -30,7 +30,7 @@ static inline void xnarch_program_timer_shot(unsigned long delay) { rthal_timer_program_shot(rthal_imuldiv_ceil - (delay, RTHAL_TIMER_FREQ, RTHAL_CPU_FREQ)); + (delay, RTHAL_TIMER_FREQ, RTHAL_CLOCK_FREQ)); } static inline int xnarch_send_timer_ipi(xnarch_cpumask_t mask) diff --git a/include/asm-arm/hal.h b/include/asm-arm/hal.h index 1787094..2dae6da 100644 --- a/include/asm-arm/hal.h +++ b/include/asm-arm/hal.h @@ -126,7 +126,22 @@ static inline __attribute_const__ unsigned long ffnz (unsigned long ul) #include <asm/mach/irq.h> #include <asm/cacheflush.h> -#define RTHAL_TIMER_IRQ __ipipe_mach_timerint +#ifndef RTHAL_TIMER_IRQ +/* + * Default setting, unless pre-set in the machine-dependent section. + */ +#ifdef __IPIPE_FEATURE_SYSINFO_V2 +#define RTHAL_TIMER_IRQ __ipipe_mach_hrtimer_irq +#else +#define RTHAL_TIMER_IRQ __ipipe_mach_timerint +#endif /* __IPIPE_FEATURE_SYSINFO_V2 */ +#endif /* RTHAL_TIMER_IRQ */ + +#ifdef __IPIPE_FEATURE_SYSINFO_V2 +#define RTHAL_TSC_INFO(p) ((p)->arch_tsc) +#else +#define RTHAL_TSC_INFO(p) ((p)->archdep.tsc) +#endif /* __IPIPE_FEATURE_SYSINFO_V2 */ #ifdef CONFIG_XENO_OPT_PERVASIVE #define RTHAL_SHARED_HEAP_FLAGS (cache_is_vivt() ? XNHEAP_GFP_NONCACHED : 0) diff --git a/ksrc/arch/arm/hal.c b/ksrc/arch/arm/hal.c index df63010..2c0dcfe 100644 --- a/ksrc/arch/arm/hal.c +++ b/ksrc/arch/arm/hal.c @@ -157,7 +157,7 @@ EXPORT_SYMBOL(rthal_timer_notify_switch); unsigned long rthal_timer_calibrate(void) { - return 1000000000 / RTHAL_CPU_FREQ; + return 1000000000 / RTHAL_CLOCK_FREQ; } int rthal_irq_host_request(unsigned irq, _______________________________________________ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git