[Xenomai-git] Philippe Gerum : powerpc: mention official URL to mainline kernel releases
Module: xenomai-2.5 Branch: master Commit: 44b05fbf13a5c17a1d68f42605ef043dbbf99493 URL: http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=44b05fbf13a5c17a1d68f42605ef043dbbf99493 Author: Philippe Gerum r...@xenomai.org Date: Tue Mar 30 09:58:02 2010 +0200 powerpc: mention official URL to mainline kernel releases --- ksrc/arch/powerpc/patches/README |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/ksrc/arch/powerpc/patches/README b/ksrc/arch/powerpc/patches/README index 010a86e..5ce4b0b 100644 --- a/ksrc/arch/powerpc/patches/README +++ b/ksrc/arch/powerpc/patches/README @@ -72,6 +72,6 @@ Patch release Commit # from Linux v2.6.33 onward ~ -From ftp://ftp.free.fr/mirrors/ftp.kernel.org/linux/kernel/v2.6/ +From ftp://ftp.kernel.org/pub/linux/kernel/v2.6/ All patches are based on mainline kernel releases. ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : scripts: fix xeno wrapper to consider --with-testdir
Module: xenomai-2.5 Branch: master Commit: 40538a3a8cf4f997d884ebf3e94db795f5df0055 URL: http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=40538a3a8cf4f997d884ebf3e94db795f5df0055 Author: Philippe Gerum r...@xenomai.org Date: Sat Apr 10 12:25:34 2010 +0200 scripts: fix xeno wrapper to consider --with-testdir --- scripts/xeno.in |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/scripts/xeno.in b/scripts/xeno.in index d830a03..fea227f 100644 --- a/scripts/xeno.in +++ b/scripts/xeno.in @@ -9,6 +9,9 @@ prefix=@prefix@ exec_prefix=@exec_prefix@ BINDIR=@bindir@ +TESTDIR=@XENO_TEST_DIR@ unset prefix exec_prefix -exec $BINDIR/$@ +test -x $BINDIR/$1 exec $BINDIR/$@ +test -x $TESTDIR/$1 exec $TESTDIR/$@ +echo $1: not found/executable ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : rtipc/bufp: reset buffer descriptor upon r/w preemption
Module: xenomai-2.5 Branch: master Commit: d0b4bb3f4ec669ac0b82b64cde811f90b02d2288 URL: http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=d0b4bb3f4ec669ac0b82b64cde811f90b02d2288 Author: Philippe Gerum r...@xenomai.org Date: Mon Mar 29 10:42:36 2010 +0200 rtipc/bufp: reset buffer descriptor upon r/w preemption In order to perform data copy while reading/writing data from/to a buffer descriptor in a lockless manner, we rely on a control token for detecting any preemption that shall lead to invalidating the current buffer, before redoing the data acquisition. Make sure to reset the buffer descriptor appropriately, before redoing the acquisition, so that the old contents are discarded. --- ksrc/drivers/ipc/bufp.c |8 ++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ksrc/drivers/ipc/bufp.c b/ksrc/drivers/ipc/bufp.c index 04b3209..7517b79 100644 --- a/ksrc/drivers/ipc/bufp.c +++ b/ksrc/drivers/ipc/bufp.c @@ -220,8 +220,10 @@ redo: * the message, we have to re-read the whole * thing. */ - if (sk-rdtoken != rdtoken) + if (sk-rdtoken != rdtoken) { + xnbufd_reset(bufd); goto redo; + } rdoff = (rdoff + n) % sk-bufsz; rbytes -= n; @@ -465,8 +467,10 @@ redo: * message, we have to write the whole thing * again. */ - if (rsk-wrtoken != wrtoken) + if (rsk-wrtoken != wrtoken) { + xnbufd_reset(bufd); goto redo; + } wroff = (wroff + n) % rsk-bufsz; wbytes -= n; ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : x86: upgrade I-pipe support to 2.6.32.11-x86-2.6-02
Module: xenomai-2.5 Branch: master Commit: f081d26bcbdeeb5a0530c45cbe81b752c98f822b URL: http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=f081d26bcbdeeb5a0530c45cbe81b752c98f822b Author: Philippe Gerum r...@xenomai.org Date: Sat Apr 10 12:03:44 2010 +0200 x86: upgrade I-pipe support to 2.6.32.11-x86-2.6-02 --- ...atch = adeos-ipipe-2.6.32.11-x86-2.6-02.patch} | 175 +++- 1 files changed, 96 insertions(+), 79 deletions(-) diff --git a/ksrc/arch/x86/patches/adeos-ipipe-2.6.32.7-x86-2.6-01.patch b/ksrc/arch/x86/patches/adeos-ipipe-2.6.32.11-x86-2.6-02.patch similarity index 98% rename from ksrc/arch/x86/patches/adeos-ipipe-2.6.32.7-x86-2.6-01.patch rename to ksrc/arch/x86/patches/adeos-ipipe-2.6.32.11-x86-2.6-02.patch index 11a3740..1ba4ecd 100644 --- a/ksrc/arch/x86/patches/adeos-ipipe-2.6.32.7-x86-2.6-01.patch +++ b/ksrc/arch/x86/patches/adeos-ipipe-2.6.32.11-x86-2.6-02.patch @@ -1,5 +1,5 @@ diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig -index 72ace95..4629709 100644 +index 4fdb669..89b72a9 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -480,6 +480,7 @@ config SCHED_OMIT_FRAME_POINTER @@ -168,7 +168,7 @@ index 0b72282..6574056 100644 /* diff --git a/arch/x86/include/asm/ipipe.h b/arch/x86/include/asm/ipipe.h new file mode 100644 -index 000..35d21c2 +index 000..32b2ece --- /dev/null +++ b/arch/x86/include/asm/ipipe.h @@ -0,0 +1,156 @@ @@ -199,10 +199,10 @@ index 000..35d21c2 +#ifdef CONFIG_IPIPE + +#ifndef IPIPE_ARCH_STRING -+#define IPIPE_ARCH_STRING 2.6-01 ++#define IPIPE_ARCH_STRING 2.6-02 +#define IPIPE_MAJOR_NUMBER2 +#define IPIPE_MINOR_NUMBER6 -+#define IPIPE_PATCH_NUMBER1 ++#define IPIPE_PATCH_NUMBER2 +#endif + +DECLARE_PER_CPU(struct pt_regs, __ipipe_tick_regs); @@ -1234,7 +1234,7 @@ index d8e5d0c..847cc01 100644 obj-$(CONFIG_HPET_TIMER) += hpet.o diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c -index c86dbcf..e027030 100644 +index 0e69e17..47586ca 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c @@ -446,7 +446,7 @@ static void lapic_timer_setup(enum clock_event_mode mode, @@ -1293,7 +1293,7 @@ index c86dbcf..e027030 100644 } } -@@ -1737,7 +1741,7 @@ void smp_spurious_interrupt(struct pt_regs *regs) +@@ -1735,7 +1739,7 @@ void smp_spurious_interrupt(struct pt_regs *regs) */ v = apic_read(APIC_ISR + ((SPURIOUS_APIC_VECTOR ~0x1f) 1)); if (v (1 (SPURIOUS_APIC_VECTOR 0x1f))) @@ -1302,7 +1302,7 @@ index c86dbcf..e027030 100644 inc_irq_stat(irq_spurious_count); -@@ -2018,13 +2022,13 @@ static int lapic_suspend(struct sys_device *dev, pm_message_t state) +@@ -2004,13 +2008,13 @@ static int lapic_suspend(struct sys_device *dev, pm_message_t state) apic_pm_state.apic_thmr = apic_read(APIC_LVTTHMR); #endif @@ -1318,7 +1318,7 @@ index c86dbcf..e027030 100644 return 0; } -@@ -2039,7 +2043,7 @@ static int lapic_resume(struct sys_device *dev) +@@ -2025,7 +2029,7 @@ static int lapic_resume(struct sys_device *dev) if (!apic_pm_state.active) return 0; @@ -1327,7 +1327,7 @@ index c86dbcf..e027030 100644 if (intr_remapping_enabled) { ioapic_entries = alloc_ioapic_entries(); if (!ioapic_entries) { -@@ -2105,7 +2109,7 @@ static int lapic_resume(struct sys_device *dev) +@@ -2091,7 +2095,7 @@ static int lapic_resume(struct sys_device *dev) free_ioapic_entries(ioapic_entries); } restore: @@ -1353,7 +1353,7 @@ index 873f81f..aada533 100644 static void flat_send_IPI_mask(const struct cpumask *cpumask, int vector) diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c -index dc69f28..d1674f6 100644 +index dc4f486..2ed892b 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c @@ -75,8 +75,11 @@ @@ -1410,7 +1410,7 @@ index dc69f28..d1674f6 100644 spin_unlock_irqrestore(ioapic_lock, flags); } -@@ -2200,6 +2214,7 @@ static unsigned int startup_ioapic_irq(unsigned int irq) +@@ -2250,6 +2264,7 @@ static unsigned int startup_ioapic_irq(unsigned int irq) } cfg = irq_cfg(irq); __unmask_IO_APIC_irq(cfg); @@ -1418,7 +1418,7 @@ index dc69f28..d1674f6 100644 spin_unlock_irqrestore(ioapic_lock, flags); return was_pending; -@@ -2479,23 +2494,61 @@ static void irq_complete_move(struct irq_desc **descp) +@@ -2529,23 +2544,61 @@ static void irq_complete_move(struct irq_desc **descp) static inline void irq_complete_move(struct irq_desc **descp) {} #endif @@ -1482,7 +1482,7 @@ index dc69f28..d1674f6 100644 int do_unmask_irq = 0; irq_complete_move(desc); -@@ -2578,6 +2631,26 @@ static void ack_apic_level(unsigned int irq) +@@ -2628,6 +2681,26 @@ static void ack_apic_level(unsigned int irq) __unmask_and_level_IO_APIC_irq(cfg);
[Xenomai-git] Philippe Gerum : nucleus: introduce bufd reset operation
Module: xenomai-2.5 Branch: master Commit: 410a9890e200385bc7aa40de8db8f6d924471db2 URL: http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=410a9890e200385bc7aa40de8db8f6d924471db2 Author: Philippe Gerum r...@xenomai.org Date: Sun Mar 28 23:18:35 2010 +0200 nucleus: introduce bufd reset operation --- include/nucleus/bufd.h |5 + ksrc/nucleus/bufd.c| 20 2 files changed, 25 insertions(+), 0 deletions(-) diff --git a/include/nucleus/bufd.h b/include/nucleus/bufd.h index ac1998a..262e546 100644 --- a/include/nucleus/bufd.h +++ b/include/nucleus/bufd.h @@ -97,6 +97,11 @@ ssize_t xnbufd_copy_from_kmem(struct xnbufd *bufd, void xnbufd_invalidate(struct xnbufd *bufd); +static inline void xnbufd_reset(struct xnbufd *bufd) +{ + bufd-b_off = 0; +} + /*...@}*/ #endif /* !_XENO_NUCLEUS_BUFD_H */ diff --git a/ksrc/nucleus/bufd.c b/ksrc/nucleus/bufd.c index d7a7b00..c482b9d 100644 --- a/ksrc/nucleus/bufd.c +++ b/ksrc/nucleus/bufd.c @@ -627,6 +627,26 @@ done: EXPORT_SYMBOL_GPL(xnbufd_unmap_uwrite); /*! + * \fn void xnbufd_reset(struct xnbufd *bufd) + * \brief Reset a buffer descriptor. + * + * The buffer descriptor is reset, so that all data already copied is + * forgotten. Any carry over buffer allocated is kept, though. + * + * @param bufd The address of the buffer descriptor to reset. + * + * Environments: + * + * This service can be called from: + * + * - Kernel code (including from primary mode) + * - Kernel-based task + * - Interrupt service routine + * + * Rescheduling: never. + */ + +/*! * \fn void xnbufd_invalidate(struct xnbufd *bufd) * \brief Invalidate a buffer descriptor. * ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : nucleus: fix relaxing synch owner detector
Module: xenomai-2.5 Branch: master Commit: 73dc92a1cab4d63bf1cb47f47f39cc4eab64c274 URL: http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=73dc92a1cab4d63bf1cb47f47f39cc4eab64c274 Author: Philippe Gerum r...@xenomai.org Date: Sun Apr 11 18:23:48 2010 +0200 nucleus: fix relaxing synch owner detector --- ksrc/nucleus/synch.c | 10 ++ 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ksrc/nucleus/synch.c b/ksrc/nucleus/synch.c index d57f7cd..7464951 100644 --- a/ksrc/nucleus/synch.c +++ b/ksrc/nucleus/synch.c @@ -996,9 +996,11 @@ void xnsynch_detect_relaxed_owner(struct xnsynch *synch, struct xnthread *sleepe /* * Detect when a thread is about to relax while holding a - * synchronization object currently claimed by someone else. By - * relying on the claim queue, we restrict the checks to PIP-enabled - * objects, but that already covers most of the use cases anyway. + * synchronization object currently claimed by another thread, which + * bears the TWARNSW bit (thus advertising a concern about potential + * spurious relaxes and priority inversion). By relying on the claim + * queue, we restrict the checks to PIP-enabled objects, but that + * already covers most of the use cases anyway. */ void xnsynch_detect_claimed_relax(struct xnthread *owner) { @@ -1012,7 +1014,7 @@ void xnsynch_detect_claimed_relax(struct xnthread *owner) for (ht = getheadpq(synch-pendq); ht != NULL; ht = nextpq(synch-pendq, ht)) { sleeper = link2thread(ht, plink); - if (xnthread_test_state(sleeper, XNRELAX)) { + if (xnthread_test_state(sleeper, XNTRAPSW)) { xnthread_set_state(sleeper, XNSWREP); xnshadow_send_sig(sleeper, SIGDEBUG, SIGDEBUG_MIGRATE_PRIOINV, 1); ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : nucleus: reduce overhead of thread handle lookup
Module: xenomai-2.5 Branch: master Commit: 5f3b0f1055ef6c1b595de59789146e4b48872e6b URL: http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=5f3b0f1055ef6c1b595de59789146e4b48872e6b Author: Philippe Gerum r...@xenomai.org Date: Sun Apr 11 19:36:35 2010 +0200 nucleus: reduce overhead of thread handle lookup --- include/nucleus/registry.h | 24 include/nucleus/thread.h |2 +- ksrc/nucleus/registry.c| 42 ++ 3 files changed, 35 insertions(+), 33 deletions(-) diff --git a/include/nucleus/registry.h b/include/nucleus/registry.h index 56826db..6bd5ec9 100644 --- a/include/nucleus/registry.h +++ b/include/nucleus/registry.h @@ -110,6 +110,8 @@ typedef struct xnpnode { /* Placeholder. */ #endif /* !CONFIG_PROC_FS */ +extern struct xnobject *registry_obj_slots; + /* Public interface. */ int xnregistry_enter(const char *key, @@ -133,6 +135,28 @@ void *xnregistry_fetch(xnhandle_t handle); u_long xnregistry_put(xnhandle_t handle); +static inline struct xnobject *xnregistry_validate(xnhandle_t handle) +{ + struct xnobject *object; + /* +* Careful: a removed object which is still in flight to be +* unexported carries a NULL objaddr, so we have to check this +* as well. +*/ + if (likely(handle handle CONFIG_XENO_OPT_REGISTRY_NRSLOTS)) { + object = registry_obj_slots[handle]; + return object-objaddr ? object : NULL; + } + + return NULL; +} + +static inline void *xnregistry_lookup(xnhandle_t handle) +{ + struct xnobject *object = xnregistry_validate(handle); + return object ? object-objaddr : NULL; +} + #ifdef __cplusplus } #endif diff --git a/include/nucleus/thread.h b/include/nucleus/thread.h index b2baccb..1867915 100644 --- a/include/nucleus/thread.h +++ b/include/nucleus/thread.h @@ -428,7 +428,7 @@ int xnthread_register(struct xnthread *thread, const char *name) static inline struct xnthread *xnthread_lookup(xnhandle_t threadh) { - struct xnthread *thread = xnregistry_fetch(threadh); + struct xnthread *thread = xnregistry_lookup(threadh); return (thread xnthread_handle(thread) == threadh) ? thread : NULL; } diff --git a/ksrc/nucleus/registry.c b/ksrc/nucleus/registry.c index 9958dd3..4df31ba 100644 --- a/ksrc/nucleus/registry.c +++ b/ksrc/nucleus/registry.c @@ -46,7 +46,7 @@ #define CONFIG_XENO_OPT_DEBUG_REGISTRY 0 #endif -static xnobject_t *registry_obj_slots; +struct xnobject *registry_obj_slots; static xnqueue_t registry_obj_freeq; /* Free objects. */ @@ -232,16 +232,6 @@ void xnregistry_cleanup(void) CONFIG_XENO_OPT_REGISTRY_NRSLOTS * sizeof(xnobject_t)); } -static inline xnobject_t *registry_validate(xnhandle_t handle) -{ - if (handle 0 handle CONFIG_XENO_OPT_REGISTRY_NRSLOTS) { - xnobject_t *object = registry_obj_slots[handle]; - return object-objaddr ? object : NULL; - } - - return NULL; -} - #ifdef CONFIG_PROC_FS /* * The following stuff implements the mechanism for delegating @@ -823,9 +813,8 @@ int xnregistry_remove(xnhandle_t handle) xnlock_get_irqsave(nklock, s); - object = registry_validate(handle); - - if (!object) { + object = xnregistry_validate(handle); + if (object == NULL) { err = -ESRCH; goto unlock_and_exit; } @@ -932,9 +921,8 @@ int xnregistry_remove_safe(xnhandle_t handle, xnticks_t timeout) xnlock_get_irqsave(nklock, s); - object = registry_validate(handle); - - if (!object) { + object = xnregistry_validate(handle); + if (object == NULL) { err = -ESRCH; goto unlock_and_exit; } @@ -1047,9 +1035,8 @@ void *xnregistry_get(xnhandle_t handle) xnlock_get_irqsave(nklock, s); - object = registry_validate(handle); - - if (object) { + object = xnregistry_validate(handle); + if (likely(object)) { ++object-safelock; objaddr = object-objaddr; } else @@ -1107,9 +1094,8 @@ u_long xnregistry_put(xnhandle_t handle) xnlock_get_irqsave(nklock, s); - object = registry_validate(handle); - - if (!object) { + object = xnregistry_validate(handle); + if (object == NULL) { newlock = 0; goto unlock_and_exit; } @@ -1159,18 +1145,10 @@ EXPORT_SYMBOL_GPL(xnregistry_put); void *xnregistry_fetch(xnhandle_t handle) { - xnobject_t *object; - if (handle == XNOBJECT_SELF) return xnpod_primary_p()? xnpod_current_thread() : NULL; - object = registry_validate(handle); - - if (!object) - return NULL; - - return object-objaddr; - + return xnregistry_lookup(handle); } EXPORT_SYMBOL_GPL(xnregistry_fetch);
[Xenomai-git] Gilles Chanteperdrix : arm: rework the compiler flags to only enable interworking with EABI
Module: xenomai-2.5 Branch: master Commit: e651149d337b7f54f041793c7acf2ccb40c28e49 URL: http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=e651149d337b7f54f041793c7acf2ccb40c28e49 Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org Date: Mon Apr 19 15:04:24 2010 +0200 arm: rework the compiler flags to only enable interworking with EABI --- configure| 86 +++--- configure.in | 70 --- 2 files changed, 94 insertions(+), 62 deletions(-) diff --git a/configure b/configure index e0cce39..5a9c8d9 100755 --- a/configure +++ b/configure @@ -934,10 +934,10 @@ enable_debug enable_smp enable_x86_sep enable_x86_tsc +enable_arm_eabi enable_arm_mach enable_arm_arch enable_arm_tsc -enable_arm_eabi enable_linux_build with_adeos_patch enable_dox_doc @@ -1598,6 +1598,7 @@ Optional Features: --enable-smpEnable SMP support --enable-x86-sepEnable x86 SEP instructions for issuing syscalls --enable-x86-tscEnable x86 TSC for timings + --enable-arm-eabi Enable ARM EABI interface --enable-arm-mach Select for which machine we are compiling. Valid machines are at91rm9200, at91sam926x, at91sam9, generic, generic-vfp, imx, imx21, imx51, integrator, @@ -1608,7 +1609,6 @@ Optional Features: selected with --enable-arm-mach supports several architecture versions --disable-arm-tsc Disable TSC emulation in user-space - --enable-arm-eabi Enable ARM EABI interface --enable-linux-build=linux-src-dir Build Linux in Xenomai build tree, copying sources from linux-src-dir. If no source directory is @@ -11678,6 +11678,19 @@ if test $XENO_TARGET_ARCH = arm ; then unset vfp unset XNARCH_ARM_TSC_TYPE + { $as_echo $as_me:${as_lineno-$LINENO}: checking for ARM EABI interface 5 +$as_echo_n checking for ARM EABI interface... 6; } + # Check whether --enable-arm-eabi was given. +if test ${enable_arm_eabi+set} = set; then : + enableval=$enable_arm_eabi; case $enableval in + y | yes) CONFIG_XENO_ARM_EABI=y ;; + *) unset CONFIG_XENO_ARM_EABI ;; + esac +fi + + { $as_echo $as_me:${as_lineno-$LINENO}: result: ${CONFIG_XENO_ARM_EABI:-no} 5 +$as_echo ${CONFIG_XENO_ARM_EABI:-no} 6; } + { $as_echo $as_me:${as_lineno-$LINENO}: checking for ARM machine 5 $as_echo_n checking for ARM machine... 6; } # Check whether --enable-arm-mach was given. @@ -11728,13 +11741,13 @@ if test ${enable_arm_mach+set} = set; then : pxa)arch=5 tsc_type=__XN_TSC_TYPE_FREERUNNING;; - pxa3xx) arch=xscale3 + pxa3xx) arch=xscale3 tsc_type=__XN_TSC_TYPE_FREERUNNING;; s3c2410)arch=4 tsc_type=__XN_TSC_TYPE_DECREMENTER;; - sa1100) arch=4 + sa1100) arch=4 CONFIG_XENO_ARM_SA1100=y tsc_type=__XN_TSC_TYPE_FREERUNNING;; @@ -11748,6 +11761,19 @@ fi { $as_echo $as_me:${as_lineno-$LINENO}: result: ${enable_arm_mach:-no} 5 $as_echo ${enable_arm_mach:-no} 6; } + { $as_echo $as_me:${as_lineno-$LINENO}: checking for ARM EABI interface 5 +$as_echo_n checking for ARM EABI interface... 6; } + # Check whether --enable-arm-eabi was given. +if test ${enable_arm_eabi+set} = set; then : + enableval=$enable_arm_eabi; case $enableval in + y | yes) CONFIG_XENO_ARM_EABI=y ;; + *) unset CONFIG_XENO_ARM_EABI ;; + esac +fi + + { $as_echo $as_me:${as_lineno-$LINENO}: result: ${CONFIG_XENO_ARM_EABI:-no} 5 +$as_echo ${CONFIG_XENO_ARM_EABI:-no} 6; } + { $as_echo $as_me:${as_lineno-$LINENO}: checking for ARM architecture version 5 $as_echo_n checking for ARM architecture version... 6; } if test $arch = choose; then @@ -11769,14 +11795,34 @@ fi else CONFIG_XENO_ARM_ARCH=$arch fi -# Set the -march flag, FPU flags are set later. case $arch in - 4) XENO_ARM_ARCH_FLAGS=-march=armv4t;; + 4) XENO_ARM_ARCH_FLAGS=-march=armv4;; 5) XENO_ARM_ARCH_FLAGS=-march=armv5;; 6) XENO_ARM_ARCH_FLAGS=-march=armv6;; 7) XENO_ARM_ARCH_FLAGS=-march=armv7-a;; *) as_fn_error Invalid architecture $arch, only 4, 5, xscale3, 6 and 7 are supported $LINENO 5;; esac + + # Enable interworking + if test x$CONFIG_XENO_ARM_EABI = xy -a $CONFIG_XENO_ARM_ARCH -lt 6; then + XENO_ARM_ARCH_FLAGS=${XENO_ARM_ARCH_FLAGS}t + fi + + # Set FPU flags, if EABI is not enabled, all libraries in the system + # must be compiled with the same FPU flags, as we do not know how + # other components are compiled, we can not set the flags. + if test x$CONFIG_XENO_ARM_EABI = xy; then + if test x$vfp != x; then + XENO_ARM_ARCH_FLAGS=$XENO_ARM_ARCH_FLAGS -mfpu=$vfp
[Xenomai-git] Gilles Chanteperdrix : build: pass the *defconfig target to linux build system
Module: xenomai-2.5 Branch: master Commit: e65c4f4c906cdd3250ba1722c721e27f33e46b68 URL: http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=e65c4f4c906cdd3250ba1722c721e27f33e46b68 Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org Date: Sat May 1 10:20:04 2010 +0200 build: pass the *defconfig target to linux build system --- Makefile.am | 76 +- Makefile.in | 76 +- 2 files changed, 76 insertions(+), 76 deletions(-) diff --git a/Makefile.am b/Makefile.am index 27218e2..0d22c23 100644 --- a/Makefile.am +++ b/Makefile.am @@ -8,48 +8,48 @@ EXTRA_DIST = CREDITS README.INSTALL TROUBLESHOOTING ksrc examples debian dist-hook: rm -fr `find $(distdir) -name '.svn' -o -name CVS -o -name '.#*' \ --o -name '*~' -o -name autom4te.cache` + -o -name '*~' -o -name autom4te.cache` test -e $(srcdir)/doc || rm -rf $(distdir)/doc dev devices: @$(mkinstalldirs) $(DESTDIR)/dev; \ if test x`id -u` = x0; then \ - sudo= ; \ -else if test \! x`type $(SUDO)` = x ; then \ - echo sudo found (sudo is $(SUDO)), testing it... ; \ - $(SUDO) sh -c ( mknod $(DESTDIR)/dev/dummy c 150 0 rm -f $(DESTDIR)/dev/dummy ) \ - sudo=$(SUDO) || { \ + sudo= ; \ + else if test \! x`type $(SUDO)` = x ; then \ + echo sudo found (sudo is $(SUDO)), testing it... ; \ + $(SUDO) sh -c ( mknod $(DESTDIR)/dev/dummy c 150 0 rm -f $(DESTDIR)/dev/dummy ) \ + sudo=$(SUDO) || { \ echo '*** Warning: you are not super-user and sudo does not work, real-time devices' ; \ echo '*** nodes will not be created.' ; \ echo '*** If you do not create these devices by hand, Xenomai test programs will not' ; \ echo '*** work.' ; \ echo '*** To create these devices please run make devices with super-user' ; \ echo '*** privileges.' ; \ - exit 0 ; } ; \ - echo 'sudo is working.' ; \ - fi ; \ -fi ; \ -if test -r $(DESTDIR)/etc/udev/udev.rules ; then \ - for f in $(srcdir)/ksrc/nucleus/udev/*.rules ; do \ - b=`basename $$f` ; \ - grep -q Xenomai:`basename $$b .rules` $(DESTDIR)/etc/udev/udev.rules || \ - $$sudo sh -c ( echo ; cat $$f ) $(DESTDIR)/etc/udev/udev.rules ; \ - done ; \ -else if test -d $(DESTDIR)/etc/udev/rules.d ; then \ - for f in $(srcdir)/ksrc/nucleus/udev/*.rules ; do \ - sudo cp $$f $(DESTDIR)/etc/udev/rules.d/ ; \ - done ; \ - fi ; \ -fi ; \ +exit 0 ; } ; \ + echo 'sudo is working.' ; \ + fi ; \ + fi ; \ + if test -r $(DESTDIR)/etc/udev/udev.rules ; then \ + for f in $(srcdir)/ksrc/nucleus/udev/*.rules ; do \ + b=`basename $$f` ; \ + grep -q Xenomai:`basename $$b .rules` $(DESTDIR)/etc/udev/udev.rules || \ + $$sudo sh -c ( echo ; cat $$f ) $(DESTDIR)/etc/udev/udev.rules ; \ + done ; \ + else if test -d $(DESTDIR)/etc/udev/rules.d ; then \ + for f in $(srcdir)/ksrc/nucleus/udev/*.rules ; do \ +sudo cp $$f $(DESTDIR)/etc/udev/rules.d/ ; \ + done ; \ + fi ; \ + fi ; \ for n in `seq 0 31` ; do \ - f=$(DESTDIR)/dev/rtp$$n ; \ - if test \! -c $$f ; then \ - $$sudo mknod -m 666 $$f c 150 $$n ; \ - fi ; \ -done ; \ -if test \! -c $(DESTDIR)/dev/rtheap ; then \ - $$sudo mknod -m 666 $(DESTDIR)/dev/rtheap c 10 254 ; \ -fi + f=$(DESTDIR)/dev/rtp$$n ; \ + if test \! -c $$f ; then \ + $$sudo mknod -m 666 $$f c 150 $$n ; \ + fi ; \ + done ; \ + if test \! -c $(DESTDIR)/dev/rtheap ; then \ + $$sudo mknod -m 666 $(DESTDIR)/dev/rtheap c 10 254 ; \ + fi install-exec-local: devices @@ -60,7 +60,7 @@ if XENO_BUILD_LINUX if MAINTAINER_MODE linux/%: linux/.xenomai-prepared FORCE $(top_srcdir)/scripts/prepare-kernel.sh \ - --adeos=$(ADEOS_PATCH) --linux=linux \ +--adeos=$(ADEOS_PATCH) --linux=linux \ --arch=$(XENO_LINUX_ARCH) \ cross=`expr $(CC) : '\(.*\)gcc' || :` \ cd linux $(MAKE) $* \ @@ -68,7 +68,7 @@ linux/%: linux/.xenomai-prepared FORCE linux/all: linux/.xenomai-prepared FORCE $(top_srcdir)/scripts/prepare-kernel.sh \ - --adeos=$(ADEOS_PATCH) --linux=linux \ +--adeos=$(ADEOS_PATCH) --linux=linux \ --arch=$(XENO_LINUX_ARCH) \ cross=`expr $(CC) : '\(.*\)gcc' || :` \ cd linux $(MAKE) $(XENO_LINUX_ALL_TARGETS) \ @@ -100,9 +100,9 @@ linux/install: linux/all $$sudo $(mkinstalldirs) $(DESTDIR)/boot \ cross=`expr $(CC) : '\(.*\)gcc' || :` \ cd linux
[Xenomai-git] Jan Kiszka : mutex-torture: Add test for disallowed lock stealing
Module: xenomai-2.5 Branch: master Commit: 037d26157da458e1a90b42f7deca9fd1b1efb53e URL: http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=037d26157da458e1a90b42f7deca9fd1b1efb53e Author: Jan Kiszka jan.kis...@siemens.com Date: Sun Apr 25 16:16:32 2010 +0200 mutex-torture: Add test for disallowed lock stealing This test case reflects an existing bug in the lock stealing implementation: A lock is stolen from A and then released again. When A wakes up, it acquires the lock via the in-kernel fastpath and holds it while being busy. B preempts A and tries to acquire the lock as well. So far it steals it due to the bug while it should simply boost A and wait for the release. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- src/testsuite/unit/mutex-torture.c | 62 1 files changed, 62 insertions(+), 0 deletions(-) diff --git a/src/testsuite/unit/mutex-torture.c b/src/testsuite/unit/mutex-torture.c index fdcada4..3512977 100644 --- a/src/testsuite/unit/mutex-torture.c +++ b/src/testsuite/unit/mutex-torture.c @@ -597,6 +597,67 @@ void lock_stealing(void) NOTE: lock_stealing mutex_trylock: not supported\n); } +void *victim(void *cookie) +{ + mutex_t *mutex = (mutex_t *) cookie; + unsigned long long start; + + dispatch(victim pthread_detach, THREAD_DETACH, 1, 0); + dispatch(victim mutex_lock, MUTEX_LOCK, 1, 0, mutex); + + start = rt_timer_tsc(); + while (rt_timer_tsc2ns(rt_timer_tsc() - start) 11000); + + dispatch(victim mutex_unlock, MUTEX_UNLOCK, 1, 0, mutex); + + return cookie; +} + +void deny_stealing(void) +{ + unsigned long long start, diff; + mutex_t mutex; + thread_t lowprio_tid; + + fprintf(stderr, deny_stealing\n); + + dispatch(deny_stealing mutex_init, MUTEX_CREATE, 1, 0, mutex, 1, 0); + dispatch(deny_stealing mutex_lock 1, MUTEX_LOCK, 1, 0, mutex); + + /* Main thread should have higher priority */ + dispatch(deny_stealing thread_create, THREAD_CREATE, 1, 0, +lowprio_tid, 1, victim, mutex); + + /* Give lowprio thread 1 more ms to block on the mutex */ + ms_sleep(6); + + dispatch(deny_stealing mutex_unlock 1, MUTEX_UNLOCK, 1, 0, mutex); + + /* Steal the lock for a short while */ + dispatch(deny_stealing mutex_lock 2, MUTEX_LOCK, 1, 0, mutex); + dispatch(deny_stealing mutex_unlock 2, MUTEX_UNLOCK, 1, 0, mutex); + + /* Give lowprio thread a chance to run */ + ms_sleep(6); + + /* Try to reacquire the lock, but the lowprio thread should hold it */ + start = rt_timer_tsc(); + dispatch(deny_stealing mutex_lock 3, MUTEX_LOCK, 1, 0, mutex); + diff = rt_timer_tsc2ns(rt_timer_tsc() - start); + if (diff 1000) { + fprintf(stderr, FAILURE: main, waited %Ld.%03u us\n, + diff / 1000, (unsigned) (diff % 1000)); + exit(EXIT_FAILURE); + } + + dispatch(deny_stealing mutex_unlock 3, MUTEX_UNLOCK, 1, 0, mutex); + + /* Let waiter_lowprio a chance to run */ + ms_sleep(20); + + dispatch(deny_stealing mutex_destroy, MUTEX_DESTROY, 1, 0, mutex); +} + struct cond_mutex { mutex_t *mutex; cond_t *cond; @@ -739,6 +800,7 @@ int main(void) mode_switch(); pi_wait(); lock_stealing(); + deny_stealing(); simple_condwait(); recursive_condwait(); fprintf(stderr, Test OK\n); ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : native/buffer: reset buffer descriptor upon r/w preemption
Module: xenomai-2.5 Branch: master Commit: a259751ec439aae9980d2596004db4ec360888c3 URL: http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=a259751ec439aae9980d2596004db4ec360888c3 Author: Philippe Gerum r...@xenomai.org Date: Mon Mar 29 10:47:09 2010 +0200 native/buffer: reset buffer descriptor upon r/w preemption In order to perform data copy while reading/writing data from/to a buffer descriptor in a lockless manner, we rely on a control token for detecting any preemption that shall lead to invalidating the current buffer, before redoing the data acquisition. Make sure to reset the buffer descriptor appropriately, before redoing the acquisition, so that the old contents are discarded. --- ksrc/skins/native/buffer.c |8 ++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ksrc/skins/native/buffer.c b/ksrc/skins/native/buffer.c index 2d364bb..8aca559 100644 --- a/ksrc/skins/native/buffer.c +++ b/ksrc/skins/native/buffer.c @@ -400,8 +400,10 @@ redo: * the message, we have to resend the whole * thing. */ - if (bf-wrtoken != wrtoken) + if (bf-wrtoken != wrtoken) { + xnbufd_reset(bufd); goto redo; + } wroff = (wroff + n) % bf-bufsz; rbytes -= n; @@ -557,8 +559,10 @@ redo: * the message, we have to re-read the whole * thing. */ - if (bf-rdtoken != rdtoken) + if (bf-rdtoken != rdtoken) { + xnbufd_reset(bufd); goto redo; + } rdoff = (rdoff + n) % bf-bufsz; rbytes -= n; ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Jan Kiszka : nucleus: Fix bogus lock stealing case
Module: xenomai-2.5 Branch: master Commit: af9b015e6389a4812ae8ba194c9edf53d9f58d8e URL: http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=af9b015e6389a4812ae8ba194c9edf53d9f58d8e Author: Jan Kiszka jan.kis...@siemens.com Date: Sun Apr 25 16:20:51 2010 +0200 nucleus: Fix bogus lock stealing case See deny_stealing mutex test case for the detailed scenario. The bug was caused by XNWAKEN/wwake remaining untouched when returning from xnsynch_acquire with the lock held. Namely, the robbed original owner restarted the acquisition and grabbed the lock in the fast path without properly resetting XNWAKEN. This happens now right after returning from xnpod_suspend_thread (we can only gain this state when entering suspension). Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- ksrc/nucleus/synch.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ksrc/nucleus/synch.c b/ksrc/nucleus/synch.c index 7464951..7299405 100644 --- a/ksrc/nucleus/synch.c +++ b/ksrc/nucleus/synch.c @@ -514,6 +514,9 @@ xnflags_t xnsynch_acquire(struct xnsynch *synch, xnticks_t timeout, xnpod_suspend_thread(thread, XNPEND, timeout, timeout_mode, synch); + thread-wwake = NULL; + xnthread_clear_info(thread, XNWAKEN); + if (xnthread_test_info(thread, XNRMID | XNTIMEO | XNBREAK)) goto unlock_and_exit; @@ -548,9 +551,6 @@ xnflags_t xnsynch_acquire(struct xnsynch *synch, xnticks_t timeout, unlock_and_exit: - thread-wwake = NULL; - xnthread_clear_info(thread, XNWAKEN); - xnlock_put_irqrestore(nklock, s); return xnthread_test_info(thread, XNRMID|XNTIMEO|XNBREAK); ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Gilles Chanteperdrix : Merge commit 'rpm'
Module: xenomai-2.5 Branch: master Commit: 4b35a2e9094bfe158f16c5c84d85664c565b62fe URL: http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=4b35a2e9094bfe158f16c5c84d85664c565b62fe Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org Date: Sun May 2 03:08:44 2010 +0200 Merge commit 'rpm' --- ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Jan Kiszka : nucleus: fix excessive host tick latencies
Module: xenomai-2.5 Branch: master Commit: c8a0f8cb1bbda978dc8c4b1754eb6526861b4c73 URL: http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=c8a0f8cb1bbda978dc8c4b1754eb6526861b4c73 Author: Jan Kiszka jan.kis...@siemens.com Date: Sun May 2 03:14:40 2010 +0200 nucleus: fix excessive host tick latencies If a reschedule is pending, we won't allow the host timer to decide about the next hardware tick. But if that next reschedule will simply keep ROOT (which, e.g., happens during thread deletion), this deferral can impose significant unwanted timer latencies on Linux. --- ksrc/nucleus/pod.c |9 - 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/ksrc/nucleus/pod.c b/ksrc/nucleus/pod.c index 3ffd548..fb63f35 100644 --- a/ksrc/nucleus/pod.c +++ b/ksrc/nucleus/pod.c @@ -2184,9 +2184,16 @@ void __xnpod_schedule(struct xnsched *sched) zombie = xnthread_test_state(curr, XNZOMBIE); next = xnsched_pick_next(sched); - if (next == curr !xnthread_test_state(curr, XNRESTART)) + if (next == curr !xnthread_test_state(curr, XNRESTART)) { /* Note: the root thread never restarts. */ + if (unlikely(xnthread_test_state(next, XNROOT))) { + if (testbits(sched-status, XNHTICK)) + xnintr_host_tick(sched); + if (testbits(sched-status, XNHDEFER)) + xntimer_next_local_shot(sched); + } goto signal_unlock_and_exit; + } XENO_BUGON(NUCLEUS, need_resched == 0); ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : nucleus/shadow: revert commit 96f5fa2
Module: xenomai-2.5 Branch: master Commit: ac5c739dabcb14334c2e390a9e3064f11f97283c URL: http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=ac5c739dabcb14334c2e390a9e3064f11f97283c Author: Philippe Gerum r...@xenomai.org Date: Sat May 1 18:22:40 2010 +0200 nucleus/shadow: revert commit 96f5fa2 This patch reverts 96f5fa2, which did fix a real bug, but the wrong way. It broke basic assumptions in RPI management wrt SMP, introducing races in rpi_clear_remote() and xnshadow_rpi_check() at least, regarding the update of the RPI backlink (i.e. thread-rpi). Those assumptions are as follows: - RPI queues are per-CPU, and threads may enter/leave them only from the CPU they belong to, with one exception: rpi_clear_remote(). - threads may enter/leave RPI queues when they are in a state mutually exclusive to running rpi_clear_remote(). --- ksrc/nucleus/shadow.c | 70 ++-- 1 files changed, 32 insertions(+), 38 deletions(-) diff --git a/ksrc/nucleus/shadow.c b/ksrc/nucleus/shadow.c index 872c37f..873a9bc 100644 --- a/ksrc/nucleus/shadow.c +++ b/ksrc/nucleus/shadow.c @@ -170,40 +170,6 @@ static inline void set_switch_lock_owner(struct task_struct *p) #define rpi_p(t) ((t)-rpi != NULL) -static struct xnthread *rpi_next(struct xnsched *sched, spl_t s) -{ - struct xnthread *thread; - - thread = xnsched_peek_rpi(sched); - while (thread - xnthread_user_task(thread)-state != TASK_RUNNING - !xnthread_test_info(thread, XNATOMIC)) { - /* -* A blocked Linux task must be removed from the RPI -* list. Checking for XNATOMIC prevents from unlinking -* a thread which is currently in flight to the -* primary domain (see xnshadow_harden()); not doing -* so would open a tiny window for priority inversion. -* -* BIG FAT WARNING: Do not consider a blocked thread -* linked to another processor's RPI list for removal, -* since this may happen if such thread immediately -* resumes on the remote CPU. -*/ - xnsched_pop_rpi(thread); - thread-rpi = NULL; - xnlock_put_irqrestore(sched-rpilock, s); - /* Do NOT nest the rpilock and nklock locks. */ - xnlock_get_irqsave(nklock, s); - xnsched_suspend_rpi(thread); - xnlock_put_irqrestore(nklock, s); - xnlock_get_irqsave(sched-rpilock, s); - thread = xnsched_peek_rpi(sched); - } - - return thread; -} - static void rpi_push(struct xnsched *sched, struct xnthread *thread) { struct xnsched_class *sched_class; @@ -266,7 +232,7 @@ static void rpi_pop(struct xnthread *thread) return; } - top = rpi_next(sched, s); + top = xnsched_peek_rpi(sched); if (likely(top == NULL)) { prio = XNSCHED_IDLE_PRIO; sched_class = xnsched_class_idle; @@ -340,7 +306,7 @@ static void rpi_clear_remote(struct xnthread *thread) xnsched_pop_rpi(thread); thread-rpi = NULL; - if (rpi_next(rpi, s) == NULL) + if (xnsched_peek_rpi(rpi) == NULL) rcpu = xnsched_cpu(rpi); xnlock_put_irqrestore(rpi-rpilock, s); @@ -404,12 +370,40 @@ static inline void rpi_switch(struct task_struct *next_task) oldprio = xnsched_root_priority(sched); oldclass = xnsched_root_class(sched); + if (prev + current-state != TASK_RUNNING + !xnthread_test_info(prev, XNATOMIC)) { + /* +* A blocked Linux task must be removed from the RPI +* list. Checking for XNATOMIC prevents from unlinking +* a thread which is currently in flight to the +* primary domain (see xnshadow_harden()); not doing +* so would open a tiny window for priority inversion. +* +* BIG FAT WARNING: Do not consider a blocked thread +* linked to another processor's RPI list for removal, +* since this may happen if such thread immediately +* resumes on the remote CPU. +*/ + xnlock_get_irqsave(sched-rpilock, s); + if (prev-rpi == sched) { + xnsched_pop_rpi(prev); + prev-rpi = NULL; + xnlock_put_irqrestore(sched-rpilock, s); + /* Do NOT nest the rpilock and nklock locks. */ + xnlock_get_irqsave(nklock, s); + xnsched_suspend_rpi(prev); + xnlock_put_irqrestore(nklock, s); + } else + xnlock_put_irqrestore(sched-rpilock, s); + } + if (next == NULL ||
[Xenomai-git] Philippe Gerum : powerpc: upgrade I-pipe support to 2.6.34-rc5-powerpc-2. 9-01
Module: xenomai-2.5 Branch: master Commit: 5f22526e5092565047858fcbdde7d62820cf0eb2 URL: http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=5f22526e5092565047858fcbdde7d62820cf0eb2 Author: Philippe Gerum r...@xenomai.org Date: Mon Apr 26 08:54:21 2010 +0200 powerpc: upgrade I-pipe support to 2.6.34-rc5-powerpc-2.9-01 --- .../adeos-ipipe-2.6.34-rc5-powerpc-2.9-01.patch|11862 1 files changed, 11862 insertions(+), 0 deletions(-) Diff: http://git.xenomai.org/?p=xenomai-2.5.git;a=commitdiff;h=5f22526e5092565047858fcbdde7d62820cf0eb2 ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Gilles Chanteperdrix : registry: export the registry_obj_slots symbol
Module: xenomai-2.5 Branch: master Commit: 8cfad608219d6ed122c8206a11199273f8cb0ba4 URL: http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=8cfad608219d6ed122c8206a11199273f8cb0ba4 Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org Date: Sat May 1 14:06:01 2010 +0200 registry: export the registry_obj_slots symbol --- ksrc/nucleus/registry.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/ksrc/nucleus/registry.c b/ksrc/nucleus/registry.c index 4df31ba..53781f2 100644 --- a/ksrc/nucleus/registry.c +++ b/ksrc/nucleus/registry.c @@ -47,6 +47,7 @@ #endif struct xnobject *registry_obj_slots; +EXPORT_SYMBOL(registry_obj_slots); static xnqueue_t registry_obj_freeq; /* Free objects. */ ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Gilles Chanteperdrix : build: fix build for arm integrator platform
Module: xenomai-2.5 Branch: master Commit: 78524b0316a5f9ff29a343c034c45d93f99e8625 URL: http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=78524b0316a5f9ff29a343c034c45d93f99e8625 Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org Date: Sun May 2 12:04:36 2010 +0200 build: fix build for arm integrator platform --- configure|2 +- configure.in |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 5a9c8d9..7ee2016 100755 --- a/configure +++ b/configure @@ -11795,7 +11795,7 @@ fi else CONFIG_XENO_ARM_ARCH=$arch fi - case $arch in + case $CONFIG_XENO_ARM_ARCH in 4) XENO_ARM_ARCH_FLAGS=-march=armv4;; 5) XENO_ARM_ARCH_FLAGS=-march=armv5;; 6) XENO_ARM_ARCH_FLAGS=-march=armv6;; diff --git a/configure.in b/configure.in index 0130baf..9c68443 100644 --- a/configure.in +++ b/configure.in @@ -312,7 +312,7 @@ omap3, orion, pxa, pxa3xx, s3c2410, sa1100.]), else CONFIG_XENO_ARM_ARCH=$arch fi - case $arch in + case $CONFIG_XENO_ARM_ARCH in 4) XENO_ARM_ARCH_FLAGS=-march=armv4;; 5) XENO_ARM_ARCH_FLAGS=-march=armv5;; 6) XENO_ARM_ARCH_FLAGS=-march=armv6;; ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Gilles Chanteperdrix : posix wrappers: avoid undefined reference with uclibc
Module: xenomai-2.5 Branch: master Commit: 469dba926a33768b3e0b9c5ea8bbde981ad1 URL: http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=469dba926a33768b3e0b9c5ea8bbde981ad1 Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org Date: Sun May 2 12:15:16 2010 +0200 posix wrappers: avoid undefined reference with uclibc Do not wrap mmap64 and ftruncate64 if the libc does not provide them. --- src/skins/posix/wrappers.c |8 ++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/skins/posix/wrappers.c b/src/skins/posix/wrappers.c index 0e7d2f1..a3cc2d8 100644 --- a/src/skins/posix/wrappers.c +++ b/src/skins/posix/wrappers.c @@ -276,20 +276,24 @@ void *__real_mmap(void *addr, } /* 32 bits platform */ -#if LONG_MAX == 2147483647L +#if __WORDSIZE == 32 +#ifdef HAVE_FTRUNCATE64 __attribute__ ((weak)) int __real_ftruncate64(int fildes, long long length) { return ftruncate64(fildes, length); } +#endif /* HAVE_FTRUNCATE64 */ +#ifdef HAVE_MMAP64 __attribute__ ((weak)) void *__real_mmap64(void *addr, size_t len, int prot, int flags, int fd, long long off) { return mmap64(addr, len, prot, flags, fd, off); } -#endif +#endif /* HAVE_MMAP64 */ +#endif /* 32 bits */ __attribute__ ((weak)) int __real_munmap(void *addr, size_t len) ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: make cmd_read work with infinite acquisitions ( -S 0)
Module: xenomai-abe Branch: analogy Commit: c8acd651fc3fda0cdbf60a3e712ff7bad9c662f0 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=c8acd651fc3fda0cdbf60a3e712ff7bad9c662f0 Author: Alexis Berlemont alexis.berlem...@gmail.com Date: Mon Mar 22 22:37:33 2010 +0100 analogy: make cmd_read work with infinite acquisitions (-S 0) --- src/utils/analogy/cmd_read.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/utils/analogy/cmd_read.c b/src/utils/analogy/cmd_read.c index ee65dc9..fb21081 100644 --- a/src/utils/analogy/cmd_read.c +++ b/src/utils/analogy/cmd_read.c @@ -244,6 +244,7 @@ int main(int argc, char *argv[]) /* Update the command structure */ cmd.scan_end_arg = cmd.nb_chan; + cmd.stop_src = cmd.stop_arg != 0 ? TRIG_COUNT : TRIG_NONE; if (real_time != 0) { @@ -328,8 +329,9 @@ int main(int argc, char *argv[]) if (verbose != 0) { printf(cmd_read: scan size = %u\n, scan_size); - printf(cmd_read: size to read = %u\n, - scan_size * cmd.stop_arg); + if (cmd.stop_arg != 0) + printf(cmd_read: size to read = %u\n, + scan_size * cmd.stop_arg); } /* Cancel any former command which might be in progress */ ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: fix buffer checkings so as to allow infinite acquisitions
Module: xenomai-abe Branch: analogy Commit: 922969283f793bcebb5f7a99cb000f4d22ab42c2 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=922969283f793bcebb5f7a99cb000f4d22ab42c2 Author: Alexis Berlemont alexis.berlem...@gmail.com Date: Mon Mar 22 01:00:01 2010 +0100 analogy: fix buffer checkings so as to allow infinite acquisitions With unlimited acquisitions (cmd.stop_src == TRIG_NONE), the field end_count displayed by the buffer descriptor is set to 0. Many checkings in buffer.h did not properly handle this case. --- include/analogy/buffer.h | 11 ++- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/include/analogy/buffer.h b/include/analogy/buffer.h index 0ab93ba..007f01e 100644 --- a/include/analogy/buffer.h +++ b/include/analogy/buffer.h @@ -201,7 +201,6 @@ static inline int __pre_put(a4l_buf_t * buf, unsigned long count) static inline int __pre_abs_get(a4l_buf_t * buf, unsigned long count) { - /* The first time, we expect the buffer to be properly filled before the trigger occurence; by the way, we need tmp_count to have been initialized and tmp_count is updated right here */ @@ -213,7 +212,7 @@ static inline int __pre_abs_get(a4l_buf_t * buf, unsigned long count) last time, the DMA channel can easily overtake the tmp frontier because no more data were sent from user space; therefore no useless alarm should be sent */ - if ((long)(count - buf-end_count) 0) + if (buf-end_count != 0 (long)(count - buf-end_count) 0) goto out; /* Once the exception are passed, we check that the DMA @@ -253,7 +252,7 @@ static inline int __abs_put(a4l_buf_t * buf, unsigned long count) if ((old / buf-size) != (count / buf-size)) set_bit(A4L_BUF_EOBUF_NR, buf-evt_flags); - if ((long)(count - buf-end_count) = 0) + if (buf-end_count != 0 (long)(count - buf-end_count) = 0) set_bit(A4L_BUF_EOA_NR, buf-evt_flags); return 0; @@ -276,7 +275,7 @@ static inline int __abs_get(a4l_buf_t * buf, unsigned long count) if ((old / buf-size) != count / buf-size) set_bit(A4L_BUF_EOBUF_NR, buf-evt_flags); - if ((long)(count - buf-end_count) = 0) + if (buf-end_count != 0 (long)(count - buf-end_count) = 0) set_bit(A4L_BUF_EOA_NR, buf-evt_flags); return 0; @@ -303,7 +302,9 @@ static inline unsigned long __count_to_get(a4l_buf_t * buf) { unsigned long ret; - if (buf-end_count != 0 (long)(buf-end_count - buf-prd_count) 0) + /* If the acquisition is unlimited (end_count == 0), we must + not take into account end_count */ + if (buf-end_count == 0 || (long)(buf-end_count - buf-prd_count) 0) ret = buf-prd_count; else ret = buf-end_count; ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Daniele Nicolodi : analogy: make a4l_find_range return the index of the selected range
Module: xenomai-abe Branch: analogy Commit: 1bfa79e1a966515c3b2d0dd822376f92c4a91d42 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=1bfa79e1a966515c3b2d0dd822376f92c4a91d42 Author: Daniele Nicolodi nicol...@science.unitn.it Date: Sun Apr 4 01:45:00 2010 +0200 analogy: make a4l_find_range return the index of the selected range a4l_find_range did not provide the index of the most suitable range. This patch fix this issue by making the function return the index. -ENOENT is returned if no range was found. --- src/drvlib/analogy/range.c | 40 +++- 1 files changed, 23 insertions(+), 17 deletions(-) diff --git a/src/drvlib/analogy/range.c b/src/drvlib/analogy/range.c index 934c52a..fc4e302 100644 --- a/src/drvlib/analogy/range.c +++ b/src/drvlib/analogy/range.c @@ -154,8 +154,9 @@ int a4l_sizeof_subd(a4l_sbinfo_t *subd) * @param[in] max Maximal limit value * @param[out] rng Found range * - * @return 0 on success. Otherwise: + * @return The index of the most suitable range on success. Otherwise: * + * - -ENOENT is returned if a suitable range is not found. * - -EINVAL is returned if some argument is missing or wrong; *idx_subd, idx_chan and the dsc pointer should be checked; check *also the kernel log (dmesg); WARNING: a4l_fill_desc() should @@ -171,10 +172,14 @@ int a4l_find_range(a4l_desc_t * dsc, int i, ret; long lmin, lmax; a4l_chinfo_t *chinfo; - a4l_rnginfo_t *rnginfo; + a4l_rnginfo_t *rnginfo, *tmp = NULL; + unsigned int idx_rng = -ENOENT; + + if (rng != NULL) + *rng = NULL; /* Basic checkings */ - if (dsc == NULL || rng == NULL) + if (dsc == NULL) return -EINVAL; /* a4l_fill_desc() must have been called on this descriptor */ @@ -184,38 +189,39 @@ int a4l_find_range(a4l_desc_t * dsc, /* Retrieves the ranges count */ ret = a4l_get_chinfo(dsc, idx_subd, idx_chan, chinfo); if (ret 0) - goto out_get_range; + return ret; /* Initializes variables */ lmin = (long)(min * A4L_RNG_FACTOR); lmax = (long)(max * A4L_RNG_FACTOR); - *rng = NULL; /* Performs the research */ for (i = 0; i chinfo-nb_rng; i++) { ret = a4l_get_rnginfo(dsc, idx_subd, idx_chan, i, rnginfo); if (ret 0) - goto out_get_range; + return ret; if (A4L_RNG_UNIT(rnginfo-flags) == unit rnginfo-min = lmin rnginfo-max = lmax) { - if (*rng != NULL) { - if (rnginfo-min = (*rng)-min - rnginfo-max = (*rng)-max) - *rng = rnginfo; - } else - *rng = rnginfo; + if (tmp != NULL) { + if (rnginfo-min = tmp-min + rnginfo-max = tmp-max) { + idx_rng = i; + tmp = rnginfo; + } + } else { + idx_rng = i; + tmp = rnginfo; + } } } -out_get_range: - - if (ret 0) - *rng = NULL; + if (rng != NULL) + *rng = tmp; - return ret; + return idx_rng; } /** ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: fix a misuse of channel descriptors in a4l_get_chan
Module: xenomai-abe Branch: analogy Commit: c7bdcc70dad9792c637d0f152277c7365eb04b3a URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=c7bdcc70dad9792c637d0f152277c7365eb04b3a Author: Alexis Berlemont alexis.berlem...@gmail.com Date: Fri Apr 2 22:52:30 2010 +0200 analogy: fix a misuse of channel descriptors in a4l_get_chan The mode of the channel descriptor (global or specific) was not taken into account so as to find out the channel index. --- ksrc/drivers/analogy/buffer.c | 18 +++--- 1 files changed, 11 insertions(+), 7 deletions(-) diff --git a/ksrc/drivers/analogy/buffer.c b/ksrc/drivers/analogy/buffer.c index bbd79ec..3ec558a 100644 --- a/ksrc/drivers/analogy/buffer.c +++ b/ksrc/drivers/analogy/buffer.c @@ -112,7 +112,7 @@ a4l_cmd_t *a4l_get_cmd(a4l_subd_t *subd) int a4l_get_chan(a4l_subd_t *subd) { a4l_dev_t *dev = subd-dev; - int i, tmp_count, tmp_size = 0; + int i, j, tmp_count, tmp_size = 0; a4l_cmd_t *cmd; /* Check that subdevice supports commands */ @@ -132,9 +132,11 @@ int a4l_get_chan(a4l_subd_t *subd) /* We assume channels can have different sizes; so, we have to compute the global size of the channels in this command... */ - for (i = 0; i cmd-nb_chan; i++) - tmp_size += dev-transfer.subds[subd-idx]-chan_desc- - chans[CR_CHAN(cmd-chan_descs[i])].nb_bits; + for (i = 0; i cmd-nb_chan; i++) { + j = (subd-chan_desc-mode != A4L_CHAN_GLOBAL_CHANDESC) ? + CR_CHAN(cmd-chan_descs[i]) : 0; + tmp_size += subd-chan_desc-chans[j].nb_bits; + } /* Translation bits - bytes */ tmp_size /= 8; @@ -146,9 +148,11 @@ int a4l_get_chan(a4l_subd_t *subd) /* ...and find the channel the last munged sample was related with */ - for (i = 0; tmp_count 0 i cmd-nb_chan; i++) - tmp_count -= dev-transfer.subds[subd-idx]-chan_desc- - chans[CR_CHAN(cmd-chan_descs[i])].nb_bits; + for (i = 0; tmp_count 0 i cmd-nb_chan; i++) { + j = (subd-chan_desc-mode != A4L_CHAN_GLOBAL_CHANDESC) ? + CR_CHAN(cmd-chan_descs[i]) : 0; + tmp_count -= subd-chan_desc-chans[j].nb_bits; + } if (tmp_count == 0) return i; ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: fix ring-buffer issues
Module: xenomai-abe Branch: analogy Commit: 9dfff090e9d782de116b3761568dac51481f1c42 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=9dfff090e9d782de116b3761568dac51481f1c42 Author: Alexis Berlemont alexis.berlem...@gmail.com Date: Mon Mar 22 00:15:13 2010 +0100 analogy: fix ring-buffer issues --- include/analogy/buffer.h | 32 1 files changed, 16 insertions(+), 16 deletions(-) diff --git a/include/analogy/buffer.h b/include/analogy/buffer.h index 0e8f279..0ab93ba 100644 --- a/include/analogy/buffer.h +++ b/include/analogy/buffer.h @@ -87,11 +87,11 @@ static inline int __produce(a4l_cxt_t * cxt, int ret = 0; while (ret == 0 tmp_cnt != 0) { - /* Checks the data copy can be performed contiguously */ + /* Check the data copy can be performed contiguously */ unsigned long blk_size = (start_ptr + tmp_cnt buf-size) ? buf-size - start_ptr : tmp_cnt; - /* Performs the copy */ + /* Perform the copy */ if (cxt == NULL) memcpy(buf-buf + start_ptr, pin, blk_size); else @@ -99,7 +99,7 @@ static inline int __produce(a4l_cxt_t * cxt, buf-buf + start_ptr, pin, blk_size); - /* Updates pointers/counts */ + /* Update pointers/counts */ pin += blk_size; tmp_cnt -= blk_size; start_ptr = 0; @@ -117,11 +117,11 @@ static inline int __consume(a4l_cxt_t * cxt, int ret = 0; while (ret == 0 tmp_cnt != 0) { - /* Checks the data copy can be performed contiguously */ + /* Check the data copy can be performed contiguously */ unsigned long blk_size = (start_ptr + tmp_cnt buf-size) ? buf-size - start_ptr : tmp_cnt; - /* Performs the copy */ + /* Perform the copy */ if (cxt == NULL) memcpy(pout, buf-buf + start_ptr, blk_size); else @@ -130,7 +130,7 @@ static inline int __consume(a4l_cxt_t * cxt, buf-buf + start_ptr, blk_size); - /* Updates pointers/counts */ + /* Update pointers/counts */ pout += blk_size; tmp_cnt -= blk_size; start_ptr = 0; @@ -149,14 +149,14 @@ static inline void __munge(struct a4l_subdevice * subd, unsigned long tmp_cnt = count; while (tmp_cnt != 0) { - /* Checks the data copy can be performed contiguously */ + /* Check the data copy can be performed contiguously */ unsigned long blk_size = (start_ptr + tmp_cnt buf-size) ? buf-size - start_ptr : tmp_cnt; - /* Performs the munge operation */ + /* Perform the munge operation */ munge(subd, buf-buf + start_ptr, blk_size); - /* Updates the start pointer and the count */ + /* Update the start pointer and the count */ tmp_cnt -= blk_size; start_ptr = 0; } @@ -245,7 +245,7 @@ static inline int __abs_put(a4l_buf_t * buf, unsigned long count) { unsigned long old = buf-prd_count; - if (buf-prd_count = count) + if ((long)(buf-prd_count - count) = 0) return -EINVAL; buf-prd_count = count; @@ -253,7 +253,7 @@ static inline int __abs_put(a4l_buf_t * buf, unsigned long count) if ((old / buf-size) != (count / buf-size)) set_bit(A4L_BUF_EOBUF_NR, buf-evt_flags); - if (count = buf-end_count) + if ((long)(count - buf-end_count) = 0) set_bit(A4L_BUF_EOA_NR, buf-evt_flags); return 0; @@ -268,7 +268,7 @@ static inline int __abs_get(a4l_buf_t * buf, unsigned long count) { unsigned long old = buf-cns_count; - if (buf-cns_count = count) + if ((long)(buf-cns_count - count) = 0) return -EINVAL; buf-cns_count = count; @@ -276,7 +276,7 @@ static inline int __abs_get(a4l_buf_t * buf, unsigned long count) if ((old / buf-size) != count / buf-size) set_bit(A4L_BUF_EOBUF_NR, buf-evt_flags); - if (count = buf-end_count) + if ((long)(count - buf-end_count) = 0) set_bit(A4L_BUF_EOA_NR, buf-evt_flags); return 0; @@ -291,7 +291,7 @@ static inline unsigned long __count_to_put(a4l_buf_t * buf) { unsigned long ret; - if (buf-size + buf-cns_count buf-prd_count) + if ((long) (buf-size + buf-cns_count - buf-prd_count) 0) ret = buf-size + buf-cns_count - buf-prd_count; else
[Xenomai-git] Alexis Berlemont : analogy: [pcimio] register the digital trigger routine
Module: xenomai-abe Branch: analogy Commit: 6b006f5473187099b1115914869f1c8b374fc801 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=6b006f5473187099b1115914869f1c8b374fc801 Author: Alexis Berlemont alexis.berlem...@gmail.com Date: Thu Apr 15 01:40:38 2010 +0200 analogy: [pcimio] register the digital trigger routine --- .../analogy/national_instruments/mio_common.c | 18 ++ 1 files changed, 10 insertions(+), 8 deletions(-) diff --git a/ksrc/drivers/analogy/national_instruments/mio_common.c b/ksrc/drivers/analogy/national_instruments/mio_common.c index a51a3cd..96d3100 100644 --- a/ksrc/drivers/analogy/national_instruments/mio_common.c +++ b/ksrc/drivers/analogy/national_instruments/mio_common.c @@ -3365,8 +3365,9 @@ int ni_cdio_cmdtest(a4l_subd_t *subd, a4l_cmd_t *cmd) return -EINVAL; } - if (cmd-scan_begin_arg != - PACK_FLAGS(CDO_Sample_Source_Select_Mask, 0, 0, CR_INVERT)) + if ((cmd-scan_begin_arg +PACK_FLAGS(CDO_Sample_Source_Select_Mask, 0, 0, CR_INVERT)) != + cmd-scan_begin_arg) return -EINVAL; if (cmd-convert_arg != 0) { @@ -3404,8 +3405,8 @@ int ni_cdio_cmd(a4l_subd_t *subd, a4l_cmd_t *cmd) switch (cmd-scan_begin_src) { case TRIG_EXT: cdo_mode_bits |= - CR_CHAN(cmd- - scan_begin_arg) CDO_Sample_Source_Select_Mask; + CR_CHAN(cmd-scan_begin_arg) + CDO_Sample_Source_Select_Mask; break; default: BUG(); @@ -3429,8 +3430,6 @@ int ni_cdio_cmd(a4l_subd_t *subd, a4l_cmd_t *cmd) return retval; } - /* TODO: manage the trigger function */ - return 0; } @@ -5036,19 +5035,22 @@ int ni_E_init(a4l_dev_t *dev) subd-insn_bits = ni_m_series_dio_insn_bits_8; else subd-insn_bits = ni_m_series_dio_insn_bits_32; + subd-insn_config = ni_m_series_dio_insn_config; #if (defined(CONFIG_XENO_DRIVERS_ANALOGY_NI_MITE) || \ defined(CONFIG_XENO_DRIVERS_ANALOGY_NI_MITE_MODULE)) - a4l_dbg(1, drv_dbg, dev, - mio_common: DIO: command feature available\n); + a4l_dbg(1, drv_dbg, dev, + mio_common: DIO: command feature available\n); subd-flags |= A4L_SUBD_CMD; subd-do_cmd = ni_cdio_cmd; subd-do_cmdtest = ni_cdio_cmdtest; subd-cmd_mask = mio_dio_cmd_mask; subd-cancel = ni_cdio_cancel; + subd-trigger = ni_cdo_inttrig; + #endif /* CONFIG_XENO_DRIVERS_ANALOGY_NI_MITE */ ni_writel(CDO_Reset_Bit | CDI_Reset_Bit, M_Offset_CDIO_Command); ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: minor cosmetic fix
Module: xenomai-abe Branch: analogy Commit: aa95bb3e7f8d6fe642444c1c33061a6b693045d7 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=aa95bb3e7f8d6fe642444c1c33061a6b693045d7 Author: Alexis Berlemont alexis.berlem...@gmail.com Date: Thu Apr 15 01:42:39 2010 +0200 analogy: minor cosmetic fix --- ksrc/drivers/analogy/subdevice.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ksrc/drivers/analogy/subdevice.c b/ksrc/drivers/analogy/subdevice.c index 2d7811d..28aa4a0 100644 --- a/ksrc/drivers/analogy/subdevice.c +++ b/ksrc/drivers/analogy/subdevice.c @@ -67,19 +67,19 @@ a4l_rngdesc_t range_fake = RNG_GLOBAL(rng_fake); /* --- Basic channel / range management functions --- */ -a4l_chan_t *a4l_get_chfeat(a4l_subd_t * sb, int idx) +a4l_chan_t *a4l_get_chfeat(a4l_subd_t *sb, int idx) { int i = (sb-chan_desc-mode != A4L_CHAN_GLOBAL_CHANDESC) ? idx : 0; return (sb-chan_desc-chans[i]); } -a4l_rng_t *a4l_get_rngfeat(a4l_subd_t * sb, int chidx, int rngidx) +a4l_rng_t *a4l_get_rngfeat(a4l_subd_t *sb, int chidx, int rngidx) { int i = (sb-rng_desc-mode != A4L_RNG_GLOBAL_RNGDESC) ? chidx : 0; return (sb-rng_desc-rngtabs[i]-rngs[rngidx]); } -int a4l_check_chanlist(a4l_subd_t * subd, +int a4l_check_chanlist(a4l_subd_t *subd, unsigned char nb_chan, unsigned int *chans) { int i, j; ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: add the test program cmd_bits (beta version)
Module: xenomai-abe Branch: analogy Commit: 938c4a4de443d2c16647759cf567d7829eddd681 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=938c4a4de443d2c16647759cf567d7829eddd681 Author: Alexis Berlemont alexis.berlem...@gmail.com Date: Thu Apr 15 01:44:34 2010 +0200 analogy: add the test program cmd_bits (beta version) --- src/utils/analogy/Makefile.am | 10 +- src/utils/analogy/cmd_bits.c | 256 + 2 files changed, 263 insertions(+), 3 deletions(-) diff --git a/src/utils/analogy/Makefile.am b/src/utils/analogy/Makefile.am index d695eae..f82942e 100644 --- a/src/utils/analogy/Makefile.am +++ b/src/utils/analogy/Makefile.am @@ -1,6 +1,6 @@ sbin_PROGRAMS = analogy_config -bin_PROGRAMS = cmd_read cmd_write insn_read insn_write insn_bits +bin_PROGRAMS = cmd_read cmd_write cmd_bits insn_read insn_write insn_bits CPPFLAGS = \ @XENO_USER_CFLAGS@ \ @@ -29,17 +29,21 @@ cmd_write_LDADD = \ ../../skins/rtdm/librtdm.la \ ../../skins/common/libxenomai.la +cmd_bits_SOURCES = cmd_bits.c +cmd_bits_LDADD = \ + ../../drvlib/analogy/libanalogy.la \ + ../../skins/rtdm/librtdm.la \ + ../../skins/common/libxenomai.la + insn_read_SOURCES = insn_read.c insn_read_LDADD = \ ../../drvlib/analogy/libanalogy.la \ - ../../skins/native/libnative.la \ ../../skins/rtdm/librtdm.la \ ../../skins/common/libxenomai.la insn_write_SOURCES = insn_write.c insn_write_LDADD = \ ../../drvlib/analogy/libanalogy.la \ - ../../skins/native/libnative.la \ ../../skins/rtdm/librtdm.la \ ../../skins/common/libxenomai.la diff --git a/src/utils/analogy/cmd_bits.c b/src/utils/analogy/cmd_bits.c new file mode 100644 index 000..0afb69f --- /dev/null +++ b/src/utils/analogy/cmd_bits.c @@ -0,0 +1,256 @@ + +/** + * @file + * Analogy for Linux, digital command test program + * + * @note Copyright (C) 1997-2000 David A. Schleef d...@schleef.org + * @note Copyright (C) 2008 Alexis Berlemont alexis.berlem...@free.fr + * + * Xenomai is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Xenomai is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Xenomai; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include stdint.h +#include stdio.h +#include stdlib.h +#include sys/mman.h +#include errno.h +#include getopt.h + +#include analogy/analogy.h + +#define FILENAME analogy0 + +static char *filename = FILENAME; +static int verbose; + +/* TODO: to be removed */ +static unsigned int chans[4] = {0, 1, 2, 3}; + +/* The command to send by default */ +a4l_cmd_t cmd = { + .idx_subd = -1, + .flags = 0, + .start_src = TRIG_INT, + .start_arg = 0, + .scan_begin_src = TRIG_EXT, + .scan_begin_arg = 0, /* in ns */ + .convert_src = TRIG_NOW, + .convert_arg = 0, /* in ns */ + .scan_end_src = TRIG_COUNT, + .scan_end_arg = 4, + .stop_src = TRIG_NONE, + .stop_arg = 0, + .nb_chan = 4, + .chan_descs = chans, +}; + +struct option cmd_bits_opts[] = { + {verbose, no_argument, NULL, 'v'}, + {device, required_argument, NULL, 'd'}, + {subdevice, required_argument, NULL, 's'}, + {help, no_argument, NULL, 'h'}, + {0}, +}; + +void do_print_usage(void) +{ + fprintf(stdout, usage:\tcmd_bits [OPTS] bits_values mask\n); + fprintf(stdout, \tOPTS:\t -v, --verbose: verbose output\n); + fprintf(stdout, + \t\t -d, --device: + device filename (analogy0, analogy1, ...)\n); + fprintf(stdout, \t\t -s, --subdevice: subdevice index\n); + fprintf(stdout, \t\t -h, --help: print this help\n); +} + +int main(int argc, char *argv[]) +{ + int i = 0, err = 0; + a4l_desc_t dsc = { .sbdata = NULL }; + a4l_sbinfo_t *sbinfo; + int scan_size, idx_subd = -1; + int value, mask = 0; + + /* Compute arguments */ + while ((err = getopt_long(argc, + argv, + vd:s:h, cmd_bits_opts, NULL)) = 0) { + switch (err) { + case 'v': + verbose = 1; + break; + case 'd': + filename = optarg; + break; + case 's': + idx_subd = strtoul(optarg, NULL, 0); + break; + case 'h': +
[Xenomai-git] Alexis Berlemont : analogy: minor fix in insn_bits
Module: xenomai-abe Branch: analogy Commit: 46e3e006da389c4537c031762245a556f0b14e03 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=46e3e006da389c4537c031762245a556f0b14e03 Author: Alexis Berlemont alexis.berlem...@gmail.com Date: Wed Apr 21 00:25:54 2010 +0200 analogy: minor fix in insn_bits --- src/utils/analogy/insn_bits.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/utils/analogy/insn_bits.c b/src/utils/analogy/insn_bits.c index 9e672c4..192f897 100644 --- a/src/utils/analogy/insn_bits.c +++ b/src/utils/analogy/insn_bits.c @@ -1,6 +1,6 @@ /** * @file - * Analogy for Linux, instruction write test program + * Analogy for Linux, instruction bits test program * * @note Copyright (C) 1997-2000 David A. Schleef d...@schleef.org * @note Copyright (C) 2008 Alexis Berlemont alexis.berlem...@free.fr ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: add triggering in cmd_bits
Module: xenomai-abe Branch: analogy Commit: 6d244092529e86893b1b64ee89c1d4a7c12e0ea0 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=6d244092529e86893b1b64ee89c1d4a7c12e0ea0 Author: Alexis Berlemont alexis.berlem...@gmail.com Date: Wed Apr 21 00:28:01 2010 +0200 analogy: add triggering in cmd_bits --- src/utils/analogy/cmd_bits.c | 23 ++- 1 files changed, 22 insertions(+), 1 deletions(-) diff --git a/src/utils/analogy/cmd_bits.c b/src/utils/analogy/cmd_bits.c index 0afb69f..aa0e082 100644 --- a/src/utils/analogy/cmd_bits.c +++ b/src/utils/analogy/cmd_bits.c @@ -56,6 +56,12 @@ a4l_cmd_t cmd = { .chan_descs = chans, }; +a4l_insn_t insn = { + .type = A4L_INSN_INTTRIG, + .idx_subd = -1, + .data_size = 0, +}; + struct option cmd_bits_opts[] = { {verbose, no_argument, NULL, 'v'}, {device, required_argument, NULL, 'd'}, @@ -83,6 +89,9 @@ int main(int argc, char *argv[]) int scan_size, idx_subd = -1; int value, mask = 0; + /* Trigger status, written data..., before triggering */ + int triggered = 0, total = 0, trigger_threshold = 128; + /* Compute arguments */ while ((err = getopt_long(argc, argv, @@ -185,7 +194,7 @@ int main(int argc, char *argv[]) goto out_cmd_bits; } - cmd.idx_subd = idx_subd; + cmd.idx_subd = insn.idx_subd = idx_subd; if ((sbinfo-flags A4L_SUBD_TYPES) != A4L_SUBD_DIO (sbinfo-flags A4L_SUBD_TYPES) != A4L_SUBD_DO) { @@ -240,6 +249,18 @@ int main(int argc, char *argv[]) cmd_bits: a4l_write failed (err=%d)\n, err); goto out_cmd_bits; } + + total += err; + + if (!triggered total trigger_threshold) { + err = a4l_snd_insn(dsc, insn); + if (err 0) { + fprintf(stderr, + cmd_bits: triggering failed (err=%d)\n, + err); + goto out_cmd_bits; + } + } } while (err 0); ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: in the core, call rtdm_in_rt_context() instead of a4l_test_rt()
Module: xenomai-abe Branch: analogy Commit: ab0731793c18ffa133c13a540f07980e7046a38e URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=ab0731793c18ffa133c13a540f07980e7046a38e Author: Alexis Berlemont alexis.berlem...@gmail.com Date: Wed Apr 21 01:02:17 2010 +0200 analogy: in the core, call rtdm_in_rt_context() instead of a4l_test_rt() --- ksrc/drivers/analogy/buffer.c | 13 +++-- ksrc/drivers/analogy/device.c |2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/ksrc/drivers/analogy/buffer.c b/ksrc/drivers/analogy/buffer.c index 3ec558a..d882810 100644 --- a/ksrc/drivers/analogy/buffer.c +++ b/ksrc/drivers/analogy/buffer.c @@ -400,7 +400,7 @@ int a4l_ioctl_mmap(a4l_cxt_t *cxt, void *arg) /* The mmap operation cannot be performed in a real-time context */ - if (a4l_test_rt() != 0) { + if (rtdm_in_rt_context() != 0) { return -ENOSYS; } @@ -475,7 +475,7 @@ int a4l_ioctl_bufcfg(a4l_cxt_t * cxt, void *arg) /* As Linux API is used to allocate a virtual buffer, the calling process must not be in primary mode */ - if (a4l_test_rt() != 0) { + if (rtdm_in_rt_context() != 0) { return -ENOSYS; } @@ -730,7 +730,7 @@ ssize_t a4l_read(a4l_cxt_t * cxt, void *bufdata, size_t nbytes) /* If the acquisition is not over, we must not leave the function without having read a least byte */ else { - ret = a4l_wait_sync((buf-sync), a4l_test_rt()); + ret = a4l_wait_sync((buf-sync), rtdm_in_rt_context()); if (ret 0) { if (ret == -ERESTARTSYS) ret = -EINTR; @@ -823,7 +823,7 @@ ssize_t a4l_write(a4l_cxt_t *cxt, goto out_a4l_write; } else { /* The buffer is full, we have to wait for a slot to free */ - ret = a4l_wait_sync((buf-sync), a4l_test_rt()); + ret = a4l_wait_sync((buf-sync), rtdm_in_rt_context()); if (ret 0) { if (ret == -ERESTARTSYS) ret = -EINTR; @@ -953,11 +953,12 @@ int a4l_ioctl_poll(a4l_cxt_t * cxt, void *arg) goto out_poll; if (poll.arg == A4L_INFINITE) - ret = a4l_wait_sync((buf-sync), a4l_test_rt()); + ret = a4l_wait_sync((buf-sync), rtdm_in_rt_context()); else { unsigned long long ns = ((unsigned long long)poll.arg) * ((unsigned long long)NSEC_PER_MSEC); - ret = a4l_timedwait_sync((buf-sync), a4l_test_rt(), ns); + ret = a4l_timedwait_sync((buf-sync), +rtdm_in_rt_context(), ns); } if (ret == 0) { diff --git a/ksrc/drivers/analogy/device.c b/ksrc/drivers/analogy/device.c index ec40b95..a840ada 100644 --- a/ksrc/drivers/analogy/device.c +++ b/ksrc/drivers/analogy/device.c @@ -427,7 +427,7 @@ int a4l_ioctl_devcfg(a4l_cxt_t * cxt, void *arg) __a4l_dbg(1, core_dbg, a4l_ioctl_devcfg: minor=%d\n, a4l_get_minor(cxt)); - if (a4l_test_rt() != 0) + if (rtdm_in_rt_context() != 0) return -ENOSYS; if (arg == NULL) { ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: add calls to rtdm_rt_capable() in ioctl handlers
Module: xenomai-abe Branch: analogy Commit: c4baa205e55055c9c26d35537af6b06a012da223 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=c4baa205e55055c9c26d35537af6b06a012da223 Author: Alexis Berlemont alexis.berlem...@gmail.com Date: Wed Apr 21 01:17:07 2010 +0200 analogy: add calls to rtdm_rt_capable() in ioctl handlers Analogy now integrates calls to rtdm_rt_capable() in many ioctl handlers. Not all of them were updated: the ioctls in charge of the description of the board configuration (dev_info, subd_info, chan_info, rng_info) needs no real-time warranty in any way. --- ksrc/drivers/analogy/buffer.c | 30 ++ ksrc/drivers/analogy/command.c |3 +++ ksrc/drivers/analogy/instruction.c |6 ++ ksrc/drivers/analogy/transfer.c|3 +++ 4 files changed, 30 insertions(+), 12 deletions(-) diff --git a/ksrc/drivers/analogy/buffer.c b/ksrc/drivers/analogy/buffer.c index d882810..916a571 100644 --- a/ksrc/drivers/analogy/buffer.c +++ b/ksrc/drivers/analogy/buffer.c @@ -389,6 +389,12 @@ int a4l_ioctl_mmap(a4l_cxt_t *cxt, void *arg) __a4l_dbg(1, core_dbg, a4l_ioctl_mmap: minor=%d\n, a4l_get_minor(cxt)); + /* The mmap operation cannot be performed in a + real-time context */ + if (rtdm_in_rt_context() != 0) { + return -ENOSYS; + } + dev = a4l_get_dev(cxt); /* Basically check the device */ @@ -398,12 +404,6 @@ int a4l_ioctl_mmap(a4l_cxt_t *cxt, void *arg) return -EINVAL; } - /* The mmap operation cannot be performed in a - real-time context */ - if (rtdm_in_rt_context() != 0) { - return -ENOSYS; - } - /* Recover the argument structure */ if (rtdm_safe_copy_from_user(cxt-user_info, map_cfg, arg, sizeof(a4l_mmap_t)) != 0) @@ -467,18 +467,18 @@ int a4l_ioctl_bufcfg(a4l_cxt_t * cxt, void *arg) __a4l_dbg(1, core_dbg, a4l_ioctl_bufcfg: minor=%d\n, a4l_get_minor(cxt)); - /* Basic checking */ - if (!test_bit(A4L_DEV_ATTACHED, dev-flags)) { - __a4l_err(a4l_ioctl_bufcfg: unattached device\n); - return -EINVAL; - } - /* As Linux API is used to allocate a virtual buffer, the calling process must not be in primary mode */ if (rtdm_in_rt_context() != 0) { return -ENOSYS; } + /* Basic checking */ + if (!test_bit(A4L_DEV_ATTACHED, dev-flags)) { + __a4l_err(a4l_ioctl_bufcfg: unattached device\n); + return -EINVAL; + } + if (rtdm_safe_copy_from_user(cxt-user_info, buf_cfg, arg, sizeof(a4l_bufcfg_t)) != 0) @@ -536,6 +536,9 @@ int a4l_ioctl_bufinfo(a4l_cxt_t * cxt, void *arg) __a4l_dbg(1, core_dbg, a4l_ioctl_bufinfo: minor=%d\n, a4l_get_minor(cxt)); + if (rtdm_rt_capable(cxt-user_info) != 0) + return -ENOSYS; + /* Basic checking */ if (!test_bit(A4L_DEV_ATTACHED, dev-flags)) { __a4l_err(a4l_ioctl_bufinfo: unattached device\n); @@ -879,6 +882,9 @@ int a4l_ioctl_poll(a4l_cxt_t * cxt, void *arg) a4l_buf_t *buf; a4l_poll_t poll; + if (rtdm_rt_capable(cxt-user_info) != 0) + return -ENOSYS; + /* Basic checking */ if (!test_bit(A4L_DEV_ATTACHED, dev-flags)) { __a4l_err(a4l_poll: unattached device\n); diff --git a/ksrc/drivers/analogy/command.c b/ksrc/drivers/analogy/command.c index d58f05f..05e4d78 100644 --- a/ksrc/drivers/analogy/command.c +++ b/ksrc/drivers/analogy/command.c @@ -304,6 +304,9 @@ int a4l_ioctl_cmd(a4l_cxt_t * cxt, void *arg) __a4l_dbg(1, core_dbg, a4l_ioctl_cmd: minor=%d\n, a4l_get_minor(cxt)); + if (rtdm_rt_capable(cxt-user_info) != 0) + return -ENOSYS; + /* Basically check the device */ if (!test_bit(A4L_DEV_ATTACHED, dev-flags)) { __a4l_err(a4l_ioctl_cmd: cannot command diff --git a/ksrc/drivers/analogy/instruction.c b/ksrc/drivers/analogy/instruction.c index f3a4ed7..a95c8c5 100644 --- a/ksrc/drivers/analogy/instruction.c +++ b/ksrc/drivers/analogy/instruction.c @@ -292,6 +292,9 @@ int a4l_ioctl_insn(a4l_cxt_t * cxt, void *arg) a4l_kinsn_t insn; a4l_dev_t *dev = a4l_get_dev(cxt); + if (rtdm_rt_capable(cxt-user_info) != 0) + return -ENOSYS; + /* Basic checking */ if (!test_bit(A4L_DEV_ATTACHED, dev-flags)) { __a4l_err(a4l_ioctl_insn: unattached device\n); @@ -391,6 +394,9 @@ int a4l_ioctl_insnlist(a4l_cxt_t * cxt, void *arg) a4l_kilst_t ilst; a4l_dev_t *dev = a4l_get_dev(cxt); + if (rtdm_rt_capable(cxt-user_info) != 0) + return -ENOSYS; + /*
[Xenomai-git] Alexis Berlemont : analogy: remove useless device declarations in read / write syscalls handlers
Module: xenomai-abe Branch: analogy Commit: 7f84b16df4beb57883dd4e6ddd39c303563b2140 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=7f84b16df4beb57883dd4e6ddd39c303563b2140 Author: Alexis Berlemont alexis.berlem...@gmail.com Date: Wed Apr 28 00:29:19 2010 +0200 analogy: remove useless device declarations in read / write syscalls handlers --- ksrc/drivers/analogy/rtdm_interface.c |4 1 files changed, 0 insertions(+), 4 deletions(-) diff --git a/ksrc/drivers/analogy/rtdm_interface.c b/ksrc/drivers/analogy/rtdm_interface.c index 99abf2f..2973b59 100644 --- a/ksrc/drivers/analogy/rtdm_interface.c +++ b/ksrc/drivers/analogy/rtdm_interface.c @@ -151,11 +151,9 @@ ssize_t a4l_rt_read(struct rtdm_dev_context * context, rtdm_user_info_t * user_info, void *buf, size_t nbytes) { a4l_cxt_t cxt; - a4l_dev_t *dev; a4l_init_cxt(context, user_info, cxt); a4l_set_dev(cxt); - dev = a4l_get_dev(cxt); __a4l_dbg(1, core_dbg, a4l_rt_read: minor=%d\n, a4l_get_minor(cxt)); @@ -171,11 +169,9 @@ ssize_t a4l_rt_write(struct rtdm_dev_context * context, size_t nbytes) { a4l_cxt_t cxt; - a4l_dev_t *dev; a4l_init_cxt(context, user_info, cxt); a4l_set_dev(cxt); - dev = a4l_get_dev(cxt); __a4l_dbg(1, core_dbg, a4l_rt_write: minor=%d\n, a4l_get_minor(cxt)); ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git