[Xenomai-git] Philippe Gerum : copperplate/clockobj, alchemy: sanitize clockobj_get_time () interface
Module: xenomai-forge Branch: next Commit: 3d43735528324673626b306f6bb40b42cd5abed6 URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=3d43735528324673626b306f6bb40b42cd5abed6 Author: Philippe Gerum Date: Wed Sep 24 12:10:08 2014 +0200 copperplate/clockobj, alchemy: sanitize clockobj_get_time() interface --- include/alchemy/timer.h| 19 + include/copperplate/clockobj.h |3 +-- lib/alchemy/task.c |2 +- lib/alchemy/timer.c| 26 ++- lib/copperplate/clockobj.c | 46 5 files changed, 37 insertions(+), 59 deletions(-) diff --git a/include/alchemy/timer.h b/include/alchemy/timer.h index c85d80f..fc33db9 100644 --- a/include/alchemy/timer.h +++ b/include/alchemy/timer.h @@ -99,6 +99,25 @@ int alchemy_poll_mode(const struct timespec *abs_timeout) extern "C" { #endif +/** + * @fn RTIME rt_timer_read(void) + * @brief Return the current system time. + * + * Return the current time maintained by the Xenomai core clock. + * + * @return The current time expressed in clock ticks (see note). + * + * @apitags{unrestricted} + * + * @note The @a time value is a multiple of the Alchemy clock + * resolution (see --alchemy-clock-resolution option, defaults to 1 + * nanosecond). + */ +static inline RTIME rt_timer_read(void) +{ + return clockobj_get_time(&alchemy_clock); +} + static inline RTIME rt_timer_tsc(void) { return clockobj_get_tsc(); diff --git a/include/copperplate/clockobj.h b/include/copperplate/clockobj.h index 1543589..f480214 100644 --- a/include/copperplate/clockobj.h +++ b/include/copperplate/clockobj.h @@ -71,8 +71,7 @@ void clockobj_set_date(struct clockobj *clkobj, ticks_t ticks); void clockobj_get_date(struct clockobj *clkobj, ticks_t *pticks); -void clockobj_get_time(struct clockobj *clkobj, - ticks_t *pticks, ticks_t *ptsc); +ticks_t clockobj_get_time(struct clockobj *clkobj); void clockobj_get_distance(struct clockobj *clkobj, const struct itimerspec *itm, diff --git a/lib/alchemy/task.c b/lib/alchemy/task.c index bd309c9..c9ec272 100644 --- a/lib/alchemy/task.c +++ b/lib/alchemy/task.c @@ -959,7 +959,7 @@ int rt_task_sleep_until(RTIME date) if (date == TM_INFINITE) ts = zero_time; else { - clockobj_get_time(&alchemy_clock, &now, NULL); + now = clockobj_get_time(&alchemy_clock); if (date <= now) return -ETIMEDOUT; CANCEL_DEFER(svc); diff --git a/lib/alchemy/timer.c b/lib/alchemy/timer.c index dfe4f6d..323273c 100644 --- a/lib/alchemy/timer.c +++ b/lib/alchemy/timer.c @@ -31,29 +31,6 @@ struct clockobj alchemy_clock; /** - * @fn RTIME rt_timer_read(void) - * @brief Return the current system time. - * - * Return the current time maintained by the Xenomai core clock. - * - * @return The current time expressed in clock ticks (see note). - * - * @apitags{unrestricted} - * - * @note The @a time value is a multiple of the Alchemy clock - * resolution (see --alchemy-clock-resolution option, defaults to 1 - * nanosecond). - */ -RTIME rt_timer_read(void) -{ - ticks_t ticks; - - clockobj_get_time(&alchemy_clock, &ticks, NULL); - - return ticks; -} - -/** * @fn RTIME rt_timer_ns2ticks(SRTIME ns) * @brief Convert nanoseconds to Alchemy clock ticks. * @@ -113,7 +90,8 @@ SRTIME rt_timer_ticks2ns(SRTIME ticks) int rt_timer_inquire(RT_TIMER_INFO *info) { info->period = clockobj_get_resolution(&alchemy_clock); - clockobj_get_time(&alchemy_clock, &info->date, &info->tsc); + info->date = clockobj_get_time(&alchemy_clock); + info->tsc = clockobj_get_tsc(); return 0; } diff --git a/lib/copperplate/clockobj.c b/lib/copperplate/clockobj.c index 1b6f5f6..8ee3ed7 100644 --- a/lib/copperplate/clockobj.c +++ b/lib/copperplate/clockobj.c @@ -237,21 +237,18 @@ ticks_t clockobj_get_tsc(void) { struct timespec now; - /* Rare case with legacy uClibc+linuxthreads combo. */ + /* +* Rare case with legacy uClibc+linuxthreads combo over +* Cobalt, we actually return nanoseconds just like in the +* Mercury case. +*/ __RT(clock_gettime(CLOCK_REALTIME, &now)); return xnarch_ullmul(now.tv_sec, 10) + now.tv_nsec; } -void clockobj_get_time(struct clockobj *clkobj, - ticks_t *pticks, ticks_t *ptsc) +ticks_t clockobj_get_time(struct clockobj *clkobj) { - ticks_t ns; - - ns = clockobj_get_tsc(); - if (ptsc) - *ptsc = ns; - - *pticks = clockobj_ns_to_ticks(clkobj, ns); + return clockobj_ns_to_ticks(clkobj, clockobj_get_tsc()); } #else /* !CONFIG_XENO_COPPERPLATE_CLOCK_RESTRICTED */ @@ -266,17 +263,10 @@ ticks_t clockobj_get_tsc(void) return cobalt_read_tsc(); } -void clockobj_get_time(struct
[Xenomai-git] Philippe Gerum : cobalt/rtdm: save open flags in rtdm_fd descriptor
Module: xenomai-forge Branch: next Commit: ca7abf7612d8579ec79cf28f349feb6c45f4bdb7 URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=ca7abf7612d8579ec79cf28f349feb6c45f4bdb7 Author: Philippe Gerum Date: Wed Sep 24 11:56:55 2014 +0200 cobalt/rtdm: save open flags in rtdm_fd descriptor --- include/cobalt/kernel/rtdm/fd.h |6 ++ kernel/cobalt/rtdm/core.c |1 + 2 files changed, 7 insertions(+) diff --git a/include/cobalt/kernel/rtdm/fd.h b/include/cobalt/kernel/rtdm/fd.h index ec327b3..cf47fcb 100644 --- a/include/cobalt/kernel/rtdm/fd.h +++ b/include/cobalt/kernel/rtdm/fd.h @@ -298,6 +298,7 @@ struct rtdm_fd { struct cobalt_ppd *owner; unsigned int refs; int minor; + int oflags; struct list_head cleanup; }; @@ -317,6 +318,11 @@ static inline int rtdm_fd_minor(struct rtdm_fd *fd) return fd->minor; } +static inline int rtdm_fd_flags(struct rtdm_fd *fd) +{ + return fd->oflags; +} + int rtdm_fd_enter(struct rtdm_fd *rtdm_fd, int ufd, unsigned int magic, struct rtdm_fd_ops *ops); diff --git a/kernel/cobalt/rtdm/core.c b/kernel/cobalt/rtdm/core.c index f5c82f7..cdb0483 100644 --- a/kernel/cobalt/rtdm/core.c +++ b/kernel/cobalt/rtdm/core.c @@ -172,6 +172,7 @@ int __rtdm_dev_open(const char *path, int oflag) goto fail_create; context->fd.minor = dev->minor; + context->fd.oflags = oflag; trace_cobalt_fd_open(current, &context->fd, ufd, oflag); ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : scripts/xeno-config: accept nop switch --posix over Mercury
Module: xenomai-forge Branch: next Commit: 7ad6bab8a9fc418f5bb246c8676f0ada5dcbbf7c URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=7ad6bab8a9fc418f5bb246c8676f0ada5dcbbf7c Author: Philippe Gerum Date: Wed Sep 24 10:20:42 2014 +0200 scripts/xeno-config: accept nop switch --posix over Mercury --- scripts/xeno-config-mercury.in |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/xeno-config-mercury.in b/scripts/xeno-config-mercury.in index 4e0cdc3..2ac6fd8 100644 --- a/scripts/xeno-config-mercury.in +++ b/scripts/xeno-config-mercury.in @@ -34,7 +34,7 @@ Options : --ccld --arch --prefix ---[skin=]vxworks|psos|alchemy|rtdm|smokey +--[skin=]posix|vxworks|psos|alchemy|rtdm|smokey --auto-init|no-auto-init --cflags --ldflags @@ -118,7 +118,7 @@ while test $# -gt 0; do skin_list="$skin_list `expr "$1" : '--skin=\(.*\)'`" fi ;; - --vxworks|--psos|--alchemy|--rtdm|--smokey) + --posix|--vxworks|--psos|--alchemy|--rtdm|--smokey) skin_list="$skin_list `expr "$1" : '--\(.*\)'`" ;; --cflags) @@ -166,6 +166,8 @@ while test $# -gt 0; do ldflags="$WRAP_MAIN $XENO_BASE_LDFLAGS" for skin in $skin_list; do case "$skin" in + posix) + ;; vxworks|psos|alchemy|smokey) ldflags="-l$skin $ldflags" ;; ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : alchemy/timer: drop useless return value from rt_timer_inquire()
Module: xenomai-forge Branch: next Commit: 5709dc849befb917e83398177121870f483a76d2 URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=5709dc849befb917e83398177121870f483a76d2 Author: Philippe Gerum Date: Wed Sep 24 12:14:40 2014 +0200 alchemy/timer: drop useless return value from rt_timer_inquire() --- include/alchemy/timer.h |2 +- lib/alchemy/timer.c |8 ++-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/include/alchemy/timer.h b/include/alchemy/timer.h index fc33db9..5c1cc08 100644 --- a/include/alchemy/timer.h +++ b/include/alchemy/timer.h @@ -139,7 +139,7 @@ SRTIME rt_timer_ticks2ns(SRTIME ticks); RTIME rt_timer_read(void); -int rt_timer_inquire(RT_TIMER_INFO *info); +void rt_timer_inquire(RT_TIMER_INFO *info); void rt_timer_spin(RTIME ns); diff --git a/lib/alchemy/timer.c b/lib/alchemy/timer.c index 323273c..d37a9d7 100644 --- a/lib/alchemy/timer.c +++ b/lib/alchemy/timer.c @@ -75,7 +75,7 @@ SRTIME rt_timer_ticks2ns(SRTIME ticks) } /** - * @fn int rt_timer_inquire(RT_TIMER_INFO *info) + * @fn void rt_timer_inquire(RT_TIMER_INFO *info) * @brief Inquire about the Xenomai core timer. * * Return status information of the Xenomai core timer. @@ -83,17 +83,13 @@ SRTIME rt_timer_ticks2ns(SRTIME ticks) * @param info The address of a structure the status data will be * written to. * - * @return This service always returns 0. - * * @apitags{unrestricted} */ -int rt_timer_inquire(RT_TIMER_INFO *info) +void rt_timer_inquire(RT_TIMER_INFO *info) { info->period = clockobj_get_resolution(&alchemy_clock); info->date = clockobj_get_time(&alchemy_clock); info->tsc = clockobj_get_tsc(); - - return 0; } /** ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : copperplate/clockobj: fix restricted clock mode
Module: xenomai-forge Branch: next Commit: 11fa6a474dfcc72cbef51703e7f984eb93a681f3 URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=11fa6a474dfcc72cbef51703e7f984eb93a681f3 Author: Philippe Gerum Date: Wed Sep 24 11:45:26 2014 +0200 copperplate/clockobj: fix restricted clock mode --- lib/copperplate/clockobj.c | 60 ++-- 1 file changed, 41 insertions(+), 19 deletions(-) diff --git a/lib/copperplate/clockobj.c b/lib/copperplate/clockobj.c index fe823c7..1b6f5f6 100644 --- a/lib/copperplate/clockobj.c +++ b/lib/copperplate/clockobj.c @@ -231,51 +231,73 @@ int clockobj_set_resolution(struct clockobj *clkobj, unsigned int resolution_ns) #include #include +#ifdef CONFIG_XENO_COPPERPLATE_CLOCK_RESTRICTED + ticks_t clockobj_get_tsc(void) { -#ifdef CONFIG_XENO_COPPERPLATE_CLOCK_RESTRICTED - /* Rare case with legacy uClibc+linuxthreads combo. */ struct timespec now; + + /* Rare case with legacy uClibc+linuxthreads combo. */ __RT(clock_gettime(CLOCK_REALTIME, &now)); return xnarch_ullmul(now.tv_sec, 10) + now.tv_nsec; -#else - /* Guaranteed to be the source of CLOCK_COPPERPLATE. */ - return cobalt_read_tsc(); -#endif } -#ifndef CONFIG_XENO_LORES_CLOCK_DISABLED - -sticks_t clockobj_ns_to_ticks(struct clockobj *clkobj, sticks_t ns) +void clockobj_get_time(struct clockobj *clkobj, + ticks_t *pticks, ticks_t *ptsc) { - /* Cobalt has optimized arith ops, use them. */ - return xnarch_ulldiv(ns, clkobj->resolution, NULL); + ticks_t ns; + + ns = clockobj_get_tsc(); + if (ptsc) + *ptsc = ns; + + *pticks = clockobj_ns_to_ticks(clkobj, ns); } -#endif /* !CONFIG_XENO_LORES_CLOCK_DISABLED */ +#else /* !CONFIG_XENO_COPPERPLATE_CLOCK_RESTRICTED */ + +/* + * NOTE: we can't inline this routine, as we don't want to expose + * lib/cobalt/arch/.../include/asm/xenomai/tsc.h. + */ +ticks_t clockobj_get_tsc(void) +{ + /* Guaranteed to be the source of CLOCK_COPPERPLATE. */ + return cobalt_read_tsc(); +} void clockobj_get_time(struct clockobj *clkobj, ticks_t *pticks, ticks_t *ptsc) { - unsigned long long ns, tsc; + ticks_t ns, tsc; tsc = cobalt_read_tsc(); - ns = cobalt_ticks_to_ns_rounded(tsc); - if (clockobj_get_resolution(clkobj) > 1) - ns /= clockobj_get_resolution(clkobj); - *pticks = ns; - if (ptsc) *ptsc = tsc; + + ns = cobalt_ticks_to_ns_rounded(tsc); + *pticks = clockobj_ns_to_ticks(clkobj, ns); } +#endif /* !CONFIG_XENO_COPPERPLATE_CLOCK_RESTRICTED */ + +#ifndef CONFIG_XENO_LORES_CLOCK_DISABLED + +sticks_t clockobj_ns_to_ticks(struct clockobj *clkobj, sticks_t ns) +{ + /* Cobalt has optimized arith ops, use them. */ + return xnarch_ulldiv(ns, clkobj->resolution, NULL); +} + +#endif /* !CONFIG_XENO_LORES_CLOCK_DISABLED */ + void clockobj_get_date(struct clockobj *clkobj, ticks_t *pticks) { unsigned long long ns; read_lock_nocancel(&clkobj->lock); - ns = cobalt_ticks_to_ns(cobalt_read_tsc()); + ns = cobalt_ticks_to_ns(clockobj_get_tsc()); /* Add offset to epoch. */ ns += (unsigned long long)clkobj->offset.tv_sec * 10ULL; ns += clkobj->offset.tv_nsec; ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : copperplate/clockobj: cobalt: used rounded conversion to ns in clockobj_get_time()
Module: xenomai-forge Branch: next Commit: 99c9d3c6f6f521c4aad4b8d98ebd402ce5dc58df URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=99c9d3c6f6f521c4aad4b8d98ebd402ce5dc58df Author: Philippe Gerum Date: Tue Sep 23 15:50:53 2014 +0200 copperplate/clockobj: cobalt: used rounded conversion to ns in clockobj_get_time() --- lib/copperplate/clockobj.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/copperplate/clockobj.c b/lib/copperplate/clockobj.c index 18c45ca..fe823c7 100644 --- a/lib/copperplate/clockobj.c +++ b/lib/copperplate/clockobj.c @@ -260,7 +260,7 @@ void clockobj_get_time(struct clockobj *clkobj, unsigned long long ns, tsc; tsc = cobalt_read_tsc(); - ns = cobalt_ticks_to_ns(tsc); + ns = cobalt_ticks_to_ns_rounded(tsc); if (clockobj_get_resolution(clkobj) > 1) ns /= clockobj_get_resolution(clkobj); *pticks = ns; ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : testsuite/latency: check input for sampling period
Module: xenomai-forge Branch: next Commit: a2abebd6adce35d5e1618c068b6cf74cd789cf6f URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=a2abebd6adce35d5e1618c068b6cf74cd789cf6f Author: Philippe Gerum Date: Tue Sep 23 17:16:19 2014 +0200 testsuite/latency: check input for sampling period --- testsuite/latency/latency.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/testsuite/latency/latency.c b/testsuite/latency/latency.c index 9e6aefd..862e15d 100644 --- a/testsuite/latency/latency.c +++ b/testsuite/latency/latency.c @@ -20,15 +20,15 @@ pthread_t latency_task, display_task; sem_t *display_sem; -#define TEN_MILLION1000 #define ONE_BILLION10 +#define TEN_MILLIONS 1000 #define HIPRIO 99 #define LOPRIO 0 unsigned max_relaxed; long minjitter, maxjitter, avgjitter; -long gminjitter = TEN_MILLION, gmaxjitter = -TEN_MILLION, goverrun = 0; +long gminjitter = TEN_MILLIONS, gmaxjitter = -TEN_MILLIONS, goverrun = 0; long long gavgjitter = 0; long long period_ns = 0; @@ -56,9 +56,6 @@ const char *test_mode_names[] = { time_t test_start, test_end; /* report test duration */ int test_loops = 0;/* outer loop count */ -#define MEASURE_PERIOD ONE_BILLION -#define SAMPLE_COUNT (MEASURE_PERIOD / period_ns) - /* Warmup time : in order to avoid spurious cache effects on low-end machines. */ #define WARMUP_TIME 1 #define HISTOGRAM_CELLS 300 @@ -122,7 +119,7 @@ static void *latency(void *cookie) } fault_threshold = CONFIG_XENO_DEFAULT_PERIOD; - nsamples = ONE_BILLION / period_ns; + nsamples = (long long)ONE_BILLION / period_ns; /* start time: one millisecond from now. */ expected.tv_nsec += 100; if (expected.tv_nsec > ONE_BILLION) { @@ -141,7 +138,7 @@ static void *latency(void *cookie) } for (;;) { - long minj = TEN_MILLION, maxj = -TEN_MILLION, dt; + long minj = TEN_MILLIONS, maxj = -TEN_MILLIONS, dt; long overrun = 0; long long sumj; test_loops++; @@ -611,6 +608,10 @@ int main(int argc, char *const *argv) case 'p': period_ns = atoi(optarg) * 1000LL; + if (period_ns > ONE_BILLION) { + fprintf(stderr, "latency: invalid period (> 1s).\n"); + exit(2); + } break; case 'l': ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : cobalt/kernel: enable auto-tuner by default
Module: xenomai-forge Branch: next Commit: d3b7499c107ab175b3753b5f8e894fa45d8c7765 URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=d3b7499c107ab175b3753b5f8e894fa45d8c7765 Author: Philippe Gerum Date: Tue Sep 23 16:51:55 2014 +0200 cobalt/kernel: enable auto-tuner by default --- kernel/cobalt/Kconfig |2 +- kernel/cobalt/arch/x86/Kconfig |3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/kernel/cobalt/Kconfig b/kernel/cobalt/Kconfig index c80ae91..207484f 100644 --- a/kernel/cobalt/Kconfig +++ b/kernel/cobalt/Kconfig @@ -166,7 +166,7 @@ config XENO_OPT_RR_QUANTUM config XENO_OPT_AUTOTUNE bool "Auto-tuning" -default y if XENO_ARCH_AUTOTUNE +default y select XENO_DRIVERS_AUTOTUNE help Enable auto-tuning capabilities. Auto-tuning is used for diff --git a/kernel/cobalt/arch/x86/Kconfig b/kernel/cobalt/arch/x86/Kconfig index cc85389..72e539a 100644 --- a/kernel/cobalt/arch/x86/Kconfig +++ b/kernel/cobalt/arch/x86/Kconfig @@ -1,9 +1,6 @@ config XENO_ARCH_FPU def_bool y -config XENO_ARCH_AUTOTUNE - def_bool y - config XENO_ARCH_X32 def_bool X86_X32 select XENO_OPT_SYS3264 ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : demo/alchemy/latency: revamp for removing legacy
Module: xenomai-forge Branch: next Commit: 1d290f9b623aa450a59ced64b6455e94bf95d41e URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=1d290f9b623aa450a59ced64b6455e94bf95d41e Author: Philippe Gerum Date: Tue Sep 23 17:16:29 2014 +0200 demo/alchemy/latency: revamp for removing legacy NOTE: we stop using TSC as the time reference unit, as this is unreliable for long durations, due to accumulated rounding errors. --- demo/alchemy/Makefile.am |9 ++ demo/alchemy/Makefile.in |9 ++ demo/alchemy/latency.c | 229 +- 3 files changed, 101 insertions(+), 146 deletions(-) diff --git a/demo/alchemy/Makefile.am b/demo/alchemy/Makefile.am index c2bd0e5..406bccb 100644 --- a/demo/alchemy/Makefile.am +++ b/demo/alchemy/Makefile.am @@ -22,3 +22,12 @@ latency_SOURCES = latency.c latency_CPPFLAGS = $(cppflags) latency_LDADD = $(ldadd) -lpthread -lrt -lm latency_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@ $(XENO_POSIX_WRAPPERS) + +# This demo mixes the Alchemy and Xenomai-enabled POSIX APIs over +# Cobalt, so we ask for both set of flags. --posix along with +# --ldflags will get us the linker switches causing the symbol +# wrapping for open/read/write/ioctl and friends. Over Mercury, +# --posix is ignored since it's implicitly enabled. +# +# CFLAGS = $(shell xeno-config --alchemy --posix --cflags) +# LDFLAGS = $(shell xeno-config --alchemy --posix --ldflags) diff --git a/demo/alchemy/Makefile.in b/demo/alchemy/Makefile.in index b7abefa..f606a03 100644 --- a/demo/alchemy/Makefile.in +++ b/demo/alchemy/Makefile.in @@ -816,6 +816,15 @@ uninstall-am: uninstall-demoPROGRAMS uninstall-am uninstall-demoPROGRAMS +# This demo mixes the Alchemy and Xenomai-enabled POSIX APIs over +# Cobalt, so we ask for both set of flags. --posix along with +# --ldflags will get us the linker switches causing the symbol +# wrapping for open/read/write/ioctl and friends. Over Mercury, +# --posix is ignored since it's implicitly enabled. +# +# CFLAGS = $(shell xeno-config --alchemy --posix --cflags) +# LDFLAGS = $(shell xeno-config --alchemy --posix --ldflags) + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/demo/alchemy/latency.c b/demo/alchemy/latency.c index 70c717e..7d1bf0a 100644 --- a/demo/alchemy/latency.c +++ b/demo/alchemy/latency.c @@ -3,12 +3,10 @@ #include #include #include -#include #include #include -#include -#include #include +#include #include #include #include @@ -30,8 +28,7 @@ long long period_ns = 0; int test_duration = 0; /* sec of testing, via -T , 0 is inf */ int data_lines = 21; /* data lines per header line, -l to change */ int quiet = 0; /* suppress printing of RTH, RTD lines when -T given */ -int benchdev_no = 0; -int benchdev = -1; +int devfd = -1; int freeze_max = 0; int priority = T_HIPRIO; int stop_upon_switch = 0; @@ -51,9 +48,6 @@ const char *test_mode_names[] = { time_t test_start, test_end; /* report test duration */ int test_loops = 0;/* outer loop count */ -#define MEASURE_PERIOD ONE_BILLION -#define SAMPLE_COUNT (MEASURE_PERIOD / period_ns) - /* Warmup time : in order to avoid spurious cache effects on low-end machines. */ #define WARMUP_TIME 1 #define HISTOGRAM_CELLS 300 @@ -69,52 +63,39 @@ int bucketsize = 1000; /* default = 1000ns, -B to override */ static inline void add_histogram(long *histogram, long addval) { /* bucketsize steps */ - long inabs = - rt_timer_tsc2ns(addval >= 0 ? addval : -addval) / bucketsize; + long inabs = (addval >= 0 ? addval : -addval) / bucketsize; histogram[inabs < histogram_size ? inabs : histogram_size - 1]++; } static void latency(void *cookie) { - int err, count, nsamples, warmup = 1; - RTIME expected_tsc, period_tsc, start_ticks, fault_threshold; - RT_TIMER_INFO timer_info; - unsigned old_relaxed = 0; - - err = rt_timer_inquire(&timer_info); - - if (err) { - fprintf(stderr, "latency: rt_timer_inquire, code %d\n", err); - return; - } - - fault_threshold = rt_timer_ns2tsc(CONFIG_XENO_DEFAULT_PERIOD); - nsamples = ONE_BILLION / period_ns; - period_tsc = rt_timer_ns2tsc(period_ns); - /* start time: one millisecond from now. */ - start_ticks = timer_info.date + rt_timer_ns2ticks(100); - expected_tsc = timer_info.tsc + rt_timer_ns2tsc(100); - - err = rt_task_set_periodic(NULL, start_ticks, - rt_timer_ns2ticks(period_ns)); - if (err) { + RTIME expected_ns, start_ns, fault_threshold; + unsigned int old_relaxed = 0, new_relaxed; + int ret, count, nsamples, warmup = 1; + long minj, maxj, dt, overrun, sumj; + unsigned long ov; + + fault_threshold = CONFIG_XENO
[Xenomai-git] Philippe Gerum : cobalt/rtdm: save open flags in rtdm_fd descriptor
Module: xenomai-forge Branch: master Commit: ca7abf7612d8579ec79cf28f349feb6c45f4bdb7 URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=ca7abf7612d8579ec79cf28f349feb6c45f4bdb7 Author: Philippe Gerum Date: Wed Sep 24 11:56:55 2014 +0200 cobalt/rtdm: save open flags in rtdm_fd descriptor --- include/cobalt/kernel/rtdm/fd.h |6 ++ kernel/cobalt/rtdm/core.c |1 + 2 files changed, 7 insertions(+) diff --git a/include/cobalt/kernel/rtdm/fd.h b/include/cobalt/kernel/rtdm/fd.h index ec327b3..cf47fcb 100644 --- a/include/cobalt/kernel/rtdm/fd.h +++ b/include/cobalt/kernel/rtdm/fd.h @@ -298,6 +298,7 @@ struct rtdm_fd { struct cobalt_ppd *owner; unsigned int refs; int minor; + int oflags; struct list_head cleanup; }; @@ -317,6 +318,11 @@ static inline int rtdm_fd_minor(struct rtdm_fd *fd) return fd->minor; } +static inline int rtdm_fd_flags(struct rtdm_fd *fd) +{ + return fd->oflags; +} + int rtdm_fd_enter(struct rtdm_fd *rtdm_fd, int ufd, unsigned int magic, struct rtdm_fd_ops *ops); diff --git a/kernel/cobalt/rtdm/core.c b/kernel/cobalt/rtdm/core.c index f5c82f7..cdb0483 100644 --- a/kernel/cobalt/rtdm/core.c +++ b/kernel/cobalt/rtdm/core.c @@ -172,6 +172,7 @@ int __rtdm_dev_open(const char *path, int oflag) goto fail_create; context->fd.minor = dev->minor; + context->fd.oflags = oflag; trace_cobalt_fd_open(current, &context->fd, ufd, oflag); ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : copperplate/clockobj: cobalt: used rounded conversion to ns in clockobj_get_time()
Module: xenomai-forge Branch: master Commit: 99c9d3c6f6f521c4aad4b8d98ebd402ce5dc58df URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=99c9d3c6f6f521c4aad4b8d98ebd402ce5dc58df Author: Philippe Gerum Date: Tue Sep 23 15:50:53 2014 +0200 copperplate/clockobj: cobalt: used rounded conversion to ns in clockobj_get_time() --- lib/copperplate/clockobj.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/copperplate/clockobj.c b/lib/copperplate/clockobj.c index 18c45ca..fe823c7 100644 --- a/lib/copperplate/clockobj.c +++ b/lib/copperplate/clockobj.c @@ -260,7 +260,7 @@ void clockobj_get_time(struct clockobj *clkobj, unsigned long long ns, tsc; tsc = cobalt_read_tsc(); - ns = cobalt_ticks_to_ns(tsc); + ns = cobalt_ticks_to_ns_rounded(tsc); if (clockobj_get_resolution(clkobj) > 1) ns /= clockobj_get_resolution(clkobj); *pticks = ns; ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : copperplate/clockobj: fix restricted clock mode
Module: xenomai-forge Branch: master Commit: 11fa6a474dfcc72cbef51703e7f984eb93a681f3 URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=11fa6a474dfcc72cbef51703e7f984eb93a681f3 Author: Philippe Gerum Date: Wed Sep 24 11:45:26 2014 +0200 copperplate/clockobj: fix restricted clock mode --- lib/copperplate/clockobj.c | 60 ++-- 1 file changed, 41 insertions(+), 19 deletions(-) diff --git a/lib/copperplate/clockobj.c b/lib/copperplate/clockobj.c index fe823c7..1b6f5f6 100644 --- a/lib/copperplate/clockobj.c +++ b/lib/copperplate/clockobj.c @@ -231,51 +231,73 @@ int clockobj_set_resolution(struct clockobj *clkobj, unsigned int resolution_ns) #include #include +#ifdef CONFIG_XENO_COPPERPLATE_CLOCK_RESTRICTED + ticks_t clockobj_get_tsc(void) { -#ifdef CONFIG_XENO_COPPERPLATE_CLOCK_RESTRICTED - /* Rare case with legacy uClibc+linuxthreads combo. */ struct timespec now; + + /* Rare case with legacy uClibc+linuxthreads combo. */ __RT(clock_gettime(CLOCK_REALTIME, &now)); return xnarch_ullmul(now.tv_sec, 10) + now.tv_nsec; -#else - /* Guaranteed to be the source of CLOCK_COPPERPLATE. */ - return cobalt_read_tsc(); -#endif } -#ifndef CONFIG_XENO_LORES_CLOCK_DISABLED - -sticks_t clockobj_ns_to_ticks(struct clockobj *clkobj, sticks_t ns) +void clockobj_get_time(struct clockobj *clkobj, + ticks_t *pticks, ticks_t *ptsc) { - /* Cobalt has optimized arith ops, use them. */ - return xnarch_ulldiv(ns, clkobj->resolution, NULL); + ticks_t ns; + + ns = clockobj_get_tsc(); + if (ptsc) + *ptsc = ns; + + *pticks = clockobj_ns_to_ticks(clkobj, ns); } -#endif /* !CONFIG_XENO_LORES_CLOCK_DISABLED */ +#else /* !CONFIG_XENO_COPPERPLATE_CLOCK_RESTRICTED */ + +/* + * NOTE: we can't inline this routine, as we don't want to expose + * lib/cobalt/arch/.../include/asm/xenomai/tsc.h. + */ +ticks_t clockobj_get_tsc(void) +{ + /* Guaranteed to be the source of CLOCK_COPPERPLATE. */ + return cobalt_read_tsc(); +} void clockobj_get_time(struct clockobj *clkobj, ticks_t *pticks, ticks_t *ptsc) { - unsigned long long ns, tsc; + ticks_t ns, tsc; tsc = cobalt_read_tsc(); - ns = cobalt_ticks_to_ns_rounded(tsc); - if (clockobj_get_resolution(clkobj) > 1) - ns /= clockobj_get_resolution(clkobj); - *pticks = ns; - if (ptsc) *ptsc = tsc; + + ns = cobalt_ticks_to_ns_rounded(tsc); + *pticks = clockobj_ns_to_ticks(clkobj, ns); } +#endif /* !CONFIG_XENO_COPPERPLATE_CLOCK_RESTRICTED */ + +#ifndef CONFIG_XENO_LORES_CLOCK_DISABLED + +sticks_t clockobj_ns_to_ticks(struct clockobj *clkobj, sticks_t ns) +{ + /* Cobalt has optimized arith ops, use them. */ + return xnarch_ulldiv(ns, clkobj->resolution, NULL); +} + +#endif /* !CONFIG_XENO_LORES_CLOCK_DISABLED */ + void clockobj_get_date(struct clockobj *clkobj, ticks_t *pticks) { unsigned long long ns; read_lock_nocancel(&clkobj->lock); - ns = cobalt_ticks_to_ns(cobalt_read_tsc()); + ns = cobalt_ticks_to_ns(clockobj_get_tsc()); /* Add offset to epoch. */ ns += (unsigned long long)clkobj->offset.tv_sec * 10ULL; ns += clkobj->offset.tv_nsec; ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : testsuite/latency: check input for sampling period
Module: xenomai-forge Branch: master Commit: a2abebd6adce35d5e1618c068b6cf74cd789cf6f URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=a2abebd6adce35d5e1618c068b6cf74cd789cf6f Author: Philippe Gerum Date: Tue Sep 23 17:16:19 2014 +0200 testsuite/latency: check input for sampling period --- testsuite/latency/latency.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/testsuite/latency/latency.c b/testsuite/latency/latency.c index 9e6aefd..862e15d 100644 --- a/testsuite/latency/latency.c +++ b/testsuite/latency/latency.c @@ -20,15 +20,15 @@ pthread_t latency_task, display_task; sem_t *display_sem; -#define TEN_MILLION1000 #define ONE_BILLION10 +#define TEN_MILLIONS 1000 #define HIPRIO 99 #define LOPRIO 0 unsigned max_relaxed; long minjitter, maxjitter, avgjitter; -long gminjitter = TEN_MILLION, gmaxjitter = -TEN_MILLION, goverrun = 0; +long gminjitter = TEN_MILLIONS, gmaxjitter = -TEN_MILLIONS, goverrun = 0; long long gavgjitter = 0; long long period_ns = 0; @@ -56,9 +56,6 @@ const char *test_mode_names[] = { time_t test_start, test_end; /* report test duration */ int test_loops = 0;/* outer loop count */ -#define MEASURE_PERIOD ONE_BILLION -#define SAMPLE_COUNT (MEASURE_PERIOD / period_ns) - /* Warmup time : in order to avoid spurious cache effects on low-end machines. */ #define WARMUP_TIME 1 #define HISTOGRAM_CELLS 300 @@ -122,7 +119,7 @@ static void *latency(void *cookie) } fault_threshold = CONFIG_XENO_DEFAULT_PERIOD; - nsamples = ONE_BILLION / period_ns; + nsamples = (long long)ONE_BILLION / period_ns; /* start time: one millisecond from now. */ expected.tv_nsec += 100; if (expected.tv_nsec > ONE_BILLION) { @@ -141,7 +138,7 @@ static void *latency(void *cookie) } for (;;) { - long minj = TEN_MILLION, maxj = -TEN_MILLION, dt; + long minj = TEN_MILLIONS, maxj = -TEN_MILLIONS, dt; long overrun = 0; long long sumj; test_loops++; @@ -611,6 +608,10 @@ int main(int argc, char *const *argv) case 'p': period_ns = atoi(optarg) * 1000LL; + if (period_ns > ONE_BILLION) { + fprintf(stderr, "latency: invalid period (> 1s).\n"); + exit(2); + } break; case 'l': ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : copperplate/threadobj: report overruns in threadobj_wait_period()
Module: xenomai-forge Branch: master Commit: 53f5c1c0a38dd69786fd27f72f5a25f906a5bc93 URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=53f5c1c0a38dd69786fd27f72f5a25f906a5bc93 Author: Philippe Gerum Date: Tue Sep 23 11:47:33 2014 +0200 copperplate/threadobj: report overruns in threadobj_wait_period() --- lib/copperplate/threadobj.c |7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/copperplate/threadobj.c b/lib/copperplate/threadobj.c index 923bf83..32fbf01 100644 --- a/lib/copperplate/threadobj.c +++ b/lib/copperplate/threadobj.c @@ -1467,8 +1467,11 @@ int threadobj_wait_period(unsigned long *overruns_r) panic("cannot wait for next period, %s", symerror(-errno)); } - if (overruns_r) - *overruns_r = si.si_overrun; + if (si.si_overrun) { + if (overruns_r) + *overruns_r = si.si_overrun; + return -ETIMEDOUT; + } return 0; } ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : demo/alchemy/latency: fix path to RTDM-based test device
Module: xenomai-forge Branch: master Commit: 5821670ca249db120fc23339d19f694ed485516b URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=5821670ca249db120fc23339d19f694ed485516b Author: Philippe Gerum Date: Tue Sep 23 12:06:19 2014 +0200 demo/alchemy/latency: fix path to RTDM-based test device --- demo/alchemy/latency.c |7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/demo/alchemy/latency.c b/demo/alchemy/latency.c index a8af526..70c717e 100644 --- a/demo/alchemy/latency.c +++ b/demo/alchemy/latency.c @@ -683,12 +683,7 @@ int main(int argc, char *const *argv) mlockall(MCL_CURRENT | MCL_FUTURE); if (test_mode != USER_TASK) { - char devname[RTDM_MAX_DEVNAME_LEN]; - - snprintf(devname, RTDM_MAX_DEVNAME_LEN, "rttest-timerbench%d", -benchdev_no); - benchdev = rt_dev_open(devname, O_RDWR); - + benchdev = open("/dev/rtdm/timerbench", O_RDWR); if (benchdev < 0) { fprintf(stderr, "latency: failed to open benchmark device, code %d\n" ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : copperplate/clockobj, alchemy: sanitize clockobj_get_time () interface
Module: xenomai-forge Branch: master Commit: 3d43735528324673626b306f6bb40b42cd5abed6 URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=3d43735528324673626b306f6bb40b42cd5abed6 Author: Philippe Gerum Date: Wed Sep 24 12:10:08 2014 +0200 copperplate/clockobj, alchemy: sanitize clockobj_get_time() interface --- include/alchemy/timer.h| 19 + include/copperplate/clockobj.h |3 +-- lib/alchemy/task.c |2 +- lib/alchemy/timer.c| 26 ++- lib/copperplate/clockobj.c | 46 5 files changed, 37 insertions(+), 59 deletions(-) diff --git a/include/alchemy/timer.h b/include/alchemy/timer.h index c85d80f..fc33db9 100644 --- a/include/alchemy/timer.h +++ b/include/alchemy/timer.h @@ -99,6 +99,25 @@ int alchemy_poll_mode(const struct timespec *abs_timeout) extern "C" { #endif +/** + * @fn RTIME rt_timer_read(void) + * @brief Return the current system time. + * + * Return the current time maintained by the Xenomai core clock. + * + * @return The current time expressed in clock ticks (see note). + * + * @apitags{unrestricted} + * + * @note The @a time value is a multiple of the Alchemy clock + * resolution (see --alchemy-clock-resolution option, defaults to 1 + * nanosecond). + */ +static inline RTIME rt_timer_read(void) +{ + return clockobj_get_time(&alchemy_clock); +} + static inline RTIME rt_timer_tsc(void) { return clockobj_get_tsc(); diff --git a/include/copperplate/clockobj.h b/include/copperplate/clockobj.h index 1543589..f480214 100644 --- a/include/copperplate/clockobj.h +++ b/include/copperplate/clockobj.h @@ -71,8 +71,7 @@ void clockobj_set_date(struct clockobj *clkobj, ticks_t ticks); void clockobj_get_date(struct clockobj *clkobj, ticks_t *pticks); -void clockobj_get_time(struct clockobj *clkobj, - ticks_t *pticks, ticks_t *ptsc); +ticks_t clockobj_get_time(struct clockobj *clkobj); void clockobj_get_distance(struct clockobj *clkobj, const struct itimerspec *itm, diff --git a/lib/alchemy/task.c b/lib/alchemy/task.c index bd309c9..c9ec272 100644 --- a/lib/alchemy/task.c +++ b/lib/alchemy/task.c @@ -959,7 +959,7 @@ int rt_task_sleep_until(RTIME date) if (date == TM_INFINITE) ts = zero_time; else { - clockobj_get_time(&alchemy_clock, &now, NULL); + now = clockobj_get_time(&alchemy_clock); if (date <= now) return -ETIMEDOUT; CANCEL_DEFER(svc); diff --git a/lib/alchemy/timer.c b/lib/alchemy/timer.c index dfe4f6d..323273c 100644 --- a/lib/alchemy/timer.c +++ b/lib/alchemy/timer.c @@ -31,29 +31,6 @@ struct clockobj alchemy_clock; /** - * @fn RTIME rt_timer_read(void) - * @brief Return the current system time. - * - * Return the current time maintained by the Xenomai core clock. - * - * @return The current time expressed in clock ticks (see note). - * - * @apitags{unrestricted} - * - * @note The @a time value is a multiple of the Alchemy clock - * resolution (see --alchemy-clock-resolution option, defaults to 1 - * nanosecond). - */ -RTIME rt_timer_read(void) -{ - ticks_t ticks; - - clockobj_get_time(&alchemy_clock, &ticks, NULL); - - return ticks; -} - -/** * @fn RTIME rt_timer_ns2ticks(SRTIME ns) * @brief Convert nanoseconds to Alchemy clock ticks. * @@ -113,7 +90,8 @@ SRTIME rt_timer_ticks2ns(SRTIME ticks) int rt_timer_inquire(RT_TIMER_INFO *info) { info->period = clockobj_get_resolution(&alchemy_clock); - clockobj_get_time(&alchemy_clock, &info->date, &info->tsc); + info->date = clockobj_get_time(&alchemy_clock); + info->tsc = clockobj_get_tsc(); return 0; } diff --git a/lib/copperplate/clockobj.c b/lib/copperplate/clockobj.c index 1b6f5f6..8ee3ed7 100644 --- a/lib/copperplate/clockobj.c +++ b/lib/copperplate/clockobj.c @@ -237,21 +237,18 @@ ticks_t clockobj_get_tsc(void) { struct timespec now; - /* Rare case with legacy uClibc+linuxthreads combo. */ + /* +* Rare case with legacy uClibc+linuxthreads combo over +* Cobalt, we actually return nanoseconds just like in the +* Mercury case. +*/ __RT(clock_gettime(CLOCK_REALTIME, &now)); return xnarch_ullmul(now.tv_sec, 10) + now.tv_nsec; } -void clockobj_get_time(struct clockobj *clkobj, - ticks_t *pticks, ticks_t *ptsc) +ticks_t clockobj_get_time(struct clockobj *clkobj) { - ticks_t ns; - - ns = clockobj_get_tsc(); - if (ptsc) - *ptsc = ns; - - *pticks = clockobj_ns_to_ticks(clkobj, ns); + return clockobj_ns_to_ticks(clkobj, clockobj_get_tsc()); } #else /* !CONFIG_XENO_COPPERPLATE_CLOCK_RESTRICTED */ @@ -266,17 +263,10 @@ ticks_t clockobj_get_tsc(void) return cobalt_read_tsc(); } -void clockobj_get_time(struc
[Xenomai-git] Philippe Gerum : alchemy/doc: raise attention on rt_task_set_periodic() behavior
Module: xenomai-forge Branch: master Commit: 3a131ac9bf1ee3b9d5083ac0b28f8bb2ac385946 URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=3a131ac9bf1ee3b9d5083ac0b28f8bb2ac385946 Author: Philippe Gerum Date: Tue Sep 23 10:49:50 2014 +0200 alchemy/doc: raise attention on rt_task_set_periodic() behavior --- lib/alchemy/task.c |7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/alchemy/task.c b/lib/alchemy/task.c index 3974213..bd309c9 100644 --- a/lib/alchemy/task.c +++ b/lib/alchemy/task.c @@ -805,7 +805,7 @@ undo: * * @note The caller must be an Alchemy task if @a task is NULL. * - * @sideeffect Over Cobalt, -EINVAL is returned if @a period is + * @note Over Cobalt, -EINVAL is returned if @a period is * different from TM_INFINITE but shorter than the user scheduling * latency value for the target system, as displayed by * /proc/xenomai/latency. @@ -813,6 +813,11 @@ undo: * @note The @a idate and @a period values are interpreted as a * multiple of the Alchemy clock resolution (see * --alchemy-clock-resolution option, defaults to 1 nanosecond). + * + * @attention Unlike its Xenomai 2.x counterpart, + * rt_task_set_periodic() will @b NOT block @a task until @a idate is + * reached. The first beat in the periodic timeline should be awaited + * for by a call to rt_task_wait_period(). */ #ifndef DOXYGEN_CPP CURRENT_IMPL(int, rt_task_set_periodic, ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : cobalt/rtdm: update internal change log
Module: xenomai-forge Branch: master Commit: 8ed3aa2abe77a3c047617f7c7a0a3e54d178ff2d URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=8ed3aa2abe77a3c047617f7c7a0a3e54d178ff2d Author: Philippe Gerum Date: Tue Sep 23 11:29:27 2014 +0200 cobalt/rtdm: update internal change log --- kernel/cobalt/rtdm/API.CHANGES |7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kernel/cobalt/rtdm/API.CHANGES b/kernel/cobalt/rtdm/API.CHANGES index 73c1850..978799f 100644 --- a/kernel/cobalt/rtdm/API.CHANGES +++ b/kernel/cobalt/rtdm/API.CHANGES @@ -3,9 +3,10 @@ Scheduled modifications (unsorted): buffer pools). o Threaded IRQ handlers. o Support for deferring IRQ line re-enabling from handler to thread context. - o Support for user-space drivers. - o Removal of open_rt, socket_rt, and close_rt, ie. support for device - creation and destruction in RT context. + +Revision 9: + +See http://xenomai.org/migrating-from-xenomai-2-x-to-3-x/#RTDM_interface_changes. Revision 8: o Added rtdm_rt_capable. ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : demo/alchemy/latency: fix overrun handling
Module: xenomai-forge Branch: master Commit: 73561e3a3a616a24f62c1ba9587dd3d12ac4b820 URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=73561e3a3a616a24f62c1ba9587dd3d12ac4b820 Author: Philippe Gerum Date: Tue Sep 23 11:46:09 2014 +0200 demo/alchemy/latency: fix overrun handling --- demo/alchemy/latency.c |5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/demo/alchemy/latency.c b/demo/alchemy/latency.c index cebf663..a8af526 100644 --- a/demo/alchemy/latency.c +++ b/demo/alchemy/latency.c @@ -135,11 +135,10 @@ static void latency(void *cookie) err); exit(EXIT_FAILURE); /* Timer stopped. */ } - overrun += ov; expected_tsc += period_tsc * ov; - } else - expected_tsc += period_tsc; + } + expected_tsc += period_tsc; if (freeze_max && (dt > gmaxjitter) && !(finished || warmup)) { ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : alchemy/timer: drop useless return value from rt_timer_inquire()
Module: xenomai-forge Branch: master Commit: 5709dc849befb917e83398177121870f483a76d2 URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=5709dc849befb917e83398177121870f483a76d2 Author: Philippe Gerum Date: Wed Sep 24 12:14:40 2014 +0200 alchemy/timer: drop useless return value from rt_timer_inquire() --- include/alchemy/timer.h |2 +- lib/alchemy/timer.c |8 ++-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/include/alchemy/timer.h b/include/alchemy/timer.h index fc33db9..5c1cc08 100644 --- a/include/alchemy/timer.h +++ b/include/alchemy/timer.h @@ -139,7 +139,7 @@ SRTIME rt_timer_ticks2ns(SRTIME ticks); RTIME rt_timer_read(void); -int rt_timer_inquire(RT_TIMER_INFO *info); +void rt_timer_inquire(RT_TIMER_INFO *info); void rt_timer_spin(RTIME ns); diff --git a/lib/alchemy/timer.c b/lib/alchemy/timer.c index 323273c..d37a9d7 100644 --- a/lib/alchemy/timer.c +++ b/lib/alchemy/timer.c @@ -75,7 +75,7 @@ SRTIME rt_timer_ticks2ns(SRTIME ticks) } /** - * @fn int rt_timer_inquire(RT_TIMER_INFO *info) + * @fn void rt_timer_inquire(RT_TIMER_INFO *info) * @brief Inquire about the Xenomai core timer. * * Return status information of the Xenomai core timer. @@ -83,17 +83,13 @@ SRTIME rt_timer_ticks2ns(SRTIME ticks) * @param info The address of a structure the status data will be * written to. * - * @return This service always returns 0. - * * @apitags{unrestricted} */ -int rt_timer_inquire(RT_TIMER_INFO *info) +void rt_timer_inquire(RT_TIMER_INFO *info) { info->period = clockobj_get_resolution(&alchemy_clock); info->date = clockobj_get_time(&alchemy_clock); info->tsc = clockobj_get_tsc(); - - return 0; } /** ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : scripts/wrap-links.sh: avoid duplicate output directive
Module: xenomai-forge Branch: master Commit: b50797c2be6858360bec7a4bb28c181d6107b148 URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=b50797c2be6858360bec7a4bb28c181d6107b148 Author: Philippe Gerum Date: Wed Sep 24 15:04:14 2014 +0200 scripts/wrap-links.sh: avoid duplicate output directive --- scripts/wrap-link.sh |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/wrap-link.sh b/scripts/wrap-link.sh index 6794525..24a270e 100755 --- a/scripts/wrap-link.sh +++ b/scripts/wrap-link.sh @@ -138,7 +138,7 @@ while test $# -gt 0; do next_is_wrapped_symbol=: ;; - -Wl,--wrap,main|-Wl,--wrap=main) + -Wl,--wrap,main|-Wl,--wrap=main|-Wl,--dynamic-list=*) # special case so that Copperplate can interpose on the # main() routine. For this we need this wrapping to # take place in the second stage. @@ -209,5 +209,5 @@ if $stage2; then $dryrun rm -f $output.tmp else $verbose && set -x -$dryrun $cc -o "$output" $onestage_args +$dryrun $cc $onestage_args fi ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : cobalt/kernel: enable auto-tuner by default
Module: xenomai-forge Branch: master Commit: d3b7499c107ab175b3753b5f8e894fa45d8c7765 URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=d3b7499c107ab175b3753b5f8e894fa45d8c7765 Author: Philippe Gerum Date: Tue Sep 23 16:51:55 2014 +0200 cobalt/kernel: enable auto-tuner by default --- kernel/cobalt/Kconfig |2 +- kernel/cobalt/arch/x86/Kconfig |3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/kernel/cobalt/Kconfig b/kernel/cobalt/Kconfig index c80ae91..207484f 100644 --- a/kernel/cobalt/Kconfig +++ b/kernel/cobalt/Kconfig @@ -166,7 +166,7 @@ config XENO_OPT_RR_QUANTUM config XENO_OPT_AUTOTUNE bool "Auto-tuning" -default y if XENO_ARCH_AUTOTUNE +default y select XENO_DRIVERS_AUTOTUNE help Enable auto-tuning capabilities. Auto-tuning is used for diff --git a/kernel/cobalt/arch/x86/Kconfig b/kernel/cobalt/arch/x86/Kconfig index cc85389..72e539a 100644 --- a/kernel/cobalt/arch/x86/Kconfig +++ b/kernel/cobalt/arch/x86/Kconfig @@ -1,9 +1,6 @@ config XENO_ARCH_FPU def_bool y -config XENO_ARCH_AUTOTUNE - def_bool y - config XENO_ARCH_X32 def_bool X86_X32 select XENO_OPT_SYS3264 ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : build: enable auto-init for in tree copperplate-based programs
Module: xenomai-forge Branch: master Commit: 409f3de609c855c736770490ef69185346c69bfc URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=409f3de609c855c736770490ef69185346c69bfc Author: Philippe Gerum Date: Tue Sep 23 09:32:28 2014 +0200 build: enable auto-init for in tree copperplate-based programs --- Makefile.in |1 + config/Makefile.in |1 + configure|4 configure.ac |3 +++ demo/Makefile.in |1 + demo/alchemy/Makefile.am |6 +++--- demo/alchemy/Makefile.in | 12 demo/alchemy/cobalt/Makefile.in |1 + demo/alchemy/latency.c | 12 +--- demo/posix/Makefile.in |1 + demo/posix/cobalt/Makefile.in|1 + doc/Makefile.in |1 + doc/asciidoc/Makefile.in |1 + doc/doxygen/Makefile.in |1 + doc/gitdoc/Makefile.in |1 + include/Makefile.in |1 + include/alchemy/Makefile.in |1 + include/boilerplate/Makefile.in |1 + include/cobalt/Makefile.in |1 + include/cobalt/boilerplate/Makefile.in |1 + include/cobalt/kernel/Makefile.in|1 + include/cobalt/kernel/rtdm/Makefile.in |1 + include/cobalt/kernel/rtdm/analogy/Makefile.in |1 + include/cobalt/sys/Makefile.in |1 + include/cobalt/uapi/Makefile.in |1 + include/cobalt/uapi/asm-generic/Makefile.in |1 + include/cobalt/uapi/kernel/Makefile.in |1 + include/copperplate/Makefile.in |1 + include/mercury/Makefile.in |1 + include/mercury/boilerplate/Makefile.in |1 + include/psos/Makefile.in |1 + include/rtdm/Makefile.in |1 + include/rtdm/uapi/Makefile.in|1 + include/smokey/Makefile.in |1 + include/trank/Makefile.in|1 + include/trank/native/Makefile.in |1 + include/trank/posix/Makefile.in |1 + include/trank/rtdm/Makefile.in |1 + include/vxworks/Makefile.in |1 + lib/Makefile.in |1 + lib/alchemy/Makefile.in |1 + lib/analogy/Makefile.in |1 + lib/boilerplate/Makefile.in |1 + lib/cobalt/Makefile.in |1 + lib/cobalt/arch/Makefile.in |1 + lib/cobalt/arch/arm/Makefile.in |1 + lib/cobalt/arch/arm/include/Makefile.in |1 + lib/cobalt/arch/arm/include/asm/Makefile.in |1 + lib/cobalt/arch/arm/include/asm/xenomai/Makefile.in |1 + lib/cobalt/arch/blackfin/Makefile.in |1 + lib/cobalt/arch/blackfin/include/Makefile.in |1 + lib/cobalt/arch/blackfin/include/asm/Makefile.in |1 + lib/cobalt/arch/blackfin/include/asm/xenomai/Makefile.in |1 + lib/cobalt/arch/nios2/Makefile.in|1 + lib/cobalt/arch/nios2/include/Makefile.in|1 + lib/cobalt/arch/nios2/include/asm/Makefile.in|1 + lib/cobalt/arch/nios2/include/asm/xenomai/Makefile.in|1 + lib/cobalt/arch/powerpc/Makefile.in |1 + lib/cobalt/arch/powerpc/include/Makefile.in |1 + lib/cobalt/arch/powerpc/include/asm/Makefile.in |1 + lib/cobalt/arch/powerpc/include/asm/xenomai/Makefile.in |1 + lib/cobalt/arch/sh/Makefile.in |1 + lib/cobalt/arch/sh/include/Makefile.in |1 + lib/cobalt/arch/sh/include/asm/Makefile.in |1 + lib/cobalt/arch/sh/include/asm/xenomai/Makefile.in |1 + lib/cobalt/arch/x86/Makefile.in |1 + lib/cobalt/arch/x86/include/Makefile.in |1 + lib/cobalt/arch/x86/include/asm/Makefile.in |1 + lib/cobalt/arch/x86/include/asm/xenomai/Makefile.in |1 + lib/copperplate/Ma
[Xenomai-git] Philippe Gerum : demo/alchemy/latency: revamp for removing legacy
Module: xenomai-forge Branch: master Commit: 1d290f9b623aa450a59ced64b6455e94bf95d41e URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=1d290f9b623aa450a59ced64b6455e94bf95d41e Author: Philippe Gerum Date: Tue Sep 23 17:16:29 2014 +0200 demo/alchemy/latency: revamp for removing legacy NOTE: we stop using TSC as the time reference unit, as this is unreliable for long durations, due to accumulated rounding errors. --- demo/alchemy/Makefile.am |9 ++ demo/alchemy/Makefile.in |9 ++ demo/alchemy/latency.c | 229 +- 3 files changed, 101 insertions(+), 146 deletions(-) diff --git a/demo/alchemy/Makefile.am b/demo/alchemy/Makefile.am index c2bd0e5..406bccb 100644 --- a/demo/alchemy/Makefile.am +++ b/demo/alchemy/Makefile.am @@ -22,3 +22,12 @@ latency_SOURCES = latency.c latency_CPPFLAGS = $(cppflags) latency_LDADD = $(ldadd) -lpthread -lrt -lm latency_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@ $(XENO_POSIX_WRAPPERS) + +# This demo mixes the Alchemy and Xenomai-enabled POSIX APIs over +# Cobalt, so we ask for both set of flags. --posix along with +# --ldflags will get us the linker switches causing the symbol +# wrapping for open/read/write/ioctl and friends. Over Mercury, +# --posix is ignored since it's implicitly enabled. +# +# CFLAGS = $(shell xeno-config --alchemy --posix --cflags) +# LDFLAGS = $(shell xeno-config --alchemy --posix --ldflags) diff --git a/demo/alchemy/Makefile.in b/demo/alchemy/Makefile.in index b7abefa..f606a03 100644 --- a/demo/alchemy/Makefile.in +++ b/demo/alchemy/Makefile.in @@ -816,6 +816,15 @@ uninstall-am: uninstall-demoPROGRAMS uninstall-am uninstall-demoPROGRAMS +# This demo mixes the Alchemy and Xenomai-enabled POSIX APIs over +# Cobalt, so we ask for both set of flags. --posix along with +# --ldflags will get us the linker switches causing the symbol +# wrapping for open/read/write/ioctl and friends. Over Mercury, +# --posix is ignored since it's implicitly enabled. +# +# CFLAGS = $(shell xeno-config --alchemy --posix --cflags) +# LDFLAGS = $(shell xeno-config --alchemy --posix --ldflags) + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/demo/alchemy/latency.c b/demo/alchemy/latency.c index 70c717e..7d1bf0a 100644 --- a/demo/alchemy/latency.c +++ b/demo/alchemy/latency.c @@ -3,12 +3,10 @@ #include #include #include -#include #include #include -#include -#include #include +#include #include #include #include @@ -30,8 +28,7 @@ long long period_ns = 0; int test_duration = 0; /* sec of testing, via -T , 0 is inf */ int data_lines = 21; /* data lines per header line, -l to change */ int quiet = 0; /* suppress printing of RTH, RTD lines when -T given */ -int benchdev_no = 0; -int benchdev = -1; +int devfd = -1; int freeze_max = 0; int priority = T_HIPRIO; int stop_upon_switch = 0; @@ -51,9 +48,6 @@ const char *test_mode_names[] = { time_t test_start, test_end; /* report test duration */ int test_loops = 0;/* outer loop count */ -#define MEASURE_PERIOD ONE_BILLION -#define SAMPLE_COUNT (MEASURE_PERIOD / period_ns) - /* Warmup time : in order to avoid spurious cache effects on low-end machines. */ #define WARMUP_TIME 1 #define HISTOGRAM_CELLS 300 @@ -69,52 +63,39 @@ int bucketsize = 1000; /* default = 1000ns, -B to override */ static inline void add_histogram(long *histogram, long addval) { /* bucketsize steps */ - long inabs = - rt_timer_tsc2ns(addval >= 0 ? addval : -addval) / bucketsize; + long inabs = (addval >= 0 ? addval : -addval) / bucketsize; histogram[inabs < histogram_size ? inabs : histogram_size - 1]++; } static void latency(void *cookie) { - int err, count, nsamples, warmup = 1; - RTIME expected_tsc, period_tsc, start_ticks, fault_threshold; - RT_TIMER_INFO timer_info; - unsigned old_relaxed = 0; - - err = rt_timer_inquire(&timer_info); - - if (err) { - fprintf(stderr, "latency: rt_timer_inquire, code %d\n", err); - return; - } - - fault_threshold = rt_timer_ns2tsc(CONFIG_XENO_DEFAULT_PERIOD); - nsamples = ONE_BILLION / period_ns; - period_tsc = rt_timer_ns2tsc(period_ns); - /* start time: one millisecond from now. */ - start_ticks = timer_info.date + rt_timer_ns2ticks(100); - expected_tsc = timer_info.tsc + rt_timer_ns2tsc(100); - - err = rt_task_set_periodic(NULL, start_ticks, - rt_timer_ns2ticks(period_ns)); - if (err) { + RTIME expected_ns, start_ns, fault_threshold; + unsigned int old_relaxed = 0, new_relaxed; + int ret, count, nsamples, warmup = 1; + long minj, maxj, dt, overrun, sumj; + unsigned long ov; + + fault_threshold = CONFIG_XE
[Xenomai-git] Philippe Gerum : cobalt/arm: upgrade I-pipe support
Module: xenomai-forge Branch: master Commit: f6cdb18e010bcff369aec9c745b5ef2316933ac9 URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=f6cdb18e010bcff369aec9c745b5ef2316933ac9 Author: Philippe Gerum Date: Tue Sep 23 09:11:35 2014 +0200 cobalt/arm: upgrade I-pipe support --- ...-arm-4.patch => ipipe-core-3.10.32-arm-5.patch} | 95 +--- 1 file changed, 63 insertions(+), 32 deletions(-) diff --git a/kernel/cobalt/arch/arm/patches/ipipe-core-3.10.32-arm-4.patch b/kernel/cobalt/arch/arm/patches/ipipe-core-3.10.32-arm-5.patch similarity index 99% rename from kernel/cobalt/arch/arm/patches/ipipe-core-3.10.32-arm-4.patch rename to kernel/cobalt/arch/arm/patches/ipipe-core-3.10.32-arm-5.patch index eac0028..d1ec606 100644 --- a/kernel/cobalt/arch/arm/patches/ipipe-core-3.10.32-arm-4.patch +++ b/kernel/cobalt/arch/arm/patches/ipipe-core-3.10.32-arm-5.patch @@ -826,7 +826,7 @@ index 88d6181..b23d57c 100644 diff --git a/arch/arm/include/asm/fcse.h b/arch/arm/include/asm/fcse.h new file mode 100644 -index 000..af67648 +index 000..1d42a30 --- /dev/null +++ b/arch/arm/include/asm/fcse.h @@ -0,0 +1,201 @@ @@ -849,6 +849,12 @@ index 000..af67648 +#ifndef __ASM_ARM_FCSE_H +#define __ASM_ARM_FCSE_H + ++#ifdef CONFIG_ARM_FCSE_DEBUG ++#define FCSE_BUG_ON(expr) BUG_ON(expr) ++#else /* !CONFIG_ARM_FCSE_DEBUG */ ++#define FCSE_BUG_ON(expr) do { } while(0) ++#endif /* !CONFIG_ARM_FCSE_DEBUG */ ++ +#ifdef CONFIG_ARM_FCSE + +#include/* For struct mm_struct */ @@ -871,12 +877,6 @@ index 000..af67648 +#define FCSE_NR_PIDS (TASK_SIZE / FCSE_PID_TASK_SIZE) +#define FCSE_PID_MAX (FCSE_NR_PIDS - 1) + -+#ifdef CONFIG_ARM_FCSE_DEBUG -+#define FCSE_BUG_ON(expr) BUG_ON(expr) -+#else /* !CONFIG_ARM_FCSE_DEBUG */ -+#define FCSE_BUG_ON(expr) do { } while(0) -+#endif /* !CONFIG_ARM_FCSE_DEBUG */ -+ +struct vm_unmapped_area_info; + +extern unsigned long fcse_pids_cache_dirty[]; @@ -1076,7 +1076,7 @@ index bb28af7..780ca50 100644 static inline void sp804_clockevents_init(void __iomem *base, unsigned int irq, const char *name) diff --git a/arch/arm/include/asm/ipipe.h b/arch/arm/include/asm/ipipe.h new file mode 100644 -index 000..112ab17 +index 000..233fbe1 --- /dev/null +++ b/arch/arm/include/asm/ipipe.h @@ -0,0 +1,274 @@ @@ -1124,13 +1124,13 @@ index 000..112ab17 +#include +#include + -+#define IPIPE_CORE_RELEASE4 ++#define IPIPE_CORE_RELEASE5 + +struct ipipe_domain; + -+#define IPIPE_TSC_TYPE_NONE 0 -+#define IPIPE_TSC_TYPE_FREERUNNING1 -+#define IPIPE_TSC_TYPE_DECREMENTER2 ++#define IPIPE_TSC_TYPE_NONE 0 ++#define IPIPE_TSC_TYPE_FREERUNNING1 ++#define IPIPE_TSC_TYPE_DECREMENTER2 +#define IPIPE_TSC_TYPE_FREERUNNING_COUNTDOWN 3 +#define IPIPE_TSC_TYPE_FREERUNNING_TWICE 4 +#define IPIPE_TSC_TYPE_FREERUNNING_ARCH 5 @@ -3032,10 +3032,10 @@ index 160f337..8d77bff 100644 * have in theory up to 7 arguments to a function - r0 to r6. diff --git a/arch/arm/kernel/ipipe.c b/arch/arm/kernel/ipipe.c new file mode 100644 -index 000..812b8ef +index 000..5b77cfb --- /dev/null +++ b/arch/arm/kernel/ipipe.c -@@ -0,0 +1,627 @@ +@@ -0,0 +1,658 @@ +/* -*- linux-c -*- + * linux/arch/arm/kernel/ipipe.c + * @@ -3259,7 +3259,7 @@ index 000..812b8ef + unsigned long flags; + + printk("I-pipe: disabling SMP code\n"); -+ ++ + flags = hard_local_irq_save(); + static_key_slow_dec(&__ipipe_smp_key); + hard_local_irq_restore(flags); @@ -3393,19 +3393,40 @@ index 000..812b8ef + return ret; +} + ++#if __LINUX_ARM_ARCH__ <= 5 ++#define fast_irq_disable() hard_local_irq_save() ++#define fast_irq_enable(flags) hard_local_irq_restore(flags) ++#else ++#define fast_irq_disable()\ ++ ({ \ ++ hard_local_irq_disable(); \ ++ 0; \ ++ }) ++#define fast_irq_enable(flags)\ ++ ({ \ ++ hard_local_irq_enable();\ ++ (void)(flags); \ ++ }) ++#endif ++ +asmlinkage int __ipipe_syscall_root(unsigned long scno, struct pt_regs *regs) +{ ++#ifdef CONFIG_OABI_COMPAT ++ const bool oabi = scno + __NR_SYSCALL_BASE != regs->ARM_r7; ++#elif defined(CONFIG_AEABI) ++ const bool oabi = false; ++#else /* OABI */ ++ const bool oabi = true; ++#endif ++ struct task_struct *const task = current; + struct ipipe_percpu_domain_data *p; + unsigned long orig_r7; ++ unsigned long flags; + int ret = 0; + ++#ifdef CONFIG_IPIPE_DEBUG_INTERNAL + WARN_ON_ONCE(hard_irqs_disabled()); -+ -+ /* -+ * We use r7 to pass the syscall number to the other domains. -+ */ -+ orig_r7 =
[Xenomai-git] Philippe Gerum : scripts/xeno-config: accept nop switch --posix over Mercury
Module: xenomai-forge Branch: master Commit: 7ad6bab8a9fc418f5bb246c8676f0ada5dcbbf7c URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=7ad6bab8a9fc418f5bb246c8676f0ada5dcbbf7c Author: Philippe Gerum Date: Wed Sep 24 10:20:42 2014 +0200 scripts/xeno-config: accept nop switch --posix over Mercury --- scripts/xeno-config-mercury.in |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/xeno-config-mercury.in b/scripts/xeno-config-mercury.in index 4e0cdc3..2ac6fd8 100644 --- a/scripts/xeno-config-mercury.in +++ b/scripts/xeno-config-mercury.in @@ -34,7 +34,7 @@ Options : --ccld --arch --prefix ---[skin=]vxworks|psos|alchemy|rtdm|smokey +--[skin=]posix|vxworks|psos|alchemy|rtdm|smokey --auto-init|no-auto-init --cflags --ldflags @@ -118,7 +118,7 @@ while test $# -gt 0; do skin_list="$skin_list `expr "$1" : '--skin=\(.*\)'`" fi ;; - --vxworks|--psos|--alchemy|--rtdm|--smokey) + --posix|--vxworks|--psos|--alchemy|--rtdm|--smokey) skin_list="$skin_list `expr "$1" : '--\(.*\)'`" ;; --cflags) @@ -166,6 +166,8 @@ while test $# -gt 0; do ldflags="$WRAP_MAIN $XENO_BASE_LDFLAGS" for skin in $skin_list; do case "$skin" in + posix) + ;; vxworks|psos|alchemy|smokey) ldflags="-l$skin $ldflags" ;; ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : demo/alchemy/cross-link: fix RTDM calls
Module: xenomai-forge Branch: master Commit: 61f3ffc27d937973be17c24d5f6cb105a565afdd URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=61f3ffc27d937973be17c24d5f6cb105a565afdd Author: Philippe Gerum Date: Wed Sep 24 15:24:44 2014 +0200 demo/alchemy/cross-link: fix RTDM calls --- demo/alchemy/cobalt/Makefile.am |3 +++ demo/alchemy/cobalt/Makefile.in | 10 ++ demo/alchemy/cobalt/cross-link.c | 41 +++--- 3 files changed, 29 insertions(+), 25 deletions(-) diff --git a/demo/alchemy/cobalt/Makefile.am b/demo/alchemy/cobalt/Makefile.am index 0fbd30e..c9b79c0 100644 --- a/demo/alchemy/cobalt/Makefile.am +++ b/demo/alchemy/cobalt/Makefile.am @@ -1,5 +1,7 @@ demodir = @XENO_DEMO_DIR@ +CCLD = $(top_srcdir)/scripts/wrap-link.sh $(CC) + demo_PROGRAMS = cross-link cppflags = \ @@ -10,6 +12,7 @@ ldadd = \ ../../../lib/alchemy/libalchemy.la \ ../../../lib/copperplate/libcopperplate.la \ ../../../lib/cobalt/libcobalt.la\ + $(XENO_POSIX_WRAPPERS) \ @XENO_USER_LDADD@ \ -lpthread -lrt diff --git a/demo/alchemy/cobalt/Makefile.in b/demo/alchemy/cobalt/Makefile.in index c476b29..1c8a158 100644 --- a/demo/alchemy/cobalt/Makefile.in +++ b/demo/alchemy/cobalt/Makefile.in @@ -101,10 +101,11 @@ am__installdirs = "$(DESTDIR)$(demodir)" PROGRAMS = $(demo_PROGRAMS) am_cross_link_OBJECTS = cross_link-cross-link.$(OBJEXT) cross_link_OBJECTS = $(am_cross_link_OBJECTS) -am__DEPENDENCIES_1 = ../../../lib/alchemy/libalchemy.la \ +am__DEPENDENCIES_1 = +am__DEPENDENCIES_2 = ../../../lib/alchemy/libalchemy.la \ ../../../lib/copperplate/libcopperplate.la \ - ../../../lib/cobalt/libcobalt.la -cross_link_DEPENDENCIES = $(am__DEPENDENCIES_1) + ../../../lib/cobalt/libcobalt.la $(am__DEPENDENCIES_1) +cross_link_DEPENDENCIES = $(am__DEPENDENCIES_2) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent @@ -135,7 +136,6 @@ AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = -CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ @@ -337,6 +337,7 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ demodir = @XENO_DEMO_DIR@ +CCLD = $(top_srcdir)/scripts/wrap-link.sh $(CC) cppflags = \ $(XENO_USER_CFLAGS) \ -I$(top_srcdir)/include @@ -345,6 +346,7 @@ ldadd = \ ../../../lib/alchemy/libalchemy.la \ ../../../lib/copperplate/libcopperplate.la \ ../../../lib/cobalt/libcobalt.la\ + $(XENO_POSIX_WRAPPERS) \ @XENO_USER_LDADD@ \ -lpthread -lrt diff --git a/demo/alchemy/cobalt/cross-link.c b/demo/alchemy/cobalt/cross-link.c index 0da2e98..8c0f53f 100644 --- a/demo/alchemy/cobalt/cross-link.c +++ b/demo/alchemy/cobalt/cross-link.c @@ -32,8 +32,8 @@ #define WTASK_PREFIX "write_task: " #define RTASK_PREFIX "read_task: " -#define WRITE_FILE"rtser0" -#define READ_FILE "rtser1" +#define WRITE_FILE"/dev/rtdm/rtser0" +#define READ_FILE "/dev/rtdm/rtser1" int read_fd = -1; int write_fd = -1; @@ -77,7 +77,7 @@ static int close_file( int fd, char *name) do { i++; - err = rt_dev_close(fd); + err = close(fd); switch (err) { case -EAGAIN: printf(MAIN_PREFIX "%s -> EAGAIN (%d times)\n", @@ -155,9 +155,9 @@ static void write_task_proc(void *arg) write_time = rt_timer_read(); - written = rt_dev_write(write_fd, &write_time, sz); + written = write(write_fd, &write_time, sz); if (written < 0 ) { - printf(WTASK_PREFIX "error on rt_dev_write, %s\n", + printf(WTASK_PREFIX "error on write, %s\n", strerror(-err)); break; } else if (written != sz) { @@ -183,7 +183,7 @@ static void read_task_proc(void *arg) RTIME write_time = 0; RTIME irq_time = 0; ssize_t sz = sizeof(RTIME); - int read = 0; + int rd = 0; struct rtser_event rx_event; printf(" Nr | write->irq|irq->read| write->read |\n"); @@ -197,7 +197,7 @@ static void read_task_proc(void *arg) while (1) { /* waiting for event */ - err = rt_dev_ioctl(read_fd, RTSER_RTIOC_WAIT_EVENT, &rx_event); + err = ioctl(read_fd, RTSER_RTIOC_WAIT_EVENT, &rx_event); if (
[Xenomai-git] Philippe Gerum : doc: prebuild
Module: xenomai-forge Branch: master Commit: 64171e11ad0a473e42ec02137a3f718afe6348fb URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=64171e11ad0a473e42ec02137a3f718afe6348fb Author: Philippe Gerum Date: Wed Sep 24 15:37:02 2014 +0200 doc: prebuild --- doc/prebuilt/html/MIGRATION/index.html |6 +- doc/prebuilt/html/README.APPLICATIONS/index.html |2 +- doc/prebuilt/html/README.INSTALL/index.html|2 +- .../html/TROUBLESHOOTING.COBALT/index.html |2 +- .../html/TROUBLESHOOTING.MERCURY/index.html|2 +- doc/prebuilt/html/man1/latency/index.html |2 +- doc/prebuilt/html/man1/xeno-config/index.html |2 +- .../html/xeno3prm/16550A__io_8h_source.html|2 +- .../html/xeno3prm/16550A__pci_8h_source.html |2 +- .../html/xeno3prm/16550A__pnp_8h_source.html |2 +- doc/prebuilt/html/xeno3prm/8255_8h_source.html |2 +- doc/prebuilt/html/xeno3prm/analogy_2driver_8h.html |2 +- .../html/xeno3prm/analogy_2driver_8h_source.html |2 +- doc/prebuilt/html/xeno3prm/analogy_8h.html |2 +- doc/prebuilt/html/xeno3prm/analogy_8h_source.html |2 +- doc/prebuilt/html/xeno3prm/annotated.html |2 +- doc/prebuilt/html/xeno3prm/apc_8h_source.html |2 +- doc/prebuilt/html/xeno3prm/api-tags.html |2 +- ..._2include_2asm_2xenomai_2machine_8h_source.html |2 +- ...include_2asm_2xenomai_2syscall32_8h_source.html |2 +- ..._2include_2asm_2xenomai_2machine_8h_source.html |2 +- ...include_2asm_2xenomai_2syscall32_8h_source.html |2 +- ..._2include_2asm_2xenomai_2machine_8h_source.html |2 +- ...include_2asm_2xenomai_2syscall32_8h_source.html |2 +- ..._2include_2asm_2xenomai_2machine_8h_source.html |2 +- ...include_2asm_2xenomai_2syscall32_8h_source.html |2 +- ..._2include_2asm_2xenomai_2machine_8h_source.html |2 +- ...include_2asm_2xenomai_2syscall32_8h_source.html |2 +- ..._2include_2asm_2xenomai_2machine_8h_source.html |2 +- ...include_2asm_2xenomai_2syscall32_8h_source.html |2 +- ...clude_2asm_2xenomai_2calibration_8h_source.html |2 +- ...m_2include_2asm_2xenomai_2fptest_8h_source.html |2 +- ...lude_2asm_2xenomai_2uapi_2fptest_8h_source.html |2 +- doc/prebuilt/html/xeno3prm/assert_8h_source.html |2 +- doc/prebuilt/html/xeno3prm/async_8c.html |2 +- doc/prebuilt/html/xeno3prm/atomic_8h_source.html |2 +- doc/prebuilt/html/xeno3prm/bheap_8h_source.html|2 +- ...clude_2asm_2xenomai_2calibration_8h_source.html |2 +- ...n_2include_2asm_2xenomai_2fptest_8h_source.html |2 +- ...lude_2asm_2xenomai_2uapi_2fptest_8h_source.html |2 +- .../boilerplate_2ancillaries_8h_source.html|2 +- .../html/xeno3prm/boilerplate_2list_8h_source.html |2 +- .../html/xeno3prm/boilerplate_2lock_8h_source.html |2 +- .../html/xeno3prm/boilerplate_2time_8h_source.html |2 +- doc/prebuilt/html/xeno3prm/bufd_8h_source.html |2 +- .../html/xeno3prm/bufp-label_8c-example.html |2 +- .../html/xeno3prm/bufp-readwrite_8c-example.html |2 +- doc/prebuilt/html/xeno3prm/c1e_8h_source.html |2 +- doc/prebuilt/html/xeno3prm/can-rtt_8c-example.html |2 +- doc/prebuilt/html/xeno3prm/channel__range_8h.html |2 +- .../html/xeno3prm/channel__range_8h_source.html|2 +- doc/prebuilt/html/xeno3prm/classes.html|2 +- doc/prebuilt/html/xeno3prm/clockobj_8h_source.html | 407 ++-- doc/prebuilt/html/xeno3prm/cluster_8h_source.html |2 +- .../html/xeno3prm/cobalt-core_8h_source.html |2 +- .../html/xeno3prm/cobalt-posix_8h_source.html |2 +- .../html/xeno3prm/cobalt-rtdm_8h_source.html |2 +- .../cobalt_2boilerplate_2limits_8h_source.html |2 +- .../cobalt_2boilerplate_2trace_8h_source.html |2 +- .../cobalt_2kernel_2ancillaries_8h_source.html |2 +- .../xeno3prm/cobalt_2kernel_2list_8h_source.html |2 +- .../xeno3prm/cobalt_2kernel_2lock_8h_source.html |2 +- .../cobalt_2kernel_2registry_8h_source.html|2 +- .../cobalt_2kernel_2rtdm_2autotune_8h_source.html |2 +- .../xeno3prm/cobalt_2kernel_2rtdm_2can_8h.html |2 +- .../cobalt_2kernel_2rtdm_2can_8h_source.html |2 +- .../xeno3prm/cobalt_2kernel_2rtdm_2ipc_8h.html |2 +- .../cobalt_2kernel_2rtdm_2ipc_8h_source.html |2 +- .../xeno3prm/cobalt_2kernel_2rtdm_2rtdm_8h.html|2 +- .../cobalt_2kernel_2rtdm_2rtdm_8h_source.html |2 +- .../xeno3prm/cobalt_2kernel_2rtdm_2serial_8h.html |2 +- .../cobalt_2kernel_2rtdm_2serial_8h_source.html|2 +- .../xeno3prm/cobalt_2kernel_2rtdm_2testing_8h.html |2 +- .../cobalt_2kernel_2rtdm_2testing_8h_source.html |2 +- .../xeno3prm/cobalt_2kernel_2rtdm_2udd_8h.html |2 +- .../cobalt_2kernel_2rtdm_2udd_8h_source.html |
[Xenomai-git] Philippe Gerum : demo/alchemy/latency: rename to altency
Module: xenomai-forge Branch: master Commit: 05676371d77e86292292ce9b76b769cc948397fd URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=05676371d77e86292292ce9b76b769cc948397fd Author: Philippe Gerum Date: Wed Sep 24 17:19:34 2014 +0200 demo/alchemy/latency: rename to altency For disambiguation, since we also have the main "latency" measurement program (based on the POSIX API). --- demo/alchemy/Makefile.am | 10 +++ demo/alchemy/Makefile.in | 52 - demo/alchemy/{latency.c => altency.c} | 47 - 3 files changed, 57 insertions(+), 52 deletions(-) diff --git a/demo/alchemy/Makefile.am b/demo/alchemy/Makefile.am index 406bccb..beb3644 100644 --- a/demo/alchemy/Makefile.am +++ b/demo/alchemy/Makefile.am @@ -1,6 +1,6 @@ demodir = @XENO_DEMO_DIR@ -demo_PROGRAMS = latency +demo_PROGRAMS = altency core_libs = if XENO_COBALT @@ -18,10 +18,10 @@ ldadd = \ $(core_libs)\ @XENO_USER_LDADD@ -latency_SOURCES = latency.c -latency_CPPFLAGS = $(cppflags) -latency_LDADD = $(ldadd) -lpthread -lrt -lm -latency_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@ $(XENO_POSIX_WRAPPERS) +altency_SOURCES = altency.c +altency_CPPFLAGS = $(cppflags) +altency_LDADD = $(ldadd) -lpthread -lrt -lm +altency_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@ $(XENO_POSIX_WRAPPERS) # This demo mixes the Alchemy and Xenomai-enabled POSIX APIs over # Cobalt, so we ask for both set of flags. --posix along with diff --git a/demo/alchemy/Makefile.in b/demo/alchemy/Makefile.in index f606a03..37284c1 100644 --- a/demo/alchemy/Makefile.in +++ b/demo/alchemy/Makefile.in @@ -79,7 +79,7 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ -demo_PROGRAMS = latency$(EXEEXT) +demo_PROGRAMS = altency$(EXEEXT) @XENO_COBALT_TRUE@am__append_1 = ../../lib/cobalt/libcobalt.la subdir = demo/alchemy DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ @@ -100,18 +100,18 @@ CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(demodir)" PROGRAMS = $(demo_PROGRAMS) -am_latency_OBJECTS = latency-latency.$(OBJEXT) -latency_OBJECTS = $(am_latency_OBJECTS) +am_altency_OBJECTS = altency-altency.$(OBJEXT) +altency_OBJECTS = $(am_altency_OBJECTS) am__DEPENDENCIES_1 = ../../lib/alchemy/libalchemy.la \ ../../lib/copperplate/libcopperplate.la $(core_libs) -latency_DEPENDENCIES = $(am__DEPENDENCIES_1) +altency_DEPENDENCIES = $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = -latency_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ +altency_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(latency_LDFLAGS) $(LDFLAGS) -o $@ + $(altency_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -146,8 +146,8 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD" $@; am__v_CCLD_1 = -SOURCES = $(latency_SOURCES) -DIST_SOURCES = $(latency_SOURCES) +SOURCES = $(altency_SOURCES) +DIST_SOURCES = $(altency_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ @@ -394,10 +394,10 @@ ldadd = \ $(core_libs)\ @XENO_USER_LDADD@ -latency_SOURCES = latency.c -latency_CPPFLAGS = $(cppflags) -latency_LDADD = $(ldadd) -lpthread -lrt -lm -latency_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@ $(XENO_POSIX_WRAPPERS) +altency_SOURCES = altency.c +altency_CPPFLAGS = $(cppflags) +altency_LDADD = $(ldadd) -lpthread -lrt -lm +altency_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@ $(XENO_POSIX_WRAPPERS) all: all-recursive .SUFFIXES: @@ -482,9 +482,9 @@ clean-demoPROGRAMS: echo " rm -f" $$list; \ rm -f $$list -latency$(EXEEXT): $(latency_OBJECTS) $(latency_DEPENDENCIES) $(EXTRA_latency_DEPENDENCIES) - @rm -f latency$(EXEEXT) - $(AM_V_CCLD)$(latency_LINK) $(latency_OBJECTS) $(latency_LDADD) $(LIBS) +altency$(EXEEXT): $(altency_OBJECTS) $(altency_DEPENDENCIES) $(EXTRA_altency_DEPENDENCIES) + @rm -f altency$(EXEEXT) + $(AM_V_CCLD)$(altency_LINK) $(altency_OBJECTS) $(altency_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -492,7 +492,7 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/latency-latency.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/altency-altency.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -515,19 +515,19 @@ distclean-compile: @AMDE
[Xenomai-git] Philippe Gerum : scripts/wrap-links.sh: avoid duplicate output directive
Module: xenomai-forge Branch: next Commit: b50797c2be6858360bec7a4bb28c181d6107b148 URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=b50797c2be6858360bec7a4bb28c181d6107b148 Author: Philippe Gerum Date: Wed Sep 24 15:04:14 2014 +0200 scripts/wrap-links.sh: avoid duplicate output directive --- scripts/wrap-link.sh |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/wrap-link.sh b/scripts/wrap-link.sh index 6794525..24a270e 100755 --- a/scripts/wrap-link.sh +++ b/scripts/wrap-link.sh @@ -138,7 +138,7 @@ while test $# -gt 0; do next_is_wrapped_symbol=: ;; - -Wl,--wrap,main|-Wl,--wrap=main) + -Wl,--wrap,main|-Wl,--wrap=main|-Wl,--dynamic-list=*) # special case so that Copperplate can interpose on the # main() routine. For this we need this wrapping to # take place in the second stage. @@ -209,5 +209,5 @@ if $stage2; then $dryrun rm -f $output.tmp else $verbose && set -x -$dryrun $cc -o "$output" $onestage_args +$dryrun $cc $onestage_args fi ___ Xenomai-git mailing list Xenomai-git@xenomai.org http://www.xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : demo/alchemy/cross-link: fix RTDM calls
Module: xenomai-forge Branch: next Commit: 61f3ffc27d937973be17c24d5f6cb105a565afdd URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=61f3ffc27d937973be17c24d5f6cb105a565afdd Author: Philippe Gerum Date: Wed Sep 24 15:24:44 2014 +0200 demo/alchemy/cross-link: fix RTDM calls --- demo/alchemy/cobalt/Makefile.am |3 +++ demo/alchemy/cobalt/Makefile.in | 10 ++ demo/alchemy/cobalt/cross-link.c | 41 +++--- 3 files changed, 29 insertions(+), 25 deletions(-) diff --git a/demo/alchemy/cobalt/Makefile.am b/demo/alchemy/cobalt/Makefile.am index 0fbd30e..c9b79c0 100644 --- a/demo/alchemy/cobalt/Makefile.am +++ b/demo/alchemy/cobalt/Makefile.am @@ -1,5 +1,7 @@ demodir = @XENO_DEMO_DIR@ +CCLD = $(top_srcdir)/scripts/wrap-link.sh $(CC) + demo_PROGRAMS = cross-link cppflags = \ @@ -10,6 +12,7 @@ ldadd = \ ../../../lib/alchemy/libalchemy.la \ ../../../lib/copperplate/libcopperplate.la \ ../../../lib/cobalt/libcobalt.la\ + $(XENO_POSIX_WRAPPERS) \ @XENO_USER_LDADD@ \ -lpthread -lrt diff --git a/demo/alchemy/cobalt/Makefile.in b/demo/alchemy/cobalt/Makefile.in index c476b29..1c8a158 100644 --- a/demo/alchemy/cobalt/Makefile.in +++ b/demo/alchemy/cobalt/Makefile.in @@ -101,10 +101,11 @@ am__installdirs = "$(DESTDIR)$(demodir)" PROGRAMS = $(demo_PROGRAMS) am_cross_link_OBJECTS = cross_link-cross-link.$(OBJEXT) cross_link_OBJECTS = $(am_cross_link_OBJECTS) -am__DEPENDENCIES_1 = ../../../lib/alchemy/libalchemy.la \ +am__DEPENDENCIES_1 = +am__DEPENDENCIES_2 = ../../../lib/alchemy/libalchemy.la \ ../../../lib/copperplate/libcopperplate.la \ - ../../../lib/cobalt/libcobalt.la -cross_link_DEPENDENCIES = $(am__DEPENDENCIES_1) + ../../../lib/cobalt/libcobalt.la $(am__DEPENDENCIES_1) +cross_link_DEPENDENCIES = $(am__DEPENDENCIES_2) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent @@ -135,7 +136,6 @@ AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = -CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ @@ -337,6 +337,7 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ demodir = @XENO_DEMO_DIR@ +CCLD = $(top_srcdir)/scripts/wrap-link.sh $(CC) cppflags = \ $(XENO_USER_CFLAGS) \ -I$(top_srcdir)/include @@ -345,6 +346,7 @@ ldadd = \ ../../../lib/alchemy/libalchemy.la \ ../../../lib/copperplate/libcopperplate.la \ ../../../lib/cobalt/libcobalt.la\ + $(XENO_POSIX_WRAPPERS) \ @XENO_USER_LDADD@ \ -lpthread -lrt diff --git a/demo/alchemy/cobalt/cross-link.c b/demo/alchemy/cobalt/cross-link.c index 0da2e98..8c0f53f 100644 --- a/demo/alchemy/cobalt/cross-link.c +++ b/demo/alchemy/cobalt/cross-link.c @@ -32,8 +32,8 @@ #define WTASK_PREFIX "write_task: " #define RTASK_PREFIX "read_task: " -#define WRITE_FILE"rtser0" -#define READ_FILE "rtser1" +#define WRITE_FILE"/dev/rtdm/rtser0" +#define READ_FILE "/dev/rtdm/rtser1" int read_fd = -1; int write_fd = -1; @@ -77,7 +77,7 @@ static int close_file( int fd, char *name) do { i++; - err = rt_dev_close(fd); + err = close(fd); switch (err) { case -EAGAIN: printf(MAIN_PREFIX "%s -> EAGAIN (%d times)\n", @@ -155,9 +155,9 @@ static void write_task_proc(void *arg) write_time = rt_timer_read(); - written = rt_dev_write(write_fd, &write_time, sz); + written = write(write_fd, &write_time, sz); if (written < 0 ) { - printf(WTASK_PREFIX "error on rt_dev_write, %s\n", + printf(WTASK_PREFIX "error on write, %s\n", strerror(-err)); break; } else if (written != sz) { @@ -183,7 +183,7 @@ static void read_task_proc(void *arg) RTIME write_time = 0; RTIME irq_time = 0; ssize_t sz = sizeof(RTIME); - int read = 0; + int rd = 0; struct rtser_event rx_event; printf(" Nr | write->irq|irq->read| write->read |\n"); @@ -197,7 +197,7 @@ static void read_task_proc(void *arg) while (1) { /* waiting for event */ - err = rt_dev_ioctl(read_fd, RTSER_RTIOC_WAIT_EVENT, &rx_event); + err = ioctl(read_fd, RTSER_RTIOC_WAIT_EVENT, &rx_event); if (er
[Xenomai-git] Philippe Gerum : doc: prebuild
Module: xenomai-forge Branch: next Commit: 64171e11ad0a473e42ec02137a3f718afe6348fb URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=64171e11ad0a473e42ec02137a3f718afe6348fb Author: Philippe Gerum Date: Wed Sep 24 15:37:02 2014 +0200 doc: prebuild --- doc/prebuilt/html/MIGRATION/index.html |6 +- doc/prebuilt/html/README.APPLICATIONS/index.html |2 +- doc/prebuilt/html/README.INSTALL/index.html|2 +- .../html/TROUBLESHOOTING.COBALT/index.html |2 +- .../html/TROUBLESHOOTING.MERCURY/index.html|2 +- doc/prebuilt/html/man1/latency/index.html |2 +- doc/prebuilt/html/man1/xeno-config/index.html |2 +- .../html/xeno3prm/16550A__io_8h_source.html|2 +- .../html/xeno3prm/16550A__pci_8h_source.html |2 +- .../html/xeno3prm/16550A__pnp_8h_source.html |2 +- doc/prebuilt/html/xeno3prm/8255_8h_source.html |2 +- doc/prebuilt/html/xeno3prm/analogy_2driver_8h.html |2 +- .../html/xeno3prm/analogy_2driver_8h_source.html |2 +- doc/prebuilt/html/xeno3prm/analogy_8h.html |2 +- doc/prebuilt/html/xeno3prm/analogy_8h_source.html |2 +- doc/prebuilt/html/xeno3prm/annotated.html |2 +- doc/prebuilt/html/xeno3prm/apc_8h_source.html |2 +- doc/prebuilt/html/xeno3prm/api-tags.html |2 +- ..._2include_2asm_2xenomai_2machine_8h_source.html |2 +- ...include_2asm_2xenomai_2syscall32_8h_source.html |2 +- ..._2include_2asm_2xenomai_2machine_8h_source.html |2 +- ...include_2asm_2xenomai_2syscall32_8h_source.html |2 +- ..._2include_2asm_2xenomai_2machine_8h_source.html |2 +- ...include_2asm_2xenomai_2syscall32_8h_source.html |2 +- ..._2include_2asm_2xenomai_2machine_8h_source.html |2 +- ...include_2asm_2xenomai_2syscall32_8h_source.html |2 +- ..._2include_2asm_2xenomai_2machine_8h_source.html |2 +- ...include_2asm_2xenomai_2syscall32_8h_source.html |2 +- ..._2include_2asm_2xenomai_2machine_8h_source.html |2 +- ...include_2asm_2xenomai_2syscall32_8h_source.html |2 +- ...clude_2asm_2xenomai_2calibration_8h_source.html |2 +- ...m_2include_2asm_2xenomai_2fptest_8h_source.html |2 +- ...lude_2asm_2xenomai_2uapi_2fptest_8h_source.html |2 +- doc/prebuilt/html/xeno3prm/assert_8h_source.html |2 +- doc/prebuilt/html/xeno3prm/async_8c.html |2 +- doc/prebuilt/html/xeno3prm/atomic_8h_source.html |2 +- doc/prebuilt/html/xeno3prm/bheap_8h_source.html|2 +- ...clude_2asm_2xenomai_2calibration_8h_source.html |2 +- ...n_2include_2asm_2xenomai_2fptest_8h_source.html |2 +- ...lude_2asm_2xenomai_2uapi_2fptest_8h_source.html |2 +- .../boilerplate_2ancillaries_8h_source.html|2 +- .../html/xeno3prm/boilerplate_2list_8h_source.html |2 +- .../html/xeno3prm/boilerplate_2lock_8h_source.html |2 +- .../html/xeno3prm/boilerplate_2time_8h_source.html |2 +- doc/prebuilt/html/xeno3prm/bufd_8h_source.html |2 +- .../html/xeno3prm/bufp-label_8c-example.html |2 +- .../html/xeno3prm/bufp-readwrite_8c-example.html |2 +- doc/prebuilt/html/xeno3prm/c1e_8h_source.html |2 +- doc/prebuilt/html/xeno3prm/can-rtt_8c-example.html |2 +- doc/prebuilt/html/xeno3prm/channel__range_8h.html |2 +- .../html/xeno3prm/channel__range_8h_source.html|2 +- doc/prebuilt/html/xeno3prm/classes.html|2 +- doc/prebuilt/html/xeno3prm/clockobj_8h_source.html | 407 ++-- doc/prebuilt/html/xeno3prm/cluster_8h_source.html |2 +- .../html/xeno3prm/cobalt-core_8h_source.html |2 +- .../html/xeno3prm/cobalt-posix_8h_source.html |2 +- .../html/xeno3prm/cobalt-rtdm_8h_source.html |2 +- .../cobalt_2boilerplate_2limits_8h_source.html |2 +- .../cobalt_2boilerplate_2trace_8h_source.html |2 +- .../cobalt_2kernel_2ancillaries_8h_source.html |2 +- .../xeno3prm/cobalt_2kernel_2list_8h_source.html |2 +- .../xeno3prm/cobalt_2kernel_2lock_8h_source.html |2 +- .../cobalt_2kernel_2registry_8h_source.html|2 +- .../cobalt_2kernel_2rtdm_2autotune_8h_source.html |2 +- .../xeno3prm/cobalt_2kernel_2rtdm_2can_8h.html |2 +- .../cobalt_2kernel_2rtdm_2can_8h_source.html |2 +- .../xeno3prm/cobalt_2kernel_2rtdm_2ipc_8h.html |2 +- .../cobalt_2kernel_2rtdm_2ipc_8h_source.html |2 +- .../xeno3prm/cobalt_2kernel_2rtdm_2rtdm_8h.html|2 +- .../cobalt_2kernel_2rtdm_2rtdm_8h_source.html |2 +- .../xeno3prm/cobalt_2kernel_2rtdm_2serial_8h.html |2 +- .../cobalt_2kernel_2rtdm_2serial_8h_source.html|2 +- .../xeno3prm/cobalt_2kernel_2rtdm_2testing_8h.html |2 +- .../cobalt_2kernel_2rtdm_2testing_8h_source.html |2 +- .../xeno3prm/cobalt_2kernel_2rtdm_2udd_8h.html |2 +- .../cobalt_2kernel_2rtdm_2udd_8h_source.html |
[Xenomai-git] Philippe Gerum : demo/alchemy/latency: rename to altency
Module: xenomai-forge Branch: next Commit: 05676371d77e86292292ce9b76b769cc948397fd URL: http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=05676371d77e86292292ce9b76b769cc948397fd Author: Philippe Gerum Date: Wed Sep 24 17:19:34 2014 +0200 demo/alchemy/latency: rename to altency For disambiguation, since we also have the main "latency" measurement program (based on the POSIX API). --- demo/alchemy/Makefile.am | 10 +++ demo/alchemy/Makefile.in | 52 - demo/alchemy/{latency.c => altency.c} | 47 - 3 files changed, 57 insertions(+), 52 deletions(-) diff --git a/demo/alchemy/Makefile.am b/demo/alchemy/Makefile.am index 406bccb..beb3644 100644 --- a/demo/alchemy/Makefile.am +++ b/demo/alchemy/Makefile.am @@ -1,6 +1,6 @@ demodir = @XENO_DEMO_DIR@ -demo_PROGRAMS = latency +demo_PROGRAMS = altency core_libs = if XENO_COBALT @@ -18,10 +18,10 @@ ldadd = \ $(core_libs)\ @XENO_USER_LDADD@ -latency_SOURCES = latency.c -latency_CPPFLAGS = $(cppflags) -latency_LDADD = $(ldadd) -lpthread -lrt -lm -latency_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@ $(XENO_POSIX_WRAPPERS) +altency_SOURCES = altency.c +altency_CPPFLAGS = $(cppflags) +altency_LDADD = $(ldadd) -lpthread -lrt -lm +altency_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@ $(XENO_POSIX_WRAPPERS) # This demo mixes the Alchemy and Xenomai-enabled POSIX APIs over # Cobalt, so we ask for both set of flags. --posix along with diff --git a/demo/alchemy/Makefile.in b/demo/alchemy/Makefile.in index f606a03..37284c1 100644 --- a/demo/alchemy/Makefile.in +++ b/demo/alchemy/Makefile.in @@ -79,7 +79,7 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ -demo_PROGRAMS = latency$(EXEEXT) +demo_PROGRAMS = altency$(EXEEXT) @XENO_COBALT_TRUE@am__append_1 = ../../lib/cobalt/libcobalt.la subdir = demo/alchemy DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ @@ -100,18 +100,18 @@ CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(demodir)" PROGRAMS = $(demo_PROGRAMS) -am_latency_OBJECTS = latency-latency.$(OBJEXT) -latency_OBJECTS = $(am_latency_OBJECTS) +am_altency_OBJECTS = altency-altency.$(OBJEXT) +altency_OBJECTS = $(am_altency_OBJECTS) am__DEPENDENCIES_1 = ../../lib/alchemy/libalchemy.la \ ../../lib/copperplate/libcopperplate.la $(core_libs) -latency_DEPENDENCIES = $(am__DEPENDENCIES_1) +altency_DEPENDENCIES = $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = -latency_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ +altency_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(latency_LDFLAGS) $(LDFLAGS) -o $@ + $(altency_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -146,8 +146,8 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD" $@; am__v_CCLD_1 = -SOURCES = $(latency_SOURCES) -DIST_SOURCES = $(latency_SOURCES) +SOURCES = $(altency_SOURCES) +DIST_SOURCES = $(altency_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ @@ -394,10 +394,10 @@ ldadd = \ $(core_libs)\ @XENO_USER_LDADD@ -latency_SOURCES = latency.c -latency_CPPFLAGS = $(cppflags) -latency_LDADD = $(ldadd) -lpthread -lrt -lm -latency_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@ $(XENO_POSIX_WRAPPERS) +altency_SOURCES = altency.c +altency_CPPFLAGS = $(cppflags) +altency_LDADD = $(ldadd) -lpthread -lrt -lm +altency_LDFLAGS = @XENO_AUTOINIT_LDFLAGS@ $(XENO_POSIX_WRAPPERS) all: all-recursive .SUFFIXES: @@ -482,9 +482,9 @@ clean-demoPROGRAMS: echo " rm -f" $$list; \ rm -f $$list -latency$(EXEEXT): $(latency_OBJECTS) $(latency_DEPENDENCIES) $(EXTRA_latency_DEPENDENCIES) - @rm -f latency$(EXEEXT) - $(AM_V_CCLD)$(latency_LINK) $(latency_OBJECTS) $(latency_LDADD) $(LIBS) +altency$(EXEEXT): $(altency_OBJECTS) $(altency_DEPENDENCIES) $(EXTRA_altency_DEPENDENCIES) + @rm -f altency$(EXEEXT) + $(AM_V_CCLD)$(altency_LINK) $(altency_OBJECTS) $(altency_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -492,7 +492,7 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/latency-latency.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/altency-altency.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -515,19 +515,19 @@ distclean-compile: @AMDEP_