[Xenomai-git] Philippe Gerum : copperplate/eventobj: add uninit cleanup helper
Module: xenomai-3 Branch: next Commit: 824d831c7218faa28014ad624d960b0926ece048 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=824d831c7218faa28014ad624d960b0926ece048 Author: Philippe Gerum r...@xenomai.org Date: Mon Aug 10 18:07:16 2015 +0200 copperplate/eventobj: add uninit cleanup helper This one does not run the object finalizer, assuming a strictly passive object (no waiters yet). --- include/copperplate/eventobj.h |2 ++ lib/copperplate/eventobj.c | 12 2 files changed, 14 insertions(+) diff --git a/include/copperplate/eventobj.h b/include/copperplate/eventobj.h index a98ede9..3fc9416 100644 --- a/include/copperplate/eventobj.h +++ b/include/copperplate/eventobj.h @@ -82,6 +82,8 @@ int eventobj_init(struct eventobj *evobj, int eventobj_destroy(struct eventobj *evobj); +void eventobj_uninit(struct eventobj *evobj); + int eventobj_post(struct eventobj *evobj, unsigned int bits); diff --git a/lib/copperplate/eventobj.c b/lib/copperplate/eventobj.c index 7cd1583..ff8c526 100644 --- a/lib/copperplate/eventobj.c +++ b/lib/copperplate/eventobj.c @@ -59,6 +59,13 @@ int eventobj_destroy(struct eventobj *evobj) return 0; } +void eventobj_uninit(struct eventobj *evobj) +{ + int ret = cobalt_event_destroy(evobj-core.event); + assert(ret == 0); + (void)ret; +} + int eventobj_wait(struct eventobj *evobj, unsigned int bits, unsigned int *bits_r, int mode, const struct timespec *timeout) @@ -186,6 +193,11 @@ int eventobj_destroy(struct eventobj *evobj) return 0; } +void eventobj_uninit(struct eventobj *evobj) +{ + syncobj_uninit(evobj-core.sobj); +} + int eventobj_wait(struct eventobj *evobj, unsigned int bits, unsigned int *bits_r, int mode, const struct timespec *timeout) ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : lib/cobalt: export cobalt_thread_mode()
Module: xenomai-3 Branch: next Commit: 03dab4601a19f84dc80fb9bb331bff1ace74ed09 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=03dab4601a19f84dc80fb9bb331bff1ace74ed09 Author: Philippe Gerum r...@xenomai.org Date: Fri Jul 31 17:41:41 2015 +0200 lib/cobalt: export cobalt_thread_mode() --- config/apirev |2 +- include/cobalt/sys/cobalt.h |2 ++ lib/cobalt/internal.c |5 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/config/apirev b/config/apirev index b1bd38b..8351c19 100644 --- a/config/apirev +++ b/config/apirev @@ -1 +1 @@ -13 +14 diff --git a/include/cobalt/sys/cobalt.h b/include/cobalt/sys/cobalt.h index e80800b..e7c58d7 100644 --- a/include/cobalt/sys/cobalt.h +++ b/include/cobalt/sys/cobalt.h @@ -70,6 +70,8 @@ int cobalt_thread_join(pthread_t thread); pid_t cobalt_thread_pid(pthread_t thread); +int cobalt_thread_mode(void); + int cobalt_monitor_init(cobalt_monitor_t *mon, clockid_t clk_id, int flags); diff --git a/lib/cobalt/internal.c b/lib/cobalt/internal.c index 09cce81..348ca14 100644 --- a/lib/cobalt/internal.c +++ b/lib/cobalt/internal.c @@ -70,6 +70,11 @@ pid_t cobalt_thread_pid(pthread_t thread) return XENOMAI_SYSCALL1(sc_cobalt_thread_getpid, thread); } +int cobalt_thread_mode(void) +{ + return cobalt_get_current_mode(); +} + int cobalt_thread_join(pthread_t thread) { int ret, oldtype; ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Jan Kiszka : cobalt/arm: Detect software breakpoints
Module: xenomai-3 Branch: next Commit: 6dfdc69f5359d9a9945465e40800b605986bffba URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=6dfdc69f5359d9a9945465e40800b605986bffba Author: Jan Kiszka jan.kis...@siemens.com Date: Tue Aug 4 15:13:17 2015 +0200 cobalt/arm: Detect software breakpoints gdb injects software breakpoints as undefined instructions. Make sure we detect them as well. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- kernel/cobalt/arch/arm/include/asm/xenomai/thread.h |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/cobalt/arch/arm/include/asm/xenomai/thread.h b/kernel/cobalt/arch/arm/include/asm/xenomai/thread.h index 3d8e699..11439a3 100644 --- a/kernel/cobalt/arch/arm/include/asm/xenomai/thread.h +++ b/kernel/cobalt/arch/arm/include/asm/xenomai/thread.h @@ -56,7 +56,8 @@ struct xnarchtcb { #define xnarch_fault_pf_p(d) ((d)-exception == IPIPE_TRAP_ACCESS) #define xnarch_fault_bp_p(d) ((current-ptrace PT_PTRACED) \ -((d)-exception == IPIPE_TRAP_BREAK)) +((d)-exception == IPIPE_TRAP_BREAK || \ + (d)-exception == IPIPE_TRAP_UNDEFINSTR)) #define xnarch_fault_notify(d) (!xnarch_fault_bp_p(d)) ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : lib/cobalt/heapobj: pshared: allow group access to heap
Module: xenomai-3 Branch: next Commit: 033976af9db37d77dbb0c0422658bf7df0680104 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=033976af9db37d77dbb0c0422658bf7df0680104 Author: Philippe Gerum r...@xenomai.org Date: Thu Aug 6 09:49:16 2015 +0200 lib/cobalt/heapobj: pshared: allow group access to heap Allow users who belong to the same group to access the shared heap, provided umask allows it too. --- lib/copperplate/heapobj-pshared.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/copperplate/heapobj-pshared.c b/lib/copperplate/heapobj-pshared.c index 61769c9..5fe899a 100644 --- a/lib/copperplate/heapobj-pshared.c +++ b/lib/copperplate/heapobj-pshared.c @@ -628,7 +628,7 @@ static int create_main_heap(pid_t *cnode_r) snprintf(hobj-fsname, sizeof(hobj-fsname), /xeno:%s, hobj-name); - fd = shm_open(hobj-fsname, O_RDWR|O_CREAT, 0600); + fd = shm_open(hobj-fsname, O_RDWR|O_CREAT, 0660); if (fd 0) return __bt(-errno); ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : copperplate/regd: do timed wait for anon connection
Module: xenomai-3 Branch: next Commit: dcd9821a3b9212270de2f503d83bd2d1a3999695 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=dcd9821a3b9212270de2f503d83bd2d1a3999695 Author: Philippe Gerum r...@xenomai.org Date: Fri Jul 31 15:00:48 2015 +0200 copperplate/regd: do timed wait for anon connection --- lib/copperplate/regd/regd.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/copperplate/regd/regd.c b/lib/copperplate/regd/regd.c index 4f48273..01ecc60 100644 --- a/lib/copperplate/regd/regd.c +++ b/lib/copperplate/regd/regd.c @@ -343,7 +343,7 @@ static void handle_requests(void) FD_ZERO(refset); FD_SET(sockfd, refset); - if (!(linger || anon)) { + if (!linger) { tmfd = __STD(timerfd_create(CLOCK_MONOTONIC, 0)); if (tmfd 0) error(1, errno, handle_requests/timerfd_create); @@ -371,8 +371,14 @@ static void handle_requests(void) continue; } FD_SET(s, refset); - if (tmfd != -1) - __STD(timerfd_settime(tmfd, 0, its, NULL)); + if (tmfd != -1) { + if (anon) { + FD_CLR(tmfd, refset); + __STD(close(tmfd)); + tmfd = -1; + } else + __STD(timerfd_settime(tmfd, 0, its, NULL)); + } } if (tmfd != -1 FD_ISSET(tmfd, set)) { ret = __STD(read(tmfd, exp, sizeof(exp))); ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : lib/cobalt: fix private event state accessor
Module: xenomai-3 Branch: next Commit: 23bb3153a512788f3427f06da9c6d358be6a9f21 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=23bb3153a512788f3427f06da9c6d358be6a9f21 Author: Philippe Gerum r...@xenomai.org Date: Wed Aug 5 16:08:23 2015 +0200 lib/cobalt: fix private event state accessor --- lib/cobalt/internal.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cobalt/internal.c b/lib/cobalt/internal.c index 348ca14..62ecb4a 100644 --- a/lib/cobalt/internal.c +++ b/lib/cobalt/internal.c @@ -426,7 +426,7 @@ struct cobalt_event_state *get_event_state(cobalt_event_t *event) { return event-flags COBALT_EVENT_SHARED ? cobalt_umm_shared + event-state_offset : - cobalt_umm_shared + event-state_offset; + cobalt_umm_private + event-state_offset; } int cobalt_event_init(cobalt_event_t *event, unsigned int value, ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : alchemy/sem: prevent double-free on error path
Module: xenomai-3 Branch: next Commit: ac6fb1c0c7b0eefed103a9ae963a201595c22f2a URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=ac6fb1c0c7b0eefed103a9ae963a201595c22f2a Author: Philippe Gerum r...@xenomai.org Date: Mon Aug 10 18:08:04 2015 +0200 alchemy/sem: prevent double-free on error path We don't want the finalizer to run for the underlying sema4 object when cleaning up upon error at creation. Call the uninit helper instead. --- 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 cf4add9..4b967ed 100644 --- a/lib/alchemy/sem.c +++ b/lib/alchemy/sem.c @@ -226,7 +226,7 @@ int rt_sem_create(RT_SEM *sem, const char *name, if (syncluster_addobj(alchemy_sem_table, scb-name, scb-cobj)) { registry_destroy_file(scb-fsobj); - semobj_destroy(scb-smobj); + semobj_uninit(scb-smobj); xnfree(scb); ret = -EEXIST; } else ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : copperplate/semobj: add uninit cleanup helper
Module: xenomai-3 Branch: next Commit: fa3092a14f97e729c6f8e0bc5608c87a1a063e6a URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=fa3092a14f97e729c6f8e0bc5608c87a1a063e6a Author: Philippe Gerum r...@xenomai.org Date: Mon Aug 10 18:07:05 2015 +0200 copperplate/semobj: add uninit cleanup helper This one does not run the object finalizer, assuming a strictly passive object (no waiters yet). --- include/copperplate/semobj.h |2 ++ lib/copperplate/semobj.c | 12 2 files changed, 14 insertions(+) diff --git a/include/copperplate/semobj.h b/include/copperplate/semobj.h index dd2e642..4d9e0a5 100644 --- a/include/copperplate/semobj.h +++ b/include/copperplate/semobj.h @@ -66,6 +66,8 @@ int semobj_init(struct semobj *smobj, int semobj_destroy(struct semobj *smobj); +void semobj_uninit(struct semobj *smobj); + int semobj_post(struct semobj *smobj); int semobj_broadcast(struct semobj *smobj); diff --git a/lib/copperplate/semobj.c b/lib/copperplate/semobj.c index d056a7b..a615678 100644 --- a/lib/copperplate/semobj.c +++ b/lib/copperplate/semobj.c @@ -73,6 +73,13 @@ int semobj_destroy(struct semobj *smobj) return ret; } +void semobj_uninit(struct semobj *smobj) +{ + int ret = __RT(sem_destroy(smobj-core.sem)); + assert(ret == 0); + (void)ret; +} + int semobj_post(struct semobj *smobj) { int ret; @@ -217,6 +224,11 @@ int semobj_destroy(struct semobj *smobj) return syncobj_destroy(smobj-core.sobj, syns); } +void semobj_uninit(struct semobj *smobj) +{ + syncobj_uninit(smobj-core.sobj); +} + int semobj_post(struct semobj *smobj) { struct syncstate syns; ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://xenomai.org/mailman/listinfo/xenomai-git