[Xenomai-git] Jan Kiszka : POSIX: Fix select to return deleted xnsynch objects as pending
Module: xenomai-jki Branch: for-upstream Commit: e03cb5081bfd995f34a3ac2d9544190fdd30a50c URL: http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=e03cb5081bfd995f34a3ac2d9544190fdd30a50c Author: Jan Kiszka Date: Mon Mar 1 14:45:26 2010 +0100 POSIX: Fix select to return deleted xnsynch objects as pending We already return an fd as pending if the corresponding xnsynch object is delete while waiting on it. Extend select to do the same if the object is already mark deleted on binding. This fixes select on half-closed RTnet TCP sockets. Signed-off-by: Jan Kiszka --- ksrc/skins/posix/syscall.c | 39 +-- 1 files changed, 29 insertions(+), 10 deletions(-) diff --git a/ksrc/skins/posix/syscall.c b/ksrc/skins/posix/syscall.c index 959b61c..f7616f6 100644 --- a/ksrc/skins/posix/syscall.c +++ b/ksrc/skins/posix/syscall.c @@ -2298,24 +2298,30 @@ static int select_bind_one(struct xnselector *selector, unsigned type, int fd) } static int select_bind_all(struct xnselector *selector, - fd_set *fds[XNSELECT_MAX_TYPES], int nfds) + fd_set *in_fds[XNSELECT_MAX_TYPES], + fd_set *out_fds[XNSELECT_MAX_TYPES], int nfds) { unsigned fd, type; + int pending = 0; int err; for (type = 0; type < XNSELECT_MAX_TYPES; type++) { - fd_set *set = fds[type]; + fd_set *set = in_fds[type]; if (set) for (fd = find_first_bit(set->fds_bits, nfds); fd < nfds; fd = find_next_bit(set->fds_bits, nfds, fd + 1)) { err = select_bind_one(selector, type, fd); - if (err) - return err; + if (err) { + if (err != -EIDRM) + return err; + __FD_SET(fd, out_fds[type]); + pending++; + } } } - return 0; + return pending; } /* int select(int, fd_set *, fd_set *, fd_set *, struct timeval *) */ @@ -2328,8 +2334,10 @@ static int __select(struct pt_regs *regs) }; fd_set *in_fds[XNSELECT_MAX_TYPES] = {NULL, NULL, NULL}; fd_set *out_fds[XNSELECT_MAX_TYPES] = {NULL, NULL, NULL}; - fd_set in_fds_storage[XNSELECT_MAX_TYPES], - out_fds_storage[XNSELECT_MAX_TYPES]; + fd_set *tmp_fds[XNSELECT_MAX_TYPES]; + fd_set in_fds_storage[XNSELECT_MAX_TYPES]; + fd_set out_fds_storage[XNSELECT_MAX_TYPES]; + fd_set tmp_fds_storage[XNSELECT_MAX_TYPES]; xnticks_t timeout = XN_INFINITE; xntmode_t mode = XN_RELATIVE; struct xnselector *selector; @@ -2387,7 +2395,9 @@ static int __select(struct pt_regs *regs) /* Bind directly the file descriptors, we do not need to go through xnselect returning -ECHRNG */ - if ((err = select_bind_all(selector, in_fds, nfds))) + for (i = 0; i < XNSELECT_MAX_TYPES; i++) + __FD_ZERO(out_fds[i]); + if ((err = select_bind_all(selector, in_fds, out_fds, nfds))) return err; } @@ -2395,9 +2405,18 @@ static int __select(struct pt_regs *regs) err = xnselect(selector, out_fds, in_fds, nfds, timeout, mode); if (err == -ECHRNG) { - int err = select_bind_all(selector, out_fds, nfds); - if (err) + int err2; + + for (i = 0; i < XNSELECT_MAX_TYPES; i++) { + __FD_ZERO(&tmp_fds_storage[i]); + tmp_fds[i] = &tmp_fds_storage[i]; + } + err2 = select_bind_all(selector, out_fds, tmp_fds, + nfds); + if (err2) { + memcpy(out_fds, &tmp_fds, sizeof(*out_fds)); return err; + } } } while (err == -ECHRNG); ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Jan Kiszka : RTDM+POSIX: Avoid leaking binding objects on errors
Module: xenomai-jki Branch: for-upstream Commit: cb3cc0959ce7f8c41dcff6073e7513c81c445a0a URL: http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=cb3cc0959ce7f8c41dcff6073e7513c81c445a0a Author: Jan Kiszka Date: Fri Feb 26 18:42:35 2010 +0100 RTDM+POSIX: Avoid leaking binding objects on errors We need to release the allocated xnselect_binding if we fail to hook it into the select block. Signed-off-by: Jan Kiszka --- ksrc/skins/posix/mq.c|1 + ksrc/skins/rtdm/drvlib.c |6 ++ 2 files changed, 7 insertions(+), 0 deletions(-) diff --git a/ksrc/skins/posix/mq.c b/ksrc/skins/posix/mq.c index 11f47c0..02b59fb 100644 --- a/ksrc/skins/posix/mq.c +++ b/ksrc/skins/posix/mq.c @@ -1284,6 +1284,7 @@ int pse51_mq_select_bind(mqd_t fd, struct xnselector *selector, unlock_and_error: xnlock_put_irqrestore(&nklock, s); + xnfree(binding); return err; } #endif /* CONFIG_XENO_OPT_POSIX_SELECT */ diff --git a/ksrc/skins/rtdm/drvlib.c b/ksrc/skins/rtdm/drvlib.c index 5181108..637f99e 100644 --- a/ksrc/skins/rtdm/drvlib.c +++ b/ksrc/skins/rtdm/drvlib.c @@ -1089,6 +1089,9 @@ int rtdm_event_select_bind(rtdm_event_t *event, rtdm_selector_t *selector, RTDM_EVENT_PENDING)); xnlock_put_irqrestore(&nklock, s); + if (err) + xnfree(binding); + return err; } EXPORT_SYMBOL(rtdm_event_select_bind); @@ -1370,6 +1373,9 @@ int rtdm_sem_select_bind(rtdm_sem_t *sem, rtdm_selector_t *selector, type, fd_index, (sem->value > 0)); xnlock_put_irqrestore(&nklock, s); + if (err) + xnfree(binding); + return err; } EXPORT_SYMBOL(rtdm_sem_select_bind); ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Jan Kiszka : POSIX: Fix select to return deleted xnsynch objects as pending
Module: xenomai-jki Branch: for-upstream Commit: 6f47b8f627436bde21f87c6f21f6a729a4c23ed0 URL: http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=6f47b8f627436bde21f87c6f21f6a729a4c23ed0 Author: Jan Kiszka Date: Mon Mar 1 14:45:26 2010 +0100 POSIX: Fix select to return deleted xnsynch objects as pending We already return an fd as pending if the corresponding xnsynch object is delete while waiting on it. Extend select to do the same if the object is already marked deleted on binding. This fixes the return code select on half-closed RTnet TCP sockets from -EIDRM to > 0 (for pending fds). Signed-off-by: Jan Kiszka --- ksrc/skins/posix/syscall.c | 39 +-- 1 files changed, 29 insertions(+), 10 deletions(-) diff --git a/ksrc/skins/posix/syscall.c b/ksrc/skins/posix/syscall.c index 959b61c..f7616f6 100644 --- a/ksrc/skins/posix/syscall.c +++ b/ksrc/skins/posix/syscall.c @@ -2298,24 +2298,30 @@ static int select_bind_one(struct xnselector *selector, unsigned type, int fd) } static int select_bind_all(struct xnselector *selector, - fd_set *fds[XNSELECT_MAX_TYPES], int nfds) + fd_set *in_fds[XNSELECT_MAX_TYPES], + fd_set *out_fds[XNSELECT_MAX_TYPES], int nfds) { unsigned fd, type; + int pending = 0; int err; for (type = 0; type < XNSELECT_MAX_TYPES; type++) { - fd_set *set = fds[type]; + fd_set *set = in_fds[type]; if (set) for (fd = find_first_bit(set->fds_bits, nfds); fd < nfds; fd = find_next_bit(set->fds_bits, nfds, fd + 1)) { err = select_bind_one(selector, type, fd); - if (err) - return err; + if (err) { + if (err != -EIDRM) + return err; + __FD_SET(fd, out_fds[type]); + pending++; + } } } - return 0; + return pending; } /* int select(int, fd_set *, fd_set *, fd_set *, struct timeval *) */ @@ -2328,8 +2334,10 @@ static int __select(struct pt_regs *regs) }; fd_set *in_fds[XNSELECT_MAX_TYPES] = {NULL, NULL, NULL}; fd_set *out_fds[XNSELECT_MAX_TYPES] = {NULL, NULL, NULL}; - fd_set in_fds_storage[XNSELECT_MAX_TYPES], - out_fds_storage[XNSELECT_MAX_TYPES]; + fd_set *tmp_fds[XNSELECT_MAX_TYPES]; + fd_set in_fds_storage[XNSELECT_MAX_TYPES]; + fd_set out_fds_storage[XNSELECT_MAX_TYPES]; + fd_set tmp_fds_storage[XNSELECT_MAX_TYPES]; xnticks_t timeout = XN_INFINITE; xntmode_t mode = XN_RELATIVE; struct xnselector *selector; @@ -2387,7 +2395,9 @@ static int __select(struct pt_regs *regs) /* Bind directly the file descriptors, we do not need to go through xnselect returning -ECHRNG */ - if ((err = select_bind_all(selector, in_fds, nfds))) + for (i = 0; i < XNSELECT_MAX_TYPES; i++) + __FD_ZERO(out_fds[i]); + if ((err = select_bind_all(selector, in_fds, out_fds, nfds))) return err; } @@ -2395,9 +2405,18 @@ static int __select(struct pt_regs *regs) err = xnselect(selector, out_fds, in_fds, nfds, timeout, mode); if (err == -ECHRNG) { - int err = select_bind_all(selector, out_fds, nfds); - if (err) + int err2; + + for (i = 0; i < XNSELECT_MAX_TYPES; i++) { + __FD_ZERO(&tmp_fds_storage[i]); + tmp_fds[i] = &tmp_fds_storage[i]; + } + err2 = select_bind_all(selector, out_fds, tmp_fds, + nfds); + if (err2) { + memcpy(out_fds, &tmp_fds, sizeof(*out_fds)); return err; + } } } while (err == -ECHRNG); ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Jan Kiszka : RTDM: Add smp barrier to rtdm_context_unlock
Module: xenomai-jki Branch: for-upstream Commit: d1da9640386a8b256e1475465d818ed87d5dc366 URL: http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=d1da9640386a8b256e1475465d818ed87d5dc366 Author: Jan Kiszka Date: Mon Mar 1 18:00:00 2010 +0100 RTDM: Add smp barrier to rtdm_context_unlock rtdm_context_unlock() is part of the driver API, and is therefore only be called without holding the serializing rt_fildes_lock. Ensure proper ordering of any access to the protected rtdm_dev_context by adding an smp barrier for atomic_dec to rtdm_context_unlock(). Signed-off-by: Jan Kiszka --- include/rtdm/rtdm_driver.h |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/include/rtdm/rtdm_driver.h b/include/rtdm/rtdm_driver.h index 1697b5c..0fc1496 100644 --- a/include/rtdm/rtdm_driver.h +++ b/include/rtdm/rtdm_driver.h @@ -554,6 +554,7 @@ static inline void rtdm_context_lock(struct rtdm_dev_context *context) static inline void rtdm_context_unlock(struct rtdm_dev_context *context) { + smp_mb__before_atomic_dec(); atomic_dec(&context->close_lock_count); } ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Jan Kiszka : RTDM: Consistently use xnsynch_test_flags to test for RTDM_SYNCH_DELETED
Module: xenomai-jki Branch: for-upstream Commit: aa98bbf55279719cdd1ac08b33262e2c2033c03d URL: http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=aa98bbf55279719cdd1ac08b33262e2c2033c03d Author: Jan Kiszka Date: Mon Mar 1 17:28:20 2010 +0100 RTDM: Consistently use xnsynch_test_flags to test for RTDM_SYNCH_DELETED No functional changes. Signed-off-by: Jan Kiszka --- ksrc/skins/rtdm/drvlib.c |8 +--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ksrc/skins/rtdm/drvlib.c b/ksrc/skins/rtdm/drvlib.c index fe32f24..3b04493 100644 --- a/ksrc/skins/rtdm/drvlib.c +++ b/ksrc/skins/rtdm/drvlib.c @@ -955,7 +955,8 @@ int rtdm_event_timedwait(rtdm_event_t *event, nanosecs_rel_t timeout, xnlock_get_irqsave(&nklock, s); - if (unlikely(testbits(event->synch_base.status, RTDM_SYNCH_DELETED))) + if (unlikely(xnsynch_test_flags(&event->synch_base, + RTDM_SYNCH_DELETED))) err = -EIDRM; else if (likely(xnsynch_test_flags(&event->synch_base, RTDM_EVENT_PENDING))) { @@ -1239,7 +1240,7 @@ int rtdm_sem_timeddown(rtdm_sem_t *sem, nanosecs_rel_t timeout, xnlock_get_irqsave(&nklock, s); - if (unlikely(testbits(sem->synch_base.status, RTDM_SYNCH_DELETED))) + if (unlikely(xnsynch_test_flags(&sem->synch_base, RTDM_SYNCH_DELETED))) err = -EIDRM; else if (sem->value > 0) { if(!--sem->value) @@ -1533,7 +1534,8 @@ int rtdm_mutex_timedlock(rtdm_mutex_t *mutex, nanosecs_rel_t timeout, xnlock_get_irqsave(&nklock, s); - if (unlikely(testbits(mutex->synch_base.status, RTDM_SYNCH_DELETED))) + if (unlikely(xnsynch_test_flags(&mutex->synch_base, + RTDM_SYNCH_DELETED))) err = -EIDRM; else if (likely(xnsynch_owner(&mutex->synch_base) == NULL)) xnsynch_set_owner(&mutex->synch_base, curr_thread); ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Jan Kiszka : RTDM: Avoid calling cleanup_instance with held spin lock
Module: xenomai-jki Branch: for-upstream Commit: 95278926edc559d48b1b178e6b01f91c019fd53c URL: http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=95278926edc559d48b1b178e6b01f91c019fd53c Author: Jan Kiszka Date: Mon Mar 1 17:44:30 2010 +0100 RTDM: Avoid calling cleanup_instance with held spin lock It's cleaner to check for close_lock_count under spin lock from within cleanup_instance than calling it with the lock held. This changes no semantics of the involved functions. Signed-off-by: Jan Kiszka --- ksrc/skins/rtdm/core.c | 45 +++-- 1 files changed, 23 insertions(+), 22 deletions(-) diff --git a/ksrc/skins/rtdm/core.c b/ksrc/skins/rtdm/core.c index 3bc13f1..8677c47 100644 --- a/ksrc/skins/rtdm/core.c +++ b/ksrc/skins/rtdm/core.c @@ -167,11 +167,19 @@ static int create_instance(struct rtdm_device *device, return 0; } -/* call with rt_fildes_lock acquired - will release it */ -static void cleanup_instance(struct rtdm_device *device, -struct rtdm_dev_context *context, -struct rtdm_fildes *fildes, int nrt_mem, spl_t s) +static int cleanup_instance(struct rtdm_device *device, + struct rtdm_dev_context *context, + struct rtdm_fildes *fildes, int nrt_mem) { + spl_t s; + + xnlock_get_irqsave(&rt_fildes_lock, s); + + if (unlikely(atomic_read(&context->close_lock_count) > 1)) { + xnlock_put_irqrestore(&rt_fildes_lock, s); + return -EAGAIN; + } + if (fildes) { clear_bit((fildes - fildes_table), used_fildes); fildes->context = NULL; @@ -192,6 +200,8 @@ static void cleanup_instance(struct rtdm_device *device, } rtdm_dereference_device(device); + + return 0; } int __rt_dev_open(rtdm_user_info_t *user_info, const char *path, int oflag) @@ -199,7 +209,6 @@ int __rt_dev_open(rtdm_user_info_t *user_info, const char *path, int oflag) struct rtdm_device *device; struct rtdm_fildes *fildes; struct rtdm_dev_context *context; - spl_t s; int ret; int nrt_mode = !rtdm_in_rt_context(); @@ -236,8 +245,7 @@ int __rt_dev_open(rtdm_user_info_t *user_info, const char *path, int oflag) return context->fd; cleanup_out: - xnlock_get_irqsave(&rt_fildes_lock, s); - cleanup_instance(device, context, fildes, nrt_mode, s); + cleanup_instance(device, context, fildes, nrt_mode); err_out: return ret; @@ -251,7 +259,6 @@ int __rt_dev_socket(rtdm_user_info_t *user_info, int protocol_family, struct rtdm_device *device; struct rtdm_fildes *fildes; struct rtdm_dev_context *context; - spl_t s; int ret; int nrt_mode = !rtdm_in_rt_context(); @@ -289,8 +296,7 @@ int __rt_dev_socket(rtdm_user_info_t *user_info, int protocol_family, return context->fd; cleanup_out: - xnlock_get_irqsave(&rt_fildes_lock, s); - cleanup_instance(device, context, fildes, nrt_mode, s); + cleanup_instance(device, context, fildes, nrt_mode); err_out: return ret; @@ -348,24 +354,19 @@ again: } else if (unlikely(ret < 0)) goto unlock_out; - xnlock_get_irqsave(&rt_fildes_lock, s); + ret = cleanup_instance(context->device, context, &fildes_table[fd], + test_bit(RTDM_CREATED_IN_NRT, + &context->context_flags)); + if (ret < 0) { + rtdm_context_unlock(context); - if (unlikely(atomic_read(&context->close_lock_count) > 1)) { - xnlock_put_irqrestore(&rt_fildes_lock, s); + if (!nrt_mode) + goto err_out; - if (!nrt_mode) { - ret = -EAGAIN; - goto unlock_out; - } - rtdm_context_unlock(context); msleep(CLOSURE_RETRY_PERIOD); goto again; } - cleanup_instance(context->device, context, &fildes_table[fd], -test_bit(RTDM_CREATED_IN_NRT, &context->context_flags), -s); - trace_mark(xn_rtdm, fd_closed, "fd %d", fd); return ret; ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Jan Kiszka : RTDM: Bind deleted sem/event objects, but mark them pending
Module: xenomai-jki Branch: for-upstream Commit: ea3a001f8ee4decc2029ac28f88da2749d3aea52 URL: http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=ea3a001f8ee4decc2029ac28f88da2749d3aea52 Author: Jan Kiszka Date: Mon Mar 1 17:12:44 2010 +0100 RTDM: Bind deleted sem/event objects, but mark them pending Deleted semaphore and event objects do not necessarily mean that the corresponding RTDM file descriptor is already closed. Moreover, returning -EIDRM on bind makes select return this invalid error to the user. Fix this by binding both object types even if they are marked deleted, but report them as pending. This cures the return value of select on half-closed RTnet TCP sockets. Signed-off-by: Jan Kiszka --- ksrc/skins/rtdm/drvlib.c | 26 ++ 1 files changed, 10 insertions(+), 16 deletions(-) diff --git a/ksrc/skins/rtdm/drvlib.c b/ksrc/skins/rtdm/drvlib.c index 637f99e..fe32f24 100644 --- a/ksrc/skins/rtdm/drvlib.c +++ b/ksrc/skins/rtdm/drvlib.c @@ -1051,8 +1051,6 @@ EXPORT_SYMBOL(rtdm_event_clear); * * @return 0 on success, otherwise: * - * - -EIDRM is returned if @a event has been destroyed. - * * - -ENOMEM is returned if there is insufficient memory to establish the * dynamic binding. * @@ -1080,13 +1078,11 @@ int rtdm_event_select_bind(rtdm_event_t *event, rtdm_selector_t *selector, return -ENOMEM; xnlock_get_irqsave(&nklock, s); - if (unlikely(testbits(event->synch_base.status, RTDM_SYNCH_DELETED))) - err = -EIDRM; - else - err = xnselect_bind(&event->select_block, - binding, selector, type, fd_index, - xnsynch_test_flags(&event->synch_base, - RTDM_EVENT_PENDING)); + err = xnselect_bind(&event->select_block, + binding, selector, type, fd_index, + xnsynch_test_flags(&event->synch_base, + RTDM_SYNCH_DELETED | + RTDM_EVENT_PENDING)); xnlock_put_irqrestore(&nklock, s); if (err) @@ -1337,8 +1333,6 @@ EXPORT_SYMBOL(rtdm_sem_up); * * @return 0 on success, otherwise: * - * - -EIDRM is returned if @a sem has been destroyed. - * * - -ENOMEM is returned if there is insufficient memory to establish the * dynamic binding. * @@ -1366,11 +1360,11 @@ int rtdm_sem_select_bind(rtdm_sem_t *sem, rtdm_selector_t *selector, return -ENOMEM; xnlock_get_irqsave(&nklock, s); - if (unlikely(testbits(sem->synch_base.status, RTDM_SYNCH_DELETED))) - err = -EIDRM; - else - err = xnselect_bind(&sem->select_block, binding, selector, - type, fd_index, (sem->value > 0)); + err = xnselect_bind(&sem->select_block, binding, selector, + type, fd_index, + (sem->value > 0) || + xnsynch_test_flags(&sem->synch_base, + RTDM_SYNCH_DELETED)); xnlock_put_irqrestore(&nklock, s); if (err) ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Jan Kiszka : Push time conversion services into libxeno_common
Module: xenomai-2.5 Branch: master Commit: 684ce4be595d500b882b51b69ab15174d8905ad9 URL: http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=684ce4be595d500b882b51b69ab15174d8905ad9 Author: Jan Kiszka Date: Wed Feb 10 22:02:11 2010 +0100 Push time conversion services into libxeno_common This both fixes the breakage in multi-skin scenarios due to private variables vs. weak functions in timeconv.h and avoids that this code is redundantly included by every skin. Signed-off-by: Jan Kiszka --- include/asm-generic/arith.h |4 ++- include/asm-generic/bits/timeconv.h | 18 +++- include/asm-generic/system.h| 12 ++ include/asm-generic/timeconv.h | 32 + include/native/timer.h |1 + src/skins/common/Makefile.am|2 +- src/skins/common/bind.c |3 ++ src/skins/common/timeconv.c | 38 +++ src/skins/native/init.c |3 -- src/skins/native/timer.c| 16 +- src/skins/posix/clock.c | 18 +-- src/skins/posix/init.c |5 12 files changed, 92 insertions(+), 60 deletions(-) diff --git a/include/asm-generic/arith.h b/include/asm-generic/arith.h index 416e742..c147768 100644 --- a/include/asm-generic/arith.h +++ b/include/asm-generic/arith.h @@ -393,7 +393,9 @@ static inline void xnarch_init_llmulshft(const unsigned m_in, #define xnarch_nodiv_ullimd rthal_nodiv_ullimd #define xnarch_nodiv_llimd rthal_nodiv_llimd #define xnarch_llmulshft rthal_llmulshft -#define xnarch_get_cpu_tsc rthal_rdtsc + +unsigned long long xnarch_divrem_billion(unsigned long long value, +unsigned long *rem); /*...@}*/ diff --git a/include/asm-generic/bits/timeconv.h b/include/asm-generic/bits/timeconv.h index fde8e5d..c3db32c 100644 --- a/include/asm-generic/bits/timeconv.h +++ b/include/asm-generic/bits/timeconv.h @@ -32,24 +32,23 @@ static rthal_u32frac_t bln_frac; #endif #ifdef XNARCH_HAVE_LLMULSHFT -__attribute__ ((weak)) long long xnarch_tsc_to_ns(long long ticks) { return xnarch_llmulshft(ticks, tsc_scale, tsc_shift); } -__attribute__ ((weak)) + long long xnarch_tsc_to_ns_rounded(long long ticks) { unsigned int shift = tsc_shift - 1; return (xnarch_llmulshft(ticks, tsc_scale, shift) + 1) / 2; } + #ifdef XNARCH_HAVE_NODIV_LLIMD -__attribute__ ((weak)) long long xnarch_ns_to_tsc(long long ns) { return xnarch_nodiv_llimd(ns, tsc_frac.frac, tsc_frac.integ); } -__attribute__ ((weak)) + unsigned long long xnarch_divrem_billion(unsigned long long value, unsigned long *rem) { @@ -66,24 +65,24 @@ unsigned long long xnarch_divrem_billion(unsigned long long value, return q; } #else /* !XNARCH_HAVE_NODIV_LLIMD */ -__attribute__ ((weak)) long long xnarch_ns_to_tsc(long long ns) { return xnarch_llimd(ns, 1 << tsc_shift, tsc_scale); } #endif /* !XNARCH_HAVE_NODIV_LLIMD */ + #else /* !XNARCH_HAVE_LLMULSHFT */ -__attribute__ ((weak)) + long long xnarch_tsc_to_ns(long long ticks) { return xnarch_llimd(ticks, 10, clockfreq); } -__attribute__ ((weak)) + long long xnarch_tsc_to_ns_rounded(long long ticks) { return (xnarch_llimd(ticks, 10, clockfreq/2) + 1) / 2; } -__attribute__ ((weak)) + long long xnarch_ns_to_tsc(long long ns) { return xnarch_llimd(ns, clockfreq, 10); @@ -91,7 +90,6 @@ long long xnarch_ns_to_tsc(long long ns) #endif /* !XNARCH_HAVE_LLMULSHFT */ #ifndef XNARCH_HAVE_NODIV_LLIMD -__attribute__ ((weak)) unsigned long long xnarch_divrem_billion(unsigned long long value, unsigned long *rem) { @@ -100,7 +98,7 @@ unsigned long long xnarch_divrem_billion(unsigned long long value, } #endif /* !XNARCH_HAVE_NODIV_LLIMD */ -static inline void xnarch_init_timeconv(unsigned long long freq) +static void xnarch_init_timeconv(unsigned long long freq) { clockfreq = freq; #ifdef XNARCH_HAVE_LLMULSHFT diff --git a/include/asm-generic/system.h b/include/asm-generic/system.h index 176de1b..bff7140 100644 --- a/include/asm-generic/system.h +++ b/include/asm-generic/system.h @@ -38,6 +38,7 @@ #include #include #include +#include #include /* debug support */ @@ -282,22 +283,15 @@ typedef struct xnarch_heapcb { unsigned long long xnarch_get_host_time(void); -long long xnarch_tsc_to_ns(long long ts); - -long long xnarch_tsc_to_ns_rounded(long long ts); - -long long xnarch_ns_to_tsc(long long ns); - unsigned long long xnarch_get_cpu_time(void); -unsigned long long xnarch_divrem_billion(unsigned long long value, -unsigned long *rem); - static inline unsigned long long xnarch_get_cpu_freq(void) { return RTHAL_CPU_FREQ; } +#define
[Xenomai-git] Gilles Chanteperdrix : Make libxeno_common a real shared library
Module: xenomai-2.5 Branch: master Commit: 00f56a94218fcb0a46da3648de21a31bda02e493 URL: http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=00f56a94218fcb0a46da3648de21a31bda02e493 Author: Gilles Chanteperdrix Date: Wed Feb 24 10:29:03 2010 +0100 Make libxeno_common a real shared library --- include/asm-generic/bits/mlock_alert.h | 31 ++- src/skins/common/Makefile.am | 10 ++ src/skins/common/bind.c| 25 - src/skins/common/current.c | 18 +++--- src/skins/common/sem_heap.c|1 - src/skins/common/sigshadow.c | 13 + src/skins/native/Makefile.am |2 -- src/skins/posix/Makefile.am|2 -- src/skins/psos+/Makefile.am|2 -- src/skins/rtai/Makefile.am |2 -- src/skins/rtdm/Makefile.am |2 -- src/skins/uitron/Makefile.am |2 -- src/skins/vrtx/Makefile.am |2 -- src/skins/vxworks/Makefile.am |2 -- src/testsuite/clocktest/Makefile.am|4 +++- src/testsuite/cyclic/Makefile.am |4 +++- src/testsuite/irqbench/Makefile.am |5 +++-- src/testsuite/latency/Makefile.am |1 + src/testsuite/sigtest/Makefile.am |4 +++- src/testsuite/switchtest/Makefile.am |4 +++- src/testsuite/unit/Makefile.am |5 + 21 files changed, 65 insertions(+), 76 deletions(-) diff --git a/include/asm-generic/bits/mlock_alert.h b/include/asm-generic/bits/mlock_alert.h index 6c7217d..6a4e3cd 100644 --- a/include/asm-generic/bits/mlock_alert.h +++ b/include/asm-generic/bits/mlock_alert.h @@ -1,35 +1,8 @@ #ifndef _XENO_ASM_GENERIC_BITS_MLOCK_ALERT_H #define _XENO_ASM_GENERIC_BITS_MLOCK_ALERT_H -#include -#include -#include -#include +extern int xeno_sigxcpu_no_mlock; -__attribute__ ((weak)) -int xeno_sigxcpu_no_mlock = 1; - -__attribute__ ((weak, visibility ("internal"))) -void xeno_handle_mlock_alert(int sig) -{ - struct sigaction sa; - - if (xeno_sigxcpu_no_mlock) { - fprintf(stderr, "Xenomai: process memory not locked " - "(missing mlockall?)\n"); - fflush(stderr); - exit(4); - } - - /* XNTRAPSW was set for the thread but no user-defined handler - has been set to override our internal handler, so let's - invoke the default signal action. */ - - sa.sa_handler = SIG_DFL; - sigemptyset(&sa.sa_mask); - sa.sa_flags = 0; - sigaction(SIGXCPU, &sa, NULL); - pthread_kill(pthread_self(), SIGXCPU); -} +void xeno_handle_mlock_alert(int sig); #endif /* _XENO_ASM_GENERIC_BITS_MLOCK_ALERT_H */ diff --git a/src/skins/common/Makefile.am b/src/skins/common/Makefile.am index 8466833..e9d4ab6 100644 --- a/src/skins/common/Makefile.am +++ b/src/skins/common/Makefile.am @@ -1,12 +1,14 @@ -noinst_LTLIBRARIES = libxeno_common.la +lib_LTLIBRARIES = libxenomai.la noinst_HEADERS = sem_heap.h -libxeno_common_la_SOURCES = bind.c current.c sigshadow.c timeconv.c +libxenomai_la_SOURCES = bind.c current.c sigshadow.c timeconv.c if CONFIG_XENO_FASTSYNCH -libxeno_common_la_SOURCES += sem_heap.c +libxenomai_la_SOURCES += sem_heap.c endif -libxeno_common_la_CPPFLAGS = \ +libxenomai_la_LDFLAGS = @XENO_DLOPEN_CONSTRAINT@ -version-info 0:0:0 -lpthread + +libxenomai_la_CPPFLAGS = \ @XENO_USER_CFLAGS@ \ -I$(top_srcdir)/include diff --git a/src/skins/common/bind.c b/src/skins/common/bind.c index 0c9917a..3967cce 100644 --- a/src/skins/common/bind.c +++ b/src/skins/common/bind.c @@ -11,10 +11,11 @@ #include #include "sem_heap.h" +int xeno_sigxcpu_no_mlock = 1; static pthread_t xeno_main_tid; static xnsighandler *xnsig_handlers[32]; -void __attribute__((weak)) xeno_sigill_handler(int sig) +static void xeno_sigill_handler(int sig) { fprintf(stderr, "Xenomai or CONFIG_XENO_OPT_PERVASIVE disabled.\n" "(modprobe xeno_nucleus?)\n"); @@ -152,3 +153,25 @@ void xeno_fault_stack(void) stk[0] = stk[sizeof(stk) - 1] = 0xA5; } + +void xeno_handle_mlock_alert(int sig) +{ + struct sigaction sa; + + if (xeno_sigxcpu_no_mlock) { + fprintf(stderr, "Xenomai: process memory not locked " + "(missing mlockall?)\n"); + fflush(stderr); + exit(4); + } + + /* XNTRAPSW was set for the thread but no user-defined handler + has been set to override our internal handler, so let's + invoke the default signal action. */ + + sa.sa_handler = SIG_DFL; + sigemptyset(&sa.sa_mask); + sa.sa_flags = 0; + sigaction(SIGXCPU, &sa, NULL); + pthread_kill(pthread_self(), SIGXCPU); +} diff --git a/src/skins/common/current.c b/src/skins/common/current.c index a371cab..89e39c8 100644 --- a/src/skins/common/current.c +++ b/src/skins/common/cu
[Xenomai-git] Jan Kiszka : Fix remapping of global sem_heap on fork
Module: xenomai-2.5 Branch: master Commit: e70ce487ac7ab62cd8de28af8ddccf7309f1259d URL: http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=e70ce487ac7ab62cd8de28af8ddccf7309f1259d Author: Jan Kiszka Date: Fri Feb 12 17:40:09 2010 +0100 Fix remapping of global sem_heap on fork As xeno_init_sem_heaps might be called multiple times even without fork, we must not remap the global heap here. Register an atfork handler instead that handles this case and simple reject multiple heap creation requests for the same process. Signed-off-by: Jan Kiszka --- src/skins/common/sem_heap.c | 30 +++--- 1 files changed, 19 insertions(+), 11 deletions(-) diff --git a/src/skins/common/sem_heap.c b/src/skins/common/sem_heap.c index 89f325a..723e031 100644 --- a/src/skins/common/sem_heap.c +++ b/src/skins/common/sem_heap.c @@ -1,6 +1,6 @@ #include #include - +#include #include #include #include @@ -65,24 +65,32 @@ static void unmap_sem_heap(unsigned long heap_addr, unsigned shared) munmap((void *) heap_addr, hinfo.size); } +static void remap_on_fork(void) +{ + unmap_sem_heap(xeno_sem_heap[0], 0); + + xeno_sem_heap[0] = (unsigned long) map_sem_heap(0); + if (xeno_sem_heap[0] == (unsigned long) MAP_FAILED) { + perror("Xenomai: mmap(local sem heap)"); + exit(EXIT_FAILURE); + } +} + void xeno_init_sem_heaps(void) { - /* In case we forked, we need to map the new local semaphore heap */ if (xeno_sem_heap[0]) - unmap_sem_heap(xeno_sem_heap[0], 0); + return; + xeno_sem_heap[0] = (unsigned long) map_sem_heap(0); if (xeno_sem_heap[0] == (unsigned long) MAP_FAILED) { perror("Xenomai: mmap(local sem heap)"); exit(EXIT_FAILURE); } + pthread_atfork(NULL, NULL, remap_on_fork); - /* Even if we forked the global semaphore heap did not change, no need - to map it anew */ - if (!xeno_sem_heap[1]) { - xeno_sem_heap[1] = (unsigned long) map_sem_heap(1); - if (xeno_sem_heap[1] == (unsigned long) MAP_FAILED) { - perror("Xenomai: mmap(global sem heap)"); - exit(EXIT_FAILURE); - } + xeno_sem_heap[1] = (unsigned long) map_sem_heap(1); + if (xeno_sem_heap[1] == (unsigned long) MAP_FAILED) { + perror("Xenomai: mmap(global sem heap)"); + exit(EXIT_FAILURE); } } ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Gilles Chanteperdrix : Add libxenomai and a new --skin option to xeno-config
Module: xenomai-2.5 Branch: master Commit: 383e13b354e6bffcde8c43dae5ea3799d4055d20 URL: http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=383e13b354e6bffcde8c43dae5ea3799d4055d20 Author: Gilles Chanteperdrix Date: Wed Feb 24 10:55:35 2010 +0100 Add libxenomai and a new --skin option to xeno-config --- include/asm-generic/bits/sigshadow.h | 12 +- scripts/xeno-config.in | 72 ++ src/skins/common/current.c |6 +- src/skins/common/sigshadow.c | 10 - src/skins/native/task.c |4 +- src/skins/posix/init.c |4 -- src/skins/posix/thread.c |6 +- src/skins/psos+/task.c |4 +- src/skins/uitron/task.c |4 +- src/skins/vrtx/task.c|2 +- src/skins/vxworks/taskLib.c |2 +- src/testsuite/sigtest/sigtest.c |1 + src/utils/analogy/Makefile.am| 39 ++- src/utils/can/Makefile.am| 19 ++--- 14 files changed, 130 insertions(+), 55 deletions(-) diff --git a/include/asm-generic/bits/sigshadow.h b/include/asm-generic/bits/sigshadow.h index e07ce00..3a7c48c 100644 --- a/include/asm-generic/bits/sigshadow.h +++ b/include/asm-generic/bits/sigshadow.h @@ -1,16 +1,6 @@ #ifndef _XENO_ASM_GENERIC_BITS_SIGSHADOW_H #define _XENO_ASM_GENERIC_BITS_SIGSHADOW_H -#include -#include +void xeno_sigshadow_install_once(void); -extern pthread_once_t xeno_sigshadow_installed; -extern struct sigaction xeno_saved_sigshadow_action; - -void xeno_sigshadow_install(void); - -static inline void sigshadow_install_once(void) -{ - pthread_once(&xeno_sigshadow_installed, xeno_sigshadow_install); -} #endif /* _XENO_ASM_GENERIC_BITS_SIGSHADOW_H */ diff --git a/scripts/xeno-config.in b/scripts/xeno-config.in index 4008048..3cbdd04 100644 --- a/scripts/xeno-config.in +++ b/scripts/xeno-config.in @@ -14,9 +14,8 @@ XENO_PREFIX="${staging}${prefix}" XENO_CC="@CC@" XENO_TARGET_ARCH="@XENO_TARGET_ARCH@" XENO_BASE_CFLAGS="-I${staging}${includedir} @XENO_USER_APP_CFLAGS@ -D__XENO__" -XENO_BASE_LDFLAGS="-L${staging}${libdir} -lpthread @XENO_USER_APP_LDFLAGS@" -XENO_POSIX_CFLAGS="-I${staging}${includedir} -I${staging}${includedir}/posix @XENO_USER_APP_CFLAGS@ -D__XENO__" -XENO_POSIX_LDFLAGS="-L${staging}${libdir} -lpthread_rt -lpthread -lrt @XENO_USER_APP_LDFLAGS@" +XENO_BASE_LDFLAGS="-L${staging}${libdir} -lxenomai -lpthread @XENO_USER_APP_LDFLAGS@" +XENO_POSIX_LDFLAGS="-L${staging}${libdir} -lpthread_rt -lxenomai -lpthread -lrt @XENO_USER_APP_LDFLAGS@" XENO_POSIX_WRAPPERS="${staging}${libdir}/posix.wrappers" XENO_POSIX_FAST_WRAPPING="@LD_FILE_OPTION@" XENO_LIBRARY_DIR="${staging}${libdir}" @@ -42,7 +41,7 @@ posix_ldflags () usage () { cat <&2 + exit 1 + ;; + *) + echo skin $skin unknown 1>&2 + exit 1 + ;; + esac + ;; + + --ldflags) + case "$skin" in + posix) + echo $XENO_POSIX_LDFLAGS + ;; + native|psos|psos+|rtai|uitron|vrtx|vxworks) + if [ "x$skin" = "xpsos+" ]; then + skin="psos" + fi + echo -l$skin $XENO_BASE_LDFLAGS + ;; + "") + echo skin not set, please pass --skin before --cflags 1>&2 + exit 1 + ;; + *) + echo skin $skin unknown 1>&2 + exit 1 + ;; + esac + ;; + --xeno-cflags) + echo "$1" is deprecated, use --skin=name --cflags instead 1>&2 echo $XENO_BASE_CFLAGS ;; --xeno-ldflags) + echo "$1" is deprecated, use --skin=name --ldflags instead 1>&2 echo $XENO_BASE_LDFLAGS ;; --posix-cflags) + echo "$1" is deprecated, use --skin=posix --cflags instead 1>&2 echo $XENO_POSIX_CFLAGS ;; --posix-ldflags) + echo "$1" is deprecated, use --skin=posix --ldflags instead 1>&2 posix_ldflags echo ;; ---lib*-dir|--libdir|--user-libdir) -echo $XENO_LIBRARY_DIR -;; --help) usage 0 1>&2 ;; diff --git a/src/skins/common/current.c b/src/skins/common/current.c index 89e39c8..2922d6e 100644 --- a/src/skins/common/current.c +++ b/src/skins/common/current.c @@ -18,15 +18,15 @@ static inline void __xeno_set_current(xnhandle_t current) #else /* !HAVE___THREAD */ #include -static pthread_key_t xeno_current_key; -static pthread_key_t xeno_current_mode_key; +pthread_key_t xeno_current_key; +pthread_key_t xeno_current_mode_key; static inline void __xeno_set_current(xnhandle_t current) {
[Xenomai-git] Gilles Chanteperdrix : build: bootstrap
Module: xenomai-2.5 Branch: master Commit: 4312916b4606abdd242d4f5c2588723b8213013f URL: http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=4312916b4606abdd242d4f5c2588723b8213013f Author: Gilles Chanteperdrix Date: Mon Mar 1 20:34:36 2010 +0100 build: bootstrap --- src/skins/common/Makefile.in | 149 + src/skins/native/Makefile.in |3 +- src/skins/posix/Makefile.in |3 +- src/skins/psos+/Makefile.in |3 +- src/skins/rtai/Makefile.in |3 +- src/skins/rtdm/Makefile.in |3 +- src/skins/uitron/Makefile.in |3 +- src/skins/vrtx/Makefile.in |3 +- src/skins/vxworks/Makefile.in|3 +- src/testsuite/clocktest/Makefile.in |7 +- src/testsuite/cyclic/Makefile.in |7 +- src/testsuite/irqbench/Makefile.in |7 +- src/testsuite/latency/Makefile.in|3 +- src/testsuite/sigtest/Makefile.in|7 +- src/testsuite/switchtest/Makefile.in |7 +- src/testsuite/unit/Makefile.in | 20 - src/utils/analogy/Makefile.in| 67 src/utils/can/Makefile.in| 30 +-- 18 files changed, 217 insertions(+), 111 deletions(-) diff --git a/src/skins/common/Makefile.in b/src/skins/common/Makefile.in index 671edbf..d96be69 100644 --- a/src/skins/common/Makefile.in +++ b/src/skins/common/Makefile.in @@ -52,16 +52,26 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/xeno_config.h CONFIG_CLEAN_FILES = -LTLIBRARIES = $(noinst_LTLIBRARIES) -libxeno_common_la_LIBADD = -am__libxeno_common_la_SOURCES_DIST = bind.c current.c sigshadow.c \ - sem_heap.c -...@config_xeno_fastsynch_true@am__objects_1 = \ -...@config_xeno_fastsynch_true@libxeno_common_la-sem_heap.lo -am_libxeno_common_la_OBJECTS = libxeno_common_la-bind.lo \ - libxeno_common_la-current.lo libxeno_common_la-sigshadow.lo \ - $(am__objects_1) -libxeno_common_la_OBJECTS = $(am_libxeno_common_la_OBJECTS) +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ +$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ +*) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(libdir)" +libLTLIBRARIES_INSTALL = $(INSTALL) +LTLIBRARIES = $(lib_LTLIBRARIES) +libxenomai_la_LIBADD = +am__libxenomai_la_SOURCES_DIST = bind.c current.c sigshadow.c \ + timeconv.c sem_heap.c +...@config_xeno_fastsynch_true@am__objects_1 = libxenomai_la-sem_heap.lo +am_libxenomai_la_OBJECTS = libxenomai_la-bind.lo \ + libxenomai_la-current.lo libxenomai_la-sigshadow.lo \ + libxenomai_la-timeconv.lo $(am__objects_1) +libxenomai_la_OBJECTS = $(am_libxenomai_la_OBJECTS) +libxenomai_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libxenomai_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -...@am__isrc@ -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles @@ -74,8 +84,8 @@ CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ -SOURCES = $(libxeno_common_la_SOURCES) -DIST_SOURCES = $(am__libxeno_common_la_SOURCES_DIST) +SOURCES = $(libxenomai_la_SOURCES) +DIST_SOURCES = $(am__libxenomai_la_SOURCES_DIST) HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags @@ -239,11 +249,12 @@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -noinst_LTLIBRARIES = libxeno_common.la +lib_LTLIBRARIES = libxenomai.la noinst_HEADERS = sem_heap.h -libxeno_common_la_SOURCES = bind.c current.c sigshadow.c \ +libxenomai_la_SOURCES = bind.c current.c sigshadow.c timeconv.c \ $(am__append_1) -libxeno_common_la_CPPFLAGS = \ +libxenomai_la_LDFLAGS = @XENO_DLOPEN_CONSTRAINT@ -version-info 0:0:0 -lpthread +libxenomai_la_CPPFLAGS = \ @XENO_USER_CFLAGS@ \ -I$(top_srcdir)/include @@ -280,17 +291,35 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ + if test -f $$p; then \ + f=$(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOL
[Xenomai-git] Gilles Chanteperdrix : wrap-link: try to work correctly with the --as-needed option
Module: xenomai-2.5 Branch: master Commit: e00bdd72802002e70ed82787a36cf0f45285aada URL: http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=e00bdd72802002e70ed82787a36cf0f45285aada Author: Gilles Chanteperdrix Date: Fri Feb 12 08:22:23 2010 +0100 wrap-link: try to work correctly with the --as-needed option --- scripts/wrap-link.sh |9 - 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/scripts/wrap-link.sh b/scripts/wrap-link.sh index f4826ac..09944f5 100755 --- a/scripts/wrap-link.sh +++ b/scripts/wrap-link.sh @@ -34,7 +34,14 @@ add_linker_flag() { stage1_args="$stage1_args -Wl,--wrap $@" next_is_wrapped_symbol=false else - add_2stages "$@" + case "$@" in + *--as-needed*) + stage2_args="$stage2_args $@" + ;; + *) + add_2stages "$@" + ;; + esac fi } ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Gilles Chanteperdrix : Use pthread_once for initializations which should be called once.
Module: xenomai-2.5 Branch: master Commit: 64c5c2804ef02a32dd8cfc4886f98ad941b6c4c0 URL: http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=64c5c2804ef02a32dd8cfc4886f98ad941b6c4c0 Author: Gilles Chanteperdrix Date: Mon Mar 1 21:33:46 2010 +0100 Use pthread_once for initializations which should be called once. --- src/skins/common/sem_heap.c | 14 +- src/skins/common/timeconv.c | 11 +-- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/skins/common/sem_heap.c b/src/skins/common/sem_heap.c index ad2e9b8..55ad7d1 100644 --- a/src/skins/common/sem_heap.c +++ b/src/skins/common/sem_heap.c @@ -1,7 +1,8 @@ #include #include -#include + #include +#include #include #include #include @@ -75,11 +76,8 @@ static void remap_on_fork(void) } } -void xeno_init_sem_heaps(void) +static void xeno_init_sem_heaps_inner(void) { - if (xeno_sem_heap[0]) - return; - xeno_sem_heap[0] = (unsigned long) map_sem_heap(0); if (xeno_sem_heap[0] == (unsigned long) MAP_FAILED) { perror("Xenomai: mmap(local sem heap)"); @@ -93,3 +91,9 @@ void xeno_init_sem_heaps(void) exit(EXIT_FAILURE); } } + +void xeno_init_sem_heaps(void) +{ + static pthread_once_t init_sem_heaps_once = PTHREAD_ONCE_INIT; + pthread_once(&init_sem_heaps_once, &xeno_init_sem_heaps_inner); +} diff --git a/src/skins/common/timeconv.c b/src/skins/common/timeconv.c index 9b2ba23..87a0ba2 100644 --- a/src/skins/common/timeconv.c +++ b/src/skins/common/timeconv.c @@ -20,19 +20,26 @@ #include #include +#include + #include #include xnsysinfo_t sysinfo; +static void xeno_init_timeconv_inner(void) +{ + xnarch_init_timeconv(sysinfo.cpufreq); +} + void xeno_init_timeconv(int muxid) { + static pthread_once_t init_timeconv_once = PTHREAD_ONCE_INIT; int err = XENOMAI_SYSCALL2(__xn_sys_info, muxid, &sysinfo); if (err) { fprintf(stderr, "Xenomai: sys_info failed: %s\n", strerror(-err)); exit(EXIT_FAILURE); } - - xnarch_init_timeconv(sysinfo.cpufreq); + pthread_once(&init_timeconv_once, &xeno_init_timeconv_inner); } ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : testsuite/unit: make vdso test depend on fastsynch availability
Module: xenomai-rpm Branch: for-upstream Commit: 34162f394f33a96ef45d63ba7fd9674ef55a648d URL: http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=34162f394f33a96ef45d63ba7fd9674ef55a648d Author: Philippe Gerum Date: Sun Feb 28 19:37:39 2010 +0100 testsuite/unit: make vdso test depend on fastsynch availability --- src/testsuite/unit/Makefile.am | 10 -- src/testsuite/unit/Makefile.in | 29 + 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/src/testsuite/unit/Makefile.am b/src/testsuite/unit/Makefile.am index c6188fb..4312c74 100644 --- a/src/testsuite/unit/Makefile.am +++ b/src/testsuite/unit/Makefile.am @@ -3,8 +3,10 @@ testdir = @XENO_TEST_DIR@ CCLD = $(top_srcdir)/scripts/wrap-link.sh $(CC) -test_PROGRAMS = arith wakeup-time mutex-torture-posix mutex-torture-native \ - check-vdso +test_PROGRAMS = arith wakeup-time mutex-torture-posix mutex-torture-native +if CONFIG_XENO_FASTSYNCH +test_PROGRAMS += check-vdso +endif arith_SOURCES = arith.c arith-noinline.c arith-noinline.h @@ -55,6 +57,8 @@ mutex_torture_native_LDADD = \ ../../skins/native/libnative.la \ -lpthread -lm +if CONFIG_XENO_FASTSYNCH + check_vdso_SOURCES = check-vdso.c check_vdso_CPPFLAGS = \ @@ -67,6 +71,8 @@ check_vdso_LDADD = \ ../../skins/native/libnative.la \ -lpthread -lm +endif + install-data-local: $(mkinstalldirs) $(DESTDIR)$(rundir) @sed -e's,@exec_prefix\@,$(exec_prefix),g' $(srcdir)/runinfo.in > $(DESTDIR)$(rundir)/.runinfo diff --git a/src/testsuite/unit/Makefile.in b/src/testsuite/unit/Makefile.in index eab3b29..abc85a6 100644 --- a/src/testsuite/unit/Makefile.in +++ b/src/testsuite/unit/Makefile.in @@ -37,7 +37,8 @@ host_triplet = @host@ target_triplet = @target@ test_PROGRAMS = arith$(EXEEXT) wakeup-time$(EXEEXT) \ mutex-torture-posix$(EXEEXT) mutex-torture-native$(EXEEXT) \ - check-vdso$(EXEEXT) + $(am__EXEEXT_1) +...@config_xeno_fastsynch_true@am__append_1 = check-vdso subdir = src/testsuite/unit DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -55,6 +56,7 @@ mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/xeno_config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = +...@config_xeno_fastsynch_true@am__EXEEXT_1 = check-vdso$(EXEEXT) am__installdirs = "$(DESTDIR)$(testdir)" PROGRAMS = $(test_PROGRAMS) am_arith_OBJECTS = arith-arith.$(OBJEXT) \ @@ -64,9 +66,12 @@ arith_DEPENDENCIES = ../../skins/native/libnative.la arith_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(arith_LDFLAGS) \ $(LDFLAGS) -o $@ -am_check_vdso_OBJECTS = check_vdso-check-vdso.$(OBJEXT) +am__check_vdso_SOURCES_DIST = check-vdso.c +...@config_xeno_fastsynch_true@am_check_vdso_OBJECTS = \ +...@config_xeno_fastsynch_true@check_vdso-check-vdso.$(OBJEXT) check_vdso_OBJECTS = $(am_check_vdso_OBJECTS) -check_vdso_DEPENDENCIES = ../../skins/native/libnative.la +...@config_xeno_fastsynch_true@check_vdso_DEPENDENCIES = \ +...@config_xeno_fastsynch_true@../../skins/native/libnative.la check_vdso_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(check_vdso_LDFLAGS) $(LDFLAGS) -o $@ @@ -106,7 +111,7 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ SOURCES = $(arith_SOURCES) $(check_vdso_SOURCES) \ $(mutex_torture_native_SOURCES) $(mutex_torture_posix_SOURCES) \ $(wakeup_time_SOURCES) -DIST_SOURCES = $(arith_SOURCES) $(check_vdso_SOURCES) \ +DIST_SOURCES = $(arith_SOURCES) $(am__check_vdso_SOURCES_DIST) \ $(mutex_torture_native_SOURCES) $(mutex_torture_posix_SOURCES) \ $(wakeup_time_SOURCES) ETAGS = etags @@ -316,15 +321,15 @@ mutex_torture_native_LDADD = \ ../../skins/native/libnative.la \ -lpthread -lm -check_vdso_SOURCES = check-vdso.c -check_vdso_CPPFLAGS = \ - @XENO_USER_CFLAGS@ \ - -I$(top_srcdir)/include +...@config_xeno_fastsynch_true@check_vdso_SOURCES = check-vdso.c +...@config_xeno_fastsynch_true@check_vdso_CPPFLAGS = \ +...@config_xeno_fastsynch_true@@XENO_USER_CFLAGS@ \ +...@config_xeno_fastsynch_true@-I$(top_srcdir)/include -check_vdso_LDFLAGS = @XENO_USER_LDFLAGS@ -check_vdso_LDADD = \ - ../../skins/native/libnative.la \ - -lpthread -lm +...@config_xeno_fastsynch_true@check_vdso_LDFLAGS = @XENO_USER_LDFLAGS@ +...@config_xeno_fastsynch_true@check_vdso_LDADD = \ +...@config_xeno_fastsynch_true@../../skins/native/libnative.la \ +...@config_xeno_fastsynch_true@-lpthread -lm EXTRA_DIST = runinfo.in all: all-am ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : wrap-link.sh: introduce dry run mode (-n)
Module: xenomai-2.5 Branch: master Commit: ec7cf85c20554e326da433a3f88a5693f58d1fa0 URL: http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=ec7cf85c20554e326da433a3f88a5693f58d1fa0 Author: Philippe Gerum Date: Sun Feb 21 16:36:19 2010 +0100 wrap-link.sh: introduce dry run mode (-n) --- scripts/wrap-link.sh | 15 +++ 1 files changed, 11 insertions(+), 4 deletions(-) diff --git a/scripts/wrap-link.sh b/scripts/wrap-link.sh index 83a8d3d..a54e6ff 100755 --- a/scripts/wrap-link.sh +++ b/scripts/wrap-link.sh @@ -14,6 +14,7 @@ Xenomai user-space posix skin in two stages. Options: -q be quiet -v be verbose (print each command before running it) +-n dry run (print all commands but don't run any) Example: $1 -v gcc -o foo foo.o -Wl,@/usr/xenomai/lib/posix.wrappers -L/usr/xenomai/lib -lpthread_rt -lpthread -lrt @@ -58,6 +59,7 @@ if test -n "$V" && test $V -gt 0; then else verbose=false fi +dryrun= progname="$0" if test $# -eq 0; then @@ -77,6 +79,10 @@ while test $# -gt 0; do verbose=false ;; + -n) + dryrun="echo # " + ;; + -*) cc="$cc $arg" ;; @@ -98,6 +104,7 @@ while test $# -gt 0; do esac done +test -z "$dryrun" || verbose=false next_is_wrapped_symbol=false onestage_args="$@" @@ -182,10 +189,10 @@ done if $stage2; then $verbose && set -x -$cc -o "$output.tmp" -Wl,-Ur -nostdlib $stage1_args -$cc -o "$output" "$output.tmp" $stage2_args -rm -f $output.tmp +$dryrun $cc -o "$output.tmp" -Wl,-Ur -nostdlib $stage1_args +$dryrun $cc -o "$output" "$output.tmp" $stage2_args +$dryrun rm -f $output.tmp else $verbose && set -x -$cc -o "$output" $onestage_args +$dryrun $cc -o "$output" $onestage_args fi ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : wrap-link.sh: force object files to stage1
Module: xenomai-2.5 Branch: master Commit: 5bbd81bdbeff581f09db7b8eb194e9d5faa98eec URL: http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=5bbd81bdbeff581f09db7b8eb194e9d5faa98eec Author: Philippe Gerum Date: Sun Feb 21 11:37:13 2010 +0100 wrap-link.sh: force object files to stage1 Force object files listed after libpthread_rt to stage1, so that no files are missed for the partial link. This should be better than getting an obscure "no input files" message from collect2. --- scripts/wrap-link.sh |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/scripts/wrap-link.sh b/scripts/wrap-link.sh index 09944f5..83a8d3d 100755 --- a/scripts/wrap-link.sh +++ b/scripts/wrap-link.sh @@ -165,6 +165,11 @@ while test $# -gt 0; do stage2_args="$stage2_args $arg" ;; + *.o) + # Force .o to stage1 regardless of its position + stage1_args="$stage1_args $arg" + ;; + *) if test -e "$arg"; then add_linker_obj $arg ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : x86: upgrade I-pipe support to 2.6.32.7-x86-2.6-00
Module: xenomai-2.5 Branch: master Commit: 91bfaafbdb661ff9c38e1d08be9f7edf2dfcb568 URL: http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=91bfaafbdb661ff9c38e1d08be9f7edf2dfcb568 Author: Philippe Gerum Date: Thu Feb 4 10:44:30 2010 +0100 x86: upgrade I-pipe support to 2.6.32.7-x86-2.6-00 --- ...patch => adeos-ipipe-2.6.32.7-x86-2.6-00.patch} | 626 --- 1 files changed, 395 insertions(+), 231 deletions(-) diff --git a/ksrc/arch/x86/patches/adeos-ipipe-2.6.32.7-x86-2.5-01.patch b/ksrc/arch/x86/patches/adeos-ipipe-2.6.32.7-x86-2.6-00.patch similarity index 96% rename from ksrc/arch/x86/patches/adeos-ipipe-2.6.32.7-x86-2.5-01.patch rename to ksrc/arch/x86/patches/adeos-ipipe-2.6.32.7-x86-2.6-00.patch index 7268bd2..426a17e 100644 --- a/ksrc/arch/x86/patches/adeos-ipipe-2.6.32.7-x86-2.5-01.patch +++ b/ksrc/arch/x86/patches/adeos-ipipe-2.6.32.7-x86-2.6-00.patch @@ -168,7 +168,7 @@ index 0b72282..6574056 100644 /* diff --git a/arch/x86/include/asm/ipipe.h b/arch/x86/include/asm/ipipe.h new file mode 100644 -index 000..38c39cf +index 000..0d7eb46 --- /dev/null +++ b/arch/x86/include/asm/ipipe.h @@ -0,0 +1,156 @@ @@ -199,10 +199,10 @@ index 000..38c39cf +#ifdef CONFIG_IPIPE + +#ifndef IPIPE_ARCH_STRING -+#define IPIPE_ARCH_STRING "2.5-01" ++#define IPIPE_ARCH_STRING "2.6-00" +#define IPIPE_MAJOR_NUMBER2 -+#define IPIPE_MINOR_NUMBER5 -+#define IPIPE_PATCH_NUMBER1 ++#define IPIPE_MINOR_NUMBER6 ++#define IPIPE_PATCH_NUMBER0 +#endif + +DECLARE_PER_CPU(struct pt_regs, __ipipe_tick_regs); @@ -658,10 +658,10 @@ index 000..956c4de +#endif/* !__X86_IPIPE_64_H */ diff --git a/arch/x86/include/asm/ipipe_base.h b/arch/x86/include/asm/ipipe_base.h new file mode 100644 -index 000..3c81096 +index 000..1098d6f --- /dev/null +++ b/arch/x86/include/asm/ipipe_base.h -@@ -0,0 +1,212 @@ +@@ -0,0 +1,210 @@ +/* -*- linux-c -*- + * arch/x86/include/asm/ipipe_base.h + * @@ -691,10 +691,8 @@ index 000..3c81096 +#include + +#ifdef CONFIG_X86_32 -+#define IPIPE_IRQ_ISHIFT 5 +#define IPIPE_NR_FAULTS 33 /* 32 from IDT + iret_error */ +#else -+#define IPIPE_IRQ_ISHIFT 6 +#define IPIPE_NR_FAULTS 32 +#endif + @@ -3012,10 +3010,10 @@ index df89102..cfb29a2 100644 handle_real_irq: diff --git a/arch/x86/kernel/ipipe.c b/arch/x86/kernel/ipipe.c new file mode 100644 -index 000..b5b0966 +index 000..36cd591 --- /dev/null +++ b/arch/x86/kernel/ipipe.c -@@ -0,0 +1,1043 @@ +@@ -0,0 +1,1048 @@ +/* -*- linux-c -*- + * linux/arch/x86/kernel/ipipe.c + * @@ -3077,6 +3075,8 @@ index 000..b5b0966 + +static cpumask_t __ipipe_cpu_lock_map; + ++static unsigned long __ipipe_critical_lock; ++ +static IPIPE_DEFINE_SPINLOCK(__ipipe_cpu_barrier); + +static atomic_t __ipipe_critical_count = ATOMIC_INIT(0); @@ -3090,16 +3090,21 @@ index 000..b5b0966 + * just like if it has been actually received from a hw source. Also + * works for virtual interrupts. + */ -+int ipipe_trigger_irq(unsigned irq) ++int ipipe_trigger_irq(unsigned int irq) +{ + struct pt_regs regs; + unsigned long flags; + -+ if (irq >= IPIPE_NR_IRQS || -+ (ipipe_virtual_irq_p(irq) && -+ !test_bit(irq - IPIPE_VIRQ_BASE, &__ipipe_virtual_irq_map))) ++#ifdef CONFIG_IPIPE_DEBUG ++ if (irq >= IPIPE_NR_IRQS) + return -EINVAL; -+ ++ if (ipipe_virtual_irq_p(irq)) { ++ if (!test_bit(irq - IPIPE_VIRQ_BASE, ++&__ipipe_virtual_irq_map)) ++ return -EINVAL; ++ } else if (irq_to_desc(irq) == NULL) ++ return -EINVAL; ++#endif + local_irq_save_hw(flags); + regs.flags = flags; + regs.orig_ax = irq; /* Positive value - IRQ won't be acked */ @@ -3166,7 +3171,7 @@ index 000..b5b0966 + +void __init __ipipe_enable_pipeline(void) +{ -+ unsigned vector, irq; ++ unsigned int vector, irq; + +#ifdef CONFIG_X86_LOCAL_APIC + @@ -3434,11 +3439,12 @@ index 000..b5b0966 + +#endif/* CONFIG_SMP */ + -+/* ipipe_critical_enter() -- Grab the superlock excluding all CPUs -+ but the current one from a critical section. This lock is used when -+ we must enforce a global critical section for a single CPU in a -+ possibly SMP system whichever context the CPUs are running. */ -+ ++/* ++ * ipipe_critical_enter() -- Grab the superlock excluding all CPUs but ++ * the current one from a critical section. This lock is used when we ++ * must enforce a global critical section for a single CPU in a ++ * possibly SMP system whichever context the CPUs are running. ++ */ +unsigned long ipipe_critical_enter(void (*syncfn) (void)) +{ + unsigned long flags; @@ -3446,7 +3452,7 @@ index 000..b5b0966 + local_irq_save_hw(flags); + +#ifdef CONFIG_SMP -+ if (unlikely(num_online_cpus() == 1)) /* We might be running a SMP-kernel on a UP bo
[Xenomai-git] Philippe Gerum : x86: upgrade I-pipe support to 2.6.32.7-x86-2.6-01
Module: xenomai-2.5 Branch: master Commit: 746bf8a8575e058db313b0cd8cbb71b9855f7b5e URL: http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=746bf8a8575e058db313b0cd8cbb71b9855f7b5e Author: Philippe Gerum Date: Sun Feb 21 17:02:01 2010 +0100 x86: upgrade I-pipe support to 2.6.32.7-x86-2.6-01 --- ...patch => adeos-ipipe-2.6.32.7-x86-2.6-01.patch} | 38 ++- 1 files changed, 20 insertions(+), 18 deletions(-) diff --git a/ksrc/arch/x86/patches/adeos-ipipe-2.6.32.7-x86-2.6-00.patch b/ksrc/arch/x86/patches/adeos-ipipe-2.6.32.7-x86-2.6-01.patch similarity index 99% rename from ksrc/arch/x86/patches/adeos-ipipe-2.6.32.7-x86-2.6-00.patch rename to ksrc/arch/x86/patches/adeos-ipipe-2.6.32.7-x86-2.6-01.patch index 426a17e..11a3740 100644 --- a/ksrc/arch/x86/patches/adeos-ipipe-2.6.32.7-x86-2.6-00.patch +++ b/ksrc/arch/x86/patches/adeos-ipipe-2.6.32.7-x86-2.6-01.patch @@ -168,7 +168,7 @@ index 0b72282..6574056 100644 /* diff --git a/arch/x86/include/asm/ipipe.h b/arch/x86/include/asm/ipipe.h new file mode 100644 -index 000..0d7eb46 +index 000..35d21c2 --- /dev/null +++ b/arch/x86/include/asm/ipipe.h @@ -0,0 +1,156 @@ @@ -199,10 +199,10 @@ index 000..0d7eb46 +#ifdef CONFIG_IPIPE + +#ifndef IPIPE_ARCH_STRING -+#define IPIPE_ARCH_STRING "2.6-00" ++#define IPIPE_ARCH_STRING "2.6-01" +#define IPIPE_MAJOR_NUMBER2 +#define IPIPE_MINOR_NUMBER6 -+#define IPIPE_PATCH_NUMBER0 ++#define IPIPE_PATCH_NUMBER1 +#endif + +DECLARE_PER_CPU(struct pt_regs, __ipipe_tick_regs); @@ -1353,7 +1353,7 @@ index 873f81f..aada533 100644 static void flat_send_IPI_mask(const struct cpumask *cpumask, int vector) diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c -index dc69f28..c0235cf 100644 +index dc69f28..d1674f6 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c @@ -75,8 +75,11 @@ @@ -1396,7 +1396,7 @@ index dc69f28..c0235cf 100644 __mask_IO_APIC_irq(cfg); spin_unlock_irqrestore(&ioapic_lock, flags); } -@@ -625,6 +633,11 @@ static void unmask_IO_APIC_irq_desc(struct irq_desc *desc) +@@ -625,7 +633,13 @@ static void unmask_IO_APIC_irq_desc(struct irq_desc *desc) unsigned long flags; spin_lock_irqsave(&ioapic_lock, flags); @@ -1406,9 +1406,11 @@ index dc69f28..c0235cf 100644 + else +#endif __unmask_IO_APIC_irq(cfg); ++ ipipe_irq_unlock(desc->irq); spin_unlock_irqrestore(&ioapic_lock, flags); } -@@ -2200,6 +2213,7 @@ static unsigned int startup_ioapic_irq(unsigned int irq) + +@@ -2200,6 +2214,7 @@ static unsigned int startup_ioapic_irq(unsigned int irq) } cfg = irq_cfg(irq); __unmask_IO_APIC_irq(cfg); @@ -1416,7 +1418,7 @@ index dc69f28..c0235cf 100644 spin_unlock_irqrestore(&ioapic_lock, flags); return was_pending; -@@ -2479,23 +2493,61 @@ static void irq_complete_move(struct irq_desc **descp) +@@ -2479,23 +2494,61 @@ static void irq_complete_move(struct irq_desc **descp) static inline void irq_complete_move(struct irq_desc **descp) {} #endif @@ -1480,7 +1482,7 @@ index dc69f28..c0235cf 100644 int do_unmask_irq = 0; irq_complete_move(&desc); -@@ -2578,6 +2630,26 @@ static void ack_apic_level(unsigned int irq) +@@ -2578,6 +2631,26 @@ static void ack_apic_level(unsigned int irq) __unmask_and_level_IO_APIC_irq(cfg); spin_unlock(&ioapic_lock); } @@ -1507,7 +1509,7 @@ index dc69f28..c0235cf 100644 } #ifdef CONFIG_INTR_REMAP -@@ -2606,14 +2678,14 @@ eoi_ioapic_irq(struct irq_desc *desc) +@@ -2606,14 +2679,14 @@ eoi_ioapic_irq(struct irq_desc *desc) static void ir_ack_apic_edge(unsigned int irq) { @@ -1524,7 +1526,7 @@ index dc69f28..c0235cf 100644 eoi_ioapic_irq(desc); } #endif /* CONFIG_INTR_REMAP */ -@@ -2627,6 +2699,9 @@ static struct irq_chip ioapic_chip __read_mostly = { +@@ -2627,6 +2700,9 @@ static struct irq_chip ioapic_chip __read_mostly = { .eoi= ack_apic_level, #ifdef CONFIG_SMP .set_affinity = set_ioapic_affinity_irq, @@ -1534,7 +1536,7 @@ index dc69f28..c0235cf 100644 #endif .retrigger = ioapic_retrigger_irq, }; -@@ -2641,6 +2716,9 @@ static struct irq_chip ir_ioapic_chip __read_mostly = { +@@ -2641,6 +2717,9 @@ static struct irq_chip ir_ioapic_chip __read_mostly = { .eoi= ir_ack_apic_level, #ifdef CONFIG_SMP .set_affinity = set_ir_ioapic_affinity_irq, @@ -1544,7 +1546,7 @@ index dc69f28..c0235cf 100644 #endif #endif .retrigger = ioapic_retrigger_irq, -@@ -2686,23 +2764,29 @@ static inline void init_IO_APIC_traps(void) +@@ -2686,23 +2765,29 @@ static inline void init_IO_APIC_traps(void) static void mask_lapic_irq(unsigned int irq) { @@ -1577,7 +1579,7 @@ index dc69f28..c0235cf 100644 } static struct irq_chip lapic_chip __read_mostly = { -@@ -2710,6 +2794,9 @@ static struct irq_chip lapi
[Xenomai-git] Stefan Kisdaroczi : debian: copyright: fix typo and add project url
Module: xenomai-2.5 Branch: master Commit: bafcc48eaff6fd946826c29422d8f8d51e884c7a URL: http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=bafcc48eaff6fd946826c29422d8f8d51e884c7a Author: Stefan Kisdaroczi Date: Tue Feb 23 13:06:52 2010 +0100 debian: copyright: fix typo and add project url --- debian/copyright |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/debian/copyright b/debian/copyright index 683e276..b3980df 100644 --- a/debian/copyright +++ b/debian/copyright @@ -3,6 +3,8 @@ On: Sat Mar 3 12:00 GMT 2007 The primary author of the upstream package is Philippe Gerum. +It was downloaded from http://www.xenomai.org/ + Copyright (C) 2001,2002,2003,2004,2005,2006,2007,2008 Philippe Gerum . Copyright (C) 2005 Dmitry Adamushko Copyright (C) 2001,2003,2004,2005,2006,2008 Gilles Chanteperdrix @@ -11,7 +13,7 @@ Copyright (C) 2006 Wolfgang Grandegger License: -Xenmai is licensed under GPL version 2, the user space libraries are LGPL +Xenomai is licensed under GPL version 2, the user space libraries are LGPL version 2.1. On Debian systems, the complete texts of the GNU General Public License v2 and the GNU Lesser General Public License v2 can be found in the file ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Stefan Kisdaroczi : debian: linux-patch-xenomai.README.Debian: sync from debian.org
Module: xenomai-2.5 Branch: master Commit: f3badc40501702980ba906211f9ade8ab3dec739 URL: http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=f3badc40501702980ba906211f9ade8ab3dec739 Author: Stefan Kisdaroczi Date: Tue Feb 23 16:28:39 2010 +0100 debian: linux-patch-xenomai.README.Debian: sync from debian.org --- debian/linux-patch-xenomai.README.Debian |8 +--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/debian/linux-patch-xenomai.README.Debian b/debian/linux-patch-xenomai.README.Debian index a6aaa6b..3304bf5 100644 --- a/debian/linux-patch-xenomai.README.Debian +++ b/debian/linux-patch-xenomai.README.Debian @@ -4,12 +4,14 @@ Xenomai kernel patches in Debian With this package, you can patch and build kernels suitable for usage with Xenomai. This can be done with, e.g.: -# cd /usr/src/linux-source-2.6.24 -# fakeroot make-kpkg --initrd --added-patches xenomai kernel_image +# cd /usr/src/linux-source-2.6.32 +# /usr/src/kernel-patches/i386/apply/xenomai +# make config +# make-kpkg --rootcmd fakeroot --initrd kernel_image This is intended for vanilla and Debian kernel sources. NOTE: In the kernel config, PARAVIRT should be turned off for Xenomai kernels to compile successfully. - -- Roland Stigge , Fri, 11 Apr 2008 09:02:28 +0200 + -- Roland Stigge , Sun, 14 Feb 2010 15:14:40 +0100 ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Stefan Kisdaroczi : debian: libxenomai1: sync from debian.org
Module: xenomai-2.5 Branch: master Commit: b3c7d12425b6911b0931eaae7313face8823ef6a URL: http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=b3c7d12425b6911b0931eaae7313face8823ef6a Author: Stefan Kisdaroczi Date: Tue Feb 23 16:21:23 2010 +0100 debian: libxenomai1: sync from debian.org --- debian/libxenomai1.lintian |2 +- debian/libxenomai1.postinst |2 +- debian/libxenomai1.postrm |2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/debian/libxenomai1.lintian b/debian/libxenomai1.lintian index 42a4149..0f6a514 100644 --- a/debian/libxenomai1.lintian +++ b/debian/libxenomai1.lintian @@ -1,2 +1,2 @@ # no contained shared library names refer to "xenomai", therefore own name -libxenomai1: package-name-doesnt-match-sonames libnative1 libpsos0 libpthread-rt1 librtai0 librtdk0 librtdm1 libuitron0 libvrtx0 libvxworks1 +libxenomai1: package-name-doesnt-match-sonames libanalogy1 libnative3 libpsos0 libpthread-rt1 librtai0 librtdk0 librtdm1 libuitron0 libvrtx0 libvxworks1 diff --git a/debian/libxenomai1.postinst b/debian/libxenomai1.postinst index dfdaa46..8afc6fc 100644 --- a/debian/libxenomai1.postinst +++ b/debian/libxenomai1.postinst @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -e rm -f /etc/udev/rules.d/xenomai.rules ln -sf ../xenomai.rules /etc/udev/rules.d/xenomai.rules diff --git a/debian/libxenomai1.postrm b/debian/libxenomai1.postrm index a269ef5..3559eb5 100644 --- a/debian/libxenomai1.postrm +++ b/debian/libxenomai1.postrm @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -e case "$1" in purge | remove) ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Stefan Kisdaroczi : debian: Build-Depends: debhelper (>= 7)
Module: xenomai-2.5 Branch: master Commit: ad814b2f634d6b9f2745efe7a8be850e1d0f5420 URL: http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=ad814b2f634d6b9f2745efe7a8be850e1d0f5420 Author: Stefan Kisdaroczi Date: Tue Feb 23 16:42:40 2010 +0100 debian: Build-Depends: debhelper (>= 7) --- debian/compat |2 +- debian/control |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/compat b/debian/compat index 7ed6ff8..7f8f011 100644 --- a/debian/compat +++ b/debian/compat @@ -1 +1 @@ -5 +7 diff --git a/debian/control b/debian/control index e7fdfef..ab4636d 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: xenomai Section: devel Priority: extra Maintainer: Roland Stigge -Build-Depends: debhelper (>= 5), dh-kpatches, findutils (>= 4.2.28) +Build-Depends: debhelper (>= 7), dh-kpatches, findutils (>= 4.2.28) Standards-Version: 3.8.0 Homepage: http://www.xenomai.org/ ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : scripts: add wrapper script to run standard Xenomai commands
Module: xenomai-2.5 Branch: master Commit: 027f2f1584741a2305039b0ac7f5b8b50904980a URL: http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=027f2f1584741a2305039b0ac7f5b8b50904980a Author: Philippe Gerum Date: Mon Feb 22 16:52:46 2010 +0100 scripts: add wrapper script to run standard Xenomai commands Linux distributions or obvious naming conflicts may impose non-standard locations for the Xenomai executables and scripts. This patch introduces a simple "xeno" wrapper to be used to hide those specifics when running Xenomai commands. --- configure |6 -- configure.in|2 ++ doc/man/Makefile.am |2 +- doc/man/Makefile.in | 11 +++ doc/man/xeno.man.in | 24 scripts/Makefile.am |2 +- scripts/Makefile.in |8 +--- scripts/xeno.in | 14 ++ 8 files changed, 58 insertions(+), 11 deletions(-) diff --git a/configure b/configure index 13aee64..0c89b58 100755 --- a/configure +++ b/configure @@ -12880,11 +12880,11 @@ base=asm-generic ac_config_links="$ac_config_links src/include/$base/xenomai:$srcdir/include/$base" -ac_config_files="$ac_config_files Makefile config/Makefile scripts/Makefile scripts/xeno-config scripts/xeno-load scripts/xeno-test src/Makefile src/rtdk/Makefile src/skins/Makefile src/skins/common/Makefile src/skins/posix/Makefile src/skins/native/Makefile src/skins/vxworks/Makefile src/skins/psos+/Makefile src/skins/vrtx/Makefile src/skins/rtdm/Makefile src/skins/rtai/Makefile src/skins/uitron/Makefile src/drvlib/Makefile src/drvlib/analogy/Makefile src/include/Makefile src/testsuite/Makefile src/testsuite/latency/Makefile src/testsuite/cyclic/Makefile src/testsuite/switchtest/Makefile src/testsuite/irqbench/Makefile src/testsuite/clocktest/Makefile src/testsuite/klatency/Makefile src/testsuite/unit/Makefile src/testsuite/sigtest/Makefile src/utils/Makefile src/utils/can/Makefile src/utils/analogy/Makefile src/utils/ps/Makefile include/Makefile include/asm-generic/Makefile include/asm-generic/bits/Makefile include/asm-blackfin/Makefile include/asm-blackfin/bits/Makefile include/asm-x86/Makefile include/asm-x86/bits/Makefile include/asm-powerpc/Makefile include/asm-powerpc/bits/Makefile include/asm-arm/Makefile include/asm-arm/bits/Makefile include/asm-nios2/Makefile include/asm-nios2/bits/Makefile include/asm-sim/Makefile include/asm-sim/bits/Makefile include/native/Makefile include/nucleus/Makefile include/posix/Makefile include/posix/sys/Makefile include/psos+/Makefile include/rtai/Makefile include/rtdm/Makefile include/analogy/Makefile include/uitron/Makefile include/vrtx/Makefile include/vxworks/Makefile" +ac_config_files="$ac_config_files Makefile config/Makefile scripts/Makefile scripts/xeno-config scripts/xeno-load scripts/xeno-test scripts/xeno src/Makefile src/rtdk/Makefile src/skins/Makefile src/skins/common/Makefile src/skins/posix/Makefile src/skins/native/Makefile src/skins/vxworks/Makefile src/skins/psos+/Makefile src/skins/vrtx/Makefile src/skins/rtdm/Makefile src/skins/rtai/Makefile src/skins/uitron/Makefile src/drvlib/Makefile src/drvlib/analogy/Makefile src/include/Makefile src/testsuite/Makefile src/testsuite/latency/Makefile src/testsuite/cyclic/Makefile src/testsuite/switchtest/Makefile src/testsuite/irqbench/Makefile src/testsuite/clocktest/Makefile src/testsuite/klatency/Makefile src/testsuite/unit/Makefile src/testsuite/sigtest/Makefile src/utils/Makefile src/utils/can/Makefile src/utils/analogy/Makefile src/utils/ps/Makefile include/Makefile include/asm-generic/Makefile include/asm-generic/bits/Makefile include/asm-blackfin/Makefile include/asm-blackfin/bits/Makefile include/asm-x86/Makefile include/asm-x86/bits/Makefile include/asm-powerpc/Makefile include/asm-powerpc/bits/Makefile include/asm-arm/Makefile include/asm-arm/bits/Makefile include/asm-nios2/Makefile include/asm-nios2/bits/Makefile include/asm-sim/Makefile include/asm-sim/bits/Makefile include/native/Makefile include/nucleus/Makefile include/posix/Makefile include/posix/sys/Makefile include/psos+/Makefile include/rtai/Makefile include/rtdm/Makefile include/analogy/Makefile include/uitron/Makefile include/vrtx/Makefile include/vxworks/Makefile" if test \! x$XENO_MAYBE_DOCDIR = x ; then - ac_config_files="$ac_config_files doc/Makefile doc/txt/Makefile doc/man/Makefile doc/man/clocktest.man doc/man/cyclictest.man doc/man/irqbench.man doc/man/irqloop.man doc/man/klatency.man doc/man/latency.man doc/man/rtcanconfig.man doc/man/rtcanrecv.man doc/man/rtcansend.man doc/man/switchbench.man doc/man/switchtest.man doc/man/runinfo.man doc/man/xeno-config.man doc/man/xeno-info.man doc/man/xeno-load.man doc/man/xeno-test.man doc/doxygen/Makefile doc/doxygen/Doxyfile-common doc/doxygen/Doxyfile doc/doxygen/Doxyfile-native doc/doxygen/Doxyfile-nucleus doc/doxygen/Doxyfile-posix doc/doxygen/Doxyfile-rtdm doc/docbook/Makefile doc/docbook/catalog doc/docb
[Xenomai-git] Stefan Kisdaroczi : debian: changelog: sync from debian.org
Module: xenomai-2.5 Branch: master Commit: 62bdda5e9f407a8dd172af0c516f66de23607e5b URL: http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=62bdda5e9f407a8dd172af0c516f66de23607e5b Author: Stefan Kisdaroczi Date: Tue Feb 23 17:12:23 2010 +0100 debian: changelog: sync from debian.org --- debian/changelog | 40 1 files changed, 40 insertions(+), 0 deletions(-) diff --git a/debian/changelog b/debian/changelog index b43955d..45736a4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,43 @@ +xenomai (2.5.1-3) unstable; urgency=low + + * xenomai-runtime: Replaced "xenomai-" prefixed executables with +wrapper script /usr/bin/xeno to call original executables from +/usr/lib/xenomai/, e.g. "xeno latency" + * debian/prepare-patch.sh: Synchronized from upstream (Closes: #569721) + * Removed 2.6.24 adeos-ipipe patches + * Enabled patching/use of Debian's kernel (2.6.32) + + -- Roland Stigge Sun, 14 Feb 2010 13:35:15 +0100 + +xenomai (2.5.1-2) unstable; urgency=low + + * xenomai-runtime: Renamed /usr/bin/* to /usr/bin/xenomai-* (Closes: #569357) + + -- Roland Stigge Fri, 12 Feb 2010 21:18:00 +0100 + +xenomai (2.5.1-1) unstable; urgency=low + + * New upstream release (Closes: #553334, #566566, #536731) + * debian/control: Standards-Version: 3.8.4 + + -- Roland Stigge Sat, 06 Feb 2010 11:05:50 +0100 + +xenomai (2.4.8-2) unstable; urgency=low + + * debian/libxenomai1.{postinst,postrm}: "set -e" + * debian/control: linux-patch-xenomai: Section: kernel + + -- Roland Stigge Wed, 24 Jun 2009 17:47:41 +0200 + +xenomai (2.4.8-1) unstable; urgency=low + + * New upstream release +- includes limits.h include as in patch from Peter Green (Closes: #527654) + * debian/control: +- Standards-Version: 3.8.2 + + -- Roland Stigge Mon, 22 Jun 2009 22:50:23 +0200 + xenomai (2.4.4-3) unstable; urgency=low * debian/rules: Fixed concurrent ./configure + make runs, thanks to Albin ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : testsuite/unit: make vdso test depend on fastsynch availability
Module: xenomai-2.5 Branch: master Commit: 0b0912552e8082ae6a21daae5ea137264bc70168 URL: http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=0b0912552e8082ae6a21daae5ea137264bc70168 Author: Philippe Gerum Date: Sun Feb 28 19:37:39 2010 +0100 testsuite/unit: make vdso test depend on fastsynch availability --- src/testsuite/unit/Makefile.am | 10 -- src/testsuite/unit/Makefile.in | 33 +++-- 2 files changed, 27 insertions(+), 16 deletions(-) diff --git a/src/testsuite/unit/Makefile.am b/src/testsuite/unit/Makefile.am index 345118f..e0ad06e 100644 --- a/src/testsuite/unit/Makefile.am +++ b/src/testsuite/unit/Makefile.am @@ -3,8 +3,10 @@ testdir = @XENO_TEST_DIR@ CCLD = $(top_srcdir)/scripts/wrap-link.sh $(CC) -test_PROGRAMS = arith wakeup-time mutex-torture-posix mutex-torture-native \ - check-vdso +test_PROGRAMS = arith wakeup-time mutex-torture-posix mutex-torture-native +if CONFIG_XENO_FASTSYNCH +test_PROGRAMS += check-vdso +endif arith_SOURCES = arith.c arith-noinline.c arith-noinline.h @@ -59,6 +61,8 @@ mutex_torture_native_LDADD = \ ../../skins/common/libxenomai.la \ -lpthread -lm +if CONFIG_XENO_FASTSYNCH + check_vdso_SOURCES = check-vdso.c check_vdso_CPPFLAGS = \ @@ -72,6 +76,8 @@ check_vdso_LDADD = \ ../../skins/common/libxenomai.la \ -lpthread -lm +endif + install-data-local: $(mkinstalldirs) $(DESTDIR)$(rundir) @sed -e's,@exec_prefix\@,$(exec_prefix),g' $(srcdir)/runinfo.in > $(DESTDIR)$(rundir)/.runinfo diff --git a/src/testsuite/unit/Makefile.in b/src/testsuite/unit/Makefile.in index 34cf0fe..4322788 100644 --- a/src/testsuite/unit/Makefile.in +++ b/src/testsuite/unit/Makefile.in @@ -35,7 +35,8 @@ host_triplet = @host@ target_triplet = @target@ test_PROGRAMS = arith$(EXEEXT) wakeup-time$(EXEEXT) \ mutex-torture-posix$(EXEEXT) mutex-torture-native$(EXEEXT) \ - check-vdso$(EXEEXT) + $(am__EXEEXT_1) +...@config_xeno_fastsynch_true@am__append_1 = check-vdso subdir = src/testsuite/unit DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -52,6 +53,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/include/xeno_config.h CONFIG_CLEAN_FILES = +...@config_xeno_fastsynch_true@am__EXEEXT_1 = check-vdso$(EXEEXT) am__installdirs = "$(DESTDIR)$(testdir)" testPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(test_PROGRAMS) @@ -63,10 +65,13 @@ arith_DEPENDENCIES = ../../skins/native/libnative.la \ arith_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(arith_LDFLAGS) \ $(LDFLAGS) -o $@ -am_check_vdso_OBJECTS = check_vdso-check-vdso.$(OBJEXT) +am__check_vdso_SOURCES_DIST = check-vdso.c +...@config_xeno_fastsynch_true@am_check_vdso_OBJECTS = \ +...@config_xeno_fastsynch_true@check_vdso-check-vdso.$(OBJEXT) check_vdso_OBJECTS = $(am_check_vdso_OBJECTS) -check_vdso_DEPENDENCIES = ../../skins/native/libnative.la \ - ../../skins/common/libxenomai.la +...@config_xeno_fastsynch_true@check_vdso_DEPENDENCIES = \ +...@config_xeno_fastsynch_true@../../skins/native/libnative.la \ +...@config_xeno_fastsynch_true@../../skins/common/libxenomai.la check_vdso_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(check_vdso_LDFLAGS) $(LDFLAGS) -o $@ @@ -108,7 +113,7 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ SOURCES = $(arith_SOURCES) $(check_vdso_SOURCES) \ $(mutex_torture_native_SOURCES) $(mutex_torture_posix_SOURCES) \ $(wakeup_time_SOURCES) -DIST_SOURCES = $(arith_SOURCES) $(check_vdso_SOURCES) \ +DIST_SOURCES = $(arith_SOURCES) $(am__check_vdso_SOURCES_DIST) \ $(mutex_torture_native_SOURCES) $(mutex_torture_posix_SOURCES) \ $(wakeup_time_SOURCES) ETAGS = etags @@ -322,16 +327,16 @@ mutex_torture_native_LDADD = \ ../../skins/common/libxenomai.la \ -lpthread -lm -check_vdso_SOURCES = check-vdso.c -check_vdso_CPPFLAGS = \ - @XENO_USER_CFLAGS@ \ - -I$(top_srcdir)/include +...@config_xeno_fastsynch_true@check_vdso_SOURCES = check-vdso.c +...@config_xeno_fastsynch_true@check_vdso_CPPFLAGS = \ +...@config_xeno_fastsynch_true@@XENO_USER_CFLAGS@ \ +...@config_xeno_fastsynch_true@-I$(top_srcdir)/include -check_vdso_LDFLAGS = @XENO_USER_LDFLAGS@ -check_vdso_LDADD = \ - ../../skins/native/libnative.la \ - ../../skins/common/libxenomai.la \ - -lpthread -lm +...@config_xeno_fastsynch_true@check_vdso_LDFLAGS = @XENO_USER_LDFLAGS@ +...@config_xeno_fastsynch_true@check_vdso_LDADD = \ +...@config_xeno_fastsynch_true@../../skins/native/libnative.la \ +...@config_xeno_fastsynch_true@../../skins/common/libxenomai.la \ +...@c
[Xenomai-git] Jan Kiszka : RTDM: Bind deleted sem/event objects, but mark them pending
Module: xenomai-2.5 Branch: master Commit: ea3a001f8ee4decc2029ac28f88da2749d3aea52 URL: http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=ea3a001f8ee4decc2029ac28f88da2749d3aea52 Author: Jan Kiszka Date: Mon Mar 1 17:12:44 2010 +0100 RTDM: Bind deleted sem/event objects, but mark them pending Deleted semaphore and event objects do not necessarily mean that the corresponding RTDM file descriptor is already closed. Moreover, returning -EIDRM on bind makes select return this invalid error to the user. Fix this by binding both object types even if they are marked deleted, but report them as pending. This cures the return value of select on half-closed RTnet TCP sockets. Signed-off-by: Jan Kiszka --- ksrc/skins/rtdm/drvlib.c | 26 ++ 1 files changed, 10 insertions(+), 16 deletions(-) diff --git a/ksrc/skins/rtdm/drvlib.c b/ksrc/skins/rtdm/drvlib.c index 637f99e..fe32f24 100644 --- a/ksrc/skins/rtdm/drvlib.c +++ b/ksrc/skins/rtdm/drvlib.c @@ -1051,8 +1051,6 @@ EXPORT_SYMBOL(rtdm_event_clear); * * @return 0 on success, otherwise: * - * - -EIDRM is returned if @a event has been destroyed. - * * - -ENOMEM is returned if there is insufficient memory to establish the * dynamic binding. * @@ -1080,13 +1078,11 @@ int rtdm_event_select_bind(rtdm_event_t *event, rtdm_selector_t *selector, return -ENOMEM; xnlock_get_irqsave(&nklock, s); - if (unlikely(testbits(event->synch_base.status, RTDM_SYNCH_DELETED))) - err = -EIDRM; - else - err = xnselect_bind(&event->select_block, - binding, selector, type, fd_index, - xnsynch_test_flags(&event->synch_base, - RTDM_EVENT_PENDING)); + err = xnselect_bind(&event->select_block, + binding, selector, type, fd_index, + xnsynch_test_flags(&event->synch_base, + RTDM_SYNCH_DELETED | + RTDM_EVENT_PENDING)); xnlock_put_irqrestore(&nklock, s); if (err) @@ -1337,8 +1333,6 @@ EXPORT_SYMBOL(rtdm_sem_up); * * @return 0 on success, otherwise: * - * - -EIDRM is returned if @a sem has been destroyed. - * * - -ENOMEM is returned if there is insufficient memory to establish the * dynamic binding. * @@ -1366,11 +1360,11 @@ int rtdm_sem_select_bind(rtdm_sem_t *sem, rtdm_selector_t *selector, return -ENOMEM; xnlock_get_irqsave(&nklock, s); - if (unlikely(testbits(sem->synch_base.status, RTDM_SYNCH_DELETED))) - err = -EIDRM; - else - err = xnselect_bind(&sem->select_block, binding, selector, - type, fd_index, (sem->value > 0)); + err = xnselect_bind(&sem->select_block, binding, selector, + type, fd_index, + (sem->value > 0) || + xnsynch_test_flags(&sem->synch_base, + RTDM_SYNCH_DELETED)); xnlock_put_irqrestore(&nklock, s); if (err) ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Jan Kiszka : RTDM+POSIX: Avoid leaking binding objects on errors
Module: xenomai-2.5 Branch: master Commit: cb3cc0959ce7f8c41dcff6073e7513c81c445a0a URL: http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=cb3cc0959ce7f8c41dcff6073e7513c81c445a0a Author: Jan Kiszka Date: Fri Feb 26 18:42:35 2010 +0100 RTDM+POSIX: Avoid leaking binding objects on errors We need to release the allocated xnselect_binding if we fail to hook it into the select block. Signed-off-by: Jan Kiszka --- ksrc/skins/posix/mq.c|1 + ksrc/skins/rtdm/drvlib.c |6 ++ 2 files changed, 7 insertions(+), 0 deletions(-) diff --git a/ksrc/skins/posix/mq.c b/ksrc/skins/posix/mq.c index 11f47c0..02b59fb 100644 --- a/ksrc/skins/posix/mq.c +++ b/ksrc/skins/posix/mq.c @@ -1284,6 +1284,7 @@ int pse51_mq_select_bind(mqd_t fd, struct xnselector *selector, unlock_and_error: xnlock_put_irqrestore(&nklock, s); + xnfree(binding); return err; } #endif /* CONFIG_XENO_OPT_POSIX_SELECT */ diff --git a/ksrc/skins/rtdm/drvlib.c b/ksrc/skins/rtdm/drvlib.c index 5181108..637f99e 100644 --- a/ksrc/skins/rtdm/drvlib.c +++ b/ksrc/skins/rtdm/drvlib.c @@ -1089,6 +1089,9 @@ int rtdm_event_select_bind(rtdm_event_t *event, rtdm_selector_t *selector, RTDM_EVENT_PENDING)); xnlock_put_irqrestore(&nklock, s); + if (err) + xnfree(binding); + return err; } EXPORT_SYMBOL(rtdm_event_select_bind); @@ -1370,6 +1373,9 @@ int rtdm_sem_select_bind(rtdm_sem_t *sem, rtdm_selector_t *selector, type, fd_index, (sem->value > 0)); xnlock_put_irqrestore(&nklock, s); + if (err) + xnfree(binding); + return err; } EXPORT_SYMBOL(rtdm_sem_select_bind); ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Gilles Chanteperdrix : Merge commit 'jan'
Module: xenomai-2.5 Branch: master Commit: 9b49a7c2ca9ee5ec51172ad70cc9dfb7630eef9d URL: http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=9b49a7c2ca9ee5ec51172ad70cc9dfb7630eef9d Author: Gilles Chanteperdrix Date: Mon Mar 1 23:30:53 2010 +0100 Merge commit 'jan' --- ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Jan Kiszka : RTDM: Avoid calling cleanup_instance with held spin lock
Module: xenomai-2.5 Branch: master Commit: 95278926edc559d48b1b178e6b01f91c019fd53c URL: http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=95278926edc559d48b1b178e6b01f91c019fd53c Author: Jan Kiszka Date: Mon Mar 1 17:44:30 2010 +0100 RTDM: Avoid calling cleanup_instance with held spin lock It's cleaner to check for close_lock_count under spin lock from within cleanup_instance than calling it with the lock held. This changes no semantics of the involved functions. Signed-off-by: Jan Kiszka --- ksrc/skins/rtdm/core.c | 45 +++-- 1 files changed, 23 insertions(+), 22 deletions(-) diff --git a/ksrc/skins/rtdm/core.c b/ksrc/skins/rtdm/core.c index 3bc13f1..8677c47 100644 --- a/ksrc/skins/rtdm/core.c +++ b/ksrc/skins/rtdm/core.c @@ -167,11 +167,19 @@ static int create_instance(struct rtdm_device *device, return 0; } -/* call with rt_fildes_lock acquired - will release it */ -static void cleanup_instance(struct rtdm_device *device, -struct rtdm_dev_context *context, -struct rtdm_fildes *fildes, int nrt_mem, spl_t s) +static int cleanup_instance(struct rtdm_device *device, + struct rtdm_dev_context *context, + struct rtdm_fildes *fildes, int nrt_mem) { + spl_t s; + + xnlock_get_irqsave(&rt_fildes_lock, s); + + if (unlikely(atomic_read(&context->close_lock_count) > 1)) { + xnlock_put_irqrestore(&rt_fildes_lock, s); + return -EAGAIN; + } + if (fildes) { clear_bit((fildes - fildes_table), used_fildes); fildes->context = NULL; @@ -192,6 +200,8 @@ static void cleanup_instance(struct rtdm_device *device, } rtdm_dereference_device(device); + + return 0; } int __rt_dev_open(rtdm_user_info_t *user_info, const char *path, int oflag) @@ -199,7 +209,6 @@ int __rt_dev_open(rtdm_user_info_t *user_info, const char *path, int oflag) struct rtdm_device *device; struct rtdm_fildes *fildes; struct rtdm_dev_context *context; - spl_t s; int ret; int nrt_mode = !rtdm_in_rt_context(); @@ -236,8 +245,7 @@ int __rt_dev_open(rtdm_user_info_t *user_info, const char *path, int oflag) return context->fd; cleanup_out: - xnlock_get_irqsave(&rt_fildes_lock, s); - cleanup_instance(device, context, fildes, nrt_mode, s); + cleanup_instance(device, context, fildes, nrt_mode); err_out: return ret; @@ -251,7 +259,6 @@ int __rt_dev_socket(rtdm_user_info_t *user_info, int protocol_family, struct rtdm_device *device; struct rtdm_fildes *fildes; struct rtdm_dev_context *context; - spl_t s; int ret; int nrt_mode = !rtdm_in_rt_context(); @@ -289,8 +296,7 @@ int __rt_dev_socket(rtdm_user_info_t *user_info, int protocol_family, return context->fd; cleanup_out: - xnlock_get_irqsave(&rt_fildes_lock, s); - cleanup_instance(device, context, fildes, nrt_mode, s); + cleanup_instance(device, context, fildes, nrt_mode); err_out: return ret; @@ -348,24 +354,19 @@ again: } else if (unlikely(ret < 0)) goto unlock_out; - xnlock_get_irqsave(&rt_fildes_lock, s); + ret = cleanup_instance(context->device, context, &fildes_table[fd], + test_bit(RTDM_CREATED_IN_NRT, + &context->context_flags)); + if (ret < 0) { + rtdm_context_unlock(context); - if (unlikely(atomic_read(&context->close_lock_count) > 1)) { - xnlock_put_irqrestore(&rt_fildes_lock, s); + if (!nrt_mode) + goto err_out; - if (!nrt_mode) { - ret = -EAGAIN; - goto unlock_out; - } - rtdm_context_unlock(context); msleep(CLOSURE_RETRY_PERIOD); goto again; } - cleanup_instance(context->device, context, &fildes_table[fd], -test_bit(RTDM_CREATED_IN_NRT, &context->context_flags), -s); - trace_mark(xn_rtdm, fd_closed, "fd %d", fd); return ret; ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Jan Kiszka : Avoid false error reports of xeno_handle_mlock_alert
Module: xenomai-2.5 Branch: master Commit: 3c549329e89d06654f6546ccdf623c48975d3d08 URL: http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=3c549329e89d06654f6546ccdf623c48975d3d08 Author: Jan Kiszka Date: Thu Feb 25 23:33:46 2010 +0100 Avoid false error reports of xeno_handle_mlock_alert We already propagate the SIGDEBUG reason to user space. Use it to tell SIGDEBUG_NOMLOCK apart from other triggers of this signal, e.g. the watchdog. This also allows to drop xeno_sigxcpu_no_mlock. Signed-off-by: Jan Kiszka --- include/asm-generic/bits/bind.h|6 +++--- include/asm-generic/bits/mlock_alert.h |4 +--- src/skins/common/bind.c|4 ++-- src/skins/native/task.c| 15 --- src/skins/posix/thread.c |9 - src/skins/psos+/init.c |1 - 6 files changed, 6 insertions(+), 33 deletions(-) diff --git a/include/asm-generic/bits/bind.h b/include/asm-generic/bits/bind.h index 7267e0d..1aeffb5 100644 --- a/include/asm-generic/bits/bind.h +++ b/include/asm-generic/bits/bind.h @@ -9,7 +9,7 @@ union xnsiginfo; typedef void xnsighandler(union xnsiginfo *si); -void xeno_handle_mlock_alert(int sig); +void xeno_handle_mlock_alert(int sig, siginfo_t *si, void *context); int xeno_bind_skin_opt(unsigned skin_magic, const char *skin, @@ -29,9 +29,9 @@ xeno_bind_skin(unsigned skin_magic, const char *skin, exit(EXIT_FAILURE); } - sa.sa_handler = &xeno_handle_mlock_alert; + sa.sa_sigaction = xeno_handle_mlock_alert; sigemptyset(&sa.sa_mask); - sa.sa_flags = 0; + sa.sa_flags = SA_SIGINFO; sigaction(SIGXCPU, &sa, NULL); return muxid; diff --git a/include/asm-generic/bits/mlock_alert.h b/include/asm-generic/bits/mlock_alert.h index 6a4e3cd..5b2f73f 100644 --- a/include/asm-generic/bits/mlock_alert.h +++ b/include/asm-generic/bits/mlock_alert.h @@ -1,8 +1,6 @@ #ifndef _XENO_ASM_GENERIC_BITS_MLOCK_ALERT_H #define _XENO_ASM_GENERIC_BITS_MLOCK_ALERT_H -extern int xeno_sigxcpu_no_mlock; - -void xeno_handle_mlock_alert(int sig); +void xeno_handle_mlock_alert(int sig, siginfo_t *si, void *context); #endif /* _XENO_ASM_GENERIC_BITS_MLOCK_ALERT_H */ diff --git a/src/skins/common/bind.c b/src/skins/common/bind.c index 3967cce..352c4e8 100644 --- a/src/skins/common/bind.c +++ b/src/skins/common/bind.c @@ -154,11 +154,11 @@ void xeno_fault_stack(void) stk[0] = stk[sizeof(stk) - 1] = 0xA5; } -void xeno_handle_mlock_alert(int sig) +void xeno_handle_mlock_alert(int sig, siginfo_t *si, void *context) { struct sigaction sa; - if (xeno_sigxcpu_no_mlock) { + if (si->si_value.sival_int == SIGDEBUG_NOMLOCK) { fprintf(stderr, "Xenomai: process memory not locked " "(missing mlockall?)\n"); fflush(stderr); diff --git a/src/skins/native/task.c b/src/skins/native/task.c index 1dde653..2c0c114 100644 --- a/src/skins/native/task.c +++ b/src/skins/native/task.c @@ -41,7 +41,6 @@ extern pthread_key_t __native_tskey; #endif /* !HAVE___THREAD */ extern int __native_muxid; -extern int xeno_sigxcpu_no_mlock; /* Public Xenomai interface. */ @@ -97,9 +96,6 @@ static void *rt_task_trampoline(void *cookie) xeno_set_current(); - if (iargs->mode & T_WARNSW) - xeno_sigxcpu_no_mlock = 0; - /* Wait on the barrier for the task to be started. The barrier could be released in order to process Linux signals while the Xenomai shadow is still dormant; in such a case, resume wait. */ @@ -231,9 +227,6 @@ int rt_task_shadow(RT_TASK *task, const char *name, int prio, int mode) xeno_set_current(); - if (mode & T_WARNSW) - xeno_sigxcpu_no_mlock = 0; - return 0; fail: @@ -347,14 +340,6 @@ int rt_task_set_mode(int clrmask, int setmask, int *oldmode) __native_task_set_mode, clrmask, setmask, oldmode); - /* Silently deactivate our internal handler for SIGXCPU. At that - point, we know that the process memory has been properly - locked, otherwise we would have caught the latter signal upon - thread creation. */ - - if (!err && xeno_sigxcpu_no_mlock) - xeno_sigxcpu_no_mlock = !(setmask & T_WARNSW); - return err; } diff --git a/src/skins/posix/thread.c b/src/skins/posix/thread.c index 86a6c5d..bc5572f 100644 --- a/src/skins/posix/thread.c +++ b/src/skins/posix/thread.c @@ -330,20 +330,11 @@ int pthread_wait_np(unsigned long *overruns_r) int pthread_set_mode_np(int clrmask, int setmask) { - extern int xeno_sigxcpu_no_mlock; int err; err = -XENOMAI_SKINCALL2(__pse51_muxid, __pse51_thread_set_mode, clrmask, setmask); - /* Silently deactivate our internal handler for SIGXCPU. At that -
[Xenomai-git] Jan Kiszka : RTDM: Consistently use xnsynch_test_flags to test for RTDM_SYNCH_DELETED
Module: xenomai-2.5 Branch: master Commit: aa98bbf55279719cdd1ac08b33262e2c2033c03d URL: http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=aa98bbf55279719cdd1ac08b33262e2c2033c03d Author: Jan Kiszka Date: Mon Mar 1 17:28:20 2010 +0100 RTDM: Consistently use xnsynch_test_flags to test for RTDM_SYNCH_DELETED No functional changes. Signed-off-by: Jan Kiszka --- ksrc/skins/rtdm/drvlib.c |8 +--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ksrc/skins/rtdm/drvlib.c b/ksrc/skins/rtdm/drvlib.c index fe32f24..3b04493 100644 --- a/ksrc/skins/rtdm/drvlib.c +++ b/ksrc/skins/rtdm/drvlib.c @@ -955,7 +955,8 @@ int rtdm_event_timedwait(rtdm_event_t *event, nanosecs_rel_t timeout, xnlock_get_irqsave(&nklock, s); - if (unlikely(testbits(event->synch_base.status, RTDM_SYNCH_DELETED))) + if (unlikely(xnsynch_test_flags(&event->synch_base, + RTDM_SYNCH_DELETED))) err = -EIDRM; else if (likely(xnsynch_test_flags(&event->synch_base, RTDM_EVENT_PENDING))) { @@ -1239,7 +1240,7 @@ int rtdm_sem_timeddown(rtdm_sem_t *sem, nanosecs_rel_t timeout, xnlock_get_irqsave(&nklock, s); - if (unlikely(testbits(sem->synch_base.status, RTDM_SYNCH_DELETED))) + if (unlikely(xnsynch_test_flags(&sem->synch_base, RTDM_SYNCH_DELETED))) err = -EIDRM; else if (sem->value > 0) { if(!--sem->value) @@ -1533,7 +1534,8 @@ int rtdm_mutex_timedlock(rtdm_mutex_t *mutex, nanosecs_rel_t timeout, xnlock_get_irqsave(&nklock, s); - if (unlikely(testbits(mutex->synch_base.status, RTDM_SYNCH_DELETED))) + if (unlikely(xnsynch_test_flags(&mutex->synch_base, + RTDM_SYNCH_DELETED))) err = -EIDRM; else if (likely(xnsynch_owner(&mutex->synch_base) == NULL)) xnsynch_set_owner(&mutex->synch_base, curr_thread); ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Jan Kiszka : RTDM: Add smp barrier to rtdm_context_unlock
Module: xenomai-2.5 Branch: master Commit: d1da9640386a8b256e1475465d818ed87d5dc366 URL: http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=d1da9640386a8b256e1475465d818ed87d5dc366 Author: Jan Kiszka Date: Mon Mar 1 18:00:00 2010 +0100 RTDM: Add smp barrier to rtdm_context_unlock rtdm_context_unlock() is part of the driver API, and is therefore only be called without holding the serializing rt_fildes_lock. Ensure proper ordering of any access to the protected rtdm_dev_context by adding an smp barrier for atomic_dec to rtdm_context_unlock(). Signed-off-by: Jan Kiszka --- include/rtdm/rtdm_driver.h |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/include/rtdm/rtdm_driver.h b/include/rtdm/rtdm_driver.h index 1697b5c..0fc1496 100644 --- a/include/rtdm/rtdm_driver.h +++ b/include/rtdm/rtdm_driver.h @@ -554,6 +554,7 @@ static inline void rtdm_context_lock(struct rtdm_dev_context *context) static inline void rtdm_context_unlock(struct rtdm_dev_context *context) { + smp_mb__before_atomic_dec(); atomic_dec(&context->close_lock_count); } ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Gilles Chanteperdrix : asm-generic: remove any trace of mlock_alert.h, only bind.h needs it
Module: xenomai-2.5 Branch: master Commit: 5fcdfb8f789be4f58c92c73c51ca3e03e2620d87 URL: http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=5fcdfb8f789be4f58c92c73c51ca3e03e2620d87 Author: Gilles Chanteperdrix Date: Tue Mar 2 00:55:00 2010 +0100 asm-generic: remove any trace of mlock_alert.h, only bind.h needs it --- include/asm-generic/bits/Makefile.am |1 - include/asm-generic/bits/Makefile.in |1 - include/asm-generic/bits/mlock_alert.h |6 -- src/skins/native/init.c|1 - src/skins/posix/init.c |1 - src/skins/rtai/init.c |1 - src/skins/uitron/init.c|1 - src/skins/vrtx/init.c |1 - src/skins/vxworks/init.c |1 - src/testsuite/sigtest/sigtest.c|1 - 10 files changed, 0 insertions(+), 15 deletions(-) diff --git a/include/asm-generic/bits/Makefile.am b/include/asm-generic/bits/Makefile.am index 4a60896..4e6e4ec 100644 --- a/include/asm-generic/bits/Makefile.am +++ b/include/asm-generic/bits/Makefile.am @@ -5,7 +5,6 @@ includesub_HEADERS = \ current.h \ heap.h \ intr.h \ - mlock_alert.h \ pod.h \ sigshadow.h \ timeconv.h diff --git a/include/asm-generic/bits/Makefile.in b/include/asm-generic/bits/Makefile.in index 1873032..ffc1817 100644 --- a/include/asm-generic/bits/Makefile.in +++ b/include/asm-generic/bits/Makefile.in @@ -230,7 +230,6 @@ includesub_HEADERS = \ current.h \ heap.h \ intr.h \ - mlock_alert.h \ pod.h \ sigshadow.h \ timeconv.h diff --git a/include/asm-generic/bits/mlock_alert.h b/include/asm-generic/bits/mlock_alert.h deleted file mode 100644 index 5b2f73f..000 --- a/include/asm-generic/bits/mlock_alert.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _XENO_ASM_GENERIC_BITS_MLOCK_ALERT_H -#define _XENO_ASM_GENERIC_BITS_MLOCK_ALERT_H - -void xeno_handle_mlock_alert(int sig, siginfo_t *si, void *context); - -#endif /* _XENO_ASM_GENERIC_BITS_MLOCK_ALERT_H */ diff --git a/src/skins/native/init.c b/src/skins/native/init.c index aa5e41d..e85784a 100644 --- a/src/skins/native/init.c +++ b/src/skins/native/init.c @@ -24,7 +24,6 @@ #include #include #include -#include #include int __native_muxid = -1; diff --git a/src/skins/posix/init.c b/src/skins/posix/init.c index c86ab6e..8ed878b 100644 --- a/src/skins/posix/init.c +++ b/src/skins/posix/init.c @@ -26,7 +26,6 @@ #include #include #include -#include #include #include diff --git a/src/skins/rtai/init.c b/src/skins/rtai/init.c index a050a95..6aa6bd3 100644 --- a/src/skins/rtai/init.c +++ b/src/skins/rtai/init.c @@ -20,7 +20,6 @@ #include #include #include -#include #include int __rtai_muxid = -1; diff --git a/src/skins/uitron/init.c b/src/skins/uitron/init.c index 2ab11f3..b9c7467 100644 --- a/src/skins/uitron/init.c +++ b/src/skins/uitron/init.c @@ -20,7 +20,6 @@ #include #include #include -#include #include int __uitron_muxid = -1; diff --git a/src/skins/vrtx/init.c b/src/skins/vrtx/init.c index 52abf7e..e119867 100644 --- a/src/skins/vrtx/init.c +++ b/src/skins/vrtx/init.c @@ -24,7 +24,6 @@ #include #include #include -#include int __vrtx_muxid = -1; diff --git a/src/skins/vxworks/init.c b/src/skins/vxworks/init.c index 48bd3df..e274e02 100644 --- a/src/skins/vxworks/init.c +++ b/src/skins/vxworks/init.c @@ -24,7 +24,6 @@ #include #include #include -#include int __vxworks_muxid = -1; diff --git a/src/testsuite/sigtest/sigtest.c b/src/testsuite/sigtest/sigtest.c index 1e80317..93c3e5a 100644 --- a/src/testsuite/sigtest/sigtest.c +++ b/src/testsuite/sigtest/sigtest.c @@ -9,7 +9,6 @@ #include #endif /* !__UCLIBC__ */ -#include #include #include #include ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Gilles Chanteperdrix : libxenomai: make xnsysinfo static, its contents depend on the skin
Module: xenomai-2.5 Branch: master Commit: 5c5d6bee6c57f7bb8336036c35fe6825ba38a339 URL: http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=5c5d6bee6c57f7bb8336036c35fe6825ba38a339 Author: Gilles Chanteperdrix Date: Tue Mar 2 01:03:58 2010 +0100 libxenomai: make xnsysinfo static, its contents depend on the skin --- src/skins/common/timeconv.c | 10 +++--- src/skins/posix/clock.c | 16 +++- src/skins/posix/init.c |5 + 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/src/skins/common/timeconv.c b/src/skins/common/timeconv.c index 87a0ba2..931c5eb 100644 --- a/src/skins/common/timeconv.c +++ b/src/skins/common/timeconv.c @@ -25,21 +25,25 @@ #include #include -xnsysinfo_t sysinfo; +static unsigned long long xeno_cpufreq; static void xeno_init_timeconv_inner(void) { - xnarch_init_timeconv(sysinfo.cpufreq); + xnarch_init_timeconv(xeno_cpufreq); } void xeno_init_timeconv(int muxid) { static pthread_once_t init_timeconv_once = PTHREAD_ONCE_INIT; - int err = XENOMAI_SYSCALL2(__xn_sys_info, muxid, &sysinfo); + xnsysinfo_t sysinfo; + int err; + + err = XENOMAI_SYSCALL2(__xn_sys_info, muxid, &sysinfo); if (err) { fprintf(stderr, "Xenomai: sys_info failed: %s\n", strerror(-err)); exit(EXIT_FAILURE); } + xeno_cpufreq = sysinfo.cpufreq; pthread_once(&init_timeconv_once, &xeno_init_timeconv_inner); } diff --git a/src/skins/posix/clock.c b/src/skins/posix/clock.c index 7b2e42d..e27a2ec 100644 --- a/src/skins/posix/clock.c +++ b/src/skins/posix/clock.c @@ -28,6 +28,20 @@ extern int __pse51_muxid; +#ifdef XNARCH_HAVE_NONPRIV_TSC +static xnsysinfo_t __pse51_sysinfo; + +void pse51_clock_init(int muxid) +{ + int err = -XENOMAI_SYSCALL2(__xn_sys_info, muxid, &__pse51_sysinfo); + if (err) { + fprintf(stderr, "Xenomai Posix skin init: " + "sys_info: %s\n", strerror(err)); + exit(EXIT_FAILURE); + } +} +#endif /* XNARCH_HAVE_NONPRIV_TSC */ + int __wrap_clock_getres(clockid_t clock_id, struct timespec *tp) { int err = -XENOMAI_SKINCALL2(__pse51_muxid, @@ -46,7 +60,7 @@ int __wrap_clock_gettime(clockid_t clock_id, struct timespec *tp) { int err; #ifdef XNARCH_HAVE_NONPRIV_TSC - if (clock_id == CLOCK_MONOTONIC && sysinfo.tickval == 1) { + if (clock_id == CLOCK_MONOTONIC && __pse51_sysinfo.tickval == 1) { unsigned long long ns; unsigned long rem; diff --git a/src/skins/posix/init.c b/src/skins/posix/init.c index 8ed878b..20ae526 100644 --- a/src/skins/posix/init.c +++ b/src/skins/posix/init.c @@ -41,6 +41,7 @@ int __rtdm_fd_start = INT_MAX; static int fork_handler_registered; int __wrap_pthread_setschedparam(pthread_t, int, const struct sched_param *); +void pse51_clock_init(int); static __attribute__ ((constructor)) void __init_posix_interface(void) @@ -53,6 +54,10 @@ void __init_posix_interface(void) muxid = xeno_bind_skin(PSE51_SKIN_MAGIC, "POSIX", "xeno_posix", NULL); +#ifdef XNARCH_HAVE_NONPRIV_TSC + pse51_clock_init(muxid); +#endif /* XNARCH_HAVE_NONPRIV_TSC */ + __pse51_muxid = __xn_mux_shifted_id(muxid); muxid = XENOMAI_SYSBIND(RTDM_SKIN_MAGIC, ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Gilles Chanteperdrix : xeno-config: fix typo
Module: xenomai-2.5 Branch: master Commit: 368844e91b15fc179f16710fd70679caefa5aea3 URL: http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=368844e91b15fc179f16710fd70679caefa5aea3 Author: Gilles Chanteperdrix Date: Tue Mar 2 01:28:38 2010 +0100 xeno-config: fix typo --- scripts/xeno-config.in |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/scripts/xeno-config.in b/scripts/xeno-config.in index 3cbdd04..d39998e 100644 --- a/scripts/xeno-config.in +++ b/scripts/xeno-config.in @@ -116,7 +116,7 @@ while test $# -gt 0; do if [ "x$skin" = "xpsos" ]; then skin="psos+" fi - echo $XENO_BASE_CFLAGS -I{staging}${includedir}/$skin + echo $XENO_BASE_CFLAGS -I${staging}${includedir}/$skin ;; "") echo skin not set, please pass --skin before --cflags 1>&2 ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Gilles Chanteperdrix : xeno-config: support --skin= foo option in addition to --skin foo
Module: xenomai-2.5 Branch: master Commit: 6d1edfb9259413f4b3fa89ac5e56e08de60bcf0d URL: http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=6d1edfb9259413f4b3fa89ac5e56e08de60bcf0d Author: Gilles Chanteperdrix Date: Tue Mar 2 01:33:52 2010 +0100 xeno-config: support --skin=foo option in addition to --skin foo --- scripts/xeno-config.in |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/scripts/xeno-config.in b/scripts/xeno-config.in index d39998e..e3e1b56 100644 --- a/scripts/xeno-config.in +++ b/scripts/xeno-config.in @@ -107,6 +107,9 @@ while test $# -gt 0; do skin="$2" shift ;; + --skin=*) + skin=`expr "$1" : '--skin=\(.*\)'` + ;; --cflags) case "$skin" in native|rtdm) ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git