[Xenomai-git] Philippe Gerum : powerpc: upgrade I-pipe support to 2.6.30.3-powerpc-2.7-04
Module: xenomai-head Branch: master Commit: dd0553ab19442581083a082a1d5378e28f526f9a URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=dd0553ab19442581083a082a1d5378e28f526f9a Author: Philippe Gerum r...@xenomai.org Date: Fri Dec 4 10:01:30 2009 +0100 powerpc: upgrade I-pipe support to 2.6.30.3-powerpc-2.7-04 --- ...adeos-ipipe-2.6.30.3-powerpc-DENX-2.7-04.patch} | 16 +--- 1 files changed, 9 insertions(+), 7 deletions(-) diff --git a/ksrc/arch/powerpc/patches/adeos-ipipe-2.6.30.3-powerpc-DENX-2.7-03.patch b/ksrc/arch/powerpc/patches/adeos-ipipe-2.6.30.3-powerpc-DENX-2.7-04.patch similarity index 99% rename from ksrc/arch/powerpc/patches/adeos-ipipe-2.6.30.3-powerpc-DENX-2.7-03.patch rename to ksrc/arch/powerpc/patches/adeos-ipipe-2.6.30.3-powerpc-DENX-2.7-04.patch index 682f6e7..a9f1efc 100644 --- a/ksrc/arch/powerpc/patches/adeos-ipipe-2.6.30.3-powerpc-DENX-2.7-03.patch +++ b/ksrc/arch/powerpc/patches/adeos-ipipe-2.6.30.3-powerpc-DENX-2.7-04.patch @@ -572,7 +572,7 @@ index b7e034b..d769f6d 100644 #define hard_irq_disable()local_irq_disable() diff --git a/arch/powerpc/include/asm/ipipe.h b/arch/powerpc/include/asm/ipipe.h new file mode 100644 -index 000..dafd95f +index 000..5fdbbb8 --- /dev/null +++ b/arch/powerpc/include/asm/ipipe.h @@ -0,0 +1,271 @@ @@ -623,10 +623,10 @@ index 000..dafd95f +#include asm/paca.h +#endif + -+#define IPIPE_ARCH_STRING 2.7-03 ++#define IPIPE_ARCH_STRING 2.7-04 +#define IPIPE_MAJOR_NUMBER2 +#define IPIPE_MINOR_NUMBER7 -+#define IPIPE_PATCH_NUMBER3 ++#define IPIPE_PATCH_NUMBER4 + +#ifdef CONFIG_IPIPE_WANT_PREEMPTIBLE_SWITCH + @@ -2303,10 +2303,10 @@ index 5328709..8c3a2b7 100644 sync diff --git a/arch/powerpc/kernel/ipipe.c b/arch/powerpc/kernel/ipipe.c new file mode 100644 -index 000..261e6fb +index 000..304d39b --- /dev/null +++ b/arch/powerpc/kernel/ipipe.c -@@ -0,0 +1,863 @@ +@@ -0,0 +1,865 @@ +/* -*- linux-c -*- + * linux/arch/powerpc/kernel/ipipe.c + * @@ -2421,6 +2421,9 @@ index 000..261e6fb +{ + __ipipe_ipi_irq = irq; + mb(); ++#ifndef CONFIG_DEBUGGER ++ irq_desc[irq].chip-startup(irq); ++#endif +} + +static void __ipipe_ipi_demux(int irq, struct pt_regs *regs) @@ -2469,7 +2472,7 @@ index 000..261e6fb + if (cpus_empty(cpumask)) + return CPU_MASK_NONE; /* Error -- bad mask value or non-routable IRQ. */ + -+ cpumask_copy(oldmask, irq_to_desc(irq)-affinity); ++ cpumask_copy(oldmask, irq_to_desc(irq)-affinity); + irq_to_desc(irq)-chip-set_affinity(irq, cpumask); + + return oldmask; @@ -2477,7 +2480,6 @@ index 000..261e6fb + +int __ipipe_send_ipi(unsigned ipi, cpumask_t cpumask) +{ -+ extern void mpic_send_ipi(unsigned int ipi_no, unsigned int cpu_mask); + unsigned long flags; + cpumask_t testmask; + int cpu; ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : build: fix powerpc config detection with --enable-linux-build
Module: xenomai-2.4 Branch: master Commit: d977aeaa7161a59524d9a25cbd96ee787af1f06f URL: http://git.xenomai.org/?p=xenomai-2.4.git;a=commit;h=d977aeaa7161a59524d9a25cbd96ee787af1f06f Author: Philippe Gerum r...@xenomai.org Date: Fri Dec 4 10:03:13 2009 +0100 build: fix powerpc config detection with --enable-linux-build --- configure|8 ++-- configure.in | 10 +++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/configure b/configure index be12ea9..1ab56fa 100755 --- a/configure +++ b/configure @@ -15279,8 +15279,12 @@ _LT_EOF test x$CONFIG_ARM = xy cfg_arch=arm || : test x$CONFIG_BLACKFIN = xy cfg_arch=blackfin || : test x$CONFIG_IA64 = xy cfg_arch=ia64 || : - test x$CONFIG_PPC = xy cfg_arch=ppc || : - test x$CONFIG_PPC64 = xy cfg_arch=ppc64 || : + if test x$CONFIG_PPC = xy; then + cfg_arch=ppc + test x$CONFIG_PPC32 = xy cfg_arch=powerpc || : + test x$CONFIG_PPC64 = xy cfg_arch=powerpc || : + test x$CONFIG_PPC_MERGE = xy cfg_arch=powerpc || : + fi test x$CONFIG_X86_64 = xy cfg_arch=x86_64 || : test x$CONFIG_X86 = xy cfg_arch=i386 || : if test $cfg_arch = $XENO_LINUX_ARCH ; then diff --git a/configure.in b/configure.in index 9b3b74f..134003a 100644 --- a/configure.in +++ b/configure.in @@ -374,8 +374,8 @@ patch. Default is to infer the patch name from Linux kernel version.]), cd conftest2.dir $LNDIR -silent -ignorelinks ../conftest1.dir \ cd .. test -e conftest2.dir/foo LNDIR=$LNDIR -silent -ignorelinks - rm -Rf contest1.dir conftest2.dir fi +rm -Rf contest1.dir conftest2.dir if test x$LNDIR = xlndir; then AC_MSG_RESULT(no) else @@ -424,8 +424,12 @@ patch. Default is to infer the patch name from Linux kernel version.]), test x$CONFIG_ARM = xy cfg_arch=arm || : test x$CONFIG_BLACKFIN = xy cfg_arch=blackfin || : test x$CONFIG_IA64 = xy cfg_arch=ia64 || : - test x$CONFIG_PPC = xy cfg_arch=ppc || : - test x$CONFIG_PPC64 = xy cfg_arch=ppc64 || : + if test x$CONFIG_PPC = xy; then + cfg_arch=ppc + test x$CONFIG_PPC32 = xy cfg_arch=powerpc || : + test x$CONFIG_PPC64 = xy cfg_arch=powerpc || : + test x$CONFIG_PPC_MERGE = xy cfg_arch=powerpc || : + fi test x$CONFIG_X86_64 = xy cfg_arch=x86_64 || : test x$CONFIG_X86 = xy cfg_arch=i386 || : if test $cfg_arch = $XENO_LINUX_ARCH ; then ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : powerpc: upgrade I-pipe support to 2.6.30.3-powerpc-2.7-04
Module: xenomai-2.4 Branch: master Commit: ccd151a6ffe8e286eb3f381a5fad9e00a99bb7de URL: http://git.xenomai.org/?p=xenomai-2.4.git;a=commit;h=ccd151a6ffe8e286eb3f381a5fad9e00a99bb7de Author: Philippe Gerum r...@xenomai.org Date: Fri Dec 4 10:02:11 2009 +0100 powerpc: upgrade I-pipe support to 2.6.30.3-powerpc-2.7-04 --- ...adeos-ipipe-2.6.30.3-powerpc-DENX-2.7-04.patch} | 16 +--- 1 files changed, 9 insertions(+), 7 deletions(-) diff --git a/ksrc/arch/powerpc/patches/adeos-ipipe-2.6.30.3-powerpc-DENX-2.7-03.patch b/ksrc/arch/powerpc/patches/adeos-ipipe-2.6.30.3-powerpc-DENX-2.7-04.patch similarity index 99% rename from ksrc/arch/powerpc/patches/adeos-ipipe-2.6.30.3-powerpc-DENX-2.7-03.patch rename to ksrc/arch/powerpc/patches/adeos-ipipe-2.6.30.3-powerpc-DENX-2.7-04.patch index 682f6e7..a9f1efc 100644 --- a/ksrc/arch/powerpc/patches/adeos-ipipe-2.6.30.3-powerpc-DENX-2.7-03.patch +++ b/ksrc/arch/powerpc/patches/adeos-ipipe-2.6.30.3-powerpc-DENX-2.7-04.patch @@ -572,7 +572,7 @@ index b7e034b..d769f6d 100644 #define hard_irq_disable()local_irq_disable() diff --git a/arch/powerpc/include/asm/ipipe.h b/arch/powerpc/include/asm/ipipe.h new file mode 100644 -index 000..dafd95f +index 000..5fdbbb8 --- /dev/null +++ b/arch/powerpc/include/asm/ipipe.h @@ -0,0 +1,271 @@ @@ -623,10 +623,10 @@ index 000..dafd95f +#include asm/paca.h +#endif + -+#define IPIPE_ARCH_STRING 2.7-03 ++#define IPIPE_ARCH_STRING 2.7-04 +#define IPIPE_MAJOR_NUMBER2 +#define IPIPE_MINOR_NUMBER7 -+#define IPIPE_PATCH_NUMBER3 ++#define IPIPE_PATCH_NUMBER4 + +#ifdef CONFIG_IPIPE_WANT_PREEMPTIBLE_SWITCH + @@ -2303,10 +2303,10 @@ index 5328709..8c3a2b7 100644 sync diff --git a/arch/powerpc/kernel/ipipe.c b/arch/powerpc/kernel/ipipe.c new file mode 100644 -index 000..261e6fb +index 000..304d39b --- /dev/null +++ b/arch/powerpc/kernel/ipipe.c -@@ -0,0 +1,863 @@ +@@ -0,0 +1,865 @@ +/* -*- linux-c -*- + * linux/arch/powerpc/kernel/ipipe.c + * @@ -2421,6 +2421,9 @@ index 000..261e6fb +{ + __ipipe_ipi_irq = irq; + mb(); ++#ifndef CONFIG_DEBUGGER ++ irq_desc[irq].chip-startup(irq); ++#endif +} + +static void __ipipe_ipi_demux(int irq, struct pt_regs *regs) @@ -2469,7 +2472,7 @@ index 000..261e6fb + if (cpus_empty(cpumask)) + return CPU_MASK_NONE; /* Error -- bad mask value or non-routable IRQ. */ + -+ cpumask_copy(oldmask, irq_to_desc(irq)-affinity); ++ cpumask_copy(oldmask, irq_to_desc(irq)-affinity); + irq_to_desc(irq)-chip-set_affinity(irq, cpumask); + + return oldmask; @@ -2477,7 +2480,6 @@ index 000..261e6fb + +int __ipipe_send_ipi(unsigned ipi, cpumask_t cpumask) +{ -+ extern void mpic_send_ipi(unsigned int ipi_no, unsigned int cpu_mask); + unsigned long flags; + cpumask_t testmask; + int cpu; ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : blackfin: fix all syscall templates
Module: xenomai-2.4 Branch: master Commit: 0b6b63885e91bd18c0aa31c935a0a1a5d44ef152 URL: http://git.xenomai.org/?p=xenomai-2.4.git;a=commit;h=0b6b63885e91bd18c0aa31c935a0a1a5d44ef152 Author: Philippe Gerum r...@xenomai.org Date: Fri Dec 4 10:09:08 2009 +0100 blackfin: fix all syscall templates Do not stack registers already marked as clobbered, and introduce mandatory memory clobber. --- include/asm-blackfin/syscall.h | 190 +++- 1 files changed, 92 insertions(+), 98 deletions(-) diff --git a/include/asm-blackfin/syscall.h b/include/asm-blackfin/syscall.h index 47ecb2d..1750694 100644 --- a/include/asm-blackfin/syscall.h +++ b/include/asm-blackfin/syscall.h @@ -101,117 +101,111 @@ static inline int __xn_interrupted_p(struct pt_regs *regs) */ #define __emit_syscall0(muxcode) \ -({ \ - long __res; \ - __asm__ __volatile__ ( \ - p0 = %1;\n\t \ - excpt 0;\n\t \ - %0=r0;\n\t \ - : =da (__res) \ - : d (muxcode) \ - : CC, P0); \ - __res; \ -}) + ({ \ + long __res; \ + __asm__ __volatile__ ( \ + p0 = %1;\n\t \ + excpt 0;\n\t \ + %0=r0;\n\t\ + : =da (__res) \ + : d (muxcode) \ + : CC,P0,memory); \ + __res; \ + }) #define __emit_syscall1(muxcode,a1)\ -({ \ - long __res; \ - __asm__ __volatile__ ( \ - r0=%2;\n\t \ - p0=%1;\n\t \ - excpt 0;\n\t \ - %0=r0;\n\t \ -: =da (__res) \ -: d (muxcode), \ - a ((long)(a1)) \ - : CC, R0, P0);\ - __res; \ -}) + ({ \ + long __res; \ + __asm__ __volatile__ ( \ + r0=%2;\n\t\ + p0=%1;\n\t\ + excpt 0;\n\t \ + %0=r0;\n\t\ + : =da (__res) \ + : d (muxcode),\ + a ((long)(a1)) \ + : CC, R0,P0,memory);\ + __res; \ + }) #define __emit_syscall2(muxcode,a1,a2) \ -({ \ - long __res; \ - __asm__ __volatile__ ( \ - r1=%3;\n\t \ - r0=%2;\n\t \ - p0=%1;\n\t \ - excpt 0;\n\t \ - %0=r0;\n\t \ -: =da (__res) \ -: d (muxcode), \ -
[Xenomai-git] Philippe Gerum : build: introduce CONFIG_XENO_SHARED to reflect shlib support
Module: xenomai-head Branch: master Commit: 98e228ddd09f3b8c9e30c10aa277c36a8b9f6fac URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=98e228ddd09f3b8c9e30c10aa277c36a8b9f6fac Author: Philippe Gerum r...@xenomai.org Date: Fri Dec 4 10:19:48 2009 +0100 build: introduce CONFIG_XENO_SHARED to reflect shlib support --- configure.in |2 +- src/testsuite/sigtest/Makefile.am |5 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 37d1ad2..cc2945e 100644 --- a/configure.in +++ b/configure.in @@ -629,7 +629,7 @@ test x$CONFIG_XENO_ARM_SA1100 = xy AC_DEFINE(CONFIG_XENO_ARM_SA1100,1,[config test x$CONFIG_XENO_CPU_XSC3 = xy AC_DEFINE(CONFIG_XENO_CPU_XSC3,1,[config]) test $XNARCH_ARM_TSC_TYPE AC_DEFINE_UNQUOTED(XNARCH_ARM_TSC_TYPE,$XNARCH_ARM_TSC_TYPE,[config]) test x$CONFIG_XENO_ARM_EABI = xy AC_DEFINE(CONFIG_XENO_ARM_EABI,1,[config]) - +AM_CONDITIONAL(CONFIG_XENO_SHARED,[test $enable_shared = 'yes']) # Default sampling period (ns) used in various tests AC_DEFINE_UNQUOTED(CONFIG_XENO_DEFAULT_PERIOD,$CONFIG_XENO_DEFAULT_PERIOD,[config]) diff --git a/src/testsuite/sigtest/Makefile.am b/src/testsuite/sigtest/Makefile.am index 9d7a342..a2f20bd 100644 --- a/src/testsuite/sigtest/Makefile.am +++ b/src/testsuite/sigtest/Makefile.am @@ -8,7 +8,10 @@ sigtest_SOURCES = sigtest.c sigtest_CPPFLAGS = -I$(top_srcdir)/include/posix $(XENO_USER_CFLAGS) -g -I$(top_srcdir)/include -sigtest_LDFLAGS = $(XENO_POSIX_WRAPPERS) $(XENO_USER_LDFLAGS) -rdynamic +sigtest_LDFLAGS = $(XENO_POSIX_WRAPPERS) $(XENO_USER_LDFLAGS) +if CONFIG_XENO_SHARED +sigtest_LDFLAGS += -rdynamic +endif sigtest_LDADD = \ ../../skins/posix/libpthread_rt.la -lpthread -lrt ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : build: bootstrap
Module: xenomai-head Branch: master Commit: 010b9364d08a0653ca9168fa0a7bfa1cd2c13aef URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=010b9364d08a0653ca9168fa0a7bfa1cd2c13aef Author: Philippe Gerum r...@xenomai.org Date: Fri Dec 4 10:19:59 2009 +0100 build: bootstrap --- Makefile.in| 193 +- aclocal.m4 | 323 +- config/Makefile.in | 43 +- configure | 5866 doc/Makefile.in| 131 +- doc/docbook/Makefile.in| 131 +- doc/docbook/custom-stylesheets/Makefile.in | 131 +- doc/docbook/custom-stylesheets/xsl/Makefile.in | 131 +- .../custom-stylesheets/xsl/common/Makefile.in | 43 +- doc/docbook/custom-stylesheets/xsl/fo/Makefile.in | 43 +- .../custom-stylesheets/xsl/html/Makefile.in| 43 +- doc/docbook/xenomai/Makefile.in| 43 +- doc/doxygen/Makefile.in| 43 +- doc/man/Makefile.in| 215 +- doc/txt/Makefile.in| 82 +- include/Makefile.in| 192 +- include/analogy/Makefile.in| 105 +- include/asm-arm/Makefile.in| 170 +- include/asm-arm/bits/Makefile.in | 105 +- include/asm-blackfin/Makefile.in | 170 +- include/asm-blackfin/bits/Makefile.in | 105 +- include/asm-generic/Makefile.in| 170 +- include/asm-generic/bits/Makefile.in | 105 +- include/asm-nios2/Makefile.in | 170 +- include/asm-nios2/bits/Makefile.in | 105 +- include/asm-powerpc/Makefile.in| 170 +- include/asm-powerpc/bits/Makefile.in | 105 +- include/asm-sim/Makefile.in| 170 +- include/asm-sim/bits/Makefile.in | 105 +- include/asm-x86/Makefile.in| 170 +- include/asm-x86/bits/Makefile.in | 105 +- include/native/Makefile.in | 105 +- include/nucleus/Makefile.in| 105 +- include/posix/Makefile.in | 170 +- include/posix/sys/Makefile.in | 105 +- include/psos+/Makefile.in | 105 +- include/rtai/Makefile.in | 105 +- include/rtdm/Makefile.in | 105 +- include/uitron/Makefile.in | 105 +- include/vrtx/Makefile.in | 105 +- include/vxworks/Makefile.in| 105 +- scripts/Makefile.in| 104 +- src/Makefile.in| 131 +- src/drvlib/Makefile.in | 131 +- src/drvlib/analogy/Makefile.in | 149 +- src/include/Makefile.in| 47 +- src/include/xeno_config.h.in |3 + src/rtdk/Makefile.in | 137 +- src/skins/Makefile.in | 131 +- src/skins/common/Makefile.in | 97 +- src/skins/native/Makefile.in | 203 +- src/skins/posix/Makefile.in| 191 +- src/skins/psos+/Makefile.in| 155 +- src/skins/rtai/Makefile.in | 125 +- src/skins/rtdm/Makefile.in | 125 +- src/skins/uitron/Makefile.in | 143 +- src/skins/vrtx/Makefile.in | 179 +- src/skins/vxworks/Makefile.in | 185 +- src/testsuite/Makefile.in | 131 +- src/testsuite/clocktest/Makefile.in| 133 +- src/testsuite/cyclic/Makefile.in | 133 +- src/testsuite/irqbench/Makefile.in | 137 +- src/testsuite/klatency/Makefile.in | 133 +- src/testsuite/latency/Makefile.in | 133 +- src/testsuite/sigtest/Makefile.in | 137 +- src/testsuite/switchtest/Makefile.in | 133 +- src/testsuite/unit/Makefile.in | 149 +- src/utils/Makefile.in | 131 +- src/utils/analogy/Makefile.in | 185 +- src/utils/can/Makefile.in | 185 +- src/utils/ps/Makefile.in | 129 +- 71 files changed, 8552 insertions(+), 6331 deletions(-) Diff: http://git.xenomai.org/?p=xenomai-head.git;a=commitdiff;h=010b9364d08a0653ca9168fa0a7bfa1cd2c13aef ___ Xenomai-git mailing list Xenomai-git@gna.org
[Xenomai-git] Philippe Gerum : x86: upgrade I-pipe support to 2.6.31.1-x86-2.4-07
Module: xenomai-head Branch: master Commit: 4f42de74f9b9a1d29093ba695e5ae0ff4a66a132 URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=4f42de74f9b9a1d29093ba695e5ae0ff4a66a132 Author: Philippe Gerum r...@xenomai.org Date: Fri Dec 4 10:30:01 2009 +0100 x86: upgrade I-pipe support to 2.6.31.1-x86-2.4-07 --- ...patch = adeos-ipipe-2.6.31.1-x86-2.4-07.patch} | 49 ++- 1 files changed, 26 insertions(+), 23 deletions(-) diff --git a/ksrc/arch/x86/patches/adeos-ipipe-2.6.31.1-x86-2.4-06.patch b/ksrc/arch/x86/patches/adeos-ipipe-2.6.31.1-x86-2.4-07.patch similarity index 99% rename from ksrc/arch/x86/patches/adeos-ipipe-2.6.31.1-x86-2.4-06.patch rename to ksrc/arch/x86/patches/adeos-ipipe-2.6.31.1-x86-2.4-07.patch index 9cdbf4d..19da2e1 100644 --- a/ksrc/arch/x86/patches/adeos-ipipe-2.6.31.1-x86-2.4-06.patch +++ b/ksrc/arch/x86/patches/adeos-ipipe-2.6.31.1-x86-2.4-07.patch @@ -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..017417c +index 000..ec73274 --- /dev/null +++ b/arch/x86/include/asm/ipipe.h @@ -0,0 +1,156 @@ @@ -199,10 +199,10 @@ index 000..017417c +#ifdef CONFIG_IPIPE + +#ifndef IPIPE_ARCH_STRING -+#define IPIPE_ARCH_STRING 2.4-06 ++#define IPIPE_ARCH_STRING 2.4-07 +#define IPIPE_MAJOR_NUMBER2 +#define IPIPE_MINOR_NUMBER4 -+#define IPIPE_PATCH_NUMBER6 ++#define IPIPE_PATCH_NUMBER7 +#endif + +DECLARE_PER_CPU(struct pt_regs, __ipipe_tick_regs); @@ -4065,18 +4065,19 @@ index 071166a..4944cbb 100644 * One CPU supports mwait = All CPUs supports mwait */ diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c -index 59f4524..a8a5cd1 100644 +index 59f4524..e31de9e 100644 --- a/arch/x86/kernel/process_32.c +++ b/arch/x86/kernel/process_32.c -@@ -114,6 +114,7 @@ void cpu_idle(void) +@@ -111,6 +111,8 @@ void cpu_idle(void) + if (cpu_is_offline(cpu)) + play_dead(); + ++ ipipe_suspend_domain(); ++ local_irq_disable(); /* Don't trace irqs off for idle */ stop_critical_timings(); -+ ipipe_suspend_domain(); - pm_idle(); - start_critical_timings(); - } -@@ -308,10 +309,12 @@ start_thread(struct pt_regs *regs, unsigned long new_ip, unsigned long new_sp) +@@ -308,10 +310,12 @@ start_thread(struct pt_regs *regs, unsigned long new_ip, unsigned long new_sp) regs-cs= __USER_CS; regs-ip= new_ip; regs-sp= new_sp; @@ -4089,7 +4090,7 @@ index 59f4524..a8a5cd1 100644 } EXPORT_SYMBOL_GPL(start_thread); -@@ -348,7 +351,7 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) +@@ -348,7 +352,7 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) { struct thread_struct *prev = prev_p-thread, *next = next_p-thread; @@ -4099,7 +4100,7 @@ index 59f4524..a8a5cd1 100644 /* never put a printk in __switch_to... printk() calls wake_up*() indirectly */ diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c -index ebefb54..02efd18 100644 +index ebefb54..b30dc4d 100644 --- a/arch/x86/kernel/process_64.c +++ b/arch/x86/kernel/process_64.c @@ -61,6 +61,8 @@ EXPORT_PER_CPU_SYMBOL(current_task); @@ -4111,15 +4112,17 @@ index ebefb54..02efd18 100644 unsigned long kernel_thread_flags = CLONE_VM | CLONE_UNTRACED; static ATOMIC_NOTIFIER_HEAD(idle_notifier); -@@ -143,6 +145,7 @@ void cpu_idle(void) - enter_idle(); - /* Don't trace irqs off for idle */ - stop_critical_timings(); -+ ipipe_suspend_domain(); - pm_idle(); - start_critical_timings(); - /* In many cases the interrupt that ended idle -@@ -295,6 +298,7 @@ int copy_thread(unsigned long clone_flags, unsigned long sp, +@@ -134,6 +136,9 @@ void cpu_idle(void) + + if (cpu_is_offline(smp_processor_id())) + play_dead(); ++ ++ ipipe_suspend_domain(); ++ + /* +* Idle routines should keep interrupts disabled +* from here on, until they go to idle. +@@ -295,6 +300,7 @@ int copy_thread(unsigned long clone_flags, unsigned long sp, p-thread.sp = (unsigned long) childregs; p-thread.sp0 = (unsigned long) (childregs+1); p-thread.usersp = me-thread.usersp; @@ -4127,7 +4130,7 @@ index ebefb54..02efd18 100644 set_tsk_thread_flag(p, TIF_FORK); -@@ -361,10 +365,12 @@ start_thread(struct pt_regs *regs, unsigned long
[Xenomai-git] Gilles Chanteperdrix : posix: cosmetic cleanup of pthread_cond_*wait
Module: xenomai-gch Branch: for-head Commit: 554e2b716f98d69b5d61de006fc9f3c1e38f2bc7 URL: http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=554e2b716f98d69b5d61de006fc9f3c1e38f2bc7 Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org Date: Thu Dec 3 21:13:54 2009 +0100 posix: cosmetic cleanup of pthread_cond_*wait --- src/skins/posix/cond.c | 16 1 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/skins/posix/cond.c b/src/skins/posix/cond.c index 0582367..7b99c92 100644 --- a/src/skins/posix/cond.c +++ b/src/skins/posix/cond.c @@ -124,12 +124,8 @@ int __wrap_pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex) pthread_cleanup_pop(0); - while (err == EINTR) - err = -XENOMAI_SKINCALL3(__pse51_muxid, -__pse51_cond_wait_epilogue, -c.cond-shadow_cond, -c.mutex-shadow_mutex, -c.count); + if (err == EINTR) + __pthread_cond_cleanup(c); cb_read_unlock(c.mutex-shadow_mutex.lock, s); @@ -163,12 +159,8 @@ int __wrap_pthread_cond_timedwait(pthread_cond_t * cond, pthread_cleanup_pop(0); - while (err == EINTR) - err = -XENOMAI_SKINCALL3(__pse51_muxid, -__pse51_cond_wait_epilogue, -c.cond-shadow_cond, -c.mutex-shadow_mutex, -c.count); + if (err == EINTR) + __pthread_cond_cleanup(c); cb_read_unlock(c.mutex-shadow_mutex.lock, s); ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Gilles Chanteperdrix : signals: reduce signals handling memory footprint
Module: xenomai-gch Branch: for-head Commit: e7e1d7638ee8d3de1099c68311766bfd4e534f31 URL: http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=e7e1d7638ee8d3de1099c68311766bfd4e534f31 Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org Date: Wed Dec 2 17:12:21 2009 +0100 signals: reduce signals handling memory footprint --- Makefile.in| 193 +- aclocal.m4 | 323 +- config/Makefile.in | 43 +- configure | 5860 doc/Makefile.in| 131 +- doc/docbook/Makefile.in| 131 +- doc/docbook/custom-stylesheets/Makefile.in | 131 +- doc/docbook/custom-stylesheets/xsl/Makefile.in | 131 +- .../custom-stylesheets/xsl/common/Makefile.in | 43 +- doc/docbook/custom-stylesheets/xsl/fo/Makefile.in | 43 +- .../custom-stylesheets/xsl/html/Makefile.in| 43 +- doc/docbook/xenomai/Makefile.in| 43 +- doc/doxygen/Makefile.in| 43 +- doc/man/Makefile.in| 215 +- doc/txt/Makefile.in| 82 +- include/Makefile.in| 192 +- include/analogy/Makefile.in| 105 +- include/asm-arm/Makefile.in| 170 +- include/asm-arm/bits/Makefile.in | 105 +- include/asm-arm/syscall.h |9 +- include/asm-blackfin/Makefile.in | 170 +- include/asm-blackfin/bits/Makefile.in | 105 +- include/asm-blackfin/syscall.h |8 +- include/asm-generic/Makefile.in| 170 +- include/asm-generic/bits/Makefile.in | 105 +- include/asm-generic/syscall.h | 18 +- include/asm-nios2/Makefile.in | 170 +- include/asm-nios2/bits/Makefile.in | 105 +- include/asm-nios2/syscall.h|8 +- include/asm-powerpc/Makefile.in| 170 +- include/asm-powerpc/bits/Makefile.in | 105 +- include/asm-powerpc/syscall.h |9 +- include/asm-sim/Makefile.in| 170 +- include/asm-sim/bits/Makefile.in | 105 +- include/asm-x86/Makefile.in| 170 +- include/asm-x86/bits/Makefile.in | 105 +- include/asm-x86/syscall.h | 93 +- include/native/Makefile.in | 105 +- include/nucleus/Makefile.in| 105 +- include/posix/Makefile.in | 170 +- include/posix/sys/Makefile.in | 105 +- include/psos+/Makefile.in | 105 +- include/rtai/Makefile.in | 105 +- include/rtdm/Makefile.in | 105 +- include/uitron/Makefile.in | 105 +- include/vrtx/Makefile.in | 105 +- include/vxworks/Makefile.in| 105 +- scripts/Makefile.in| 104 +- src/Makefile.in| 131 +- src/drvlib/Makefile.in | 131 +- src/drvlib/analogy/Makefile.in | 149 +- src/include/Makefile.in| 47 +- src/include/xeno_config.h.in |3 - src/rtdk/Makefile.in | 137 +- src/skins/Makefile.in | 131 +- src/skins/common/Makefile.in | 97 +- src/skins/common/bind.c| 38 + src/skins/native/Makefile.in | 203 +- src/skins/posix/Makefile.in| 191 +- src/skins/psos+/Makefile.in| 155 +- src/skins/rtai/Makefile.in | 125 +- src/skins/rtdm/Makefile.in | 125 +- src/skins/uitron/Makefile.in | 143 +- src/skins/vrtx/Makefile.in | 179 +- src/skins/vxworks/Makefile.in | 185 +- src/testsuite/Makefile.in | 131 +- src/testsuite/clocktest/Makefile.in| 133 +- src/testsuite/cyclic/Makefile.in | 133 +- src/testsuite/irqbench/Makefile.in | 137 +- src/testsuite/klatency/Makefile.in | 133 +- src/testsuite/latency/Makefile.in | 133 +- src/testsuite/sigtest/Makefile.in | 133 +- src/testsuite/switchtest/Makefile.in | 133 +- src/testsuite/unit/Makefile.in | 149 +- src/utils/Makefile.in
[Xenomai-git] Gilles Chanteperdrix : signals: reduce signals handling memory footprint
Module: xenomai-gch Branch: for-head Commit: 264b76b939fb2625b091a18133871e874479f97c URL: http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=264b76b939fb2625b091a18133871e874479f97c Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org Date: Fri Dec 4 23:27:17 2009 +0100 signals: reduce signals handling memory footprint --- include/asm-arm/syscall.h |9 +--- include/asm-blackfin/syscall.h |8 +--- include/asm-generic/syscall.h | 18 include/asm-nios2/syscall.h|8 +--- include/asm-powerpc/syscall.h |9 +--- include/asm-x86/syscall.h | 93 ++- src/skins/common/bind.c| 38 7 files changed, 98 insertions(+), 85 deletions(-) diff --git a/include/asm-arm/syscall.h b/include/asm-arm/syscall.h index be16e9c..0b51492 100644 --- a/include/asm-arm/syscall.h +++ b/include/asm-arm/syscall.h @@ -201,13 +201,6 @@ static inline int __xn_interrupted_p(struct pt_regs *regs) err = XENOMAI_DO_SYSCALL_INNER(nr, shifted_id, \ op, sigs, args); \ res = xnsig_dispatch(sigs, res, err); \ - \ - while (sigs.nsigs sigs.remaining) { \ - sigs.nsigs = 0; \ - err = XENOMAI_DO_SYSCALL_INNER \ - (0, 0, __xn_sys_get_next_sigs, sigs); \ - res = xnsig_dispatch_next(sigs, res, err); \ - } \ } while (res == -ERESTART); \ res;\ }) @@ -226,6 +219,8 @@ static inline int __xn_interrupted_p(struct pt_regs *regs) XENOMAI_DO_SYSCALL(5,0,op,a1,a2,a3,a4,a5) #define XENOMAI_SYSBIND(a1,a2,a3,a4) \ XENOMAI_DO_SYSCALL(4,0,__xn_sys_bind,a1,a2,a3,a4) +#define XENOMAI_SYSSIGS(sigs) \ + XENOMAI_DO_SYSCALL_INNER(0, 0, __xn_sys_get_next_sigs, sigs) #define XENOMAI_SKINCALL0(id,op) \ XENOMAI_DO_SYSCALL(0,id,op) diff --git a/include/asm-blackfin/syscall.h b/include/asm-blackfin/syscall.h index 02cc143..9f90611 100644 --- a/include/asm-blackfin/syscall.h +++ b/include/asm-blackfin/syscall.h @@ -221,12 +221,6 @@ static inline int __xn_interrupted_p(struct pt_regs *regs) __err__ = XENOMAI_DO_SYSCALL_INNER(nr, shifted_id, \ op, __sigs__, ##args); \ __res__ = xnsig_dispatch(__sigs__, __res__, __err__); \ - while (__sigs__.nsigs __sigs__.remaining) { \ - __sigs__.nsigs = 0; \ - __err__ = XENOMAI_DO_SYSCALL_INNER \ - (0, 0, __xn_sys_get_next_sigs, __sigs__); \ - __res__ = xnsig_dispatch_next(__sigs__, __res__, __err__); \ - } \ } while (__res__ == -ERESTART); \ __res__;\ }) @@ -238,6 +232,8 @@ static inline int __xn_interrupted_p(struct pt_regs *regs) #define XENOMAI_SYSCALL4(op,a1,a2,a3,a4) XENOMAI_DO_SYSCALL(4,0,op,a1,a2,a3,a4) #define XENOMAI_SYSCALL5(op,a1,a2,a3,a4,a5) XENOMAI_DO_SYSCALL(5,0,op,a1,a2,a3,a4,a5) #define XENOMAI_SYSBIND(a1,a2,a3,a4) XENOMAI_DO_SYSCALL(4,0,__xn_sys_bind,a1,a2,a3,a4) +#define XENOMAI_SYSSIGS(sigs) \ + XENOMAI_DO_SYSCALL_INNER(0, 0, __xn_sys_get_next_sigs, sigs) #define XENOMAI_SKINCALL0(id,op)XENOMAI_DO_SYSCALL(0,id,op) #define XENOMAI_SKINCALL1(id,op,a1) XENOMAI_DO_SYSCALL(1,id,op,a1) diff --git a/include/asm-generic/syscall.h b/include/asm-generic/syscall.h index 926498b..483b99f 100644 --- a/include/asm-generic/syscall.h +++ b/include/asm-generic/syscall.h @@ -158,10 +158,15 @@ static inline int __xn_safe_strncpy_from_user(char *dst, #else /* !__KERNEL__ */ #ifdef __cplusplus -extern C +extern C { #endif /* __cplusplus */ int __xnsig_dispatch(struct xnsig *sigs, int cumulated_error, int last_error); +int __xnsig_dispatch_safe(struct xnsig *sigs, int cumulated_error, int last_error); +#ifdef __cplusplus +} +#endif /* __cplusplus */ + /* Called to dispatch signals which interrupted a system call. */ static inline int xnsig_dispatch(struct xnsig *sigs, int cumul, int last) { @@ -170,16 +175,11 @@ static inline int xnsig_dispatch(struct xnsig *sigs, int cumul, int last)
[Xenomai-git] Gilles Chanteperdrix : posix: revert commit 58c1b922a96fedaef110c925a0dddb0e86dbcaf4
Module: xenomai-gch Branch: for-head Commit: b3e689de20636d5fdeedce28a7416807d412c78f URL: http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=b3e689de20636d5fdeedce28a7416807d412c78f Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org Date: Sat Dec 5 00:03:14 2009 +0100 posix: revert commit 58c1b922a96fedaef110c925a0dddb0e86dbcaf4 we do not want errors other than -EINTR returned by the mutex relocking in __wrap_pthred_cond_*wait to be ignored. --- src/skins/posix/cond.c | 26 +++--- 1 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/skins/posix/cond.c b/src/skins/posix/cond.c index d7087e6..0582367 100644 --- a/src/skins/posix/cond.c +++ b/src/skins/posix/cond.c @@ -86,7 +86,7 @@ struct pse51_cond_cleanup_t { unsigned count; }; -static void __pthread_cond_relock_mutex(void *data) +static void __pthread_cond_cleanup(void *data) { struct pse51_cond_cleanup_t *c = (struct pse51_cond_cleanup_t *) data; int err; @@ -111,7 +111,7 @@ int __wrap_pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex) if (cb_try_read_lock(c.mutex-shadow_mutex.lock, s)) return EINVAL; - pthread_cleanup_push(__pthread_cond_relock_mutex, c); + pthread_cleanup_push(__pthread_cond_cleanup, c); pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, oldtype); @@ -124,10 +124,12 @@ int __wrap_pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex) pthread_cleanup_pop(0); - if (err == EINTR) { - err = 0; - __pthread_cond_relock_mutex(c); - } + while (err == EINTR) + err = -XENOMAI_SKINCALL3(__pse51_muxid, +__pse51_cond_wait_epilogue, +c.cond-shadow_cond, +c.mutex-shadow_mutex, +c.count); cb_read_unlock(c.mutex-shadow_mutex.lock, s); @@ -149,7 +151,7 @@ int __wrap_pthread_cond_timedwait(pthread_cond_t * cond, if (cb_try_read_lock(c.mutex-shadow_mutex.lock, s)) return EINVAL; - pthread_cleanup_push(__pthread_cond_relock_mutex, c); + pthread_cleanup_push(__pthread_cond_cleanup, c); pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, oldtype); @@ -161,10 +163,12 @@ int __wrap_pthread_cond_timedwait(pthread_cond_t * cond, pthread_cleanup_pop(0); - if (err == EINTR) { - err = 0; - __pthread_cond_relock_mutex(c); - } + while (err == EINTR) + err = -XENOMAI_SKINCALL3(__pse51_muxid, +__pse51_cond_wait_epilogue, +c.cond-shadow_cond, +c.mutex-shadow_mutex, +c.count); cb_read_unlock(c.mutex-shadow_mutex.lock, s); ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Gilles Chanteperdrix : posix: mark nanosleep as non restartable
Module: xenomai-gch Branch: for-2.4 Commit: 57c50f58986471f5e2844969261b3d24adaecd83 URL: http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=57c50f58986471f5e2844969261b3d24adaecd83 Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org Date: Sat Dec 5 00:09:09 2009 +0100 posix: mark nanosleep as non restartable --- ksrc/skins/posix/syscall.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/ksrc/skins/posix/syscall.c b/ksrc/skins/posix/syscall.c index 4051257..f8c79d9 100644 --- a/ksrc/skins/posix/syscall.c +++ b/ksrc/skins/posix/syscall.c @@ -2811,7 +2811,8 @@ static xnsysent_t __systab[] = { [__pse51_clock_getres] = {__clock_getres, __xn_exec_any}, [__pse51_clock_gettime] = {__clock_gettime, __xn_exec_any}, [__pse51_clock_settime] = {__clock_settime, __xn_exec_any}, - [__pse51_clock_nanosleep] = {__clock_nanosleep, __xn_exec_primary}, + [__pse51_clock_nanosleep] = + {__clock_nanosleep, __xn_exec_primary | __xn_exec_norestart}, [__pse51_mutex_init] = {__pthread_mutex_init, __xn_exec_any}, [__pse51_mutex_destroy] = {__pthread_mutex_destroy, __xn_exec_any}, [__pse51_mutex_lock] = {__pthread_mutex_lock, __xn_exec_primary}, ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Peter Soetens : nucleus: move posix selector in nucleus for every skin to use.
Module: xenomai-gch Branch: for-2.4 Commit: a473a11f6d717b7bd098ce8cbc0ef6e329dbffb5 URL: http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=a473a11f6d717b7bd098ce8cbc0ef6e329dbffb5 Author: Peter Soetens pe...@thesourceworks.com Date: Thu Oct 1 15:57:54 2009 +0200 nucleus: move posix selector in nucleus for every skin to use. This patch makes the select implementation in syscall.c independent of the posix skin. --- include/nucleus/thread.h |4 ksrc/nucleus/pod.c | 12 ksrc/nucleus/thread.c |3 +++ ksrc/skins/posix/syscall.c |4 ++-- ksrc/skins/posix/thread.c |7 --- ksrc/skins/posix/thread.h |4 6 files changed, 21 insertions(+), 13 deletions(-) diff --git a/include/nucleus/thread.h b/include/nucleus/thread.h index 3eefb53..b651bd8 100644 --- a/include/nucleus/thread.h +++ b/include/nucleus/thread.h @@ -142,6 +142,7 @@ struct xnthread; struct xnsched; struct xnsynch; struct xnrpi; +struct xnselector; typedef struct xnthrops { @@ -207,6 +208,9 @@ typedef struct xnthread { xnstat_exectime_t account; /* Execution time accounting entity */ xnstat_exectime_t lastperiod; /* Interval marker for execution time reports */ } stat; +#ifdef CONFIG_XENO_OPT_SELECT +struct xnselector *selector;/* For select. */ +#endif /* CONFIG_XENO_OPT_SELECT */ int errcode; /* Local errno */ diff --git a/ksrc/nucleus/pod.c b/ksrc/nucleus/pod.c index 9348ce1..bee6a04 100644 --- a/ksrc/nucleus/pod.c +++ b/ksrc/nucleus/pod.c @@ -41,6 +41,7 @@ #include nucleus/registry.h #include nucleus/module.h #include nucleus/stat.h +#include nucleus/select.h #include asm/xenomai/bits/pod.h /* debug support */ @@ -1204,6 +1205,15 @@ void xnpod_delete_thread(xnthread_t *thread) xntimer_destroy(thread-rtimer); xntimer_destroy(thread-ptimer); +#ifdef CONFIG_XENO_OPT_SELECT + if (thread-selector) { + xnselector_destroy(thread-selector); + xnheap_schedule_free(kheap, thread-selector, +(xnholder_t *)thread-selector); + thread-selector = NULL; + } +#endif /* CONFIG_XENO_OPT_SELECT */ + if (xnthread_test_state(thread, XNPEND)) xnsynch_forget_sleeper(thread); @@ -1283,6 +1293,8 @@ void xnpod_abort_thread(xnthread_t *thread) if (!xnpod_current_p(thread)) xnpod_suspend_thread(thread, XNDORMANT, XN_INFINITE, XN_RELATIVE, NULL); xnpod_delete_thread(thread); + /* FIXME: in case thread has a selector, the xnfree(selector) + happens with nklock locked. */ xnlock_put_irqrestore(nklock, s); } diff --git a/ksrc/nucleus/thread.c b/ksrc/nucleus/thread.c index 5fceaec..0969c90 100644 --- a/ksrc/nucleus/thread.c +++ b/ksrc/nucleus/thread.c @@ -123,6 +123,9 @@ int xnthread_init(xnthread_t *thread, initph(thread-xlink); thread-rpi = NULL; #endif /* CONFIG_XENO_OPT_PRIOCPL */ +#ifdef CONFIG_XENO_OPT_SELECT + thread-selector = NULL; +#endif /* CONFIG_XENO_OPT_SELECT */ initpq(thread-claimq); xnarch_init_display_context(thread); diff --git a/ksrc/skins/posix/syscall.c b/ksrc/skins/posix/syscall.c index f8c79d9..6427d40 100644 --- a/ksrc/skins/posix/syscall.c +++ b/ksrc/skins/posix/syscall.c @@ -2370,11 +2370,11 @@ static int __select(struct task_struct *curr, struct pt_regs *regs) xntmode_t mode = XN_RELATIVE; struct xnselector *selector; struct timeval tv; - pthread_t thread; + xnthread_t *thread; int i, err, nfds; size_t fds_size; - thread = pse51_current_thread(); + thread = xnpod_current_thread(); if (!thread) return -EPERM; diff --git a/ksrc/skins/posix/thread.c b/ksrc/skins/posix/thread.c index ad4aaa5..6e89625 100644 --- a/ksrc/skins/posix/thread.c +++ b/ksrc/skins/posix/thread.c @@ -78,12 +78,6 @@ static void thread_delete_hook(xnthread_t *xnthread) pse51_mark_deleted(thread); pse51_signal_cleanup_thread(thread); pse51_timer_cleanup_thread(thread); -#ifdef CONFIG_XENO_OPT_POSIX_SELECT - if (thread-selector) { - xnselector_destroy(thread-selector); - thread-selector = NULL; - } -#endif /* CONFIG_XENO_OPT_POSIX_SELECT */ switch (thread_getdetachstate(thread)) { case PTHREAD_CREATE_DETACHED: @@ -216,7 +210,6 @@ int pthread_create(pthread_t *tid, pse51_signal_init_thread(thread, cur); pse51_tsd_init_thread(thread); pse51_timer_init_thread(thread); - thread-selector = NULL; if (thread-attr.policy == SCHED_RR) { xnthread_time_slice(thread-threadbase) = pse51_time_slice; diff --git a/ksrc/skins/posix/thread.h b/ksrc/skins/posix/thread.h index 33b14fd..fc8c6fe 100644 --- a/ksrc/skins/posix/thread.h +++ b/ksrc/skins/posix/thread.h @@ -21,7 +21,6 @@ #define _POSIX_THREAD_H
[Xenomai-git] Gilles Chanteperdrix : posix: fix pthread_cond_wait syscall signals handling
Module: xenomai-gch Branch: for-2.4 Commit: daa90535d99e549e87bd1985ae0b17d8f07b2fcc URL: http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=daa90535d99e549e87bd1985ae0b17d8f07b2fcc Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org Date: Fri Dec 4 23:50:37 2009 +0100 posix: fix pthread_cond_wait syscall signals handling --- ksrc/nucleus/shadow.c |2 +- ksrc/skins/posix/syscall.c | 14 +- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/ksrc/nucleus/shadow.c b/ksrc/nucleus/shadow.c index 0b02f70..b361480 100644 --- a/ksrc/nucleus/shadow.c +++ b/ksrc/nucleus/shadow.c @@ -823,7 +823,7 @@ static inline void request_syscall_restart(xnthread_t *thread, if (__xn_interrupted_p(regs)) { __xn_error_return(regs, (sysflags __xn_exec_norestart) ? - -ERESTARTNOHAND : -ERESTARTSYS); + -EINTR : -ERESTARTSYS); notify = !xnthread_test_state(thread, XNDEBUG); } diff --git a/ksrc/skins/posix/syscall.c b/ksrc/skins/posix/syscall.c index d936f21..4051257 100644 --- a/ksrc/skins/posix/syscall.c +++ b/ksrc/skins/posix/syscall.c @@ -1518,18 +1518,6 @@ static int __pthread_cond_wait_prologue(struct task_struct *curr, timed, XN_INFINITE); - if (err == EINTR) { - do { - xnthread_clear_info(cur, XNKICKED); - err = pse51_cond_timedwait_epilogue(cur, cnd.shadow_cond, - mx.shadow_mutex, count); - } - while (err == EINTR); - xnthread_set_info(cur, XNKICKED); - err = EINTR; - } - - if (!err || err == EINTR || err == ETIMEDOUT) __xn_copy_to_user(curr, (void __user *) __xn_reg_arg3(regs), count, sizeof(count)); @@ -2834,7 +2822,7 @@ static xnsysent_t __systab[] = { [__pse51_cond_init] = {__pthread_cond_init, __xn_exec_any}, [__pse51_cond_destroy] = {__pthread_cond_destroy, __xn_exec_any}, [__pse51_cond_wait_prologue] = - {__pthread_cond_wait_prologue, __xn_exec_primary}, + {__pthread_cond_wait_prologue, __xn_exec_primary | __xn_exec_norestart}, [__pse51_cond_wait_epilogue] = {__pthread_cond_wait_epilogue, __xn_exec_primary}, [__pse51_cond_signal] = {__pthread_cond_signal, __xn_exec_any}, ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Gilles Chanteperdrix : native: increase user-space native skin default stack size.
Module: xenomai-gch Branch: for-2.4 Commit: 0c79a25de4ef172bf1bcc0b311202e4bdbd78027 URL: http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=0c79a25de4ef172bf1bcc0b311202e4bdbd78027 Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org Date: Thu Aug 13 21:25:32 2009 +0200 native: increase user-space native skin default stack size. PTHREAD_STACK_MIN varies a lot depending on architecture and versions of the glibc, so, choose a reasonable default value of 32K for the default stack size instead of relying on PTHREAD_STACK_MIN in case its value would be too small for a simple printf. --- src/skins/native/task.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/src/skins/native/task.c b/src/skins/native/task.c index 41c72fd..b85f75c 100644 --- a/src/skins/native/task.c +++ b/src/skins/native/task.c @@ -132,6 +132,8 @@ int rt_task_create(RT_TASK *task, pthread_attr_init(thattr); + if (!stksize) + stksize = 32 * 1024; if (stksize PTHREAD_STACK_MIN) stksize = PTHREAD_STACK_MIN; ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Gilles Chanteperdrix : nucleus: defer selector block deletion to an APC.
Module: xenomai-gch Branch: for-2.4 Commit: 3d4e22a501b33979f3be98d6ed2e3947f2361567 URL: http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=3d4e22a501b33979f3be98d6ed2e3947f2361567 Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org Date: Thu Nov 5 23:49:43 2009 +0100 nucleus: defer selector block deletion to an APC. Avoid creating reschedulings in the middle of xnpod_delete_thread. --- include/nucleus/select.h |5 +++ ksrc/nucleus/module.c| 19 +++-- ksrc/nucleus/pod.c |4 --- ksrc/nucleus/select.c| 64 ++ 4 files changed, 74 insertions(+), 18 deletions(-) diff --git a/include/nucleus/select.h b/include/nucleus/select.h index b098b63..20eefbe 100644 --- a/include/nucleus/select.h +++ b/include/nucleus/select.h @@ -41,6 +41,7 @@ struct xnselector { fd_set expected; fd_set pending; } fds [XNSELECT_MAX_TYPES]; + xnholder_t destroy_link; xnqueue_t bindings; /* only used by xnselector_destroy */ }; @@ -106,6 +107,10 @@ int xnselect(struct xnselector *selector, void xnselector_destroy(struct xnselector *selector); +int xnselect_mount(void); + +int xnselect_umount(void); + #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/ksrc/nucleus/module.c b/ksrc/nucleus/module.c index bc3bc59..cde32f9 100644 --- a/ksrc/nucleus/module.c +++ b/ksrc/nucleus/module.c @@ -34,6 +34,7 @@ #ifdef CONFIG_XENO_OPT_PERVASIVE #include nucleus/core.h #endif /* CONFIG_XENO_OPT_PERVASIVE */ +#include nucleus/select.h #include asm/xenomai/bits/init.h MODULE_DESCRIPTION(Xenomai nucleus); @@ -1171,11 +1172,18 @@ int __init __xeno_sys_init(void) goto cleanup_arch; #endif /* CONFIG_XENO_OPT_PIPE */ +#ifdef CONFIG_XENO_OPT_SELECT + err = xnselect_mount(); + + if (err) + goto cleanup_pipe; +#endif /* CONFIG_XENO_OPT_SELECT */ + #ifdef CONFIG_XENO_OPT_PERVASIVE err = xnshadow_mount(); if (err) - goto cleanup_pipe; + goto cleanup_select; err = xnheap_mount(); @@ -1201,10 +1209,15 @@ int __init __xeno_sys_init(void) xnshadow_cleanup(); - cleanup_pipe: - + cleanup_select: #endif /* CONFIG_XENO_OPT_PERVASIVE */ +#ifdef CONFIG_XENO_OPT_SELECT + xnselect_umount(); + + cleanup_pipe: +#endif /* CONFIG_XENO_OPT_SELECT */ + #ifdef CONFIG_XENO_OPT_PIPE xnpipe_umount(); diff --git a/ksrc/nucleus/pod.c b/ksrc/nucleus/pod.c index bee6a04..386f86a 100644 --- a/ksrc/nucleus/pod.c +++ b/ksrc/nucleus/pod.c @@ -1208,8 +1208,6 @@ void xnpod_delete_thread(xnthread_t *thread) #ifdef CONFIG_XENO_OPT_SELECT if (thread-selector) { xnselector_destroy(thread-selector); - xnheap_schedule_free(kheap, thread-selector, -(xnholder_t *)thread-selector); thread-selector = NULL; } #endif /* CONFIG_XENO_OPT_SELECT */ @@ -1293,8 +1291,6 @@ void xnpod_abort_thread(xnthread_t *thread) if (!xnpod_current_p(thread)) xnpod_suspend_thread(thread, XNDORMANT, XN_INFINITE, XN_RELATIVE, NULL); xnpod_delete_thread(thread); - /* FIXME: in case thread has a selector, the xnfree(selector) - happens with nklock locked. */ xnlock_put_irqrestore(nklock, s); } diff --git a/ksrc/nucleus/select.c b/ksrc/nucleus/select.c index 502e7f6..d63503f 100644 --- a/ksrc/nucleus/select.c +++ b/ksrc/nucleus/select.c @@ -53,6 +53,9 @@ #include linux/types.h #include linux/bitops.h /* For hweight_long */ +static xnqueue_t xnselectors; +static int xnselect_apc; + #define link2binding(baddr, memb) \ container_of(baddr, struct xnselect_binding, memb) @@ -388,28 +391,67 @@ EXPORT_SYMBOL(xnselect); */ void xnselector_destroy(struct xnselector *selector) { - xnholder_t *holder; spl_t s; + inith(selector-destroy_link); xnlock_get_irqsave(nklock, s); - while ((holder = getq(selector-bindings))) { - struct xnselect_binding *binding; - struct xnselect *fd; + appendq(xnselectors, selector-destroy_link); + xnlock_put_irqrestore(nklock, s); + + rthal_apc_schedule(xnselect_apc); +} +EXPORT_SYMBOL_GPL(xnselector_destroy); + +static void xnselector_destroy_loop(void *cookie) +{ + struct xnselector *selector; + xnholder_t *holder; + int resched; + spl_t s; - binding = link2binding(holder, slink); - fd = binding-fd; - removeq(fd-bindings, binding-link); + xnlock_get_irqsave(nklock, s); + while ((holder = getq(xnselectors))) { + selector = container_of(holder, struct xnselector, destroy_link); + while ((holder = getq(selector-bindings))) { + struct xnselect_binding *binding; +