[Xenomai-git] Philippe Gerum : native/buffer: reset buffer descriptor upon r/w preemption
Module: xenomai-rpm Branch: for-upstream Commit: a259751ec439aae9980d2596004db4ec360888c3 URL: http://git.xenomai.org/?p=xenomai-rpm.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] Philippe Gerum : nucleus: introduce bufd reset operation
Module: xenomai-rpm Branch: for-upstream Commit: 410a9890e200385bc7aa40de8db8f6d924471db2 URL: http://git.xenomai.org/?p=xenomai-rpm.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 : powerpc: mention official URL to mainline kernel releases
Module: xenomai-rpm Branch: for-upstream Commit: 44b05fbf13a5c17a1d68f42605ef043dbbf99493 URL: http://git.xenomai.org/?p=xenomai-rpm.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-rpm Branch: for-upstream Commit: 40538a3a8cf4f997d884ebf3e94db795f5df0055 URL: http://git.xenomai.org/?p=xenomai-rpm.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 : x86: upgrade I-pipe support to 2.6.32.11-x86-2.6-02
Module: xenomai-rpm Branch: for-upstream Commit: f081d26bcbdeeb5a0530c45cbe81b752c98f822b URL: http://git.xenomai.org/?p=xenomai-rpm.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: reduce overhead of thread handle lookup
Module: xenomai-rpm Branch: for-upstream Commit: 5f3b0f1055ef6c1b595de59789146e4b48872e6b URL: http://git.xenomai.org/?p=xenomai-rpm.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] Philippe Gerum : nucleus: fix relaxing synch owner detector
Module: xenomai-rpm Branch: for-upstream Commit: 73dc92a1cab4d63bf1cb47f47f39cc4eab64c274 URL: http://git.xenomai.org/?p=xenomai-rpm.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] Stefan Kisdaroczi : debian: sync with 2.5.2-1 from debian.org
Module: xenomai-rpm Branch: for-upstream Commit: 67d3e44ea72f435ce0434316fe06ee5a029e6345 URL: http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=67d3e44ea72f435ce0434316fe06ee5a029e6345 Author: Stefan Kisdaroczi ki...@hispeed.ch Date: Thu Apr 15 11:11:26 2010 +0200 debian: sync with 2.5.2-1 from debian.org --- debian/changelog |6 ++ debian/libxenomai1.lintian |7 ++- debian/rules |1 + debian/xenomai-runtime.install |1 + 4 files changed, 14 insertions(+), 1 deletions(-) diff --git a/debian/changelog b/debian/changelog index 6d2d3cf..3e4a44b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +xenomai (2.5.2-1) unstable; urgency=low + + * New upstream release + + -- Roland Stigge sti...@antcom.de Mon, 29 Mar 2010 20:51:07 +0200 + xenomai (2.5.1-4) unstable; urgency=low * Added patches by Stefan Kisdaroczi ki...@hispeed.ch: diff --git a/debian/libxenomai1.lintian b/debian/libxenomai1.lintian index fe0da46..f5694a3 100644 --- a/debian/libxenomai1.lintian +++ b/debian/libxenomai1.lintian @@ -1,2 +1,7 @@ -# no contained shared library names refer to xenomai, therefore own name +# The package libxenomai1 first didn't contain a library called *xenomai*. +# Therefore, I called it libxenomai1. Now, upstream introduced libxenomai0 in +# the package. I'm leaving the package name libxenomai1 for now since +# downgrading the number in the package name is probably a bad idea, and +# synchronizing the package name with the SO version number isn't easily +# possible anyway since the package contains several libraries. libxenomai1: package-name-doesnt-match-sonames libanalogy1 libnative3 libpsos0 libpthread-rt1 librtai0 librtdk0 librtdm1 libuitron0 libvrtx0 libvxworks1 libxenomai0 diff --git a/debian/rules b/debian/rules index 4cb53a3..38991e2 100755 --- a/debian/rules +++ b/debian/rules @@ -38,6 +38,7 @@ endif CONFIG_OPTS += --prefix=/usr \ --includedir=/usr/include/xenomai \ --mandir=/usr/share/man \ + --with-testdir=/usr/lib/xenomai ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE)) CONFIG_OPTS += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE) diff --git a/debian/xenomai-runtime.install b/debian/xenomai-runtime.install index c9eee75..d1dbe13 100644 --- a/debian/xenomai-runtime.install +++ b/debian/xenomai-runtime.install @@ -2,3 +2,4 @@ usr/bin usr/sbin usr/share/man usr/share/xenomai +usr/lib/xenomai ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git