[Xenomai-git] Philippe Gerum : posix: remove unused variable
Module: xenomai-head Branch: master Commit: 4b061ce6cfbe7578cfd9ad628f36d8a8d3ec1aaa URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=4b061ce6cfbe7578cfd9ad628f36d8a8d3ec1aaa Author: Philippe Gerum r...@xenomai.org Date: Tue Oct 19 09:21:15 2010 +0200 posix: remove unused variable --- ksrc/skins/posix/syscall.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/ksrc/skins/posix/syscall.c b/ksrc/skins/posix/syscall.c index be5bbb0..13e7472 100644 --- a/ksrc/skins/posix/syscall.c +++ b/ksrc/skins/posix/syscall.c @@ -441,7 +441,7 @@ static int __pthread_set_name_np(struct pt_regs *regs) static int __pthread_kill(struct pt_regs *regs) { struct pse51_hkey hkey; - pthread_t k_tid, curr; + pthread_t k_tid; int sig, ret; hkey.u_tid = __xn_reg_arg1(regs); ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: rename waveform files
Module: xenomai-abe Branch: analogy Commit: f74ecdce5588fe049ae439de8a0454d2eb2f2622 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=f74ecdce5588fe049ae439de8a0454d2eb2f2622 Author: Alexis Berlemont alexis.berlem...@gmail.com Date: Mon Oct 18 07:53:19 2010 +0200 analogy: rename waveform files --- .../{signal_generation.c = wf_facilities.c} |0 .../{signal_generation.h = wf_facilities.h} |0 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/src/utils/analogy/signal_generation.c b/src/utils/analogy/wf_facilities.c similarity index 100% rename from src/utils/analogy/signal_generation.c rename to src/utils/analogy/wf_facilities.c diff --git a/src/utils/analogy/signal_generation.h b/src/utils/analogy/wf_facilities.h similarity index 100% rename from src/utils/analogy/signal_generation.h rename to src/utils/analogy/wf_facilities.h ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: implement configuration of buffer default size
Module: xenomai-abe Branch: analogy Commit: 44b31ad7b1b9b13104fc98c3ff616a1539398f11 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=44b31ad7b1b9b13104fc98c3ff616a1539398f11 Author: Alexis Berlemont alexis.berlem...@gmail.com Date: Tue Oct 19 23:52:20 2010 +0200 analogy: implement configuration of buffer default size --- include/analogy/buffer.h |8 include/analogy/transfer.h|3 +++ include/analogy/types.h |4 +--- ksrc/drivers/analogy/buffer.c | 17 +++-- ksrc/drivers/analogy/rtdm_interface.c | 10 +- ksrc/drivers/analogy/transfer.c |4 6 files changed, 32 insertions(+), 14 deletions(-) diff --git a/include/analogy/buffer.h b/include/analogy/buffer.h index b5be3f0..86d0a64 100644 --- a/include/analogy/buffer.h +++ b/include/analogy/buffer.h @@ -456,9 +456,17 @@ typedef struct a4l_mmap_arg a4l_mmap_t; (might be used with BUFCFG ioctl) */ #define A4L_BUF_MAXSIZE 0x100 #define A4L_BUF_DEFSIZE 0x1 +#define A4L_BUF_DEFMAGIC 0xffaaff55 /* BUFCFG ioctl argument structure */ struct a4l_buffer_config { + /* NOTE: with the last buffer implementation, the field + idx_subd became useless; the buffer are now + per-context. So, the buffer size configuration is specific + to an opened device. There is a little exception: we can + define a default buffer size for a device. + So far, a hack is used to implement the configuration of + the default buffer size */ unsigned int idx_subd; unsigned long buf_size; }; diff --git a/include/analogy/transfer.h b/include/analogy/transfer.h index 929022b..2850834 100644 --- a/include/analogy/transfer.h +++ b/include/analogy/transfer.h @@ -57,6 +57,9 @@ struct a4l_transfer { unsigned int nb_subd; a4l_subd_t **subds; + /* Buffer stuff: the default size */ + unsigned int default_bufsize; + /* IRQ in use */ /* TODO: irq_desc should vanish */ a4l_irq_desc_t irq_desc; diff --git a/include/analogy/types.h b/include/analogy/types.h index e3974eb..89dbb8a 100644 --- a/include/analogy/types.h +++ b/include/analogy/types.h @@ -25,9 +25,7 @@ #ifndef DOXYGEN_CPP -/* --- Misc precompilation constants --- */ - -#define A4L_DEFAULT_BFSIZE 0x1 +/* --- Misc precompilation constant --- */ #define A4L_NAMELEN 20 /* --- Common Analogy types --- */ diff --git a/ksrc/drivers/analogy/buffer.c b/ksrc/drivers/analogy/buffer.c index 8bd7d38..7623674 100644 --- a/ksrc/drivers/analogy/buffer.c +++ b/ksrc/drivers/analogy/buffer.c @@ -117,7 +117,7 @@ static void a4l_reinit_buffer(a4l_buf_t *buf_desc) void a4l_init_buffer(a4l_buf_t *buf_desc) { - + memset(buf_desc, 0, sizeof(a4l_buf_t)); a4l_init_sync(buf_desc-sync); a4l_reinit_buffer(buf_desc); } @@ -598,16 +598,21 @@ int a4l_ioctl_bufcfg(a4l_cxt_t * cxt, void *arg) arg, sizeof(a4l_bufcfg_t)) != 0) return -EFAULT; - if (subd test_bit(A4L_SUBD_BUSY_NR, subd-status)) { - __a4l_err(a4l_ioctl_bufcfg: acquisition in progress\n); - return -EBUSY; - } - if (buf_cfg.buf_size A4L_BUF_MAXSIZE) { __a4l_err(a4l_ioctl_bufcfg: buffer size too big (=16MB)\n); return -EINVAL; } + if (buf_cfg.idx_subd == A4L_BUF_DEFMAGIC) { + cxt-dev-transfer.default_bufsize = buf_cfg.buf_size; + return 0; + } + + if (subd test_bit(A4L_SUBD_BUSY_NR, subd-status)) { + __a4l_err(a4l_ioctl_bufcfg: acquisition in progress\n); + return -EBUSY; + } + if (test_bit(A4L_BUF_MAP, buf-flags)) { __a4l_err(a4l_ioctl_bufcfg: please unmap before configuring buffer\n); diff --git a/ksrc/drivers/analogy/rtdm_interface.c b/ksrc/drivers/analogy/rtdm_interface.c index 65acc86..906a20f 100644 --- a/ksrc/drivers/analogy/rtdm_interface.c +++ b/ksrc/drivers/analogy/rtdm_interface.c @@ -136,11 +136,11 @@ int a4l_open(struct rtdm_dev_context *context, /* Allocate the asynchronous buffer NOTE: it should be interesting to allocate the buffer only - on demand especially if the system is short of memory - NOTE2: the default buffer size could be configured via - kernel config*/ - a4l_alloc_buffer(cxt-buffer, A4L_DEFAULT_BFSIZE); - + on demand especially if the system is short of memory */ + if (cxt-dev-transfer.default_bufsize) + a4l_alloc_buffer(cxt-buffer, +cxt-dev-transfer.default_bufsize); + return 0; } diff --git a/ksrc/drivers/analogy/transfer.c b/ksrc/drivers/analogy/transfer.c index dc34997..c0f2945 100644 --- a/ksrc/drivers/analogy/transfer.c +++ b/ksrc/drivers/analogy/transfer.c @@ -92,6 +92,8 @@
[Xenomai-git] Gilles Chanteperdrix : Merge commit 'rpm/for-upstream'
Module: xenomai-2.5 Branch: master Commit: c016ff2d47f74f203af5c8870e809ed3769fe1b8 URL: http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=c016ff2d47f74f203af5c8870e809ed3769fe1b8 Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org Date: Fri Oct 15 00:12:13 2010 +0200 Merge commit 'rpm/for-upstream' --- ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : hal/arm: do not assume single global timer chip
Module: xenomai-2.5 Branch: master Commit: 036120a6c8846d2706be66b498a7cfc9e879bca4 URL: http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=036120a6c8846d2706be66b498a7cfc9e879bca4 Author: Philippe Gerum r...@xenomai.org Date: Thu Oct 14 09:29:07 2010 +0200 hal/arm: do not assume single global timer chip This patch revamps the timer-related code to match the requirements of SMP configurations with per-cpu local timers. --- ksrc/arch/arm/hal.c | 468 --- 1 files changed, 294 insertions(+), 174 deletions(-) diff --git a/ksrc/arch/arm/hal.c b/ksrc/arch/arm/hal.c index 7b93d5d..ffd33e7 100644 --- a/ksrc/arch/arm/hal.c +++ b/ksrc/arch/arm/hal.c @@ -2,7 +2,7 @@ * @ingroup hal * @file * - * Adeos-based Real-Time Abstraction Layer for PowerPC. + * Adeos-based Real-Time Abstraction Layer for ARM. * * ARM port * Copyright (C) 2005 Stelian Pop @@ -49,142 +49,78 @@ #endif /* CONFIG_PROC_FS */ #include stdarg.h -static struct { -unsigned long flags; -int count; -} rthal_linux_irq[IPIPE_NR_XIRQS]; - rthal_u32frac_t rthal_tsc_to_timer; EXPORT_SYMBOL(rthal_tsc_to_timer); -enum rthal_ktimer_mode rthal_ktimer_saved_mode; - -int rthal_timer_request(void (*handler)(void), -#ifdef CONFIG_GENERIC_CLOCKEVENTS - void (*mode_emul)(enum clock_event_mode mode, - struct clock_event_device *cdev), - int (*tick_emul)(unsigned long delay, -struct clock_event_device *cdev), -#endif /* CONFIG_GENERIC_CLOCKEVENTS */ - int cpu) -{ -int tickval, err; -unsigned long flags; - -#ifdef CONFIG_GENERIC_CLOCKEVENTS -unsigned long dummy, *tmfreq = dummy; -int res; - -if (rthal_timerfreq_arg == 0) - tmfreq = rthal_tunables.timer_freq; - -res = ipipe_request_tickdev(RTHAL_TIMER_DEVICE, mode_emul, - tick_emul, cpu, tmfreq); - -switch (res) { -case CLOCK_EVT_MODE_PERIODIC: - /* oneshot tick emulation callback won't be used, ask -* the caller to start an internal timer for emulating -* a periodic tick. */ - tickval = 10UL / HZ; - break; - -case CLOCK_EVT_MODE_ONESHOT: - /* oneshot tick emulation */ - tickval = 1; - break; - -case CLOCK_EVT_MODE_UNUSED: - /* we don't need to emulate the tick at all. */ - tickval = 0; - break; - -case CLOCK_EVT_MODE_SHUTDOWN: - return -ENOSYS; - -default: - return res; -} -rthal_ktimer_saved_mode = res; -#else /* !CONFIG_GENERIC_CLOCKEVENTS */ -tickval = 10UL / HZ; -rthal_ktimer_saved_mode = KTIMER_MODE_PERIODIC; - -if (rthal_timerfreq_arg == 0) - rthal_tunables.timer_freq = CLOCK_TICK_RATE; -#endif /* !CONFIG_GENERIC_CLOCKEVENTS */ - -flags = rthal_critical_enter(NULL); - -__ipipe_mach_timerstolen = 1; - -rthal_timer_program_shot(__ipipe_mach_ticks_per_jiffy); +#define RTHAL_CALIBRATE_LOOPS 10 -rthal_irq_release(RTHAL_TIMER_IRQ); +static struct { + unsigned long flags; + int count; +} rthal_linux_irq[IPIPE_NR_XIRQS]; -err = rthal_irq_request(RTHAL_TIMER_IRQ, - (rthal_irq_handler_t) handler, NULL, NULL); +enum rthal_ktimer_mode rthal_ktimer_saved_mode; -rthal_critical_exit(flags); +#define RTHAL_SET_ONESHOT_XENOMAI 1 +#define RTHAL_SET_ONESHOT_LINUX2 +#define RTHAL_SET_PERIODIC 3 -return err ?: tickval; +static inline void steal_timer(int stolen) +{ + /* +* Some platform-specific I-pipe bits may want to know whether +* non-vanilla kernel code is currently fiddling with the +* timer chip; setting this flag on tells them so. +*/ + __ipipe_mach_timerstolen = stolen; } -void rthal_timer_release(int cpu) +static inline void force_oneshot_hw_mode(void) { -unsigned long flags; - -#ifdef CONFIG_GENERIC_CLOCKEVENTS -ipipe_release_tickdev(cpu); -#endif - -flags = rthal_critical_enter(NULL); - -__ipipe_mach_release_timer(); - -rthal_irq_release(RTHAL_TIMER_IRQ); - -__ipipe_mach_timerstolen = 0; - -rthal_critical_exit(flags); + /* +* Program next tick ahead at a sensible date. We expect +* __ipipe_mach_set_dec() to switch off any auto-reload mode +* if that makes sense for the hardware. +*/ + __ipipe_mach_set_dec(__ipipe_mach_ticks_per_jiffy); } -#ifdef CONFIG_GENERIC_CLOCKEVENTS -void rthal_timer_notify_switch(enum clock_event_mode mode, - struct clock_event_device *cdev) +static inline void restore_normal_hw_mode(void) { - rthal_ktimer_saved_mode = mode; + steal_timer(0); + /* +* Ask the I-pipe to reset the normal timer operating
[Xenomai-git] Philippe Gerum : hal/arm: do not assume single global timer chip
Module: xenomai-head Branch: master Commit: ac7e4c88efa697dbfd8da7b42aede1db42ae008b URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=ac7e4c88efa697dbfd8da7b42aede1db42ae008b Author: Philippe Gerum r...@xenomai.org Date: Thu Oct 14 09:29:07 2010 +0200 hal/arm: do not assume single global timer chip This patch revamps the timer-related code to match the requirements of SMP configurations with per-cpu local timers. --- ksrc/arch/arm/hal.c | 468 --- 1 files changed, 294 insertions(+), 174 deletions(-) diff --git a/ksrc/arch/arm/hal.c b/ksrc/arch/arm/hal.c index 7b93d5d..ffd33e7 100644 --- a/ksrc/arch/arm/hal.c +++ b/ksrc/arch/arm/hal.c @@ -2,7 +2,7 @@ * @ingroup hal * @file * - * Adeos-based Real-Time Abstraction Layer for PowerPC. + * Adeos-based Real-Time Abstraction Layer for ARM. * * ARM port * Copyright (C) 2005 Stelian Pop @@ -49,142 +49,78 @@ #endif /* CONFIG_PROC_FS */ #include stdarg.h -static struct { -unsigned long flags; -int count; -} rthal_linux_irq[IPIPE_NR_XIRQS]; - rthal_u32frac_t rthal_tsc_to_timer; EXPORT_SYMBOL(rthal_tsc_to_timer); -enum rthal_ktimer_mode rthal_ktimer_saved_mode; - -int rthal_timer_request(void (*handler)(void), -#ifdef CONFIG_GENERIC_CLOCKEVENTS - void (*mode_emul)(enum clock_event_mode mode, - struct clock_event_device *cdev), - int (*tick_emul)(unsigned long delay, -struct clock_event_device *cdev), -#endif /* CONFIG_GENERIC_CLOCKEVENTS */ - int cpu) -{ -int tickval, err; -unsigned long flags; - -#ifdef CONFIG_GENERIC_CLOCKEVENTS -unsigned long dummy, *tmfreq = dummy; -int res; - -if (rthal_timerfreq_arg == 0) - tmfreq = rthal_tunables.timer_freq; - -res = ipipe_request_tickdev(RTHAL_TIMER_DEVICE, mode_emul, - tick_emul, cpu, tmfreq); - -switch (res) { -case CLOCK_EVT_MODE_PERIODIC: - /* oneshot tick emulation callback won't be used, ask -* the caller to start an internal timer for emulating -* a periodic tick. */ - tickval = 10UL / HZ; - break; - -case CLOCK_EVT_MODE_ONESHOT: - /* oneshot tick emulation */ - tickval = 1; - break; - -case CLOCK_EVT_MODE_UNUSED: - /* we don't need to emulate the tick at all. */ - tickval = 0; - break; - -case CLOCK_EVT_MODE_SHUTDOWN: - return -ENOSYS; - -default: - return res; -} -rthal_ktimer_saved_mode = res; -#else /* !CONFIG_GENERIC_CLOCKEVENTS */ -tickval = 10UL / HZ; -rthal_ktimer_saved_mode = KTIMER_MODE_PERIODIC; - -if (rthal_timerfreq_arg == 0) - rthal_tunables.timer_freq = CLOCK_TICK_RATE; -#endif /* !CONFIG_GENERIC_CLOCKEVENTS */ - -flags = rthal_critical_enter(NULL); - -__ipipe_mach_timerstolen = 1; - -rthal_timer_program_shot(__ipipe_mach_ticks_per_jiffy); +#define RTHAL_CALIBRATE_LOOPS 10 -rthal_irq_release(RTHAL_TIMER_IRQ); +static struct { + unsigned long flags; + int count; +} rthal_linux_irq[IPIPE_NR_XIRQS]; -err = rthal_irq_request(RTHAL_TIMER_IRQ, - (rthal_irq_handler_t) handler, NULL, NULL); +enum rthal_ktimer_mode rthal_ktimer_saved_mode; -rthal_critical_exit(flags); +#define RTHAL_SET_ONESHOT_XENOMAI 1 +#define RTHAL_SET_ONESHOT_LINUX2 +#define RTHAL_SET_PERIODIC 3 -return err ?: tickval; +static inline void steal_timer(int stolen) +{ + /* +* Some platform-specific I-pipe bits may want to know whether +* non-vanilla kernel code is currently fiddling with the +* timer chip; setting this flag on tells them so. +*/ + __ipipe_mach_timerstolen = stolen; } -void rthal_timer_release(int cpu) +static inline void force_oneshot_hw_mode(void) { -unsigned long flags; - -#ifdef CONFIG_GENERIC_CLOCKEVENTS -ipipe_release_tickdev(cpu); -#endif - -flags = rthal_critical_enter(NULL); - -__ipipe_mach_release_timer(); - -rthal_irq_release(RTHAL_TIMER_IRQ); - -__ipipe_mach_timerstolen = 0; - -rthal_critical_exit(flags); + /* +* Program next tick ahead at a sensible date. We expect +* __ipipe_mach_set_dec() to switch off any auto-reload mode +* if that makes sense for the hardware. +*/ + __ipipe_mach_set_dec(__ipipe_mach_ticks_per_jiffy); } -#ifdef CONFIG_GENERIC_CLOCKEVENTS -void rthal_timer_notify_switch(enum clock_event_mode mode, - struct clock_event_device *cdev) +static inline void restore_normal_hw_mode(void) { - rthal_ktimer_saved_mode = mode; + steal_timer(0); + /* +* Ask the I-pipe to reset the normal timer
[Xenomai-git] Gilles Chanteperdrix : arm: make atomic.h implementation C++ friendly
Module: xenomai-head Branch: master Commit: b0b7000e22c25759785425af43c0e9707621b991 URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=b0b7000e22c25759785425af43c0e9707621b991 Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org Date: Wed Oct 20 05:53:00 2010 +0200 arm: make atomic.h implementation C++ friendly It gets included by pthread.h. --- include/asm-arm/atomic.h | 22 +++--- 1 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/asm-arm/atomic.h b/include/asm-arm/atomic.h index 3701e41..98a7ca5 100644 --- a/include/asm-arm/atomic.h +++ b/include/asm-arm/atomic.h @@ -172,9 +172,9 @@ xnarch_atomic_clear_mask(unsigned long *addr, unsigned long mask) static inline unsigned long xnarch_atomic_cmpxchg(xnarch_atomic_t *ptr, - unsigned long old, unsigned long new) + unsigned long oldval, unsigned long newval) { - unsigned long oldval, res; + unsigned long curval, res; xnarch_memory_barrier(); @@ -184,14 +184,14 @@ xnarch_atomic_cmpxchg(xnarch_atomic_t *ptr, mov%0, #0\n teq%1, %4\n strexeq %0, %5, [%3]\n - : =r (res), =r (oldval), +Qo (ptr-counter) - : r (ptr-counter), Ir (old), r (new) + : =r (res), =r (curval), +Qo (ptr-counter) + : r (ptr-counter), Ir (oldval), r (newval) : cc); } while (res); xnarch_memory_barrier(); - return oldval; + return curval; } static inline int xnarch_atomic_inc_and_test(xnarch_atomic_t *v) @@ -263,8 +263,8 @@ xnarch_atomic_set_mask(unsigned long *addr, unsigned long mask) atomic_dec((atomic_t *)pcounter) #define xnarch_atomic_clear_mask(addr, mask) \ atomic_clear_mask((mask), (addr)) -#define xnarch_atomic_cmpxchg(pcounter, old, new) \ - atomic_cmpxchg((atomic_t *)(pcounter), (old), (new)) +#define xnarch_atomic_cmpxchg(pcounter, oldval, newval) \ + atomic_cmpxchg((atomic_t *)(pcounter), (oldval), (newval)) #define xnarch_atomic_inc_and_test(pcounter) \ atomic_inc_and_test((atomic_t *)pcounter) #define xnarch_atomic_dec_and_test(pcounter) \ @@ -347,9 +347,9 @@ xnarch_atomic_clear_mask(unsigned long *addr, unsigned long mask) static __inline__ unsigned long xnarch_atomic_cmpxchg(xnarch_atomic_t *ptr, - unsigned long old, unsigned long newval) + unsigned long oldval, unsigned long newval) { - register unsigned long asm_old asm(r0) = old; + register unsigned long asm_old asm(r0) = oldval; register unsigned long asm_new asm(r1) = newval; register unsigned long *asm_ptr asm(r2) = (unsigned long *)ptr-counter; @@ -365,8 +365,8 @@ xnarch_atomic_cmpxchg(xnarch_atomic_t *ptr, : r(asm_new), r(asm_ptr) : ip, cc, memory); if (likely(!asm_old)) - return old; - } while ((asm_old = *asm_ptr) == old); + return oldval; + } while ((asm_old = *asm_ptr) == oldval); return asm_old; } ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git