[Xenomai-git] Philippe Gerum : doc/asciidoc: update guides
Module: xenomai-3 Branch: next Commit: f86c6d67d8caeb5cb158113d87fbc5a52654b4c0 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=f86c6d67d8caeb5cb158113d87fbc5a52654b4c0 Author: Philippe Gerum r...@xenomai.org Date: Tue Mar 24 11:23:09 2015 +0100 doc/asciidoc: update guides --- doc/asciidoc/README.INSTALL.adoc | 20 +++- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/doc/asciidoc/README.INSTALL.adoc b/doc/asciidoc/README.INSTALL.adoc index efec3aa..8206a83 100644 --- a/doc/asciidoc/README.INSTALL.adoc +++ b/doc/asciidoc/README.INSTALL.adoc @@ -350,8 +350,11 @@ although this is not mandatory if building with `--disable-tls`. the target kernel running the real-time applications. In addition, the FUSE development libraries must be available from the toolchain. -- The autoconf (= 2.62), automake and libtool packages must be - available on your build system. +- If you plan to build from the sources available from the Xenomai GIT + tree (git.xenomai.org), the autoconf (= 2.62), automake and libtool + packages must be available on your build system. This is not + required when building from a source tree extracted from a + http://download.gna.org/xenomai/[release tarball]. _Cobalt_-specific requirements ^^ @@ -377,14 +380,21 @@ _Mercury_-specific requirement Configuring ~~~ -First, the `configure` script and Makefiles must be generated in the -Xenomai source tree. The recommended way is to run the automatic -reconfiguration script shipped, from the top of the source tree: +If building the source obtained from the Xenomai GIT tree +(git.xenomai.org), the `configure` script and Makefiles must be +generated in the Xenomai source tree. The recommended way is to run +the automatic reconfiguration script shipped, from the top of the +source tree: - $ ./scripts/bootstrap - +If building from a http://download.gna.org/xenomai[release tarball], a +set of autoconf-generated file will be readily available from the +extracted source tree, and therefore reconfiguring will not be +required. + When run, the generated `configure` script prepares for building the libraries and programs, for both the _Cobalt_ and _Mercury_ cores. The core-specific code which may be needed internally is automatically and ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : cobalt: bump ABI revision level
Module: xenomai-3 Branch: master Commit: c2506b7133d6e6d05e9aee79363a57be9fb6ffae URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=c2506b7133d6e6d05e9aee79363a57be9fb6ffae Author: Philippe Gerum r...@xenomai.org Date: Tue Mar 24 10:19:31 2015 +0100 cobalt: bump ABI revision level --- kernel/cobalt/arch/arm/include/asm/xenomai/uapi/features.h |2 +- kernel/cobalt/arch/blackfin/include/asm/xenomai/uapi/features.h |2 +- kernel/cobalt/arch/nios2/include/asm/xenomai/uapi/features.h|2 +- kernel/cobalt/arch/powerpc/include/asm/xenomai/uapi/features.h |2 +- kernel/cobalt/arch/sh/include/asm/xenomai/uapi/features.h |2 +- kernel/cobalt/arch/x86/include/asm/xenomai/uapi/features.h |2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/kernel/cobalt/arch/arm/include/asm/xenomai/uapi/features.h b/kernel/cobalt/arch/arm/include/asm/xenomai/uapi/features.h index 9109ab1..3d3f6de 100644 --- a/kernel/cobalt/arch/arm/include/asm/xenomai/uapi/features.h +++ b/kernel/cobalt/arch/arm/include/asm/xenomai/uapi/features.h @@ -22,7 +22,7 @@ #define _COBALT_ARM_ASM_UAPI_FEATURES_H /* The ABI revision level we use on this arch. */ -#define XENOMAI_ABI_REV 12UL +#define XENOMAI_ABI_REV 13UL #define XENOMAI_FEAT_DEP (__xn_feat_generic_mask) diff --git a/kernel/cobalt/arch/blackfin/include/asm/xenomai/uapi/features.h b/kernel/cobalt/arch/blackfin/include/asm/xenomai/uapi/features.h index e2b74fc..b40abbe 100644 --- a/kernel/cobalt/arch/blackfin/include/asm/xenomai/uapi/features.h +++ b/kernel/cobalt/arch/blackfin/include/asm/xenomai/uapi/features.h @@ -19,7 +19,7 @@ #define _COBALT_BLACKFIN_ASM_UAPI_FEATURES_H /* The ABI revision level we use on this arch. */ -#define XENOMAI_ABI_REV 12UL +#define XENOMAI_ABI_REV 13UL #define XENOMAI_FEAT_DEP __xn_feat_generic_mask diff --git a/kernel/cobalt/arch/nios2/include/asm/xenomai/uapi/features.h b/kernel/cobalt/arch/nios2/include/asm/xenomai/uapi/features.h index a57557f..f890cc6 100644 --- a/kernel/cobalt/arch/nios2/include/asm/xenomai/uapi/features.h +++ b/kernel/cobalt/arch/nios2/include/asm/xenomai/uapi/features.h @@ -21,7 +21,7 @@ #include linux/types.h /* The ABI revision level we use on this arch. */ -#define XENOMAI_ABI_REV 11UL +#define XENOMAI_ABI_REV 12UL #define XENOMAI_FEAT_DEP __xn_feat_generic_mask diff --git a/kernel/cobalt/arch/powerpc/include/asm/xenomai/uapi/features.h b/kernel/cobalt/arch/powerpc/include/asm/xenomai/uapi/features.h index e347d58..e183f92 100644 --- a/kernel/cobalt/arch/powerpc/include/asm/xenomai/uapi/features.h +++ b/kernel/cobalt/arch/powerpc/include/asm/xenomai/uapi/features.h @@ -19,7 +19,7 @@ #define _COBALT_POWERPC_ASM_UAPI_FEATURES_H /* The ABI revision level we use on this arch. */ -#define XENOMAI_ABI_REV 12UL +#define XENOMAI_ABI_REV 13UL #define XENOMAI_FEAT_DEP __xn_feat_generic_mask diff --git a/kernel/cobalt/arch/sh/include/asm/xenomai/uapi/features.h b/kernel/cobalt/arch/sh/include/asm/xenomai/uapi/features.h index 58cee62..9a2f9fb 100644 --- a/kernel/cobalt/arch/sh/include/asm/xenomai/uapi/features.h +++ b/kernel/cobalt/arch/sh/include/asm/xenomai/uapi/features.h @@ -21,7 +21,7 @@ #include linux/types.h /* The ABI revision level we use on this arch. */ -#define XENOMAI_ABI_REV 9UL +#define XENOMAI_ABI_REV 10UL #define XENOMAI_FEAT_DEP __xn_feat_generic_mask diff --git a/kernel/cobalt/arch/x86/include/asm/xenomai/uapi/features.h b/kernel/cobalt/arch/x86/include/asm/xenomai/uapi/features.h index 8cadbec..362fdf4 100644 --- a/kernel/cobalt/arch/x86/include/asm/xenomai/uapi/features.h +++ b/kernel/cobalt/arch/x86/include/asm/xenomai/uapi/features.h @@ -19,7 +19,7 @@ #define _COBALT_X86_ASM_UAPI_FEATURES_H /* The ABI revision level we use on this arch. */ -#define XENOMAI_ABI_REV 12UL +#define XENOMAI_ABI_REV 13UL #define XENOMAI_FEAT_DEP __xn_feat_generic_mask ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : cobalt/arm: upgrade I-pipe support
Module: xenomai-3 Branch: master Commit: dc89691364d545218bc515fb95646f6c748a5ff6 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=dc89691364d545218bc515fb95646f6c748a5ff6 Author: Philippe Gerum r...@xenomai.org Date: Fri Mar 20 09:25:13 2015 +0100 cobalt/arm: upgrade I-pipe support --- ...-arm-8.patch = ipipe-core-3.14.33-arm-8.patch} | 63 +++-- ...6-arm-3.patch = ipipe-core-3.16.7-arm-5.patch} | 260 2 files changed, 142 insertions(+), 181 deletions(-) diff --git a/kernel/cobalt/arch/arm/patches/ipipe-core-3.14.28-arm-8.patch b/kernel/cobalt/arch/arm/patches/ipipe-core-3.14.33-arm-8.patch similarity index 99% rename from kernel/cobalt/arch/arm/patches/ipipe-core-3.14.28-arm-8.patch rename to kernel/cobalt/arch/arm/patches/ipipe-core-3.14.33-arm-8.patch index 6ed50be..d415abc 100644 --- a/kernel/cobalt/arch/arm/patches/ipipe-core-3.14.28-arm-8.patch +++ b/kernel/cobalt/arch/arm/patches/ipipe-core-3.14.33-arm-8.patch @@ -3096,7 +3096,7 @@ index ded0417..6ce9baa 100644 DEFINE(TI_VFPSTATE, offsetof(struct thread_info, vfpstate)); #ifdef CONFIG_SMP diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S -index 1879e8d..a608340 100644 +index 1879e8d..f6ef839 100644 --- a/arch/arm/kernel/entry-armv.S +++ b/arch/arm/kernel/entry-armv.S @@ -4,6 +4,7 @@ @@ -3244,8 +3244,8 @@ index 1879e8d..a608340 100644 + get_thread_info tsk + ldr r0, [tsk, #TI_IPIPE] + tst r0, #_TIP_HEAD -+ THUMB( it eq) -+ beq __ipipe_ret_to_user_irqs_disabled @ Fast exit path over non-root domains ++ THUMB( it ne) ++ bne __ipipe_ret_to_user_irqs_disabled @ Fast exit path over non-root domains +#endif /* !CONFIG_IPIPE_LEGACY */ +#else /* !CONFIG_IPIPE */ + get_thread_info tsk @@ -3626,7 +3626,7 @@ index 88c6bab..cf2772a 100644 * have in theory up to 7 arguments to a function - r0 to r6. diff --git a/arch/arm/kernel/ipipe.c b/arch/arm/kernel/ipipe.c new file mode 100644 -index 000..0d3412d +index 000..8a6c9bc --- /dev/null +++ b/arch/arm/kernel/ipipe.c @@ -0,0 +1,575 @@ @@ -3841,7 +3841,7 @@ index 000..0d3412d +#ifdef CONFIG_SMP_ON_UP +struct static_key __ipipe_smp_key = STATIC_KEY_INIT_TRUE; + -+unsigned __ipipe_processor_id(void) ++unsigned notrace __ipipe_processor_id(void) +{ + return raw_smp_processor_id(); +} @@ -4792,7 +4792,7 @@ index 0dd3b79..b56a680 100644 return 0; } diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c -index 1e8b030..c755375 100644 +index aab70f6..465dcb8 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c @@ -465,16 +465,27 @@ void notrace cpu_init(void) @@ -4853,7 +4853,7 @@ index 04d6388..f0616de 100644 } while (thread_flags _TIF_WORK_MASK); return 0; diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c -index b7b4c86..64f2adf 100644 +index 8cd3724..f1265b0 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c @@ -69,8 +69,24 @@ enum ipi_msg_type { @@ -4900,7 +4900,7 @@ index b7b4c86..64f2adf 100644 /* * All kernel threads share the same mm context; grab a -@@ -500,6 +523,93 @@ u64 smp_irq_stat_cpu(unsigned int cpu) +@@ -509,6 +532,93 @@ u64 smp_irq_stat_cpu(unsigned int cpu) } #ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST @@ -4994,7 +4994,7 @@ index b7b4c86..64f2adf 100644 void tick_broadcast(const struct cpumask *mask) { smp_cross_call(mask, IPI_TIMER); -@@ -565,9 +675,9 @@ void handle_IPI(int ipinr, struct pt_regs *regs) +@@ -574,9 +684,9 @@ void handle_IPI(int ipinr, struct pt_regs *regs) #ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST case IPI_TIMER: @@ -5007,7 +5007,7 @@ index b7b4c86..64f2adf 100644 break; #endif -@@ -576,35 +686,35 @@ void handle_IPI(int ipinr, struct pt_regs *regs) +@@ -585,35 +695,35 @@ void handle_IPI(int ipinr, struct pt_regs *regs) break; case IPI_CALL_FUNC: @@ -6677,7 +6677,7 @@ index 19fca1f..f8d6d6c 100644 } CLK_OF_DECLARE(imx53_ccm, fsl,imx53-ccm, mx53_clocks_init); diff --git a/arch/arm/mach-imx/clk-imx6q.c b/arch/arm/mach-imx/clk-imx6q.c -index 4d677f4..824107c 100644 +index 01a5765..d5f077a 100644 --- a/arch/arm/mach-imx/clk-imx6q.c +++ b/arch/arm/mach-imx/clk-imx6q.c @@ -144,7 +144,7 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node) @@ -7658,7 +7658,7 @@ index 1f3770a..1119417 100644 return; diff --git a/arch/arm/mach-omap2/pm44xx.c b/arch/arm/mach-omap2/pm44xx.c -index eefb30c..a9086b9 100644 +index 2b9cff9..d60cf7c 100644 --- a/arch/arm/mach-omap2/pm44xx.c +++ b/arch/arm/mach-omap2/pm44xx.c @@ -133,7 +133,13 @@ static int __init pwrdms_setup(struct powerdomain *pwrdm, void *unused) @@ -7694,7 +7694,7 @@ index b4c4ab9..795b538 100644 if (chip-irq_ack) chip-irq_ack(desc-irq_data); diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c -index
[Xenomai-git] Philippe Gerum : cobalt/posix/monitor: use resource management API
Module: xenomai-3 Branch: master Commit: 970053aa1dcad91aba28cb850b3be7df6cd46645 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=970053aa1dcad91aba28cb850b3be7df6cd46645 Author: Philippe Gerum r...@xenomai.org Date: Wed Mar 18 18:51:41 2015 +0100 cobalt/posix/monitor: use resource management API --- kernel/cobalt/posix/monitor.c | 68 - kernel/cobalt/posix/monitor.h |8 ++--- kernel/cobalt/posix/process.c |2 +- 3 files changed, 25 insertions(+), 53 deletions(-) diff --git a/kernel/cobalt/posix/monitor.c b/kernel/cobalt/posix/monitor.c index 4e19af4..e928eeb 100644 --- a/kernel/cobalt/posix/monitor.c +++ b/kernel/cobalt/posix/monitor.c @@ -54,7 +54,6 @@ COBALT_SYSCALL(monitor_init, current, { struct cobalt_monitor_shadow shadow; struct cobalt_monitor_state *state; - struct cobalt_resources *rs; struct cobalt_monitor *mon; int pshared, tmode, ret; struct cobalt_umm *umm; @@ -77,7 +76,7 @@ COBALT_SYSCALL(monitor_init, current, return -EAGAIN; } - ret = xnregistry_enter_anon(mon, mon-handle); + ret = xnregistry_enter_anon(mon, mon-resnode.handle); if (ret) { cobalt_umm_free(umm, state); xnfree(mon); @@ -90,20 +89,17 @@ COBALT_SYSCALL(monitor_init, current, mon-flags = flags; mon-tmode = tmode; INIT_LIST_HEAD(mon-waiters); - rs = cobalt_current_resources(pshared); - mon-scope = rs; xnlock_get_irqsave(nklock, s); - list_add_tail(mon-link, rs-monitorq); - xnlock_put_irqrestore(nklock, s); - + cobalt_add_resource(mon-resnode, monitor, pshared); mon-magic = COBALT_MONITOR_MAGIC; + xnlock_put_irqrestore(nklock, s); state-flags = 0; stateoff = cobalt_umm_offset(umm, state); XENO_BUG_ON(COBALT, stateoff != (__u32)stateoff); shadow.flags = flags; - shadow.handle = mon-handle; + shadow.handle = mon-resnode.handle; shadow.state_offset = (__u32)stateoff; return cobalt_copy_to_user(u_mon, shadow, sizeof(*u_mon)); @@ -376,25 +372,6 @@ COBALT_SYSCALL(monitor_exit, primary, return ret; } -static void monitor_destroy(struct cobalt_monitor *mon) -{ - struct cobalt_umm *umm; - int pshared; - spl_t s; - - xnlock_get_irqsave(nklock, s); - list_del(mon-link); - xnsynch_destroy(mon-gate); - xnsynch_destroy(mon-drain); - xnregistry_remove(mon-handle); - xnlock_put_irqrestore(nklock, s); - - pshared = (mon-flags COBALT_MONITOR_SHARED) != 0; - umm = cobalt_ppd_get(pshared)-umm; - cobalt_umm_free(umm, mon-state); - xnfree(mon); -} - COBALT_SYSCALL(monitor_destroy, primary, (struct cobalt_monitor_shadow __user *u_mon)) { @@ -432,11 +409,7 @@ COBALT_SYSCALL(monitor_destroy, primary, goto fail; } - mon-magic = 0; /* Hide it from userland before deletion. */ - - xnlock_put_irqrestore(nklock, s); - - monitor_destroy(mon); + cobalt_monitor_reclaim(mon-resnode, s); /* drops lock */ xnsched_run(); @@ -447,23 +420,22 @@ COBALT_SYSCALL(monitor_destroy, primary, return ret; } -void cobalt_monitor_reclaim(struct cobalt_process *process) +void cobalt_monitor_reclaim(struct cobalt_resnode *node, spl_t s) { - struct cobalt_resources *p = process-resources; - struct cobalt_monitor *mon, *tmp; - spl_t s; - - xnlock_get_irqsave(nklock, s); - - if (list_empty(p-monitorq)) - goto out; + struct cobalt_monitor *mon; + struct cobalt_umm *umm; + int pshared; - list_for_each_entry_safe(mon, tmp, p-monitorq, link) { - mon-magic = 0; - xnlock_put_irqrestore(nklock, s); - monitor_destroy(mon); - xnlock_get_irqsave(nklock, s); - } -out: + mon = container_of(node, struct cobalt_monitor, resnode); + pshared = (mon-flags COBALT_MONITOR_SHARED) != 0; + xnsynch_destroy(mon-gate); + xnsynch_destroy(mon-drain); + xnregistry_remove(node-handle); + cobalt_del_resource(node); + cobalt_mark_deleted(mon); xnlock_put_irqrestore(nklock, s); + + umm = cobalt_ppd_get(pshared)-umm; + cobalt_umm_free(umm, mon-state); + xnfree(mon); } diff --git a/kernel/cobalt/posix/monitor.h b/kernel/cobalt/posix/monitor.h index 80cafbb..8b321aa 100644 --- a/kernel/cobalt/posix/monitor.h +++ b/kernel/cobalt/posix/monitor.h @@ -22,6 +22,7 @@ #include cobalt/kernel/synch.h #include cobalt/uapi/monitor.h #include xenomai/posix/syscall.h +#include xenomai/posix/process.h struct cobalt_resources; struct cobalt_process; @@ -31,12 +32,10 @@ struct cobalt_monitor { struct xnsynch gate; struct xnsynch drain; struct cobalt_monitor_state *state; - struct
[Xenomai-git] Philippe Gerum : cobalt/posix/process: move global thread list out of kqueue container
Module: xenomai-3 Branch: master Commit: aa24133acbe4298443c5a040309382030aac05db URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=aa24133acbe4298443c5a040309382030aac05db Author: Philippe Gerum r...@xenomai.org Date: Tue Mar 17 17:06:39 2015 +0100 cobalt/posix/process: move global thread list out of kqueue container --- kernel/cobalt/posix/init.c|3 ++- kernel/cobalt/posix/process.c |1 - kernel/cobalt/posix/process.h |3 ++- kernel/cobalt/posix/thread.c |7 +++ kernel/cobalt/posix/thread.h |7 ++- 5 files changed, 9 insertions(+), 12 deletions(-) diff --git a/kernel/cobalt/posix/init.c b/kernel/cobalt/posix/init.c index e97f96f..e955a3f 100644 --- a/kernel/cobalt/posix/init.c +++ b/kernel/cobalt/posix/init.c @@ -30,6 +30,8 @@ #include monitor.h #include event.h +LIST_HEAD(cobalt_thread_list); + struct cobalt_kqueues cobalt_global_kqueues; void cobalt_cleanup(void) @@ -49,7 +51,6 @@ int __init cobalt_init(void) { int ret; - INIT_LIST_HEAD(cobalt_global_kqueues.threadq); cobalt_time_slice = CONFIG_XENO_OPT_RR_QUANTUM * 1000; ret = cobalt_process_init(); diff --git a/kernel/cobalt/posix/process.c b/kernel/cobalt/posix/process.c index dfcce4c..1ae494f 100644 --- a/kernel/cobalt/posix/process.c +++ b/kernel/cobalt/posix/process.c @@ -1323,7 +1323,6 @@ static void *cobalt_process_attach(void) INIT_LIST_HEAD(process-kqueues.condq); INIT_LIST_HEAD(process-kqueues.mutexq); INIT_LIST_HEAD(process-kqueues.semq); - INIT_LIST_HEAD(process-kqueues.threadq); INIT_LIST_HEAD(process-kqueues.monitorq); INIT_LIST_HEAD(process-kqueues.eventq); INIT_LIST_HEAD(process-kqueues.schedq); diff --git a/kernel/cobalt/posix/process.h b/kernel/cobalt/posix/process.h index 7f78345..7c9ab2f 100644 --- a/kernel/cobalt/posix/process.h +++ b/kernel/cobalt/posix/process.h @@ -38,7 +38,6 @@ struct cobalt_kqueues { struct list_head condq; struct list_head mutexq; struct list_head semq; - struct list_head threadq; struct list_head monitorq; struct list_head eventq; struct list_head schedq; @@ -57,6 +56,8 @@ struct cobalt_process { void *priv[NR_PERSONALITIES]; }; +extern struct list_head cobalt_thread_list; + extern struct cobalt_kqueues cobalt_global_kqueues; int cobalt_register_personality(struct xnthread_personality *personality); diff --git a/kernel/cobalt/posix/thread.c b/kernel/cobalt/posix/thread.c index cc47c10..c122cf6 100644 --- a/kernel/cobalt/posix/thread.c +++ b/kernel/cobalt/posix/thread.c @@ -220,7 +220,7 @@ struct xnthread_personality *cobalt_thread_exit(struct xnthread *curr) thread_unhash(thread-hkey); xnlock_get_irqsave(nklock, s); cobalt_mark_deleted(thread); - list_del(thread-link); + list_del(thread-next); xnlock_put_irqrestore(nklock, s); cobalt_signal_flush(thread); xnsynch_destroy(thread-monitor_synch); @@ -404,8 +404,7 @@ static int pthread_create(struct cobalt_thread **thread_p, } xnlock_get_irqsave(nklock, s); - thread-container = cobalt_kqueues(0)-threadq; - list_add_tail(thread-link, thread-container); + list_add_tail(thread-next, cobalt_thread_list); xnlock_put_irqrestore(nklock, s); thread-hkey.u_pth = 0; @@ -424,7 +423,7 @@ static void pthread_discard(struct cobalt_thread *thread) xnsynch_destroy(thread-sigwait); xnlock_get_irqsave(nklock, s); - list_del(thread-link); + list_del(thread-next); xnlock_put_irqrestore(nklock, s); __xnthread_discard(thread-threadbase); xnfree(thread); diff --git a/kernel/cobalt/posix/thread.h b/kernel/cobalt/posix/thread.h index d00879f..ffdf612 100644 --- a/kernel/cobalt/posix/thread.h +++ b/kernel/cobalt/posix/thread.h @@ -91,14 +91,11 @@ struct cobalt_thread { struct xnthread threadbase; struct cobalt_extref extref; struct cobalt_process *process; - - /** cobalt_threadq */ - struct list_head link; - struct list_head *container; + struct list_head next; /* in cobalt_thread_list */ /** Signal management. */ sigset_t sigpending; - struct list_head sigqueues[_NSIG]; /* cobalt_sigpending */ + struct list_head sigqueues[_NSIG]; /* in cobalt_sigpending */ struct xnsynch sigwait; struct list_head signext; ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : cobalt/x86: upgrade I-pipe support
Module: xenomai-3 Branch: master Commit: 01f7ffb89837099be2e41a29865b57123642e92e URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=01f7ffb89837099be2e41a29865b57123642e92e Author: Philippe Gerum r...@xenomai.org Date: Fri Mar 20 09:27:24 2015 +0100 cobalt/x86: upgrade I-pipe support --- ...6-x86-3.patch = ipipe-core-3.16.7-x86-3.patch} | 74 ++-- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/kernel/cobalt/arch/x86/patches/ipipe-core-3.16-x86-3.patch b/kernel/cobalt/arch/x86/patches/ipipe-core-3.16.7-x86-3.patch similarity index 99% rename from kernel/cobalt/arch/x86/patches/ipipe-core-3.16-x86-3.patch rename to kernel/cobalt/arch/x86/patches/ipipe-core-3.16.7-x86-3.patch index 0fcf3fd..7fcbfba 100644 --- a/kernel/cobalt/arch/x86/patches/ipipe-core-3.16-x86-3.patch +++ b/kernel/cobalt/arch/x86/patches/ipipe-core-3.16.7-x86-3.patch @@ -1,5 +1,5 @@ diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig -index d24887b..ac506bb 100644 +index 27adfd9..40a67c4 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -9,6 +9,7 @@ config 64BIT @@ -4220,7 +4220,7 @@ index be8e1bd..0249ce4 100644 /* diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c -index 5492798..7a685e0 100644 +index 215815b..b0cfd08 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c @@ -890,7 +890,7 @@ static int do_boot_cpu(int apicid, int cpu, struct task_struct *idle) @@ -4581,7 +4581,7 @@ index e8edcf5..0a93042 100644 tsk-thread.screen_bitmap = info-screen_bitmap; if (info-flags VM86_SCREEN_BITMAP) diff --git a/arch/x86/kernel/vsyscall_64.c b/arch/x86/kernel/vsyscall_64.c -index ea5b570..e1f1fe2 100644 +index e1e1e80..a70b1a7 100644 --- a/arch/x86/kernel/vsyscall_64.c +++ b/arch/x86/kernel/vsyscall_64.c @@ -32,6 +32,7 @@ @@ -4658,10 +4658,10 @@ index b5e994a..743ceae 100644 } diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c -index 801332e..8f9018f 100644 +index 6c437ed..767d308 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c -@@ -1781,9 +1781,11 @@ static void __vmx_load_host_state(struct vcpu_vmx *vmx) +@@ -1782,9 +1782,11 @@ static void __vmx_load_host_state(struct vcpu_vmx *vmx) static void vmx_load_host_state(struct vcpu_vmx *vmx) { @@ -4675,7 +4675,7 @@ index 801332e..8f9018f 100644 } /* -@@ -2083,6 +2085,7 @@ static void setup_msrs(struct vcpu_vmx *vmx) +@@ -2084,6 +2086,7 @@ static void setup_msrs(struct vcpu_vmx *vmx) { int save_nmsrs, index; @@ -4683,7 +4683,7 @@ index 801332e..8f9018f 100644 save_nmsrs = 0; #ifdef CONFIG_X86_64 if (is_long_mode(vmx-vcpu)) { -@@ -2112,6 +2115,7 @@ static void setup_msrs(struct vcpu_vmx *vmx) +@@ -2113,6 +2116,7 @@ static void setup_msrs(struct vcpu_vmx *vmx) move_msr_up(vmx, index, save_nmsrs++); vmx-save_nmsrs = save_nmsrs; @@ -4691,7 +4691,7 @@ index 801332e..8f9018f 100644 if (cpu_has_vmx_msr_bitmap()) vmx_set_msr_bitmap(vmx-vcpu); -@@ -7192,8 +7196,10 @@ static void vmx_handle_external_intr(struct kvm_vcpu *vcpu) +@@ -7198,8 +7202,10 @@ static void vmx_handle_external_intr(struct kvm_vcpu *vcpu) [ss]i(__KERNEL_DS), [cs]i(__KERNEL_CS) ); @@ -4703,7 +4703,7 @@ index 801332e..8f9018f 100644 } static bool vmx_mpx_supported(void) -@@ -7567,7 +7573,9 @@ static struct kvm_vcpu *vmx_create_vcpu(struct kvm *kvm, unsigned int id) +@@ -7579,7 +7585,9 @@ static struct kvm_vcpu *vmx_create_vcpu(struct kvm *kvm, unsigned int id) vmx_vcpu_load(vmx-vcpu, cpu); vmx-vcpu.cpu = cpu; err = vmx_vcpu_setup(vmx); @@ -4713,7 +4713,7 @@ index 801332e..8f9018f 100644 put_cpu(); if (err) goto free_vmcs; -@@ -7590,6 +7598,9 @@ static struct kvm_vcpu *vmx_create_vcpu(struct kvm *kvm, unsigned int id) +@@ -7602,6 +7610,9 @@ static struct kvm_vcpu *vmx_create_vcpu(struct kvm *kvm, unsigned int id) vmx-nested.current_vmptr = -1ull; vmx-nested.current_vmcs12 = NULL; @@ -5704,7 +5704,7 @@ index a16b497..fa578e8 100644 /* diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h -index 404a686..605479f 100644 +index 721de25..c4a10c8 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h @@ -101,6 +101,7 @@ enum { @@ -5714,7 +5714,7 @@ index 404a686..605479f 100644 + FTRACE_OPS_FL_IPIPE_EXCLUSIVE = 1 9, }; - /* + #ifdef CONFIG_DYNAMIC_FTRACE diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index cba442e..b513a46 100644 --- a/include/linux/hardirq.h @@ -8161,7 +8161,7 @@ index 5b9b84b..6c8bb4d 100644 static inline void __raw_read_lock(rwlock_t *lock) { diff --git a/include/linux/sched.h b/include/linux/sched.h -index 0376b05..82b6b3e 100644 +index c5cc872..6cdf1f7 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -26,6 +26,7 @@ struct sched_param { @@
[Xenomai-git] Philippe Gerum : include/trank: add C bindings
Module: xenomai-3 Branch: master Commit: f537649c1b69a4f7b6d8f22ef344faf3414fe079 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=f537649c1b69a4f7b6d8f22ef344faf3414fe079 Author: Philippe Gerum r...@xenomai.org Date: Thu Mar 19 19:27:41 2015 +0100 include/trank: add C bindings --- include/trank/native/alarm.h |8 include/trank/native/event.h |8 include/trank/native/misc.h |8 include/trank/native/pipe.h |7 +++ include/trank/native/task.h |7 +++ include/trank/native/timer.h |8 include/trank/rtdm/rtdm.h|8 7 files changed, 54 insertions(+) diff --git a/include/trank/native/alarm.h b/include/trank/native/alarm.h index 8096133..688d625 100644 --- a/include/trank/native/alarm.h +++ b/include/trank/native/alarm.h @@ -21,10 +21,18 @@ #include trank/trank.h #include alchemy/alarm.h +#ifdef __cplusplus +extern C { +#endif + COMPAT_DECL(int, rt_alarm_create(RT_ALARM *alarm, const char *name)); COMPAT_DECL(int, rt_alarm_wait(RT_ALARM *alarm)); COMPAT_DECL(int, rt_alarm_delete(RT_ALARM *alarm)); +#ifdef __cplusplus +} +#endif + #endif /* _XENOMAI_TRANK_NATIVE_ALARM_H */ diff --git a/include/trank/native/event.h b/include/trank/native/event.h index 037ddd0..800cbca 100644 --- a/include/trank/native/event.h +++ b/include/trank/native/event.h @@ -20,6 +20,10 @@ #include alchemy/event.h +#ifdef __cplusplus +extern C { +#endif + COMPAT_DECL(int, rt_event_create(RT_EVENT *event, const char *name, unsigned long ivalue, int mode)); @@ -70,4 +74,8 @@ int rt_event_wait(RT_EVENT *event, #endif /* __XENO_COMPAT__ */ +#ifdef __cplusplus +} +#endif + #endif /* _XENOMAI_TRANK_NATIVE_EVENT_H */ diff --git a/include/trank/native/misc.h b/include/trank/native/misc.h index b5255fa..bf0ed17 100644 --- a/include/trank/native/misc.h +++ b/include/trank/native/misc.h @@ -28,6 +28,10 @@ typedef struct rt_ioregion { } RT_IOREGION; +#ifdef __cplusplus +extern C { +#endif + __attribute__((__deprecated__)) static inline int rt_io_get_region(RT_IOREGION *iorn, const char *name, @@ -46,4 +50,8 @@ int rt_io_put_region(RT_IOREGION *iorn) return -ENOSYS; } +#ifdef __cplusplus +} +#endif + #endif /* _XENOMAI_TRANK_NATIVE_MISC_H */ diff --git a/include/trank/native/pipe.h b/include/trank/native/pipe.h index 95f8ae9..42f56a5 100644 --- a/include/trank/native/pipe.h +++ b/include/trank/native/pipe.h @@ -21,8 +21,15 @@ #include alchemy/pipe.h #include trank/trank.h +#ifdef __cplusplus +extern C { +#endif + COMPAT_DECL(int, rt_pipe_create(RT_PIPE *pipe, const char *name, int minor, size_t poolsize)); +#ifdef __cplusplus +} +#endif #endif /* _XENOMAI_TRANK_NATIVE_PIPE_H */ diff --git a/include/trank/native/task.h b/include/trank/native/task.h index f2fb1dd..5c4d354 100644 --- a/include/trank/native/task.h +++ b/include/trank/native/task.h @@ -31,6 +31,10 @@ #define T_CPU(cpu) (1 (24 + (cpu 7))) #define T_CPUMASK 0xff00 +#ifdef __cplusplus +extern C { +#endif + __attribute__((__deprecated__)) static inline int rt_task_notify(RT_TASK *task, rt_sigset_t sigs) { @@ -47,5 +51,8 @@ COMPAT_DECL(int, rt_task_spawn(RT_TASK *task, const char *name, COMPAT_DECL(int, rt_task_set_periodic(RT_TASK *task, RTIME idate, RTIME period)); +#ifdef __cplusplus +} +#endif #endif /* _XENOMAI_TRANK_NATIVE_TASK_H */ diff --git a/include/trank/native/timer.h b/include/trank/native/timer.h index 9ab6e8e..7ccba1c 100644 --- a/include/trank/native/timer.h +++ b/include/trank/native/timer.h @@ -24,6 +24,10 @@ #define TM_ONESHOT 0 +#ifdef __cplusplus +extern C { +#endif + __attribute__((__deprecated__)) static inline int rt_timer_set_mode(RTIME nstick) { @@ -36,4 +40,8 @@ static inline int rt_timer_set_mode(RTIME nstick) return 0; } +#ifdef __cplusplus +} +#endif + #endif /* _XENOMAI_TRANK_NATIVE_TIMER_H */ diff --git a/include/trank/rtdm/rtdm.h b/include/trank/rtdm/rtdm.h index 5fa36b2..9a0c965 100644 --- a/include/trank/rtdm/rtdm.h +++ b/include/trank/rtdm/rtdm.h @@ -20,6 +20,10 @@ #include_next rtdm/rtdm.h +#ifdef __cplusplus +extern C { +#endif + #ifndef RTDM_NO_DEFAULT_USER_API #define rt_dev_call(__call, __args...) \ @@ -165,4 +169,8 @@ static inline ssize_t rt_dev_read(int fd, void *buf, size_t len) #endif /* !RTDM_NO_DEFAULT_USER_API */ +#ifdef __cplusplus +} +#endif + #endif /* _XENOMAI_TRANK_RTDM_RTDM_H */ ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : cobalt/x86: upgrade I-pipe support
Module: xenomai-3 Branch: master Commit: b2ffcb119159299b95a9110095e2b9b98bdab042 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=b2ffcb119159299b95a9110095e2b9b98bdab042 Author: Philippe Gerum r...@xenomai.org Date: Wed Mar 4 09:15:54 2015 +0100 cobalt/x86: upgrade I-pipe support --- ...-x86-7.patch = ipipe-core-3.14.33-x86-8.patch} | 167 +++- 1 file changed, 91 insertions(+), 76 deletions(-) diff --git a/kernel/cobalt/arch/x86/patches/ipipe-core-3.14.28-x86-7.patch b/kernel/cobalt/arch/x86/patches/ipipe-core-3.14.33-x86-8.patch similarity index 99% rename from kernel/cobalt/arch/x86/patches/ipipe-core-3.14.28-x86-7.patch rename to kernel/cobalt/arch/x86/patches/ipipe-core-3.14.33-x86-8.patch index 0086f76..97a412f 100644 --- a/kernel/cobalt/arch/x86/patches/ipipe-core-3.14.28-x86-7.patch +++ b/kernel/cobalt/arch/x86/patches/ipipe-core-3.14.33-x86-8.patch @@ -1,5 +1,5 @@ diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig -index 98aa930..91e382d 100644 +index 2f645c9..908b4f5 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -9,6 +9,7 @@ config 64BIT @@ -50,7 +50,7 @@ index 98aa930..91e382d 100644 + config X86_UP_APIC bool Local APIC support on uniprocessors - depends on X86_32 !SMP !X86_32_NON_STANDARD !PCI_MSI + depends on X86_32 !SMP !X86_32_NON_STANDARD diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S index 92a2e93..56aa429 100644 --- a/arch/x86/ia32/ia32entry.S @@ -202,7 +202,7 @@ index 4b528a9..0cf06c6 100644 static inline void debug_stack_usage_inc(void) { diff --git a/arch/x86/include/asm/desc.h b/arch/x86/include/asm/desc.h -index 50d033a..f87cb28 100644 +index a94b82e..e185603 100644 --- a/arch/x86/include/asm/desc.h +++ b/arch/x86/include/asm/desc.h @@ -4,6 +4,7 @@ @@ -213,7 +213,7 @@ index 50d033a..f87cb28 100644 #include linux/smp.h #include linux/percpu.h -@@ -368,11 +369,16 @@ static inline void _set_gate(int gate, unsigned type, void *addr, +@@ -376,11 +377,16 @@ static inline void _set_gate(int gate, unsigned type, void *addr, * Pentium F0 0F bugfix can have resulted in the mapped * IDT being write-protected. */ @@ -231,7 +231,7 @@ index 50d033a..f87cb28 100644 _trace_set_gate(n, GATE_INTERRUPT, (void *)trace_##addr,\ 0, 0, __KERNEL_CS); \ } while (0) -@@ -384,6 +390,13 @@ extern unsigned long used_vectors[]; +@@ -392,6 +398,13 @@ extern unsigned long used_vectors[]; static inline void alloc_system_vector(int vector) { if (!test_bit(vector, used_vectors)) { @@ -245,7 +245,7 @@ index 50d033a..f87cb28 100644 set_bit(vector, used_vectors); if (first_system_vector vector) first_system_vector = vector; -@@ -392,6 +405,12 @@ static inline void alloc_system_vector(int vector) +@@ -400,6 +413,12 @@ static inline void alloc_system_vector(int vector) } } @@ -258,7 +258,7 @@ index 50d033a..f87cb28 100644 #define alloc_intr_gate(n, addr) \ do {\ alloc_system_vector(n); \ -@@ -437,7 +456,7 @@ static inline void set_system_intr_gate_ist(int n, void *addr, unsigned ist) +@@ -445,7 +464,7 @@ static inline void set_system_intr_gate_ist(int n, void *addr, unsigned ist) _set_gate(n, GATE_INTERRUPT, addr, 0x3, ist, __KERNEL_CS); } @@ -442,7 +442,7 @@ index 615fa90..e0a62ab 100644 extern void default_send_IPI_mask_sequence_phys(const struct cpumask *mask, diff --git a/arch/x86/include/asm/ipipe.h b/arch/x86/include/asm/ipipe.h new file mode 100644 -index 000..f6df562 +index 000..a244663 --- /dev/null +++ b/arch/x86/include/asm/ipipe.h @@ -0,0 +1,96 @@ @@ -472,7 +472,7 @@ index 000..f6df562 + +#ifdef CONFIG_IPIPE + -+#define IPIPE_CORE_RELEASE7 ++#define IPIPE_CORE_RELEASE8 + +struct ipipe_domain; + @@ -1664,7 +1664,7 @@ index 2c621a6..18b3219 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 6ad4658..c97b856 100644 +index 6ad4658..9233e45 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c @@ -71,8 +71,8 @@ @@ -1809,7 +1809,7 @@ index 6ad4658..c97b856 100644 ioapic_write_entry(attr-ioapic, attr-ioapic_pin, entry); } -@@ -2139,7 +2180,7 @@ static unsigned int startup_ioapic_irq(struct irq_data *data) +@@ -2139,11 +2180,12 @@ static unsigned int startup_ioapic_irq(struct irq_data *data) raw_spin_lock_irqsave(ioapic_lock, flags); if (irq legacy_pic-nr_legacy_irqs) { @@ -1818,7 +1818,12 @@ index 6ad4658..c97b856 100644 if (legacy_pic-irq_pending(irq)) was_pending = 1; } -@@ -2198,7 +2239,8 @@ asmlinkage void
[Xenomai-git] Philippe Gerum : copperplate: fix synchronization with shared clusters
Module: xenomai-3 Branch: master Commit: 383e8ed5659076771c393a0f1aabb6da8c6b959b URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=383e8ed5659076771c393a0f1aabb6da8c6b959b Author: Philippe Gerum r...@xenomai.org Date: Sun Mar 15 13:02:55 2015 +0100 copperplate: fix synchronization with shared clusters The inter-process synchronization can only work if the syncobj is shared between processes. Add a dictionary object type with an embedded syncobj for implementing shared clusters. --- include/copperplate/cluster.h |9 - lib/copperplate/cluster.c | 87 ++--- 2 files changed, 63 insertions(+), 33 deletions(-) diff --git a/include/copperplate/cluster.h b/include/copperplate/cluster.h index 0f75690..9c76cbc 100644 --- a/include/copperplate/cluster.h +++ b/include/copperplate/cluster.h @@ -39,9 +39,14 @@ struct cluster { struct dictionary *d; }; +struct syndictionary { + struct hash_table table; + struct syncobj sobj; + struct hashobj hobj; +}; + struct syncluster { - struct cluster c; - struct syncobj *sobj; + struct syndictionary *d; }; struct pvclusterobj { diff --git a/lib/copperplate/cluster.c b/lib/copperplate/cluster.c index 0dda986..7353aa8 100644 --- a/lib/copperplate/cluster.c +++ b/lib/copperplate/cluster.c @@ -139,20 +139,18 @@ redo: } d = xnmalloc(sizeof(*d)); - if (d == NULL) { - ret = -ENOMEM; - goto out; - } + if (d == NULL) + return __bt(-ENOMEM); hash_init(d-table); ret = hash_enter(main_catalog, name, strlen(name), d-hobj, hash_operations); + /* +* If someone managed to slip in, creating the cluster between +* the table look up and indexing the new cluster, retry the +* whole process. +*/ if (ret == -EEXIST) { - /* -* Someone seems to have slipped in, creating the -* cluster right after we failed retrieving it: retry -* the whole process. -*/ hash_destroy(d-table); xnfree(d); goto redo; @@ -249,17 +247,40 @@ int cluster_walk(struct cluster *c, int syncluster_init(struct syncluster *sc, const char *name) { + struct syndictionary *d; + struct hashobj *hobj; int ret; - ret = __bt(cluster_init(sc-c, name)); - if (ret) - return ret; +redo: + hobj = hash_search(main_catalog, name, strlen(name), + hash_operations); + if (hobj) { + d = container_of(hobj, struct syndictionary, hobj); + ret = 0; + goto out; + } - sc-sobj = xnmalloc(sizeof(*sc-sobj)); - if (sc-sobj == NULL) + d = xnmalloc(sizeof(*d)); + if (d == NULL) return -ENOMEM; - return syncobj_init(sc-sobj, CLOCK_COPPERPLATE, + hash_init(d-table); + + ret = hash_enter(main_catalog, name, strlen(name), d-hobj, +hash_operations); + /* +* Same as cluster_init(), redo if someone slipped in, +* creating the cluster. +*/ + if (ret == -EEXIST) { + hash_destroy(d-table); + xnfree(d); + goto redo; + } +out: + sc-d = d; + + return syncobj_init(d-sobj, CLOCK_COPPERPLATE, SYNCOBJ_FIFO, fnref_null); } @@ -271,26 +292,29 @@ int syncluster_addobj(struct syncluster *sc, const char *name, struct syncstate syns; int ret; - if (syncobj_lock(sc-sobj, syns)) + if (syncobj_lock(sc-d-sobj, syns)) return __bt(-EINVAL); - ret = cluster_addobj(sc-c, name, cobj); + cobj-cnode = __node_id; + + ret = hash_enter_probe(sc-d-table, name, strlen(name), + cobj-hobj, hash_operations); if (ret) goto out; - if (!syncobj_grant_wait_p(sc-sobj)) + if (!syncobj_grant_wait_p(sc-d-sobj)) goto out; /* * Wake up all threads waiting for this key to appear in the * dictionary. */ - syncobj_for_each_grant_waiter_safe(sc-sobj, thobj, tmp) { + syncobj_for_each_grant_waiter_safe(sc-d-sobj, thobj, tmp) { wait = threadobj_get_wait(thobj); if (*wait-name == *name strcmp(wait-name, name) == 0) - syncobj_grant_to(sc-sobj, thobj); + syncobj_grant_to(sc-d-sobj, thobj); } out: - syncobj_unlock(sc-sobj, syns); + syncobj_unlock(sc-d-sobj, syns); return ret; } @@ -301,12 +325,12 @@ int syncluster_delobj(struct syncluster *sc, struct syncstate syns; int ret; - if (syncobj_lock(sc-sobj, syns)) + if (syncobj_lock(sc-d-sobj, syns))
[Xenomai-git] Jan Kiszka : alchemy/sem: Fix nwaiters reported by rt_sem_inquire
Module: xenomai-3 Branch: master Commit: 676724f562389e458b46a03316e2c3c4744c8c1c URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=676724f562389e458b46a03316e2c3c4744c8c1c Author: Jan Kiszka jan.kis...@siemens.com Date: Fri Mar 13 19:24:33 2015 +0100 alchemy/sem: Fix nwaiters reported by rt_sem_inquire If the semaphore value is positive, there are no waiters. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- lib/alchemy/sem.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/alchemy/sem.c b/lib/alchemy/sem.c index b0ce742..cf4add9 100644 --- a/lib/alchemy/sem.c +++ b/lib/alchemy/sem.c @@ -490,7 +490,7 @@ int rt_sem_inquire(RT_SEM *sem, RT_SEM_INFO *info) goto out; info-count = sval 0 ? 0 : sval; - info-nwaiters = -sval; + info-nwaiters = sval 0 ? -sval : 0; strcpy(info-name, scb-name); /* = racy. */ out: CANCEL_RESTORE(svc); ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Jan Kiszka : cobalt/procfs: Fix layout of APC header line
Module: xenomai-3 Branch: master Commit: 5520d9e13d43b5174aa5131fd1801a7c48a83308 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=5520d9e13d43b5174aa5131fd1801a7c48a83308 Author: Jan Kiszka jan.kis...@siemens.com Date: Thu Mar 12 16:26:01 2015 +0100 cobalt/procfs: Fix layout of APC header line Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- kernel/cobalt/procfs.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/cobalt/procfs.c b/kernel/cobalt/procfs.c index 2c9342d..f338aa7 100644 --- a/kernel/cobalt/procfs.c +++ b/kernel/cobalt/procfs.c @@ -180,10 +180,10 @@ static int apc_vfile_show(struct xnvfile_regular_iterator *it, void *data) /* We assume the entire output fits in a single page. */ - xnvfile_puts(it, APC ); + xnvfile_puts(it, APC ); for_each_realtime_cpu(cpu) - xnvfile_printf(it, CPU%d, cpu); + xnvfile_printf(it, CPU%d, cpu); for (apc = 0; apc BITS_PER_LONG; apc++) { if (!test_bit(apc, cobalt_pipeline.apc_map)) ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : cobalt/x86: upgrade I-pipe support
Module: xenomai-3 Branch: master Commit: 51680b1d9b3b1993011da1ddf56b54c12e59d49d URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=51680b1d9b3b1993011da1ddf56b54c12e59d49d Author: Philippe Gerum r...@xenomai.org Date: Tue Mar 3 20:15:28 2015 +0100 cobalt/x86: upgrade I-pipe support --- 16-x86-2.patch = ipipe-core-3.16-x86-3.patch} | 54 +++- 1 file changed, 40 insertions(+), 14 deletions(-) diff --git a/kernel/cobalt/arch/x86/patches/ipipe-core-3.16-x86-2.patch b/kernel/cobalt/arch/x86/patches/ipipe-core-3.16-x86-3.patch similarity index 99% rename from kernel/cobalt/arch/x86/patches/ipipe-core-3.16-x86-2.patch rename to kernel/cobalt/arch/x86/patches/ipipe-core-3.16-x86-3.patch index 18fa1fa..0fcf3fd 100644 --- a/kernel/cobalt/arch/x86/patches/ipipe-core-3.16-x86-2.patch +++ b/kernel/cobalt/arch/x86/patches/ipipe-core-3.16-x86-3.patch @@ -437,7 +437,7 @@ index 615fa90..e0a62ab 100644 extern void default_send_IPI_mask_sequence_phys(const struct cpumask *mask, diff --git a/arch/x86/include/asm/ipipe.h b/arch/x86/include/asm/ipipe.h new file mode 100644 -index 000..7145c10 +index 000..68af8b7 --- /dev/null +++ b/arch/x86/include/asm/ipipe.h @@ -0,0 +1,118 @@ @@ -467,7 +467,7 @@ index 000..7145c10 + +#ifdef CONFIG_IPIPE + -+#define IPIPE_CORE_RELEASE2 ++#define IPIPE_CORE_RELEASE3 + +struct ipipe_domain; +struct pt_regs; @@ -2498,7 +2498,7 @@ index 1abcb50..dc6d438 100644 /* * When in-kernel, we also print out the stack and code at the diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S -index 0d0c9d4..6e6b88a 100644 +index 0d0c9d4..e834437 100644 --- a/arch/x86/kernel/entry_32.S +++ b/arch/x86/kernel/entry_32.S @@ -45,6 +45,7 @@ @@ -2616,7 +2616,7 @@ index 0d0c9d4..6e6b88a 100644 LOCKDEP_SYS_EXIT DISABLE_INTERRUPTS(CLBR_ANY) TRACE_IRQS_OFF -@@ -443,6 +503,23 @@ sysenter_exit: +@@ -443,6 +503,24 @@ sysenter_exit: PTGS_TO_GS ENABLE_INTERRUPTS_SYSEXIT @@ -2634,13 +2634,14 @@ index 0d0c9d4..6e6b88a 100644 + jmp sysenter_exit +sysenter_exit_root: + call __ipipe_root_sync ++ movl PT_EAX(%esp),%eax + jmp sysenter_exit_check +#endif + #ifdef CONFIG_AUDITSYSCALL sysenter_audit: testl $(_TIF_WORK_SYSCALL_ENTRY ~_TIF_SYSCALL_AUDIT),TI_flags(%ebp) -@@ -495,6 +572,25 @@ ENTRY(system_call) +@@ -495,6 +573,25 @@ ENTRY(system_call) pushl_cfi %eax # save orig_eax SAVE_ALL GET_THREAD_INFO(%ebp) @@ -2666,7 +2667,7 @@ index 0d0c9d4..6e6b88a 100644 # system call tracing in operation / emulation testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%ebp) jnz syscall_trace_entry -@@ -596,6 +692,7 @@ work_pending: +@@ -596,6 +693,7 @@ work_pending: testb $_TIF_NEED_RESCHED, %cl jz work_notifysig work_resched: @@ -2674,7 +2675,7 @@ index 0d0c9d4..6e6b88a 100644 call schedule LOCKDEP_SYS_EXIT DISABLE_INTERRUPTS(CLBR_ANY)# make sure we don't miss an interrupt -@@ -611,6 +708,7 @@ work_resched: +@@ -611,6 +709,7 @@ work_resched: work_notifysig: # deal with pending signals and # notify-resume requests @@ -2682,7 +2683,7 @@ index 0d0c9d4..6e6b88a 100644 #ifdef CONFIG_VM86 testl $X86_EFLAGS_VM, PT_EFLAGS(%esp) movl %esp, %eax -@@ -759,6 +857,58 @@ END(irq_entries_start) +@@ -759,6 +858,58 @@ END(irq_entries_start) END(interrupt) .previous @@ -2741,7 +2742,7 @@ index 0d0c9d4..6e6b88a 100644 /* * the CPU automatically disables interrupts when executing an IRQ vector, * so IRQ-flags tracing has to follow that: -@@ -788,6 +938,7 @@ ENTRY(name)\ +@@ -788,6 +939,7 @@ ENTRY(name)\ CFI_ENDPROC;\ ENDPROC(name) @@ -2749,7 +2750,7 @@ index 0d0c9d4..6e6b88a 100644 #ifdef CONFIG_TRACING #define TRACE_BUILD_INTERRUPT(name, nr) \ -@@ -1275,9 +1426,15 @@ error_code: +@@ -1275,9 +1427,15 @@ error_code: movl $(__USER_DS), %ecx movl %ecx, %ds movl %ecx, %es @@ -2765,7 +2766,7 @@ index 0d0c9d4..6e6b88a 100644 jmp ret_from_exception CFI_ENDPROC END(page_fault) -@@ -1317,7 +1474,9 @@ ENTRY(debug) +@@ -1317,7 +1475,9 @@ ENTRY(debug) debug_stack_correct: pushl_cfi $-1 # mark this as an int SAVE_ALL @@ -2775,7 +2776,7 @@ index 0d0c9d4..6e6b88a 100644 xorl %edx,%edx # error code 0 movl %esp,%eax # pt_regs pointer call do_debug -@@ -1413,7 +1572,9 @@ ENTRY(int3) +@@ -1413,7 +1573,9 @@ ENTRY(int3) ASM_CLAC pushl_cfi $-1 # mark this as an int SAVE_ALL @@ -15306,10 +15307,35 @@ index f802c2d..b320432 100644 #ifdef finish_arch_post_lock_switch
[Xenomai-git] Philippe Gerum : cobalt/sched: do not choke on redundant policy setting
Module: xenomai-3 Branch: master Commit: d2bc78c45e322451a46dcbe0de75a09f304c1c57 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=d2bc78c45e322451a46dcbe0de75a09f304c1c57 Author: Philippe Gerum r...@xenomai.org Date: Tue Mar 17 09:11:21 2015 +0100 cobalt/sched: do not choke on redundant policy setting Setting the base scheduling class of a thread to the current value should not cause such thread to be declared again to the policy module. It is not only useless, but declaration handlers are not expected to cope with such situation. See http://www.xenomai.org/pipermail/xenomai/2015-March/033563.html. --- kernel/cobalt/sched.c |8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/kernel/cobalt/sched.c b/kernel/cobalt/sched.c index a6469db..f57570e 100644 --- a/kernel/cobalt/sched.c +++ b/kernel/cobalt/sched.c @@ -387,9 +387,11 @@ int xnsched_set_policy(struct xnthread *thread, * affect the previous class (such as touching thread-rlink * for instance). */ - ret = xnsched_declare(sched_class, thread, p); - if (ret) - return ret; + if (sched_class != thread-base_class) { + ret = xnsched_declare(sched_class, thread, p); + if (ret) + return ret; + } /* * As a special case, we may be called from __xnthread_init() ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : debian/rules: xeno-config also belongs to the base package
Module: xenomai-3 Branch: master Commit: 8871363fa57266af4c8d8a06965f2898b940fb48 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=8871363fa57266af4c8d8a06965f2898b940fb48 Author: Philippe Gerum r...@xenomai.org Date: Thu Feb 26 14:16:40 2015 +0100 debian/rules: xeno-config also belongs to the base package --- debian/rules |3 --- 1 file changed, 3 deletions(-) diff --git a/debian/rules b/debian/rules index 07a4a19..f91a621 100755 --- a/debian/rules +++ b/debian/rules @@ -61,9 +61,6 @@ install: build dh_installdirs $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp/ dh_install --sourcedir=$(CURDIR)/debian/tmp - # xeno-config should be only in libxenomai-dev - rm -f $(CURDIR)/debian/xenomai-runtime/usr/bin/xeno-config - rm -f $(CURDIR)/debian/xenomai-runtime/usr/share/man/man1/xeno-config.1 for f in $(CURDIR)/kernel/cobalt/udev/*.rules ; do \ cat $$f $(CURDIR)/debian/libxenomai1/etc/udev/xenomai.rules ; \ done ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : copperplate/regd: be resilient in presence of a stale / system tree
Module: xenomai-3 Branch: master Commit: 50e61ff291d4daf4d48088321aa8ed7f229a7ce1 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=50e61ff291d4daf4d48088321aa8ed7f229a7ce1 Author: Philippe Gerum r...@xenomai.org Date: Wed Mar 4 10:00:29 2015 +0100 copperplate/regd: be resilient in presence of a stale /system tree --- lib/copperplate/regd/regd.c | 19 +-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/lib/copperplate/regd/regd.c b/lib/copperplate/regd/regd.c index c8ae0f6..fd5b060 100644 --- a/lib/copperplate/regd/regd.c +++ b/lib/copperplate/regd/regd.c @@ -159,7 +159,7 @@ static void create_rootdir(void) if (*rootdir != '/') error(1, EINVAL, absolute root directory path required); - + ret = create_directory_recursive(rootdir); if (ret) error(1, -ret, create_directory_recursive(\%s\), rootdir); @@ -387,9 +387,24 @@ static void create_system_fs(const char *arg0, const char *rootdir) error(1, ENOMEM, malloc); ret = create_directory_recursive(mountpt); - if (ret) + if (ret) { + /* +* Before giving up, try to cleanup a left over, in +* case a former sysregd instance died ungracefully. +* Receiving ENOTCONN when creating the /system root +* is the sign that we may be attempting to walk a +* stale tree. +*/ + if (ret == -ENOTCONN) { + unmount(mountpt); + ret = create_directory_recursive(mountpt); + if (ret == 0) + goto bootstrap; + } error(1, -ret, create_directory_recursive(\%s\), mountpt); + } +bootstrap: atexit(delete_system_fs); CPU_ZERO(__node_info.cpu_affinity); ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : config: bump core version
Module: xenomai-3 Branch: master Commit: 108b3e82f910b0512c633c1c89f8138b17665270 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=108b3e82f910b0512c633c1c89f8138b17665270 Author: Philippe Gerum r...@xenomai.org Date: Tue Mar 24 10:17:27 2015 +0100 config: bump core version --- config/version-code |2 +- config/version-label |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/version-code b/config/version-code index 6580c69..04b88ce 100644 --- a/config/version-code +++ b/config/version-code @@ -1 +1 @@ -2.99.12 +2.99.13 diff --git a/config/version-label b/config/version-label index 2080ef6..c3c565f 100644 --- a/config/version-label +++ b/config/version-label @@ -1 +1 @@ -3.0-rc3 +3.0-rc4 ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : build: turn on _FORTIFY_SOURCE on --enable-fortify
Module: xenomai-3 Branch: master Commit: 8f45b304774359d24872651ccf5d8ddd368b2f76 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=8f45b304774359d24872651ccf5d8ddd368b2f76 Author: Philippe Gerum r...@xenomai.org Date: Thu Feb 19 21:34:40 2015 +0100 build: turn on _FORTIFY_SOURCE on --enable-fortify --- configure| 62 ++ configure.ac | 40 +++-- 2 files changed, 53 insertions(+), 49 deletions(-) diff --git a/configure b/configure index ec37dbb..ea63a7a 100755 --- a/configure +++ b/configure @@ -862,11 +862,11 @@ enable_doc_build enable_doc_install enable_verbose_latex enable_valgrind_client +enable_fortify enable_dlopen_libs enable_tls with_testdir with_demodir -enable_fortify ' ac_precious_vars='build_alias host_alias @@ -1538,10 +1538,9 @@ Optional Features: --enable-nonstop-latex Use LaTeX non-stop mode --enable-valgrind-client Enable Valgrind client API + --enable-fortifyEnable _FORTIFY_SOURCE --enable-dlopen-libsAllow dynamic loading of Xenomai libraries --enable-tlsEnable thread local storage - --enable-fortifyEnable support for applications compiled with - _FORTIFY_SOURCE Optional Packages: --with-PACKAGE[=ARG]use PACKAGE [ARG=yes] @@ -14244,6 +14243,33 @@ if test $ac_cv_atomic_builtins != yes; then as_fn_error $? compiler does not support atomic builtins $LINENO 5 fi +unset want_fortify +{ $as_echo $as_me:${as_lineno-$LINENO}: checking for fortify support 5 +$as_echo_n checking for fortify support... 6; } +# Check whether --enable-fortify was given. +if test ${enable_fortify+set} = set; then : + enableval=$enable_fortify; case $enableval in + y | yes) want_fortify=yes;; + *) want_fortify=no;; + esac +fi + +{ $as_echo $as_me:${as_lineno-$LINENO}: result: ${want_fortify:-autodetect} 5 +$as_echo ${want_fortify:-autodetect} 6; } +if test x$want_fortify != xno; then + ac_fn_c_check_func $LINENO __vfprintf_chk ac_cv_func___vfprintf_chk +if test x$ac_cv_func___vfprintf_chk = xyes; then : + +$as_echo #define CONFIG_XENO_FORTIFY 1 confdefs.h + +else + if test x$want_fortify = xyes; then + as_fn_error $? Fortify support enabled but not available in *libc $LINENO 5 + fi +fi + +fi + XENO_USER_APP_CFLAGS=-D_GNU_SOURCE -D_REENTRANT XENO_USER_APP_LDFLAGS= @@ -14254,6 +14280,9 @@ fi XENO_USER_CFLAGS=$XENO_USER_APP_CFLAGS -pipe -fstrict-aliasing \ -Wall -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wno-unused-parameter -Werror +if test x$want_fortify != xno -a x$debug_mode != xfull; then + XENO_USER_CFLAGS=$XENO_USER_CFLAGS -D_FORTIFY_SOURCE=1 +fi XENO_USER_LDADD=$XENO_USER_APP_LDFLAGS XENO_USER_APP_CFLAGS=$CFLAGS $XENO_USER_APP_CFLAGS @@ -14484,33 +14513,6 @@ fi XENO_AUTOINIT_LDFLAGS=-Wl,--wrap=main -Wl,--dynamic-list=$topdir/scripts/dynlist.ld -unset want_fortify -{ $as_echo $as_me:${as_lineno-$LINENO}: checking for fortify support 5 -$as_echo_n checking for fortify support... 6; } -# Check whether --enable-fortify was given. -if test ${enable_fortify+set} = set; then : - enableval=$enable_fortify; case $enableval in - y | yes) want_fortify=yes;; - *) want_fortify=no;; - esac -fi - -{ $as_echo $as_me:${as_lineno-$LINENO}: result: ${want_fortify:-autodetect} 5 -$as_echo ${want_fortify:-autodetect} 6; } -if test x$want_fortify != xno; then - ac_fn_c_check_func $LINENO __vfprintf_chk ac_cv_func___vfprintf_chk -if test x$ac_cv_func___vfprintf_chk = xyes; then : - -$as_echo #define CONFIG_XENO_FORTIFY 1 confdefs.h - -else - if test x$want_fortify = xyes; then - as_fn_error $? Fortify support enabled but not available in *libc $LINENO 5 - fi -fi - -fi - diff --git a/configure.ac b/configure.ac index 8f6502c..429e7d5 100644 --- a/configure.ac +++ b/configure.ac @@ -668,6 +668,24 @@ if test $ac_cv_atomic_builtins != yes; then AC_MSG_ERROR([compiler does not support atomic builtins]) fi +unset want_fortify +AC_MSG_CHECKING(for fortify support) +AC_ARG_ENABLE([fortify], + AC_HELP_STRING([--enable-fortify], +[Enable _FORTIFY_SOURCE]), + [case $enableval in + y | yes) want_fortify=yes;; + *) want_fortify=no;; + esac]) +AC_MSG_RESULT(${want_fortify:-autodetect}) +if test x$want_fortify != xno; then + AC_CHECK_FUNC(__vfprintf_chk, + [AC_DEFINE(CONFIG_XENO_FORTIFY, 1,[config])], + [if test x$want_fortify = xyes; then + AC_MSG_ERROR([Fortify support enabled but not available in *libc]) + fi]) +fi + dnl Exported CFLAGS and LDFLAGS, shared with internal flags XENO_USER_APP_CFLAGS=-D_GNU_SOURCE -D_REENTRANT XENO_USER_APP_LDFLAGS= @@ -680,6 +698,9 @@ fi dnl Internal CFLAGS
[Xenomai-git] Philippe Gerum : cobalt/x86: allow symbolic state names for xenomai.smi
Module: xenomai-3 Branch: master Commit: 561abf198d058c1b6860468f9e58e66c0c2c3349 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=561abf198d058c1b6860468f9e58e66c0c2c3349 Author: Philippe Gerum r...@xenomai.org Date: Wed Feb 18 20:59:54 2015 +0100 cobalt/x86: allow symbolic state names for xenomai.smi --- kernel/cobalt/arch/x86/smi.c | 35 +-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/kernel/cobalt/arch/x86/smi.c b/kernel/cobalt/arch/x86/smi.c index cc38f17..5573e7b 100644 --- a/kernel/cobalt/arch/x86/smi.c +++ b/kernel/cobalt/arch/x86/smi.c @@ -23,6 +23,7 @@ #include linux/kernel.h #include linux/module.h #include linux/version.h +#include linux/ctype.h #include linux/pci.h #include linux/pci_ids.h #include linux/reboot.h @@ -38,8 +39,6 @@ #define SMI_CTRL_ADDR 0x30 static int smi_state; -module_param_named(smi, smi_state, int, 0400); -MODULE_PARM_DESC(smi, SMI workaround: -1=disable, 0=detect only, 1=enable); static unsigned int smi_masked_bits = 1; /* Global disable bit */ module_param_named(smi_mask, smi_masked_bits, int, 0400); @@ -134,3 +133,35 @@ void mach_x86_smi_init(void) pci_dev_put(dev); } + +static const char *smi_state_labels[] = { + disabled, + detect, + enabled, +}; + +static int setup_smi_state(char *s) +{ + static char warn_bad_state[] = + XENO_WARNING invalid SMI state '%s'\n; + char *p; + int n; + + /* Backward compat with legacy state specifiers. */ + n = simple_strtol(s, p, 10); + if (*p == '\0') { + smi_state = n; + return 1; + } + + for (n = 0; n ARRAY_SIZE(smi_state_labels); n++) + if (strcmp(smi_state_labels[n], s) == 0) { + smi_state = n - 1; + return 1; + } + + printk(warn_bad_state, s); + + return 0; +} +__setup(xenomai.smi=, setup_smi_state); ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : README: refer to build run howtos
Module: xenomai-3 Branch: master Commit: eff22660b2978dfb79bb00409ff8b238abbdd35c URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=eff22660b2978dfb79bb00409ff8b238abbdd35c Author: Philippe Gerum r...@xenomai.org Date: Mon Mar 16 16:49:07 2015 +0100 README: refer to build run howtos --- README |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README b/README index 8f70ab5..71f8287 100644 --- a/README +++ b/README @@ -25,8 +25,9 @@ The online version of the documentation is available from our website for the current release: http://xenomai.org/installing-xenomai-3-x/ +http://xenomai.org/building-applications-with-xenomai-3-x/ +http://xenomai.org/running-applications-with-xenomai-3-x/ http://xenomai.org/migrating-from-xenomai-2-x-to-3-x/ http://xenomai.org/documentation/xenomai-3/html/xeno3prm/index.html -http://xenomai.org/running-applications-with-xenomai-3-x/ http://xenomai.org/troubleshooting-a-dual-kernel-configuration/ http://xenomai.org/troubleshooting-a-single-kernel-configuration/ ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : build: do not set _FORTIFY_SOURCE in autodetect mode
Module: xenomai-3 Branch: master Commit: 52fb91ed0ab4e06f77db99e14a56576d7fbe1387 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=52fb91ed0ab4e06f77db99e14a56576d7fbe1387 Author: Philippe Gerum r...@xenomai.org Date: Fri Feb 20 10:22:15 2015 +0100 build: do not set _FORTIFY_SOURCE in autodetect mode --- configure|2 +- configure.ac |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure b/configure index b187729..07c0c86 100755 --- a/configure +++ b/configure @@ -14278,7 +14278,7 @@ fi XENO_USER_CFLAGS=$XENO_USER_APP_CFLAGS -pipe -fstrict-aliasing \ -Wall -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wno-unused-parameter -Werror -if test x$want_fortify != xno -a x$debug_mode != xfull; then +if test x$want_fortify = xyes -a x$debug_mode != xfull; then XENO_USER_CFLAGS=$XENO_USER_CFLAGS -D_FORTIFY_SOURCE=1 fi XENO_USER_LDADD=$XENO_USER_APP_LDFLAGS diff --git a/configure.ac b/configure.ac index 79c121e..ca26fd6 100644 --- a/configure.ac +++ b/configure.ac @@ -696,7 +696,7 @@ fi dnl Internal CFLAGS and LDFLAGS, may be enhanced per-arch below XENO_USER_CFLAGS=$XENO_USER_APP_CFLAGS -pipe -fstrict-aliasing \ -Wall -Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -Wno-unused-parameter -Werror -if test x$want_fortify != xno -a x$debug_mode != xfull; then +if test x$want_fortify = xyes -a x$debug_mode != xfull; then XENO_USER_CFLAGS=$XENO_USER_CFLAGS -D_FORTIFY_SOURCE=1 fi XENO_USER_LDADD=$XENO_USER_APP_LDFLAGS ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Jan Kiszka : cobalt/posix/syscall: Exclude sc_cobalt_get_current from debug warnings
Module: xenomai-3 Branch: master Commit: 55797eb5d9d24651a0fce84aeceaf421a7f42f21 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=55797eb5d9d24651a0fce84aeceaf421a7f42f21 Author: Jan Kiszka jan.kis...@siemens.com Date: Fri Feb 20 16:50:15 2015 +0100 cobalt/posix/syscall: Exclude sc_cobalt_get_current from debug warnings This syscall is used for probing the context, thus may be triggered by non-RT threads as well which we should not report as potential error. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- kernel/cobalt/posix/syscall.c |6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kernel/cobalt/posix/syscall.c b/kernel/cobalt/posix/syscall.c index b5d4d1c..bc33c96 100644 --- a/kernel/cobalt/posix/syscall.c +++ b/kernel/cobalt/posix/syscall.c @@ -851,7 +851,11 @@ static int handle_head_syscall(struct ipipe_domain *ipd, struct pt_regs *regs) * sc_cobalt_bind which does its own checks. */ if (unlikely(!allowed_syscall(process, thread, sysflags, nr))) { - if (XENO_DEBUG(COBALT)) + /* +* Exclude get_current from reporting, it is used to probe the +* execution context. +*/ + if (XENO_DEBUG(COBALT) nr != sc_cobalt_get_current) printk(XENO_WARNING syscall %d denied to %s[%d]\n, nr, current-comm, current-pid); ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : cobalt/posix/mutex: fix release of shared state to UMM heap
Module: xenomai-3 Branch: master Commit: 655dda153fbaba31246963f3011fff194fbecaa8 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=655dda153fbaba31246963f3011fff194fbecaa8 Author: Philippe Gerum r...@xenomai.org Date: Sat Mar 21 18:11:29 2015 +0100 cobalt/posix/mutex: fix release of shared state to UMM heap --- kernel/cobalt/posix/mutex.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/kernel/cobalt/posix/mutex.c b/kernel/cobalt/posix/mutex.c index 0a21b36..d659b46 100644 --- a/kernel/cobalt/posix/mutex.c +++ b/kernel/cobalt/posix/mutex.c @@ -28,7 +28,7 @@ static int cobalt_mutex_init_inner(struct cobalt_mutex_shadow *shadow, const struct cobalt_mutexattr *attr) { int synch_flags = XNSYNCH_PRIO | XNSYNCH_OWNER; - struct cobalt_ppd *sys_ppd; + struct cobalt_umm *umm; spl_t s; int err; @@ -36,12 +36,12 @@ static int cobalt_mutex_init_inner(struct cobalt_mutex_shadow *shadow, if (err 0) return err; - sys_ppd = cobalt_ppd_get(attr-pshared); + umm = cobalt_ppd_get(attr-pshared)-umm; shadow-handle = mutex-resnode.handle; shadow-magic = COBALT_MUTEX_MAGIC; shadow-lockcnt = 0; shadow-attr = *attr; - shadow-state_offset = cobalt_umm_offset(sys_ppd-umm, state); + shadow-state_offset = cobalt_umm_offset(umm, state); if (attr-protocol == PTHREAD_PRIO_INHERIT) synch_flags |= XNSYNCH_PIP; @@ -386,10 +386,12 @@ COBALT_SYSCALL(mutex_unlock, nonrestartable, void cobalt_mutex_reclaim(struct cobalt_resnode *node, spl_t s) { + struct cobalt_mutex_state *state; struct cobalt_mutex *mutex; int pshared; mutex = container_of(node, struct cobalt_mutex, resnode); + state = container_of(mutex-synchbase.fastlock, struct cobalt_mutex_state, owner); pshared = mutex-attr.pshared; xnregistry_remove(node-handle); cobalt_del_resource(node); @@ -397,7 +399,6 @@ void cobalt_mutex_reclaim(struct cobalt_resnode *node, spl_t s) cobalt_mark_deleted(mutex); xnlock_put_irqrestore(nklock, s); - cobalt_umm_free(cobalt_ppd_get(pshared)-umm, - mutex-synchbase.fastlock); + cobalt_umm_free(cobalt_ppd_get(pshared)-umm, state); xnfree(mutex); } ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : doc/man/autotune: mention static CONFIG_* values for gravity
Module: xenomai-3 Branch: master Commit: 0dd150ea0b1f2d0c366c7d084a17c7eb671fba08 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=0dd150ea0b1f2d0c366c7d084a17c7eb671fba08 Author: Philippe Gerum r...@xenomai.org Date: Wed Feb 18 12:08:35 2015 +0100 doc/man/autotune: mention static CONFIG_* values for gravity --- doc/asciidoc/man1/autotune.adoc | 12 1 file changed, 12 insertions(+) diff --git a/doc/asciidoc/man1/autotune.adoc b/doc/asciidoc/man1/autotune.adoc index b244c96..28fd751 100644 --- a/doc/asciidoc/man1/autotune.adoc +++ b/doc/asciidoc/man1/autotune.adoc @@ -137,6 +137,18 @@ running the auto-tuner after each boot e.g: # echo 1728u 907k /proc/xenomai/clock/coreclck -- +Alternatively, the gravity values can be statically defined in the +kernel configuration of the target kernel: + +- CONFIG_XENO_OPT_TIMING_SCHEDLAT should be assigned the user gravity + value. + +- CONFIG_XENO_OPT_TIMING_KSCHEDLAT should be assigned the kernel + gravity value. + +- CONFIG_XENO_OPT_TIMING_IRQLAT should be assigned the IRQ gravity + value. + AUTHOR --- *autotune* was written by Philippe Gerum r...@xenomai.org. ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : autotune: fix build with _FORTIFY_SOURCE 0
Module: xenomai-3 Branch: master Commit: dc4e88aed234e3980f85ba2dbd49e0134cb43682 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=dc4e88aed234e3980f85ba2dbd49e0134cb43682 Author: Philippe Gerum r...@xenomai.org Date: Thu Feb 19 21:35:02 2015 +0100 autotune: fix build with _FORTIFY_SOURCE 0 --- utils/autotune/autotune.c |7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/utils/autotune/autotune.c b/utils/autotune/autotune.c index 462f6b8..3ea6672 100644 --- a/utils/autotune/autotune.c +++ b/utils/autotune/autotune.c @@ -296,8 +296,11 @@ int main(int argc, char *const argv[]) } } - if (background) - daemon(0, 0); + if (background) { + ret = daemon(0, 0); + if (ret) + error(1, errno, cannot daemonize); + } fd = open(/dev/rtdm/autotune, O_RDONLY); if (fd 0) ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : copperplate/registry: disambiguate socket usage
Module: xenomai-3 Branch: next Commit: b3acca61db633ece76c7eebe175716ef6acaaa4d URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=b3acca61db633ece76c7eebe175716ef6acaaa4d Author: Philippe Gerum r...@xenomai.org Date: Mon Mar 23 15:23:12 2015 +0100 copperplate/registry: disambiguate socket usage --- lib/copperplate/registry.c |8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/copperplate/registry.c b/lib/copperplate/registry.c index 26b777b..8c7354a 100644 --- a/lib/copperplate/registry.c +++ b/lib/copperplate/registry.c @@ -714,19 +714,19 @@ static int connect_regd(const char *sessdir, char **mountpt, int flags) sun.sun_path[0] = '\0'; for (retries = 0; retries 3; retries++) { - s = socket(AF_UNIX, SOCK_SEQPACKET, 0); + s = __STD(socket(AF_UNIX, SOCK_SEQPACKET, 0)); if (s 0) { ret = -errno; free(*mountpt); return ret; } - ret = connect(s, (struct sockaddr *)sun, addrlen); + ret = __STD(connect(s, (struct sockaddr *)sun, addrlen)); if (ret == 0) { - ret = recv(s, *mountpt, PATH_MAX, 0); + ret = __STD(recv(s, *mountpt, PATH_MAX, 0)); if (ret 0) return 0; } - close(s); + __STD(close(s)); ret = spawn_daemon(sessdir, flags); if (ret) break; ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : doc/asciidoc: update guides
Module: xenomai-3 Branch: next Commit: b044b5f86fef13135f4da0f82f897fd573fca741 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=b044b5f86fef13135f4da0f82f897fd573fca741 Author: Philippe Gerum r...@xenomai.org Date: Tue Mar 24 10:55:24 2015 +0100 doc/asciidoc: update guides --- doc/asciidoc/MIGRATION.adoc |7 +++--- doc/asciidoc/README.APPLICATIONS.adoc |9 --- doc/asciidoc/README.INSTALL.adoc | 44 - 3 files changed, 35 insertions(+), 25 deletions(-) diff --git a/doc/asciidoc/MIGRATION.adoc b/doc/asciidoc/MIGRATION.adoc index ecb6b48..9f1e0ab 100644 --- a/doc/asciidoc/MIGRATION.adoc +++ b/doc/asciidoc/MIGRATION.adoc @@ -105,8 +105,8 @@ follows: /mount-point /* registry fs root, defaults to /var/run/xenomai */ - [/user] /* user name, missing if anon session */ -/session /* shared session name or anon */ + /user/* user name */ +/session /* shared session name or anon@pid */ /pid/* application (main) pid */ /skin /* API name: alchemy/vxworks/psos/... */ /family /* object class (task, semaphore, ...) */ @@ -117,8 +117,7 @@ follows: Each leaf entry under a session hierarchy is normally viewable, for retrieving the information attached to the corresponding object, such as its state, and/or value. There can be multiple sessions hosted -under a single registry mount point. Session-less application -processes are grouped under the special anon hierarchy. +under a single registry mount point. The /system hierarchy provides information about the current state of the Xenomai core, aggregating data from all processes which belong to diff --git a/doc/asciidoc/README.APPLICATIONS.adoc b/doc/asciidoc/README.APPLICATIONS.adoc index 5bdffea..bd236a5 100644 --- a/doc/asciidoc/README.APPLICATIONS.adoc +++ b/doc/asciidoc/README.APPLICATIONS.adoc @@ -85,8 +85,8 @@ link:installing-xenomai-3-x[configuration switch]). *--no-registry*:: This switch disables registry support at runtime. No real-time - objects will be exported to +/var/run/xenomai/[user/]session/pid+, - despite the registry code was compiled in. + objects will be exported to +/var/run/xenomai+, despite the + registry code was compiled in. *--no-sanity*:: *--sanity*:: @@ -118,11 +118,12 @@ link:installing-xenomai-3-x[configuration switch]). [normal] This label is also used to form the registry mount point for - each process, e.g. +/var/run/xenomai/[user/]session/pid+. + each process, e.g. +/var/run/xenomai/user/session/pid+. See +--enable-registry+ from the build options. [normal] - By default, _anon_ is used as the session label. + By default, `anon@pid` is used as the session label, with pid + equal to the system identifier of the process. *--reset*:: diff --git a/doc/asciidoc/README.INSTALL.adoc b/doc/asciidoc/README.INSTALL.adoc index f2e2d08..efec3aa 100644 --- a/doc/asciidoc/README.INSTALL.adoc +++ b/doc/asciidoc/README.INSTALL.adoc @@ -350,6 +350,9 @@ although this is not mandatory if building with `--disable-tls`. the target kernel running the real-time applications. In addition, the FUSE development libraries must be available from the toolchain. +- The autoconf (= 2.62), automake and libtool packages must be + available on your build system. + _Cobalt_-specific requirements ^^ @@ -374,10 +377,18 @@ _Mercury_-specific requirement Configuring ~~~ -A common autoconf script prepares for building the libraries and -programs, for both the _Cobalt_ and _Mercury_ cores. The core-specific -code which may be needed internally is automatically and transparently -selected at compilation-time by the build process. +First, the `configure` script and Makefiles must be generated in the +Xenomai source tree. The recommended way is to run the automatic +reconfiguration script shipped, from the top of the source tree: + +- +$ ./scripts/bootstrap +- + +When run, the generated `configure` script prepares for building the +libraries and programs, for both the _Cobalt_ and _Mercury_ cores. The +core-specific code which may be needed internally is automatically and +transparently selected at compilation-time by the build process. The options listed below can be passed to this script. @@ -466,21 +477,20 @@ Generic configuration options (both cores) CONFIG_FUSE_FS must be enabled in the target kernel. [normal] - When this option is enabled, the system creates a file - hierachy under `/var/run/xenomai/[user/]session/pid` - (by default), where you can access the internal state of the - active real-time objects. The session label is
[Xenomai-git] Philippe Gerum : copperplate/init: fix shared heap name with default session
Module: xenomai-3 Branch: master Commit: 8c60d68e2296cf71f1b43ca6f0bc91788b1af78c URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=8c60d68e2296cf71f1b43ca6f0bc91788b1af78c Author: Philippe Gerum r...@xenomai.org Date: Fri Mar 13 17:07:46 2015 +0100 copperplate/init: fix shared heap name with default session We need a valid session label to be defined before creating the shared heap. This fixes a regression introduced by ede23e4. --- lib/copperplate/init.c | 37 ++--- lib/copperplate/internal.h |7 +-- lib/copperplate/registry.c | 19 ++- 3 files changed, 41 insertions(+), 22 deletions(-) diff --git a/lib/copperplate/init.c b/lib/copperplate/init.c index 6a962e4..384d03e 100644 --- a/lib/copperplate/init.c +++ b/lib/copperplate/init.c @@ -26,6 +26,7 @@ #include memory.h #include malloc.h #include assert.h +#include pwd.h #include signal.h #include errno.h #include getopt.h @@ -45,10 +46,9 @@ struct coppernode __node_info = { .no_sanity = !CONFIG_XENO_SANITY, .reset_session = 0, .silent_mode = 0, -#ifdef CONFIG_XENO_REGISTRY - .session_label = NULL, .registry_root = DEFAULT_REGISTRY_ROOT, -#endif + .session_label = NULL, + .session_root = NULL, }; pid_t __node_id; @@ -517,6 +517,29 @@ fail: early_panic(initialization failed, %s, symerror(ret)); } +static int get_session_root(void) +{ + struct passwd *pw; + char *sessdir; + int ret; + + if (__node_info.session_label) { + pw = getpwuid(geteuid()); + if (pw == NULL) + return -errno; + ret = asprintf(sessdir, %s/%s/%s, __node_info.registry_root, + pw-pw_name, __node_info.session_label); + } else { + __node_info.session_label = DEFAULT_REGISTRY_SESSION; + ret = asprintf(sessdir, %s/%s, __node_info.registry_root, + DEFAULT_REGISTRY_SESSION); + } + + __node_info.session_root = sessdir; + + return ret 0 ? -ENOMEM : 0; +} + /* The application-level copperplate init call. */ void copperplate_init(int *argcp, char *const **argvp) @@ -587,6 +610,14 @@ void copperplate_init(int *argcp, char *const **argvp) goto fail; } + /* +* We need the session label to be known before we create the +* shared heap, which is named after the former. +*/ + ret = get_session_root(); + if (ret) + goto fail; + ret = heapobj_pkg_init_shared(); if (ret) { warning(failed to initialize main shared heap); diff --git a/lib/copperplate/internal.h b/lib/copperplate/internal.h index cc41101..a3f2fca 100644 --- a/lib/copperplate/internal.h +++ b/lib/copperplate/internal.h @@ -32,13 +32,16 @@ #ifdef CONFIG_XENO_REGISTRY #define DEFAULT_REGISTRY_ROOT CONFIG_XENO_REGISTRY_ROOT -#define DEFAULT_REGISTRY_SESSION anon +#else +#define DEFAULT_REGISTRY_ROOT NULL #endif +#define DEFAULT_REGISTRY_SESSION anon struct coppernode { unsigned int mem_pool; - const char *session_label; const char *registry_root; + const char *session_label; + const char *session_root; cpu_set_t cpu_affinity; int no_mlock; int no_registry; diff --git a/lib/copperplate/registry.c b/lib/copperplate/registry.c index 3053d0d..661562b 100644 --- a/lib/copperplate/registry.c +++ b/lib/copperplate/registry.c @@ -35,7 +35,6 @@ #include pthread.h #include semaphore.h #include fuse.h -#include pwd.h #include xeno_config.h #include boilerplate/hash.h #include copperplate/heapobj.h @@ -802,24 +801,10 @@ int __registry_pkg_init(const char *arg0, char *mountpt, int shared_registry) int registry_pkg_init(const char *arg0) { - struct passwd *pw = NULL; - char *mountpt, *sessdir; + char *mountpt; int ret; - if (__node_info.session_label) { - pw = getpwuid(geteuid()); - if (!pw) - return -errno; - ret = asprintf(sessdir, %s/%s/%s, __node_info.registry_root, - pw-pw_name, __node_info.session_label); - } else - ret = asprintf(sessdir, %s/%s, __node_info.registry_root, - DEFAULT_REGISTRY_SESSION); - if (ret 0) - return -ENOMEM; - - ret = connect_regd(sessdir, mountpt); - free(sessdir); + ret = connect_regd(__node_info.session_root, mountpt); if (ret) return ret; ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : cobalt/kernel: rebase assertion mechanism on BUG/ WARN support
Module: xenomai-3 Branch: master Commit: 5697298f58c48ef891b6494cfd78d8bc0de92732 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=5697298f58c48ef891b6494cfd78d8bc0de92732 Author: Philippe Gerum r...@xenomai.org Date: Tue Feb 17 15:07:15 2015 +0100 cobalt/kernel: rebase assertion mechanism on BUG/WARN support --- include/cobalt/kernel/assert.h | 93 ++- include/cobalt/kernel/bheap.h |2 +- include/cobalt/kernel/rtdm/driver.h |2 +- include/cobalt/kernel/sched.h |2 +- kernel/cobalt/Makefile |1 - kernel/cobalt/arch/x86/smi.c|4 +- kernel/cobalt/assert.c | 103 --- kernel/cobalt/clock.c |2 +- kernel/cobalt/heap.c| 12 ++-- kernel/cobalt/init.c|9 +-- kernel/cobalt/posix/event.c |2 +- kernel/cobalt/posix/monitor.c |2 +- kernel/cobalt/posix/mutex.c |4 +- kernel/cobalt/posix/process.c | 62 ++--- kernel/cobalt/posix/signal.c|6 +- kernel/cobalt/posix/syscall.c | 10 ++-- kernel/cobalt/posix/thread.c|4 +- kernel/cobalt/posix/timer.c |2 +- kernel/cobalt/rtdm/core.c |2 +- kernel/cobalt/rtdm/device.c |8 +-- kernel/cobalt/rtdm/drvlib.c |2 +- kernel/cobalt/rtdm/fd.c |6 +- kernel/cobalt/sched-quota.c | 12 ++-- kernel/cobalt/sched-sporadic.c |8 +-- kernel/cobalt/sched-tp.c|4 +- kernel/cobalt/sched.c | 16 +++--- kernel/cobalt/synch.c | 18 +++--- kernel/cobalt/thread.c | 26 + kernel/cobalt/vfile.c |8 +-- kernel/drivers/autotune/autotune.c |2 +- kernel/drivers/ipc/bufp.c |4 +- 31 files changed, 147 insertions(+), 291 deletions(-) diff --git a/include/cobalt/kernel/assert.h b/include/cobalt/kernel/assert.h index 2318410..82d01a5 100644 --- a/include/cobalt/kernel/assert.h +++ b/include/cobalt/kernel/assert.h @@ -19,75 +19,40 @@ #ifndef _COBALT_KERNEL_ASSERT_H #define _COBALT_KERNEL_ASSERT_H +#include linux/kconfig.h #include cobalt/kernel/trace.h #include cobalt/kernel/ancillaries.h -#define XENO_INFO KERN_INFO[Xenomai] -#define XENO_WARN KERN_WARNING [Xenomai] -#define XENO_ERR KERN_ERR [Xenomai] - -#define XENO_DEBUG(__subsys) \ - (CONFIG_XENO_OPT_DEBUG_##__subsys 0) - -#define XENO_ASSERT(__subsys, __cond) \ - ({ \ - int __ret = !XENO_DEBUG(__subsys) || (__cond); \ - if (unlikely(!__ret)) \ - __xnsys_assert_failed(__FILE__, __LINE__, (#__cond)); \ - __ret; \ - }) - -#define XENO_BUGON(__subsys, __cond) \ - do {\ - if (unlikely(XENO_DEBUG(__subsys) (__cond))) \ - xnsys_fatal(bug at %s:%d (%s),\ - __FILE__, __LINE__, (#__cond)); \ - } while (0) - -#define XENO_BUG(__subsys) XENO_BUGON(__subsys, 1) - -#define XENO_WARNON(__subsys, __cond) \ - do {\ - if (unlikely(XENO_DEBUG(__subsys) (__cond))) \ - printk(XENO_WARN assertion failed at %s:%d (%s), \ - __FILE__, __LINE__, (#__cond)); \ - } while (0) - -#ifndef CONFIG_XENO_OPT_DEBUG_COBALT -#define CONFIG_XENO_OPT_DEBUG_COBALT 0 -#endif - -#ifndef CONFIG_XENO_OPT_DEBUG_CONTEXT -#define CONFIG_XENO_OPT_DEBUG_CONTEXT 0 -#endif - -#ifndef CONFIG_XENO_OPT_DEBUG_LOCKING -#define CONFIG_XENO_OPT_DEBUG_LOCKING 0 -#endif - -#ifndef CONFIG_XENO_OPT_DEBUG_USER -#define CONFIG_XENO_OPT_DEBUG_USER 0 -#endif - -#define primary_mode_only()XENO_BUGON(CONTEXT, ipipe_root_p) -#define secondary_mode_only() XENO_BUGON(CONTEXT, !ipipe_root_p) -#define interrupt_only() XENO_BUGON(CONTEXT, !xnsched_interrupt_p()) -#define realtime_cpu_only()XENO_BUGON(CONTEXT, !xnsched_supported_cpu(ipipe_processor_id())) -#define thread_only() XENO_BUGON(CONTEXT, xnsched_interrupt_p()) +#define XENO_INFO KERN_INFO[Xenomai] +#define XENO_WARNING KERN_WARNING [Xenomai] +#define XENO_ERR KERN_ERR [Xenomai] + +#define XENO_DEBUG(__subsys) \ + IS_ENABLED(CONFIG_XENO_OPT_DEBUG_##__subsys) +#define XENO_ASSERT(__subsys, __cond) \ + (!WARN_ON(XENO_DEBUG(__subsys) !(__cond))) +#define
[Xenomai-git] Philippe Gerum : cobalt/kernel: unify naming of extern data - cobalt_debug_vfroot
Module: xenomai-3 Branch: master Commit: d1f46a3ff8d557922819d35d7f176499148b6760 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=d1f46a3ff8d557922819d35d7f176499148b6760 Author: Philippe Gerum r...@xenomai.org Date: Tue Feb 17 11:56:05 2015 +0100 cobalt/kernel: unify naming of extern data - cobalt_debug_vfroot --- kernel/cobalt/debug.c |6 +++--- kernel/cobalt/debug.h |2 +- kernel/cobalt/procfs.c |6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/kernel/cobalt/debug.c b/kernel/cobalt/debug.c index 5783b0c..8cd32b3 100644 --- a/kernel/cobalt/debug.c +++ b/kernel/cobalt/debug.c @@ -37,8 +37,8 @@ * @defgroup cobalt_core_debug Debugging services * @{ */ -struct xnvfile_directory debug_vfroot; -EXPORT_SYMBOL_GPL(debug_vfroot); +struct xnvfile_directory cobalt_debug_vfroot; +EXPORT_SYMBOL_GPL(cobalt_debug_vfroot); #ifdef CONFIG_XENO_OPT_DEBUG_TRACE_RELAX @@ -498,7 +498,7 @@ static inline int init_trace_relax(void) xnheap_set_name(memory_pool, debug log); - ret = xnvfile_init_regular(relax, relax_vfile, debug_vfroot); + ret = xnvfile_init_regular(relax, relax_vfile, cobalt_debug_vfroot); if (ret) { xnheap_destroy(memory_pool); vfree(p); diff --git a/kernel/cobalt/debug.h b/kernel/cobalt/debug.h index 2af4fcb..24dc354 100644 --- a/kernel/cobalt/debug.h +++ b/kernel/cobalt/debug.h @@ -32,7 +32,7 @@ void xndebug_cleanup(void); void xndebug_shadow_init(struct xnthread *thread); -extern struct xnvfile_directory debug_vfroot; +extern struct xnvfile_directory cobalt_debug_vfroot; #else /* !XENO_OPT_DEBUG */ diff --git a/kernel/cobalt/procfs.c b/kernel/cobalt/procfs.c index cc1cad4..2c9342d 100644 --- a/kernel/cobalt/procfs.c +++ b/kernel/cobalt/procfs.c @@ -219,7 +219,7 @@ void xnprocfs_cleanup_tree(void) #if XENO_DEBUG(LOCKING) xnvfile_destroy_regular(lock_vfile); #endif - xnvfile_destroy_dir(debug_vfroot); + xnvfile_destroy_dir(cobalt_debug_vfroot); #endif /* XENO_DEBUG(COBALT) */ xnvfile_destroy_regular(apc_vfile); xnvfile_destroy_regular(faults_vfile); @@ -252,9 +252,9 @@ int __init xnprocfs_init_tree(void) xnvfile_init_regular(faults, faults_vfile, cobalt_vfroot); xnvfile_init_regular(apc, apc_vfile, cobalt_vfroot); #ifdef CONFIG_XENO_OPT_DEBUG - xnvfile_init_dir(debug, debug_vfroot, cobalt_vfroot); + xnvfile_init_dir(debug, cobalt_debug_vfroot, cobalt_vfroot); #if XENO_DEBUG(LOCKING) - xnvfile_init_regular(lock, lock_vfile, debug_vfroot); + xnvfile_init_regular(lock, lock_vfile, cobalt_debug_vfroot); #endif #endif /* XENO_DEBUG(COBALT) */ ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : cobalt/posix: convert 32bit syscalls to long return type
Module: xenomai-3 Branch: master Commit: 3f243033c2e44778dc403fa1540c2d9d70f6cf2a URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=3f243033c2e44778dc403fa1540c2d9d70f6cf2a Author: Philippe Gerum r...@xenomai.org Date: Tue Feb 17 12:16:22 2015 +0100 cobalt/posix: convert 32bit syscalls to long return type --- .../arch/x86/include/asm/xenomai/syscall32.h | 20 +- kernel/cobalt/posix/syscall32.c| 195 ++- kernel/cobalt/posix/syscall32.h| 200 ++-- 3 files changed, 207 insertions(+), 208 deletions(-) diff --git a/kernel/cobalt/arch/x86/include/asm/xenomai/syscall32.h b/kernel/cobalt/arch/x86/include/asm/xenomai/syscall32.h index 5604580..8bd40d4 100644 --- a/kernel/cobalt/arch/x86/include/asm/xenomai/syscall32.h +++ b/kernel/cobalt/arch/x86/include/asm/xenomai/syscall32.h @@ -62,12 +62,12 @@ __COBALT_CALL32x_ENTRY(__name, __syshand32emu__(__name)) /* x32 thunk implementation. */ -#define COBALT_SYSCALL32x(__name, __mode, __type, __args) \ - __typeof__(__type) cobalt32x_ ## __name __args +#define COBALT_SYSCALL32x(__name, __mode, __args) \ + long cobalt32x_ ## __name __args /* x32 thunk declaration. */ -#define COBALT_SYSCALL32x_DECL(__name, __type, __args) \ - __typeof__(__type) cobalt32x_ ## __name __args +#define COBALT_SYSCALL32x_DECL(__name, __args) \ + long cobalt32x_ ## __name __args #else /* !CONFIG_X86_X32 */ @@ -87,7 +87,7 @@ #define __COBALT_CALL32x_THUNK(__name) -#define COBALT_SYSCALL32x_DECL(__name, __type, __args) +#define COBALT_SYSCALL32x_DECL(__name, __args) #endif /* !CONFIG_X86_X32 */ @@ -127,12 +127,12 @@ __COBALT_CALL32emu_ENTRY(__name, __syshand32emu__(__name)) /* ia32 thunk implementation. */ -#define COBALT_SYSCALL32emu(__name, __mode, __type, __args)\ - __typeof__(__type) cobalt32emu_ ## __name __args +#define COBALT_SYSCALL32emu(__name, __mode, __args)\ + long cobalt32emu_ ## __name __args /* ia32 thunk declaration. */ -#define COBALT_SYSCALL32emu_DECL(__name, __type, __args) \ - __typeof__(__type) cobalt32emu_ ## __name __args +#define COBALT_SYSCALL32emu_DECL(__name, __args) \ + long cobalt32emu_ ## __name __args #else /* !CONFIG_IA32_EMULATION */ @@ -150,7 +150,7 @@ #define __COBALT_CALL32emu_THUNK(__name) -#define COBALT_SYSCALL32emu_DECL(__name, __type, __args) +#define COBALT_SYSCALL32emu_DECL(__name, __args) #endif /* !CONFIG_IA32_EMULATION */ diff --git a/kernel/cobalt/posix/syscall32.c b/kernel/cobalt/posix/syscall32.c index 17066bc..218bc7b 100644 --- a/kernel/cobalt/posix/syscall32.c +++ b/kernel/cobalt/posix/syscall32.c @@ -37,11 +37,11 @@ #include ../debug.h COBALT_SYSCALL32emu(thread_create, init, - int, (compat_ulong_t pth, - int policy, - const struct compat_sched_param_ex __user *u_param_ex, - int xid, - __u32 __user *u_winoff)) + (compat_ulong_t pth, +int policy, +const struct compat_sched_param_ex __user *u_param_ex, +int xid, +__u32 __user *u_winoff)) { struct sched_param_ex param_ex; int ret; @@ -54,11 +54,11 @@ COBALT_SYSCALL32emu(thread_create, init, } COBALT_SYSCALL32emu(thread_setschedparam_ex, conforming, - int, (compat_ulong_t pth, - int policy, - const struct compat_sched_param_ex __user *u_param_ex, - __u32 __user *u_winoff, - int __user *u_promoted)) + (compat_ulong_t pth, +int policy, +const struct compat_sched_param_ex __user *u_param_ex, +__u32 __user *u_winoff, +int __user *u_promoted)) { struct sched_param_ex param_ex; int ret; @@ -72,9 +72,9 @@ COBALT_SYSCALL32emu(thread_setschedparam_ex, conforming, } COBALT_SYSCALL32emu(thread_getschedparam_ex, current, - int, (compat_ulong_t pth, - int __user *u_policy, - struct compat_sched_param_ex __user *u_param)) + (compat_ulong_t pth, +int __user *u_policy, +struct compat_sched_param_ex __user *u_param)) { struct sched_param_ex param_ex; int policy; @@ -94,9 +94,9 @@ static inline int sys32_fetch_timeout(struct timespec *ts, } COBALT_SYSCALL32emu(sem_open, lostage, - int, (compat_uptr_t __user *u_addrp, - const char __user *u_name, - int oflags, mode_t mode, unsigned int value)) + (compat_uptr_t __user *u_addrp, +const char __user *u_name, +int
[Xenomai-git] Philippe Gerum : cobalt/kernel: unify naming of extern data - cobalt_heap
Module: xenomai-3 Branch: master Commit: 2d43cc8850f352fda6dc3a8d21c50dd8a12b3b05 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=2d43cc8850f352fda6dc3a8d21c50dd8a12b3b05 Author: Philippe Gerum r...@xenomai.org Date: Tue Feb 17 11:48:12 2015 +0100 cobalt/kernel: unify naming of extern data - cobalt_heap --- include/cobalt/kernel/heap.h |6 +++--- kernel/cobalt/heap.c |4 ++-- kernel/cobalt/init.c | 10 +- kernel/cobalt/pipe.c |2 +- kernel/cobalt/posix/memory.c |8 kernel/drivers/ipc/iddp.c|6 +++--- kernel/drivers/ipc/xddp.c|2 +- 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/include/cobalt/kernel/heap.h b/include/cobalt/kernel/heap.h index 916ac8f..988004f 100644 --- a/include/cobalt/kernel/heap.h +++ b/include/cobalt/kernel/heap.h @@ -90,10 +90,10 @@ struct xnheap { u32 used; }; -extern struct xnheap kheap; +extern struct xnheap cobalt_heap; -#define xnmalloc(size) xnheap_alloc(kheap, size) -#define xnfree(ptr)xnheap_free(kheap, ptr) +#define xnmalloc(size) xnheap_alloc(cobalt_heap, size) +#define xnfree(ptr)xnheap_free(cobalt_heap, ptr) static inline u32 xnheap_get_size(const struct xnheap *heap) { diff --git a/kernel/cobalt/heap.c b/kernel/cobalt/heap.c index 918e263..359b74f 100644 --- a/kernel/cobalt/heap.c +++ b/kernel/cobalt/heap.c @@ -37,8 +37,8 @@ * http://docs.FreeBSD.org/44doc/papers/kernmalloc.pdf. *@{ */ -struct xnheap kheap; /* System heap */ -EXPORT_SYMBOL_GPL(kheap); +struct xnheap cobalt_heap; /* System heap */ +EXPORT_SYMBOL_GPL(cobalt_heap); static LIST_HEAD(heapq); /* Heap list for v-file dump */ diff --git a/kernel/cobalt/init.c b/kernel/cobalt/init.c index d5fc750..d47ecec 100644 --- a/kernel/cobalt/init.c +++ b/kernel/cobalt/init.c @@ -151,9 +151,9 @@ static void sys_shutdown(void) xnlock_put_irqrestore(nklock, s); xnregistry_cleanup(); - membase = xnheap_get_membase(kheap); - memsize = xnheap_get_size(kheap); - xnheap_destroy(kheap); + membase = xnheap_get_membase(cobalt_heap); + memsize = xnheap_get_size(cobalt_heap); + xnheap_destroy(cobalt_heap); free_pages_exact(membase, memsize); } @@ -284,10 +284,10 @@ static __init int sys_init(void) heapaddr = alloc_pages_exact(sysheap_size_arg * 1024, GFP_KERNEL); if (heapaddr == NULL || - xnheap_init(kheap, heapaddr, sysheap_size_arg * 1024)) { + xnheap_init(cobalt_heap, heapaddr, sysheap_size_arg * 1024)) { return -ENOMEM; } - xnheap_set_name(kheap, system heap); + xnheap_set_name(cobalt_heap, system heap); for_each_online_cpu(cpu) { sched = per_cpu(nksched, cpu); diff --git a/kernel/cobalt/pipe.c b/kernel/cobalt/pipe.c index 716cbf9..fa16378 100644 --- a/kernel/cobalt/pipe.c +++ b/kernel/cobalt/pipe.c @@ -271,7 +271,7 @@ static void *xnpipe_default_alloc_ibuf(size_t size, void *xstate) if (likely(buf != NULL)) return buf; - if (size xnheap_get_size(kheap)) + if (size xnheap_get_size(cobalt_heap)) /* Request will never succeed. */ return (struct xnpipe_mh *)-1; diff --git a/kernel/cobalt/posix/memory.c b/kernel/cobalt/posix/memory.c index efedfa2..9e4d093 100644 --- a/kernel/cobalt/posix/memory.c +++ b/kernel/cobalt/posix/memory.c @@ -180,10 +180,10 @@ static int do_sysmem_ioctls(struct rtdm_fd *fd, switch (request) { case MEMDEV_RTIOC_STAT: - xnlock_get_irqsave(kheap.lock, s); - stat.size = xnheap_get_size(kheap); - stat.free = xnheap_get_free(kheap); - xnlock_put_irqrestore(kheap.lock, s); + xnlock_get_irqsave(cobalt_heap.lock, s); + stat.size = xnheap_get_size(cobalt_heap); + stat.free = xnheap_get_free(cobalt_heap); + xnlock_put_irqrestore(cobalt_heap.lock, s); ret = rtdm_safe_copy_to_user(fd, arg, stat, sizeof(stat)); break; default: diff --git a/kernel/drivers/ipc/iddp.c b/kernel/drivers/ipc/iddp.c index d37c784..1eac820 100644 --- a/kernel/drivers/ipc/iddp.c +++ b/kernel/drivers/ipc/iddp.c @@ -167,7 +167,7 @@ static int iddp_socket(struct rtdm_fd *fd) sk-magic = IDDP_SOCKET_MAGIC; sk-name = nullsa; /* Unbound */ sk-peer = nullsa; - sk-bufpool = kheap; + sk-bufpool = cobalt_heap; sk-poolwaitq = poolwaitq; sk-poolsz = 0; sk-status = 0; @@ -205,7 +205,7 @@ static void iddp_close(struct rtdm_fd *fd) if (sk-handle) xnregistry_remove(sk-handle); - if (sk-bufpool != kheap) { + if (sk-bufpool != cobalt_heap) { poolmem = xnheap_get_membase(sk-privpool); poolsz = xnheap_get_size(sk-privpool);
[Xenomai-git] Philippe Gerum : utils/hdb: add basic shared heap debugger/viewer
Module: xenomai-3 Branch: master Commit: 4d5e3b32169cc3c1fb91fea8e5d465f13c543f0f URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=4d5e3b32169cc3c1fb91fea8e5d465f13c543f0f Author: Philippe Gerum r...@xenomai.org Date: Wed Mar 11 22:23:19 2015 +0100 utils/hdb: add basic shared heap debugger/viewer --- configure |3 +- configure.ac |1 + utils/Makefile.am |3 +- utils/Makefile.in |5 +- utils/hdb/Makefile.am | 21 ++ utils/hdb/Makefile.in | 708 + utils/hdb/hdb.c | 155 +++ 7 files changed, 892 insertions(+), 4 deletions(-) diff --git a/configure b/configure index 00c0535..24b51d7 100755 --- a/configure +++ b/configure @@ -14545,7 +14545,7 @@ XENO_AUTOINIT_LDFLAGS=-Wl,--wrap=main -Wl,--dynamic-list=$topdir/scripts/dynlis -ac_config_files=$ac_config_files Makefile config/Makefile scripts/Makefile scripts/xeno-config:scripts/xeno-config-$rtcore_type.in scripts/xeno lib/Makefile lib/boilerplate/Makefile lib/cobalt/Makefile lib/cobalt/arch/Makefile lib/cobalt/arch/arm/Makefile lib/cobalt/arch/arm/include/Makefile lib/cobalt/arch/arm/include/asm/Makefile lib/cobalt/arch/arm/include/asm/xenomai/Makefile lib/cobalt/arch/powerpc/Makefile lib/cobalt/arch/powerpc/include/Makefile lib/cobalt/arch/powerpc/include/asm/Makefile lib/cobalt/arch/powerpc/include/asm/xenomai/Makefile lib/cobalt/arch/blackfin/Makefile lib/cobalt/arch/blackfin/include/Makefile lib/cobalt/arch/blackfin/include/asm/Makefile lib/cobalt/arch/blackfin/include/asm/xenomai/Makefile lib/cobalt/arch/x86/Makefile lib/cobalt/arch/x86/include/Makefile lib/cobalt/arch/x86/include/asm/Makefile lib/cobalt/arch/x86/include/asm/xenomai/Makefile lib/cobalt/arch/nios2/Makefile lib/cobalt/arch/nios2/include/Makefile lib/cobalt/arch/nios2/include/asm/Makef ile lib/cobalt/arch/nios2/include/asm/xenomai/Makefile lib/cobalt/arch/sh/Makefile lib/cobalt/arch/sh/include/Makefile lib/cobalt/arch/sh/include/asm/Makefile lib/cobalt/arch/sh/include/asm/xenomai/Makefile lib/copperplate/Makefile lib/copperplate/regd/Makefile lib/alchemy/Makefile lib/vxworks/Makefile lib/psos/Makefile lib/analogy/Makefile lib/smokey/Makefile lib/trank/Makefile testsuite/Makefile testsuite/latency/Makefile testsuite/switchtest/Makefile testsuite/smokey/Makefile testsuite/smokey/arith/Makefile testsuite/smokey/sched-quota/Makefile testsuite/smokey/sched-tp/Makefile testsuite/smokey/rtdm/Makefile testsuite/smokey/vdso-access/Makefile testsuite/smokey/cond-torture/Makefile testsuite/smokey/mutex-torture/Makefile testsuite/smokey/xddp/Makefile testsuite/smokey/iddp/Makefile testsuite/smokey/bufp/Makefile testsuite/smokey/fork-exec/Makefile testsuite/smokey/sigdebug/Makefile testsuite/clocktest/Makefile testsuite/xeno-test/Makefile testsuite/regression/Makefile testsuit e/regression/posix/Makefile utils/Makefile utils/can/Makefile utils/analogy/Makefile utils/ps/Makefile utils/slackspot/Makefile utils/corectl/Makefile utils/autotune/Makefile utils/net/rtnet utils/net/rtnet.conf utils/net/Makefile demo/Makefile demo/posix/Makefile demo/posix/cobalt/Makefile demo/alchemy/Makefile demo/alchemy/cobalt/Makefile include/Makefile include/cobalt/uapi/Makefile include/cobalt/uapi/asm-generic/Makefile include/cobalt/uapi/kernel/Makefile include/cobalt/Makefile include/cobalt/sys/Makefile include/cobalt/kernel/Makefile include/cobalt/kernel/rtdm/Makefile include/cobalt/kernel/rtdm/analogy/Makefile include/cobalt/boilerplate/Makefile include/rtdm/Makefile include/rtdm/uapi/Makefile include/mercury/Makefile include/mercury/boilerplate/Makefile include/boilerplate/Makefile include/copperplate/Makefile include/alchemy/Makefile include/vxworks/Makefile include/psos/Makefile include/smokey/Makefile include/trank/Makefile include/trank/posix/Makefile include/trank/n ative/Makefile include/trank/rtdm/Makefile doc/Makefile doc/doxygen/Makefile doc/doxygen/xeno3prm-common.conf doc/doxygen/xeno3prm-html.conf doc/doxygen/xeno3prm-latex.conf doc/gitdoc/Makefile doc/asciidoc/Makefile +ac_config_files=$ac_config_files Makefile config/Makefile scripts/Makefile scripts/xeno-config:scripts/xeno-config-$rtcore_type.in scripts/xeno lib/Makefile lib/boilerplate/Makefile lib/cobalt/Makefile lib/cobalt/arch/Makefile lib/cobalt/arch/arm/Makefile lib/cobalt/arch/arm/include/Makefile lib/cobalt/arch/arm/include/asm/Makefile lib/cobalt/arch/arm/include/asm/xenomai/Makefile lib/cobalt/arch/powerpc/Makefile lib/cobalt/arch/powerpc/include/Makefile lib/cobalt/arch/powerpc/include/asm/Makefile lib/cobalt/arch/powerpc/include/asm/xenomai/Makefile lib/cobalt/arch/blackfin/Makefile lib/cobalt/arch/blackfin/include/Makefile lib/cobalt/arch/blackfin/include/asm/Makefile lib/cobalt/arch/blackfin/include/asm/xenomai/Makefile lib/cobalt/arch/x86/Makefile lib/cobalt/arch/x86/include/Makefile lib/cobalt/arch/x86/include/asm/Makefile
[Xenomai-git] Philippe Gerum : cobalt/posix: cleanup reclaiming of process-local objects
Module: xenomai-3 Branch: master Commit: e0e2775ad33537d2646af4d5e36c1333fe57d9a8 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=e0e2775ad33537d2646af4d5e36c1333fe57d9a8 Author: Philippe Gerum r...@xenomai.org Date: Tue Mar 17 17:58:56 2015 +0100 cobalt/posix: cleanup reclaiming of process-local objects --- kernel/cobalt/posix/cond.c | 38 +++--- kernel/cobalt/posix/cond.h | 11 - kernel/cobalt/posix/event.c| 33 ++ kernel/cobalt/posix/event.h| 11 - kernel/cobalt/posix/init.c | 43 + kernel/cobalt/posix/internal.h |8 +++ kernel/cobalt/posix/monitor.c | 32 + kernel/cobalt/posix/monitor.h | 11 - kernel/cobalt/posix/mqueue.c | 28 +- kernel/cobalt/posix/mqueue.h |4 kernel/cobalt/posix/mutex.c| 46 ++-- kernel/cobalt/posix/mutex.h| 10 kernel/cobalt/posix/nsem.c | 50 --- kernel/cobalt/posix/process.c | 51 kernel/cobalt/posix/process.h |8 +++ kernel/cobalt/posix/sched.c| 30 +++ kernel/cobalt/posix/sched.h| 11 - kernel/cobalt/posix/sem.c | 47 +++- kernel/cobalt/posix/sem.h | 10 +++- kernel/cobalt/posix/signal.c |7 +- kernel/cobalt/posix/signal.h |4 +--- kernel/cobalt/posix/timer.c|2 +- kernel/cobalt/posix/timer.h|5 +--- 23 files changed, 174 insertions(+), 326 deletions(-) diff --git a/kernel/cobalt/posix/cond.c b/kernel/cobalt/posix/cond.c index cdd0720..549a871 100644 --- a/kernel/cobalt/posix/cond.c +++ b/kernel/cobalt/posix/cond.c @@ -24,7 +24,7 @@ #include trace/events/cobalt-posix.h static inline void -cond_destroy_internal(xnhandle_t handle, struct cobalt_kqueues *q) +cond_destroy_internal(xnhandle_t handle) { struct cobalt_cond *cond; spl_t s; @@ -38,9 +38,8 @@ cond_destroy_internal(xnhandle_t handle, struct cobalt_kqueues *q) xnregistry_remove(handle); list_del(cond-link); /* -* synchbase wait queue may not be empty only when this -* function is called from cobalt_cond_pkg_cleanup, in which -* case we don't have to reschedule. +* At this point, synchbase wait queue is empty, so we don't +* have to reschedule. */ xnsynch_destroy(cond-synchbase); cobalt_mark_deleted(cond); @@ -76,7 +75,7 @@ pthread_cond_init(struct cobalt_cond_shadow *cnd, const struct cobalt_condattr * xnlock_get_irqsave(nklock, s); - condq = cobalt_kqueues(attr-pshared)-condq; + condq = cobalt_current_resources(attr-pshared)-condq; /* * We allow reinitializing a shared condvar. Rationale: since @@ -96,7 +95,7 @@ pthread_cond_init(struct cobalt_cond_shadow *cnd, const struct cobalt_condattr * goto fail_register; } xnlock_put_irqrestore(nklock, s); - cond_destroy_internal(cnd-handle, cobalt_kqueues(1)); + cond_destroy_internal(cnd-handle); xnlock_get_irqsave(nklock, s); do_init: ret = xnregistry_enter_anon(cond, cond-handle); @@ -109,7 +108,7 @@ do_init: xnsynch_init(cond-synchbase, synch_flags, NULL); cond-attr = *attr; cond-mutex = NULL; - cond-owningq = cobalt_kqueues(attr-pshared); + cond-scope = cobalt_current_resources(attr-pshared); list_add_tail(cond-link, condq); cnd-handle = cond-handle; @@ -147,7 +146,7 @@ static inline int pthread_cond_destroy(struct cobalt_cond_shadow *cnd) return -EINVAL; } - if (cond-owningq != cobalt_kqueues(cond-attr.pshared)) { + if (cond-scope != cobalt_current_resources(cond-attr.pshared)) { xnlock_put_irqrestore(nklock, s); return -EPERM; } @@ -161,7 +160,7 @@ static inline int pthread_cond_destroy(struct cobalt_cond_shadow *cnd) pshared = cond-attr.pshared; xnlock_put_irqrestore(nklock, s); - cond_destroy_internal(cnd-handle, cobalt_kqueues(pshared)); + cond_destroy_internal(cnd-handle); return 0; } @@ -184,7 +183,7 @@ static inline int cobalt_cond_timedwait_prologue(struct xnthread *cur, } #if XENO_DEBUG(USER) - if (cond-owningq != cobalt_kqueues(cond-attr.pshared)) { + if (cond-scope != cobalt_current_resources(cond-attr.pshared)) { err = -EPERM; goto unlock_and_return; } @@ -453,31 +452,22 @@ int cobalt_cond_deferred_signals(struct cobalt_cond *cond) return need_resched; } -void cobalt_condq_cleanup(struct cobalt_kqueues *q) +void cobalt_cond_reclaim(struct cobalt_process *process) { + struct cobalt_resources *p =
[Xenomai-git] Philippe Gerum : copperplate/regd: drop references to stale threads in sysgroup
Module: xenomai-3 Branch: master Commit: fe7ccb36fe2b1a0b148829ce4d1b0aaac5b0eb80 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=fe7ccb36fe2b1a0b148829ce4d1b0aaac5b0eb80 Author: Philippe Gerum r...@xenomai.org Date: Sun Mar 22 16:47:46 2015 +0100 copperplate/regd: drop references to stale threads in sysgroup --- include/copperplate/heapobj.h|4 ++-- lib/copperplate/regd/fs-common.c | 12 +++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/include/copperplate/heapobj.h b/include/copperplate/heapobj.h index 495d72c..c92e581 100644 --- a/include/copperplate/heapobj.h +++ b/include/copperplate/heapobj.h @@ -272,8 +272,8 @@ static inline void sysgroup_unlock(void) #define sysgroup_count(__group)\ (__main_sysgroup-__group ## _count) -#define for_each_sysgroup(__obj, __group) \ - list_for_each_entry(__obj, (__main_sysgroup-__group ## _list), next) +#define for_each_sysgroup(__obj, __tmp, __group) \ + list_for_each_entry_safe(__obj, __tmp, (__main_sysgroup-__group ## _list), next) int heapobj_pkg_init_shared(void); diff --git a/lib/copperplate/regd/fs-common.c b/lib/copperplate/regd/fs-common.c index 5f8b439..ab73d5c 100644 --- a/lib/copperplate/regd/fs-common.c +++ b/lib/copperplate/regd/fs-common.c @@ -70,9 +70,9 @@ static char *format_time(ticks_t value, char *buf, size_t bufsz) int open_threads(struct fsobj *fsobj, void *priv) { struct thread_data *thread_data, *p; + struct sysgroup_memspec *obj, *tmp; char sbuf[64], pbuf[16], tbuf[64]; struct threadobj_stat statbuf; - struct sysgroup_memspec *obj; struct fsobstack *o = priv; struct threadobj *thobj; const char *sched_class; @@ -105,13 +105,15 @@ int open_threads(struct fsobj *fsobj, void *priv) sysgroup_lock(); - for_each_sysgroup(obj, thread) { + for_each_sysgroup(obj, tmp, thread) { if (p - thread_data = count) break; thobj = container_of(obj, struct threadobj, memspec); ret = threadobj_lock(thobj); - if (ret) + if (ret) { + sysgroup_remove(thread, obj); continue; + } namecpy(p-name, thobj-name); p-name[sizeof(p-name) - 1] = '\0'; p-pid = thobj-pid; @@ -198,8 +200,8 @@ struct heap_data { int open_heaps(struct fsobj *fsobj, void *priv) { + struct sysgroup_memspec *obj, *tmp; struct heap_data *heap_data, *p; - struct sysgroup_memspec *obj; struct fsobstack *o = priv; struct shared_heap *heap; int ret, count, len = 0; @@ -230,7 +232,7 @@ int open_heaps(struct fsobj *fsobj, void *priv) * the group lock, so there is no point in acquiring each heap * lock individually for reading the slot. */ - for_each_sysgroup(obj, heap) { + for_each_sysgroup(obj, tmp, heap) { if (p - heap_data = count) break; heap = container_of(obj, struct shared_heap, memspec); ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : copperplate/registry: shorten sync delay with sysregd
Module: xenomai-3 Branch: master Commit: f444cb7974f37eadba4f696379e4d5139ef16e83 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=f444cb7974f37eadba4f696379e4d5139ef16e83 Author: Philippe Gerum r...@xenomai.org Date: Sun Mar 22 16:40:26 2015 +0100 copperplate/registry: shorten sync delay with sysregd --- lib/copperplate/registry.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/copperplate/registry.c b/lib/copperplate/registry.c index 661562b..cc10464 100644 --- a/lib/copperplate/registry.c +++ b/lib/copperplate/registry.c @@ -667,10 +667,10 @@ static int spawn_daemon(const char *sessdir) break; default: /* -* Make sure we sleep at least one second regardless -* of signal receipts. +* Make sure we sleep at least 200 ms regardless of +* signal receipts. */ - while (__STD(sleep(1)) 0) ; + while (__STD(usleep(20)) 0) ; regd_pid = pid; barrier(); sa.sa_handler = sigchld_handler; ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : cobalt/posix/process: introduce resource management API
Module: xenomai-3 Branch: master Commit: f72256ffc5c4b525749f7940119b42289565a9e0 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=f72256ffc5c4b525749f7940119b42289565a9e0 Author: Philippe Gerum r...@xenomai.org Date: Wed Mar 18 11:52:46 2015 +0100 cobalt/posix/process: introduce resource management API We depart from POSIX with respect to the lifetime of pshared objects: those will be automatically reclaimed by Cobalt upon exit from the processes which created them. --- kernel/cobalt/posix/internal.h | 10 - kernel/cobalt/posix/process.c | 48 +++- kernel/cobalt/posix/process.h | 43 --- 3 files changed, 83 insertions(+), 18 deletions(-) diff --git a/kernel/cobalt/posix/internal.h b/kernel/cobalt/posix/internal.h index dd20972..ba33ebe 100644 --- a/kernel/cobalt/posix/internal.h +++ b/kernel/cobalt/posix/internal.h @@ -47,16 +47,6 @@ #define cobalt_mark_deleted(t) ((t)-magic = ~(t)-magic) -static inline struct cobalt_resources *cobalt_current_resources(int pshared) -{ - struct cobalt_process *process; - - if (pshared || (process = cobalt_current_process()) == NULL) - return cobalt_global_resources; - - return process-resources; -} - static inline xnhandle_t cobalt_get_handle_from_user(xnhandle_t *u_h) { xnhandle_t handle; diff --git a/kernel/cobalt/posix/process.c b/kernel/cobalt/posix/process.c index 9d93e43..15fae37 100644 --- a/kernel/cobalt/posix/process.c +++ b/kernel/cobalt/posix/process.c @@ -1362,19 +1362,57 @@ static void detach_process(struct cobalt_process *process) cobalt_umm_destroy(p-umm); } +static void __reclaim_resource(struct cobalt_process *process, + void (*reclaim)(struct cobalt_resnode *node, spl_t s), + struct list_head *local, + struct list_head *global) +{ + struct cobalt_resnode *node, *tmp; + spl_t s; + + xnlock_get_irqsave(nklock, s); + + if (list_empty(global)) + goto flush_local; + + list_for_each_entry_safe(node, tmp, global, next) { + if (node-owner == process) { + reclaim(node, s); /* drops lock */ + xnlock_get_irqsave(nklock, s); + } + } + +flush_local: + if (list_empty(local)) + goto out; + + list_for_each_entry_safe(node, tmp, local, next) { + reclaim(node, s); /* drops lock */ + xnlock_get_irqsave(nklock, s); + } +out: + xnsched_run(); + xnlock_put_irqrestore(nklock, s); +} + +#define cobalt_reclaim_resource(__process, __reclaim, __type) \ + __reclaim_resource(__process, __reclaim,\ + (__process)-resources.__type ## q, \ + cobalt_global_resources.__type ## q) + static void cobalt_process_detach(void *arg) { struct cobalt_process *process = arg; cobalt_nsem_reclaim(process); - cobalt_timer_reclaim(process); + cobalt_timer_reclaim(process); cobalt_cond_reclaim(process); cobalt_mutex_reclaim(process); - cobalt_sem_reclaim(process); - cobalt_monitor_reclaim(process); + cobalt_sem_reclaim(process); + cobalt_monitor_reclaim(process); cobalt_event_reclaim(process); - cobalt_sched_reclaim(process); - detach_process(process); + cobalt_sched_reclaim(process); + detach_process(process); /* * The cobalt_process descriptor release may be deferred until * the last mapping on the private heap is gone. However, this diff --git a/kernel/cobalt/posix/process.h b/kernel/cobalt/posix/process.h index 5891559..ee4b225 100644 --- a/kernel/cobalt/posix/process.h +++ b/kernel/cobalt/posix/process.h @@ -56,9 +56,12 @@ struct cobalt_process { void *priv[NR_PERSONALITIES]; }; -extern struct list_head cobalt_thread_list; - -extern struct cobalt_resources cobalt_global_resources; +struct cobalt_resnode { + struct cobalt_resources *scope; + struct cobalt_process *owner; + struct list_head next; + xnhandle_t handle; +}; int cobalt_register_personality(struct xnthread_personality *personality); @@ -82,6 +85,10 @@ int cobalt_yield(xnticks_t min, xnticks_t max); int cobalt_process_init(void); +extern struct list_head cobalt_thread_list; + +extern struct cobalt_resources cobalt_global_resources; + static inline struct cobalt_process *cobalt_current_process(void) { return ipipe_current_threadinfo()-process; @@ -109,6 +116,36 @@ static inline struct cobalt_ppd *cobalt_ppd_get(int global) return process-sys_ppd; } +static inline struct cobalt_resources *cobalt_current_resources(int pshared) +{ + struct cobalt_process *process; + + if (pshared ||
[Xenomai-git] Philippe Gerum : cobalt/posix: group init work
Module: xenomai-3 Branch: master Commit: 376fdf23b322f96cf3e4be343e88a1292b0eb08f URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=376fdf23b322f96cf3e4be343e88a1292b0eb08f Author: Philippe Gerum r...@xenomai.org Date: Wed Mar 18 10:53:18 2015 +0100 cobalt/posix: group init work --- kernel/cobalt/posix/Makefile |1 - kernel/cobalt/posix/init.c| 49 - kernel/cobalt/posix/process.c | 39 kernel/cobalt/posix/thread.c |2 +- 4 files changed, 26 insertions(+), 65 deletions(-) diff --git a/kernel/cobalt/posix/Makefile b/kernel/cobalt/posix/Makefile index 2ac92ff..278e833 100644 --- a/kernel/cobalt/posix/Makefile +++ b/kernel/cobalt/posix/Makefile @@ -4,7 +4,6 @@ xenomai-y :=\ clock.o \ cond.o \ event.o \ - init.o \ io.o\ memory.o\ monitor.o \ diff --git a/kernel/cobalt/posix/init.c b/kernel/cobalt/posix/init.c deleted file mode 100644 index bc446d8..000 --- a/kernel/cobalt/posix/init.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Written by Gilles Chanteperdrix gilles.chanteperd...@xenomai.org. - * - * This program 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. - * - * This program 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 this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#include linux/init.h -#include linux/module.h -#include internal.h -#include thread.h -#include sched.h -#include cond.h -#include mutex.h -#include sem.h -#include mqueue.h -#include signal.h -#include timer.h -#include monitor.h -#include event.h - -LIST_HEAD(cobalt_thread_list); - -struct cobalt_resources cobalt_global_resources = { - .condq = LIST_HEAD_INIT(cobalt_global_resources.condq), - .mutexq = LIST_HEAD_INIT(cobalt_global_resources.mutexq), - .semq = LIST_HEAD_INIT(cobalt_global_resources.semq), - .monitorq = LIST_HEAD_INIT(cobalt_global_resources.monitorq), - .eventq = LIST_HEAD_INIT(cobalt_global_resources.eventq), - .schedq = LIST_HEAD_INIT(cobalt_global_resources.schedq), -}; - -__init int cobalt_init(void) -{ - cobalt_time_slice = CONFIG_XENO_OPT_RR_QUANTUM * 1000; - - return cobalt_process_init(); -} diff --git a/kernel/cobalt/posix/process.c b/kernel/cobalt/posix/process.c index 06ff84f..9d93e43 100644 --- a/kernel/cobalt/posix/process.c +++ b/kernel/cobalt/posix/process.c @@ -85,6 +85,17 @@ struct xnthread_personality *cobalt_personalities[NR_PERSONALITIES]; static struct xnsynch yield_sync; +LIST_HEAD(cobalt_thread_list); + +struct cobalt_resources cobalt_global_resources = { + .condq = LIST_HEAD_INIT(cobalt_global_resources.condq), + .mutexq = LIST_HEAD_INIT(cobalt_global_resources.mutexq), + .semq = LIST_HEAD_INIT(cobalt_global_resources.semq), + .monitorq = LIST_HEAD_INIT(cobalt_global_resources.monitorq), + .eventq = LIST_HEAD_INIT(cobalt_global_resources.eventq), + .schedq = LIST_HEAD_INIT(cobalt_global_resources.schedq), +}; + static unsigned __attribute__((pure)) process_hash_crunch(struct mm_struct *mm) { unsigned long hash = ((unsigned long)mm - PAGE_OFFSET) / sizeof(*mm); @@ -1371,7 +1382,20 @@ static void cobalt_process_detach(void *arg) */ } -int cobalt_process_init(void) +struct xnthread_personality cobalt_personality = { + .name = cobalt, + .magic = 0, + .ops = { + .attach_process = cobalt_process_attach, + .detach_process = cobalt_process_detach, + .map_thread = cobalt_thread_map, + .exit_thread = cobalt_thread_exit, + .finalize_thread = cobalt_thread_finalize, + }, +}; +EXPORT_SYMBOL_GPL(cobalt_personality); + +__init int cobalt_init(void) { unsigned int i, size; int ret; @@ -1431,16 +1455,3 @@ fail_debug: return ret; } - -struct xnthread_personality cobalt_personality = { - .name = cobalt, - .magic = 0, - .ops = { - .attach_process = cobalt_process_attach, - .detach_process = cobalt_process_detach, - .map_thread = cobalt_thread_map, - .exit_thread = cobalt_thread_exit, - .finalize_thread = cobalt_thread_finalize, - }, -}; -EXPORT_SYMBOL_GPL(cobalt_personality); diff --git a/kernel/cobalt/posix/thread.c
[Xenomai-git] Philippe Gerum : cobalt/posix/mutex: use resource management API
Module: xenomai-3 Branch: master Commit: 8c1b05986fd49f2b0a0d10756e17cbb78a2eeb8e URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=8c1b05986fd49f2b0a0d10756e17cbb78a2eeb8e Author: Philippe Gerum r...@xenomai.org Date: Wed Mar 18 18:17:08 2015 +0100 cobalt/posix/mutex: use resource management API --- kernel/cobalt/posix/mutex.c | 112 ++--- kernel/cobalt/posix/mutex.h |8 +-- kernel/cobalt/posix/process.c |2 +- 3 files changed, 44 insertions(+), 78 deletions(-) diff --git a/kernel/cobalt/posix/mutex.c b/kernel/cobalt/posix/mutex.c index 78fba35..0a21b36 100644 --- a/kernel/cobalt/posix/mutex.c +++ b/kernel/cobalt/posix/mutex.c @@ -28,21 +28,18 @@ static int cobalt_mutex_init_inner(struct cobalt_mutex_shadow *shadow, const struct cobalt_mutexattr *attr) { int synch_flags = XNSYNCH_PRIO | XNSYNCH_OWNER; - struct cobalt_resources *rs; struct cobalt_ppd *sys_ppd; spl_t s; int err; - rs = cobalt_current_resources(attr-pshared); - sys_ppd = cobalt_ppd_get(attr-pshared); - err = xnregistry_enter_anon(mutex, shadow-handle); + err = xnregistry_enter_anon(mutex, mutex-resnode.handle); if (err 0) return err; - mutex-handle = shadow-handle; + sys_ppd = cobalt_ppd_get(attr-pshared); + shadow-handle = mutex-resnode.handle; shadow-magic = COBALT_MUTEX_MAGIC; shadow-lockcnt = 0; - shadow-attr = *attr; shadow-state_offset = cobalt_umm_offset(sys_ppd-umm, state); @@ -54,45 +51,15 @@ static int cobalt_mutex_init_inner(struct cobalt_mutex_shadow *shadow, state-flags = (attr-type == PTHREAD_MUTEX_ERRORCHECK ? COBALT_MUTEX_ERRORCHECK : 0); mutex-attr = *attr; - mutex-scope = rs; INIT_LIST_HEAD(mutex-conds); xnlock_get_irqsave(nklock, s); - list_add_tail(mutex-link, rs-mutexq); + cobalt_add_resource(mutex-resnode, mutex, attr-pshared); xnlock_put_irqrestore(nklock, s); return 0; } -static void -cobalt_mutex_destroy_inner(xnhandle_t handle) -{ - struct cobalt_mutex *mutex; - spl_t s; - - xnlock_get_irqsave(nklock, s); - mutex = xnregistry_lookup(handle, NULL); - if (!cobalt_obj_active(mutex, COBALT_MUTEX_MAGIC, typeof(*mutex))) { - xnlock_put_irqrestore(nklock, s); - printk(XENO_WARNING %s: invalid mutex %x\n, - __func__, mutex ? mutex-magic : ~0); - return; - } - xnregistry_remove(handle); - list_del(mutex-link); - /* -* At this point, synchbase wait queue must be empty, so we -* don't need to reschedule. -*/ - xnsynch_destroy(mutex-synchbase); - cobalt_mark_deleted(mutex); - xnlock_put_irqrestore(nklock, s); - - cobalt_umm_free(cobalt_ppd_get(mutex-attr.pshared)-umm, - mutex-synchbase.fastlock); - xnfree(mutex); -} - /* must be called with nklock locked, interrupts off. */ int __cobalt_mutex_acquire_unchecked(struct xnthread *cur, struct cobalt_mutex *mutex, @@ -129,7 +96,8 @@ int cobalt_mutex_release(struct xnthread *cur, return -EINVAL; #if XENO_DEBUG(USER) - if (mutex-scope != cobalt_current_resources(mutex-attr.pshared)) + if (mutex-resnode.scope != + cobalt_current_resources(mutex-attr.pshared)) return -EPERM; #endif state = container_of(mutex-synchbase.fastlock, struct cobalt_mutex_state, owner); @@ -175,7 +143,8 @@ redo: goto out; } #if XENO_DEBUG(USER) - if (mutex-scope != cobalt_current_resources(mutex-attr.pshared)) { + if (mutex-resnode.scope != + cobalt_current_resources(mutex-attr.pshared)) { ret = -EPERM; goto out; } @@ -288,43 +257,42 @@ COBALT_SYSCALL(mutex_init, current, COBALT_SYSCALL(mutex_destroy, current, (struct cobalt_mutex_shadow __user *u_mx)) { - struct cobalt_mutex *mutex; struct cobalt_mutex_shadow mx; + struct cobalt_mutex *mutex; spl_t s; - int err; + int ret; if (cobalt_copy_from_user(mx, u_mx, sizeof(mx))) return -EFAULT; xnlock_get_irqsave(nklock, s); + mutex = xnregistry_lookup(mx.handle, NULL); if (!cobalt_obj_active(mutex, COBALT_MUTEX_MAGIC, typeof(*mutex))) { - err = -EINVAL; - goto err_unlock; + ret = -EINVAL; + goto fail; } - if (cobalt_current_resources(mutex-attr.pshared) != mutex-scope) { - err = -EPERM; - goto err_unlock; + if (cobalt_current_resources(mutex-attr.pshared) != + mutex-resnode.scope) { + ret = -EPERM; +
[Xenomai-git] Philippe Gerum : cobalt: fixups for kernel 3.18
Module: xenomai-3 Branch: master Commit: f85712970575265c66941af6a2ddecefca3b6cb8 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=f85712970575265c66941af6a2ddecefca3b6cb8 Author: Philippe Gerum r...@xenomai.org Date: Sat Feb 28 10:46:35 2015 +0100 cobalt: fixups for kernel 3.18 --- include/cobalt/kernel/apc.h |2 +- include/cobalt/kernel/sched.h|2 +- include/cobalt/kernel/stat.h |2 +- include/cobalt/kernel/timer.h|2 +- kernel/cobalt/apc.c |4 ++-- kernel/cobalt/include/asm-generic/xenomai/wrappers.h |7 +++ kernel/cobalt/intr.c |4 ++-- kernel/cobalt/posix/process.c|2 +- 8 files changed, 16 insertions(+), 9 deletions(-) diff --git a/include/cobalt/kernel/apc.h b/include/cobalt/kernel/apc.h index 1009c2d..7075ad0 100644 --- a/include/cobalt/kernel/apc.h +++ b/include/cobalt/kernel/apc.h @@ -35,7 +35,7 @@ void xnapc_free(int apc); static inline void __xnapc_schedule(int apc) { - unsigned long *p = __this_cpu_ptr(cobalt_machine_cpudata)-apc_pending; + unsigned long *p = raw_cpu_ptr(cobalt_machine_cpudata)-apc_pending; if (!__test_and_set_bit(apc, p)) ipipe_post_irq_root(cobalt_pipeline.apc_virq); diff --git a/include/cobalt/kernel/sched.h b/include/cobalt/kernel/sched.h index c9b86fb..1a2c6eb 100644 --- a/include/cobalt/kernel/sched.h +++ b/include/cobalt/kernel/sched.h @@ -190,7 +190,7 @@ static inline struct xnsched *xnsched_struct(int cpu) static inline struct xnsched *xnsched_current(void) { /* IRQs off */ - return __this_cpu_ptr(nksched); + return raw_cpu_ptr(nksched); } static inline struct xnthread *xnsched_current_thread(void) diff --git a/include/cobalt/kernel/stat.h b/include/cobalt/kernel/stat.h index 713ade4..2e06514 100644 --- a/include/cobalt/kernel/stat.h +++ b/include/cobalt/kernel/stat.h @@ -37,7 +37,7 @@ typedef struct xnstat_exectime { } xnstat_exectime_t; -#define xnstat_percpu_data __this_cpu_ptr(nktimer.stats) +#define xnstat_percpu_data raw_cpu_ptr(nktimer.stats) /* Return current date which can be passed to other xnstat services for immediate or lazy accounting. */ diff --git a/include/cobalt/kernel/timer.h b/include/cobalt/kernel/timer.h index f7a80ab..60f900b 100644 --- a/include/cobalt/kernel/timer.h +++ b/include/cobalt/kernel/timer.h @@ -185,7 +185,7 @@ xnclock_percpu_timerdata(struct xnclock *clock, int cpu) static inline struct xntimerdata * xnclock_this_timerdata(struct xnclock *clock) { - return __this_cpu_ptr(clock-timerdata); + return raw_cpu_ptr(clock-timerdata); } struct xntimer { diff --git a/kernel/cobalt/apc.c b/kernel/cobalt/apc.c index 3fb337a..3383a26 100644 --- a/kernel/cobalt/apc.c +++ b/kernel/cobalt/apc.c @@ -58,13 +58,13 @@ void apc_dispatch(unsigned int virq, void *arg) spin_lock(apc_lock); /* This is atomic linux context (non-threaded IRQ). */ - p = __this_cpu_ptr(cobalt_machine_cpudata)-apc_pending; + p = raw_cpu_ptr(cobalt_machine_cpudata)-apc_pending; while (*p) { apc = ffnz(*p); clear_bit(apc, p); handler = cobalt_pipeline.apc_table[apc].handler; cookie = cobalt_pipeline.apc_table[apc].cookie; - __this_cpu_ptr(cobalt_machine_cpudata)-apc_shots[apc]++; + raw_cpu_ptr(cobalt_machine_cpudata)-apc_shots[apc]++; spin_unlock(apc_lock); handler(cookie); spin_lock(apc_lock); diff --git a/kernel/cobalt/include/asm-generic/xenomai/wrappers.h b/kernel/cobalt/include/asm-generic/xenomai/wrappers.h index efba9b0..2a2172d 100644 --- a/kernel/cobalt/include/asm-generic/xenomai/wrappers.h +++ b/kernel/cobalt/include/asm-generic/xenomai/wrappers.h @@ -34,6 +34,9 @@ * - keep the conditional structure flat, no nesting (e.g. do not nest * the pre-3.11 conditions into the pre-3.14 ones). * - group all wrappers which share the same condition. + * - identify the first kernel release for which the wrapper should + * be defined, instead of testing the existence of a preprocessor + * symbol, so that obsolete wrappers can be spotted. */ #if LINUX_VERSION_CODE KERNEL_VERSION(3,11,0) @@ -48,6 +51,10 @@ #define get_current_uuid() from_kuid_munged(current_user_ns(), current_uid()) #endif +#if LINUX_VERSION_CODE KERNEL_VERSION(3,15,0) +#define raw_cpu_ptr(v) __this_cpu_ptr(v) +#endif + #if LINUX_VERSION_CODE KERNEL_VERSION(3,16,0) #define smp_mb__before_atomic() smp_mb() #define smp_mb__after_atomic() smp_mb() diff --git a/kernel/cobalt/intr.c b/kernel/cobalt/intr.c index 19fcc2c..50ff595 100644 --- a/kernel/cobalt/intr.c +++ b/kernel/cobalt/intr.c @@ -118,7 +118,7 @@ static void inc_irqstats(struct
[Xenomai-git] Philippe Gerum : copperplate/registry: move anon sessions under the user tree
Module: xenomai-3 Branch: master Commit: ff1e3666c8079b67d9676f0caf14d8563e44de55 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=ff1e3666c8079b67d9676f0caf14d8563e44de55 Author: Philippe Gerum r...@xenomai.org Date: Tue Mar 24 10:08:05 2015 +0100 copperplate/registry: move anon sessions under the user tree --- lib/copperplate/init.c | 24 ++-- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/lib/copperplate/init.c b/lib/copperplate/init.c index b5b7a36..f6e06d3 100644 --- a/lib/copperplate/init.c +++ b/lib/copperplate/init.c @@ -513,28 +513,24 @@ static int get_session_root(int *regflags_r) struct passwd *pw; int ret; + pw = getpwuid(geteuid()); + if (pw == NULL) + return -errno; + if (__node_info.session_label == NULL) { ret = asprintf(session, anon@%d, __node_id); if (ret 0) return -ENOMEM; __node_info.session_label = session; - ret = asprintf(sessdir, %s/%s, - __node_info.registry_root, session); - if (ret 0) - return -ENOMEM; *regflags_r |= REGISTRY_ANON; - } else { - pw = getpwuid(geteuid()); - if (pw == NULL) - return -errno; - - ret = asprintf(sessdir, %s/%s/%s, - __node_info.registry_root, - pw-pw_name, __node_info.session_label); - if (ret 0) - return -ENOMEM; } + ret = asprintf(sessdir, %s/%s/%s, + __node_info.registry_root, + pw-pw_name, __node_info.session_label); + if (ret 0) + return -ENOMEM; + __node_info.session_root = sessdir; return 0; ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Jan Kiszka : cobalt/posix/sem: Increment semaphore on interrupted sem_wait
Module: xenomai-3 Branch: master Commit: 2b2efee02f28ea9cb7494413f4fc555cb83fbeda URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=2b2efee02f28ea9cb7494413f4fc555cb83fbeda Author: Jan Kiszka jan.kis...@siemens.com Date: Fri Mar 13 19:20:09 2015 +0100 cobalt/posix/sem: Increment semaphore on interrupted sem_wait When leaving sem_wait due to an interruption, don't forget to increment the semaphore again as the acquisition was unsuccessful. For this we can use sem_post_inner, we just have to move it unmodified up in the file. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- kernel/cobalt/posix/sem.c | 68 +++-- 1 file changed, 35 insertions(+), 33 deletions(-) diff --git a/kernel/cobalt/posix/sem.c b/kernel/cobalt/posix/sem.c index ab97fb3..fc89c24 100644 --- a/kernel/cobalt/posix/sem.c +++ b/kernel/cobalt/posix/sem.c @@ -241,6 +241,37 @@ static int sem_trywait(xnhandle_t handle) return err; } +static int sem_post_inner(struct cobalt_sem *sem, struct cobalt_kqueues *ownq, int bcast) +{ + if (sem == NULL || sem-magic != COBALT_SEM_MAGIC) + return -EINVAL; + +#if XENO_DEBUG(USER) + if (ownq ownq != sem_kqueue(sem)) + return -EPERM; +#endif + + if (atomic_read(sem-state-value) == SEM_VALUE_MAX) + return -EINVAL; + + if (!bcast) { + if (atomic_inc_return(sem-state-value) = 0) { + if (xnsynch_wakeup_one_sleeper(sem-synchbase)) + xnsched_run(); + } else if (sem-flags SEM_PULSE) + atomic_set(sem-state-value, 0); + } else { + if (atomic_read(sem-state-value) 0) { + atomic_set(sem-state-value, 0); + if (xnsynch_flush(sem-synchbase, 0) == + XNSYNCH_RESCHED) + xnsched_run(); + } + } + + return 0; +} + static int sem_wait(xnhandle_t handle) { struct cobalt_sem *sem; @@ -256,10 +287,12 @@ static int sem_wait(xnhandle_t handle) ret = 0; info = xnsynch_sleep_on(sem-synchbase, XN_INFINITE, XN_RELATIVE); - if (info XNRMID) + if (info XNRMID) { ret = -EINVAL; - else if (info XNBREAK) + } else if (info XNBREAK) { + sem_post_inner(sem, sem-owningq, 0); ret = -EINTR; + } out: xnlock_put_irqrestore(nklock, s); @@ -335,37 +368,6 @@ int __cobalt_sem_timedwait(struct cobalt_sem_shadow __user *u_sem, return ret; } -int sem_post_inner(struct cobalt_sem *sem, struct cobalt_kqueues *ownq, int bcast) -{ - if (sem == NULL || sem-magic != COBALT_SEM_MAGIC) - return -EINVAL; - -#if XENO_DEBUG(USER) - if (ownq ownq != sem_kqueue(sem)) - return -EPERM; -#endif - - if (atomic_read(sem-state-value) == SEM_VALUE_MAX) - return -EINVAL; - - if (!bcast) { - if (atomic_inc_return(sem-state-value) = 0) { - if (xnsynch_wakeup_one_sleeper(sem-synchbase)) - xnsched_run(); - } else if (sem-flags SEM_PULSE) - atomic_set(sem-state-value, 0); - } else { - if (atomic_read(sem-state-value) 0) { - atomic_set(sem-state-value, 0); - if (xnsynch_flush(sem-synchbase, 0) == - XNSYNCH_RESCHED) - xnsched_run(); - } - } - - return 0; -} - static int sem_post(xnhandle_t handle) { struct cobalt_sem *sm; ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : copperplate/registry: disambiguate socket usage
Module: xenomai-3 Branch: master Commit: b3acca61db633ece76c7eebe175716ef6acaaa4d URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=b3acca61db633ece76c7eebe175716ef6acaaa4d Author: Philippe Gerum r...@xenomai.org Date: Mon Mar 23 15:23:12 2015 +0100 copperplate/registry: disambiguate socket usage --- lib/copperplate/registry.c |8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/copperplate/registry.c b/lib/copperplate/registry.c index 26b777b..8c7354a 100644 --- a/lib/copperplate/registry.c +++ b/lib/copperplate/registry.c @@ -714,19 +714,19 @@ static int connect_regd(const char *sessdir, char **mountpt, int flags) sun.sun_path[0] = '\0'; for (retries = 0; retries 3; retries++) { - s = socket(AF_UNIX, SOCK_SEQPACKET, 0); + s = __STD(socket(AF_UNIX, SOCK_SEQPACKET, 0)); if (s 0) { ret = -errno; free(*mountpt); return ret; } - ret = connect(s, (struct sockaddr *)sun, addrlen); + ret = __STD(connect(s, (struct sockaddr *)sun, addrlen)); if (ret == 0) { - ret = recv(s, *mountpt, PATH_MAX, 0); + ret = __STD(recv(s, *mountpt, PATH_MAX, 0)); if (ret 0) return 0; } - close(s); + __STD(close(s)); ret = spawn_daemon(sessdir, flags); if (ret) break; ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : boilerplate/hash: pass opaque arg to table walk handler
Module: xenomai-3 Branch: master Commit: 97132d8ad817f374708a980efe11bd83ac8fde2b URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=97132d8ad817f374708a980efe11bd83ac8fde2b Author: Philippe Gerum r...@xenomai.org Date: Wed Mar 11 22:01:35 2015 +0100 boilerplate/hash: pass opaque arg to table walk handler --- include/boilerplate/hash.h | 10 ++ lib/boilerplate/hash.c | 14 -- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/include/boilerplate/hash.h b/include/boilerplate/hash.h index 081aefe..2d77d2f 100644 --- a/include/boilerplate/hash.h +++ b/include/boilerplate/hash.h @@ -54,7 +54,8 @@ struct hash_operations { }; typedef int (*hash_walk_op)(struct hash_table *t, - struct hashobj *obj); + struct hashobj *obj, + void *arg); #ifdef CONFIG_XENO_PSHARED @@ -82,7 +83,8 @@ struct pvhash_operations { }; typedef int (*pvhash_walk_op)(struct pvhash_table *t, - struct pvhashobj *obj); + struct pvhashobj *obj, + void *arg); #else /* !CONFIG_XENO_PSHARED */ #define pvhashobj hashobj @@ -137,7 +139,7 @@ struct hashobj *hash_search(struct hash_table *t, const struct hash_operations *hops); int hash_walk(struct hash_table *t, - hash_walk_op walk); + hash_walk_op walk, void *arg); #ifdef CONFIG_XENO_PSHARED @@ -203,7 +205,7 @@ struct pvhashobj *pvhash_search(struct pvhash_table *t, const struct pvhash_operations *hops); int pvhash_walk(struct pvhash_table *t, - pvhash_walk_op walk); + pvhash_walk_op walk, void *arg); #else /* !CONFIG_XENO_PSHARED */ #define pvhash_inithash_init diff --git a/lib/boilerplate/hash.c b/lib/boilerplate/hash.c index c7f5a50..35fcf73 100644 --- a/lib/boilerplate/hash.c +++ b/lib/boilerplate/hash.c @@ -212,7 +212,7 @@ out: return obj; } -int hash_walk(struct hash_table *t, hash_walk_op walk) +int hash_walk(struct hash_table *t, hash_walk_op walk, void *arg) { struct hash_bucket *bucket; struct hashobj *obj, *tmp; @@ -226,7 +226,7 @@ int hash_walk(struct hash_table *t, hash_walk_op walk) continue; list_for_each_entry_safe(obj, tmp, bucket-obj_list, link) { read_unlock(t-lock); - ret = walk(t, obj); + ret = walk(t, obj, arg); if (ret) return __bt(ret); read_lock_nocancel(t-lock); @@ -266,8 +266,10 @@ static inline int store_key(struct hashobj *obj, static inline void drop_key(struct hashobj *obj, const struct hash_operations *hops) { - if (obj-key != __moff(obj-static_key)) - hops-free((void *)__mptr(obj-key)); + const void *key = __mptr(obj-key); + + if (key != obj-static_key) + hops-free((void *)key); } int __hash_enter_probe(struct hash_table *t, @@ -461,7 +463,7 @@ out: return obj; } -int pvhash_walk(struct pvhash_table *t,pvhash_walk_op walk) +int pvhash_walk(struct pvhash_table *t,pvhash_walk_op walk, void *arg) { struct pvhash_bucket *bucket; struct pvhashobj *obj, *tmp; @@ -475,7 +477,7 @@ int pvhash_walk(struct pvhash_table *t, pvhash_walk_op walk) continue; pvlist_for_each_entry_safe(obj, tmp, bucket-obj_list, link) { read_unlock(t-lock); - ret = walk(t, obj); + ret = walk(t, obj, arg); if (ret) return __bt(ret); read_lock_nocancel(t-lock); ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : copperplate/heapobj: use per-process heap for anon sessions
Module: xenomai-3 Branch: next Commit: 14343e9e0f7c37708b6221e4fb1c2ac847f2091a URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=14343e9e0f7c37708b6221e4fb1c2ac847f2091a Author: Philippe Gerum r...@xenomai.org Date: Sun Mar 22 19:21:29 2015 +0100 copperplate/heapobj: use per-process heap for anon sessions We have different lifetimes for Cobalt-managed POSIX objects such as mutexes and condvars, and Cobalt maintains dynamically allocated resources for them. Some POSIX objects are embedded into the session header for protecting sysgroups, and serializing allocation ops on the shared heap. Therefore, they must survive until the last process detaches from the anon session. Most other POSIX objects stored into the shared heap become virtually stale when the application exits and should be reclaimed automatically, so that we don't end up leaking kernel resources as processes come and go into the anon session. For the sake of simplicity, Cobalt reclaims shared POSIX objects upon exit of their respective creator, assuming that a multi-process application requires all involved processes to be present at any time, including the one which has initialized the resources. By using separate, per-process heaps for each instance of the anon session, we make sure that all POSIX resources can be reclaimed safely by Cobalt for any given session, upon application exit. --- include/copperplate/heapobj.h |7 +++ include/copperplate/registry.h| 16 +-- lib/copperplate/heapobj-pshared.c | 39 lib/copperplate/init.c| 38 ++-- lib/copperplate/internal.h|3 +- lib/copperplate/regd/regd.c | 65 -- lib/copperplate/registry.c| 42 ++--- scripts/Makefile.am |1 - scripts/xeno-multiuser| 91 - 9 files changed, 139 insertions(+), 163 deletions(-) diff --git a/include/copperplate/heapobj.h b/include/copperplate/heapobj.h index c92e581..b628ea4 100644 --- a/include/copperplate/heapobj.h +++ b/include/copperplate/heapobj.h @@ -310,6 +310,8 @@ int heapobj_bind_session(const char *session); void heapobj_unbind_session(void); +int heapobj_unlink_session(const char *session); + void *xnmalloc(size_t size); void xnfree(void *ptr); @@ -425,6 +427,11 @@ static inline int heapobj_bind_session(const char *session) return -ENOSYS; } +static inline int heapobj_unlink_session(const char *session) +{ + return 0; +} + static inline void heapobj_unbind_session(void) { } static inline void *xnmalloc(size_t size) diff --git a/include/copperplate/registry.h b/include/copperplate/registry.h index 903db4a..8e423dc 100644 --- a/include/copperplate/registry.h +++ b/include/copperplate/registry.h @@ -29,6 +29,9 @@ struct fsobj; +#define REGISTRY_SHARED 1 +#define REGISTRY_ANON2 + #ifdef CONFIG_XENO_REGISTRY struct registry_operations { @@ -76,9 +79,12 @@ void registry_destroy_file(struct fsobj *fsobj); void registry_touch_file(struct fsobj *fsobj); -int __registry_pkg_init(const char *arg0, char *mountpt, int shared_registry); +int __registry_pkg_init(const char *arg0, + char *mountpt, + int flags); -int registry_pkg_init(const char *arg0); +int registry_pkg_init(const char *arg0, + int flags); void registry_pkg_destroy(void); @@ -126,13 +132,15 @@ void registry_touch_file(struct fsobj *fsobj) } static inline -int __registry_pkg_init(const char *arg0, char *mountpt, int shared_registry) +int __registry_pkg_init(const char *arg0, + char *mountpt, int flags) { return 0; } static inline -int registry_pkg_init(const char *arg0) +int registry_pkg_init(const char *arg0, + int flags) { return 0; } diff --git a/lib/copperplate/heapobj-pshared.c b/lib/copperplate/heapobj-pshared.c index 20b5b44..88c0e21 100644 --- a/lib/copperplate/heapobj-pshared.c +++ b/lib/copperplate/heapobj-pshared.c @@ -33,6 +33,7 @@ #include unistd.h #include signal.h #include fcntl.h +#include malloc.h #include unistd.h #include boilerplate/list.h #include boilerplate/hash.h @@ -622,7 +623,7 @@ static int create_main_heap(pid_t *cnode_r) * Otherwise, create the heap for the new emerging session and * bind to it. */ - snprintf(hobj-name, sizeof(hobj-name), %s.main-heap, session); + snprintf(hobj-name, sizeof(hobj-name), %s.heap, session); snprintf(hobj-fsname, sizeof(hobj-fsname), /xeno:%s, hobj-name); fd = shm_open(hobj-fsname, O_RDWR|O_CREAT, 0600); @@ -708,13 +709,13 @@ static int bind_main_heap(const char *session) { struct heapobj *hobj = main_pool; struct session_heap *m_heap; + int ret, fd, cpid; struct stat sbuf; memoff_t len; - int ret, fd; /* No error tracking, this is
[Xenomai-git] Philippe Gerum : cobalt/x86: exclude %rsp from mayday fixup in long mode
Module: xenomai-3 Branch: master Commit: 498e4e9ef69ef7cb2ec4e6a889e3c016f218bdd9 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=498e4e9ef69ef7cb2ec4e6a889e3c016f218bdd9 Author: Philippe Gerum r...@xenomai.org Date: Thu Feb 12 18:39:02 2015 +0100 cobalt/x86: exclude %rsp from mayday fixup in long mode --- kernel/cobalt/arch/x86/mayday.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/cobalt/arch/x86/mayday.c b/kernel/cobalt/arch/x86/mayday.c index 62c5eea..22a9196 100644 --- a/kernel/cobalt/arch/x86/mayday.c +++ b/kernel/cobalt/arch/x86/mayday.c @@ -204,11 +204,12 @@ void xnarch_fixup_mayday(struct xnarchtcb *tcb, struct pt_regs *regs) test_thread_flag(TIF_IA32)) { regs-ip = tcb-mayday.ip; regs-ax = tcb-mayday.ax; + regs-sp = tcb-mayday.sp; } else regs-ax = tcb-mayday.ip; #else regs-ip = tcb-mayday.ip; regs-ax = tcb-mayday.ax; -#endif regs-sp = tcb-mayday.sp; +#endif } ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : cobalt/kernel: sanitize usage of internal copy_to/ from helpers
Module: xenomai-3 Branch: master Commit: cc47a3104817cd5befb4218e2042debb122fc79f URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=cc47a3104817cd5befb4218e2042debb122fc79f Author: Philippe Gerum r...@xenomai.org Date: Wed Feb 18 10:36:01 2015 +0100 cobalt/kernel: sanitize usage of internal copy_to/from helpers Unless explicitly paired with access_w/rok() checks, all copy to/from helpers should implement the safe form, testing for the basic sanity of the address range. cobalt_copy_to/from_user() implement the safe call form in replacement of __xn_safe_copy_to/from_user(). __xn_copy_to/from_user() still implement the unchecked variant, assuming the address range will be checked separately. Drivers should stick with the rtdm_copy_to/from_user() helpers. --- include/cobalt/kernel/rtdm/driver.h| 10 +++- kernel/cobalt/arch/arm/syscall.c |2 +- kernel/cobalt/bufd.c |6 ++--- .../cobalt/include/asm-generic/xenomai/syscall.h | 12 +- kernel/cobalt/posix/clock.c| 10 kernel/cobalt/posix/compat.c | 20 kernel/cobalt/posix/cond.c | 12 +- kernel/cobalt/posix/event.c| 10 kernel/cobalt/posix/io.c | 24 ++-- kernel/cobalt/posix/monitor.c |4 ++-- kernel/cobalt/posix/mqueue.c | 20 kernel/cobalt/posix/mutex.c| 12 +- kernel/cobalt/posix/nsem.c |2 +- kernel/cobalt/posix/sched.c| 10 kernel/cobalt/posix/sem.c | 16 ++--- kernel/cobalt/posix/signal.c | 17 ++ kernel/cobalt/posix/syscall.c | 14 ++-- kernel/cobalt/posix/syscall32.c| 22 +- kernel/cobalt/posix/thread.c | 18 +++ kernel/cobalt/posix/timer.c| 10 kernel/cobalt/posix/timerfd.c | 12 -- 21 files changed, 127 insertions(+), 136 deletions(-) diff --git a/include/cobalt/kernel/rtdm/driver.h b/include/cobalt/kernel/rtdm/driver.h index b2087f1..c14198b 100644 --- a/include/cobalt/kernel/rtdm/driver.h +++ b/include/cobalt/kernel/rtdm/driver.h @@ -1233,8 +1233,7 @@ static inline int rtdm_safe_copy_from_user(struct rtdm_fd *fd, void *dst, const void __user *src, size_t size) { - return (!access_rok(src, size) || - __xn_copy_from_user(dst, src, size)) ? -EFAULT : 0; + return cobalt_copy_from_user(dst, src, size); } static inline int rtdm_copy_to_user(struct rtdm_fd *fd, @@ -1248,17 +1247,14 @@ static inline int rtdm_safe_copy_to_user(struct rtdm_fd *fd, void __user *dst, const void *src, size_t size) { - return (!access_wok(dst, size) || - __xn_copy_to_user(dst, src, size)) ? -EFAULT : 0; + return cobalt_copy_to_user(dst, src, size); } static inline int rtdm_strncpy_from_user(struct rtdm_fd *fd, char *dst, const char __user *src, size_t count) { - if (unlikely(!access_rok(src, 1))) - return -EFAULT; - return __xn_strncpy_from_user(dst, src, count); + return cobalt_strncpy_from_user(dst, src, count); } static inline int rtdm_rt_capable(struct rtdm_fd *fd) diff --git a/kernel/cobalt/arch/arm/syscall.c b/kernel/cobalt/arch/arm/syscall.c index 735208b..ee78243 100644 --- a/kernel/cobalt/arch/arm/syscall.c +++ b/kernel/cobalt/arch/arm/syscall.c @@ -49,5 +49,5 @@ int xnarch_local_syscall(unsigned long a1, unsigned long a2, break; } - return __xn_safe_copy_to_user((void *)a2, info, sizeof(info)); + return cobalt_copy_to_user((void *)a2, info, sizeof(info)); } diff --git a/kernel/cobalt/bufd.c b/kernel/cobalt/bufd.c index decd1bd..9b41b6a 100644 --- a/kernel/cobalt/bufd.c +++ b/kernel/cobalt/bufd.c @@ -328,7 +328,7 @@ ssize_t xnbufd_copy_to_kmem(void *to, struct xnbufd *bufd, size_t len) */ if (current-mm == bufd-b_mm) { preemptible_only(); - if (__xn_safe_copy_from_user(to, (void __user *)from, len)) + if (cobalt_copy_from_user(to, (void __user *)from, len)) return -EFAULT; goto advance_offset; } @@ -433,7 +433,7 @@ ssize_t xnbufd_copy_from_kmem(struct xnbufd *bufd, void *from, size_t len) */ if (current-mm == bufd-b_mm) { preemptible_only(); -
[Xenomai-git] Philippe Gerum : build: drop autoconf-generated files
Module: xenomai-3 Branch: master Commit: e179b093f80e019cc30eaa61147638162578b405 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=e179b093f80e019cc30eaa61147638162578b405 Author: Philippe Gerum r...@xenomai.org Date: Mon Mar 23 16:58:14 2015 +0100 build: drop autoconf-generated files --- Makefile.in| 914 -- aclocal.m4 | 2262 --- config/Makefile.in | 491 - config/libtool.m4 | 7992 - config/ltmain.sh | 9655 --- config/ltoptions.m4| 384 - config/ltsugar.m4 | 123 - config/ltversion.m4| 23 - config/lt~obsolete.m4 | 98 - configure |17075 demo/Makefile.in | 661 - demo/alchemy/Makefile.in | 836 - demo/alchemy/cobalt/Makefile.in| 709 - demo/posix/Makefile.in | 826 - demo/posix/cobalt/Makefile.in | 891 - doc/Makefile.in| 674 - doc/asciidoc/Makefile.in | 699 - doc/doxygen/Makefile.in| 634 - doc/gitdoc/Makefile.in | 521 - include/Makefile.in| 776 - include/alchemy/Makefile.in| 616 - include/boilerplate/Makefile.in| 617 - include/cobalt/Makefile.in | 742 - include/cobalt/boilerplate/Makefile.in | 609 - include/cobalt/kernel/Makefile.in | 701 - include/cobalt/kernel/rtdm/Makefile.in | 677 - include/cobalt/kernel/rtdm/analogy/Makefile.in | 560 - include/cobalt/sys/Makefile.in | 611 - include/cobalt/uapi/Makefile.in| 731 - include/cobalt/uapi/asm-generic/Makefile.in| 553 - include/cobalt/uapi/kernel/Makefile.in | 613 - include/copperplate/Makefile.in| 621 - include/mercury/Makefile.in| 665 - include/mercury/boilerplate/Makefile.in| 609 - include/psos/Makefile.in | 603 - include/rtdm/Makefile.in | 727 - include/rtdm/uapi/Makefile.in | 612 - include/smokey/Makefile.in | 603 - include/trank/Makefile.in | 721 - include/trank/native/Makefile.in | 617 - include/trank/posix/Makefile.in| 603 - include/trank/rtdm/Makefile.in | 609 - include/vxworks/Makefile.in| 618 - include/xeno_config.h.in | 235 - lib/Makefile.in| 677 - lib/alchemy/Makefile.in| 824 - lib/analogy/Makefile.in| 779 - lib/boilerplate/Makefile.in| 810 - lib/cobalt/Makefile.in | 1045 -- lib/cobalt/arch/Makefile.in| 661 - lib/cobalt/arch/arm/Makefile.in| 766 - lib/cobalt/arch/arm/include/Makefile.in| 661 - lib/cobalt/arch/arm/include/asm/Makefile.in| 661 - .../arch/arm/include/asm/xenomai/Makefile.in | 553 - lib/cobalt/arch/blackfin/Makefile.in | 766 - lib/cobalt/arch/blackfin/include/Makefile.in | 661 - lib/cobalt/arch/blackfin/include/asm/Makefile.in | 661 - .../arch/blackfin/include/asm/xenomai/Makefile.in | 553 - lib/cobalt/arch/nios2/Makefile.in | 766 - lib/cobalt/arch/nios2/include/Makefile.in | 661 - lib/cobalt/arch/nios2/include/asm/Makefile.in | 661 - .../arch/nios2/include/asm/xenomai/Makefile.in | 553 - lib/cobalt/arch/powerpc/Makefile.in| 766 - lib/cobalt/arch/powerpc/include/Makefile.in| 661 - lib/cobalt/arch/powerpc/include/asm/Makefile.in| 661 - .../arch/powerpc/include/asm/xenomai/Makefile.in | 553 - lib/cobalt/arch/sh/Makefile.in | 766 - lib/cobalt/arch/sh/include/Makefile.in | 661 - lib/cobalt/arch/sh/include/asm/Makefile.in | 661 - lib/cobalt/arch/sh/include/asm/xenomai/Makefile.in | 553 - lib/cobalt/arch/x86/Makefile.in| 766 - lib/cobalt/arch/x86/include/Makefile.in| 661 - lib/cobalt/arch/x86/include/asm/Makefile.in| 661 - .../arch/x86/include/asm/xenomai/Makefile.in | 553 - lib/copperplate/Makefile.in| 1134 -- lib/copperplate/regd/Makefile.in | 700 -
[Xenomai-git] Philippe Gerum : smokey/sigdebug: account for uclibc lacking clock_nanosleep()
Module: xenomai-3 Branch: master Commit: 9b37ac319452793fa2362cb5c731845b98d0a170 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=9b37ac319452793fa2362cb5c731845b98d0a170 Author: Philippe Gerum r...@xenomai.org Date: Fri Feb 20 10:06:07 2015 +0100 smokey/sigdebug: account for uclibc lacking clock_nanosleep() --- testsuite/smokey/sigdebug/sigdebug.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/smokey/sigdebug/sigdebug.c b/testsuite/smokey/sigdebug/sigdebug.c index 03f3d33..27c3263 100644 --- a/testsuite/smokey/sigdebug/sigdebug.c +++ b/testsuite/smokey/sigdebug/sigdebug.c @@ -280,7 +280,7 @@ static int run_sigdebug(struct smokey_test *t, int argc, char *const argv[]) err = __real_pthread_kill(rt_thread, SIGUSR1); check_no_error(pthread_kill, err); - __real_clock_nanosleep(CLOCK_MONOTONIC, 0, delay, NULL); + __STD(nanosleep(delay, NULL)); err = pthread_mutex_unlock(prio_invert); check_no_error(pthread_mutex_unlock, err); ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : cobalt/powerpc: upgrade I-pipe support
Module: xenomai-3 Branch: master Commit: feeaab12edd92ebc9580228406064c812e2fa5bd URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=feeaab12edd92ebc9580228406064c812e2fa5bd Author: Philippe Gerum r...@xenomai.org Date: Fri Mar 20 09:26:27 2015 +0100 cobalt/powerpc: upgrade I-pipe support --- ...-7.patch = ipipe-core-3.14.33-powerpc-7.patch} | 35 +--- ...c-2.patch = ipipe-core-3.16.7-powerpc-3.patch} | 91 +--- 2 files changed, 80 insertions(+), 46 deletions(-) diff --git a/kernel/cobalt/arch/powerpc/patches/ipipe-core-3.14.28-powerpc-7.patch b/kernel/cobalt/arch/powerpc/patches/ipipe-core-3.14.33-powerpc-7.patch similarity index 99% rename from kernel/cobalt/arch/powerpc/patches/ipipe-core-3.14.28-powerpc-7.patch rename to kernel/cobalt/arch/powerpc/patches/ipipe-core-3.14.33-powerpc-7.patch index a9d7249..64a21f2 100644 --- a/kernel/cobalt/arch/powerpc/patches/ipipe-core-3.14.28-powerpc-7.patch +++ b/kernel/cobalt/arch/powerpc/patches/ipipe-core-3.14.33-powerpc-7.patch @@ -5468,10 +5468,10 @@ index 9203393..8b03381 100644 static struct uic * __init uic_init_one(struct device_node *node) diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c -index bc5fbc2..41251db 100644 +index f89389f..1db42a0 100644 --- a/arch/powerpc/xmon/xmon.c +++ b/arch/powerpc/xmon/xmon.c -@@ -1452,7 +1452,7 @@ static void excprint(struct pt_regs *fp) +@@ -1453,7 +1453,7 @@ static void excprint(struct pt_regs *fp) } printf( current = 0x%lx\n, current); @@ -5480,7 +5480,7 @@ index bc5fbc2..41251db 100644 printf( paca= 0x%lx\t softe: %d\t irq_happened: 0x%02x\n, local_paca, local_paca-soft_enabled, local_paca-irq_happened); #endif -@@ -2072,8 +2072,10 @@ static void dump_one_paca(int cpu) +@@ -2073,8 +2073,10 @@ static void dump_one_paca(int cpu) DUMP(p, stab_rr, lx); DUMP(p, saved_r1, lx); DUMP(p, trap_save, x); @@ -13857,7 +13857,7 @@ index 452d6f2..7f20d7c 100644 } diff --git a/kernel/irq/internals.h b/kernel/irq/internals.h -index 001fa5b..4dad5c7 100644 +index 8a160e8..8a62f8b 100644 --- a/kernel/irq/internals.h +++ b/kernel/irq/internals.h @@ -53,6 +53,9 @@ enum { @@ -13871,7 +13871,7 @@ index 001fa5b..4dad5c7 100644 #include debug.h diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c -index 8ab8e93..5261b2a 100644 +index 07d4551..dc0af3d 100644 --- a/kernel/irq/irqdesc.c +++ b/kernel/irq/irqdesc.c @@ -91,6 +91,9 @@ static void desc_set_defaults(unsigned int irq, struct irq_desc *desc, int node, @@ -13884,7 +13884,7 @@ index 8ab8e93..5261b2a 100644 } int nr_irqs = NR_IRQS; -@@ -270,11 +273,13 @@ int __init early_irq_init(void) +@@ -286,11 +289,13 @@ int __init early_irq_init(void) return arch_early_irq_init(); } @@ -14724,7 +14724,7 @@ index 0de9d7f..7615cff 100644 } diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c -index 6558b7a..f0ddb74 100644 +index 8c08a6f..a21ec0f 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -148,7 +148,7 @@ static void tick_sched_handle(struct tick_sched *ts, struct pt_regs *regs) @@ -15068,7 +15068,7 @@ index 2aefbee..c3ec43f 100644 } EXPORT_SYMBOL(trace_hardirqs_off_caller); diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug -index a48abea..50cc0312 100644 +index a48abea..0e8ae4a 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -312,6 +312,7 @@ config MAGIC_SYSRQ @@ -15097,6 +15097,15 @@ index a48abea..50cc0312 100644 ---help--- Say Y here if you want to check for overflows of kernel, IRQ and exception stacks (if your archicture uses them). This +@@ -1088,7 +1091,7 @@ menu RCU Debugging + + config PROVE_RCU + bool RCU debugging: prove RCU correctness +- depends on PROVE_LOCKING ++ depends on PROVE_LOCKING !IPIPE + default n + help +This feature enables lockdep extensions that check for correct diff --git a/lib/atomic64.c b/lib/atomic64.c index 08a4f06..15810f4 100644 --- a/lib/atomic64.c @@ -15288,7 +15297,7 @@ index 0862816..aacbf2df 100644 help Transparent Hugepages allows the kernel to use huge pages and diff --git a/mm/memory.c b/mm/memory.c -index 48d7365..e23fa86 100644 +index 7f30bea..100a209 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -788,6 +788,34 @@ out: @@ -15359,7 +15368,7 @@ index 48d7365..e23fa86 100644 ptep_set_wrprotect(src_mm, addr, src_pte); pte = pte_wrprotect(pte); } -@@ -888,13 +931,27 @@ int copy_pte_range(struct mm_struct *dst_mm, struct mm_struct *src_mm, +@@ -888,13 +931,27 @@ static int copy_pte_range(struct mm_struct *dst_mm, struct mm_struct *src_mm, int progress = 0; int rss[NR_MM_COUNTERS]; swp_entry_t entry = (swp_entry_t){0}; @@ -15527,7 +15536,7 @@ index b1eb536..ca23f83 100644 +} +#endif diff --git a/mm/mmap.c b/mm/mmap.c -index b91ac80..47ee8c0 100644 +index
[Xenomai-git] Philippe Gerum : cobalt/posix/event: use resource management API
Module: xenomai-3 Branch: master Commit: 7d9fabb7467a7e54f54b8c272668d6ce93fee392 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=7d9fabb7467a7e54f54b8c272668d6ce93fee392 Author: Philippe Gerum r...@xenomai.org Date: Wed Mar 18 18:15:25 2015 +0100 cobalt/posix/event: use resource management API --- kernel/cobalt/posix/event.c | 77 + kernel/cobalt/posix/event.h | 10 +++--- kernel/cobalt/posix/process.c |2 +- 3 files changed, 31 insertions(+), 58 deletions(-) diff --git a/kernel/cobalt/posix/event.c b/kernel/cobalt/posix/event.c index 475b5cd..6c99ea9 100644 --- a/kernel/cobalt/posix/event.c +++ b/kernel/cobalt/posix/event.c @@ -52,7 +52,6 @@ COBALT_SYSCALL(event_init, current, { struct cobalt_event_shadow shadow; struct cobalt_event_state *state; - struct cobalt_resources *rs; int pshared, synflags, ret; struct cobalt_event *event; struct cobalt_umm *umm; @@ -73,7 +72,7 @@ COBALT_SYSCALL(event_init, current, return -EAGAIN; } - ret = xnregistry_enter_anon(event, event-handle); + ret = xnregistry_enter_anon(event, event-resnode.handle); if (ret) { cobalt_umm_free(umm, state); xnfree(event); @@ -84,22 +83,19 @@ COBALT_SYSCALL(event_init, current, event-flags = flags; synflags = (flags COBALT_EVENT_PRIO) ? XNSYNCH_PRIO : XNSYNCH_FIFO; xnsynch_init(event-synch, synflags, NULL); - rs = cobalt_current_resources(pshared); - event-scope = rs; - - xnlock_get_irqsave(nklock, s); - list_add_tail(event-link, rs-eventq); - xnlock_put_irqrestore(nklock, s); - - event-magic = COBALT_EVENT_MAGIC; - state-value = value; state-flags = 0; state-nwaiters = 0; stateoff = cobalt_umm_offset(umm, state); XENO_BUG_ON(COBALT, stateoff != (__u32)stateoff); + + xnlock_get_irqsave(nklock, s); + cobalt_add_resource(event-resnode, event, pshared); + event-magic = COBALT_EVENT_MAGIC; + xnlock_put_irqrestore(nklock, s); + shadow.flags = flags; - shadow.handle = event-handle; + shadow.handle = event-resnode.handle; shadow.state_offset = (__u32)stateoff; return cobalt_copy_to_user(u_event, shadow, sizeof(*u_event)); @@ -259,31 +255,11 @@ out: return ret; } -static void event_destroy(struct cobalt_event *event, - spl_t s) /* atomic-entry */ -{ - struct cobalt_umm *umm; - int pshared; - - list_del(event-link); - xnsynch_destroy(event-synch); - xnregistry_remove(event-handle); - event-magic = 0; - pshared = (event-flags COBALT_EVENT_SHARED) != 0; - xnlock_put_irqrestore(nklock, s); - - umm = cobalt_ppd_get(pshared)-umm; - cobalt_umm_free(umm, event-state); - xnfree(event); - xnlock_get_irqsave(nklock, s); -} - COBALT_SYSCALL(event_destroy, current, (struct cobalt_event_shadow __user *u_event)) { struct cobalt_event *event; xnhandle_t handle; - int ret = 0; spl_t s; trace_cobalt_event_destroy(u_event); @@ -294,17 +270,13 @@ COBALT_SYSCALL(event_destroy, current, event = xnregistry_lookup(handle, NULL); if (event == NULL || event-magic != COBALT_EVENT_MAGIC) { - ret = -EINVAL; - goto out; + xnlock_put_irqrestore(nklock, s); + return -EINVAL; } - event_destroy(event, s); - - xnsched_run(); -out: - xnlock_put_irqrestore(nklock, s); + cobalt_event_reclaim(event-resnode, s); /* drops lock */ - return ret; + return 0; } COBALT_SYSCALL(event_inquire, current, @@ -393,19 +365,20 @@ COBALT_SYSCALL(event_inquire, current, return ret ?: nrwait; } -void cobalt_event_reclaim(struct cobalt_process *process) +void cobalt_event_reclaim(struct cobalt_resnode *node, spl_t s) { - struct cobalt_resources *p = process-resources; - struct cobalt_event *event, *tmp; - spl_t s; - - xnlock_get_irqsave(nklock, s); - - if (list_empty(p-eventq)) - goto out; + struct cobalt_event *event; + struct cobalt_umm *umm; + int pshared; - list_for_each_entry_safe(event, tmp, p-eventq, link) - event_destroy(event, s); -out: + event = container_of(node, struct cobalt_event, resnode); + xnregistry_remove(node-handle); + cobalt_del_resource(node); + xnsynch_destroy(event-synch); + pshared = (event-flags COBALT_EVENT_SHARED) != 0; xnlock_put_irqrestore(nklock, s); + + umm = cobalt_ppd_get(pshared)-umm; + cobalt_umm_free(umm, event-state); + xnfree(event); } diff --git a/kernel/cobalt/posix/event.h b/kernel/cobalt/posix/event.h index 1461a3e..28d4516 100644 ---
[Xenomai-git] Philippe Gerum : copperplate/heapobj: use per-process heap for anon sessions
Module: xenomai-3 Branch: master Commit: 14343e9e0f7c37708b6221e4fb1c2ac847f2091a URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=14343e9e0f7c37708b6221e4fb1c2ac847f2091a Author: Philippe Gerum r...@xenomai.org Date: Sun Mar 22 19:21:29 2015 +0100 copperplate/heapobj: use per-process heap for anon sessions We have different lifetimes for Cobalt-managed POSIX objects such as mutexes and condvars, and Cobalt maintains dynamically allocated resources for them. Some POSIX objects are embedded into the session header for protecting sysgroups, and serializing allocation ops on the shared heap. Therefore, they must survive until the last process detaches from the anon session. Most other POSIX objects stored into the shared heap become virtually stale when the application exits and should be reclaimed automatically, so that we don't end up leaking kernel resources as processes come and go into the anon session. For the sake of simplicity, Cobalt reclaims shared POSIX objects upon exit of their respective creator, assuming that a multi-process application requires all involved processes to be present at any time, including the one which has initialized the resources. By using separate, per-process heaps for each instance of the anon session, we make sure that all POSIX resources can be reclaimed safely by Cobalt for any given session, upon application exit. --- include/copperplate/heapobj.h |7 +++ include/copperplate/registry.h| 16 +-- lib/copperplate/heapobj-pshared.c | 39 lib/copperplate/init.c| 38 ++-- lib/copperplate/internal.h|3 +- lib/copperplate/regd/regd.c | 65 -- lib/copperplate/registry.c| 42 ++--- scripts/Makefile.am |1 - scripts/xeno-multiuser| 91 - 9 files changed, 139 insertions(+), 163 deletions(-) diff --git a/include/copperplate/heapobj.h b/include/copperplate/heapobj.h index c92e581..b628ea4 100644 --- a/include/copperplate/heapobj.h +++ b/include/copperplate/heapobj.h @@ -310,6 +310,8 @@ int heapobj_bind_session(const char *session); void heapobj_unbind_session(void); +int heapobj_unlink_session(const char *session); + void *xnmalloc(size_t size); void xnfree(void *ptr); @@ -425,6 +427,11 @@ static inline int heapobj_bind_session(const char *session) return -ENOSYS; } +static inline int heapobj_unlink_session(const char *session) +{ + return 0; +} + static inline void heapobj_unbind_session(void) { } static inline void *xnmalloc(size_t size) diff --git a/include/copperplate/registry.h b/include/copperplate/registry.h index 903db4a..8e423dc 100644 --- a/include/copperplate/registry.h +++ b/include/copperplate/registry.h @@ -29,6 +29,9 @@ struct fsobj; +#define REGISTRY_SHARED 1 +#define REGISTRY_ANON2 + #ifdef CONFIG_XENO_REGISTRY struct registry_operations { @@ -76,9 +79,12 @@ void registry_destroy_file(struct fsobj *fsobj); void registry_touch_file(struct fsobj *fsobj); -int __registry_pkg_init(const char *arg0, char *mountpt, int shared_registry); +int __registry_pkg_init(const char *arg0, + char *mountpt, + int flags); -int registry_pkg_init(const char *arg0); +int registry_pkg_init(const char *arg0, + int flags); void registry_pkg_destroy(void); @@ -126,13 +132,15 @@ void registry_touch_file(struct fsobj *fsobj) } static inline -int __registry_pkg_init(const char *arg0, char *mountpt, int shared_registry) +int __registry_pkg_init(const char *arg0, + char *mountpt, int flags) { return 0; } static inline -int registry_pkg_init(const char *arg0) +int registry_pkg_init(const char *arg0, + int flags) { return 0; } diff --git a/lib/copperplate/heapobj-pshared.c b/lib/copperplate/heapobj-pshared.c index 20b5b44..88c0e21 100644 --- a/lib/copperplate/heapobj-pshared.c +++ b/lib/copperplate/heapobj-pshared.c @@ -33,6 +33,7 @@ #include unistd.h #include signal.h #include fcntl.h +#include malloc.h #include unistd.h #include boilerplate/list.h #include boilerplate/hash.h @@ -622,7 +623,7 @@ static int create_main_heap(pid_t *cnode_r) * Otherwise, create the heap for the new emerging session and * bind to it. */ - snprintf(hobj-name, sizeof(hobj-name), %s.main-heap, session); + snprintf(hobj-name, sizeof(hobj-name), %s.heap, session); snprintf(hobj-fsname, sizeof(hobj-fsname), /xeno:%s, hobj-name); fd = shm_open(hobj-fsname, O_RDWR|O_CREAT, 0600); @@ -708,13 +709,13 @@ static int bind_main_heap(const char *session) { struct heapobj *hobj = main_pool; struct session_heap *m_heap; + int ret, fd, cpid; struct stat sbuf; memoff_t len; - int ret, fd; /* No error tracking, this is
[Xenomai-git] Philippe Gerum : boilerplate/hash: no dependency on address space in shared h-table
Module: xenomai-3 Branch: master Commit: 1fe66f3a2bc0b74767d7b13110b6426c31018c06 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=1fe66f3a2bc0b74767d7b13110b6426c31018c06 Author: Philippe Gerum r...@xenomai.org Date: Fri Mar 6 17:47:16 2015 +0100 boilerplate/hash: no dependency on address space in shared h-table --- include/boilerplate/hash.h| 122 +++--- lib/boilerplate/hash.c| 169 - lib/copperplate/cluster.c | 49 --- lib/copperplate/heapobj-pshared.c |2 +- lib/copperplate/registry.c| 44 ++ 5 files changed, 252 insertions(+), 134 deletions(-) diff --git a/include/boilerplate/hash.h b/include/boilerplate/hash.h index fca9c49..081aefe 100644 --- a/include/boilerplate/hash.h +++ b/include/boilerplate/hash.h @@ -25,7 +25,10 @@ #define HASHSLOTS (18) struct hashobj { - const void *key; + dref_type(const void *) key; +#ifdef CONFIG_XENO_PSHARED + char static_key[16]; +#endif size_t len; struct holder link; }; @@ -36,13 +39,27 @@ struct hash_bucket { struct hash_table { struct hash_bucket table[HASHSLOTS]; - int (*compare)(const struct hashobj *l, - const struct hashobj *r); pthread_mutex_t lock; }; +struct hash_operations { + int (*compare)(const void *l, + const void *r, + size_t len); +#ifdef CONFIG_XENO_PSHARED + int (*probe)(struct hashobj *oldobj); + void *(*alloc)(size_t len); + void (*free)(void *key); +#endif +}; + +typedef int (*hash_walk_op)(struct hash_table *t, + struct hashobj *obj); + #ifdef CONFIG_XENO_PSHARED -/* Private version - not shareable between processes. */ + +/* Private version - h-table is not shareable between processes. */ + struct pvhashobj { const void *key; size_t len; @@ -55,14 +72,23 @@ struct pvhash_bucket { struct pvhash_table { struct pvhash_bucket table[HASHSLOTS]; - int (*compare)(const struct pvhashobj *l, - const struct pvhashobj *r); pthread_mutex_t lock; }; + +struct pvhash_operations { + int (*compare)(const void *l, + const void *r, + size_t len); +}; + +typedef int (*pvhash_walk_op)(struct pvhash_table *t, + struct pvhashobj *obj); + #else /* !CONFIG_XENO_PSHARED */ -#define pvhashobj hashobj -#define pvhash_bucket hash_bucket -#define pvhash_table hash_table +#define pvhashobj hashobj +#define pvhash_bucket hash_bucket +#define pvhash_table hash_table +#define pvhash_walk_op hash_walk_op #endif /* !CONFIG_XENO_PSHARED */ #ifdef __cplusplus @@ -72,112 +98,112 @@ extern C { unsigned int __hash_key(const void *key, size_t length, unsigned int c); -void __hash_init(void *heap, struct hash_table *t, -int (*compare)(const struct hashobj *l, - const struct hashobj *r)); +void __hash_init(void *heap, struct hash_table *t); int __hash_enter(struct hash_table *t, const void *key, size_t len, -struct hashobj *newobj, int nodup); +struct hashobj *newobj, +const struct hash_operations *hops, +int nodup); -static inline void hash_init(struct hash_table *t, -int (*compare)(const struct hashobj *l, - const struct hashobj *r)) +static inline void hash_init(struct hash_table *t) { - __hash_init(__main_heap, t, compare); + __hash_init(__main_heap, t); } void hash_destroy(struct hash_table *t); static inline int hash_enter(struct hash_table *t, const void *key, size_t len, -struct hashobj *newobj) +struct hashobj *newobj, +const struct hash_operations *hops) { - return __hash_enter(t, key, len, newobj, 1); + return __hash_enter(t, key, len, newobj, hops, 1); } static inline int hash_enter_dup(struct hash_table *t, const void *key, size_t len, -struct hashobj *newobj) +struct hashobj *newobj, +const struct hash_operations *hops) { - return __hash_enter(t, key, len, newobj, 0); + return __hash_enter(t, key, len, newobj, hops, 0); } -int hash_remove(struct hash_table *t, struct hashobj *delobj); +int hash_remove(struct hash_table *t, struct hashobj *delobj, + const struct hash_operations *hops); struct hashobj *hash_search(struct hash_table *t, - const void *key, size_t len); + const
[Xenomai-git] Philippe Gerum : build: drop autoconf-generated files
Module: xenomai-3 Branch: next Commit: e179b093f80e019cc30eaa61147638162578b405 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=e179b093f80e019cc30eaa61147638162578b405 Author: Philippe Gerum r...@xenomai.org Date: Mon Mar 23 16:58:14 2015 +0100 build: drop autoconf-generated files --- Makefile.in| 914 -- aclocal.m4 | 2262 --- config/Makefile.in | 491 - config/libtool.m4 | 7992 - config/ltmain.sh | 9655 --- config/ltoptions.m4| 384 - config/ltsugar.m4 | 123 - config/ltversion.m4| 23 - config/lt~obsolete.m4 | 98 - configure |17075 demo/Makefile.in | 661 - demo/alchemy/Makefile.in | 836 - demo/alchemy/cobalt/Makefile.in| 709 - demo/posix/Makefile.in | 826 - demo/posix/cobalt/Makefile.in | 891 - doc/Makefile.in| 674 - doc/asciidoc/Makefile.in | 699 - doc/doxygen/Makefile.in| 634 - doc/gitdoc/Makefile.in | 521 - include/Makefile.in| 776 - include/alchemy/Makefile.in| 616 - include/boilerplate/Makefile.in| 617 - include/cobalt/Makefile.in | 742 - include/cobalt/boilerplate/Makefile.in | 609 - include/cobalt/kernel/Makefile.in | 701 - include/cobalt/kernel/rtdm/Makefile.in | 677 - include/cobalt/kernel/rtdm/analogy/Makefile.in | 560 - include/cobalt/sys/Makefile.in | 611 - include/cobalt/uapi/Makefile.in| 731 - include/cobalt/uapi/asm-generic/Makefile.in| 553 - include/cobalt/uapi/kernel/Makefile.in | 613 - include/copperplate/Makefile.in| 621 - include/mercury/Makefile.in| 665 - include/mercury/boilerplate/Makefile.in| 609 - include/psos/Makefile.in | 603 - include/rtdm/Makefile.in | 727 - include/rtdm/uapi/Makefile.in | 612 - include/smokey/Makefile.in | 603 - include/trank/Makefile.in | 721 - include/trank/native/Makefile.in | 617 - include/trank/posix/Makefile.in| 603 - include/trank/rtdm/Makefile.in | 609 - include/vxworks/Makefile.in| 618 - include/xeno_config.h.in | 235 - lib/Makefile.in| 677 - lib/alchemy/Makefile.in| 824 - lib/analogy/Makefile.in| 779 - lib/boilerplate/Makefile.in| 810 - lib/cobalt/Makefile.in | 1045 -- lib/cobalt/arch/Makefile.in| 661 - lib/cobalt/arch/arm/Makefile.in| 766 - lib/cobalt/arch/arm/include/Makefile.in| 661 - lib/cobalt/arch/arm/include/asm/Makefile.in| 661 - .../arch/arm/include/asm/xenomai/Makefile.in | 553 - lib/cobalt/arch/blackfin/Makefile.in | 766 - lib/cobalt/arch/blackfin/include/Makefile.in | 661 - lib/cobalt/arch/blackfin/include/asm/Makefile.in | 661 - .../arch/blackfin/include/asm/xenomai/Makefile.in | 553 - lib/cobalt/arch/nios2/Makefile.in | 766 - lib/cobalt/arch/nios2/include/Makefile.in | 661 - lib/cobalt/arch/nios2/include/asm/Makefile.in | 661 - .../arch/nios2/include/asm/xenomai/Makefile.in | 553 - lib/cobalt/arch/powerpc/Makefile.in| 766 - lib/cobalt/arch/powerpc/include/Makefile.in| 661 - lib/cobalt/arch/powerpc/include/asm/Makefile.in| 661 - .../arch/powerpc/include/asm/xenomai/Makefile.in | 553 - lib/cobalt/arch/sh/Makefile.in | 766 - lib/cobalt/arch/sh/include/Makefile.in | 661 - lib/cobalt/arch/sh/include/asm/Makefile.in | 661 - lib/cobalt/arch/sh/include/asm/xenomai/Makefile.in | 553 - lib/cobalt/arch/x86/Makefile.in| 766 - lib/cobalt/arch/x86/include/Makefile.in| 661 - lib/cobalt/arch/x86/include/asm/Makefile.in| 661 - .../arch/x86/include/asm/xenomai/Makefile.in | 553 - lib/copperplate/Makefile.in| 1134 -- lib/copperplate/regd/Makefile.in | 700 -
[Xenomai-git] Philippe Gerum : copperplate/registry: move anon sessions under the user tree
Module: xenomai-3 Branch: next Commit: ff1e3666c8079b67d9676f0caf14d8563e44de55 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=ff1e3666c8079b67d9676f0caf14d8563e44de55 Author: Philippe Gerum r...@xenomai.org Date: Tue Mar 24 10:08:05 2015 +0100 copperplate/registry: move anon sessions under the user tree --- lib/copperplate/init.c | 24 ++-- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/lib/copperplate/init.c b/lib/copperplate/init.c index b5b7a36..f6e06d3 100644 --- a/lib/copperplate/init.c +++ b/lib/copperplate/init.c @@ -513,28 +513,24 @@ static int get_session_root(int *regflags_r) struct passwd *pw; int ret; + pw = getpwuid(geteuid()); + if (pw == NULL) + return -errno; + if (__node_info.session_label == NULL) { ret = asprintf(session, anon@%d, __node_id); if (ret 0) return -ENOMEM; __node_info.session_label = session; - ret = asprintf(sessdir, %s/%s, - __node_info.registry_root, session); - if (ret 0) - return -ENOMEM; *regflags_r |= REGISTRY_ANON; - } else { - pw = getpwuid(geteuid()); - if (pw == NULL) - return -errno; - - ret = asprintf(sessdir, %s/%s/%s, - __node_info.registry_root, - pw-pw_name, __node_info.session_label); - if (ret 0) - return -ENOMEM; } + ret = asprintf(sessdir, %s/%s/%s, + __node_info.registry_root, + pw-pw_name, __node_info.session_label); + if (ret 0) + return -ENOMEM; + __node_info.session_root = sessdir; return 0; ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : copperplate/init: allow pure copperplate-based applications
Module: xenomai-3 Branch: master Commit: 6553ee7a32075cc210f6eef45a26bfc51a0efa26 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=6553ee7a32075cc210f6eef45a26bfc51a0efa26 Author: Philippe Gerum r...@xenomai.org Date: Fri Mar 13 15:29:23 2015 +0100 copperplate/init: allow pure copperplate-based applications We may want to run applications solely based on the copperplate API, without any requirement to bind to a skin. --- lib/copperplate/init.c | 78 ++-- 1 file changed, 42 insertions(+), 36 deletions(-) diff --git a/lib/copperplate/init.c b/lib/copperplate/init.c index 50ca596..6a962e4 100644 --- a/lib/copperplate/init.c +++ b/lib/copperplate/init.c @@ -179,7 +179,7 @@ static void usage(void) print_version(); fprintf(stderr, usage: program options, where options may be:\n); - fprintf(stderr, --mem-pool-size=sizeK size of the main heap (kbytes)\n); + fprintf(stderr, --mem-pool-size=sizeK size of the main heap (kbytes)\n); fprintf(stderr, --no-mlock do not lock memory at init (Mercury only)\n); fprintf(stderr, --registry-root=path root path of registry\n); fprintf(stderr, --no-registrysuppress object registration\n); @@ -190,7 +190,10 @@ static void usage(void) fprintf(stderr, --silent tame down verbosity\n); fprintf(stderr, --versionget version information\n); fprintf(stderr, --dump-configdump configuration settings\n); - + + if (pvlist_empty(skins)) + return; + pvlist_for_each_entry(skin, skins, __reserved.next) { if (skin-help) skin-help(); @@ -301,28 +304,35 @@ static struct option *build_option_array(int *base_opt_startp) int nopts; nopts = sizeof(base_options) / sizeof(base_options[0]); - pvlist_for_each_entry(skin, skins, __reserved.next) { - p = skin-options; - if (p) { - while (p-name) { - nopts++; - p++; + + if (!pvlist_empty(skins)) { + pvlist_for_each_entry(skin, skins, __reserved.next) { + p = skin-options; + if (p) { + while (p-name) { + nopts++; + p++; + } } } } + options = malloc(sizeof(*options) * nopts); if (options == NULL) return NULL; q = options; - pvlist_for_each_entry(skin, skins, __reserved.next) { - p = skin-options; - if (p) { - skin-__reserved.opt_start = q - options; - while (p-name) - memcpy(q++, p++, sizeof(*q)); + + if (!pvlist_empty(skins)) { + pvlist_for_each_entry(skin, skins, __reserved.next) { + p = skin-options; + if (p) { + skin-__reserved.opt_start = q - options; + while (p-name) + memcpy(q++, p++, sizeof(*q)); + } + skin-__reserved.opt_end = q - options; } - skin-__reserved.opt_end = q - options; } *base_opt_startp = q - options; @@ -534,12 +544,6 @@ void copperplate_init(int *argcp, char *const **argvp) /* No ifs, no buts: we must be called over the main thread. */ assert(getpid() == __node_id); - if (pvlist_empty(skins)) { - warning(no skin detected in program); - ret = -EINVAL; - goto fail; - } - /* Define default CPU affinity, i.e. no particular affinity. */ CPU_ZERO(__node_info.cpu_affinity); @@ -623,27 +627,29 @@ void copperplate_init(int *argcp, char *const **argvp) * skin handlers for parsing their own options, which in turn * may create system objects on the fly. */ - ret = parse_skin_options(argcp, largc, uargv, options); - if (ret) - goto fail; - - free(options); + if (!pvlist_empty(skins)) { + ret = parse_skin_options(argcp, largc, uargv, options); + if (ret) + goto fail; - CANCEL_DEFER(svc); + CANCEL_DEFER(svc); - pvlist_for_each_entry(skin, skins, __reserved.next) { - ret = skin-init(); - if (ret) - break; - } + pvlist_for_each_entry(skin, skins, __reserved.next) { + ret = skin-init(); +
[Xenomai-git] Philippe Gerum : doc/asciidoc: update guides
Module: xenomai-3 Branch: master Commit: f86c6d67d8caeb5cb158113d87fbc5a52654b4c0 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=f86c6d67d8caeb5cb158113d87fbc5a52654b4c0 Author: Philippe Gerum r...@xenomai.org Date: Tue Mar 24 11:23:09 2015 +0100 doc/asciidoc: update guides --- doc/asciidoc/README.INSTALL.adoc | 20 +++- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/doc/asciidoc/README.INSTALL.adoc b/doc/asciidoc/README.INSTALL.adoc index efec3aa..8206a83 100644 --- a/doc/asciidoc/README.INSTALL.adoc +++ b/doc/asciidoc/README.INSTALL.adoc @@ -350,8 +350,11 @@ although this is not mandatory if building with `--disable-tls`. the target kernel running the real-time applications. In addition, the FUSE development libraries must be available from the toolchain. -- The autoconf (= 2.62), automake and libtool packages must be - available on your build system. +- If you plan to build from the sources available from the Xenomai GIT + tree (git.xenomai.org), the autoconf (= 2.62), automake and libtool + packages must be available on your build system. This is not + required when building from a source tree extracted from a + http://download.gna.org/xenomai/[release tarball]. _Cobalt_-specific requirements ^^ @@ -377,14 +380,21 @@ _Mercury_-specific requirement Configuring ~~~ -First, the `configure` script and Makefiles must be generated in the -Xenomai source tree. The recommended way is to run the automatic -reconfiguration script shipped, from the top of the source tree: +If building the source obtained from the Xenomai GIT tree +(git.xenomai.org), the `configure` script and Makefiles must be +generated in the Xenomai source tree. The recommended way is to run +the automatic reconfiguration script shipped, from the top of the +source tree: - $ ./scripts/bootstrap - +If building from a http://download.gna.org/xenomai[release tarball], a +set of autoconf-generated file will be readily available from the +extracted source tree, and therefore reconfiguring will not be +required. + When run, the generated `configure` script prepares for building the libraries and programs, for both the _Cobalt_ and _Mercury_ cores. The core-specific code which may be needed internally is automatically and ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : cobalt/kernel: add back sysfs exposure to parameters
Module: xenomai-3 Branch: master Commit: 669d592a3131554cbebb77936dd506da9dbf480d URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=669d592a3131554cbebb77936dd506da9dbf480d Author: Philippe Gerum r...@xenomai.org Date: Thu Feb 19 12:42:58 2015 +0100 cobalt/kernel: add back sysfs exposure to parameters --- kernel/cobalt/arch/x86/smi.c | 66 ++ kernel/cobalt/init.c | 16 +- 2 files changed, 43 insertions(+), 39 deletions(-) diff --git a/kernel/cobalt/arch/x86/smi.c b/kernel/cobalt/arch/x86/smi.c index 5573e7b..6caedef 100644 --- a/kernel/cobalt/arch/x86/smi.c +++ b/kernel/cobalt/arch/x86/smi.c @@ -39,6 +39,8 @@ #define SMI_CTRL_ADDR 0x30 static int smi_state; +static char smi_state_arg[16] = detect; +module_param_string(smi, smi_state_arg, sizeof(smi_state_arg), 0444); static unsigned int smi_masked_bits = 1; /* Global disable bit */ module_param_named(smi_mask, smi_masked_bits, int, 0400); @@ -102,10 +104,42 @@ static unsigned short get_smi_en_addr(struct pci_dev *dev) return SMI_CTRL_ADDR + (((byte1 1) | (byte0 7)) 7);// bits 7-15 } + +static const char *smi_state_labels[] = { + disabled, + detect, + enabled, +}; + +static void setup_smi_state(void) +{ + static char warn_bad_state[] = + XENO_WARNING invalid SMI state '%s'\n; + char *p; + int n; + + /* Backward compat with legacy state specifiers. */ + n = simple_strtol(smi_state_arg, p, 10); + if (*p == '\0') { + smi_state = n; + return; + } + + for (n = 0; n ARRAY_SIZE(smi_state_labels); n++) + if (strcmp(smi_state_labels[n], smi_state_arg) == 0) { + smi_state = n - 1; + return; + } + + printk(warn_bad_state, smi_state_arg); +} + void mach_x86_smi_init(void) { struct pci_dev *dev = NULL; + setup_smi_state(); + if (smi_state 0) return; @@ -133,35 +167,3 @@ void mach_x86_smi_init(void) pci_dev_put(dev); } - -static const char *smi_state_labels[] = { - disabled, - detect, - enabled, -}; - -static int setup_smi_state(char *s) -{ - static char warn_bad_state[] = - XENO_WARNING invalid SMI state '%s'\n; - char *p; - int n; - - /* Backward compat with legacy state specifiers. */ - n = simple_strtol(s, p, 10); - if (*p == '\0') { - smi_state = n; - return 1; - } - - for (n = 0; n ARRAY_SIZE(smi_state_labels); n++) - if (strcmp(smi_state_labels[n], s) == 0) { - smi_state = n - 1; - return 1; - } - - printk(warn_bad_state, s); - - return 0; -} -__setup(xenomai.smi=, setup_smi_state); diff --git a/kernel/cobalt/init.c b/kernel/cobalt/init.c index bfa63a2..25d49b6 100644 --- a/kernel/cobalt/init.c +++ b/kernel/cobalt/init.c @@ -61,6 +61,9 @@ module_param_named(supported_cpus, supported_cpus_arg, ulong, 0444); static unsigned long sysheap_size_arg; module_param_named(sysheap_size, sysheap_size_arg, ulong, 0444); +static char init_state_arg[16] = enabled; +module_param_string(state, init_state_arg, sizeof(init_state_arg), 0444); + static BLOCKING_NOTIFIER_HEAD(state_notifier_list); struct cobalt_pipeline cobalt_pipeline; @@ -255,23 +258,20 @@ static struct { { enabled, COBALT_STATE_WARMUP }, }; -static int __init setup_init_state(char *s) +static void __init setup_init_state(void) { static char warn_bad_state[] __initdata = XENO_WARNING invalid init state '%s'\n; int n; for (n = 0; n ARRAY_SIZE(init_states); n++) - if (strcmp(init_states[n].label, s) == 0) { + if (strcmp(init_states[n].label, init_state_arg) == 0) { set_realtime_core_state(init_states[n].state); - return 1; + return; } - printk(warn_bad_state, s); - - return 0; + printk(warn_bad_state, init_state_arg); } -__setup(xenomai.state=, setup_init_state); static __init int sys_init(void) { @@ -323,6 +323,8 @@ static int __init xenomai_init(void) { int ret, __maybe_unused cpu; + setup_init_state(); + if (!realtime_core_enabled()) { printk(XENO_WARNING disabled on kernel command line\n); return 0; ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : cobalt/intr: catch invalid status from IRQ handlers
Module: xenomai-3 Branch: master Commit: 590aa2a1513414ba729d3c203b3c9100a14b5408 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=590aa2a1513414ba729d3c203b3c9100a14b5408 Author: Philippe Gerum r...@xenomai.org Date: Wed Feb 25 10:48:04 2015 +0100 cobalt/intr: catch invalid status from IRQ handlers --- kernel/cobalt/intr.c |3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/cobalt/intr.c b/kernel/cobalt/intr.c index a9c1024..19fcc2c 100644 --- a/kernel/cobalt/intr.c +++ b/kernel/cobalt/intr.c @@ -326,6 +326,7 @@ static void xnintr_vec_handler(unsigned int irq, void *cookie) * while running the interrupt service routine. */ ret = intr-isr(intr); + XENO_WARN_ON_ONCE(USER, (ret XN_IRQ_STATMASK) == 0); s |= ret; if (ret XN_IRQ_HANDLED) { inc_irqstats(intr, sched, start); @@ -398,6 +399,7 @@ static void xnintr_edge_vec_handler(unsigned int irq, void *cookie) * while running the interrupt service routine. */ ret = intr-isr(intr); + XENO_WARN_ON_ONCE(USER, (ret XN_IRQ_STATMASK) == 0); s |= ret; if (ret XN_IRQ_HANDLED) { @@ -609,6 +611,7 @@ static void xnintr_irq_handler(unsigned int irq, void *cookie) } s = intr-isr(intr); + XENO_WARN_ON_ONCE(USER, (s XN_IRQ_STATMASK) == 0); if (unlikely(s XN_IRQ_NONE)) { if (++intr-unhandled == XNINTR_MAX_UNHANDLED) { printk(XENO_ERR %s: IRQ%d not handled. Disabling IRQ line\n, ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : cobalt/kernel: unify naming of extern data - cobalt_nrthreads
Module: xenomai-3 Branch: master Commit: 7f9a31af78677bef3257e69c21ebbea3f9176b8d URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=7f9a31af78677bef3257e69c21ebbea3f9176b8d Author: Philippe Gerum r...@xenomai.org Date: Tue Feb 17 11:40:45 2015 +0100 cobalt/kernel: unify naming of extern data - cobalt_nrthreads --- include/cobalt/kernel/sched.h |2 +- kernel/cobalt/sched.c |8 kernel/cobalt/thread.c| 14 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/cobalt/kernel/sched.h b/include/cobalt/kernel/sched.h index 286db0f..04bd6ea 100644 --- a/include/cobalt/kernel/sched.h +++ b/include/cobalt/kernel/sched.h @@ -121,7 +121,7 @@ extern cpumask_t nkaffinity; extern struct list_head nkthreadq; -extern int nknrthreads; +extern int cobalt_nrthreads; #ifdef CONFIG_XENO_OPT_VFILE extern struct xnvfile_rev_tag nkthreadlist_tag; diff --git a/kernel/cobalt/sched.c b/kernel/cobalt/sched.c index bffb22a..ecdd3ca 100644 --- a/kernel/cobalt/sched.c +++ b/kernel/cobalt/sched.c @@ -43,7 +43,7 @@ EXPORT_SYMBOL_GPL(nkaffinity); LIST_HEAD(nkthreadq); -int nknrthreads; +int cobalt_nrthreads; #ifdef CONFIG_XENO_OPT_VFILE struct xnvfile_rev_tag nkthreadlist_tag; @@ -209,7 +209,7 @@ void xnsched_init(struct xnsched *sched, int cpu) xnthread_init_root_tcb(sched-rootcb); list_add_tail(sched-rootcb.glink, nkthreadq); - nknrthreads++; + cobalt_nrthreads++; #ifdef CONFIG_XENO_OPT_WATCHDOG xntimer_init(sched-wdtimer, nkclock, watchdog_handler, @@ -943,7 +943,7 @@ static int vfile_schedlist_rewind(struct xnvfile_snapshot_iterator *it) priv-curr = list_first_entry(nkthreadq, struct xnthread, glink); priv-start_time = xnclock_read_monotonic(nkclock); - return nknrthreads; + return cobalt_nrthreads; } static int vfile_schedlist_next(struct xnvfile_snapshot_iterator *it, @@ -1103,7 +1103,7 @@ static int vfile_schedstat_rewind(struct xnvfile_snapshot_iterator *it) priv-irq = 0; irqnr = xnintr_query_init(priv-intr_it) * NR_CPUS; - return irqnr + nknrthreads; + return irqnr + cobalt_nrthreads; } static int vfile_schedstat_next(struct xnvfile_snapshot_iterator *it, diff --git a/kernel/cobalt/thread.c b/kernel/cobalt/thread.c index 91af8ad..4018d7c 100644 --- a/kernel/cobalt/thread.c +++ b/kernel/cobalt/thread.c @@ -436,7 +436,7 @@ static inline void cleanup_tcb(struct xnthread *thread) /* nklock held, irqs off struct xnsched *sched = thread-sched; list_del(thread-glink); - nknrthreads--; + cobalt_nrthreads--; xnvfile_touch_tag(nkthreadlist_tag); if (xnthread_test_state(thread, XNREADY)) { @@ -507,7 +507,7 @@ void __xnthread_discard(struct xnthread *thread) xnlock_get_irqsave(nklock, s); list_del(thread-glink); - nknrthreads--; + cobalt_nrthreads--; xnvfile_touch_tag(nkthreadlist_tag); xnthread_deregister(thread); xnlock_put_irqrestore(nklock, s); @@ -608,7 +608,7 @@ int xnthread_init(struct xnthread *thread, xnlock_get_irqsave(nklock, s); list_add_tail(thread-glink, nkthreadq); - nknrthreads++; + cobalt_nrthreads++; xnvfile_touch_tag(nkthreadlist_tag); xnlock_put_irqrestore(nklock, s); @@ -2472,7 +2472,7 @@ int xnthread_killall(int grace, int mask) */ xnlock_get_irqsave(nklock, s); - nrthreads = nknrthreads; + nrthreads = cobalt_nrthreads; xnsched_for_each_thread(t) { if (xnthread_test_state(t, XNROOT) || @@ -2502,17 +2502,17 @@ int xnthread_killall(int grace, int mask) if (grace 0) { ret = wait_event_interruptible_timeout(nkjoinq, - nknrthreads == count, + cobalt_nrthreads == count, grace * HZ); if (ret == 0) return -EAGAIN; } else ret = wait_event_interruptible(nkjoinq, - nknrthreads == count); + cobalt_nrthreads == count); if (XENO_DEBUG(COBALT)) printk(XENO_INFO joined %d threads\n, - count + nrkilled - nknrthreads); + count + nrkilled - cobalt_nrthreads); return ret 0 ? EINTR : 0; } ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : build: make $prefix value available to configure script
Module: xenomai-3 Branch: master Commit: dc1f7755d5156432e146f41c2c1d17a81b56dd97 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=dc1f7755d5156432e146f41c2c1d17a81b56dd97 Author: Philippe Gerum r...@xenomai.org Date: Tue Mar 3 20:52:57 2015 +0100 build: make $prefix value available to configure script --- configure| 73 +++--- configure.ac | 15 2 files changed, 49 insertions(+), 39 deletions(-) diff --git a/configure b/configure index 4722de5..00c0535 100755 --- a/configure +++ b/configure @@ -2363,6 +2363,45 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu +ac_config_headers=$ac_config_headers include/xeno_config.h + +ac_aux_dir= +for ac_dir in config $srcdir/config; do + if test -f $ac_dir/install-sh; then +ac_aux_dir=$ac_dir +ac_install_sh=$ac_aux_dir/install-sh -c +break + elif test -f $ac_dir/install.sh; then +ac_aux_dir=$ac_dir +ac_install_sh=$ac_aux_dir/install.sh -c +break + elif test -f $ac_dir/shtool; then +ac_aux_dir=$ac_dir +ac_install_sh=$ac_aux_dir/shtool install -c +break + fi +done +if test -z $ac_aux_dir; then + as_fn_error $? cannot find install-sh, install.sh, or shtool in config \$srcdir\/config $LINENO 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess=$SHELL $ac_aux_dir/config.guess # Please don't use this var. +ac_config_sub=$SHELL $ac_aux_dir/config.sub # Please don't use this var. +ac_configure=$SHELL $ac_aux_dir/configure # Please don't use this var. + + + + + +# We want $prefix to be set for the configure script +if test x$prefix = xNONE; then + prefix=$ac_default_prefix +fi + version_code=`cat $srcdir/config/version-code` CONFIG_XENO_VERSION_MAJOR=`expr $version_code : '\([0-9]*\)'` CONFIG_XENO_VERSION_MINOR=`expr $version_code : '[0-9]*\.\([0-9]*\)'` @@ -2429,40 +2468,6 @@ if eval test $includedir = /usr/include; then as_fn_error $? Using /usr/include as includedir is not supported. Please change your --prefix or specify another --includedir $LINENO 5 fi -ac_config_headers=$ac_config_headers include/xeno_config.h - -ac_aux_dir= -for ac_dir in config $srcdir/config; do - if test -f $ac_dir/install-sh; then -ac_aux_dir=$ac_dir -ac_install_sh=$ac_aux_dir/install-sh -c -break - elif test -f $ac_dir/install.sh; then -ac_aux_dir=$ac_dir -ac_install_sh=$ac_aux_dir/install.sh -c -break - elif test -f $ac_dir/shtool; then -ac_aux_dir=$ac_dir -ac_install_sh=$ac_aux_dir/shtool install -c -break - fi -done -if test -z $ac_aux_dir; then - as_fn_error $? cannot find install-sh, install.sh, or shtool in config \$srcdir\/config $LINENO 5 -fi - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess=$SHELL $ac_aux_dir/config.guess # Please don't use this var. -ac_config_sub=$SHELL $ac_aux_dir/config.sub # Please don't use this var. -ac_configure=$SHELL $ac_aux_dir/configure # Please don't use this var. - - - - - # Make sure we can run config.sub. $SHELL $ac_aux_dir/config.sub sun4 /dev/null 21 || as_fn_error $? cannot run $SHELL $ac_aux_dir/config.sub $LINENO 5 diff --git a/configure.ac b/configure.ac index af2e73d..e04894f 100644 --- a/configure.ac +++ b/configure.ac @@ -9,6 +9,16 @@ AC_PREREQ(2.62) # defined for each architecture in the asm/features.h file. AC_INIT([Xenomai],m4_normalize(m4_include([config/version-label])),xeno...@xenomai.org) +AC_CONFIG_HEADERS(include/xeno_config.h) +AC_CONFIG_AUX_DIR(config) +AC_CONFIG_MACRO_DIR([config]) +AC_CONFIG_SRCDIR(lib/cobalt/thread.c) +AC_PREFIX_DEFAULT(/usr/xenomai) +# We want $prefix to be set for the configure script +if test x$prefix = xNONE; then + prefix=$ac_default_prefix +fi + version_code=`cat $srcdir/config/version-code` CONFIG_XENO_VERSION_MAJOR=`expr $version_code : '\([[0-9]]*\)'` CONFIG_XENO_VERSION_MINOR=`expr $version_code : '[[0-9]]*\.\([[0-9]]*\)'` @@ -54,11 +64,6 @@ if eval test $includedir = /usr/include; then AC_MSG_ERROR([Using /usr/include as includedir is not supported. Please change your --prefix or specify another --includedir]) fi -AC_CONFIG_HEADERS(include/xeno_config.h) -AC_CONFIG_AUX_DIR(config) -AC_CONFIG_MACRO_DIR([config]) -AC_CONFIG_SRCDIR(lib/cobalt/thread.c) -AC_PREFIX_DEFAULT(/usr/xenomai) AC_CANONICAL_BUILD AC_CANONICAL_HOST AC_PROG_INSTALL ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : cobalt/kernel: unify naming of extern data - cobalt_pipeline
Module: xenomai-3 Branch: master Commit: afa7dac3246825c9dd33d1b62cb9e8e139f975a8 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=afa7dac3246825c9dd33d1b62cb9e8e139f975a8 Author: Philippe Gerum r...@xenomai.org Date: Tue Feb 17 11:19:38 2015 +0100 cobalt/kernel: unify naming of extern data - cobalt_pipeline --- include/cobalt/kernel/apc.h|2 +- include/cobalt/kernel/sched.h |4 +-- kernel/cobalt/apc.c| 18 ++-- kernel/cobalt/arch/arm/thread.c|2 +- kernel/cobalt/arch/blackfin/thread.c |2 +- kernel/cobalt/arch/nios2/thread.c |2 +- kernel/cobalt/arch/powerpc/thread.c|2 +- kernel/cobalt/arch/sh/thread.c |2 +- kernel/cobalt/arch/x86/machine.c |2 +- kernel/cobalt/arch/x86/thread.c|2 +- .../cobalt/include/asm-generic/xenomai/machine.h |4 +-- kernel/cobalt/init.c | 30 ++-- kernel/cobalt/posix/syscall.c |2 +- kernel/cobalt/procfs.c |6 ++-- 14 files changed, 40 insertions(+), 40 deletions(-) diff --git a/include/cobalt/kernel/apc.h b/include/cobalt/kernel/apc.h index 3cde7f3..b5d7962 100644 --- a/include/cobalt/kernel/apc.h +++ b/include/cobalt/kernel/apc.h @@ -38,7 +38,7 @@ static inline void __xnapc_schedule(int apc) unsigned long *p = __this_cpu_ptr(xnarch_percpu_machdata)-apc_pending; if (!__test_and_set_bit(apc, p)) - ipipe_post_irq_root(xnarch_machdata.apc_virq); + ipipe_post_irq_root(cobalt_pipeline.apc_virq); } /** diff --git a/include/cobalt/kernel/sched.h b/include/cobalt/kernel/sched.h index 43c5e72..286db0f 100644 --- a/include/cobalt/kernel/sched.h +++ b/include/cobalt/kernel/sched.h @@ -210,7 +210,7 @@ static inline void xnsched_set_self_resched(struct xnsched *sched) sched-status |= XNRESCHED; } -#define xnsched_realtime_domain xnarch_machdata.domain +#define xnsched_realtime_domain cobalt_pipeline.domain /* Set resched flag for the given scheduler. */ #ifdef CONFIG_SMP @@ -228,7 +228,7 @@ static inline void xnsched_set_resched(struct xnsched *sched) } } -#define xnsched_realtime_cpusxnarch_machdata.supported_cpus +#define xnsched_realtime_cpuscobalt_pipeline.supported_cpus static inline int xnsched_supported_cpu(int cpu) { diff --git a/kernel/cobalt/apc.c b/kernel/cobalt/apc.c index a3714da..c2589eb 100644 --- a/kernel/cobalt/apc.c +++ b/kernel/cobalt/apc.c @@ -62,8 +62,8 @@ void apc_dispatch(unsigned int virq, void *arg) while (*p) { apc = ffnz(*p); clear_bit(apc, p); - handler = xnarch_machdata.apc_table[apc].handler; - cookie = xnarch_machdata.apc_table[apc].cookie; + handler = cobalt_pipeline.apc_table[apc].handler; + cookie = cobalt_pipeline.apc_table[apc].cookie; __this_cpu_ptr(xnarch_percpu_machdata)-apc_shots[apc]++; spin_unlock(apc_lock); handler(cookie); @@ -120,16 +120,16 @@ int xnapc_alloc(const char *name, spin_lock_irqsave(apc_lock, flags); - if (xnarch_machdata.apc_map == ~0) { + if (cobalt_pipeline.apc_map == ~0) { apc = -EBUSY; goto out; } - apc = ffz(xnarch_machdata.apc_map); - __set_bit(apc, xnarch_machdata.apc_map); - xnarch_machdata.apc_table[apc].handler = handler; - xnarch_machdata.apc_table[apc].cookie = cookie; - xnarch_machdata.apc_table[apc].name = name; + apc = ffz(cobalt_pipeline.apc_map); + __set_bit(apc, cobalt_pipeline.apc_map); + cobalt_pipeline.apc_table[apc].handler = handler; + cobalt_pipeline.apc_table[apc].cookie = cookie; + cobalt_pipeline.apc_table[apc].name = name; out: spin_unlock_irqrestore(apc_lock, flags); @@ -152,7 +152,7 @@ EXPORT_SYMBOL_GPL(xnapc_alloc); void xnapc_free(int apc) { BUG_ON(apc 0 || apc = BITS_PER_LONG); - clear_bit(apc, xnarch_machdata.apc_map); + clear_bit(apc, cobalt_pipeline.apc_map); smp_mb__after_atomic(); } EXPORT_SYMBOL_GPL(xnapc_free); diff --git a/kernel/cobalt/arch/arm/thread.c b/kernel/cobalt/arch/arm/thread.c index f3e0874..13d2176 100644 --- a/kernel/cobalt/arch/arm/thread.c +++ b/kernel/cobalt/arch/arm/thread.c @@ -342,7 +342,7 @@ void xnarch_switch_to(struct xnthread *out, struct xnthread *in) int xnarch_escalate(void) { if (ipipe_root_p) { - ipipe_raise_irq(xnarch_machdata.escalate_virq); + ipipe_raise_irq(cobalt_pipeline.escalate_virq); return 1; } diff --git a/kernel/cobalt/arch/blackfin/thread.c b/kernel/cobalt/arch/blackfin/thread.c index e0c5d54..d4cda91 100644 ---
[Xenomai-git] Jan Kiszka : cobalt/timer: Fix build for kernels 3.18
Module: xenomai-3 Branch: master Commit: b2d71ad46aa15a74861b2a4929738e79e57a45b1 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=b2d71ad46aa15a74861b2a4929738e79e57a45b1 Author: Jan Kiszka jan.kis...@siemens.com Date: Wed Mar 11 11:31:46 2015 +0100 cobalt/timer: Fix build for kernels 3.18 Add missing include to wrap raw_cpu_ptr for older kernels. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- include/cobalt/kernel/timer.h |1 + 1 file changed, 1 insertion(+) diff --git a/include/cobalt/kernel/timer.h b/include/cobalt/kernel/timer.h index 7fc4f73..1fe0427 100644 --- a/include/cobalt/kernel/timer.h +++ b/include/cobalt/kernel/timer.h @@ -24,6 +24,7 @@ #include cobalt/kernel/stat.h #include cobalt/kernel/list.h #include cobalt/kernel/ancillaries.h +#include asm/xenomai/wrappers.h /** * @addtogroup cobalt_core_timer ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : cobalt: finalize the core control interface
Module: xenomai-3 Branch: master Commit: 34071842e3461a5d33a63a21c097e3430f2943d0 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=34071842e3461a5d33a63a21c097e3430f2943d0 Author: Philippe Gerum r...@xenomai.org Date: Sat Feb 14 11:55:23 2015 +0100 cobalt: finalize the core control interface The former sysconf and sysctl services are merged into the new core control interface (corectl). In addition to the pre-existing configuration retrieval requests, the core stop, start and status actions are available. Those requests can be issued by the new corectl utility, for shutting down, (re-)starting, and getting the current status of the real-time services respectively. RTDM drivers can define state management operation handlers, for being notified of transitions from running to stopped state, and conversely (see rtdm_driver.smops). --- configure |3 +- configure.ac |1 + doc/asciidoc/Makefile.am |2 + doc/asciidoc/Makefile.in |2 + doc/asciidoc/man1/corectl.adoc | 106 ++ doc/prebuilt/html/MIGRATION/index.html |2 +- doc/prebuilt/html/README.APPLICATIONS/index.html |2 +- doc/prebuilt/html/README.INSTALL/index.html|2 +- .../html/TROUBLESHOOTING.COBALT/index.html |2 +- .../html/TROUBLESHOOTING.MERCURY/index.html|2 +- doc/prebuilt/html/man1/corectl/index.html | 917 +++ .../html/xeno3prm/16550A__pci_8h_source.html |2 +- doc/prebuilt/html/xeno3prm/analogy_2driver_8h.html |2 +- .../html/xeno3prm/analogy_2driver_8h__incl.map | 59 +- .../html/xeno3prm/analogy_2driver_8h__incl.md5 |2 +- .../html/xeno3prm/analogy_2driver_8h__incl.png | Bin 338951 - 343296 bytes doc/prebuilt/html/xeno3prm/annotated.html | 37 +- doc/prebuilt/html/xeno3prm/annotated.js|1 + doc/prebuilt/html/xeno3prm/classes.html| 34 +- .../html/xeno3prm/cobalt-rtdm_8h_source.html | 14 +- .../xeno3prm/cobalt_2kernel_2rtdm_2udd_8h.html |2 +- .../cobalt_2kernel_2rtdm_2udd_8h__incl.map | 65 +- .../cobalt_2kernel_2rtdm_2udd_8h__incl.md5 |2 +- .../cobalt_2kernel_2rtdm_2udd_8h__incl.png | Bin 397414 - 361279 bytes .../cobalt_2kernel_2rtdm_2udd_8h_source.html |4 +- .../html/xeno3prm/cobalt_2time_8h_source.html |2 +- doc/prebuilt/html/xeno3prm/context_8h.html |2 +- doc/prebuilt/html/xeno3prm/context_8h__incl.map| 63 +- doc/prebuilt/html/xeno3prm/context_8h__incl.md5|2 +- doc/prebuilt/html/xeno3prm/context_8h__incl.png| Bin 418824 - 368022 bytes doc/prebuilt/html/xeno3prm/context_8h_source.html |2 +- doc/prebuilt/html/xeno3prm/corectl_8h_source.html | 161 ++ doc/prebuilt/html/xeno3prm/device_8h.html |2 +- doc/prebuilt/html/xeno3prm/device_8h__incl.map | 59 +- doc/prebuilt/html/xeno3prm/device_8h__incl.md5 |2 +- doc/prebuilt/html/xeno3prm/device_8h__incl.png | Bin 325720 - 295785 bytes doc/prebuilt/html/xeno3prm/device_8h_source.html |2 +- .../dir_58628a552b85da20a02d06bea81c5738.html |4 +- .../dir_58628a552b85da20a02d06bea81c5738.js|2 +- doc/prebuilt/html/xeno3prm/driver_8h.html |7 +- doc/prebuilt/html/xeno3prm/driver_8h.js|1 + doc/prebuilt/html/xeno3prm/driver_8h__incl.map | 61 +- doc/prebuilt/html/xeno3prm/driver_8h__incl.md5 |2 +- doc/prebuilt/html/xeno3prm/driver_8h__incl.png | Bin 409411 - 387542 bytes doc/prebuilt/html/xeno3prm/driver_8h_source.html | 1648 ++-- .../html/xeno3prm/e1000_2e1000_8h_source.html |2 +- .../html/xeno3prm/e1000e_2e1000_8h_source.html |2 +- .../experimental_2e1000_2e1000_8h_source.html |2 +- .../html/xeno3prm/extension_8h_source.html |2 +- doc/prebuilt/html/xeno3prm/files.html | 16 +- doc/prebuilt/html/xeno3prm/functions_s.html|9 + doc/prebuilt/html/xeno3prm/functions_vars_s.html |9 + .../html/xeno3prm/group__cobalt__api__sched.html |4 +- .../html/xeno3prm/group__cobalt__core__irq.html|4 +- .../html/xeno3prm/group__cobalt__core__sched.html |2 +- .../html/xeno3prm/group__cobalt__core__thread.html | 11 +- .../html/xeno3prm/group__cobalt__core__timer.html | 60 +- .../html/xeno3prm/group__cobalt__core__timer.js|4 +- doc/prebuilt/html/xeno3prm/igb_8h_source.html |2 +- .../include_2cobalt_2kernel_2init_8h_source.html | 42 +- ..._2cobalt_2kernel_2rtdm_2analogy_2buffer_8h.html |2 +- ...alt_2kernel_2rtdm_2analogy_2buffer_8h__incl.map | 59 +- ...alt_2kernel_2rtdm_2analogy_2buffer_8h__incl.md5 |2 +- ...alt_2kernel_2rtdm_2analogy_2buffer_8h__incl.png | Bin 303344 - 295399 bytes
[Xenomai-git] Philippe Gerum : cobalt/kernel: unify naming of extern data - cobalt_kernel_ppd
Module: xenomai-3 Branch: master Commit: 1a07907c1732b557a486b82653d52ace066779e8 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=1a07907c1732b557a486b82653d52ace066779e8 Author: Philippe Gerum r...@xenomai.org Date: Sun Feb 15 19:07:41 2015 +0100 cobalt/kernel: unify naming of extern data - cobalt_kernel_ppd --- include/cobalt/kernel/ppd.h |2 +- include/cobalt/kernel/rtdm/driver.h |2 +- kernel/cobalt/init.c|4 ++-- kernel/cobalt/posix/memory.c| 16 kernel/cobalt/posix/mqueue.c|2 +- kernel/cobalt/posix/process.c |2 +- kernel/cobalt/posix/process.h |2 +- kernel/cobalt/rtdm/fd.c |2 +- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/include/cobalt/kernel/ppd.h b/include/cobalt/kernel/ppd.h index d5cfc69..5eabd1d 100644 --- a/include/cobalt/kernel/ppd.h +++ b/include/cobalt/kernel/ppd.h @@ -38,6 +38,6 @@ struct cobalt_ppd { struct rb_root fds; }; -extern struct cobalt_ppd __xnsys_global_ppd; +extern struct cobalt_ppd cobalt_kernel_ppd; #endif /* _COBALT_KERNEL_PPD_H */ diff --git a/include/cobalt/kernel/rtdm/driver.h b/include/cobalt/kernel/rtdm/driver.h index 4dcb0c0..6faa8bd 100644 --- a/include/cobalt/kernel/rtdm/driver.h +++ b/include/cobalt/kernel/rtdm/driver.h @@ -185,7 +185,7 @@ static inline struct rtdm_fd *rtdm_private_to_fd(void *dev_private) */ static inline bool rtdm_fd_is_user(struct rtdm_fd *fd) { - return rtdm_fd_owner(fd) != __xnsys_global_ppd; + return rtdm_fd_owner(fd) != cobalt_kernel_ppd; } /** diff --git a/kernel/cobalt/init.c b/kernel/cobalt/init.c index 3948c8d..65dc042 100644 --- a/kernel/cobalt/init.c +++ b/kernel/cobalt/init.c @@ -72,10 +72,10 @@ EXPORT_PER_CPU_SYMBOL_GPL(xnarch_percpu_machdata); atomic_t cobalt_runstate = ATOMIC_INIT(COBALT_STATE_WARMUP); EXPORT_SYMBOL_GPL(cobalt_runstate); -struct cobalt_ppd __xnsys_global_ppd = { +struct cobalt_ppd cobalt_kernel_ppd = { .exe_path = vmlinux, }; -EXPORT_SYMBOL_GPL(__xnsys_global_ppd); +EXPORT_SYMBOL_GPL(cobalt_kernel_ppd); #ifdef CONFIG_XENO_OPT_DEBUG #define boot_debug_notice [DEBUG] diff --git a/kernel/cobalt/posix/memory.c b/kernel/cobalt/posix/memory.c index 6ca9206..efedfa2 100644 --- a/kernel/cobalt/posix/memory.c +++ b/kernel/cobalt/posix/memory.c @@ -64,7 +64,7 @@ static struct cobalt_umm *umm_from_fd(struct rtdm_fd *fd) if (rtdm_fd_minor(fd) == UMM_PRIVATE) return process-sys_ppd.umm; - return __xnsys_global_ppd.umm; + return cobalt_kernel_ppd.umm; } static int umm_mmap(struct rtdm_fd *fd, struct vm_area_struct *vma) @@ -262,14 +262,14 @@ int cobalt_memdev_init(void) { int ret; - ret = cobalt_umm_init(__xnsys_global_ppd.umm, + ret = cobalt_umm_init(cobalt_kernel_ppd.umm, CONFIG_XENO_OPT_SHARED_HEAPSZ * 1024, NULL); if (ret) return ret; - cobalt_umm_set_name(__xnsys_global_ppd.umm, shared heap); + cobalt_umm_set_name(cobalt_kernel_ppd.umm, shared heap); - nkvdso = cobalt_umm_alloc(__xnsys_global_ppd.umm, sizeof(*nkvdso)); + nkvdso = cobalt_umm_alloc(cobalt_kernel_ppd.umm, sizeof(*nkvdso)); if (nkvdso == NULL) { ret = -ENOMEM; goto fail_vdso; @@ -296,9 +296,9 @@ fail_sysmem: fail_shared: rtdm_dev_unregister(umm_devices + UMM_PRIVATE); fail_private: - cobalt_umm_free(__xnsys_global_ppd.umm, nkvdso); + cobalt_umm_free(cobalt_kernel_ppd.umm, nkvdso); fail_vdso: - cobalt_umm_destroy(__xnsys_global_ppd.umm); + cobalt_umm_destroy(cobalt_kernel_ppd.umm); return ret; } @@ -308,8 +308,8 @@ void cobalt_memdev_cleanup(void) rtdm_dev_unregister(sysmem_device); rtdm_dev_unregister(umm_devices + UMM_SHARED); rtdm_dev_unregister(umm_devices + UMM_PRIVATE); - cobalt_umm_free(__xnsys_global_ppd.umm, nkvdso); - cobalt_umm_destroy(__xnsys_global_ppd.umm); + cobalt_umm_free(cobalt_kernel_ppd.umm, nkvdso); + cobalt_umm_destroy(cobalt_kernel_ppd.umm); } int cobalt_umm_init(struct cobalt_umm *umm, u32 size, diff --git a/kernel/cobalt/posix/mqueue.c b/kernel/cobalt/posix/mqueue.c index 53c7e95..66ec415 100644 --- a/kernel/cobalt/posix/mqueue.c +++ b/kernel/cobalt/posix/mqueue.c @@ -267,7 +267,7 @@ static inline int mqd_create(struct cobalt_mq *mq, unsigned long flags, int ufd) { struct cobalt_mqd *mqd; - if (cobalt_ppd_get(0) == __xnsys_global_ppd) + if (cobalt_ppd_get(0) == cobalt_kernel_ppd) return -EPERM; mqd = kmalloc(sizeof(*mqd), GFP_KERNEL); diff --git a/kernel/cobalt/posix/process.c b/kernel/cobalt/posix/process.c index 39f4e26..8c59531 100644 --- a/kernel/cobalt/posix/process.c +++ b/kernel/cobalt/posix/process.c @@ -1190,7 +1190,7 @@ static int handle_cleanup_event(struct mm_struct *mm) process =
[Xenomai-git] Philippe Gerum : cobalt/kernel: unify naming of extern data - cobalt_cpu_affinity
Module: xenomai-3 Branch: master Commit: e6fc0adc78a13f724696ae7de4b00256a7a409fb URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=e6fc0adc78a13f724696ae7de4b00256a7a409fb Author: Philippe Gerum r...@xenomai.org Date: Tue Feb 17 11:42:38 2015 +0100 cobalt/kernel: unify naming of extern data - cobalt_cpu_affinity --- include/cobalt/kernel/sched.h |2 +- kernel/cobalt/init.c |2 +- kernel/cobalt/intr.c |2 +- kernel/cobalt/posix/process.c |2 +- kernel/cobalt/sched.c |8 kernel/cobalt/thread.c|6 +++--- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/cobalt/kernel/sched.h b/include/cobalt/kernel/sched.h index 04bd6ea..b7a4365 100644 --- a/include/cobalt/kernel/sched.h +++ b/include/cobalt/kernel/sched.h @@ -117,7 +117,7 @@ struct xnsched { DECLARE_PER_CPU(struct xnsched, nksched); -extern cpumask_t nkaffinity; +extern cpumask_t cobalt_cpu_affinity; extern struct list_head nkthreadq; diff --git a/kernel/cobalt/init.c b/kernel/cobalt/init.c index a060025..d5fc750 100644 --- a/kernel/cobalt/init.c +++ b/kernel/cobalt/init.c @@ -342,7 +342,7 @@ static int __init xenomai_init(void) set_realtime_core_state(COBALT_STATE_DISABLED); return 0; } - nkaffinity = xnsched_realtime_cpus; + cobalt_cpu_affinity = xnsched_realtime_cpus; #endif /* CONFIG_SMP */ xnsched_register_classes(); diff --git a/kernel/cobalt/intr.c b/kernel/cobalt/intr.c index fb29dab..dc66700 100644 --- a/kernel/cobalt/intr.c +++ b/kernel/cobalt/intr.c @@ -819,7 +819,7 @@ int xnintr_attach(struct xnintr *intr, void *cookie) clear_irqstats(intr); #ifdef CONFIG_SMP - ipipe_set_irq_affinity(intr-irq, nkaffinity); + ipipe_set_irq_affinity(intr-irq, cobalt_cpu_affinity); #endif /* CONFIG_SMP */ raw_spin_lock(intr-lock); diff --git a/kernel/cobalt/posix/process.c b/kernel/cobalt/posix/process.c index d53e34a..07b011f 100644 --- a/kernel/cobalt/posix/process.c +++ b/kernel/cobalt/posix/process.c @@ -808,7 +808,7 @@ static int handle_setaffinity_event(struct ipipe_cpu_migration_data *d) * affinity mask accordingly. */ xnlock_get_irqsave(nklock, s); - cpus_and(thread-affinity, p-cpus_allowed, nkaffinity); + cpus_and(thread-affinity, p-cpus_allowed, cobalt_cpu_affinity); xnthread_run_handler_stack(thread, move_thread, d-dest_cpu); xnlock_put_irqrestore(nklock, s); diff --git a/kernel/cobalt/sched.c b/kernel/cobalt/sched.c index ecdd3ca..5f048c4 100644 --- a/kernel/cobalt/sched.c +++ b/kernel/cobalt/sched.c @@ -38,8 +38,8 @@ DEFINE_PER_CPU(struct xnsched, nksched); EXPORT_PER_CPU_SYMBOL_GPL(nksched); -cpumask_t nkaffinity = CPU_MASK_ALL; -EXPORT_SYMBOL_GPL(nkaffinity); +cpumask_t cobalt_cpu_affinity = CPU_MASK_ALL; +EXPORT_SYMBOL_GPL(cobalt_cpu_affinity); LIST_HEAD(nkthreadq); @@ -1281,7 +1281,7 @@ static int affinity_vfile_show(struct xnvfile_regular_iterator *it, int cpu; for (cpu = 0; cpu BITS_PER_LONG; cpu++) - if (cpu_isset(cpu, nkaffinity)) + if (cpu_isset(cpu, cobalt_cpu_affinity)) val |= (1UL cpu); xnvfile_printf(it, %08lx\n, val); @@ -1324,7 +1324,7 @@ static ssize_t affinity_vfile_store(struct xnvfile_input *input) return -EINVAL; xnlock_get_irqsave(nklock, s); - nkaffinity = affinity; + cobalt_cpu_affinity = affinity; xnlock_put_irqrestore(nklock, s); return ret; diff --git a/kernel/cobalt/thread.c b/kernel/cobalt/thread.c index 4018d7c..b883c4a 100644 --- a/kernel/cobalt/thread.c +++ b/kernel/cobalt/thread.c @@ -168,7 +168,7 @@ int __xnthread_init(struct xnthread *thread, sizeof(thread-name), @%p, thread); thread-personality = attr-personality; - cpus_and(thread-affinity, attr-affinity, nkaffinity); + cpus_and(thread-affinity, attr-affinity, cobalt_cpu_affinity); thread-sched = sched; thread-state = flags; thread-info = 0; @@ -559,7 +559,7 @@ void __xnthread_discard(struct xnthread *thread) * * - affinity: The processor affinity of this thread. Passing * CPU_MASK_ALL means any cpu from the allowed core affinity mask - * (nkaffinity). Passing an empty set is invalid. + * (cobalt_cpu_affinity). Passing an empty set is invalid. * * @param sched_class The initial scheduling class the new thread * should be assigned to. @@ -594,7 +594,7 @@ int xnthread_init(struct xnthread *thread, * affinity mask, and therefore also part of the supported * CPUs. This CPU may change in pin_to_initial_cpu(). */ - cpus_and(affinity, attr-affinity, nkaffinity); + cpus_and(affinity, attr-affinity, cobalt_cpu_affinity); if (cpus_empty(affinity)) return -EINVAL; ___
[Xenomai-git] Philippe Gerum : cobalt/thread: send SIGTERM to weak user threads upon cancellation request
Module: xenomai-3 Branch: master Commit: 7237c9fc17bb33ae3b3105a38e86e3a50f22e84c URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=7237c9fc17bb33ae3b3105a38e86e3a50f22e84c Author: Philippe Gerum r...@xenomai.org Date: Sat Feb 14 17:23:54 2015 +0100 cobalt/thread: send SIGTERM to weak user threads upon cancellation request A userland thread undergoing the weak scheduling policy is unlikely to issue Cobalt syscalls frequently, which may defer cancellation significantly: send it a regular termination signal too. --- kernel/cobalt/thread.c | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/kernel/cobalt/thread.c b/kernel/cobalt/thread.c index a635611..7885beb 100644 --- a/kernel/cobalt/thread.c +++ b/kernel/cobalt/thread.c @@ -1480,8 +1480,7 @@ void xnthread_cancel(struct xnthread *thread) if (xnthread_test_state(thread, XNDORMANT)) { xnthread_set_info(thread, XNKICKED); xnthread_resume(thread, XNDORMANT); - xnsched_run(); - goto unlock_and_exit; + goto out; } check_self_cancel: @@ -1496,10 +1495,19 @@ check_self_cancel: } __xnthread_demote(thread); - xnsched_run(); -unlock_and_exit: + /* +* A userland thread undergoing the weak scheduling policy is +* unlikely to issue Cobalt syscalls frequently, which may +* defer cancellation significantly: send it a regular +* termination signal too. +*/ + if (xnthread_test_state(thread, XNWEAK|XNUSER) == (XNWEAK|XNUSER)) + xnthread_signal(thread, SIGTERM, 0); +out: xnlock_put_irqrestore(nklock, s); + + xnsched_run(); } EXPORT_SYMBOL_GPL(xnthread_cancel); ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : cobalt/x86: drop %esp from mayday fixup in 32bit mode
Module: xenomai-3 Branch: master Commit: 6ca5c4950139b323f39dbaac3303a816278745d3 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=6ca5c4950139b323f39dbaac3303a816278745d3 Author: Philippe Gerum r...@xenomai.org Date: Fri Feb 13 18:11:05 2015 +0100 cobalt/x86: drop %esp from mayday fixup in 32bit mode We don't need this anymore, since %esp is part of the register frame saved by int80. --- kernel/cobalt/arch/x86/include/asm/xenomai/thread.h |1 - kernel/cobalt/arch/x86/mayday.c |3 --- 2 files changed, 4 deletions(-) diff --git a/kernel/cobalt/arch/x86/include/asm/xenomai/thread.h b/kernel/cobalt/arch/x86/include/asm/xenomai/thread.h index 544507c..f58caf7 100644 --- a/kernel/cobalt/arch/x86/include/asm/xenomai/thread.h +++ b/kernel/cobalt/arch/x86/include/asm/xenomai/thread.h @@ -39,7 +39,6 @@ struct xnarchtcb { struct { unsigned long ip; unsigned long ax; - unsigned long sp; } mayday; }; diff --git a/kernel/cobalt/arch/x86/mayday.c b/kernel/cobalt/arch/x86/mayday.c index 22a9196..15f07bd 100644 --- a/kernel/cobalt/arch/x86/mayday.c +++ b/kernel/cobalt/arch/x86/mayday.c @@ -191,7 +191,6 @@ void *xnarch_get_mayday_page(void) void xnarch_handle_mayday(struct xnarchtcb *tcb, struct pt_regs *regs, unsigned long tramp) { - tcb-mayday.sp = regs-sp; tcb-mayday.ip = regs-ip; tcb-mayday.ax = regs-ax; regs-ip = tramp; @@ -204,12 +203,10 @@ void xnarch_fixup_mayday(struct xnarchtcb *tcb, struct pt_regs *regs) test_thread_flag(TIF_IA32)) { regs-ip = tcb-mayday.ip; regs-ax = tcb-mayday.ax; - regs-sp = tcb-mayday.sp; } else regs-ax = tcb-mayday.ip; #else regs-ip = tcb-mayday.ip; regs-ax = tcb-mayday.ax; - regs-sp = tcb-mayday.sp; #endif } ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : scripts/prepare-kernel.sh: fix check for supported major kernel version
Module: xenomai-3 Branch: master Commit: 4686faa1937bafc6d4174c971a09de80805ae7b8 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=4686faa1937bafc6d4174c971a09de80805ae7b8 Author: Philippe Gerum r...@xenomai.org Date: Mon Feb 23 16:55:13 2015 +0100 scripts/prepare-kernel.sh: fix check for supported major kernel version --- scripts/prepare-kernel.sh | 20 ++-- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/scripts/prepare-kernel.sh b/scripts/prepare-kernel.sh index d0d62da..b7c2f0b 100755 --- a/scripts/prepare-kernel.sh +++ b/scripts/prepare-kernel.sh @@ -376,11 +376,13 @@ patch_kernelversion_specific=y case $linux_VERSION.$linux_PATCHLEVEL in -# -# Linux 3.x section -# +2.*) -3.*) +echo $me: Unsupported kernel version $linux_VERSION.$linux_PATCHLEVEL.x 2 +exit 2 +;; + +*) patch_architecture_specific=y @@ -420,16 +422,6 @@ test x$CONFIG_XENO_REVISION_LEVEL = x CONFIG_XENO_REVISION_LEVEL=0 fi ;; -# -# Paranoid section -# - -*) - -echo $me: Unsupported kernel version $linux_VERSION.$linux_PATCHLEVEL.x 2 -exit 2 -;; - esac # Create local directories then symlink to the source files from ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : copperplate/cluster: add support for walking a cluster
Module: xenomai-3 Branch: master Commit: 771f61ddaf2d02ddd9b8b3f9ff5acb16f9248854 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=771f61ddaf2d02ddd9b8b3f9ff5acb16f9248854 Author: Philippe Gerum r...@xenomai.org Date: Wed Mar 11 22:04:51 2015 +0100 copperplate/cluster: add support for walking a cluster --- include/copperplate/cluster.h | 87 + lib/copperplate/cluster.c | 59 +++- 2 files changed, 145 insertions(+), 1 deletion(-) diff --git a/include/copperplate/cluster.h b/include/copperplate/cluster.h index 34da167..0f75690 100644 --- a/include/copperplate/cluster.h +++ b/include/copperplate/cluster.h @@ -57,6 +57,42 @@ struct pvsyncluster { struct syncobj sobj; }; +static inline +const void *clusterobj_key(const struct clusterobj *cobj) +{ + return __memptr(__main_heap, cobj-hobj.key); +} + +static inline +size_t clusterobj_keylen(const struct clusterobj *cobj) +{ + return cobj-hobj.len; +} + +static inline +pid_t clusterobj_cnode(const struct clusterobj *cobj) +{ + return cobj-cnode; +} + +static inline +const void *pvclusterobj_key(const struct pvclusterobj *cobj) +{ + return cobj-hobj.key; +} + +static inline +size_t pvclusterobj_keylen(const struct pvclusterobj *cobj) +{ + return cobj-hobj.len; +} + +static inline +pid_t pvclusterobj_cnode(const struct pvclusterobj *cobj) +{ + return -1; +} + #else /* !CONFIG_XENO_PSHARED */ struct clusterobj { @@ -76,6 +112,42 @@ struct syncluster { #define pvcluster cluster #define pvsyncluster syncluster +static inline +const void *clusterobj_key(const struct pvclusterobj *cobj) +{ + return cobj-hobj.key; +} + +static inline +size_t clusterobj_keylen(const struct pvclusterobj *cobj) +{ + return cobj-hobj.len; +} + +static inline +pid_t clusterobj_cnode(const struct pvclusterobj *cobj) +{ + return -1; +} + +static inline +const void *pvclusterobj_key(const struct pvclusterobj *cobj) +{ + return clusterobj_key(cobj); +} + +static inline +size_t pvclusterobj_keylen(const struct pvclusterobj *cobj) +{ + return clusterobj_keylen(cobj); +} + +static inline +pid_t pvclusterobj_cnode(const struct pvclusterobj *cobj) +{ + return clusterobj_cnode(cobj); +} + #endif /* !CONFIG_XENO_PSHARED */ struct syncluster_wait_struct { @@ -102,6 +174,10 @@ int pvcluster_delobj(struct pvcluster *c, struct pvclusterobj *pvcluster_findobj(struct pvcluster *c, const char *name); +int pvcluster_walk(struct pvcluster *c, + int (*walk)(struct pvcluster *c, + struct pvclusterobj *cobj)); + int pvsyncluster_init(struct pvsyncluster *sc, const char *name); void pvsyncluster_destroy(struct pvsyncluster *sc); @@ -133,6 +209,10 @@ int cluster_delobj(struct cluster *c, struct clusterobj *cluster_findobj(struct cluster *c, const char *name); +int cluster_walk(struct cluster *c, +int (*walk)(struct cluster *c, +struct clusterobj *cobj)); + int syncluster_init(struct syncluster *sc, const char *name); int syncluster_addobj(struct syncluster *sc, const char *name, @@ -177,6 +257,13 @@ static inline struct clusterobj *cluster_findobj(struct cluster *c, return pvcluster_findobj(c, name); } +static inline int cluster_walk(struct cluster *c, + int (*walk)(struct cluster *c, + struct clusterobj *cobj)) +{ + return pvcluster_walk(c, walk); +} + static inline int syncluster_init(struct syncluster *sc, const char *name) { diff --git a/lib/copperplate/cluster.c b/lib/copperplate/cluster.c index 28e24c8..80923bc 100644 --- a/lib/copperplate/cluster.c +++ b/lib/copperplate/cluster.c @@ -100,13 +100,25 @@ const static struct hash_operations hash_operations; +struct cluster_walk_data { + struct cluster *c; + int (*walk)(struct cluster *c, + struct clusterobj *cobj); +}; + +struct pvcluster_walk_data { + struct pvcluster *c; + int (*walk)(struct pvcluster *c, + struct pvclusterobj *cobj); +}; + #ifdef CONFIG_XENO_PSHARED int cluster_init(struct cluster *c, const char *name) { struct dictionary *d; struct hashobj *hobj; - int ret = 0; + int ret; /* * NOTE: it does not make sense to destroy a shared cluster @@ -122,6 +134,7 @@ redo: hash_operations); if (hobj) { d = container_of(hobj, struct dictionary, hobj); + ret = 0; goto out; } @@ -140,6 +153,7 @@ redo: * cluster right after we failed retrieving it: retry * the whole process. */ + hash_destroy(d-table);
[Xenomai-git] Philippe Gerum : cobalt/kernel: unify naming of extern data - cobalt_machine
Module: xenomai-3 Branch: master Commit: 04dbe2ac275a001e4870b714cbfdd66ddfe940f3 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=04dbe2ac275a001e4870b714cbfdd66ddfe940f3 Author: Philippe Gerum r...@xenomai.org Date: Sun Feb 15 19:16:13 2015 +0100 cobalt/kernel: unify naming of extern data - cobalt_machine --- kernel/cobalt/arch/arm/machine.c|2 +- kernel/cobalt/arch/blackfin/machine.c |2 +- kernel/cobalt/arch/nios2/machine.c |2 +- kernel/cobalt/arch/powerpc/machine.c|2 +- kernel/cobalt/arch/sh/machine.c |2 +- kernel/cobalt/arch/x86/machine.c|2 +- kernel/cobalt/include/asm-generic/xenomai/machine.h |6 +++--- kernel/cobalt/init.c|8 kernel/cobalt/procfs.c |6 +++--- kernel/cobalt/rtdm/drvlib.c |4 ++-- 10 files changed, 18 insertions(+), 18 deletions(-) diff --git a/kernel/cobalt/arch/arm/machine.c b/kernel/cobalt/arch/arm/machine.c index fed94c9..bb50d2b 100644 --- a/kernel/cobalt/arch/arm/machine.c +++ b/kernel/cobalt/arch/arm/machine.c @@ -108,7 +108,7 @@ static const char *const fault_labels[] = { [IPIPE_NR_FAULTS] = NULL }; -struct xnarch_machdesc xnarch_machdesc = { +struct cobalt_machine cobalt_machine = { .name = arm, .init = NULL, .cleanup = NULL, diff --git a/kernel/cobalt/arch/blackfin/machine.c b/kernel/cobalt/arch/blackfin/machine.c index 098d921..8175d9d 100644 --- a/kernel/cobalt/arch/blackfin/machine.c +++ b/kernel/cobalt/arch/blackfin/machine.c @@ -81,7 +81,7 @@ static const char *const fault_labels[] = { [47] = NULL }; -struct xnarch_machdesc xnarch_machdesc = { +struct cobalt_machine cobalt_machine = { .name = blackfin, .init = mach_blackfin_init, .cleanup = mach_blackfin_cleanup, diff --git a/kernel/cobalt/arch/nios2/machine.c b/kernel/cobalt/arch/nios2/machine.c index ebd8ab6..39f5cc1 100644 --- a/kernel/cobalt/arch/nios2/machine.c +++ b/kernel/cobalt/arch/nios2/machine.c @@ -50,7 +50,7 @@ static const char *const fault_labels[] = { [6] = NULL }; -struct xnarch_machdesc xnarch_machdesc = { +struct cobalt_machine cobalt_machine = { .name = nios2, .init = NULL, .cleanup = NULL, diff --git a/kernel/cobalt/arch/powerpc/machine.c b/kernel/cobalt/arch/powerpc/machine.c index 2e35b4d..62c339c 100644 --- a/kernel/cobalt/arch/powerpc/machine.c +++ b/kernel/cobalt/arch/powerpc/machine.c @@ -62,7 +62,7 @@ static const char *const fault_labels[] = { [16] = NULL }; -struct xnarch_machdesc xnarch_machdesc = { +struct cobalt_machine cobalt_machine = { .name = powerpc, .init = mach_powerpc_init, .cleanup = NULL, diff --git a/kernel/cobalt/arch/sh/machine.c b/kernel/cobalt/arch/sh/machine.c index 9603407..327632c 100644 --- a/kernel/cobalt/arch/sh/machine.c +++ b/kernel/cobalt/arch/sh/machine.c @@ -49,7 +49,7 @@ static const char *const fault_labels[] = { [5] = NULL }; -struct xnarch_machdesc xnarch_machdesc = { +struct cobalt_machine cobalt_machine = { .name = sh, .init = NULL, .cleanup = NULL, diff --git a/kernel/cobalt/arch/x86/machine.c b/kernel/cobalt/arch/x86/machine.c index 3ce34ae..630f308 100644 --- a/kernel/cobalt/arch/x86/machine.c +++ b/kernel/cobalt/arch/x86/machine.c @@ -181,7 +181,7 @@ static const char *const fault_labels[] = { [20] = NULL, }; -struct xnarch_machdesc xnarch_machdesc = { +struct cobalt_machine cobalt_machine = { .name = x86, .init = mach_x86_init, .cleanup = mach_x86_cleanup, diff --git a/kernel/cobalt/include/asm-generic/xenomai/machine.h b/kernel/cobalt/include/asm-generic/xenomai/machine.h index 32f5ae0..48b96ed 100644 --- a/kernel/cobalt/include/asm-generic/xenomai/machine.h +++ b/kernel/cobalt/include/asm-generic/xenomai/machine.h @@ -26,7 +26,7 @@ struct vm_area_struct; -struct xnarch_machdesc { +struct cobalt_machine { const char *name; int (*init)(void); void (*cleanup)(void); @@ -35,7 +35,7 @@ struct xnarch_machdesc { const char *const *fault_labels; }; -extern struct xnarch_machdesc xnarch_machdesc; +extern struct cobalt_machine cobalt_machine; struct xnarch_percpu_machdata { unsigned long apc_pending; @@ -66,7 +66,7 @@ extern struct xnarch_machdata xnarch_machdata; static inline unsigned long xnarch_timer_calibrate(void) { - return xnarch_machdesc.calibrate(); + return cobalt_machine.calibrate(); } #ifndef xnarch_cache_aliasing diff --git a/kernel/cobalt/init.c b/kernel/cobalt/init.c index 65dc042..a51c28a 100644 --- a/kernel/cobalt/init.c +++ b/kernel/cobalt/init.c @@ -182,8 +182,8 @@ static int __init mach_setup(void) xnarch_machdata.timer_freq = timerfreq_arg; xnarch_machdata.clock_freq = clockfreq_arg;
[Xenomai-git] Philippe Gerum : cobalt: bump ABI revision level
Module: xenomai-3 Branch: next Commit: c2506b7133d6e6d05e9aee79363a57be9fb6ffae URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=c2506b7133d6e6d05e9aee79363a57be9fb6ffae Author: Philippe Gerum r...@xenomai.org Date: Tue Mar 24 10:19:31 2015 +0100 cobalt: bump ABI revision level --- kernel/cobalt/arch/arm/include/asm/xenomai/uapi/features.h |2 +- kernel/cobalt/arch/blackfin/include/asm/xenomai/uapi/features.h |2 +- kernel/cobalt/arch/nios2/include/asm/xenomai/uapi/features.h|2 +- kernel/cobalt/arch/powerpc/include/asm/xenomai/uapi/features.h |2 +- kernel/cobalt/arch/sh/include/asm/xenomai/uapi/features.h |2 +- kernel/cobalt/arch/x86/include/asm/xenomai/uapi/features.h |2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/kernel/cobalt/arch/arm/include/asm/xenomai/uapi/features.h b/kernel/cobalt/arch/arm/include/asm/xenomai/uapi/features.h index 9109ab1..3d3f6de 100644 --- a/kernel/cobalt/arch/arm/include/asm/xenomai/uapi/features.h +++ b/kernel/cobalt/arch/arm/include/asm/xenomai/uapi/features.h @@ -22,7 +22,7 @@ #define _COBALT_ARM_ASM_UAPI_FEATURES_H /* The ABI revision level we use on this arch. */ -#define XENOMAI_ABI_REV 12UL +#define XENOMAI_ABI_REV 13UL #define XENOMAI_FEAT_DEP (__xn_feat_generic_mask) diff --git a/kernel/cobalt/arch/blackfin/include/asm/xenomai/uapi/features.h b/kernel/cobalt/arch/blackfin/include/asm/xenomai/uapi/features.h index e2b74fc..b40abbe 100644 --- a/kernel/cobalt/arch/blackfin/include/asm/xenomai/uapi/features.h +++ b/kernel/cobalt/arch/blackfin/include/asm/xenomai/uapi/features.h @@ -19,7 +19,7 @@ #define _COBALT_BLACKFIN_ASM_UAPI_FEATURES_H /* The ABI revision level we use on this arch. */ -#define XENOMAI_ABI_REV 12UL +#define XENOMAI_ABI_REV 13UL #define XENOMAI_FEAT_DEP __xn_feat_generic_mask diff --git a/kernel/cobalt/arch/nios2/include/asm/xenomai/uapi/features.h b/kernel/cobalt/arch/nios2/include/asm/xenomai/uapi/features.h index a57557f..f890cc6 100644 --- a/kernel/cobalt/arch/nios2/include/asm/xenomai/uapi/features.h +++ b/kernel/cobalt/arch/nios2/include/asm/xenomai/uapi/features.h @@ -21,7 +21,7 @@ #include linux/types.h /* The ABI revision level we use on this arch. */ -#define XENOMAI_ABI_REV 11UL +#define XENOMAI_ABI_REV 12UL #define XENOMAI_FEAT_DEP __xn_feat_generic_mask diff --git a/kernel/cobalt/arch/powerpc/include/asm/xenomai/uapi/features.h b/kernel/cobalt/arch/powerpc/include/asm/xenomai/uapi/features.h index e347d58..e183f92 100644 --- a/kernel/cobalt/arch/powerpc/include/asm/xenomai/uapi/features.h +++ b/kernel/cobalt/arch/powerpc/include/asm/xenomai/uapi/features.h @@ -19,7 +19,7 @@ #define _COBALT_POWERPC_ASM_UAPI_FEATURES_H /* The ABI revision level we use on this arch. */ -#define XENOMAI_ABI_REV 12UL +#define XENOMAI_ABI_REV 13UL #define XENOMAI_FEAT_DEP __xn_feat_generic_mask diff --git a/kernel/cobalt/arch/sh/include/asm/xenomai/uapi/features.h b/kernel/cobalt/arch/sh/include/asm/xenomai/uapi/features.h index 58cee62..9a2f9fb 100644 --- a/kernel/cobalt/arch/sh/include/asm/xenomai/uapi/features.h +++ b/kernel/cobalt/arch/sh/include/asm/xenomai/uapi/features.h @@ -21,7 +21,7 @@ #include linux/types.h /* The ABI revision level we use on this arch. */ -#define XENOMAI_ABI_REV 9UL +#define XENOMAI_ABI_REV 10UL #define XENOMAI_FEAT_DEP __xn_feat_generic_mask diff --git a/kernel/cobalt/arch/x86/include/asm/xenomai/uapi/features.h b/kernel/cobalt/arch/x86/include/asm/xenomai/uapi/features.h index 8cadbec..362fdf4 100644 --- a/kernel/cobalt/arch/x86/include/asm/xenomai/uapi/features.h +++ b/kernel/cobalt/arch/x86/include/asm/xenomai/uapi/features.h @@ -19,7 +19,7 @@ #define _COBALT_X86_ASM_UAPI_FEATURES_H /* The ABI revision level we use on this arch. */ -#define XENOMAI_ABI_REV 12UL +#define XENOMAI_ABI_REV 13UL #define XENOMAI_FEAT_DEP __xn_feat_generic_mask ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : copperplate/regd: fix build with _FORTIFY_SOURCE 0
Module: xenomai-3 Branch: master Commit: 0dbe013a6dadbfcd3fc7f72e013f6f1c1dbc4425 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=0dbe013a6dadbfcd3fc7f72e013f6f1c1dbc4425 Author: Philippe Gerum r...@xenomai.org Date: Thu Feb 19 21:36:53 2015 +0100 copperplate/regd: fix build with _FORTIFY_SOURCE 0 --- lib/copperplate/regd/regd.c |8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/copperplate/regd/regd.c b/lib/copperplate/regd/regd.c index febaee4..c8ae0f6 100644 --- a/lib/copperplate/regd/regd.c +++ b/lib/copperplate/regd/regd.c @@ -149,9 +149,8 @@ static int create_directory_recursive(const char *dir) /* absolute path */ } free(s); - chdir(rootdir); /* Back to rootdir */ - return 0; + return chdir(rootdir) ? -errno : 0; /* Back to rootdir */ } static void create_rootdir(void) @@ -259,7 +258,7 @@ fail_nopath: static void unmount(const char *path) { - int flags; + int flags, ret; char *cmd; /* @@ -271,7 +270,8 @@ static void unmount(const char *path) fcntl(2, F_SETFD, flags | FD_CLOEXEC); if (asprintf(cmd, /usr/bin/fusermount -uzq %s, path) 0) { - system(cmd); + ret = system(cmd); + (void)ret; free(cmd); } } ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : doc/asciidoc: update guides
Module: xenomai-3 Branch: refs/tags/v3.0-rc4 Commit: f86c6d67d8caeb5cb158113d87fbc5a52654b4c0 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=f86c6d67d8caeb5cb158113d87fbc5a52654b4c0 Author: Philippe Gerum r...@xenomai.org Date: Tue Mar 24 11:23:09 2015 +0100 doc/asciidoc: update guides --- doc/asciidoc/README.INSTALL.adoc | 20 +++- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/doc/asciidoc/README.INSTALL.adoc b/doc/asciidoc/README.INSTALL.adoc index efec3aa..8206a83 100644 --- a/doc/asciidoc/README.INSTALL.adoc +++ b/doc/asciidoc/README.INSTALL.adoc @@ -350,8 +350,11 @@ although this is not mandatory if building with `--disable-tls`. the target kernel running the real-time applications. In addition, the FUSE development libraries must be available from the toolchain. -- The autoconf (= 2.62), automake and libtool packages must be - available on your build system. +- If you plan to build from the sources available from the Xenomai GIT + tree (git.xenomai.org), the autoconf (= 2.62), automake and libtool + packages must be available on your build system. This is not + required when building from a source tree extracted from a + http://download.gna.org/xenomai/[release tarball]. _Cobalt_-specific requirements ^^ @@ -377,14 +380,21 @@ _Mercury_-specific requirement Configuring ~~~ -First, the `configure` script and Makefiles must be generated in the -Xenomai source tree. The recommended way is to run the automatic -reconfiguration script shipped, from the top of the source tree: +If building the source obtained from the Xenomai GIT tree +(git.xenomai.org), the `configure` script and Makefiles must be +generated in the Xenomai source tree. The recommended way is to run +the automatic reconfiguration script shipped, from the top of the +source tree: - $ ./scripts/bootstrap - +If building from a http://download.gna.org/xenomai[release tarball], a +set of autoconf-generated file will be readily available from the +extracted source tree, and therefore reconfiguring will not be +required. + When run, the generated `configure` script prepares for building the libraries and programs, for both the _Cobalt_ and _Mercury_ cores. The core-specific code which may be needed internally is automatically and ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : copperplate: fix cluster probe routine
Module: xenomai-3 Branch: master Commit: 3882b27541dff4887374845bce9d01912f7dc61f URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=3882b27541dff4887374845bce9d01912f7dc61f Author: Philippe Gerum r...@xenomai.org Date: Sun Mar 15 12:32:00 2015 +0100 copperplate: fix cluster probe routine --- lib/copperplate/cluster.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/copperplate/cluster.c b/lib/copperplate/cluster.c index 80923bc..0dda986 100644 --- a/lib/copperplate/cluster.c +++ b/lib/copperplate/cluster.c @@ -177,7 +177,7 @@ static int cluster_probe(struct hashobj *hobj) * Over Cobalt, the main thread is always shadowed, therefore * we may use Cobalt's kill() service to probe for it. */ - return __RT(kill(cobj-cnode, 0)); + return __RT(kill(cobj-cnode, 0)) == 0; } int cluster_addobj(struct cluster *c, const char *name, ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Jan Kiszka : cobalt/posix: Convert syscalls to long return type
Module: xenomai-3 Branch: master Commit: f22bfc38b5d2e2f6da7c9105695bff37876b0e66 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=f22bfc38b5d2e2f6da7c9105695bff37876b0e66 Author: Jan Kiszka jan.kis...@siemens.com Date: Thu Feb 12 18:26:04 2015 +0100 cobalt/posix: Convert syscalls to long return type Remove the return type from COBALT_SYSCALL[_DECL] and replace it with long, the correct type we actually need to provide to the syscall dispatchers. Convert all users of the macros. This has to be done in a single step, thus this huge commit. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- kernel/cobalt/posix/clock.c | 13 ++--- kernel/cobalt/posix/clock.h | 15 ++- kernel/cobalt/posix/cond.c| 20 ++-- kernel/cobalt/posix/cond.h| 20 ++-- kernel/cobalt/posix/event.c | 24 kernel/cobalt/posix/event.h | 28 ++-- kernel/cobalt/posix/io.c | 34 -- kernel/cobalt/posix/io.h | 30 +++--- kernel/cobalt/posix/monitor.c | 18 +- kernel/cobalt/posix/monitor.h | 20 ++-- kernel/cobalt/posix/mqueue.c | 25 - kernel/cobalt/posix/mqueue.h | 26 +++--- kernel/cobalt/posix/mutex.c | 18 +- kernel/cobalt/posix/mutex.h | 18 +- kernel/cobalt/posix/nsem.c| 10 +- kernel/cobalt/posix/sched.c | 21 ++--- kernel/cobalt/posix/sched.h | 23 +++ kernel/cobalt/posix/sem.c | 30 +++--- kernel/cobalt/posix/sem.h | 38 +++--- kernel/cobalt/posix/signal.c | 18 -- kernel/cobalt/posix/signal.h | 20 +--- kernel/cobalt/posix/syscall.c | 35 +-- kernel/cobalt/posix/syscall.h |8 kernel/cobalt/posix/thread.c | 37 ++--- kernel/cobalt/posix/thread.h | 37 + kernel/cobalt/posix/timer.c | 19 +-- kernel/cobalt/posix/timer.h | 18 +- kernel/cobalt/posix/timerfd.c | 11 +-- kernel/cobalt/posix/timerfd.h | 10 +- 29 files changed, 310 insertions(+), 334 deletions(-) diff --git a/kernel/cobalt/posix/clock.c b/kernel/cobalt/posix/clock.c index 8c0f9c9..d0b108e 100644 --- a/kernel/cobalt/posix/clock.c +++ b/kernel/cobalt/posix/clock.c @@ -130,7 +130,7 @@ int __cobalt_clock_getres(clockid_t clock_id, struct timespec *ts) } COBALT_SYSCALL(clock_getres, current, - int, (clockid_t clock_id, struct timespec __user *u_ts)) + (clockid_t clock_id, struct timespec __user *u_ts)) { struct timespec ts; int ret; @@ -177,7 +177,7 @@ int __cobalt_clock_gettime(clockid_t clock_id, struct timespec *ts) } COBALT_SYSCALL(clock_gettime, current, - int, (clockid_t clock_id, struct timespec __user *u_ts)) + (clockid_t clock_id, struct timespec __user *u_ts)) { struct timespec ts; int ret; @@ -222,8 +222,7 @@ int __cobalt_clock_settime(clockid_t clock_id, const struct timespec *ts) } COBALT_SYSCALL(clock_settime, current, - int, (clockid_t clock_id, -const struct timespec __user *u_ts)) + (clockid_t clock_id, const struct timespec __user *u_ts)) { struct timespec ts; @@ -282,9 +281,9 @@ int __cobalt_clock_nanosleep(clockid_t clock_id, int flags, } COBALT_SYSCALL(clock_nanosleep, nonrestartable, - int, (clockid_t clock_id, int flags, -const struct timespec __user *u_rqt, -struct timespec __user *u_rmt)) + (clockid_t clock_id, int flags, + const struct timespec __user *u_rqt, + struct timespec __user *u_rmt)) { struct timespec rqt, rmt, *rmtp = NULL; int ret; diff --git a/kernel/cobalt/posix/clock.h b/kernel/cobalt/posix/clock.h index 5fa0f16..c810c1e 100644 --- a/kernel/cobalt/posix/clock.h +++ b/kernel/cobalt/posix/clock.h @@ -98,21 +98,18 @@ int __cobalt_clock_nanosleep(clockid_t clock_id, int flags, struct timespec *rmt); COBALT_SYSCALL_DECL(clock_getres, - int, (clockid_t clock_id, - struct timespec __user *u_ts)); + (clockid_t clock_id, struct timespec __user *u_ts)); COBALT_SYSCALL_DECL(clock_gettime, - int, (clockid_t clock_id, - struct timespec __user *u_ts)); + (clockid_t clock_id, struct timespec __user *u_ts)); COBALT_SYSCALL_DECL(clock_settime, - int, (clockid_t clock_id, - const struct timespec __user *u_ts)); +
[Xenomai-git] Philippe Gerum : cobalt/posix/cond: use resource management API
Module: xenomai-3 Branch: master Commit: 5658bbf065beefb27b92a0131b865b1b8bb40367 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=5658bbf065beefb27b92a0131b865b1b8bb40367 Author: Philippe Gerum r...@xenomai.org Date: Wed Mar 18 11:53:11 2015 +0100 cobalt/posix/cond: use resource management API --- kernel/cobalt/posix/cond.c| 104 +++-- kernel/cobalt/posix/cond.h| 11 ++--- kernel/cobalt/posix/process.c |2 +- 3 files changed, 33 insertions(+), 84 deletions(-) diff --git a/kernel/cobalt/posix/cond.c b/kernel/cobalt/posix/cond.c index 549a871..758444b 100644 --- a/kernel/cobalt/posix/cond.c +++ b/kernel/cobalt/posix/cond.c @@ -23,32 +23,6 @@ #include clock.h #include trace/events/cobalt-posix.h -static inline void -cond_destroy_internal(xnhandle_t handle) -{ - struct cobalt_cond *cond; - spl_t s; - - xnlock_get_irqsave(nklock, s); - cond = xnregistry_lookup(handle, NULL); - if (!cobalt_obj_active(cond, COBALT_COND_MAGIC, typeof(*cond))) { - xnlock_put_irqrestore(nklock, s); - return; - } - xnregistry_remove(handle); - list_del(cond-link); - /* -* At this point, synchbase wait queue is empty, so we don't -* have to reschedule. -*/ - xnsynch_destroy(cond-synchbase); - cobalt_mark_deleted(cond); - xnlock_put_irqrestore(nklock, s); - cobalt_umm_free(cobalt_ppd_get(cond-attr.pshared)-umm, - cond-state); - xnfree(cond); -} - static inline int pthread_cond_init(struct cobalt_cond_shadow *cnd, const struct cobalt_condattr *attr) { @@ -76,42 +50,27 @@ pthread_cond_init(struct cobalt_cond_shadow *cnd, const struct cobalt_condattr * xnlock_get_irqsave(nklock, s); condq = cobalt_current_resources(attr-pshared)-condq; - - /* -* We allow reinitializing a shared condvar. Rationale: since -* a condvar is inherently anonymous, if the process creating -* such condvar exits, we may assume that other processes -* sharing that condvar won't be able to keep on running. -*/ - if (cnd-magic != COBALT_COND_MAGIC || list_empty(condq)) - goto do_init; - - old_cond = xnregistry_lookup(cnd-handle, NULL); - if (!cobalt_obj_active(old_cond, COBALT_COND_MAGIC, typeof(*old_cond))) - goto do_init; - - if (attr-pshared == 0) { - ret = -EBUSY; - goto fail_register; + if (cnd-magic == COBALT_COND_MAGIC !list_empty(condq)) { + old_cond = xnregistry_lookup(cnd-handle, NULL); + if (cobalt_obj_active(old_cond, COBALT_COND_MAGIC, + typeof(*old_cond))) { + ret = -EBUSY; + goto fail_register; + } } - xnlock_put_irqrestore(nklock, s); - cond_destroy_internal(cnd-handle); - xnlock_get_irqsave(nklock, s); -do_init: - ret = xnregistry_enter_anon(cond, cond-handle); + + ret = xnregistry_enter_anon(cond, cond-resnode.handle); if (ret 0) goto fail_register; - if (attr-pshared) - cond-handle |= XNSYNCH_PSHARED; + cond-resnode.handle |= XNSYNCH_PSHARED; cond-magic = COBALT_COND_MAGIC; xnsynch_init(cond-synchbase, synch_flags, NULL); cond-attr = *attr; cond-mutex = NULL; - cond-scope = cobalt_current_resources(attr-pshared); - list_add_tail(cond-link, condq); + cobalt_add_resource(cond-resnode, cond, attr-pshared); - cnd-handle = cond-handle; + cnd-handle = cond-resnode.handle; cnd-state_offset = cobalt_umm_offset(sys_ppd-umm, state); cnd-magic = COBALT_COND_MAGIC; @@ -130,7 +89,6 @@ fail_umm: static inline int pthread_cond_destroy(struct cobalt_cond_shadow *cnd) { struct cobalt_cond *cond; - int pshared; spl_t s; xnlock_get_irqsave(nklock, s); @@ -146,7 +104,8 @@ static inline int pthread_cond_destroy(struct cobalt_cond_shadow *cnd) return -EINVAL; } - if (cond-scope != cobalt_current_resources(cond-attr.pshared)) { + if (cond-resnode.scope != + cobalt_current_resources(cond-attr.pshared)) { xnlock_put_irqrestore(nklock, s); return -EPERM; } @@ -156,11 +115,7 @@ static inline int pthread_cond_destroy(struct cobalt_cond_shadow *cnd) return -EBUSY; } - cobalt_mark_deleted(cnd); - pshared = cond-attr.pshared; - xnlock_put_irqrestore(nklock, s); - - cond_destroy_internal(cnd-handle); + cobalt_cond_reclaim(cond-resnode, s); /* drops lock */ return 0; } @@ -183,7 +138,8 @@ static inline int cobalt_cond_timedwait_prologue(struct xnthread *cur, } #if XENO_DEBUG(USER) - if (cond-scope
[Xenomai-git] Philippe Gerum : lib/cobalt: control auto-shadowing via __cobalt_no_shadow
Module: xenomai-3 Branch: master Commit: c1142d014320ada49b8fe5a255f2a4c43fd811e1 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=c1142d014320ada49b8fe5a255f2a4c43fd811e1 Author: Philippe Gerum r...@xenomai.org Date: Sat Feb 14 16:37:44 2015 +0100 lib/cobalt: control auto-shadowing via __cobalt_no_shadow --- include/cobalt/sys/cobalt.h |2 ++ lib/cobalt/init.c |5 + 2 files changed, 7 insertions(+) diff --git a/include/cobalt/sys/cobalt.h b/include/cobalt/sys/cobalt.h index 6a0aa3c..bd2dd36 100644 --- a/include/cobalt/sys/cobalt.h +++ b/include/cobalt/sys/cobalt.h @@ -141,6 +141,8 @@ void __libcobalt_init(void); extern int __cobalt_defer_init; +extern int __cobalt_no_shadow; + extern int __cobalt_main_prio; extern int __cobalt_print_bufsz; diff --git a/lib/cobalt/init.c b/lib/cobalt/init.c index b31d0d1..178e807 100644 --- a/lib/cobalt/init.c +++ b/lib/cobalt/init.c @@ -45,6 +45,8 @@ __weak int __cobalt_defer_init = 0; +__weak int __cobalt_no_shadow = 0; + __weak int __cobalt_main_prio = -1; struct sigaction __cobalt_orig_sigdebug; @@ -211,6 +213,9 @@ static __libcobalt_ctor void __init_cobalt(void) __libcobalt_init(); + if (__cobalt_no_shadow) + return; + p = getenv(XENO_NOSHADOW); if (p *p) return; ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : copperplate/registry: fix build issue with non-wrapped symbol
Module: xenomai-3 Branch: master Commit: 7fc9a3edd2ec7b6d7ea1ae52e7b6731c1a2b2091 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=7fc9a3edd2ec7b6d7ea1ae52e7b6731c1a2b2091 Author: Philippe Gerum r...@xenomai.org Date: Tue Mar 24 11:01:26 2015 +0100 copperplate/registry: fix build issue with non-wrapped symbol --- lib/copperplate/registry.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/copperplate/registry.c b/lib/copperplate/registry.c index 8c7354a..46a2f4e 100644 --- a/lib/copperplate/registry.c +++ b/lib/copperplate/registry.c @@ -680,7 +680,7 @@ static int spawn_daemon(const char *sessdir, int flags) * Make sure we sleep at least 200 ms regardless of * signal receipts. */ - while (__STD(usleep(20)) 0) ; + while (usleep(20) 0) ; regd_pid = pid; barrier(); sa.sa_handler = sigchld_handler; ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Jan Kiszka : cobalt/posix: Add support for return long values from syscalls
Module: xenomai-3 Branch: master Commit: fd14a3a3443aa4d71a5c0937e11020875a4246c4 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=fd14a3a3443aa4d71a5c0937e11020875a4246c4 Author: Jan Kiszka jan.kis...@siemens.com Date: Thu Feb 12 18:29:12 2015 +0100 cobalt/posix: Add support for return long values from syscalls So far, handle_head/root_syscall limited to width of return values to int, thus 32-bit. This was waiting to break, and it did over the rework of the mayday syscall which now passed a pointer back. But also I/O syscalls were vulnerable on 64-bit platforms, at least in principle. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- kernel/cobalt/arch/arm/include/asm/xenomai/syscall.h |2 +- kernel/cobalt/arch/blackfin/include/asm/xenomai/syscall.h |2 +- kernel/cobalt/arch/nios2/include/asm/xenomai/syscall.h|2 +- kernel/cobalt/arch/powerpc/include/asm/xenomai/syscall.h |2 +- kernel/cobalt/arch/sh/include/asm/xenomai/syscall.h |2 +- kernel/cobalt/arch/x86/include/asm/xenomai/syscall.h |2 +- kernel/cobalt/posix/syscall.c |6 -- 7 files changed, 10 insertions(+), 8 deletions(-) diff --git a/kernel/cobalt/arch/arm/include/asm/xenomai/syscall.h b/kernel/cobalt/arch/arm/include/asm/xenomai/syscall.h index fec3c59..d80df77 100644 --- a/kernel/cobalt/arch/arm/include/asm/xenomai/syscall.h +++ b/kernel/cobalt/arch/arm/include/asm/xenomai/syscall.h @@ -57,7 +57,7 @@ static inline void __xn_error_return(struct pt_regs *regs, int v) __xn_reg_rval(regs) = v; } -static inline void __xn_status_return(struct pt_regs *regs, int v) +static inline void __xn_status_return(struct pt_regs *regs, long v) { __xn_reg_rval(regs) = v; } diff --git a/kernel/cobalt/arch/blackfin/include/asm/xenomai/syscall.h b/kernel/cobalt/arch/blackfin/include/asm/xenomai/syscall.h index e0fc958..12760a1 100644 --- a/kernel/cobalt/arch/blackfin/include/asm/xenomai/syscall.h +++ b/kernel/cobalt/arch/blackfin/include/asm/xenomai/syscall.h @@ -39,7 +39,7 @@ static inline void __xn_error_return(struct pt_regs *regs, int v) __xn_reg_rval(regs) = v; } -static inline void __xn_status_return(struct pt_regs *regs, int v) +static inline void __xn_status_return(struct pt_regs *regs, long v) { __xn_reg_rval(regs) = v; } diff --git a/kernel/cobalt/arch/nios2/include/asm/xenomai/syscall.h b/kernel/cobalt/arch/nios2/include/asm/xenomai/syscall.h index e226ddc..c329dc3 100644 --- a/kernel/cobalt/arch/nios2/include/asm/xenomai/syscall.h +++ b/kernel/cobalt/arch/nios2/include/asm/xenomai/syscall.h @@ -42,7 +42,7 @@ static inline void __xn_error_return(struct pt_regs *regs, int v) __xn_reg_rval(regs) = v; } -static inline void __xn_status_return(struct pt_regs *regs, int v) +static inline void __xn_status_return(struct pt_regs *regs, long v) { __xn_reg_rval(regs) = v; } diff --git a/kernel/cobalt/arch/powerpc/include/asm/xenomai/syscall.h b/kernel/cobalt/arch/powerpc/include/asm/xenomai/syscall.h index 5cfe49c..a0e6103 100644 --- a/kernel/cobalt/arch/powerpc/include/asm/xenomai/syscall.h +++ b/kernel/cobalt/arch/powerpc/include/asm/xenomai/syscall.h @@ -48,7 +48,7 @@ static inline void __xn_error_return(struct pt_regs *regs, int v) __xn_reg_rval(regs) = v; } -static inline void __xn_status_return(struct pt_regs *regs, int v) +static inline void __xn_status_return(struct pt_regs *regs, long v) { __xn_reg_rval(regs) = v; } diff --git a/kernel/cobalt/arch/sh/include/asm/xenomai/syscall.h b/kernel/cobalt/arch/sh/include/asm/xenomai/syscall.h index 74809e0..b84fb24 100644 --- a/kernel/cobalt/arch/sh/include/asm/xenomai/syscall.h +++ b/kernel/cobalt/arch/sh/include/asm/xenomai/syscall.h @@ -39,7 +39,7 @@ static inline void __xn_error_return(struct pt_regs *regs, int v) __xn_reg_rval(regs) = v; } -static inline void __xn_status_return(struct pt_regs *regs, int v) +static inline void __xn_status_return(struct pt_regs *regs, long v) { __xn_reg_rval(regs) = v; } diff --git a/kernel/cobalt/arch/x86/include/asm/xenomai/syscall.h b/kernel/cobalt/arch/x86/include/asm/xenomai/syscall.h index b9eea7a..018e348 100644 --- a/kernel/cobalt/arch/x86/include/asm/xenomai/syscall.h +++ b/kernel/cobalt/arch/x86/include/asm/xenomai/syscall.h @@ -54,7 +54,7 @@ static inline void __xn_error_return(struct pt_regs *regs, int v) __xn_reg_rval(regs) = v; } -static inline void __xn_status_return(struct pt_regs *regs, int v) +static inline void __xn_status_return(struct pt_regs *regs, long v) { __xn_reg_rval(regs) = v; } diff --git a/kernel/cobalt/posix/syscall.c b/kernel/cobalt/posix/syscall.c index 416e18f..9ad65e3 100644 --- a/kernel/cobalt/posix/syscall.c +++ b/kernel/cobalt/posix/syscall.c @@ -710,12 +710,13 @@ static const int cobalt_sysmodes[] = { static int handle_head_syscall(struct ipipe_domain *ipd, struct pt_regs *regs) { struct
[Xenomai-git] Philippe Gerum : build: auto-detect fortify support in libc unconditionally
Module: xenomai-3 Branch: master Commit: 2ab509f672d64ab1c2d9d8fa0a592b440bc29852 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=2ab509f672d64ab1c2d9d8fa0a592b440bc29852 Author: Philippe Gerum r...@xenomai.org Date: Fri Feb 20 09:55:50 2015 +0100 build: auto-detect fortify support in libc unconditionally --- configure|8 +++- configure.ac | 12 +--- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/configure b/configure index ea63a7a..b187729 100755 --- a/configure +++ b/configure @@ -14256,19 +14256,17 @@ fi { $as_echo $as_me:${as_lineno-$LINENO}: result: ${want_fortify:-autodetect} 5 $as_echo ${want_fortify:-autodetect} 6; } -if test x$want_fortify != xno; then - ac_fn_c_check_func $LINENO __vfprintf_chk ac_cv_func___vfprintf_chk +ac_fn_c_check_func $LINENO __vfprintf_chk ac_cv_func___vfprintf_chk if test x$ac_cv_func___vfprintf_chk = xyes; then : $as_echo #define CONFIG_XENO_FORTIFY 1 confdefs.h else if test x$want_fortify = xyes; then - as_fn_error $? Fortify support enabled but not available in *libc $LINENO 5 - fi + as_fn_error $? Fortify support enabled but not available in *libc $LINENO 5 + fi fi -fi XENO_USER_APP_CFLAGS=-D_GNU_SOURCE -D_REENTRANT XENO_USER_APP_LDFLAGS= diff --git a/configure.ac b/configure.ac index 429e7d5..79c121e 100644 --- a/configure.ac +++ b/configure.ac @@ -678,13 +678,11 @@ AC_ARG_ENABLE([fortify], *) want_fortify=no;; esac]) AC_MSG_RESULT(${want_fortify:-autodetect}) -if test x$want_fortify != xno; then - AC_CHECK_FUNC(__vfprintf_chk, - [AC_DEFINE(CONFIG_XENO_FORTIFY, 1,[config])], - [if test x$want_fortify = xyes; then - AC_MSG_ERROR([Fortify support enabled but not available in *libc]) - fi]) -fi +AC_CHECK_FUNC(__vfprintf_chk, + [AC_DEFINE(CONFIG_XENO_FORTIFY, 1,[config])], + [if test x$want_fortify = xyes; then + AC_MSG_ERROR([Fortify support enabled but not available in *libc]) + fi]) dnl Exported CFLAGS and LDFLAGS, shared with internal flags XENO_USER_APP_CFLAGS=-D_GNU_SOURCE -D_REENTRANT ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Jan Kiszka : cobalt: Remove unused __xn_success_return
Module: xenomai-3 Branch: master Commit: e9f6ceb770fabe4263d287ee0b86cd0151b2c915 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=e9f6ceb770fabe4263d287ee0b86cd0151b2c915 Author: Jan Kiszka jan.kis...@siemens.com Date: Thu Feb 12 18:21:09 2015 +0100 cobalt: Remove unused __xn_success_return Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- kernel/cobalt/arch/arm/include/asm/xenomai/syscall.h |5 - kernel/cobalt/arch/blackfin/include/asm/xenomai/syscall.h |5 - kernel/cobalt/arch/nios2/include/asm/xenomai/syscall.h|5 - kernel/cobalt/arch/powerpc/include/asm/xenomai/syscall.h |5 - kernel/cobalt/arch/sh/include/asm/xenomai/syscall.h |5 - kernel/cobalt/arch/x86/include/asm/xenomai/syscall.h |5 - 6 files changed, 30 deletions(-) diff --git a/kernel/cobalt/arch/arm/include/asm/xenomai/syscall.h b/kernel/cobalt/arch/arm/include/asm/xenomai/syscall.h index a8022d2..fec3c59 100644 --- a/kernel/cobalt/arch/arm/include/asm/xenomai/syscall.h +++ b/kernel/cobalt/arch/arm/include/asm/xenomai/syscall.h @@ -52,11 +52,6 @@ #define __xn_reg_pc(__regs)((__regs)-ARM_ip) #define __xn_reg_sp(__regs)((__regs)-ARM_sp) -static inline void __xn_success_return(struct pt_regs *regs, int v) -{ - __xn_reg_rval(regs) = v; -} - static inline void __xn_error_return(struct pt_regs *regs, int v) { __xn_reg_rval(regs) = v; diff --git a/kernel/cobalt/arch/blackfin/include/asm/xenomai/syscall.h b/kernel/cobalt/arch/blackfin/include/asm/xenomai/syscall.h index 61e0ba3..e0fc958 100644 --- a/kernel/cobalt/arch/blackfin/include/asm/xenomai/syscall.h +++ b/kernel/cobalt/arch/blackfin/include/asm/xenomai/syscall.h @@ -34,11 +34,6 @@ #define __xn_reg_arg4(__regs) ((__regs)-r3) #define __xn_reg_arg5(__regs) ((__regs)-r4) -static inline void __xn_success_return(struct pt_regs *regs, int v) -{ - __xn_reg_rval(regs) = v; -} - static inline void __xn_error_return(struct pt_regs *regs, int v) { __xn_reg_rval(regs) = v; diff --git a/kernel/cobalt/arch/nios2/include/asm/xenomai/syscall.h b/kernel/cobalt/arch/nios2/include/asm/xenomai/syscall.h index cef7b4b..e226ddc 100644 --- a/kernel/cobalt/arch/nios2/include/asm/xenomai/syscall.h +++ b/kernel/cobalt/arch/nios2/include/asm/xenomai/syscall.h @@ -37,11 +37,6 @@ #define __xn_reg_pc(__regs)((__regs)-ea) #define __xn_reg_sp(__regs)((__regs)-sp) -static inline void __xn_success_return(struct pt_regs *regs, int v) -{ - __xn_reg_rval(regs) = v; -} - static inline void __xn_error_return(struct pt_regs *regs, int v) { __xn_reg_rval(regs) = v; diff --git a/kernel/cobalt/arch/powerpc/include/asm/xenomai/syscall.h b/kernel/cobalt/arch/powerpc/include/asm/xenomai/syscall.h index b00cd12..5cfe49c 100644 --- a/kernel/cobalt/arch/powerpc/include/asm/xenomai/syscall.h +++ b/kernel/cobalt/arch/powerpc/include/asm/xenomai/syscall.h @@ -39,11 +39,6 @@ #define __xn_reg_pc(__regs)((__regs)-nip) #define __xn_reg_sp(__regs)((__regs)-gpr[1]) -static inline void __xn_success_return(struct pt_regs *regs, int v) -{ - __xn_reg_rval(regs) = v; -} - static inline void __xn_error_return(struct pt_regs *regs, int v) { /* diff --git a/kernel/cobalt/arch/sh/include/asm/xenomai/syscall.h b/kernel/cobalt/arch/sh/include/asm/xenomai/syscall.h index 88c267f..74809e0 100644 --- a/kernel/cobalt/arch/sh/include/asm/xenomai/syscall.h +++ b/kernel/cobalt/arch/sh/include/asm/xenomai/syscall.h @@ -34,11 +34,6 @@ #define __xn_reg_arg4(__regs) ((__regs)-regs[7]) #define __xn_reg_arg5(__regs) ((__regs)-regs[0]) -static inline void __xn_success_return(struct pt_regs *regs, int v) -{ - __xn_reg_rval(regs) = v; -} - static inline void __xn_error_return(struct pt_regs *regs, int v) { __xn_reg_rval(regs) = v; diff --git a/kernel/cobalt/arch/x86/include/asm/xenomai/syscall.h b/kernel/cobalt/arch/x86/include/asm/xenomai/syscall.h index 5901e4d..b9eea7a 100644 --- a/kernel/cobalt/arch/x86/include/asm/xenomai/syscall.h +++ b/kernel/cobalt/arch/x86/include/asm/xenomai/syscall.h @@ -49,11 +49,6 @@ #define __xn_syscall(regs)(__xn_reg_sys(regs) ~__COBALT_SYSCALL_BIT) #endif -static inline void __xn_success_return(struct pt_regs *regs, int v) -{ - __xn_reg_rval(regs) = v; -} - static inline void __xn_error_return(struct pt_regs *regs, int v) { __xn_reg_rval(regs) = v; ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : drivers/serial/mpc52xx: fix build issue
Module: xenomai-3 Branch: master Commit: df37d86a8c5eab032c5890d7c69aab31200844a2 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=df37d86a8c5eab032c5890d7c69aab31200844a2 Author: Philippe Gerum r...@xenomai.org Date: Tue Feb 17 11:13:32 2015 +0100 drivers/serial/mpc52xx: fix build issue --- kernel/drivers/serial/mpc52xx_uart.c |1 + 1 file changed, 1 insertion(+) diff --git a/kernel/drivers/serial/mpc52xx_uart.c b/kernel/drivers/serial/mpc52xx_uart.c index 464afc7..a7b3579 100644 --- a/kernel/drivers/serial/mpc52xx_uart.c +++ b/kernel/drivers/serial/mpc52xx_uart.c @@ -20,6 +20,7 @@ #include linux/version.h #include linux/module.h #include linux/of.h +#include linux/slab.h #include linux/of_platform.h #include linux/io.h ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : alchemy: fix internal error handling
Module: xenomai-3 Branch: master Commit: e3ccc59ffb49661d1a21c9c637d320026069c73e URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=e3ccc59ffb49661d1a21c9c637d320026069c73e Author: Philippe Gerum r...@xenomai.org Date: Sat Mar 7 19:01:28 2015 +0100 alchemy: fix internal error handling --- lib/alchemy/task.c |7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/alchemy/task.c b/lib/alchemy/task.c index c9ec272..327e916 100644 --- a/lib/alchemy/task.c +++ b/lib/alchemy/task.c @@ -304,10 +304,9 @@ static int create_tcb(struct alchemy_task **tcbp, RT_TASK *task, warning(failed to export task %s to registry, %s, tcb-name, symerror(ret)); - if (syncluster_addobj(alchemy_task_table, tcb-name, tcb-cobj)) { - ret = -EEXIST; + ret = syncluster_addobj(alchemy_task_table, tcb-name, tcb-cobj); + if (ret) goto fail_register; - } if (task) task-handle = tcb-self.handle; @@ -320,7 +319,7 @@ fail_register: fail_threadinit: syncobj_uninit(tcb-sobj_msg); fail_syncinit: - delete_tcb(tcb); + threadobj_free(tcb-thobj); return ret; } ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : lib/cobalt: lock memory upon deferred init too
Module: xenomai-3 Branch: master Commit: 8c636eda4b9806ea0a3098981bee714b8a870cbe URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=8c636eda4b9806ea0a3098981bee714b8a870cbe Author: Philippe Gerum r...@xenomai.org Date: Sat Feb 14 11:27:48 2015 +0100 lib/cobalt: lock memory upon deferred init too --- lib/cobalt/init.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/cobalt/init.c b/lib/cobalt/init.c index b7c8f76..b31d0d1 100644 --- a/lib/cobalt/init.c +++ b/lib/cobalt/init.c @@ -66,6 +66,11 @@ static void low_init(void) struct cobalt_featinfo *f; int ret; + if (mlockall(MCL_CURRENT | MCL_FUTURE)) { + report_error(mlockall: %s, strerror(errno)); + exit(EXIT_FAILURE); + } + old_sigill_handler = signal(SIGILL, sigill_handler); if (old_sigill_handler == SIG_ERR) { report_error(signal(SIGILL): %s, strerror(errno)); @@ -210,11 +215,6 @@ static __libcobalt_ctor void __init_cobalt(void) if (p *p) return; - if (mlockall(MCL_CURRENT | MCL_FUTURE)) { - report_error(mlockall: %s, strerror(errno)); - exit(EXIT_FAILURE); - } - ret = __STD(pthread_getschedparam(ptid, policy, parm)); if (ret) { report_error(pthread_getschedparam: %s, strerror(ret)); ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : cobalt/posix: fix potential race when reclaiming global resources
Module: xenomai-3 Branch: next Commit: 0fd3db3b74ac9290ee0a3937ea609f8ae22326f6 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=0fd3db3b74ac9290ee0a3937ea609f8ae22326f6 Author: Philippe Gerum r...@xenomai.org Date: Tue Mar 24 16:14:01 2015 +0100 cobalt/posix: fix potential race when reclaiming global resources In theory, a Xenomai process on a different CPU might race with the reclaim code if it starts then exits while the global resources are being released on the current CPU. Unlikely, but possible though. Queue the global resources to be reclaimed from the exiting process to a local stash under nklock protection before cleaning them up. --- kernel/cobalt/posix/process.c | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/kernel/cobalt/posix/process.c b/kernel/cobalt/posix/process.c index c2d65f0..3fb644a 100644 --- a/kernel/cobalt/posix/process.c +++ b/kernel/cobalt/posix/process.c @@ -1368,8 +1368,9 @@ static void __reclaim_resource(struct cobalt_process *process, struct list_head *global) { struct cobalt_resnode *node, *tmp; + LIST_HEAD(stash); spl_t s; - + xnlock_get_irqsave(nklock, s); if (list_empty(global)) @@ -1377,17 +1378,24 @@ static void __reclaim_resource(struct cobalt_process *process, list_for_each_entry_safe(node, tmp, global, next) { if (node-owner == process) { - reclaim(node, s); /* drops lock */ - xnlock_get_irqsave(nklock, s); + list_del(node-next); + list_add(node-next, stash); } } + list_for_each_entry_safe(node, tmp, stash, next) { + reclaim(node, s); + xnlock_get_irqsave(nklock, s); + } + + XENO_BUG_ON(COBALT, !list_empty(stash)); + flush_local: if (list_empty(local)) goto out; list_for_each_entry_safe(node, tmp, local, next) { - reclaim(node, s); /* drops lock */ + reclaim(node, s); xnlock_get_irqsave(nklock, s); } out: ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : copperplate/registry: move anon sessions under the user tree
Module: xenomai-3 Branch: next Commit: 43d2a6fcb608aa078dd1736d84b560981153def0 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=43d2a6fcb608aa078dd1736d84b560981153def0 Author: Philippe Gerum r...@xenomai.org Date: Tue Mar 24 10:08:05 2015 +0100 copperplate/registry: move anon sessions under the user tree --- lib/copperplate/init.c | 24 ++-- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/lib/copperplate/init.c b/lib/copperplate/init.c index b5b7a36..f6e06d3 100644 --- a/lib/copperplate/init.c +++ b/lib/copperplate/init.c @@ -513,28 +513,24 @@ static int get_session_root(int *regflags_r) struct passwd *pw; int ret; + pw = getpwuid(geteuid()); + if (pw == NULL) + return -errno; + if (__node_info.session_label == NULL) { ret = asprintf(session, anon@%d, __node_id); if (ret 0) return -ENOMEM; __node_info.session_label = session; - ret = asprintf(sessdir, %s/%s, - __node_info.registry_root, session); - if (ret 0) - return -ENOMEM; *regflags_r |= REGISTRY_ANON; - } else { - pw = getpwuid(geteuid()); - if (pw == NULL) - return -errno; - - ret = asprintf(sessdir, %s/%s/%s, - __node_info.registry_root, - pw-pw_name, __node_info.session_label); - if (ret 0) - return -ENOMEM; } + ret = asprintf(sessdir, %s/%s/%s, + __node_info.registry_root, + pw-pw_name, __node_info.session_label); + if (ret 0) + return -ENOMEM; + __node_info.session_root = sessdir; return 0; ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : build: drop autoconf-generated files
Module: xenomai-3 Branch: next Commit: 3e7fe0083197b33e5002e4a59cd83cc04ad47416 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=3e7fe0083197b33e5002e4a59cd83cc04ad47416 Author: Philippe Gerum r...@xenomai.org Date: Mon Mar 23 16:58:14 2015 +0100 build: drop autoconf-generated files --- Makefile.in| 914 -- aclocal.m4 | 2262 --- config/Makefile.in | 491 - config/libtool.m4 | 7992 - config/ltmain.sh | 9655 --- config/ltoptions.m4| 384 - config/ltsugar.m4 | 123 - config/ltversion.m4| 23 - config/lt~obsolete.m4 | 98 - configure |17075 demo/Makefile.in | 661 - demo/alchemy/Makefile.in | 836 - demo/alchemy/cobalt/Makefile.in| 709 - demo/posix/Makefile.in | 826 - demo/posix/cobalt/Makefile.in | 891 - doc/Makefile.in| 674 - doc/asciidoc/Makefile.in | 699 - doc/doxygen/Makefile.in| 634 - doc/gitdoc/Makefile.in | 521 - include/Makefile.in| 776 - include/alchemy/Makefile.in| 616 - include/boilerplate/Makefile.in| 617 - include/cobalt/Makefile.in | 742 - include/cobalt/boilerplate/Makefile.in | 609 - include/cobalt/kernel/Makefile.in | 701 - include/cobalt/kernel/rtdm/Makefile.in | 677 - include/cobalt/kernel/rtdm/analogy/Makefile.in | 560 - include/cobalt/sys/Makefile.in | 611 - include/cobalt/uapi/Makefile.in| 731 - include/cobalt/uapi/asm-generic/Makefile.in| 553 - include/cobalt/uapi/kernel/Makefile.in | 613 - include/copperplate/Makefile.in| 621 - include/mercury/Makefile.in| 665 - include/mercury/boilerplate/Makefile.in| 609 - include/psos/Makefile.in | 603 - include/rtdm/Makefile.in | 727 - include/rtdm/uapi/Makefile.in | 612 - include/smokey/Makefile.in | 603 - include/trank/Makefile.in | 721 - include/trank/native/Makefile.in | 617 - include/trank/posix/Makefile.in| 603 - include/trank/rtdm/Makefile.in | 609 - include/vxworks/Makefile.in| 618 - include/xeno_config.h.in | 235 - lib/Makefile.in| 677 - lib/alchemy/Makefile.in| 824 - lib/analogy/Makefile.in| 779 - lib/boilerplate/Makefile.in| 810 - lib/cobalt/Makefile.in | 1045 -- lib/cobalt/arch/Makefile.in| 661 - lib/cobalt/arch/arm/Makefile.in| 766 - lib/cobalt/arch/arm/include/Makefile.in| 661 - lib/cobalt/arch/arm/include/asm/Makefile.in| 661 - .../arch/arm/include/asm/xenomai/Makefile.in | 553 - lib/cobalt/arch/blackfin/Makefile.in | 766 - lib/cobalt/arch/blackfin/include/Makefile.in | 661 - lib/cobalt/arch/blackfin/include/asm/Makefile.in | 661 - .../arch/blackfin/include/asm/xenomai/Makefile.in | 553 - lib/cobalt/arch/nios2/Makefile.in | 766 - lib/cobalt/arch/nios2/include/Makefile.in | 661 - lib/cobalt/arch/nios2/include/asm/Makefile.in | 661 - .../arch/nios2/include/asm/xenomai/Makefile.in | 553 - lib/cobalt/arch/powerpc/Makefile.in| 766 - lib/cobalt/arch/powerpc/include/Makefile.in| 661 - lib/cobalt/arch/powerpc/include/asm/Makefile.in| 661 - .../arch/powerpc/include/asm/xenomai/Makefile.in | 553 - lib/cobalt/arch/sh/Makefile.in | 766 - lib/cobalt/arch/sh/include/Makefile.in | 661 - lib/cobalt/arch/sh/include/asm/Makefile.in | 661 - lib/cobalt/arch/sh/include/asm/xenomai/Makefile.in | 553 - lib/cobalt/arch/x86/Makefile.in| 766 - lib/cobalt/arch/x86/include/Makefile.in| 661 - lib/cobalt/arch/x86/include/asm/Makefile.in| 661 - .../arch/x86/include/asm/xenomai/Makefile.in | 553 - lib/copperplate/Makefile.in| 1134 -- lib/copperplate/regd/Makefile.in | 700 -
[Xenomai-git] Philippe Gerum : copperplate/heapobj: use per-process heap for anon sessions
Module: xenomai-3 Branch: next Commit: 84c257b632c44b90c9bcb792aded0f2da706f6b5 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=84c257b632c44b90c9bcb792aded0f2da706f6b5 Author: Philippe Gerum r...@xenomai.org Date: Sun Mar 22 19:21:29 2015 +0100 copperplate/heapobj: use per-process heap for anon sessions We have different lifetimes for Cobalt-managed POSIX objects such as mutexes and condvars, and Cobalt maintains dynamically allocated resources for them. Some POSIX objects are embedded into the session header for protecting sysgroups, and serializing allocation ops on the shared heap. Therefore, they must survive until the last process detaches from the anon session. Most other POSIX objects stored into the shared heap become virtually stale when the application exits and should be reclaimed automatically, so that we don't end up leaking kernel resources as processes come and go into the anon session. For the sake of simplicity, Cobalt reclaims shared POSIX objects upon exit of their respective creator, assuming that a multi-process application requires all involved processes to be present at any time, including the one which has initialized the resources. By using separate, per-process heaps for each instance of the anon session, we make sure that all POSIX resources can be reclaimed safely by Cobalt for any given session, upon application exit. --- include/copperplate/heapobj.h |7 +++ include/copperplate/registry.h| 12 +++-- lib/copperplate/heapobj-pshared.c | 39 lib/copperplate/init.c| 38 ++-- lib/copperplate/internal.h|3 +- lib/copperplate/regd/regd.c | 65 -- lib/copperplate/registry.c| 42 ++--- scripts/Makefile.am |1 - scripts/xeno-multiuser| 91 - 9 files changed, 136 insertions(+), 162 deletions(-) diff --git a/include/copperplate/heapobj.h b/include/copperplate/heapobj.h index c92e581..b628ea4 100644 --- a/include/copperplate/heapobj.h +++ b/include/copperplate/heapobj.h @@ -310,6 +310,8 @@ int heapobj_bind_session(const char *session); void heapobj_unbind_session(void); +int heapobj_unlink_session(const char *session); + void *xnmalloc(size_t size); void xnfree(void *ptr); @@ -425,6 +427,11 @@ static inline int heapobj_bind_session(const char *session) return -ENOSYS; } +static inline int heapobj_unlink_session(const char *session) +{ + return 0; +} + static inline void heapobj_unbind_session(void) { } static inline void *xnmalloc(size_t size) diff --git a/include/copperplate/registry.h b/include/copperplate/registry.h index 903db4a..7b5fa4a 100644 --- a/include/copperplate/registry.h +++ b/include/copperplate/registry.h @@ -29,6 +29,9 @@ struct fsobj; +#define REGISTRY_SHARED 1 +#define REGISTRY_ANON2 + #ifdef CONFIG_XENO_REGISTRY struct registry_operations { @@ -76,9 +79,12 @@ void registry_destroy_file(struct fsobj *fsobj); void registry_touch_file(struct fsobj *fsobj); -int __registry_pkg_init(const char *arg0, char *mountpt, int shared_registry); +int __registry_pkg_init(const char *arg0, + char *mountpt, + int flags); -int registry_pkg_init(const char *arg0); +int registry_pkg_init(const char *arg0, + int flags); void registry_pkg_destroy(void); @@ -126,7 +132,7 @@ void registry_touch_file(struct fsobj *fsobj) } static inline -int __registry_pkg_init(const char *arg0, char *mountpt, int shared_registry) +int __registry_pkg_init(const char *arg0, char *mountpt, int flags) { return 0; } diff --git a/lib/copperplate/heapobj-pshared.c b/lib/copperplate/heapobj-pshared.c index 20b5b44..88c0e21 100644 --- a/lib/copperplate/heapobj-pshared.c +++ b/lib/copperplate/heapobj-pshared.c @@ -33,6 +33,7 @@ #include unistd.h #include signal.h #include fcntl.h +#include malloc.h #include unistd.h #include boilerplate/list.h #include boilerplate/hash.h @@ -622,7 +623,7 @@ static int create_main_heap(pid_t *cnode_r) * Otherwise, create the heap for the new emerging session and * bind to it. */ - snprintf(hobj-name, sizeof(hobj-name), %s.main-heap, session); + snprintf(hobj-name, sizeof(hobj-name), %s.heap, session); snprintf(hobj-fsname, sizeof(hobj-fsname), /xeno:%s, hobj-name); fd = shm_open(hobj-fsname, O_RDWR|O_CREAT, 0600); @@ -708,13 +709,13 @@ static int bind_main_heap(const char *session) { struct heapobj *hobj = main_pool; struct session_heap *m_heap; + int ret, fd, cpid; struct stat sbuf; memoff_t len; - int ret, fd; /* No error tracking, this is for internal users. */ - snprintf(hobj-name, sizeof(hobj-name), %s.main-heap, session); + snprintf(hobj-name, sizeof(hobj-name), %s.heap, session);
[Xenomai-git] Philippe Gerum : copperplate/registry: disambiguate socket usage
Module: xenomai-3 Branch: next Commit: 1329ff3537fcd67a624cdba88d916304a689b0c7 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=1329ff3537fcd67a624cdba88d916304a689b0c7 Author: Philippe Gerum r...@xenomai.org Date: Mon Mar 23 15:23:12 2015 +0100 copperplate/registry: disambiguate socket usage --- lib/copperplate/registry.c |8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/copperplate/registry.c b/lib/copperplate/registry.c index 26b777b..8c7354a 100644 --- a/lib/copperplate/registry.c +++ b/lib/copperplate/registry.c @@ -714,19 +714,19 @@ static int connect_regd(const char *sessdir, char **mountpt, int flags) sun.sun_path[0] = '\0'; for (retries = 0; retries 3; retries++) { - s = socket(AF_UNIX, SOCK_SEQPACKET, 0); + s = __STD(socket(AF_UNIX, SOCK_SEQPACKET, 0)); if (s 0) { ret = -errno; free(*mountpt); return ret; } - ret = connect(s, (struct sockaddr *)sun, addrlen); + ret = __STD(connect(s, (struct sockaddr *)sun, addrlen)); if (ret == 0) { - ret = recv(s, *mountpt, PATH_MAX, 0); + ret = __STD(recv(s, *mountpt, PATH_MAX, 0)); if (ret 0) return 0; } - close(s); + __STD(close(s)); ret = spawn_daemon(sessdir, flags); if (ret) break; ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Gilles Chanteperdrix : rtnet: forbid built-in rtnet
Module: xenomai-gch Branch: for-forge Commit: 64ddeb9739f097838d23898f287e77a4083478e9 URL: http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=64ddeb9739f097838d23898f287e77a4083478e9 Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org Date: Tue Mar 24 18:54:53 2015 +0100 rtnet: forbid built-in rtnet --- kernel/drivers/net/Kconfig |1 + 1 file changed, 1 insertion(+) diff --git a/kernel/drivers/net/Kconfig b/kernel/drivers/net/Kconfig index ef62b3b..6e63437 100644 --- a/kernel/drivers/net/Kconfig +++ b/kernel/drivers/net/Kconfig @@ -1,6 +1,7 @@ menu RTnet config XENO_DRIVERS_NET + depends on m select NET tristate RTnet, TCP/IP socket interface ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Gilles Chanteperdrix : Remove more generated files
Module: xenomai-gch Branch: for-forge Commit: feb0b457aafa95e68330183c5ac3cca9994733d7 URL: http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=feb0b457aafa95e68330183c5ac3cca9994733d7 Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org Date: Tue Mar 24 18:42:37 2015 +0100 Remove more generated files --- config/compile | 347 -- config/config.guess | 1420 config/config.sub | 1798 --- config/depcomp | 791 -- config/install-sh | 527 --- config/missing | 215 -- 6 files changed, 5098 deletions(-) diff --git a/config/compile b/config/compile deleted file mode 100755 index 531136b..000 --- a/config/compile +++ /dev/null @@ -1,347 +0,0 @@ -#! /bin/sh -# Wrapper for compilers which do not understand '-c -o'. - -scriptversion=2012-10-14.11; # UTC - -# Copyright (C) 1999-2013 Free Software Foundation, Inc. -# Written by Tom Tromey tro...@cygnus.com. -# -# This program 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, or (at your option) -# any later version. -# -# This program 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 this program. If not, see http://www.gnu.org/licenses/. - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# This file is maintained in Automake, please report -# bugs to bug-autom...@gnu.org or send patches to -# automake-patc...@gnu.org. - -nl=' -' - -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent tools from complaining about whitespace usage. -IFS=$nl - -file_conv= - -# func_file_conv build_file lazy -# Convert a $build file to $host form and store it in $file -# Currently only supports Windows hosts. If the determined conversion -# type is listed in (the comma separated) LAZY, no conversion will -# take place. -func_file_conv () -{ - file=$1 - case $file in -/ | /[!/]*) # absolute file, and not a UNC file - if test -z $file_conv; then - # lazily determine how to convert abs files - case `uname -s` in - MINGW*) - file_conv=mingw - ;; - CYGWIN*) - file_conv=cygwin - ;; - *) - file_conv=wine - ;; - esac - fi - case $file_conv/,$2, in - *,$file_conv,*) - ;; - mingw/*) - file=`cmd //C echo $file | sed -e 's/\(.*\) *$/\1/'` - ;; - cygwin/*) - file=`cygpath -m $file || echo $file` - ;; - wine/*) - file=`winepath -w $file || echo $file` - ;; - esac - ;; - esac -} - -# func_cl_dashL linkdir -# Make cl look for libraries in LINKDIR -func_cl_dashL () -{ - func_file_conv $1 - if test -z $lib_path; then -lib_path=$file - else -lib_path=$lib_path;$file - fi - linker_opts=$linker_opts -LIBPATH:$file -} - -# func_cl_dashl library -# Do a library search-path lookup for cl -func_cl_dashl () -{ - lib=$1 - found=no - save_IFS=$IFS - IFS=';' - for dir in $lib_path $LIB - do -IFS=$save_IFS -if $shared test -f $dir/$lib.dll.lib; then - found=yes - lib=$dir/$lib.dll.lib - break -fi -if test -f $dir/$lib.lib; then - found=yes - lib=$dir/$lib.lib - break -fi -if test -f $dir/lib$lib.a; then - found=yes - lib=$dir/lib$lib.a - break -fi - done - IFS=$save_IFS - - if test $found != yes; then -lib=$lib.lib - fi -} - -# func_cl_wrapper cl arg... -# Adjust compile command to suit cl -func_cl_wrapper () -{ - # Assume a capable shell - lib_path= - shared=: - linker_opts= - for arg - do -if test -n $eat; then - eat= -else - case $1 in - -o) - # configure might choose to run compile as 'compile cc -o foo foo.c'. - eat=1 - case $2 in - *.o | *.[oO][bB][jJ]) - func_file_conv $2 - set x $@ -Fo$file - shift - ;; - *) - func_file_conv $2 - set x $@ -Fe$file - shift - ;; - esac - ;; - -I) - eat=1 - func_file_conv $2 mingw - set x $@ -I$file - shift - ;; - -I*) - func_file_conv ${1#-I} mingw - set x $@ -I$file -
[Xenomai-git] Philippe Gerum : boilerplate/ancillaries: fix off-by-one index in name generator
Module: xenomai-3 Branch: next Commit: 2eea62199365bd9bba7bbace9917a54a6ad684f5 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=2eea62199365bd9bba7bbace9917a54a6ad684f5 Author: Philippe Gerum r...@xenomai.org Date: Tue Mar 24 18:29:09 2015 +0100 boilerplate/ancillaries: fix off-by-one index in name generator --- include/boilerplate/ancillaries.h |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boilerplate/ancillaries.h b/include/boilerplate/ancillaries.h index 8f80ba7..5532a83 100644 --- a/include/boilerplate/ancillaries.h +++ b/include/boilerplate/ancillaries.h @@ -43,7 +43,7 @@ struct name_generator { struct name_generator __name = {\ .radix = __radix, \ .length = sizeof ((__type *)0)-__member, \ - .serial = ATOMIC_INIT(1), \ + .serial = ATOMIC_INIT(0), \ } #define ONE_BILLION 10 ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : psos/task: use name generator for anon tasks
Module: xenomai-3 Branch: next Commit: 1c6195a48b9dce928a9665dc8e40885b9d935217 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=1c6195a48b9dce928a9665dc8e40885b9d935217 Author: Philippe Gerum r...@xenomai.org Date: Tue Mar 24 18:29:46 2015 +0100 psos/task: use name generator for anon tasks --- lib/psos/task.c |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/psos/task.c b/lib/psos/task.c index ea122c0..a8a53a7 100644 --- a/lib/psos/task.c +++ b/lib/psos/task.c @@ -45,7 +45,8 @@ union psos_wait_union { struct cluster psos_task_table; -static unsigned long anon_tids; +static DEFINE_NAME_GENERATOR(task_namegen, task, +struct psos_task, name); static struct psos_task *find_psos_task(u_long tid, int *err_r) { @@ -297,7 +298,7 @@ u_long t_create(const char *name, u_long prio, } if (name == NULL || *name == '\0') - sprintf(task-name, t%lu, ++anon_tids); + generate_name(task-name, name, task_namegen); else { name = __psos_maybe_short_name(short_name, name); namecpy(task-name, name); ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : vxworks/task: use name generator for anon tasks
Module: xenomai-3 Branch: next Commit: f84438b273aed9cf10284b5f090199dd913d9dd0 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=f84438b273aed9cf10284b5f090199dd913d9dd0 Author: Philippe Gerum r...@xenomai.org Date: Tue Mar 24 18:29:55 2015 +0100 vxworks/task: use name generator for anon tasks --- lib/vxworks/taskLib.c |8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/vxworks/taskLib.c b/lib/vxworks/taskLib.c index 6492d62..ddb7df6 100644 --- a/lib/vxworks/taskLib.c +++ b/lib/vxworks/taskLib.c @@ -49,7 +49,8 @@ pthread_mutex_t wind_task_lock; int wind_time_slice = 0; -static unsigned long anon_tids; +static DEFINE_NAME_GENERATOR(task_namegen, task, +struct wind_task, name); static struct wind_task *find_wind_task(TASK_ID tid) { @@ -349,10 +350,7 @@ static STATUS __taskInit(struct wind_task *task, tcb-flags = flags; tcb-entry = entry; - if (name == NULL || *name == '\0') - sprintf(task-name, t%lu, ++anon_tids); - else - namecpy(task-name, name); + generate_name(task-name, name, task_namegen); idata.magic = task_magic; idata.finalizer = task_finalizer; ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Gilles Chanteperdrix : cobalt/mutex, cond: allow static initializer
Module: xenomai-gch Branch: for-forge Commit: 1d5f60351dd45a19acc7942d8efa1c22567ba885 URL: http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=1d5f60351dd45a19acc7942d8efa1c22567ba885 Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org Date: Tue Mar 24 20:40:13 2015 +0100 cobalt/mutex,cond: allow static initializer By initializing the mutex or condvar on first access --- lib/cobalt/cond.c | 58 +++- lib/cobalt/mutex.c | 62 +++- 2 files changed, 109 insertions(+), 11 deletions(-) diff --git a/lib/cobalt/cond.c b/lib/cobalt/cond.c index 70a97fd..ba1fada 100644 --- a/lib/cobalt/cond.c +++ b/lib/cobalt/cond.c @@ -16,6 +16,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #include errno.h +#include string.h #include pthread.h #include asm/xenomai/syscall.h #include current.h @@ -189,6 +190,17 @@ static void __pthread_cond_cleanup(void *data) c-mutex-lockcnt = c-count; } +static int __attribute__((cold)) cobalt_cond_autoinit(pthread_cond_t *cond) +{ + static pthread_cond_t uninit_cond = PTHREAD_COND_INITIALIZER; + + if (memcmp(cond, uninit_cond, sizeof(*cond))) + return EINVAL; + + return __COBALT(pthread_cond_init(cond, NULL)); +} + + /** * Wait on a condition variable. * @@ -248,10 +260,13 @@ COBALT_IMPL(int, pthread_cond_wait, (pthread_cond_t *cond, pthread_mutex_t *mute int err, oldtype; unsigned count; - if (_mx-magic != COBALT_MUTEX_MAGIC - || _cnd-magic != COBALT_COND_MAGIC) + if (_mx-magic != COBALT_MUTEX_MAGIC) return EINVAL; + if (_cnd-magic != COBALT_COND_MAGIC) + goto autoinit; + + cont: if (_mx-attr.type == PTHREAD_MUTEX_ERRORCHECK) { xnhandle_t cur = cobalt_get_current(); @@ -283,6 +298,12 @@ COBALT_IMPL(int, pthread_cond_wait, (pthread_cond_t *cond, pthread_mutex_t *mute pthread_testcancel(); return -err ?: -c.err; + + autoinit: + err = cobalt_cond_autoinit(cond); + if (err) + return err; + goto cont; } /** @@ -333,10 +354,13 @@ COBALT_IMPL(int, pthread_cond_timedwait, (pthread_cond_t *cond, int err, oldtype; unsigned count; - if (_mx-magic != COBALT_MUTEX_MAGIC - || _cnd-magic != COBALT_COND_MAGIC) + if (_mx-magic != COBALT_MUTEX_MAGIC) return EINVAL; + if (_cnd-magic != COBALT_COND_MAGIC) + goto autoinit; + + cont: if (_mx-attr.type == PTHREAD_MUTEX_ERRORCHECK) { xnhandle_t cur = cobalt_get_current(); @@ -367,6 +391,12 @@ COBALT_IMPL(int, pthread_cond_timedwait, (pthread_cond_t *cond, pthread_testcancel(); return -err ?: -c.err; + + autoinit: + err = cobalt_cond_autoinit(cond); + if (err) + return err; + goto cont; } /** @@ -398,10 +428,12 @@ COBALT_IMPL(int, pthread_cond_signal, (pthread_cond_t *cond)) __u32 pending_signals; xnhandle_t cur; __u32 flags; + int err; if (_cnd-magic != COBALT_COND_MAGIC) - return EINVAL; + goto autoinit; + cont: mutex_state = get_mutex_state(_cnd); if (mutex_state == NULL) return 0; /* Fast path, no waiter. */ @@ -422,6 +454,12 @@ COBALT_IMPL(int, pthread_cond_signal, (pthread_cond_t *cond)) cond_state-pending_signals = pending_signals + 1; return 0; + + autoinit: + err = cobalt_cond_autoinit(cond); + if (err) + return err; + goto cont; } /** @@ -449,10 +487,12 @@ COBALT_IMPL(int, pthread_cond_broadcast, (pthread_cond_t *cond)) struct cobalt_cond_state *cond_state; xnhandle_t cur; __u32 flags; + int err; if (_cnd-magic != COBALT_COND_MAGIC) - return EINVAL; + goto autoinit; + cont: mutex_state = get_mutex_state(_cnd); if (mutex_state == NULL) return 0; @@ -471,6 +511,12 @@ COBALT_IMPL(int, pthread_cond_broadcast, (pthread_cond_t *cond)) cond_state-pending_signals = ~0U; return 0; + + autoinit: + err = cobalt_cond_autoinit(cond); + if (err) + return err; + goto cont; } /** diff --git a/lib/cobalt/mutex.c b/lib/cobalt/mutex.c index 93a9bbc..b84a582 100644 --- a/lib/cobalt/mutex.c +++ b/lib/cobalt/mutex.c @@ -16,8 +16,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #include errno.h -#include pthread.h +#include string.h #include limits.h +#include pthread.h #include asm/xenomai/syscall.h #include current.h #include internal.h @@ -170,6 +171,29 @@ COBALT_IMPL(int, pthread_mutex_destroy, (pthread_mutex_t *mutex)) return -err; } +static int
[Xenomai-git] Philippe Gerum : build: drop autoconf-generated files
Module: xenomai-3 Branch: next Commit: 2118b72aca6b73efeb9e5c6efa41b99bfd3d9088 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=2118b72aca6b73efeb9e5c6efa41b99bfd3d9088 Author: Philippe Gerum r...@xenomai.org Date: Mon Mar 23 16:58:14 2015 +0100 build: drop autoconf-generated files --- Makefile.in| 914 -- aclocal.m4 | 2262 --- config/Makefile.in | 491 - config/libtool.m4 | 7992 - config/ltmain.sh | 9655 --- config/ltoptions.m4| 384 - config/ltsugar.m4 | 123 - config/ltversion.m4| 23 - config/lt~obsolete.m4 | 98 - configure |17075 demo/Makefile.in | 661 - demo/alchemy/Makefile.in | 836 - demo/alchemy/cobalt/Makefile.in| 709 - demo/posix/Makefile.in | 826 - demo/posix/cobalt/Makefile.in | 891 - doc/Makefile.in| 674 - doc/asciidoc/Makefile.in | 699 - doc/doxygen/Makefile.in| 634 - doc/gitdoc/Makefile.in | 521 - include/Makefile.in| 776 - include/alchemy/Makefile.in| 616 - include/boilerplate/Makefile.in| 617 - include/cobalt/Makefile.in | 742 - include/cobalt/boilerplate/Makefile.in | 609 - include/cobalt/kernel/Makefile.in | 701 - include/cobalt/kernel/rtdm/Makefile.in | 677 - include/cobalt/kernel/rtdm/analogy/Makefile.in | 560 - include/cobalt/sys/Makefile.in | 611 - include/cobalt/uapi/Makefile.in| 731 - include/cobalt/uapi/asm-generic/Makefile.in| 553 - include/cobalt/uapi/kernel/Makefile.in | 613 - include/copperplate/Makefile.in| 621 - include/mercury/Makefile.in| 665 - include/mercury/boilerplate/Makefile.in| 609 - include/psos/Makefile.in | 603 - include/rtdm/Makefile.in | 727 - include/rtdm/uapi/Makefile.in | 612 - include/smokey/Makefile.in | 603 - include/trank/Makefile.in | 721 - include/trank/native/Makefile.in | 617 - include/trank/posix/Makefile.in| 603 - include/trank/rtdm/Makefile.in | 609 - include/vxworks/Makefile.in| 618 - include/xeno_config.h.in | 235 - lib/Makefile.in| 677 - lib/alchemy/Makefile.in| 824 - lib/analogy/Makefile.in| 779 - lib/boilerplate/Makefile.in| 810 - lib/cobalt/Makefile.in | 1045 -- lib/cobalt/arch/Makefile.in| 661 - lib/cobalt/arch/arm/Makefile.in| 766 - lib/cobalt/arch/arm/include/Makefile.in| 661 - lib/cobalt/arch/arm/include/asm/Makefile.in| 661 - .../arch/arm/include/asm/xenomai/Makefile.in | 553 - lib/cobalt/arch/blackfin/Makefile.in | 766 - lib/cobalt/arch/blackfin/include/Makefile.in | 661 - lib/cobalt/arch/blackfin/include/asm/Makefile.in | 661 - .../arch/blackfin/include/asm/xenomai/Makefile.in | 553 - lib/cobalt/arch/nios2/Makefile.in | 766 - lib/cobalt/arch/nios2/include/Makefile.in | 661 - lib/cobalt/arch/nios2/include/asm/Makefile.in | 661 - .../arch/nios2/include/asm/xenomai/Makefile.in | 553 - lib/cobalt/arch/powerpc/Makefile.in| 766 - lib/cobalt/arch/powerpc/include/Makefile.in| 661 - lib/cobalt/arch/powerpc/include/asm/Makefile.in| 661 - .../arch/powerpc/include/asm/xenomai/Makefile.in | 553 - lib/cobalt/arch/sh/Makefile.in | 766 - lib/cobalt/arch/sh/include/Makefile.in | 661 - lib/cobalt/arch/sh/include/asm/Makefile.in | 661 - lib/cobalt/arch/sh/include/asm/xenomai/Makefile.in | 553 - lib/cobalt/arch/x86/Makefile.in| 766 - lib/cobalt/arch/x86/include/Makefile.in| 661 - lib/cobalt/arch/x86/include/asm/Makefile.in| 661 - .../arch/x86/include/asm/xenomai/Makefile.in | 553 - lib/copperplate/Makefile.in| 1134 -- lib/copperplate/regd/Makefile.in | 700 -
[Xenomai-git] Gilles Chanteperdrix : smokey/mutex-torture: test mutex initializers
Module: xenomai-gch Branch: for-forge Commit: a7b99f03fb610b502488807b29f8013f8553540c URL: http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=a7b99f03fb610b502488807b29f8013f8553540c Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org Date: Tue Mar 24 21:07:50 2015 +0100 smokey/mutex-torture: test mutex initializers --- testsuite/smokey/mutex-torture/mutex-torture.c | 105 1 file changed, 105 insertions(+) diff --git a/testsuite/smokey/mutex-torture/mutex-torture.c b/testsuite/smokey/mutex-torture/mutex-torture.c index d7d7b3d..357d2cb 100644 --- a/testsuite/smokey/mutex-torture/mutex-torture.c +++ b/testsuite/smokey/mutex-torture/mutex-torture.c @@ -275,6 +275,34 @@ static void *waiter(void *cookie) return cookie; } +static void autoinit_simple_wait(void) +{ + unsigned long long start, diff; + pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; + pthread_t waiter_tid; + + fprintf(stderr, autoinit_simple_wait\n); + + dispatch(simple mutex_lock 1, MUTEX_LOCK, 1, 0, mutex); + dispatch(simple thread_create, THREAD_CREATE, 1, 0, waiter_tid, 2, +waiter, mutex); + ms_sleep(11); + dispatch(simple mutex_unlock 1, MUTEX_UNLOCK, 1, 0, mutex); + sched_yield(); + + start = timer_get_tsc(); + dispatch(simple mutex_lock 2, MUTEX_LOCK, 1, 0, mutex); + diff = timer_tsc2ns(timer_get_tsc() - start); + if (diff 1000) { + fprintf(stderr, FAILURE: main, waited %Ld.%03u us\n, + diff / 1000, (unsigned) (diff % 1000)); + exit(EXIT_FAILURE); + } + + dispatch(simple mutex_unlock 2, MUTEX_UNLOCK, 1, 0, mutex); + dispatch(simple mutex_destroy, MUTEX_DESTROY, 1, 0, mutex); +} + static void simple_wait(void) { unsigned long long start, diff; @@ -304,6 +332,38 @@ static void simple_wait(void) dispatch(simple mutex_destroy, MUTEX_DESTROY, 1, 0, mutex); } +static void autoinit_recursive_wait(void) +{ + unsigned long long start, diff; + pthread_mutex_t mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; + pthread_t waiter_tid; + + fprintf(stderr, autoinit_recursive_wait\n); + + dispatch(rec mutex_lock 1, MUTEX_LOCK, 1, 0, mutex); + dispatch(rec mutex_lock 2, MUTEX_LOCK, 1, 0, mutex); + + dispatch(rec thread_create, THREAD_CREATE, 1, 0, waiter_tid, 2, +waiter, mutex); + + dispatch(rec mutex_unlock 2, MUTEX_UNLOCK, 1, 0, mutex); + ms_sleep(11); + dispatch(rec mutex_unlock 1, MUTEX_UNLOCK, 1, 0, mutex); + sched_yield(); + + start = timer_get_tsc(); + dispatch(rec mutex_lock 3, MUTEX_LOCK, 1, 0, mutex); + diff = timer_tsc2ns(timer_get_tsc() - start); + + if (diff 1000) { + fprintf(stderr, FAILURE: main, waited %Ld.%03u us\n, + diff / 1000, (unsigned) (diff % 1000)); + exit(EXIT_FAILURE); + } + dispatch(rec mutex_unlock 3, MUTEX_UNLOCK, 1, 0, mutex); + dispatch(rec mutex_destroy, MUTEX_DESTROY, 1, 0, mutex); +} + static void recursive_wait(void) { unsigned long long start, diff; @@ -338,6 +398,48 @@ static void recursive_wait(void) dispatch(rec mutex_destroy, MUTEX_DESTROY, 1, 0, mutex); } +static void autoinit_errorcheck_wait(void) +{ + unsigned long long start, diff; + pthread_mutex_t mutex = PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP; + pthread_t waiter_tid; + int err; + + fprintf(stderr, autoinit_errorcheck_wait\n); + + dispatch(errorcheck mutex_lock 1, MUTEX_LOCK, 1, 0, mutex); + + err = pthread_mutex_lock(mutex); + if (err != EDEADLK) { + fprintf(stderr, FAILURE: errorcheck mutex_lock 2: %s\n, + strerror(err)); + exit(EXIT_FAILURE); + } + + dispatch(errorcheck thread_create, THREAD_CREATE, 1, 0, waiter_tid, 2, +waiter, mutex); + ms_sleep(11); + dispatch(errorcheck mutex_unlock 1, MUTEX_UNLOCK, 1, 0, mutex); + sched_yield(); + err = pthread_mutex_unlock(mutex); + if (err != EPERM) { + fprintf(stderr, FAILURE: errorcheck mutex_unlock 2: %s\n, + strerror(err)); + exit(EXIT_FAILURE); + } + + start = timer_get_tsc(); + dispatch(errorcheck mutex_lock 3, MUTEX_LOCK, 1, 0, mutex); + diff = timer_tsc2ns(timer_get_tsc() - start); + if (diff 1000) { + fprintf(stderr, FAILURE: main, waited %Ld.%03u us\n, + diff / 1000, (unsigned) (diff % 1000)); + exit(EXIT_FAILURE); + } + dispatch(errorcheck mutex_unlock 3, MUTEX_UNLOCK, 1, 0, mutex); + dispatch(errorcheck mutex_destroy, MUTEX_DESTROY, 1, 0, mutex); +} + static void errorcheck_wait(void) { unsigned long long start, diff; @@ -788,8 +890,11 @@ int
[Xenomai-git] Gilles Chanteperdrix : rtnet: initialize rtdm_driver device_count member
Module: xenomai-gch Branch: for-forge Commit: 7be78ffed7bbe61d8440ccfd00f76b14b311ec26 URL: http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=7be78ffed7bbe61d8440ccfd00f76b14b311ec26 Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org Date: Tue Mar 24 18:57:27 2015 +0100 rtnet: initialize rtdm_driver device_count member --- kernel/drivers/net/stack/ipv4/tcp/tcp.c |1 + kernel/drivers/net/stack/ipv4/udp/udp.c |1 + 2 files changed, 2 insertions(+) diff --git a/kernel/drivers/net/stack/ipv4/tcp/tcp.c b/kernel/drivers/net/stack/ipv4/tcp/tcp.c index d6a7b7d..a270713 100644 --- a/kernel/drivers/net/stack/ipv4/tcp/tcp.c +++ b/kernel/drivers/net/stack/ipv4/tcp/tcp.c @@ -2119,6 +2119,7 @@ static struct rtdm_driver tcp_driver = { RTDM_SUBCLASS_RTNET, RTNET_RTDM_VER), .device_flags = RTDM_PROTOCOL_DEVICE, +.device_count =1, .context_size = sizeof(struct tcp_socket), .protocol_family = PF_INET, diff --git a/kernel/drivers/net/stack/ipv4/udp/udp.c b/kernel/drivers/net/stack/ipv4/udp/udp.c index 3966e54..1e6d5d7 100644 --- a/kernel/drivers/net/stack/ipv4/udp/udp.c +++ b/kernel/drivers/net/stack/ipv4/udp/udp.c @@ -707,6 +707,7 @@ static struct rtdm_driver udp_driver = { RTDM_SUBCLASS_RTNET, RTNET_RTDM_VER), .device_flags = RTDM_PROTOCOL_DEVICE, +.device_count =1, .context_size = sizeof(struct rtsocket), .protocol_family = PF_INET, ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git