[Xenomai-git] Jan Kiszka : nucleus: Improve lostage_work instrumentation
Module: xenomai-head Branch: master Commit: d4f1b549a17a843e076d57ffb868ca0ed24db198 URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=d4f1b549a17a843e076d57ffb868ca0ed24db198 Author: Jan Kiszka Date: Tue Nov 10 23:18:08 2009 +0100 nucleus: Improve lostage_work instrumentation The request type is actually interesting, not its slot number. Signed-off-by: Jan Kiszka --- ksrc/nucleus/shadow.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ksrc/nucleus/shadow.c b/ksrc/nucleus/shadow.c index e924637..6046143 100644 --- a/ksrc/nucleus/shadow.c +++ b/ksrc/nucleus/shadow.c @@ -731,8 +731,8 @@ static void lostage_handler(void *cookie) rq->out = (reqnum + 1) & (LO_MAX_REQUESTS - 1); trace_mark(xn_nucleus, lostage_work, - "reqnum %d comm %s pid %d", - reqnum, p->comm, p->pid); + "type %d comm %s pid %d", + type, p->comm, p->pid); switch (type) { case LO_UNMAP_REQ: ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Jan Kiszka : hal: Ensure atomicity of rthal_local_irq_disabled
Module: xenomai-head Branch: master Commit: fa54cac4be49f7050388f5f50d4a3adafbc8d38c URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=fa54cac4be49f7050388f5f50d4a3adafbc8d38c Author: Jan Kiszka Date: Tue Nov 10 00:19:05 2009 +0100 hal: Ensure atomicity of rthal_local_irq_disabled ipipe_test_pipeline_from is not atomic /wrt reading the current cpu number (or an offset for the per-cpu area) and actually reading the virtualized interrupt state. Work around this by disabling hard IRQs while accessing this service on SMP hosts. This fixes false-positives of RTDM driver debug checks. Signed-off-by: Jan Kiszka --- include/asm-generic/hal.h | 19 ++- 1 files changed, 18 insertions(+), 1 deletions(-) diff --git a/include/asm-generic/hal.h b/include/asm-generic/hal.h index 97c549e..f42095c 100644 --- a/include/asm-generic/hal.h +++ b/include/asm-generic/hal.h @@ -98,6 +98,16 @@ typedef spinlock_t rthal_spinlock_t; #define rthal_cpudata_irq_hits(ipd,cpu,irq) __ipipe_cpudata_irq_hits(ipd,cpu,irq) +#ifndef local_irq_save_hw_smp +#ifdef CONFIG_SMP +#define local_irq_save_hw_smp(flags) local_irq_save_hw(flags) +#define local_irq_restore_hw_smp(flags)local_irq_restore_hw(flags) +#else /* !CONFIG_SMP */ +#define local_irq_save_hw_smp(flags) do { (void)(flags); } while (0) +#define local_irq_restore_hw_smp(flags)do { } while (0) +#endif /* !CONFIG_SMP */ +#endif /* !local_irq_save_hw_smp */ + /* I-pipe domain priorities and virtual interrupt mask handling. If the invariant pipeline head feature is enabled for Xenomai, use it. */ @@ -117,7 +127,14 @@ typedef spinlock_t rthal_spinlock_t; #endif /* !CONFIG_XENO_OPT_PIPELINE_HEAD */ #define rthal_local_irq_flags(x) ((x) = ipipe_test_pipeline_from(&rthal_domain) & 1) #define rthal_local_irq_test() ipipe_test_pipeline_from(&rthal_domain) -#define rthal_local_irq_disabled() ipipe_test_pipeline_from(&rthal_domain) +#define rthal_local_irq_disabled() \ +({ \ + unsigned long __flags, __ret; \ + local_irq_save_hw_smp(__flags); \ + __ret = ipipe_test_pipeline_from(&rthal_domain);\ + local_irq_restore_hw_smp(__flags); \ + __ret; \ +}) #define rthal_stage_irq_enable(dom)ipipe_unstall_pipeline_from(dom) #define rthal_local_irq_save_hw(x) local_irq_save_hw(x) #define rthal_local_irq_restore_hw(x) local_irq_restore_hw(x) ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Jan Kiszka : nucleus: Fix build warning of thread_fault instrumentation
Module: xenomai-head Branch: master Commit: aa361fa6d838c200b02eba7f606b883627683fa9 URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=aa361fa6d838c200b02eba7f606b883627683fa9 Author: Jan Kiszka Date: Wed Nov 11 14:22:04 2009 +0100 nucleus: Fix build warning of thread_fault instrumentation Signed-off-by: Jan Kiszka --- ksrc/nucleus/pod.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/ksrc/nucleus/pod.c b/ksrc/nucleus/pod.c index 0911a7f..fb356c5 100644 --- a/ksrc/nucleus/pod.c +++ b/ksrc/nucleus/pod.c @@ -2542,7 +2542,8 @@ int xnpod_trap_fault(xnarch_fltinfo_t *fltinfo) trace_mark(xn_nucleus, thread_fault, "thread %p thread_name %s ip %p type %d", - thread, xnthread_name(thread), xnarch_fault_pc(fltinfo), + thread, xnthread_name(thread), + (void *)xnarch_fault_pc(fltinfo), xnarch_fault_trap(fltinfo)); #ifdef __KERNEL__ ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Jan Kiszka : nucleus: Fix endless loop of DEBUG_SYNCH_RELAX
Module: xenomai-head Branch: master Commit: 834766db37076e444f7fc1acd8bcffd9975c710c URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=834766db37076e444f7fc1acd8bcffd9975c710c Author: Jan Kiszka Date: Wed Nov 11 10:35:27 2009 +0100 nucleus: Fix endless loop of DEBUG_SYNCH_RELAX When a thread is about to block on a mutex resource that is currently held by a relaxed thread, it will receive SIGXCPU if the relaxed owner debugging feature is enable. But after the signal is delivered and handled, the sleeper will restart the mutex service and then receive the same signal over and over again. Fix this fatal loop by temporarily disabling the warning for the sleeper after the first delivery, but also rearming it for the next run right after that. This will still cause re-deliveries for the same blocking call if the sleeper may fall out due to a different signal delivery. But endless loops will be avoided and the solution is kept simple. Signed-off-by: Jan Kiszka --- include/nucleus/thread.h |1 + ksrc/nucleus/synch.c | 11 --- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/include/nucleus/thread.h b/include/nucleus/thread.h index 389a12b..1124eb4 100644 --- a/include/nucleus/thread.h +++ b/include/nucleus/thread.h @@ -62,6 +62,7 @@ #define XNFPU 0x0010 /**< Thread uses FPU */ #define XNSHADOW 0x0020 /**< Shadow thread */ #define XNROOT0x0040 /**< Root thread (that is, Linux/IDLE) */ +#define XNSWREP 0x0080 /**< Mode switch already reported */ /*! @} */ /* Ends doxygen comment group: nucleus_state_flags */ diff --git a/ksrc/nucleus/synch.c b/ksrc/nucleus/synch.c index 816c7ab..1a9bbb4 100644 --- a/ksrc/nucleus/synch.c +++ b/ksrc/nucleus/synch.c @@ -987,9 +987,12 @@ EXPORT_SYMBOL_GPL(xnsynch_release_all_ownerships); */ void xnsynch_detect_relaxed_owner(struct xnsynch *synch, struct xnthread *sleeper) { - if (xnthread_test_state(sleeper, XNTRAPSW) && - xnthread_test_state(synch->owner, XNRELAX)) + if (xnthread_test_state(sleeper, XNTRAPSW|XNSWREP) == XNTRAPSW && + xnthread_test_state(synch->owner, XNRELAX)) { + xnthread_set_state(sleeper, XNSWREP); xnshadow_send_sig(sleeper, SIGXCPU, 0, 1); + } else + xnthread_clear_state(sleeper, XNSWREP); } /* @@ -1010,8 +1013,10 @@ void xnsynch_detect_claimed_relax(struct xnthread *owner) for (ht = getheadpq(&synch->pendq); ht != NULL; ht = nextpq(&synch->pendq, ht)) { sleeper = link2thread(ht, plink); - if (xnthread_test_state(sleeper, XNRELAX)) + if (xnthread_test_state(sleeper, XNRELAX)) { + xnthread_set_state(sleeper, XNSWREP); xnshadow_send_sig(sleeper, SIGXCPU, 0, 1); + } } } } ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Jan Kiszka : nucleus: Cosmetic cleanup of lostage_handler
Module: xenomai-head Branch: master Commit: f558b46e2efb97335c3251f079c6405ea0b36c80 URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=f558b46e2efb97335c3251f079c6405ea0b36c80 Author: Jan Kiszka Date: Tue Nov 10 23:07:48 2009 +0100 nucleus: Cosmetic cleanup of lostage_handler Granted, it's unlikely that we will ever hit the last free slot and will then actually be preempted by the real-time domain that injects another request. If we were, the slot may be overwritten too early. Let's clean this up, at least for the sake of the reader that tries to grab the logic. Signed-off-by: Jan Kiszka --- ksrc/nucleus/shadow.c | 24 +++- 1 files changed, 15 insertions(+), 9 deletions(-) diff --git a/ksrc/nucleus/shadow.c b/ksrc/nucleus/shadow.c index 1eae0a1..e924637 100644 --- a/ksrc/nucleus/shadow.c +++ b/ksrc/nucleus/shadow.c @@ -716,20 +716,27 @@ static void xnshadow_dereference_skin(unsigned magic) static void lostage_handler(void *cookie) { - int cpu = smp_processor_id(), reqnum, sig, arg; - struct __lostagerq *rq = &lostagerq[cpu]; + struct __lostagerq *rq = &lostagerq[smp_processor_id()]; + int reqnum, type, arg, sig, sigarg; + struct task_struct *p; while ((reqnum = rq->out) != rq->in) { - struct task_struct *p = rq->req[reqnum].task; + type = rq->req[reqnum].type; + p = rq->req[reqnum].task; + arg = rq->req[reqnum].arg; + + /* make sure we read the request before releasing its slot */ + barrier(); + rq->out = (reqnum + 1) & (LO_MAX_REQUESTS - 1); trace_mark(xn_nucleus, lostage_work, "reqnum %d comm %s pid %d", reqnum, p->comm, p->pid); - switch (rq->req[reqnum].type) { + switch (type) { case LO_UNMAP_REQ: - xnshadow_dereference_skin(rq->req[reqnum].arg); + xnshadow_dereference_skin(arg); /* fall through */ case LO_WAKEUP_REQ: @@ -751,21 +758,20 @@ static void lostage_handler(void *cookie) break; case LO_SIGTHR_REQ: - xnshadow_sig_demux(rq->req[reqnum].arg, sig, arg); + xnshadow_sig_demux(arg, sig, sigarg); if (sig == SIGSHADOW) { siginfo_t si; memset(&si, '\0', sizeof(si)); si.si_signo = sig; si.si_code = SI_QUEUE; - si.si_int = arg; + si.si_int = sigarg; send_sig_info(sig, &si, p); } else send_sig(sig, p, 1); break; case LO_SIGGRP_REQ: - sig = rq->req[reqnum].arg; - kill_proc(p->pid, sig, 1); + kill_proc(p->pid, arg, 1); break; } } ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Fabian Godehardt : scripts: use new 'head -n' syntax.
Module: xenomai-head Branch: master Commit: 6eb1ea565fc82afb9727ab5517e019b3c2e0f799 URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=6eb1ea565fc82afb9727ab5517e019b3c2e0f799 Author: Fabian Godehardt Date: Wed Nov 11 12:41:49 2009 +0100 scripts: use new 'head -n' syntax. Executing configure on a chroot which uses a modern equivalent of _POSIX_VERSION breaks on scripts/prepare-kernel.sh: patching file mm/vmalloc.c head: `-1' option is obsolete; use `-n 1' Try `head --help' for more information. This patch converts prepare-kernel.sh to the new 'head -n' syntax. Signed-off-by: Fabian Godehardt --- scripts/prepare-kernel.sh |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/prepare-kernel.sh b/scripts/prepare-kernel.sh index d499563..b052ec3 100755 --- a/scripts/prepare-kernel.sh +++ b/scripts/prepare-kernel.sh @@ -408,10 +408,10 @@ if test -r $linux_tree/arch/$linux_arch/include/asm/ipipe.h; then asm_ipipe_h=$linux_tree/$linux_include_asm/ipipe.h else linux_include_asm=include/asm-$linux_arch - asm_ipipe_h=`ls $linux_tree/include/asm-{$linux_arch,$xenomai_arch}/ipipe.h 2>/dev/null|head -1` + asm_ipipe_h=`ls $linux_tree/include/asm-{$linux_arch,$xenomai_arch}/ipipe.h 2>/dev/null|head -n1` fi -adeos_version=`grep '^#define.*IPIPE_ARCH_STRING.*"' $asm_ipipe_h 2>/dev/null|head -1|sed -e 's,.*"\(.*\)"$,\1,'` +adeos_version=`grep '^#define.*IPIPE_ARCH_STRING.*"' $asm_ipipe_h 2>/dev/null|head -n1|sed -e 's,.*"\(.*\)"$,\1,'` if test \! "x$adeos_version" = x; then if test x$verbose = x1; then ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Fabian Godehardt : scripts: use new 'head -n' syntax.
Module: xenomai-2.4 Branch: master Commit: e13a6eeccb5a1cce0c6e839cb8f6e33084a1ef6d URL: http://git.xenomai.org/?p=xenomai-2.4.git;a=commit;h=e13a6eeccb5a1cce0c6e839cb8f6e33084a1ef6d Author: Fabian Godehardt Date: Wed Nov 11 12:41:49 2009 +0100 scripts: use new 'head -n' syntax. Executing configure on a chroot which uses a modern equivalent of _POSIX_VERSION breaks on scripts/prepare-kernel.sh: patching file mm/vmalloc.c head: `-1' option is obsolete; use `-n 1' Try `head --help' for more information. This patch converts prepare-kernel.sh to the new 'head -n' syntax. Signed-off-by: Fabian Godehardt --- scripts/prepare-kernel.sh |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/prepare-kernel.sh b/scripts/prepare-kernel.sh index 2359bc2..3de59b0 100755 --- a/scripts/prepare-kernel.sh +++ b/scripts/prepare-kernel.sh @@ -408,10 +408,10 @@ if test -r $linux_tree/arch/$linux_arch/include/asm/ipipe.h; then asm_ipipe_h=$linux_tree/$linux_include_asm/ipipe.h else linux_include_asm=include/asm-$linux_arch - asm_ipipe_h=`ls $linux_tree/include/asm-{$linux_arch,$xenomai_arch}/ipipe.h 2>/dev/null|head -1` + asm_ipipe_h=`ls $linux_tree/include/asm-{$linux_arch,$xenomai_arch}/ipipe.h 2>/dev/null|head -n1` fi -adeos_version=`grep '^#define.*IPIPE_ARCH_STRING.*"' $asm_ipipe_h 2>/dev/null|head -1|sed -e 's,.*"\(.*\)"$,\1,'` +adeos_version=`grep '^#define.*IPIPE_ARCH_STRING.*"' $asm_ipipe_h 2>/dev/null|head -n1|sed -e 's,.*"\(.*\)"$,\1,'` if test \! "x$adeos_version" = x; then if test x$verbose = x1; then ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : nios2: upgrade I-pipe support to 2.6.30-nios2-1.1-00
Module: xenomai-head Branch: master Commit: 770d4a1352886ffa144ee0619d0d836b8caa1aa6 URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=770d4a1352886ffa144ee0619d0d836b8caa1aa6 Author: Philippe Gerum Date: Thu Nov 12 12:34:14 2009 +0100 nios2: upgrade I-pipe support to 2.6.30-nios2-1.1-00 --- ksrc/arch/nios2/patches/README |4 +- .../adeos-ipipe-2.6.26-rc6-nios2-1.1-00.patch | 7954 2 files changed, 2 insertions(+), 7956 deletions(-) Diff: http://git.xenomai.org/?p=xenomai-head.git;a=commitdiff;h=770d4a1352886ffa144ee0619d0d836b8caa1aa6 ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : wrappers: make sure pgprot_noncached() is always defined
Module: xenomai-head Branch: master Commit: f27e454e060104a022269c7bc1cf8ee3e12cadee URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=f27e454e060104a022269c7bc1cf8ee3e12cadee Author: Philippe Gerum Date: Thu Nov 12 12:33:49 2009 +0100 wrappers: make sure pgprot_noncached() is always defined --- include/asm-generic/wrappers.h | 10 ++ 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/include/asm-generic/wrappers.h b/include/asm-generic/wrappers.h index 1cfd60c..2ef6016 100644 --- a/include/asm-generic/wrappers.h +++ b/include/asm-generic/wrappers.h @@ -376,6 +376,12 @@ unsigned long find_next_bit(const unsigned long *addr, #define __GFP_BITS_SHIFT 20 #endif +#include + +#ifndef pgprot_noncached +#define pgprot_noncached(p) (p) +#endif /* !pgprot_noncached */ + #define wrap_switch_mm(prev,next,task) \ switch_mm(prev,next,task) #define wrap_enter_lazy_tlb(mm,task) \ @@ -503,10 +509,6 @@ static inline struct task_struct *wrap_find_task_by_pid(pid_t nr) #include -#ifndef CONFIG_MMU -#define pgprot_noncached(p) (p) -#endif /* !CONFIG_MMU */ - #define wrap_find_task_by_pid(nr) find_task_by_pid(nr) #endif /* LINUX_VERSION_CODE < 2.6.27 */ ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : nios2: upgrade I-pipe support to 2.6.30-nios2-1.1-00
Module: xenomai-head Branch: master Commit: cd3465f1862a4aa29e488a3876097d9e425ef907 URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=cd3465f1862a4aa29e488a3876097d9e425ef907 Author: Philippe Gerum Date: Thu Nov 12 12:40:46 2009 +0100 nios2: upgrade I-pipe support to 2.6.30-nios2-1.1-00 --- .../patches/adeos-ipipe-2.6.30-nios2-1.1-00.patch | 8073 1 files changed, 8073 insertions(+), 0 deletions(-) Diff: http://git.xenomai.org/?p=xenomai-head.git;a=commitdiff;h=cd3465f1862a4aa29e488a3876097d9e425ef907 ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: fix a bug in the attach procedure
Module: xenomai-abe Branch: analogy Commit: 033f0bc41e1d40d7e9a68510e3afeb0a6ac9552a URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=033f0bc41e1d40d7e9a68510e3afeb0a6ac9552a Author: Alexis Berlemont Date: Sun Nov 8 02:10:20 2009 +0100 analogy: fix a bug in the attach procedure The options to be sent to the driver at attach time were badly handled if the values were hexadecimal-based. --- src/utils/analogy/analogy_config.c | 20 ++-- 1 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/utils/analogy/analogy_config.c b/src/utils/analogy/analogy_config.c index 316dcd4..1482322 100644 --- a/src/utils/analogy/analogy_config.c +++ b/src/utils/analogy/analogy_config.c @@ -50,7 +50,7 @@ struct option a4l_conf_opts[] = { {0}, }; -int compute_opts(char *opts, unsigned int *nb, unsigned int *res) +int compute_opts(char *opts, unsigned int *nb, unsigned long *res) { int ret = 0, len, ofs; @@ -60,19 +60,26 @@ int compute_opts(char *opts, unsigned int *nb, unsigned int *res) return -EINVAL; *nb = 0; + /* We set errno to 0 so as to be sure that + strtoul did not fail */ + errno = 0; + do { (*nb)++; len = strlen(opts); ofs = strcspn(opts, __OPTS_DELIMITER); - if (res != NULL && sscanf(opts, "%u", &res[(*nb) - 1]) == 0) { - ret = -EINVAL; - goto out_compute_opts; + if (res != NULL) { + res[(*nb) - 1] = strtoul(opts, NULL, 0); + if (errno != 0) { + ret = -errno; + goto out_compute_opts; + } } opts += ofs + 1; } while (len != ofs); out_compute_opts: - (*nb) *= sizeof(unsigned int); + (*nb) *= sizeof(unsigned long); return ret; } @@ -85,7 +92,8 @@ void do_print_version(void) void do_print_usage(void) { fprintf(stdout, - "usage:\tanalogy_config [OPTS] \n"); + "usage:\tanalogy_config [OPTS] devfile driver " + "\n"); fprintf(stdout, "\tOPTS:\t -v, --verbose: verbose output\n"); fprintf(stdout, "\t\t -q, --quiet: quiet output\n"); fprintf(stdout, "\t\t -V, --version: print program version\n"); ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: improve ioctl error handling
Module: xenomai-abe Branch: analogy Commit: ca358d2dd68741bb1f9c52ec4117f254fa134907 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=ca358d2dd68741bb1f9c52ec4117f254fa134907 Author: Alexis Berlemont Date: Thu Nov 5 23:54:47 2009 +0100 analogy: improve ioctl error handling --- ksrc/drivers/analogy/buffer.c | 72 --- ksrc/drivers/analogy/command.c |9 ++-- ksrc/drivers/analogy/device.c |2 +- ksrc/drivers/analogy/instruction.c |2 +- ksrc/drivers/analogy/subdevice.c |3 +- ksrc/drivers/analogy/transfer.c| 10 - 6 files changed, 67 insertions(+), 31 deletions(-) diff --git a/ksrc/drivers/analogy/buffer.c b/ksrc/drivers/analogy/buffer.c index cad8a06..2672d7d 100644 --- a/ksrc/drivers/analogy/buffer.c +++ b/ksrc/drivers/analogy/buffer.c @@ -407,13 +407,20 @@ int a4l_ioctl_mmap(a4l_cxt_t *cxt, void *arg) return -EFAULT; /* Check the subdevice */ - if (map_cfg.idx_subd >= dev->transfer.nb_subd || - (dev->transfer.subds[map_cfg.idx_subd]->flags & A4L_SUBD_CMD) == - 0 - || (dev->transfer.subds[map_cfg.idx_subd]-> - flags & A4L_SUBD_MMAP) == 0) { - __a4l_err("a4l_ioctl_mmap: wrong subdevice selected (idx=%d)\n", - map_cfg.idx_subd); + if (map_cfg.idx_subd >= dev->transfer.nb_subd) { + __a4l_err("a4l_ioctl_mmap: subdevice index " + "out of range (idx=%d)\n", map_cfg.idx_subd); + return -EINVAL; + } + + if ((dev->transfer.subds[map_cfg.idx_subd]->flags & A4L_SUBD_CMD) == 0) { + __a4l_err("a4l_ioctl_mmap: operation not supported, " + "synchronous only subdevice\n"); + return -EINVAL; + } + + if ((dev->transfer.subds[map_cfg.idx_subd]->flags & A4L_SUBD_MMAP) == 0) { + __a4l_err("a4l_ioctl_mmap: mmap not allowed on this subdevice\n"); return -EINVAL; } @@ -476,9 +483,16 @@ int a4l_ioctl_bufcfg(a4l_cxt_t * cxt, void *arg) arg, sizeof(a4l_bufcfg_t)) != 0) return -EFAULT; - if (buf_cfg.idx_subd >= dev->transfer.nb_subd || - (dev->transfer.subds[buf_cfg.idx_subd]->flags & A4L_SUBD_CMD) == 0) { - __a4l_err("a4l_ioctl_bufcfg: wrong subdevice selected\n"); + /* Check the subdevice */ + if (buf_cfg.idx_subd >= dev->transfer.nb_subd) { + __a4l_err("a4l_ioctl_bufcfg: subdevice index " + "out of range (idx=%d)\n", buf_cfg.idx_subd); + return -EINVAL; + } + + if ((dev->transfer.subds[buf_cfg.idx_subd]->flags & A4L_SUBD_CMD) == 0) { + __a4l_err("a4l_ioctl_bufcfg: operation not supported, " + "synchronous only subdevice\n"); return -EINVAL; } @@ -491,7 +505,7 @@ int a4l_ioctl_bufcfg(a4l_cxt_t * cxt, void *arg) no buffer size change is allowed */ if (test_bit(A4L_TSF_BUSY, &(dev->transfer.status[buf_cfg.idx_subd]))) { - __a4l_err("a4l_ioctl_bufcfg: buffer size too big (<=16MB)\n"); + __a4l_err("a4l_ioctl_bufcfg: acquisition in progress\n"); return -EBUSY; } @@ -531,9 +545,16 @@ int a4l_ioctl_bufinfo(a4l_cxt_t * cxt, void *arg) &info, arg, sizeof(a4l_bufinfo_t)) != 0) return -EFAULT; - if (info.idx_subd >= dev->transfer.nb_subd || - (dev->transfer.subds[info.idx_subd]->flags & A4L_SUBD_CMD) == 0) { - __a4l_err("a4l_ioctl_bufinfo: wrong subdevice selected\n"); + /* Check the subdevice */ + if (info.idx_subd >= dev->transfer.nb_subd) { + __a4l_err("a4l_ioctl_bufinfo: subdevice index " + "out of range (idx=%d)\n", info.idx_subd); + return -EINVAL; + } + + if ((dev->transfer.subds[info.idx_subd]->flags & A4L_SUBD_CMD) == 0) { + __a4l_err("a4l_ioctl_bufinfo: operation not supported, " + "synchronous only subdevice\n"); return -EINVAL; } @@ -829,11 +850,6 @@ int a4l_select(a4l_cxt_t *cxt, return -ENOENT; } - /* TODO: to be removed - Check the subdevice capabilities */ - if ((dev->transfer.subds[idx_subd]->flags & A4L_SUBD_CMD) == 0) - return -EINVAL; - /* Performs a bind on the Analogy synchronization element */ return a4l_select_sync(&(buf->sync), selector, type, fd_index); } @@ -856,10 +872,20 @@ int a4l_ioctl_poll(a4l_cxt_t * cxt, void *arg) &poll, arg, sizeof(a4l_poll_t)) != 0) return -EFAULT; - /* Checks the subdevice capabilities */ - if ((dev->transfer.subds[poll.idx_subd
[Xenomai-git] Alexis Berlemont : analogy: fix missing renamings for testing drivers
Module: xenomai-abe Branch: analogy Commit: 1ca6ccbba74b4b1d6d882889f9e5a398710d1b6c URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=1ca6ccbba74b4b1d6d882889f9e5a398710d1b6c Author: Alexis Berlemont Date: Fri Nov 13 02:31:13 2009 +0100 analogy: fix missing renamings for testing drivers --- ksrc/drivers/analogy/testing/fake.c |2 +- ksrc/drivers/analogy/testing/loop.c |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ksrc/drivers/analogy/testing/fake.c b/ksrc/drivers/analogy/testing/fake.c index bf3bacf..cf22086 100644 --- a/ksrc/drivers/analogy/testing/fake.c +++ b/ksrc/drivers/analogy/testing/fake.c @@ -295,7 +295,7 @@ int test_detach(a4l_dev_t *dev) static a4l_drv_t test_drv = { .owner = THIS_MODULE, - .board_name = "a4l_fake", + .board_name = "analogy_fake", .attach = test_attach, .detach = test_detach, .privdata_size = sizeof(tstprv_t), diff --git a/ksrc/drivers/analogy/testing/loop.c b/ksrc/drivers/analogy/testing/loop.c index ad6a229..fae90cb 100644 --- a/ksrc/drivers/analogy/testing/loop.c +++ b/ksrc/drivers/analogy/testing/loop.c @@ -249,7 +249,7 @@ int loop_detach(a4l_dev_t *dev) static a4l_drv_t loop_drv = { .owner = THIS_MODULE, - .board_name = "a4l_loop", + .board_name = "analogy_loop", .attach = loop_attach, .detach = loop_detach, .privdata_size = sizeof(lpprv_t), ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: add default attach options for analogy_parport driver
Module: xenomai-abe Branch: analogy Commit: eb3ad781687526ee7d49e4329b9d2e9996310f11 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=eb3ad781687526ee7d49e4329b9d2e9996310f11 Author: Alexis Berlemont Date: Sun Nov 8 16:33:08 2009 +0100 analogy: add default attach options for analogy_parport driver --- ksrc/drivers/analogy/intel/parport.c | 31 +++ 1 files changed, 19 insertions(+), 12 deletions(-) diff --git a/ksrc/drivers/analogy/intel/parport.c b/ksrc/drivers/analogy/intel/parport.c index 6abc5b4..a1a1625 100644 --- a/ksrc/drivers/analogy/intel/parport.c +++ b/ksrc/drivers/analogy/intel/parport.c @@ -56,7 +56,7 @@ subdevice 2 is digital output. Unlike other Analogy devices, subdevice 0 defaults to output. - Pins 13 and 14 are inverted once by Comedi and once by the + Pins 13 and 14 are inverted once by Analogy and once by the hardware, thus cancelling the effect. Pin 1 is a strobe, thus acts like one. There's no way in software @@ -81,6 +81,9 @@ #define PARPORT_B 1 #define PARPORT_C 2 +#define DEFAULT_ADDRESS 0x378 +#define DEFAULT_IRQ 7 + typedef struct parport_subd_priv { unsigned long io_bits; } parport_spriv_t; @@ -325,24 +328,28 @@ static int dev_parport_attach(a4l_dev_t *dev, a4l_lnkdesc_t *arg) unsigned long io_base; if(arg->opts == NULL || arg->opts_size < sizeof(unsigned long)) { - a4l_err(dev, - "dev_parport_attach: " - "unable to detect any parallel port, " - "no addresses / IRQ passed as attach arguments\n"); - return -EINVAL; - } - io_base = ((unsigned long *)arg->opts)[0]; + a4l_warn(dev, +"dev_parport_attach: no attach options specified, " +"taking default options (addr=0x%x, irq=%d)\n", +DEFAULT_ADDRESS, DEFAULT_IRQ); + + io_base = DEFAULT_ADDRESS; + irq = DEFAULT_IRQ; + } else { + io_base = ((unsigned long *)arg->opts)[0]; + + if (arg->opts_size >= 2 * sizeof(unsigned long)) + irq = (int) ((unsigned long *)arg->opts)[1]; + } + if (!request_region(io_base, PARPORT_SIZE, "analogy_parport")) { a4l_err(dev, "dev_parport_attach: I/O port conflict"); return -EIO; } a4l_info(dev, "dev_parport_attach: address = 0x%lx\n", io_base); - - if (arg->opts_size == 2 * sizeof(unsigned long)) - irq = (int) ((unsigned long *)arg->opts)[1]; for (i = 0; i < 3; i++) { @@ -360,7 +367,7 @@ static int dev_parport_attach(a4l_dev_t *dev, a4l_lnkdesc_t *arg) a4l_subd_t *subd; - a4l_info(dev, "dev_parport_attach: irq = 0x%d\n", irq); + a4l_info(dev, "dev_parport_attach: irq = %d\n", irq); err = a4l_request_irq(dev, irq, parport_interrupt, 0, dev); if (err < 0) { ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: some coding style corrections
Module: xenomai-abe Branch: analogy Commit: 8fb4bbc7686071ef16295494e3d355ffd541670d URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=8fb4bbc7686071ef16295494e3d355ffd541670d Author: Alexis Berlemont Date: Fri Nov 13 02:01:40 2009 +0100 analogy: some coding style corrections --- ksrc/drivers/analogy/testing/loop.c | 12 ++-- 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ksrc/drivers/analogy/testing/loop.c b/ksrc/drivers/analogy/testing/loop.c index ec6ef76..ad6a229 100644 --- a/ksrc/drivers/analogy/testing/loop.c +++ b/ksrc/drivers/analogy/testing/loop.c @@ -128,11 +128,11 @@ int loop_cmd(a4l_subd_t *subd, a4l_cmd_t *cmd) /* Cancel callback */ int loop_cancel(a4l_subd_t *subd) { - lpprv_t *priv=(lpprv_t *)subd->dev->priv; + lpprv_t *priv = (lpprv_t *)subd->dev->priv; a4l_info(subd->dev, "loop_cancel: (subd=%d)\n", subd->idx); - priv->loop_running=0; + priv->loop_running = 0; return 0; } @@ -143,11 +143,11 @@ int loop_insn_read(a4l_subd_t *subd, a4l_kinsn_t *insn) lpprv_t *priv = (lpprv_t*)subd->dev->priv; /* Checks the buffer size */ - if (insn->data_size!=sizeof(sampl_t)) + if (insn->data_size != sizeof(sampl_t)) return -EINVAL; /* Sets the memorized value */ - insn->data[0]=priv->loop_insn_value; + insn->data[0] = priv->loop_insn_value; return 0; } @@ -158,11 +158,11 @@ int loop_insn_write(a4l_subd_t *subd, a4l_kinsn_t *insn) lpprv_t *priv = (lpprv_t*)subd->dev->priv; /* Checks the buffer size */ - if (insn->data_size!=sizeof(sampl_t)) + if (insn->data_size != sizeof(sampl_t)) return -EINVAL; /* Retrieves the value to memorize */ - priv->loop_insn_value=insn->data[0]; + priv->loop_insn_value = insn->data[0]; return 0; } ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: change prefix for traces (a4l -> Analogy)
Module: xenomai-abe Branch: analogy Commit: 0049ee222dd5b48b05f0e894da8a2055a33f9ed6 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=0049ee222dd5b48b05f0e894da8a2055a33f9ed6 Author: Alexis Berlemont Date: Fri Nov 13 02:00:36 2009 +0100 analogy: change prefix for traces (a4l -> Analogy) --- include/analogy/os_facilities.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/include/analogy/os_facilities.h b/include/analogy/os_facilities.h index 66a3f2e..2d882e2 100644 --- a/include/analogy/os_facilities.h +++ b/include/analogy/os_facilities.h @@ -44,7 +44,7 @@ /* --- Kernel traces functions --- */ -#define A4L_PROMPT "a4l: " +#define A4L_PROMPT "Analogy: " #define RTDM_SUBCLASS_ANALOGY 0 ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: fix a minor bug (filename management) in insn_read
Module: xenomai-abe Branch: analogy Commit: 9009a17125862ecaed26a5cb98378bc6127d7e39 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=9009a17125862ecaed26a5cb98378bc6127d7e39 Author: Alexis Berlemont Date: Fri Nov 13 02:03:14 2009 +0100 analogy: fix a minor bug (filename management) in insn_read --- src/utils/analogy/insn_read.c | 11 ++- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/utils/analogy/insn_read.c b/src/utils/analogy/insn_read.c index ce78dc6..bd203a0 100644 --- a/src/utils/analogy/insn_read.c +++ b/src/utils/analogy/insn_read.c @@ -1,6 +1,6 @@ /** * @file - * Analogy for Linux, instruction test program + * Analogy for Linux, instruction read test program * * @note Copyright (C) 1997-2000 David A. Schleef * @note Copyright (C) 2008 Alexis Berlemont @@ -36,7 +36,7 @@ static unsigned char buf[BUF_SIZE]; static double dbuf[BUF_SIZE]; -static char *filename; +static char *filename = FILENAME; static int verbose; static int real_time; static int idx_subd; @@ -141,10 +141,11 @@ int main(int argc, char *argv[]) } /* Open the device */ - ret = a4l_open(&dsc, FILENAME); + ret = a4l_open(&dsc, filename); if (ret < 0) { - fprintf(stderr, "insn_read: a4l_open %s failed (ret=%d)\n", - FILENAME, ret); + fprintf(stderr, + "insn_read: a4l_open %s failed (ret=%d)\n", + filename, ret); return ret; } ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: add a test program which performs synchronous write
Module: xenomai-abe Branch: analogy Commit: 2ded024ad58a3901cbc8b60ce0b6d7a59b0b2640 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=2ded024ad58a3901cbc8b60ce0b6d7a59b0b2640 Author: Alexis Berlemont Date: Fri Nov 13 02:05:31 2009 +0100 analogy: add a test program which performs synchronous write --- src/utils/analogy/Makefile.am |5 +- src/utils/analogy/Makefile.in | 18 +++- src/utils/analogy/insn_write.c | 273 3 files changed, 292 insertions(+), 4 deletions(-) diff --git a/src/utils/analogy/Makefile.am b/src/utils/analogy/Makefile.am index 32d05b5..6a232aa 100644 --- a/src/utils/analogy/Makefile.am +++ b/src/utils/analogy/Makefile.am @@ -1,6 +1,6 @@ sbin_PROGRAMS = analogy_config -bin_PROGRAMS = cmd_read cmd_write insn_read +bin_PROGRAMS = cmd_read cmd_write insn_read insn_write CPPFLAGS = \ @XENO_USER_CFLAGS@ \ @@ -23,3 +23,6 @@ cmd_write_LDADD = -lanalogy -lnative -lrtdm insn_read_SOURCES = insn_read.c insn_read_LDADD = -lanalogy -lnative -lrtdm + +insn_write_SOURCES = insn_write.c +insn_write_LDADD = -lanalogy -lnative -lrtdm diff --git a/src/utils/analogy/Makefile.in b/src/utils/analogy/Makefile.in index 21a34b2..6944a71 100644 --- a/src/utils/analogy/Makefile.in +++ b/src/utils/analogy/Makefile.in @@ -36,7 +36,8 @@ build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ sbin_PROGRAMS = analogy_config$(EXEEXT) -bin_PROGRAMS = cmd_read$(EXEEXT) cmd_write$(EXEEXT) insn_read$(EXEEXT) +bin_PROGRAMS = cmd_read$(EXEEXT) cmd_write$(EXEEXT) insn_read$(EXEEXT) \ + insn_write$(EXEEXT) subdir = src/utils/analogy DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -68,6 +69,9 @@ cmd_write_DEPENDENCIES = am_insn_read_OBJECTS = insn_read.$(OBJEXT) insn_read_OBJECTS = $(am_insn_read_OBJECTS) insn_read_DEPENDENCIES = +am_insn_write_OBJECTS = insn_write.$(OBJEXT) +insn_write_OBJECTS = $(am_insn_write_OBJECTS) +insn_write_DEPENDENCIES = DEFAULT_INCLUDES = -...@am__isrc@ -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles @@ -82,9 +86,11 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(analogy_config_SOURCES) $(cmd_read_SOURCES) \ - $(cmd_write_SOURCES) $(insn_read_SOURCES) + $(cmd_write_SOURCES) $(insn_read_SOURCES) \ + $(insn_write_SOURCES) DIST_SOURCES = $(analogy_config_SOURCES) $(cmd_read_SOURCES) \ - $(cmd_write_SOURCES) $(insn_read_SOURCES) + $(cmd_write_SOURCES) $(insn_read_SOURCES) \ + $(insn_write_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -263,6 +269,8 @@ cmd_write_SOURCES = cmd_write.c cmd_write_LDADD = -lanalogy -lnative -lrtdm insn_read_SOURCES = insn_read.c insn_read_LDADD = -lanalogy -lnative -lrtdm +insn_write_SOURCES = insn_write.c +insn_write_LDADD = -lanalogy -lnative -lrtdm all: all-am .SUFFIXES: @@ -395,6 +403,9 @@ cmd_write$(EXEEXT): $(cmd_write_OBJECTS) $(cmd_write_DEPENDENCIES) insn_read$(EXEEXT): $(insn_read_OBJECTS) $(insn_read_DEPENDENCIES) @rm -f insn_read$(EXEEXT) $(LINK) $(insn_read_OBJECTS) $(insn_read_LDADD) $(LIBS) +insn_write$(EXEEXT): $(insn_write_OBJECTS) $(insn_write_DEPENDENCIES) + @rm -f insn_write$(EXEEXT) + $(LINK) $(insn_write_OBJECTS) $(insn_write_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -406,6 +417,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__qu...@./$(DEPDIR)/cmd_read...@am__quote@ @AMDEP_TRUE@@am__include@ @am__qu...@./$(DEPDIR)/cmd_write...@am__quote@ @AMDEP_TRUE@@am__include@ @am__qu...@./$(DEPDIR)/insn_read...@am__quote@ +...@amdep_true@@am__include@ @am__qu...@./$(DEPDIR)/insn_write...@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< diff --git a/src/utils/analogy/insn_write.c b/src/utils/analogy/insn_write.c new file mode 100644 index 000..007ef4a --- /dev/null +++ b/src/utils/analogy/insn_write.c @@ -0,0 +1,273 @@ +/** + * @file + * Analogy for Linux, instruction write test program + * + * @note Copyright (C) 1997-2000 David A. Schleef + * @note Copyright (C) 2008 Alexis Berlemont + * + * Xenomai is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Xenomai is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Xenomai; if not,
[Xenomai-git] Alexis Berlemont : analogy: minor cosmetic change in instruction header
Module: xenomai-abe Branch: analogy Commit: 68d68862af544deaefa19d1b0e797efe2eb2f597 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=68d68862af544deaefa19d1b0e797efe2eb2f597 Author: Alexis Berlemont Date: Fri Nov 13 01:59:29 2009 +0100 analogy: minor cosmetic change in instruction header --- include/analogy/instruction.h | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/analogy/instruction.h b/include/analogy/instruction.h index a3a82cb..1ac7484 100644 --- a/include/analogy/instruction.h +++ b/include/analogy/instruction.h @@ -127,9 +127,9 @@ * @{ */ -#define A4L_COUNTER_ARMED 0x1 +#define A4L_COUNTER_ARMED 0x1 #define A4L_COUNTER_COUNTING 0x2 -#define A4L_COUNTER_TERMINAL_COUNT 0x4 +#define A4L_COUNTER_TERMINAL_COUNT 0x4 /*! @} ANALOGY_COUNTER_xxx */ @@ -139,9 +139,9 @@ * @{ */ -#define A4L_INPUT 0 -#define A4L_OUTPUT 1 -#define A4L_OPENDRAIN 2 +#define A4L_INPUT 0 +#define A4L_OUTPUT 1 +#define A4L_OPENDRAIN 2 /*! @} ANALOGY_IO_DIRECTION */ ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: make analogy_parport compile only for x86 architectures
Module: xenomai-abe Branch: analogy Commit: eb2f87f8f7446bad2fdb73bd64e42e74901cf269 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=eb2f87f8f7446bad2fdb73bd64e42e74901cf269 Author: Alexis Berlemont Date: Sun Nov 8 16:38:41 2009 +0100 analogy: make analogy_parport compile only for x86 architectures --- ksrc/drivers/analogy/intel/Kconfig |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/ksrc/drivers/analogy/intel/Kconfig b/ksrc/drivers/analogy/intel/Kconfig index 193c9da..6907c83 100644 --- a/ksrc/drivers/analogy/intel/Kconfig +++ b/ksrc/drivers/analogy/intel/Kconfig @@ -5,6 +5,6 @@ config XENO_DRIVERS_ANALOGY_8255 default n config XENO_DRIVERS_ANALOGY_PARPORT - depends on XENO_DRIVERS_ANALOGY + depends on XENO_DRIVERS_ANALOGY && X86 tristate "Standard parallel port driver" default n ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: use the A4L_INSN_* constants to configure the DIO subdevice
Module: xenomai-abe Branch: analogy Commit: e292451fb2ddbbad73eb37092f403016dbec22f3 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=e292451fb2ddbbad73eb37092f403016dbec22f3 Author: Alexis Berlemont Date: Wed Nov 11 17:39:01 2009 +0100 analogy: use the A4L_INSN_* constants to configure the DIO subdevice --- ksrc/drivers/analogy/intel/parport.c | 23 --- 1 files changed, 20 insertions(+), 3 deletions(-) diff --git a/ksrc/drivers/analogy/intel/parport.c b/ksrc/drivers/analogy/intel/parport.c index a1a1625..735656c 100644 --- a/ksrc/drivers/analogy/intel/parport.c +++ b/ksrc/drivers/analogy/intel/parport.c @@ -118,13 +118,30 @@ static int parport_insn_config_a(a4l_subd_t *subd, a4l_kinsn_t *insn) a4l_dev_t *dev = subd->dev; parport_spriv_t *spriv = (parport_spriv_t *)subd->priv; - if (insn->data[0]) { + /* No need to check the channel descriptor; the input / output + setting is global for all channels */ + + switch (insn->data[0]) { + + case A4L_INSN_CONFIG_DIO_OUTPUT: spriv->io_bits = 0xff; - devpriv->c_data &= ~(1 << 5); - } else { + devpriv->c_data &= ~(1 << 5); + break; + + case A4L_INSN_CONFIG_DIO_INPUT: spriv->io_bits = 0; devpriv->c_data |= (1 << 5); + break; + + case A4L_INSN_CONFIG_DIO_QUERY: + insn->data[1] = (spriv->io_bits == 0xff) ? + A4L_OUTPUT: A4L_INPUT; + break; + + default: + return -EINVAL; } + outb(devpriv->c_data, devpriv->io_base + PARPORT_C); return 0; ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: fix functions declarations in the 8255 driver
Module: xenomai-abe Branch: analogy Commit: c3a79acb163f70ec93bdbb764519b9ac41e078b3 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=c3a79acb163f70ec93bdbb764519b9ac41e078b3 Author: Alexis Berlemont Date: Sun Nov 8 02:16:53 2009 +0100 analogy: fix functions declarations in the 8255 driver Some "static" keywords were lacking. --- ksrc/drivers/analogy/intel/8255.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ksrc/drivers/analogy/intel/8255.c b/ksrc/drivers/analogy/intel/8255.c index 8f5010e..a5602c1 100644 --- a/ksrc/drivers/analogy/intel/8255.c +++ b/ksrc/drivers/analogy/intel/8255.c @@ -234,7 +234,7 @@ EXPORT_SYMBOL(subdev_8255_init); */ -int dev_8255_attach(a4l_dev_t *dev, a4l_lnkdesc_t *arg) +static int dev_8255_attach(a4l_dev_t *dev, a4l_lnkdesc_t *arg) { unsigned long *addrs; int i, err = 0; @@ -293,7 +293,7 @@ out_attach: return err; } -int dev_8255_detach(a4l_dev_t *dev) +static int dev_8255_detach(a4l_dev_t *dev) { a4l_subd_t *subd; int i = 0; ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: fix a mistyping error
Module: xenomai-abe Branch: analogy Commit: b8dfa71f7ff8c2655da4e593e35ca3cd9d7696e6 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=b8dfa71f7ff8c2655da4e593e35ca3cd9d7696e6 Author: Alexis Berlemont Date: Sun Nov 8 02:13:42 2009 +0100 analogy: fix a mistyping error --- ksrc/drivers/analogy/buffer.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/ksrc/drivers/analogy/buffer.c b/ksrc/drivers/analogy/buffer.c index 2672d7d..16c3c1e 100644 --- a/ksrc/drivers/analogy/buffer.c +++ b/ksrc/drivers/analogy/buffer.c @@ -875,7 +875,7 @@ int a4l_ioctl_poll(a4l_cxt_t * cxt, void *arg) /* Check the subdevice */ if (poll.idx_subd >= dev->transfer.nb_subd) { __a4l_err("a4l_poll: subdevice index out of range (idx=%d)\n", - buf_cfg.idx_subd); + poll.idx_subd); return -EINVAL; } ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: add an analogy driver for standard parallel port
Module: xenomai-abe Branch: analogy Commit: 809a029bc5aa7f1cbbae760537408dd664ae5ac4 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=809a029bc5aa7f1cbbae760537408dd664ae5ac4 Author: Alexis Berlemont Date: Sun Nov 8 02:20:48 2009 +0100 analogy: add an analogy driver for standard parallel port WARNING: the arguments management in some instruction functions is not coherent with the one in the NI PCIMIO driver. This issue has to be fixed shortly. --- ksrc/drivers/analogy/intel/Kconfig |9 +- ksrc/drivers/analogy/intel/Makefile | 15 +- ksrc/drivers/analogy/intel/parport.c | 428 ++ 3 files changed, 447 insertions(+), 5 deletions(-) diff --git a/ksrc/drivers/analogy/intel/Kconfig b/ksrc/drivers/analogy/intel/Kconfig index 6271d19..193c9da 100644 --- a/ksrc/drivers/analogy/intel/Kconfig +++ b/ksrc/drivers/analogy/intel/Kconfig @@ -1,5 +1,10 @@ config XENO_DRIVERS_ANALOGY_8255 - depends on XENO_DRIVERS_ANALOGY && EXPERIMENTAL + depends on XENO_DRIVERS_ANALOGY tristate "8255 driver" - default n \ No newline at end of file + default n + +config XENO_DRIVERS_ANALOGY_PARPORT + depends on XENO_DRIVERS_ANALOGY + tristate "Standard parallel port driver" + default n diff --git a/ksrc/drivers/analogy/intel/Makefile b/ksrc/drivers/analogy/intel/Makefile index 57ea839..e708c39 100644 --- a/ksrc/drivers/analogy/intel/Makefile +++ b/ksrc/drivers/analogy/intel/Makefile @@ -6,8 +6,13 @@ EXTRA_CFLAGS += -D__IN_XENOMAI__ -Iinclude/xenomai obj-$(CONFIG_XENO_DRIVERS_ANALOGY_8255) += analogy_8255.o +obj-$(CONFIG_XENO_DRIVERS_ANALOGY_PARPORT) += analogy_parport.o + analogy_8255-y := 8255.o +analogy_parport-y := parport.o + + else # Makefile frag for Linux v2.4 @@ -16,15 +21,19 @@ O_TARGET := built-in.o obj-$(CONFIG_XENO_DRIVERS_ANALOGY_8255) += analogy_8255.o +obj-$(CONFIG_XENO_DRIVERS_ANALOGY_PARPORT) += analogy_parport.o + analogy_8255-objs := 8255.o -export-objs := $(analgoy_8255-objs) +analogy_parport-objs := parport.o + +export-objs := $(analgoy_8255-objs) $(analgoy_parport-objs) EXTRA_CFLAGS += -D__IN_XENOMAI__ -I$(TOPDIR)/include/xenomai -I$(TOPDIR)/include/xenomai/compat include $(TOPDIR)/Rules.make -analogy_8255.o: $(analogy_8255-objs) - $(LD) -r -o $@ $(analogy_8255-objs) +analogy_8255.o: $(analogy_8255-objs) $(analgoy_parport-objs) + $(LD) -r -o $@ $(analogy_8255-objs) $(analgoy_parport-objs) endif diff --git a/ksrc/drivers/analogy/intel/parport.c b/ksrc/drivers/analogy/intel/parport.c new file mode 100644 index 000..6abc5b4 --- /dev/null +++ b/ksrc/drivers/analogy/intel/parport.c @@ -0,0 +1,428 @@ +/** + * @file + * Analogy driver for standard parallel port + * @note Copyright (C) 1998,2001 David A. Schleef + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +/* + A cheap and easy way to get a few more digital I/O lines. Steal + additional parallel ports from old computers or your neighbors' + computers. + + Option list: + 0: I/O port base for the parallel port. + 1: IRQ + + Parallel Port Lines: + + pin subdev chanaka + --- -- --- + 1 2 0 strobe + 2 0 0 data 0 + 3 0 1 data 1 + 4 0 2 data 2 + 5 0 3 data 3 + 6 0 4 data 4 + 7 0 5 data 5 + 8 0 6 data 6 + 9 0 7 data 7 + 10 1 3 acknowledge + 11 1 4 busy + 12 1 2 output + 13 1 1 printer selected + 14 2 1 auto LF + 15 1 0 error + 16 2 2 init + 17 2 3 select printer + 18-25 ground + + Notes: + + Subdevices 0 is digital I/O, subdevice 1 is digital input, and + subdevice 2 is digital output. Unlike other Analogy devices, + subdevice 0 defaults to output. + + Pins 13 and 14 are inverted once by Comedi and once by the + hardware, thus cancelling the effect. + + Pin 1 is a strobe, thus acts like one. There's no way in software + to change this, at least on a standard parallel port. + + Subdevice 3 pretends to be a digital input sub
[Xenomai-git] Alexis Berlemont : analogy: remove EXPERIMENTAL flag from 2.4 Config. in files
Module: xenomai-abe Branch: analogy Commit: 428419e4b0e026ac6b702294c0718982c32fe2a3 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=428419e4b0e026ac6b702294c0718982c32fe2a3 Author: Alexis Berlemont Date: Sun Nov 8 02:12:02 2009 +0100 analogy: remove EXPERIMENTAL flag from 2.4 Config.in files --- ksrc/drivers/analogy/intel/Config.in |6 +++--- .../drivers/analogy/national_instruments/Config.in |4 +--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/ksrc/drivers/analogy/intel/Config.in b/ksrc/drivers/analogy/intel/Config.in index 357bb51..515648a 100644 --- a/ksrc/drivers/analogy/intel/Config.in +++ b/ksrc/drivers/analogy/intel/Config.in @@ -3,6 +3,6 @@ # Xenomai configuration for Linux v2.4 # -if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then - dep_tristate '8255 driver' CONFIG_XENO_DRIVERS_ANALOGY_8255 $CONFIG_XENO_DRIVERS_ANALOGY -fi +dep_tristate '8255 driver' CONFIG_XENO_DRIVERS_ANALOGY_8255 $CONFIG_XENO_DRIVERS_ANALOGY + +dep_tristate 'standard parallel port driver' CONFIG_XENO_DRIVERS_ANALOGY_PARPORT $CONFIG_XENO_DRIVERS_ANALOGY \ No newline at end of file diff --git a/ksrc/drivers/analogy/national_instruments/Config.in b/ksrc/drivers/analogy/national_instruments/Config.in index 95e4d99..3dff689 100644 --- a/ksrc/drivers/analogy/national_instruments/Config.in +++ b/ksrc/drivers/analogy/national_instruments/Config.in @@ -3,6 +3,4 @@ # Xenomai configuration for Linux v2.4 # -if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then - dep_tristate 'NI MITE driver' CONFIG_XENO_DRIVERS_ANALOGY_NI_MITE $CONFIG_XENO_DRIVERS_ANALOGY -fi +dep_tristate 'NI MITE driver' CONFIG_XENO_DRIVERS_ANALOGY_NI_MITE $CONFIG_XENO_DRIVERS_ANALOGY ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Jan Kiszka : rtdm: Fix copy&paste mistake in instrumentation
Module: xenomai-jki Branch: for-upstream Commit: 5e209eeeb854e7bb376f3ed044d5ded14ab85b66 URL: http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=5e209eeeb854e7bb376f3ed044d5ded14ab85b66 Author: Jan Kiszka Date: Sat Nov 14 14:00:14 2009 +0100 rtdm: Fix copy&paste mistake in instrumentation Signed-off-by: Jan Kiszka --- ksrc/skins/rtdm/core.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/ksrc/skins/rtdm/core.c b/ksrc/skins/rtdm/core.c index 5843842..bc3dccc 100644 --- a/ksrc/skins/rtdm/core.c +++ b/ksrc/skins/rtdm/core.c @@ -511,7 +511,7 @@ EXPORT_SYMBOL(__rt_dev_recvmsg); ssize_t __rt_dev_sendmsg(rtdm_user_info_t *user_info, int fd, const struct msghdr *msg, int flags) { - trace_mark(xn_rtdm, recvmsg, "user_info %p fd %d msg_name %p " + trace_mark(xn_rtdm, sendmsg, "user_info %p fd %d msg_name %p " "msg_namelen %u msg_iov %p msg_iovlen %zu " "msg_control %p msg_controllen %zu msg_flags %d", user_info, fd, msg->msg_name, msg->msg_namelen, ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Gilles Chanteperdrix : Regenerate autotools files
Module: xenomai-gch Branch: for-head Commit: 68e10ca0a3facb188c3c2dfa4bde71b71f77a7ee URL: http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=68e10ca0a3facb188c3c2dfa4bde71b71f77a7ee Author: Gilles Chanteperdrix Date: Sun Nov 15 19:24:00 2009 +0100 Regenerate autotools files --- Makefile.in| 193 +- aclocal.m4 | 323 +- config/Makefile.in | 43 +- configure | 5868 doc/Makefile.in| 131 +- doc/docbook/Makefile.in| 131 +- doc/docbook/custom-stylesheets/Makefile.in | 131 +- doc/docbook/custom-stylesheets/xsl/Makefile.in | 131 +- .../custom-stylesheets/xsl/common/Makefile.in | 43 +- doc/docbook/custom-stylesheets/xsl/fo/Makefile.in | 43 +- .../custom-stylesheets/xsl/html/Makefile.in| 43 +- doc/docbook/xenomai/Makefile.in| 43 +- doc/doxygen/Makefile.in| 43 +- doc/man/Makefile.in| 215 +- doc/txt/Makefile.in| 82 +- include/Makefile.in| 192 +- include/analogy/Makefile.in| 105 +- include/asm-arm/Makefile.in| 170 +- include/asm-arm/bits/Makefile.in | 105 +- include/asm-blackfin/Makefile.in | 170 +- include/asm-blackfin/bits/Makefile.in | 105 +- include/asm-generic/Makefile.in| 170 +- include/asm-generic/bits/Makefile.in | 105 +- include/asm-nios2/Makefile.in | 170 +- include/asm-nios2/bits/Makefile.in | 105 +- include/asm-powerpc/Makefile.in| 170 +- include/asm-powerpc/bits/Makefile.in | 105 +- include/asm-sim/Makefile.in| 170 +- include/asm-sim/bits/Makefile.in | 105 +- include/asm-x86/Makefile.in| 170 +- include/asm-x86/bits/Makefile.in | 105 +- include/native/Makefile.in | 105 +- include/nucleus/Makefile.in| 105 +- include/posix/Makefile.in | 170 +- include/posix/sys/Makefile.in | 105 +- include/psos+/Makefile.in | 105 +- include/rtai/Makefile.in | 105 +- include/rtdm/Makefile.in | 105 +- include/uitron/Makefile.in | 105 +- include/vrtx/Makefile.in | 105 +- include/vxworks/Makefile.in| 105 +- scripts/Makefile.in| 104 +- src/Makefile.in| 131 +- src/drvlib/Makefile.in | 131 +- src/drvlib/analogy/Makefile.in | 149 +- src/include/Makefile.in| 47 +- src/include/xeno_config.h.in |3 - src/rtdk/Makefile.in | 137 +- src/skins/Makefile.in | 133 +- src/skins/common/Makefile.in | 45 +- src/skins/native/Makefile.in | 206 +- src/skins/posix/Makefile.in| 194 +- src/skins/psos+/Makefile.in| 158 +- src/skins/rtai/Makefile.in | 128 +- src/skins/rtdm/Makefile.in | 128 +- src/skins/uitron/Makefile.in | 146 +- src/skins/vrtx/Makefile.in | 182 +- src/skins/vxworks/Makefile.in | 188 +- src/testsuite/Makefile.in | 131 +- src/testsuite/clocktest/Makefile.in| 133 +- src/testsuite/cyclic/Makefile.in | 133 +- src/testsuite/irqbench/Makefile.in | 137 +- src/testsuite/klatency/Makefile.in | 133 +- src/testsuite/latency/Makefile.in | 133 +- src/testsuite/switchtest/Makefile.in | 133 +- src/testsuite/unit/Makefile.in | 149 +- src/utils/Makefile.in | 131 +- src/utils/analogy/Makefile.in | 185 +- src/utils/can/Makefile.in | 185 +- src/utils/ps/Makefile.in | 129 +- 70 files changed, 6322 insertions(+), 8400 deletions(-) Diff: http://git.xenomai.org/?p=xenomai-gch.git;a=commitdiff;h=68e10ca0a3facb188c3c2dfa4bde71b71f77a7ee ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Gilles Chanteperdrix : Replace the function definitions in bind. h with a convenience library.
Module: xenomai-gch Branch: for-head Commit: 05a32ee49ceedddc44024c2fc2f6125fdfe344b9 URL: http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=05a32ee49ceedddc44024c2fc2f6125fdfe344b9 Author: Gilles Chanteperdrix Date: Sun Nov 15 19:21:43 2009 +0100 Replace the function definitions in bind.h with a convenience library. --- configure.in|4 + include/asm-generic/bits/bind.h | 301 +--- src/skins/Makefile.am |2 +- src/skins/common/Makefile.am| 12 + src/skins/common/Makefile.in| 495 +++ src/skins/common/bind.c | 75 ++ src/skins/common/current.c | 74 ++ src/skins/common/sem_heap.c | 87 +++ src/skins/common/sem_heap.h | 12 + 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 + 17 files changed, 782 insertions(+), 296 deletions(-) diff --git a/configure.in b/configure.in index 9cce885..d0d9a1c 100644 --- a/configure.in +++ b/configure.in @@ -620,6 +620,8 @@ dnl test x$CONFIG_XENO_X86_SEP = xy && AC_DEFINE(CONFIG_XENO_X86_SEP,1,[config]) test x$CONFIG_SMP = xy && AC_DEFINE(CONFIG_SMP,1,[config]) test x$CONFIG_XENO_FASTSYNCH = xy && AC_DEFINE(CONFIG_XENO_FASTSYNCH,1,[config]) +AM_CONDITIONAL(CONFIG_XENO_FASTSYNCH,[test "$CONFIG_XENO_FASTSYNCH" = y]) + test x$CONFIG_X86_TSC = xy && AC_DEFINE(CONFIG_X86_TSC,1,[config]) test -n "$CONFIG_XENO_ARM_ARCH" && AC_DEFINE_UNQUOTED(CONFIG_XENO_ARM_ARCH,$CONFIG_XENO_ARM_ARCH,[config]) @@ -628,6 +630,7 @@ test x$CONFIG_XENO_CPU_XSC3 = xy && AC_DEFINE(CONFIG_XENO_CPU_XSC3,1,[config]) test $XNARCH_ARM_TSC_TYPE && AC_DEFINE_UNQUOTED(XNARCH_ARM_TSC_TYPE,$XNARCH_ARM_TSC_TYPE,[config]) test x$CONFIG_XENO_ARM_EABI = xy && AC_DEFINE(CONFIG_XENO_ARM_EABI,1,[config]) + # Default sampling period (ns) used in various tests AC_DEFINE_UNQUOTED(CONFIG_XENO_DEFAULT_PERIOD,$CONFIG_XENO_DEFAULT_PERIOD,[config]) @@ -889,6 +892,7 @@ AC_CONFIG_FILES([ \ src/Makefile \ src/rtdk/Makefile \ src/skins/Makefile \ + src/skins/common/Makefile \ src/skins/posix/Makefile \ src/skins/native/Makefile \ src/skins/vxworks/Makefile \ diff --git a/include/asm-generic/bits/bind.h b/include/asm-generic/bits/bind.h index 3684b21..7da2c43 100644 --- a/include/asm-generic/bits/bind.h +++ b/include/asm-generic/bits/bind.h @@ -3,320 +3,31 @@ #include #include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include - -#ifdef HAVE___THREAD -__thread __attribute__ ((tls_model ("initial-exec"), weak)) -xnhandle_t xeno_current = XN_NO_HANDLE; -__thread __attribute__ ((tls_model ("initial-exec"), weak)) -unsigned long xeno_current_mode; - -static inline void __xeno_set_current(xnhandle_t current) -{ - xeno_current = current; -} -#else /* !HAVE___THREAD */ -pthread_once_t xeno_init_current_keys_once __attribute__((weak)); -pthread_key_t xeno_current_key __attribute__ ((weak)); -pthread_key_t xeno_current_mode_key __attribute__ ((weak)); - -static inline void __xeno_set_current(xnhandle_t current) -{ - pthread_setspecific(xeno_current_key, (void *)current); -} - -__attribute__ ((weak)) -unsigned long *xeno_init_current_mode(void) -{ - unsigned long *mode = malloc(sizeof(unsigned long)); - pthread_setspecific(xeno_current_mode_key, mode); - return mode; -} - -static void cleanup_current_mode(void *ptr) -{ - free(ptr); -} - -static void __init_current_keys(void) -{ - int err = pthread_key_create(&xeno_current_key, NULL); - if (err) - goto error_exit; - - err = pthread_key_create(&xeno_current_mode_key, cleanup_current_mode); - if (err) { - error_exit: - fprintf(stderr, "Xenomai: error creating TSD key: %s\n", - strerror(-err)); - exit(1); - } -} - -static __attribute__((constructor)) -void init_current_keys(void) -{ - pthread_once(&xeno_init_current_keys_once, __init_current_keys); -} -#endif /* !HAVE___THREAD */ - -__attribute__ ((weak)) -void xeno_set_current(void) -{ - xnhandle_t current; - int err; - - err = XENOMAI_SYSCALL1(__xn_sys_current, ¤t); - if (err) { - fprintf(stderr, "Xenomai: error obtaining handle for current " - "thread: %s\n", strerror(-err)); - exit(1); - } - __xeno_set_current(current); -} - -#ifdef CONFIG_XENO_FASTSYNCH -__attribute__ ((weak)) -unsigned long xeno_sem_heap[2] = { 0, 0 }; -#endif /* CONFIG_XENO_FASTSYNCH */ void xeno_handle_mlock_alert(int sig); -#ifdef CONFIG_XENO_F
[Xenomai-git] Jan Kiszka : nucleus: Include all heaps in statistics
Module: xenomai-jki Branch: for-upstream Commit: 44e0b4874b784dca0c4712e54b45f2a7d9ae6d19 URL: http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=44e0b4874b784dca0c4712e54b45f2a7d9ae6d19 Author: Jan Kiszka Date: Mon Nov 16 14:39:42 2009 +0100 nucleus: Include all heaps in statistics This extends /proc/xenomai/heap with statistics about all currently used heaps. The required descriptive label is propagated via a new xnheap API service, xnheap_set_label. Moreover, care is taken to flush nklock while iterating of this potentially long list. Signed-off-by: Jan Kiszka --- include/nucleus/heap.h|6 +++ ksrc/drivers/ipc/iddp.c |1 + ksrc/drivers/ipc/xddp.c |3 + ksrc/nucleus/heap.c | 99 - ksrc/nucleus/module.c |2 + ksrc/nucleus/pod.c|2 + ksrc/nucleus/shadow.c |2 + ksrc/skins/native/heap.c |1 + ksrc/skins/native/pipe.c |2 + ksrc/skins/native/queue.c |1 + ksrc/skins/posix/shm.c|3 + ksrc/skins/psos+/rn.c |2 + ksrc/skins/rtai/shm.c |1 + ksrc/skins/vrtx/heap.c|1 + ksrc/skins/vrtx/syscall.c |2 + 15 files changed, 118 insertions(+), 10 deletions(-) diff --git a/include/nucleus/heap.h b/include/nucleus/heap.h index 44db738..77fefa6 100644 --- a/include/nucleus/heap.h +++ b/include/nucleus/heap.h @@ -115,6 +115,10 @@ typedef struct xnheap { XNARCH_DECL_DISPLAY_CONTEXT(); + xnholder_t stat_link; /* Link in heapq */ + + char label[XNOBJECT_NAME_LEN+16]; + } xnheap_t; extern xnheap_t kheap; @@ -226,6 +230,8 @@ int xnheap_init(xnheap_t *heap, u_long heapsize, u_long pagesize); +void xnheap_set_label(xnheap_t *heap, const char *name, ...); + void xnheap_destroy(xnheap_t *heap, void (*flushfn)(xnheap_t *heap, void *extaddr, diff --git a/ksrc/drivers/ipc/iddp.c b/ksrc/drivers/ipc/iddp.c index a589d34..8a1b079 100644 --- a/ksrc/drivers/ipc/iddp.c +++ b/ksrc/drivers/ipc/iddp.c @@ -564,6 +564,7 @@ static int __iddp_bind_socket(struct rtipc_private *priv, xnarch_free_host_mem(poolmem, poolsz); goto fail; } + xnheap_set_label(&sk->privpool, "ippd: %d", port); sk->poolevt = &sk->privevt; sk->poolwait = &sk->privwait; diff --git a/ksrc/drivers/ipc/xddp.c b/ksrc/drivers/ipc/xddp.c index f62147a..c2a65e9 100644 --- a/ksrc/drivers/ipc/xddp.c +++ b/ksrc/drivers/ipc/xddp.c @@ -750,6 +750,9 @@ static int __xddp_bind_socket(struct rtipc_private *priv, if (sk->peer.sipc_port < 0) sk->peer = *sa; + if (poolsz > 0) + xnheap_set_label(sk->bufpool, "xddp: %d", sa->sipc_port); + if (*sk->label) { ret = xnregistry_enter(sk->label, sk, &sk->handle, &__xddp_pnode); diff --git a/ksrc/nucleus/heap.c b/ksrc/nucleus/heap.c index 27a4ad7..cfcef7b 100644 --- a/ksrc/nucleus/heap.c +++ b/ksrc/nucleus/heap.c @@ -76,6 +76,9 @@ EXPORT_SYMBOL_GPL(kheap); xnheap_t kstacks; /* Private stack pool */ #endif +static DEFINE_XNQUEUE(heapq); /* Heap list for /proc reporting */ +static unsigned long heapq_rev; + static void init_extent(xnheap_t *heap, xnextent_t *extent) { caddr_t freepage; @@ -167,6 +170,7 @@ int xnheap_init(xnheap_t *heap, unsigned cpu, nr_cpus = xnarch_num_online_cpus(); u_long hdrsize, shiftsize, pageshift; xnextent_t *extent; + spl_t s; /* * Perform some parametrical checks first. @@ -232,12 +236,57 @@ int xnheap_init(xnheap_t *heap, appendq(&heap->extents, &extent->link); + snprintf(heap->label, sizeof(heap->label), "unlabeled (%p)", heap); + + xnlock_get_irqsave(&nklock, s); + appendq(&heapq, &heap->stat_link); + heapq_rev++; + xnlock_put_irqrestore(&nklock, s); + xnarch_init_display_context(heap); return 0; } EXPORT_SYMBOL_GPL(xnheap_init); +/*! + * \fn xnheap_set_label(xnheap_t *heap,const char *label,...) + * \brief Set the heap's label string. + * + * Set the heap label that will be used in statistic outputs. + * + * @param heap The address of a heap descriptor. + * + * @param label Label string displayed in statistic outputs. This parameter + * can be a format string, in which case succeeding parameters will be used + * to resolve the final label. + * + * Environments: + * + * This service can be called from: + * + * - Kernel module initialization/cleanup code + * - Kernel-based task + * - User-space task + * + * Rescheduling: never. + */ + +void xnheap_set_label(xnheap_t *heap, const char *label, ...) +{ + va_list args; + spl_t s; + + va_start(args, label); + + xnlock_get_irqsave(&nklock, s); + vsnprintf(heap->label, sizeof(heap->label), label, args); + xnlock_put_
[Xenomai-git] Jan Kiszka : nucleus: Include all heaps in statistics
Module: xenomai-jki Branch: for-upstream Commit: bdda0013bb4a666a1d2c55ef52c5dd55e5fb6f3b URL: http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=bdda0013bb4a666a1d2c55ef52c5dd55e5fb6f3b Author: Jan Kiszka Date: Mon Nov 16 14:39:42 2009 +0100 nucleus: Include all heaps in statistics This extends /proc/xenomai/heap with statistics about all currently used heaps. The required descriptive label is propagated via a new xnheap API service, xnheap_set_label. Moreover, care is taken to flush nklock while iterating of this potentially long list. Signed-off-by: Jan Kiszka --- include/nucleus/heap.h|6 +++ ksrc/drivers/ipc/iddp.c |1 + ksrc/drivers/ipc/xddp.c |3 + ksrc/nucleus/heap.c | 99 - ksrc/nucleus/module.c |2 + ksrc/nucleus/pod.c|2 + ksrc/nucleus/shadow.c |2 + ksrc/skins/native/heap.c |1 + ksrc/skins/native/pipe.c |2 + ksrc/skins/native/queue.c |1 + ksrc/skins/posix/shm.c|3 + ksrc/skins/psos+/rn.c |2 + ksrc/skins/rtai/shm.c |1 + ksrc/skins/vrtx/heap.c|1 + ksrc/skins/vrtx/syscall.c |2 + 15 files changed, 118 insertions(+), 10 deletions(-) diff --git a/include/nucleus/heap.h b/include/nucleus/heap.h index 44db738..77fefa6 100644 --- a/include/nucleus/heap.h +++ b/include/nucleus/heap.h @@ -115,6 +115,10 @@ typedef struct xnheap { XNARCH_DECL_DISPLAY_CONTEXT(); + xnholder_t stat_link; /* Link in heapq */ + + char label[XNOBJECT_NAME_LEN+16]; + } xnheap_t; extern xnheap_t kheap; @@ -226,6 +230,8 @@ int xnheap_init(xnheap_t *heap, u_long heapsize, u_long pagesize); +void xnheap_set_label(xnheap_t *heap, const char *name, ...); + void xnheap_destroy(xnheap_t *heap, void (*flushfn)(xnheap_t *heap, void *extaddr, diff --git a/ksrc/drivers/ipc/iddp.c b/ksrc/drivers/ipc/iddp.c index a589d34..8a1b079 100644 --- a/ksrc/drivers/ipc/iddp.c +++ b/ksrc/drivers/ipc/iddp.c @@ -564,6 +564,7 @@ static int __iddp_bind_socket(struct rtipc_private *priv, xnarch_free_host_mem(poolmem, poolsz); goto fail; } + xnheap_set_label(&sk->privpool, "ippd: %d", port); sk->poolevt = &sk->privevt; sk->poolwait = &sk->privwait; diff --git a/ksrc/drivers/ipc/xddp.c b/ksrc/drivers/ipc/xddp.c index f62147a..c2a65e9 100644 --- a/ksrc/drivers/ipc/xddp.c +++ b/ksrc/drivers/ipc/xddp.c @@ -750,6 +750,9 @@ static int __xddp_bind_socket(struct rtipc_private *priv, if (sk->peer.sipc_port < 0) sk->peer = *sa; + if (poolsz > 0) + xnheap_set_label(sk->bufpool, "xddp: %d", sa->sipc_port); + if (*sk->label) { ret = xnregistry_enter(sk->label, sk, &sk->handle, &__xddp_pnode); diff --git a/ksrc/nucleus/heap.c b/ksrc/nucleus/heap.c index 27a4ad7..8e82c9a 100644 --- a/ksrc/nucleus/heap.c +++ b/ksrc/nucleus/heap.c @@ -76,6 +76,9 @@ EXPORT_SYMBOL_GPL(kheap); xnheap_t kstacks; /* Private stack pool */ #endif +static DEFINE_XNQUEUE(heapq); /* Heap list for /proc reporting */ +static unsigned long heapq_rev; + static void init_extent(xnheap_t *heap, xnextent_t *extent) { caddr_t freepage; @@ -167,6 +170,7 @@ int xnheap_init(xnheap_t *heap, unsigned cpu, nr_cpus = xnarch_num_online_cpus(); u_long hdrsize, shiftsize, pageshift; xnextent_t *extent; + spl_t s; /* * Perform some parametrical checks first. @@ -232,12 +236,57 @@ int xnheap_init(xnheap_t *heap, appendq(&heap->extents, &extent->link); + snprintf(heap->label, sizeof(heap->label), "unlabeled @0x%p", heap); + + xnlock_get_irqsave(&nklock, s); + appendq(&heapq, &heap->stat_link); + heapq_rev++; + xnlock_put_irqrestore(&nklock, s); + xnarch_init_display_context(heap); return 0; } EXPORT_SYMBOL_GPL(xnheap_init); +/*! + * \fn xnheap_set_label(xnheap_t *heap,const char *label,...) + * \brief Set the heap's label string. + * + * Set the heap label that will be used in statistic outputs. + * + * @param heap The address of a heap descriptor. + * + * @param label Label string displayed in statistic outputs. This parameter + * can be a format string, in which case succeeding parameters will be used + * to resolve the final label. + * + * Environments: + * + * This service can be called from: + * + * - Kernel module initialization/cleanup code + * - Kernel-based task + * - User-space task + * + * Rescheduling: never. + */ + +void xnheap_set_label(xnheap_t *heap, const char *label, ...) +{ + va_list args; + spl_t s; + + va_start(args, label); + + xnlock_get_irqsave(&nklock, s); + vsnprintf(heap->label, sizeof(heap->label), label, args); + xnlock_put
[Xenomai-git] Jan Kiszka : rtdm: Fix copy&paste mistake in instrumentation
Module: xenomai-head Branch: master Commit: 5e209eeeb854e7bb376f3ed044d5ded14ab85b66 URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=5e209eeeb854e7bb376f3ed044d5ded14ab85b66 Author: Jan Kiszka Date: Sat Nov 14 14:00:14 2009 +0100 rtdm: Fix copy&paste mistake in instrumentation Signed-off-by: Jan Kiszka --- ksrc/skins/rtdm/core.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/ksrc/skins/rtdm/core.c b/ksrc/skins/rtdm/core.c index 5843842..bc3dccc 100644 --- a/ksrc/skins/rtdm/core.c +++ b/ksrc/skins/rtdm/core.c @@ -511,7 +511,7 @@ EXPORT_SYMBOL(__rt_dev_recvmsg); ssize_t __rt_dev_sendmsg(rtdm_user_info_t *user_info, int fd, const struct msghdr *msg, int flags) { - trace_mark(xn_rtdm, recvmsg, "user_info %p fd %d msg_name %p " + trace_mark(xn_rtdm, sendmsg, "user_info %p fd %d msg_name %p " "msg_namelen %u msg_iov %p msg_iovlen %zu " "msg_control %p msg_controllen %zu msg_flags %d", user_info, fd, msg->msg_name, msg->msg_namelen, ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Jan Kiszka : nucleus: Include all heaps in statistics
Module: xenomai-head Branch: master Commit: bdda0013bb4a666a1d2c55ef52c5dd55e5fb6f3b URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=bdda0013bb4a666a1d2c55ef52c5dd55e5fb6f3b Author: Jan Kiszka Date: Mon Nov 16 14:39:42 2009 +0100 nucleus: Include all heaps in statistics This extends /proc/xenomai/heap with statistics about all currently used heaps. The required descriptive label is propagated via a new xnheap API service, xnheap_set_label. Moreover, care is taken to flush nklock while iterating of this potentially long list. Signed-off-by: Jan Kiszka --- include/nucleus/heap.h|6 +++ ksrc/drivers/ipc/iddp.c |1 + ksrc/drivers/ipc/xddp.c |3 + ksrc/nucleus/heap.c | 99 - ksrc/nucleus/module.c |2 + ksrc/nucleus/pod.c|2 + ksrc/nucleus/shadow.c |2 + ksrc/skins/native/heap.c |1 + ksrc/skins/native/pipe.c |2 + ksrc/skins/native/queue.c |1 + ksrc/skins/posix/shm.c|3 + ksrc/skins/psos+/rn.c |2 + ksrc/skins/rtai/shm.c |1 + ksrc/skins/vrtx/heap.c|1 + ksrc/skins/vrtx/syscall.c |2 + 15 files changed, 118 insertions(+), 10 deletions(-) diff --git a/include/nucleus/heap.h b/include/nucleus/heap.h index 44db738..77fefa6 100644 --- a/include/nucleus/heap.h +++ b/include/nucleus/heap.h @@ -115,6 +115,10 @@ typedef struct xnheap { XNARCH_DECL_DISPLAY_CONTEXT(); + xnholder_t stat_link; /* Link in heapq */ + + char label[XNOBJECT_NAME_LEN+16]; + } xnheap_t; extern xnheap_t kheap; @@ -226,6 +230,8 @@ int xnheap_init(xnheap_t *heap, u_long heapsize, u_long pagesize); +void xnheap_set_label(xnheap_t *heap, const char *name, ...); + void xnheap_destroy(xnheap_t *heap, void (*flushfn)(xnheap_t *heap, void *extaddr, diff --git a/ksrc/drivers/ipc/iddp.c b/ksrc/drivers/ipc/iddp.c index a589d34..8a1b079 100644 --- a/ksrc/drivers/ipc/iddp.c +++ b/ksrc/drivers/ipc/iddp.c @@ -564,6 +564,7 @@ static int __iddp_bind_socket(struct rtipc_private *priv, xnarch_free_host_mem(poolmem, poolsz); goto fail; } + xnheap_set_label(&sk->privpool, "ippd: %d", port); sk->poolevt = &sk->privevt; sk->poolwait = &sk->privwait; diff --git a/ksrc/drivers/ipc/xddp.c b/ksrc/drivers/ipc/xddp.c index f62147a..c2a65e9 100644 --- a/ksrc/drivers/ipc/xddp.c +++ b/ksrc/drivers/ipc/xddp.c @@ -750,6 +750,9 @@ static int __xddp_bind_socket(struct rtipc_private *priv, if (sk->peer.sipc_port < 0) sk->peer = *sa; + if (poolsz > 0) + xnheap_set_label(sk->bufpool, "xddp: %d", sa->sipc_port); + if (*sk->label) { ret = xnregistry_enter(sk->label, sk, &sk->handle, &__xddp_pnode); diff --git a/ksrc/nucleus/heap.c b/ksrc/nucleus/heap.c index 27a4ad7..8e82c9a 100644 --- a/ksrc/nucleus/heap.c +++ b/ksrc/nucleus/heap.c @@ -76,6 +76,9 @@ EXPORT_SYMBOL_GPL(kheap); xnheap_t kstacks; /* Private stack pool */ #endif +static DEFINE_XNQUEUE(heapq); /* Heap list for /proc reporting */ +static unsigned long heapq_rev; + static void init_extent(xnheap_t *heap, xnextent_t *extent) { caddr_t freepage; @@ -167,6 +170,7 @@ int xnheap_init(xnheap_t *heap, unsigned cpu, nr_cpus = xnarch_num_online_cpus(); u_long hdrsize, shiftsize, pageshift; xnextent_t *extent; + spl_t s; /* * Perform some parametrical checks first. @@ -232,12 +236,57 @@ int xnheap_init(xnheap_t *heap, appendq(&heap->extents, &extent->link); + snprintf(heap->label, sizeof(heap->label), "unlabeled @0x%p", heap); + + xnlock_get_irqsave(&nklock, s); + appendq(&heapq, &heap->stat_link); + heapq_rev++; + xnlock_put_irqrestore(&nklock, s); + xnarch_init_display_context(heap); return 0; } EXPORT_SYMBOL_GPL(xnheap_init); +/*! + * \fn xnheap_set_label(xnheap_t *heap,const char *label,...) + * \brief Set the heap's label string. + * + * Set the heap label that will be used in statistic outputs. + * + * @param heap The address of a heap descriptor. + * + * @param label Label string displayed in statistic outputs. This parameter + * can be a format string, in which case succeeding parameters will be used + * to resolve the final label. + * + * Environments: + * + * This service can be called from: + * + * - Kernel module initialization/cleanup code + * - Kernel-based task + * - User-space task + * + * Rescheduling: never. + */ + +void xnheap_set_label(xnheap_t *heap, const char *label, ...) +{ + va_list args; + spl_t s; + + va_start(args, label); + + xnlock_get_irqsave(&nklock, s); + vsnprintf(heap->label, sizeof(heap->label), label, args); + xnlock_put_irq
[Xenomai-git] Andreas Glatz : nucleus: do not lose base priority in nested PIP boosts
Module: xenomai-2.4 Branch: master Commit: f4be6cc2af75ba8f878fd3dcaa7017807677cafc URL: http://git.xenomai.org/?p=xenomai-2.4.git;a=commit;h=f4be6cc2af75ba8f878fd3dcaa7017807677cafc Author: Andreas Glatz Date: Thu Nov 19 15:04:11 2009 +0100 nucleus: do not lose base priority in nested PIP boosts --- ksrc/nucleus/synch.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ksrc/nucleus/synch.c b/ksrc/nucleus/synch.c index a2f22ce..f4d65e8 100644 --- a/ksrc/nucleus/synch.c +++ b/ksrc/nucleus/synch.c @@ -326,8 +326,10 @@ void xnsynch_renice_sleeper(xnthread_t *thread) * and boost the owner. */ __setbits(synch->status, XNSYNCH_CLAIMED); insertpqf(&owner->claimq, &synch->link, thread->cprio); - owner->bprio = owner->cprio; - xnthread_set_state(owner, XNBOOST); + if (!xnthread_test_state(owner, XNBOOST)) { + owner->bprio = owner->cprio; + xnthread_set_state(owner, XNBOOST); + } } /* Renice the owner thread, progressing in the PI chain as needed. */ ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Andreas Glatz : nucleus: do not lose base priority in nested PIP boosts
Module: xenomai-head Branch: master Commit: 5e8ebc44dc20764572b707a9b13e4a9e89e3fd1f URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=5e8ebc44dc20764572b707a9b13e4a9e89e3fd1f Author: Andreas Glatz Date: Thu Nov 19 15:04:34 2009 +0100 nucleus: do not lose base priority in nested PIP boosts --- ksrc/nucleus/synch.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ksrc/nucleus/synch.c b/ksrc/nucleus/synch.c index 1a9bbb4..91de768 100644 --- a/ksrc/nucleus/synch.c +++ b/ksrc/nucleus/synch.c @@ -656,8 +656,10 @@ void xnsynch_requeue_sleeper(struct xnthread *thread) __setbits(synch->status, XNSYNCH_CLAIMED); insertpqf(&owner->claimq, &synch->link, w_cprio(thread)); - owner->bprio = owner->cprio; - xnthread_set_state(owner, XNBOOST); + if (!xnthread_test_state(owner, XNBOOST)) { + owner->bprio = owner->cprio; + xnthread_set_state(owner, XNBOOST); + } } /* * Renice the owner thread, progressing in the PI ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: fix functions declarations in the 8255 driver
Module: xenomai-abe Branch: analogy Commit: 8bb9c840abb5dc7afd4bf2113dce0cbb4d676536 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=8bb9c840abb5dc7afd4bf2113dce0cbb4d676536 Author: Alexis Berlemont Date: Sun Nov 8 02:16:53 2009 +0100 analogy: fix functions declarations in the 8255 driver Some "static" keywords were lacking. --- ksrc/drivers/analogy/intel/8255.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ksrc/drivers/analogy/intel/8255.c b/ksrc/drivers/analogy/intel/8255.c index 8f5010e..a5602c1 100644 --- a/ksrc/drivers/analogy/intel/8255.c +++ b/ksrc/drivers/analogy/intel/8255.c @@ -234,7 +234,7 @@ EXPORT_SYMBOL(subdev_8255_init); */ -int dev_8255_attach(a4l_dev_t *dev, a4l_lnkdesc_t *arg) +static int dev_8255_attach(a4l_dev_t *dev, a4l_lnkdesc_t *arg) { unsigned long *addrs; int i, err = 0; @@ -293,7 +293,7 @@ out_attach: return err; } -int dev_8255_detach(a4l_dev_t *dev) +static int dev_8255_detach(a4l_dev_t *dev) { a4l_subd_t *subd; int i = 0; ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: remove EXPERIMENTAL flag from 2.4 Config. in files
Module: xenomai-abe Branch: analogy Commit: a1c1350d5d62ca766d7051a0114a9fae9b2c4721 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=a1c1350d5d62ca766d7051a0114a9fae9b2c4721 Author: Alexis Berlemont Date: Sun Nov 8 02:12:02 2009 +0100 analogy: remove EXPERIMENTAL flag from 2.4 Config.in files --- ksrc/drivers/analogy/intel/Config.in |6 +++--- .../drivers/analogy/national_instruments/Config.in |4 +--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/ksrc/drivers/analogy/intel/Config.in b/ksrc/drivers/analogy/intel/Config.in index 357bb51..515648a 100644 --- a/ksrc/drivers/analogy/intel/Config.in +++ b/ksrc/drivers/analogy/intel/Config.in @@ -3,6 +3,6 @@ # Xenomai configuration for Linux v2.4 # -if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then - dep_tristate '8255 driver' CONFIG_XENO_DRIVERS_ANALOGY_8255 $CONFIG_XENO_DRIVERS_ANALOGY -fi +dep_tristate '8255 driver' CONFIG_XENO_DRIVERS_ANALOGY_8255 $CONFIG_XENO_DRIVERS_ANALOGY + +dep_tristate 'standard parallel port driver' CONFIG_XENO_DRIVERS_ANALOGY_PARPORT $CONFIG_XENO_DRIVERS_ANALOGY \ No newline at end of file diff --git a/ksrc/drivers/analogy/national_instruments/Config.in b/ksrc/drivers/analogy/national_instruments/Config.in index 95e4d99..3dff689 100644 --- a/ksrc/drivers/analogy/national_instruments/Config.in +++ b/ksrc/drivers/analogy/national_instruments/Config.in @@ -3,6 +3,4 @@ # Xenomai configuration for Linux v2.4 # -if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then - dep_tristate 'NI MITE driver' CONFIG_XENO_DRIVERS_ANALOGY_NI_MITE $CONFIG_XENO_DRIVERS_ANALOGY -fi +dep_tristate 'NI MITE driver' CONFIG_XENO_DRIVERS_ANALOGY_NI_MITE $CONFIG_XENO_DRIVERS_ANALOGY ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: fix a bug in the attach procedure
Module: xenomai-abe Branch: analogy Commit: 01bcfd898555425e96350b306155cba429a65539 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=01bcfd898555425e96350b306155cba429a65539 Author: Alexis Berlemont Date: Sun Nov 8 02:10:20 2009 +0100 analogy: fix a bug in the attach procedure The options to be sent to the driver at attach time were badly handled if the values were hexadecimal-based. --- src/utils/analogy/analogy_config.c | 20 ++-- 1 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/utils/analogy/analogy_config.c b/src/utils/analogy/analogy_config.c index 316dcd4..1482322 100644 --- a/src/utils/analogy/analogy_config.c +++ b/src/utils/analogy/analogy_config.c @@ -50,7 +50,7 @@ struct option a4l_conf_opts[] = { {0}, }; -int compute_opts(char *opts, unsigned int *nb, unsigned int *res) +int compute_opts(char *opts, unsigned int *nb, unsigned long *res) { int ret = 0, len, ofs; @@ -60,19 +60,26 @@ int compute_opts(char *opts, unsigned int *nb, unsigned int *res) return -EINVAL; *nb = 0; + /* We set errno to 0 so as to be sure that + strtoul did not fail */ + errno = 0; + do { (*nb)++; len = strlen(opts); ofs = strcspn(opts, __OPTS_DELIMITER); - if (res != NULL && sscanf(opts, "%u", &res[(*nb) - 1]) == 0) { - ret = -EINVAL; - goto out_compute_opts; + if (res != NULL) { + res[(*nb) - 1] = strtoul(opts, NULL, 0); + if (errno != 0) { + ret = -errno; + goto out_compute_opts; + } } opts += ofs + 1; } while (len != ofs); out_compute_opts: - (*nb) *= sizeof(unsigned int); + (*nb) *= sizeof(unsigned long); return ret; } @@ -85,7 +92,8 @@ void do_print_version(void) void do_print_usage(void) { fprintf(stdout, - "usage:\tanalogy_config [OPTS] \n"); + "usage:\tanalogy_config [OPTS] devfile driver " + "\n"); fprintf(stdout, "\tOPTS:\t -v, --verbose: verbose output\n"); fprintf(stdout, "\t\t -q, --quiet: quiet output\n"); fprintf(stdout, "\t\t -V, --version: print program version\n"); ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: fix a mistyping error
Module: xenomai-abe Branch: analogy Commit: 586a315937930d0fc5ddb8286b0216f6fbd29248 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=586a315937930d0fc5ddb8286b0216f6fbd29248 Author: Alexis Berlemont Date: Sun Nov 8 02:13:42 2009 +0100 analogy: fix a mistyping error --- ksrc/drivers/analogy/buffer.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/ksrc/drivers/analogy/buffer.c b/ksrc/drivers/analogy/buffer.c index 2672d7d..16c3c1e 100644 --- a/ksrc/drivers/analogy/buffer.c +++ b/ksrc/drivers/analogy/buffer.c @@ -875,7 +875,7 @@ int a4l_ioctl_poll(a4l_cxt_t * cxt, void *arg) /* Check the subdevice */ if (poll.idx_subd >= dev->transfer.nb_subd) { __a4l_err("a4l_poll: subdevice index out of range (idx=%d)\n", - buf_cfg.idx_subd); + poll.idx_subd); return -EINVAL; } ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: improve ioctl error handling
Module: xenomai-abe Branch: analogy Commit: e6e21a3e183f145dd1c583e60fbecda982e00c70 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=e6e21a3e183f145dd1c583e60fbecda982e00c70 Author: Alexis Berlemont Date: Thu Nov 5 23:54:47 2009 +0100 analogy: improve ioctl error handling --- ksrc/drivers/analogy/buffer.c | 72 --- ksrc/drivers/analogy/command.c |9 ++-- ksrc/drivers/analogy/device.c |2 +- ksrc/drivers/analogy/instruction.c |2 +- ksrc/drivers/analogy/subdevice.c |3 +- ksrc/drivers/analogy/transfer.c| 10 - 6 files changed, 67 insertions(+), 31 deletions(-) diff --git a/ksrc/drivers/analogy/buffer.c b/ksrc/drivers/analogy/buffer.c index cad8a06..2672d7d 100644 --- a/ksrc/drivers/analogy/buffer.c +++ b/ksrc/drivers/analogy/buffer.c @@ -407,13 +407,20 @@ int a4l_ioctl_mmap(a4l_cxt_t *cxt, void *arg) return -EFAULT; /* Check the subdevice */ - if (map_cfg.idx_subd >= dev->transfer.nb_subd || - (dev->transfer.subds[map_cfg.idx_subd]->flags & A4L_SUBD_CMD) == - 0 - || (dev->transfer.subds[map_cfg.idx_subd]-> - flags & A4L_SUBD_MMAP) == 0) { - __a4l_err("a4l_ioctl_mmap: wrong subdevice selected (idx=%d)\n", - map_cfg.idx_subd); + if (map_cfg.idx_subd >= dev->transfer.nb_subd) { + __a4l_err("a4l_ioctl_mmap: subdevice index " + "out of range (idx=%d)\n", map_cfg.idx_subd); + return -EINVAL; + } + + if ((dev->transfer.subds[map_cfg.idx_subd]->flags & A4L_SUBD_CMD) == 0) { + __a4l_err("a4l_ioctl_mmap: operation not supported, " + "synchronous only subdevice\n"); + return -EINVAL; + } + + if ((dev->transfer.subds[map_cfg.idx_subd]->flags & A4L_SUBD_MMAP) == 0) { + __a4l_err("a4l_ioctl_mmap: mmap not allowed on this subdevice\n"); return -EINVAL; } @@ -476,9 +483,16 @@ int a4l_ioctl_bufcfg(a4l_cxt_t * cxt, void *arg) arg, sizeof(a4l_bufcfg_t)) != 0) return -EFAULT; - if (buf_cfg.idx_subd >= dev->transfer.nb_subd || - (dev->transfer.subds[buf_cfg.idx_subd]->flags & A4L_SUBD_CMD) == 0) { - __a4l_err("a4l_ioctl_bufcfg: wrong subdevice selected\n"); + /* Check the subdevice */ + if (buf_cfg.idx_subd >= dev->transfer.nb_subd) { + __a4l_err("a4l_ioctl_bufcfg: subdevice index " + "out of range (idx=%d)\n", buf_cfg.idx_subd); + return -EINVAL; + } + + if ((dev->transfer.subds[buf_cfg.idx_subd]->flags & A4L_SUBD_CMD) == 0) { + __a4l_err("a4l_ioctl_bufcfg: operation not supported, " + "synchronous only subdevice\n"); return -EINVAL; } @@ -491,7 +505,7 @@ int a4l_ioctl_bufcfg(a4l_cxt_t * cxt, void *arg) no buffer size change is allowed */ if (test_bit(A4L_TSF_BUSY, &(dev->transfer.status[buf_cfg.idx_subd]))) { - __a4l_err("a4l_ioctl_bufcfg: buffer size too big (<=16MB)\n"); + __a4l_err("a4l_ioctl_bufcfg: acquisition in progress\n"); return -EBUSY; } @@ -531,9 +545,16 @@ int a4l_ioctl_bufinfo(a4l_cxt_t * cxt, void *arg) &info, arg, sizeof(a4l_bufinfo_t)) != 0) return -EFAULT; - if (info.idx_subd >= dev->transfer.nb_subd || - (dev->transfer.subds[info.idx_subd]->flags & A4L_SUBD_CMD) == 0) { - __a4l_err("a4l_ioctl_bufinfo: wrong subdevice selected\n"); + /* Check the subdevice */ + if (info.idx_subd >= dev->transfer.nb_subd) { + __a4l_err("a4l_ioctl_bufinfo: subdevice index " + "out of range (idx=%d)\n", info.idx_subd); + return -EINVAL; + } + + if ((dev->transfer.subds[info.idx_subd]->flags & A4L_SUBD_CMD) == 0) { + __a4l_err("a4l_ioctl_bufinfo: operation not supported, " + "synchronous only subdevice\n"); return -EINVAL; } @@ -829,11 +850,6 @@ int a4l_select(a4l_cxt_t *cxt, return -ENOENT; } - /* TODO: to be removed - Check the subdevice capabilities */ - if ((dev->transfer.subds[idx_subd]->flags & A4L_SUBD_CMD) == 0) - return -EINVAL; - /* Performs a bind on the Analogy synchronization element */ return a4l_select_sync(&(buf->sync), selector, type, fd_index); } @@ -856,10 +872,20 @@ int a4l_ioctl_poll(a4l_cxt_t * cxt, void *arg) &poll, arg, sizeof(a4l_poll_t)) != 0) return -EFAULT; - /* Checks the subdevice capabilities */ - if ((dev->transfer.subds[poll.idx_subd
[Xenomai-git] Alexis Berlemont : analogy: add default attach options for analogy_parport driver
Module: xenomai-abe Branch: analogy Commit: a5107b1e8f975a7771831aa9a2e5f7a58eefbbc2 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=a5107b1e8f975a7771831aa9a2e5f7a58eefbbc2 Author: Alexis Berlemont Date: Sun Nov 8 16:33:08 2009 +0100 analogy: add default attach options for analogy_parport driver --- ksrc/drivers/analogy/intel/parport.c | 31 +++ 1 files changed, 19 insertions(+), 12 deletions(-) diff --git a/ksrc/drivers/analogy/intel/parport.c b/ksrc/drivers/analogy/intel/parport.c index 6abc5b4..a1a1625 100644 --- a/ksrc/drivers/analogy/intel/parport.c +++ b/ksrc/drivers/analogy/intel/parport.c @@ -56,7 +56,7 @@ subdevice 2 is digital output. Unlike other Analogy devices, subdevice 0 defaults to output. - Pins 13 and 14 are inverted once by Comedi and once by the + Pins 13 and 14 are inverted once by Analogy and once by the hardware, thus cancelling the effect. Pin 1 is a strobe, thus acts like one. There's no way in software @@ -81,6 +81,9 @@ #define PARPORT_B 1 #define PARPORT_C 2 +#define DEFAULT_ADDRESS 0x378 +#define DEFAULT_IRQ 7 + typedef struct parport_subd_priv { unsigned long io_bits; } parport_spriv_t; @@ -325,24 +328,28 @@ static int dev_parport_attach(a4l_dev_t *dev, a4l_lnkdesc_t *arg) unsigned long io_base; if(arg->opts == NULL || arg->opts_size < sizeof(unsigned long)) { - a4l_err(dev, - "dev_parport_attach: " - "unable to detect any parallel port, " - "no addresses / IRQ passed as attach arguments\n"); - return -EINVAL; - } - io_base = ((unsigned long *)arg->opts)[0]; + a4l_warn(dev, +"dev_parport_attach: no attach options specified, " +"taking default options (addr=0x%x, irq=%d)\n", +DEFAULT_ADDRESS, DEFAULT_IRQ); + + io_base = DEFAULT_ADDRESS; + irq = DEFAULT_IRQ; + } else { + io_base = ((unsigned long *)arg->opts)[0]; + + if (arg->opts_size >= 2 * sizeof(unsigned long)) + irq = (int) ((unsigned long *)arg->opts)[1]; + } + if (!request_region(io_base, PARPORT_SIZE, "analogy_parport")) { a4l_err(dev, "dev_parport_attach: I/O port conflict"); return -EIO; } a4l_info(dev, "dev_parport_attach: address = 0x%lx\n", io_base); - - if (arg->opts_size == 2 * sizeof(unsigned long)) - irq = (int) ((unsigned long *)arg->opts)[1]; for (i = 0; i < 3; i++) { @@ -360,7 +367,7 @@ static int dev_parport_attach(a4l_dev_t *dev, a4l_lnkdesc_t *arg) a4l_subd_t *subd; - a4l_info(dev, "dev_parport_attach: irq = 0x%d\n", irq); + a4l_info(dev, "dev_parport_attach: irq = %d\n", irq); err = a4l_request_irq(dev, irq, parport_interrupt, 0, dev); if (err < 0) { ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: make analogy_parport compile only for x86 architectures
Module: xenomai-abe Branch: analogy Commit: 045dbe73e444feeffa1ba81392be7e92d4fd0e1d URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=045dbe73e444feeffa1ba81392be7e92d4fd0e1d Author: Alexis Berlemont Date: Sun Nov 8 16:38:41 2009 +0100 analogy: make analogy_parport compile only for x86 architectures --- ksrc/drivers/analogy/intel/Kconfig |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/ksrc/drivers/analogy/intel/Kconfig b/ksrc/drivers/analogy/intel/Kconfig index 193c9da..6907c83 100644 --- a/ksrc/drivers/analogy/intel/Kconfig +++ b/ksrc/drivers/analogy/intel/Kconfig @@ -5,6 +5,6 @@ config XENO_DRIVERS_ANALOGY_8255 default n config XENO_DRIVERS_ANALOGY_PARPORT - depends on XENO_DRIVERS_ANALOGY + depends on XENO_DRIVERS_ANALOGY && X86 tristate "Standard parallel port driver" default n ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: change prefix for traces (a4l -> Analogy)
Module: xenomai-abe Branch: analogy Commit: 432941665db1f694e1239ca9e144e4a3eba749a2 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=432941665db1f694e1239ca9e144e4a3eba749a2 Author: Alexis Berlemont Date: Fri Nov 13 02:00:36 2009 +0100 analogy: change prefix for traces (a4l -> Analogy) --- include/analogy/os_facilities.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/include/analogy/os_facilities.h b/include/analogy/os_facilities.h index 66a3f2e..2d882e2 100644 --- a/include/analogy/os_facilities.h +++ b/include/analogy/os_facilities.h @@ -44,7 +44,7 @@ /* --- Kernel traces functions --- */ -#define A4L_PROMPT "a4l: " +#define A4L_PROMPT "Analogy: " #define RTDM_SUBCLASS_ANALOGY 0 ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: some coding style corrections
Module: xenomai-abe Branch: analogy Commit: 6f52418ef2208548929c2b6288f3d14161a6bafe URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=6f52418ef2208548929c2b6288f3d14161a6bafe Author: Alexis Berlemont Date: Fri Nov 13 02:01:40 2009 +0100 analogy: some coding style corrections --- ksrc/drivers/analogy/testing/loop.c | 12 ++-- 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ksrc/drivers/analogy/testing/loop.c b/ksrc/drivers/analogy/testing/loop.c index ec6ef76..ad6a229 100644 --- a/ksrc/drivers/analogy/testing/loop.c +++ b/ksrc/drivers/analogy/testing/loop.c @@ -128,11 +128,11 @@ int loop_cmd(a4l_subd_t *subd, a4l_cmd_t *cmd) /* Cancel callback */ int loop_cancel(a4l_subd_t *subd) { - lpprv_t *priv=(lpprv_t *)subd->dev->priv; + lpprv_t *priv = (lpprv_t *)subd->dev->priv; a4l_info(subd->dev, "loop_cancel: (subd=%d)\n", subd->idx); - priv->loop_running=0; + priv->loop_running = 0; return 0; } @@ -143,11 +143,11 @@ int loop_insn_read(a4l_subd_t *subd, a4l_kinsn_t *insn) lpprv_t *priv = (lpprv_t*)subd->dev->priv; /* Checks the buffer size */ - if (insn->data_size!=sizeof(sampl_t)) + if (insn->data_size != sizeof(sampl_t)) return -EINVAL; /* Sets the memorized value */ - insn->data[0]=priv->loop_insn_value; + insn->data[0] = priv->loop_insn_value; return 0; } @@ -158,11 +158,11 @@ int loop_insn_write(a4l_subd_t *subd, a4l_kinsn_t *insn) lpprv_t *priv = (lpprv_t*)subd->dev->priv; /* Checks the buffer size */ - if (insn->data_size!=sizeof(sampl_t)) + if (insn->data_size != sizeof(sampl_t)) return -EINVAL; /* Retrieves the value to memorize */ - priv->loop_insn_value=insn->data[0]; + priv->loop_insn_value = insn->data[0]; return 0; } ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: use the A4L_INSN_* constants to configure the DIO subdevice
Module: xenomai-abe Branch: analogy Commit: 88fd5b0736b65007e65ef37465d2e39b7f68c293 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=88fd5b0736b65007e65ef37465d2e39b7f68c293 Author: Alexis Berlemont Date: Wed Nov 11 17:39:01 2009 +0100 analogy: use the A4L_INSN_* constants to configure the DIO subdevice --- ksrc/drivers/analogy/intel/parport.c | 23 --- 1 files changed, 20 insertions(+), 3 deletions(-) diff --git a/ksrc/drivers/analogy/intel/parport.c b/ksrc/drivers/analogy/intel/parport.c index a1a1625..735656c 100644 --- a/ksrc/drivers/analogy/intel/parport.c +++ b/ksrc/drivers/analogy/intel/parport.c @@ -118,13 +118,30 @@ static int parport_insn_config_a(a4l_subd_t *subd, a4l_kinsn_t *insn) a4l_dev_t *dev = subd->dev; parport_spriv_t *spriv = (parport_spriv_t *)subd->priv; - if (insn->data[0]) { + /* No need to check the channel descriptor; the input / output + setting is global for all channels */ + + switch (insn->data[0]) { + + case A4L_INSN_CONFIG_DIO_OUTPUT: spriv->io_bits = 0xff; - devpriv->c_data &= ~(1 << 5); - } else { + devpriv->c_data &= ~(1 << 5); + break; + + case A4L_INSN_CONFIG_DIO_INPUT: spriv->io_bits = 0; devpriv->c_data |= (1 << 5); + break; + + case A4L_INSN_CONFIG_DIO_QUERY: + insn->data[1] = (spriv->io_bits == 0xff) ? + A4L_OUTPUT: A4L_INPUT; + break; + + default: + return -EINVAL; } + outb(devpriv->c_data, devpriv->io_base + PARPORT_C); return 0; ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: minor cosmetic change in instruction header
Module: xenomai-abe Branch: analogy Commit: 28cf063829dec07d627c11bed45e6dd3cc118256 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=28cf063829dec07d627c11bed45e6dd3cc118256 Author: Alexis Berlemont Date: Fri Nov 13 01:59:29 2009 +0100 analogy: minor cosmetic change in instruction header --- include/analogy/instruction.h | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/analogy/instruction.h b/include/analogy/instruction.h index a3a82cb..1ac7484 100644 --- a/include/analogy/instruction.h +++ b/include/analogy/instruction.h @@ -127,9 +127,9 @@ * @{ */ -#define A4L_COUNTER_ARMED 0x1 +#define A4L_COUNTER_ARMED 0x1 #define A4L_COUNTER_COUNTING 0x2 -#define A4L_COUNTER_TERMINAL_COUNT 0x4 +#define A4L_COUNTER_TERMINAL_COUNT 0x4 /*! @} ANALOGY_COUNTER_xxx */ @@ -139,9 +139,9 @@ * @{ */ -#define A4L_INPUT 0 -#define A4L_OUTPUT 1 -#define A4L_OPENDRAIN 2 +#define A4L_INPUT 0 +#define A4L_OUTPUT 1 +#define A4L_OPENDRAIN 2 /*! @} ANALOGY_IO_DIRECTION */ ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: fix a minor bug (filename management) in insn_read
Module: xenomai-abe Branch: analogy Commit: 8f26347359be0f2ff774a4dab189e626bee11881 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=8f26347359be0f2ff774a4dab189e626bee11881 Author: Alexis Berlemont Date: Fri Nov 13 02:03:14 2009 +0100 analogy: fix a minor bug (filename management) in insn_read --- src/utils/analogy/insn_read.c | 11 ++- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/utils/analogy/insn_read.c b/src/utils/analogy/insn_read.c index ce78dc6..bd203a0 100644 --- a/src/utils/analogy/insn_read.c +++ b/src/utils/analogy/insn_read.c @@ -1,6 +1,6 @@ /** * @file - * Analogy for Linux, instruction test program + * Analogy for Linux, instruction read test program * * @note Copyright (C) 1997-2000 David A. Schleef * @note Copyright (C) 2008 Alexis Berlemont @@ -36,7 +36,7 @@ static unsigned char buf[BUF_SIZE]; static double dbuf[BUF_SIZE]; -static char *filename; +static char *filename = FILENAME; static int verbose; static int real_time; static int idx_subd; @@ -141,10 +141,11 @@ int main(int argc, char *argv[]) } /* Open the device */ - ret = a4l_open(&dsc, FILENAME); + ret = a4l_open(&dsc, filename); if (ret < 0) { - fprintf(stderr, "insn_read: a4l_open %s failed (ret=%d)\n", - FILENAME, ret); + fprintf(stderr, + "insn_read: a4l_open %s failed (ret=%d)\n", + filename, ret); return ret; } ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: add a test program which performs synchronous write
Module: xenomai-abe Branch: analogy Commit: 2dcb363a33702a74e9cee050f7152189fb1b2740 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=2dcb363a33702a74e9cee050f7152189fb1b2740 Author: Alexis Berlemont Date: Fri Nov 13 02:05:31 2009 +0100 analogy: add a test program which performs synchronous write --- src/utils/analogy/Makefile.am |5 +- src/utils/analogy/Makefile.in | 18 +++- src/utils/analogy/insn_write.c | 273 3 files changed, 292 insertions(+), 4 deletions(-) diff --git a/src/utils/analogy/Makefile.am b/src/utils/analogy/Makefile.am index 32d05b5..6a232aa 100644 --- a/src/utils/analogy/Makefile.am +++ b/src/utils/analogy/Makefile.am @@ -1,6 +1,6 @@ sbin_PROGRAMS = analogy_config -bin_PROGRAMS = cmd_read cmd_write insn_read +bin_PROGRAMS = cmd_read cmd_write insn_read insn_write CPPFLAGS = \ @XENO_USER_CFLAGS@ \ @@ -23,3 +23,6 @@ cmd_write_LDADD = -lanalogy -lnative -lrtdm insn_read_SOURCES = insn_read.c insn_read_LDADD = -lanalogy -lnative -lrtdm + +insn_write_SOURCES = insn_write.c +insn_write_LDADD = -lanalogy -lnative -lrtdm diff --git a/src/utils/analogy/Makefile.in b/src/utils/analogy/Makefile.in index 21a34b2..6944a71 100644 --- a/src/utils/analogy/Makefile.in +++ b/src/utils/analogy/Makefile.in @@ -36,7 +36,8 @@ build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ sbin_PROGRAMS = analogy_config$(EXEEXT) -bin_PROGRAMS = cmd_read$(EXEEXT) cmd_write$(EXEEXT) insn_read$(EXEEXT) +bin_PROGRAMS = cmd_read$(EXEEXT) cmd_write$(EXEEXT) insn_read$(EXEEXT) \ + insn_write$(EXEEXT) subdir = src/utils/analogy DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -68,6 +69,9 @@ cmd_write_DEPENDENCIES = am_insn_read_OBJECTS = insn_read.$(OBJEXT) insn_read_OBJECTS = $(am_insn_read_OBJECTS) insn_read_DEPENDENCIES = +am_insn_write_OBJECTS = insn_write.$(OBJEXT) +insn_write_OBJECTS = $(am_insn_write_OBJECTS) +insn_write_DEPENDENCIES = DEFAULT_INCLUDES = -...@am__isrc@ -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles @@ -82,9 +86,11 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(analogy_config_SOURCES) $(cmd_read_SOURCES) \ - $(cmd_write_SOURCES) $(insn_read_SOURCES) + $(cmd_write_SOURCES) $(insn_read_SOURCES) \ + $(insn_write_SOURCES) DIST_SOURCES = $(analogy_config_SOURCES) $(cmd_read_SOURCES) \ - $(cmd_write_SOURCES) $(insn_read_SOURCES) + $(cmd_write_SOURCES) $(insn_read_SOURCES) \ + $(insn_write_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -263,6 +269,8 @@ cmd_write_SOURCES = cmd_write.c cmd_write_LDADD = -lanalogy -lnative -lrtdm insn_read_SOURCES = insn_read.c insn_read_LDADD = -lanalogy -lnative -lrtdm +insn_write_SOURCES = insn_write.c +insn_write_LDADD = -lanalogy -lnative -lrtdm all: all-am .SUFFIXES: @@ -395,6 +403,9 @@ cmd_write$(EXEEXT): $(cmd_write_OBJECTS) $(cmd_write_DEPENDENCIES) insn_read$(EXEEXT): $(insn_read_OBJECTS) $(insn_read_DEPENDENCIES) @rm -f insn_read$(EXEEXT) $(LINK) $(insn_read_OBJECTS) $(insn_read_LDADD) $(LIBS) +insn_write$(EXEEXT): $(insn_write_OBJECTS) $(insn_write_DEPENDENCIES) + @rm -f insn_write$(EXEEXT) + $(LINK) $(insn_write_OBJECTS) $(insn_write_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -406,6 +417,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__qu...@./$(DEPDIR)/cmd_read...@am__quote@ @AMDEP_TRUE@@am__include@ @am__qu...@./$(DEPDIR)/cmd_write...@am__quote@ @AMDEP_TRUE@@am__include@ @am__qu...@./$(DEPDIR)/insn_read...@am__quote@ +...@amdep_true@@am__include@ @am__qu...@./$(DEPDIR)/insn_write...@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< diff --git a/src/utils/analogy/insn_write.c b/src/utils/analogy/insn_write.c new file mode 100644 index 000..007ef4a --- /dev/null +++ b/src/utils/analogy/insn_write.c @@ -0,0 +1,273 @@ +/** + * @file + * Analogy for Linux, instruction write test program + * + * @note Copyright (C) 1997-2000 David A. Schleef + * @note Copyright (C) 2008 Alexis Berlemont + * + * Xenomai is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Xenomai is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Xenomai; if not,
[Xenomai-git] Alexis Berlemont : analogy: fix missing renamings for testing drivers
Module: xenomai-abe Branch: analogy Commit: fcad39b9efb09c668c404f49f1842821b93e5e44 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=fcad39b9efb09c668c404f49f1842821b93e5e44 Author: Alexis Berlemont Date: Fri Nov 13 02:31:13 2009 +0100 analogy: fix missing renamings for testing drivers --- ksrc/drivers/analogy/testing/fake.c |2 +- ksrc/drivers/analogy/testing/loop.c |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ksrc/drivers/analogy/testing/fake.c b/ksrc/drivers/analogy/testing/fake.c index bf3bacf..cf22086 100644 --- a/ksrc/drivers/analogy/testing/fake.c +++ b/ksrc/drivers/analogy/testing/fake.c @@ -295,7 +295,7 @@ int test_detach(a4l_dev_t *dev) static a4l_drv_t test_drv = { .owner = THIS_MODULE, - .board_name = "a4l_fake", + .board_name = "analogy_fake", .attach = test_attach, .detach = test_detach, .privdata_size = sizeof(tstprv_t), diff --git a/ksrc/drivers/analogy/testing/loop.c b/ksrc/drivers/analogy/testing/loop.c index ad6a229..fae90cb 100644 --- a/ksrc/drivers/analogy/testing/loop.c +++ b/ksrc/drivers/analogy/testing/loop.c @@ -249,7 +249,7 @@ int loop_detach(a4l_dev_t *dev) static a4l_drv_t loop_drv = { .owner = THIS_MODULE, - .board_name = "a4l_loop", + .board_name = "analogy_loop", .attach = loop_attach, .detach = loop_detach, .privdata_size = sizeof(lpprv_t), ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: add an analogy driver for standard parallel port
Module: xenomai-abe Branch: analogy Commit: 350062394f8d6d5f851fb6db7e9dc16a6f95b648 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=350062394f8d6d5f851fb6db7e9dc16a6f95b648 Author: Alexis Berlemont Date: Sun Nov 8 02:20:48 2009 +0100 analogy: add an analogy driver for standard parallel port WARNING: the arguments management in some instruction functions is not coherent with the one in the NI PCIMIO driver. This issue has to be fixed shortly. --- ksrc/drivers/analogy/intel/Kconfig |9 +- ksrc/drivers/analogy/intel/Makefile | 15 +- ksrc/drivers/analogy/intel/parport.c | 428 ++ 3 files changed, 447 insertions(+), 5 deletions(-) diff --git a/ksrc/drivers/analogy/intel/Kconfig b/ksrc/drivers/analogy/intel/Kconfig index 6271d19..193c9da 100644 --- a/ksrc/drivers/analogy/intel/Kconfig +++ b/ksrc/drivers/analogy/intel/Kconfig @@ -1,5 +1,10 @@ config XENO_DRIVERS_ANALOGY_8255 - depends on XENO_DRIVERS_ANALOGY && EXPERIMENTAL + depends on XENO_DRIVERS_ANALOGY tristate "8255 driver" - default n \ No newline at end of file + default n + +config XENO_DRIVERS_ANALOGY_PARPORT + depends on XENO_DRIVERS_ANALOGY + tristate "Standard parallel port driver" + default n diff --git a/ksrc/drivers/analogy/intel/Makefile b/ksrc/drivers/analogy/intel/Makefile index 57ea839..e708c39 100644 --- a/ksrc/drivers/analogy/intel/Makefile +++ b/ksrc/drivers/analogy/intel/Makefile @@ -6,8 +6,13 @@ EXTRA_CFLAGS += -D__IN_XENOMAI__ -Iinclude/xenomai obj-$(CONFIG_XENO_DRIVERS_ANALOGY_8255) += analogy_8255.o +obj-$(CONFIG_XENO_DRIVERS_ANALOGY_PARPORT) += analogy_parport.o + analogy_8255-y := 8255.o +analogy_parport-y := parport.o + + else # Makefile frag for Linux v2.4 @@ -16,15 +21,19 @@ O_TARGET := built-in.o obj-$(CONFIG_XENO_DRIVERS_ANALOGY_8255) += analogy_8255.o +obj-$(CONFIG_XENO_DRIVERS_ANALOGY_PARPORT) += analogy_parport.o + analogy_8255-objs := 8255.o -export-objs := $(analgoy_8255-objs) +analogy_parport-objs := parport.o + +export-objs := $(analgoy_8255-objs) $(analgoy_parport-objs) EXTRA_CFLAGS += -D__IN_XENOMAI__ -I$(TOPDIR)/include/xenomai -I$(TOPDIR)/include/xenomai/compat include $(TOPDIR)/Rules.make -analogy_8255.o: $(analogy_8255-objs) - $(LD) -r -o $@ $(analogy_8255-objs) +analogy_8255.o: $(analogy_8255-objs) $(analgoy_parport-objs) + $(LD) -r -o $@ $(analogy_8255-objs) $(analgoy_parport-objs) endif diff --git a/ksrc/drivers/analogy/intel/parport.c b/ksrc/drivers/analogy/intel/parport.c new file mode 100644 index 000..6abc5b4 --- /dev/null +++ b/ksrc/drivers/analogy/intel/parport.c @@ -0,0 +1,428 @@ +/** + * @file + * Analogy driver for standard parallel port + * @note Copyright (C) 1998,2001 David A. Schleef + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +/* + A cheap and easy way to get a few more digital I/O lines. Steal + additional parallel ports from old computers or your neighbors' + computers. + + Option list: + 0: I/O port base for the parallel port. + 1: IRQ + + Parallel Port Lines: + + pin subdev chanaka + --- -- --- + 1 2 0 strobe + 2 0 0 data 0 + 3 0 1 data 1 + 4 0 2 data 2 + 5 0 3 data 3 + 6 0 4 data 4 + 7 0 5 data 5 + 8 0 6 data 6 + 9 0 7 data 7 + 10 1 3 acknowledge + 11 1 4 busy + 12 1 2 output + 13 1 1 printer selected + 14 2 1 auto LF + 15 1 0 error + 16 2 2 init + 17 2 3 select printer + 18-25 ground + + Notes: + + Subdevices 0 is digital I/O, subdevice 1 is digital input, and + subdevice 2 is digital output. Unlike other Analogy devices, + subdevice 0 defaults to output. + + Pins 13 and 14 are inverted once by Comedi and once by the + hardware, thus cancelling the effect. + + Pin 1 is a strobe, thus acts like one. There's no way in software + to change this, at least on a standard parallel port. + + Subdevice 3 pretends to be a digital input sub
[Xenomai-git] Alexis Berlemont : analogy: fix doxygen documentation generation for analogy
Module: xenomai-abe Branch: analogy Commit: b664badf3339700c9443d211a7ecd7144ff1ad6f URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=b664badf3339700c9443d211a7ecd7144ff1ad6f Author: Alexis Berlemont Date: Thu Nov 19 12:42:14 2009 +0100 analogy: fix doxygen documentation generation for analogy --- doc/doxygen/Doxyfile.in | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/doxygen/Doxyfile.in b/doc/doxygen/Doxyfile.in index 0e33b90..bd24734 100644 --- a/doc/doxygen/Doxyfile.in +++ b/doc/doxygen/Doxyfile.in @@ -27,9 +27,9 @@ INPUT = \ @top_srcdir@/include/rtdm \ @top_srcdir@/src/skins/rtdm \ @top_srcdir@/ksrc/skins/rtdm \ -@top_srcdir@/include/comedi \ -@top_srcdir@/src/drvlib/comedi \ -@top_srcdir@/ksrc/drivers/comedi \ +@top_srcdir@/include/analogy \ +@top_srcdir@/src/drvlib/analogy \ +@top_srcdir@/ksrc/drivers/analogy \ @top_srcdir@/ksrc/skins/posix \ @top_srcdir@/doc/doxygen @@ -253,9 +253,9 @@ LATEX_HIDE_INDICES = NO INCLUDE_PATH = \ @top_srcdir@/ksrc/skins/native \ @top_srcdir@/ksrc/skins/rtdm \ -...@top_srcdir@/ksrc/drivers/comedi \ +...@top_srcdir@/ksrc/drivers/analogy \ @top_srcdir@/ksrc/skins \ @top_builddir@/include \ @top_srcdir@/include \ @top_srcdir@/include/posix \ -...@top_srcdir@/include/comedi \ +...@top_srcdir@/include/analogy \ ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: fix positive error code in transfer cleanup
Module: xenomai-abe Branch: analogy Commit: 2fb0fcf170aafb241e4ee5c3e96a667b87038b1e URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=2fb0fcf170aafb241e4ee5c3e96a667b87038b1e Author: Alexis Berlemont Date: Thu Nov 19 13:02:57 2009 +0100 analogy: fix positive error code in transfer cleanup --- ksrc/drivers/analogy/transfer.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/ksrc/drivers/analogy/transfer.c b/ksrc/drivers/analogy/transfer.c index d654329..c6306d9 100644 --- a/ksrc/drivers/analogy/transfer.c +++ b/ksrc/drivers/analogy/transfer.c @@ -56,7 +56,7 @@ int a4l_cleanup_transfer(a4l_cxt_t * cxt) if (test_bit(A4L_TSF_BUSY, &(tsf->status[i]))) { __a4l_err("a4l_cleanup_transfer: " "device busy, acquisition occuring\n"); - return EBUSY; + return -EBUSY; } if (test_bit(A4L_TSF_MMAP, &(tsf->status[i]))) { ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: minor indentation fix
Module: xenomai-abe Branch: analogy Commit: 51e4c3deef732c02614a554d30728b7dd160f2e0 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=51e4c3deef732c02614a554d30728b7dd160f2e0 Author: Alexis Berlemont Date: Thu Nov 19 13:01:51 2009 +0100 analogy: minor indentation fix --- ksrc/drivers/analogy/buffer.c |5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ksrc/drivers/analogy/buffer.c b/ksrc/drivers/analogy/buffer.c index 16c3c1e..dba2e53 100644 --- a/ksrc/drivers/analogy/buffer.c +++ b/ksrc/drivers/analogy/buffer.c @@ -775,9 +775,8 @@ ssize_t a4l_write(a4l_cxt_t *cxt, if (tmp_cnt > 0) { /* Performs the copy */ - ret = - __produce(cxt, buf, (void *)bufdata + count, - tmp_cnt); + ret = __produce(cxt, + buf, (void *)bufdata + count, tmp_cnt); if (ret < 0) { count = ret; goto out_a4l_write; ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: add some details on the error codes for the syscall API
Module: xenomai-abe Branch: analogy Commit: bd1f08d003012b185a55235d4ee9ade5d5beabc7 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=bd1f08d003012b185a55235d4ee9ade5d5beabc7 Author: Alexis Berlemont Date: Thu Nov 19 13:05:21 2009 +0100 analogy: add some details on the error codes for the syscall API --- src/drvlib/analogy/sys.c | 41 + 1 files changed, 37 insertions(+), 4 deletions(-) diff --git a/src/drvlib/analogy/sys.c b/src/drvlib/analogy/sys.c index 4c71039..51edcfe 100644 --- a/src/drvlib/analogy/sys.c +++ b/src/drvlib/analogy/sys.c @@ -85,7 +85,14 @@ int a4l_sys_close(int fd) * @param[out] buf Input buffer * @param[in] nbyte Number of bytes to read * - * @return Number of bytes read, otherwise negative error code. + * @return Number of bytes read. Otherwise: + * + * - -EINVAL is returned if some argument is missing or wrong (Please, + *type "dmesg" for more info) + * - -ENOENT is returned if the device's reading subdevice is idle (no + *command was sent) + * - -EFAULT is returned if a user <-> kernel transfer went wrong + * - -EINTR is returned if calling task has been unblocked by a signal * */ int a4l_sys_read(int fd, void *buf, size_t nbyte) @@ -103,7 +110,14 @@ int a4l_sys_read(int fd, void *buf, size_t nbyte) * @param[in] buf Output buffer * @param[in] nbyte Number of bytes to write * - * @return Number of bytes written, otherwise negative error code. + * @return Number of bytes written. Otherwise: + * + * - -EINVAL is returned if some argument is missing or wrong (Please, + *type "dmesg" for more info) + * - -ENOENT is returned if the device's writing subdevice is idle (no + *command was sent) + * - -EFAULT is returned if a user <-> kernel transfer went wrong + * - -EINTR is returned if calling task has been unblocked by a signal * */ int a4l_sys_write(int fd, void *buf, size_t nbyte) @@ -125,7 +139,16 @@ int a4l_sys_write(int fd, void *buf, size_t nbyte) * @param[in] fd File descriptor as returned by a4l_sys_open() * @param[in] arg Link descriptor argument * - * @return 0 on success, otherwise a negative error code. + * @return 0 on success. Otherwise: + * + * - -ENOMEM is returned if the system is out of memory + * - -EINVAL is returned if some argument is missing or wrong (Please, + *type "dmesg" for more info) + * - -EFAULT is returned if a user <-> kernel transfer went wrong + * - -ENODEV is returned in case of internal error (Please, type + *"dmesg" for more info) + * - -ENXIO is returned in case of internal error (Please, type + *"dmesg" for more info) * */ int a4l_sys_attach(int fd, a4l_lnkdesc_t * arg) @@ -138,7 +161,17 @@ int a4l_sys_attach(int fd, a4l_lnkdesc_t * arg) * * @param[in] fd File descriptor as returned by a4l_sys_open() * - * @return 0 on success, otherwise a negative error code. + * @return 0 on success. Otherwise: + * + * - -EINVAL is returned if some argument is missing or wrong (Please, + *type "dmesg" for more info) + * - -EBUSY is returned if the device to be detached is in use + * - -EPERM is returned if the devive to be detached still has some + *buffer mapped in user-space + * - -ENODEV is returned in case of internal error (Please, type + *"dmesg" for more info) + * - -ENXIO is returned in case of internal error (Please, type + *"dmesg" for more info) * */ int a4l_sys_detach(int fd) ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Jan Kiszka : nucleus: Allow runtime setting of xeno_nucleus. watchdog_timeout
Module: xenomai-jki Branch: for-upstream Commit: 6714717b18c57aa7b0b93ee04ea90be4a96ea34f URL: http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=6714717b18c57aa7b0b93ee04ea90be4a96ea34f Author: Jan Kiszka Date: Fri Nov 20 15:29:59 2009 +0100 nucleus: Allow runtime setting of xeno_nucleus.watchdog_timeout Signed-off-by: Jan Kiszka --- ksrc/nucleus/sched.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/ksrc/nucleus/sched.c b/ksrc/nucleus/sched.c index 33b0713..0a4f7b2 100644 --- a/ksrc/nucleus/sched.c +++ b/ksrc/nucleus/sched.c @@ -63,7 +63,7 @@ void xnsched_register_classes(void) #ifdef CONFIG_XENO_OPT_WATCHDOG static u_long wd_timeout_arg = CONFIG_XENO_OPT_WATCHDOG_TIMEOUT; -module_param_named(watchdog_timeout, wd_timeout_arg, ulong, 0444); +module_param_named(watchdog_timeout, wd_timeout_arg, ulong, 0644); MODULE_PARM_DESC(watchdog_timeout, "Watchdog timeout (s)"); /*! ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: add error codes descriptions for the asynchronous API
Module: xenomai-abe Branch: analogy Commit: 1395fdfc28ad1dbc8d41c529fe823f718e90328e URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=1395fdfc28ad1dbc8d41c529fe823f718e90328e Author: Alexis Berlemont Date: Sat Nov 21 00:52:11 2009 +0100 analogy: add error codes descriptions for the asynchronous API --- src/drvlib/analogy/async.c | 78 ++- 1 files changed, 69 insertions(+), 9 deletions(-) diff --git a/src/drvlib/analogy/async.c b/src/drvlib/analogy/async.c index 9d90e5a..d83b032 100644 --- a/src/drvlib/analogy/async.c +++ b/src/drvlib/analogy/async.c @@ -43,7 +43,15 @@ * optionally a4l_fill_desc()) * @param[in] cmd Command structure * - * @return 0 on success, otherwise a negative error code. + * @return 0 on success. Otherwise: + * + * - -EINVAL is returned if some argument is missing or wrong (Please, + *type "dmesg" for more info) + * - -ENOMEM is returned if the system is out of memory + * - -EFAULT is returned if a user <-> kernel transfer went wrong + * - -EIO is returned if the selected subdevice cannot handle command + * - -EBUSY is returned if the selected subdevice is already + *processing an asynchronous operation * */ int a4l_snd_command(a4l_desc_t * dsc, a4l_cmd_t * cmd) @@ -65,7 +73,12 @@ int a4l_snd_command(a4l_desc_t * dsc, a4l_cmd_t * cmd) * optionally a4l_fill_desc()) * @param[in] idx_subd Subdevice index * - * @return 0 on success, otherwise a negative error code. + * @return 0 on success. Otherwise: + * + * - -EINVAL is returned if some argument is missing or wrong (Please, + *type "dmesg" for more info) + * - -EIO is returned if the selected subdevice does not support + *asynchronous operation * */ int a4l_snd_cancel(a4l_desc_t * dsc, unsigned int idx_subd) @@ -94,7 +107,17 @@ int a4l_snd_cancel(a4l_desc_t * dsc, unsigned int idx_subd) * @param[in] size New buffer size, the maximal tolerated value is * 16MB (A4L_BUF_MAXSIZE) * - * @return 0 on success, otherwise a negative error code. + * @return 0 on success. Otherwise: + * + * - -EINVAL is returned if some argument is missing or wrong (Please, + *type "dmesg" for more info) + * - -EPERM is returned if the function is called in an RT context or + *if the buffer to resize is mapped in user-space (Please, type + *"dmesg" for more info) + * - -EFAULT is returned if a user <-> kernel transfer went wrong + * - -EBUSY is returned if the selected subdevice is already + *processing an asynchronous operation + * - -ENOMEM is returned if the system is out of memory * */ int a4l_set_bufsize(a4l_desc_t * dsc, @@ -124,7 +147,11 @@ int a4l_set_bufsize(a4l_desc_t * dsc, * @param[in] idx_subd Index of the concerned subdevice * @param[out] size Buffer size * - * @return 0 on success, otherwise a negative error code. + * @return 0 on success. Otherwise: + * + * - -EINVAL is returned if some argument is missing or wrong (Please, + *type "dmesg" for more info) + * - -EFAULT is returned if a user <-> kernel transfer went wrong * */ int a4l_get_bufsize(a4l_desc_t * dsc, @@ -179,7 +206,12 @@ int a4l_get_bufsize(a4l_desc_t * dsc, * @param[in] cur Amount of consumed data * @param[out] new Amount of available data * - * @return 0 on success, otherwise a negative error code. + * @return 0 on success. Otherwise: + * + * - -EINVAL is returned if some argument is missing or wrong, the + *descriptor and the new pointer should be checked; check also the + *kernel log + * - -EFAULT is returned if a user <-> kernel transfer went wrong * */ int a4l_mark_bufrw(a4l_desc_t * dsc, @@ -216,7 +248,12 @@ int a4l_mark_bufrw(a4l_desc_t * dsc, * A4L_NONBLOCK causes the function to return immediately without * waiting for any available data * - * @return the available data count. + * @return the available data count. Otherwise: + * + * - -EINVAL is returned if some argument is missing or wrong (Please, + *type "dmesg" for more info) + * - -EFAULT is returned if a user <-> kernel transfer went wrong + * - -EINTR is returned if calling task has been unblocked by a signal * */ int a4l_poll(a4l_desc_t * dsc, @@ -249,7 +286,16 @@ int a4l_poll(a4l_desc_t * dsc, * @param[out] ptr Address of the pointer containing the assigned * address on return * - * @return 0 on success, otherwise a negative error code. + * @return 0 on success. Otherwise: + * + * - -EINVAL is returned if some argument is missing or wrong, the + *descriptor and the pointer should be checked; check also the + *kernel log + * - -EPERM is returned if the function is called in an RT context or + *if the buffer to resize is mapped in user-space (Please, type + *"dmesg" for more info) + * - -EFAULT is returned if a user <-> kernel transfer went wrong + * - -EBUSY is returned if the buffer is already mapped in user-space * */ int a4l_mmap(a4l_desc_t * dsc, @@ -298,7 +344,14 @@ int a4l_mmap(a4l_desc_t * dsc, * A4L_NONBLOCK
[Xenomai-git] Alexis Berlemont : analogy: fix a scan size miscalculation in cmd_read
Module: xenomai-abe Branch: analogy Commit: d78b8c46b79603772e960ecac51ba4c7c93a742f URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=d78b8c46b79603772e960ecac51ba4c7c93a742f Author: Alexis Berlemont Date: Sat Nov 21 01:19:46 2009 +0100 analogy: fix a scan size miscalculation in cmd_read If the acquisition size is not 8 bits round (like 12 bits), the scan size in bytes was not correct (one byte was missing). --- src/utils/analogy/cmd_read.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/src/utils/analogy/cmd_read.c b/src/utils/analogy/cmd_read.c index 90518d9..f665ccd 100644 --- a/src/utils/analogy/cmd_read.c +++ b/src/utils/analogy/cmd_read.c @@ -238,7 +238,8 @@ int main(int argc, char *argv[]) printf("\t range's size = %d (bits)\n", info->nb_bits); } - scan_size += info->nb_bits / 8; + scan_size += (info->nb_bits % 8 == 0) ? + info->nb_bits / 8 : (info->nb_bits / 8) + 1; } if (verbose != 0) { ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: report scan size miscalculation fix in cmd_write and insn_*
Module: xenomai-abe Branch: analogy Commit: e2a377f67fd9acfb65ec72cfae0d4379325e228b URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=e2a377f67fd9acfb65ec72cfae0d4379325e228b Author: Alexis Berlemont Date: Sat Nov 21 01:22:28 2009 +0100 analogy: report scan size miscalculation fix in cmd_write and insn_* --- src/utils/analogy/cmd_write.c |3 ++- src/utils/analogy/insn_read.c |3 ++- src/utils/analogy/insn_write.c |3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/utils/analogy/cmd_write.c b/src/utils/analogy/cmd_write.c index 95b23c8..05b648a 100644 --- a/src/utils/analogy/cmd_write.c +++ b/src/utils/analogy/cmd_write.c @@ -243,7 +243,8 @@ int main(int argc, char *argv[]) printf("\t range's size = %d (bits)\n", info->nb_bits); } - scan_size += info->nb_bits / 8; + scan_size += (info->nb_bits % 8 == 0) ? + info->nb_bits / 8 : (info->nb_bits / 8) + 1; } if (verbose != 0) { diff --git a/src/utils/analogy/insn_read.c b/src/utils/analogy/insn_read.c index bd203a0..f4029be 100644 --- a/src/utils/analogy/insn_read.c +++ b/src/utils/analogy/insn_read.c @@ -212,7 +212,8 @@ int main(int argc, char *argv[]) } /* Set the data size to read */ - scan_size *= chinfo->nb_bits / 8; + scan_size *= (chinfo->nb_bits % 8 == 0) ? + chinfo->nb_bits / 8 : (chinfo->nb_bits / 8) + 1; if (verbose != 0) { printf("insn_read: channel width is %u bits\n", diff --git a/src/utils/analogy/insn_write.c b/src/utils/analogy/insn_write.c index 007ef4a..f5bda70 100644 --- a/src/utils/analogy/insn_write.c +++ b/src/utils/analogy/insn_write.c @@ -212,7 +212,8 @@ int main(int argc, char *argv[]) } /* Set the data size to write */ - scan_size *= chinfo->nb_bits / 8; + scan_size *= (chinfo->nb_bits % 8 == 0) ? + chinfo->nb_bits / 8 : (chinfo->nb_bits / 8) + 1; if (verbose != 0) { printf("insn_write: channel width is %u bits\n", ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: add error codes descriptions for the asynchronous API
Module: xenomai-head Branch: master Commit: 1395fdfc28ad1dbc8d41c529fe823f718e90328e URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=1395fdfc28ad1dbc8d41c529fe823f718e90328e Author: Alexis Berlemont Date: Sat Nov 21 00:52:11 2009 +0100 analogy: add error codes descriptions for the asynchronous API --- src/drvlib/analogy/async.c | 78 ++- 1 files changed, 69 insertions(+), 9 deletions(-) diff --git a/src/drvlib/analogy/async.c b/src/drvlib/analogy/async.c index 9d90e5a..d83b032 100644 --- a/src/drvlib/analogy/async.c +++ b/src/drvlib/analogy/async.c @@ -43,7 +43,15 @@ * optionally a4l_fill_desc()) * @param[in] cmd Command structure * - * @return 0 on success, otherwise a negative error code. + * @return 0 on success. Otherwise: + * + * - -EINVAL is returned if some argument is missing or wrong (Please, + *type "dmesg" for more info) + * - -ENOMEM is returned if the system is out of memory + * - -EFAULT is returned if a user <-> kernel transfer went wrong + * - -EIO is returned if the selected subdevice cannot handle command + * - -EBUSY is returned if the selected subdevice is already + *processing an asynchronous operation * */ int a4l_snd_command(a4l_desc_t * dsc, a4l_cmd_t * cmd) @@ -65,7 +73,12 @@ int a4l_snd_command(a4l_desc_t * dsc, a4l_cmd_t * cmd) * optionally a4l_fill_desc()) * @param[in] idx_subd Subdevice index * - * @return 0 on success, otherwise a negative error code. + * @return 0 on success. Otherwise: + * + * - -EINVAL is returned if some argument is missing or wrong (Please, + *type "dmesg" for more info) + * - -EIO is returned if the selected subdevice does not support + *asynchronous operation * */ int a4l_snd_cancel(a4l_desc_t * dsc, unsigned int idx_subd) @@ -94,7 +107,17 @@ int a4l_snd_cancel(a4l_desc_t * dsc, unsigned int idx_subd) * @param[in] size New buffer size, the maximal tolerated value is * 16MB (A4L_BUF_MAXSIZE) * - * @return 0 on success, otherwise a negative error code. + * @return 0 on success. Otherwise: + * + * - -EINVAL is returned if some argument is missing or wrong (Please, + *type "dmesg" for more info) + * - -EPERM is returned if the function is called in an RT context or + *if the buffer to resize is mapped in user-space (Please, type + *"dmesg" for more info) + * - -EFAULT is returned if a user <-> kernel transfer went wrong + * - -EBUSY is returned if the selected subdevice is already + *processing an asynchronous operation + * - -ENOMEM is returned if the system is out of memory * */ int a4l_set_bufsize(a4l_desc_t * dsc, @@ -124,7 +147,11 @@ int a4l_set_bufsize(a4l_desc_t * dsc, * @param[in] idx_subd Index of the concerned subdevice * @param[out] size Buffer size * - * @return 0 on success, otherwise a negative error code. + * @return 0 on success. Otherwise: + * + * - -EINVAL is returned if some argument is missing or wrong (Please, + *type "dmesg" for more info) + * - -EFAULT is returned if a user <-> kernel transfer went wrong * */ int a4l_get_bufsize(a4l_desc_t * dsc, @@ -179,7 +206,12 @@ int a4l_get_bufsize(a4l_desc_t * dsc, * @param[in] cur Amount of consumed data * @param[out] new Amount of available data * - * @return 0 on success, otherwise a negative error code. + * @return 0 on success. Otherwise: + * + * - -EINVAL is returned if some argument is missing or wrong, the + *descriptor and the new pointer should be checked; check also the + *kernel log + * - -EFAULT is returned if a user <-> kernel transfer went wrong * */ int a4l_mark_bufrw(a4l_desc_t * dsc, @@ -216,7 +248,12 @@ int a4l_mark_bufrw(a4l_desc_t * dsc, * A4L_NONBLOCK causes the function to return immediately without * waiting for any available data * - * @return the available data count. + * @return the available data count. Otherwise: + * + * - -EINVAL is returned if some argument is missing or wrong (Please, + *type "dmesg" for more info) + * - -EFAULT is returned if a user <-> kernel transfer went wrong + * - -EINTR is returned if calling task has been unblocked by a signal * */ int a4l_poll(a4l_desc_t * dsc, @@ -249,7 +286,16 @@ int a4l_poll(a4l_desc_t * dsc, * @param[out] ptr Address of the pointer containing the assigned * address on return * - * @return 0 on success, otherwise a negative error code. + * @return 0 on success. Otherwise: + * + * - -EINVAL is returned if some argument is missing or wrong, the + *descriptor and the pointer should be checked; check also the + *kernel log + * - -EPERM is returned if the function is called in an RT context or + *if the buffer to resize is mapped in user-space (Please, type + *"dmesg" for more info) + * - -EFAULT is returned if a user <-> kernel transfer went wrong + * - -EBUSY is returned if the buffer is already mapped in user-space * */ int a4l_mmap(a4l_desc_t * dsc, @@ -298,7 +344,14 @@ int a4l_mmap(a4l_desc_t * dsc, * A4L_NONBLOCK
[Xenomai-git] Philippe Gerum : Merge commit 'jan'
Module: xenomai-head Branch: master Commit: 3fded6232aad90e2c6799857a21aa492a0fa8e22 URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=3fded6232aad90e2c6799857a21aa492a0fa8e22 Author: Philippe Gerum Date: Sat Nov 21 10:55:27 2009 +0100 Merge commit 'jan' --- ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Jan Kiszka : nucleus: Allow runtime setting of xeno_nucleus. watchdog_timeout
Module: xenomai-head Branch: master Commit: 6714717b18c57aa7b0b93ee04ea90be4a96ea34f URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=6714717b18c57aa7b0b93ee04ea90be4a96ea34f Author: Jan Kiszka Date: Fri Nov 20 15:29:59 2009 +0100 nucleus: Allow runtime setting of xeno_nucleus.watchdog_timeout Signed-off-by: Jan Kiszka --- ksrc/nucleus/sched.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/ksrc/nucleus/sched.c b/ksrc/nucleus/sched.c index 33b0713..0a4f7b2 100644 --- a/ksrc/nucleus/sched.c +++ b/ksrc/nucleus/sched.c @@ -63,7 +63,7 @@ void xnsched_register_classes(void) #ifdef CONFIG_XENO_OPT_WATCHDOG static u_long wd_timeout_arg = CONFIG_XENO_OPT_WATCHDOG_TIMEOUT; -module_param_named(watchdog_timeout, wd_timeout_arg, ulong, 0444); +module_param_named(watchdog_timeout, wd_timeout_arg, ulong, 0644); MODULE_PARM_DESC(watchdog_timeout, "Watchdog timeout (s)"); /*! ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: add some details on the error codes for the syscall API
Module: xenomai-head Branch: master Commit: bd1f08d003012b185a55235d4ee9ade5d5beabc7 URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=bd1f08d003012b185a55235d4ee9ade5d5beabc7 Author: Alexis Berlemont Date: Thu Nov 19 13:05:21 2009 +0100 analogy: add some details on the error codes for the syscall API --- src/drvlib/analogy/sys.c | 41 + 1 files changed, 37 insertions(+), 4 deletions(-) diff --git a/src/drvlib/analogy/sys.c b/src/drvlib/analogy/sys.c index 4c71039..51edcfe 100644 --- a/src/drvlib/analogy/sys.c +++ b/src/drvlib/analogy/sys.c @@ -85,7 +85,14 @@ int a4l_sys_close(int fd) * @param[out] buf Input buffer * @param[in] nbyte Number of bytes to read * - * @return Number of bytes read, otherwise negative error code. + * @return Number of bytes read. Otherwise: + * + * - -EINVAL is returned if some argument is missing or wrong (Please, + *type "dmesg" for more info) + * - -ENOENT is returned if the device's reading subdevice is idle (no + *command was sent) + * - -EFAULT is returned if a user <-> kernel transfer went wrong + * - -EINTR is returned if calling task has been unblocked by a signal * */ int a4l_sys_read(int fd, void *buf, size_t nbyte) @@ -103,7 +110,14 @@ int a4l_sys_read(int fd, void *buf, size_t nbyte) * @param[in] buf Output buffer * @param[in] nbyte Number of bytes to write * - * @return Number of bytes written, otherwise negative error code. + * @return Number of bytes written. Otherwise: + * + * - -EINVAL is returned if some argument is missing or wrong (Please, + *type "dmesg" for more info) + * - -ENOENT is returned if the device's writing subdevice is idle (no + *command was sent) + * - -EFAULT is returned if a user <-> kernel transfer went wrong + * - -EINTR is returned if calling task has been unblocked by a signal * */ int a4l_sys_write(int fd, void *buf, size_t nbyte) @@ -125,7 +139,16 @@ int a4l_sys_write(int fd, void *buf, size_t nbyte) * @param[in] fd File descriptor as returned by a4l_sys_open() * @param[in] arg Link descriptor argument * - * @return 0 on success, otherwise a negative error code. + * @return 0 on success. Otherwise: + * + * - -ENOMEM is returned if the system is out of memory + * - -EINVAL is returned if some argument is missing or wrong (Please, + *type "dmesg" for more info) + * - -EFAULT is returned if a user <-> kernel transfer went wrong + * - -ENODEV is returned in case of internal error (Please, type + *"dmesg" for more info) + * - -ENXIO is returned in case of internal error (Please, type + *"dmesg" for more info) * */ int a4l_sys_attach(int fd, a4l_lnkdesc_t * arg) @@ -138,7 +161,17 @@ int a4l_sys_attach(int fd, a4l_lnkdesc_t * arg) * * @param[in] fd File descriptor as returned by a4l_sys_open() * - * @return 0 on success, otherwise a negative error code. + * @return 0 on success. Otherwise: + * + * - -EINVAL is returned if some argument is missing or wrong (Please, + *type "dmesg" for more info) + * - -EBUSY is returned if the device to be detached is in use + * - -EPERM is returned if the devive to be detached still has some + *buffer mapped in user-space + * - -ENODEV is returned in case of internal error (Please, type + *"dmesg" for more info) + * - -ENXIO is returned in case of internal error (Please, type + *"dmesg" for more info) * */ int a4l_sys_detach(int fd) ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: fix a scan size miscalculation in cmd_read
Module: xenomai-head Branch: master Commit: d78b8c46b79603772e960ecac51ba4c7c93a742f URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=d78b8c46b79603772e960ecac51ba4c7c93a742f Author: Alexis Berlemont Date: Sat Nov 21 01:19:46 2009 +0100 analogy: fix a scan size miscalculation in cmd_read If the acquisition size is not 8 bits round (like 12 bits), the scan size in bytes was not correct (one byte was missing). --- src/utils/analogy/cmd_read.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/src/utils/analogy/cmd_read.c b/src/utils/analogy/cmd_read.c index 90518d9..f665ccd 100644 --- a/src/utils/analogy/cmd_read.c +++ b/src/utils/analogy/cmd_read.c @@ -238,7 +238,8 @@ int main(int argc, char *argv[]) printf("\t range's size = %d (bits)\n", info->nb_bits); } - scan_size += info->nb_bits / 8; + scan_size += (info->nb_bits % 8 == 0) ? + info->nb_bits / 8 : (info->nb_bits / 8) + 1; } if (verbose != 0) { ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: report scan size miscalculation fix in cmd_write and insn_*
Module: xenomai-head Branch: master Commit: e2a377f67fd9acfb65ec72cfae0d4379325e228b URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=e2a377f67fd9acfb65ec72cfae0d4379325e228b Author: Alexis Berlemont Date: Sat Nov 21 01:22:28 2009 +0100 analogy: report scan size miscalculation fix in cmd_write and insn_* --- src/utils/analogy/cmd_write.c |3 ++- src/utils/analogy/insn_read.c |3 ++- src/utils/analogy/insn_write.c |3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/utils/analogy/cmd_write.c b/src/utils/analogy/cmd_write.c index 95b23c8..05b648a 100644 --- a/src/utils/analogy/cmd_write.c +++ b/src/utils/analogy/cmd_write.c @@ -243,7 +243,8 @@ int main(int argc, char *argv[]) printf("\t range's size = %d (bits)\n", info->nb_bits); } - scan_size += info->nb_bits / 8; + scan_size += (info->nb_bits % 8 == 0) ? + info->nb_bits / 8 : (info->nb_bits / 8) + 1; } if (verbose != 0) { diff --git a/src/utils/analogy/insn_read.c b/src/utils/analogy/insn_read.c index bd203a0..f4029be 100644 --- a/src/utils/analogy/insn_read.c +++ b/src/utils/analogy/insn_read.c @@ -212,7 +212,8 @@ int main(int argc, char *argv[]) } /* Set the data size to read */ - scan_size *= chinfo->nb_bits / 8; + scan_size *= (chinfo->nb_bits % 8 == 0) ? + chinfo->nb_bits / 8 : (chinfo->nb_bits / 8) + 1; if (verbose != 0) { printf("insn_read: channel width is %u bits\n", diff --git a/src/utils/analogy/insn_write.c b/src/utils/analogy/insn_write.c index 007ef4a..f5bda70 100644 --- a/src/utils/analogy/insn_write.c +++ b/src/utils/analogy/insn_write.c @@ -212,7 +212,8 @@ int main(int argc, char *argv[]) } /* Set the data size to write */ - scan_size *= chinfo->nb_bits / 8; + scan_size *= (chinfo->nb_bits % 8 == 0) ? + chinfo->nb_bits / 8 : (chinfo->nb_bits / 8) + 1; if (verbose != 0) { printf("insn_write: channel width is %u bits\n", ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: fix positive error code in transfer cleanup
Module: xenomai-head Branch: master Commit: 2fb0fcf170aafb241e4ee5c3e96a667b87038b1e URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=2fb0fcf170aafb241e4ee5c3e96a667b87038b1e Author: Alexis Berlemont Date: Thu Nov 19 13:02:57 2009 +0100 analogy: fix positive error code in transfer cleanup --- ksrc/drivers/analogy/transfer.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/ksrc/drivers/analogy/transfer.c b/ksrc/drivers/analogy/transfer.c index d654329..c6306d9 100644 --- a/ksrc/drivers/analogy/transfer.c +++ b/ksrc/drivers/analogy/transfer.c @@ -56,7 +56,7 @@ int a4l_cleanup_transfer(a4l_cxt_t * cxt) if (test_bit(A4L_TSF_BUSY, &(tsf->status[i]))) { __a4l_err("a4l_cleanup_transfer: " "device busy, acquisition occuring\n"); - return EBUSY; + return -EBUSY; } if (test_bit(A4L_TSF_MMAP, &(tsf->status[i]))) { ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: fix doxygen documentation generation for analogy
Module: xenomai-head Branch: master Commit: b664badf3339700c9443d211a7ecd7144ff1ad6f URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=b664badf3339700c9443d211a7ecd7144ff1ad6f Author: Alexis Berlemont Date: Thu Nov 19 12:42:14 2009 +0100 analogy: fix doxygen documentation generation for analogy --- doc/doxygen/Doxyfile.in | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/doxygen/Doxyfile.in b/doc/doxygen/Doxyfile.in index 0e33b90..bd24734 100644 --- a/doc/doxygen/Doxyfile.in +++ b/doc/doxygen/Doxyfile.in @@ -27,9 +27,9 @@ INPUT = \ @top_srcdir@/include/rtdm \ @top_srcdir@/src/skins/rtdm \ @top_srcdir@/ksrc/skins/rtdm \ -@top_srcdir@/include/comedi \ -@top_srcdir@/src/drvlib/comedi \ -@top_srcdir@/ksrc/drivers/comedi \ +@top_srcdir@/include/analogy \ +@top_srcdir@/src/drvlib/analogy \ +@top_srcdir@/ksrc/drivers/analogy \ @top_srcdir@/ksrc/skins/posix \ @top_srcdir@/doc/doxygen @@ -253,9 +253,9 @@ LATEX_HIDE_INDICES = NO INCLUDE_PATH = \ @top_srcdir@/ksrc/skins/native \ @top_srcdir@/ksrc/skins/rtdm \ -...@top_srcdir@/ksrc/drivers/comedi \ +...@top_srcdir@/ksrc/drivers/analogy \ @top_srcdir@/ksrc/skins \ @top_builddir@/include \ @top_srcdir@/include \ @top_srcdir@/include/posix \ -...@top_srcdir@/include/comedi \ +...@top_srcdir@/include/analogy \ ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: fix missing renamings for testing drivers
Module: xenomai-head Branch: master Commit: fcad39b9efb09c668c404f49f1842821b93e5e44 URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=fcad39b9efb09c668c404f49f1842821b93e5e44 Author: Alexis Berlemont Date: Fri Nov 13 02:31:13 2009 +0100 analogy: fix missing renamings for testing drivers --- ksrc/drivers/analogy/testing/fake.c |2 +- ksrc/drivers/analogy/testing/loop.c |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ksrc/drivers/analogy/testing/fake.c b/ksrc/drivers/analogy/testing/fake.c index bf3bacf..cf22086 100644 --- a/ksrc/drivers/analogy/testing/fake.c +++ b/ksrc/drivers/analogy/testing/fake.c @@ -295,7 +295,7 @@ int test_detach(a4l_dev_t *dev) static a4l_drv_t test_drv = { .owner = THIS_MODULE, - .board_name = "a4l_fake", + .board_name = "analogy_fake", .attach = test_attach, .detach = test_detach, .privdata_size = sizeof(tstprv_t), diff --git a/ksrc/drivers/analogy/testing/loop.c b/ksrc/drivers/analogy/testing/loop.c index ad6a229..fae90cb 100644 --- a/ksrc/drivers/analogy/testing/loop.c +++ b/ksrc/drivers/analogy/testing/loop.c @@ -249,7 +249,7 @@ int loop_detach(a4l_dev_t *dev) static a4l_drv_t loop_drv = { .owner = THIS_MODULE, - .board_name = "a4l_loop", + .board_name = "analogy_loop", .attach = loop_attach, .detach = loop_detach, .privdata_size = sizeof(lpprv_t), ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: minor indentation fix
Module: xenomai-head Branch: master Commit: 51e4c3deef732c02614a554d30728b7dd160f2e0 URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=51e4c3deef732c02614a554d30728b7dd160f2e0 Author: Alexis Berlemont Date: Thu Nov 19 13:01:51 2009 +0100 analogy: minor indentation fix --- ksrc/drivers/analogy/buffer.c |5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ksrc/drivers/analogy/buffer.c b/ksrc/drivers/analogy/buffer.c index 16c3c1e..dba2e53 100644 --- a/ksrc/drivers/analogy/buffer.c +++ b/ksrc/drivers/analogy/buffer.c @@ -775,9 +775,8 @@ ssize_t a4l_write(a4l_cxt_t *cxt, if (tmp_cnt > 0) { /* Performs the copy */ - ret = - __produce(cxt, buf, (void *)bufdata + count, - tmp_cnt); + ret = __produce(cxt, + buf, (void *)bufdata + count, tmp_cnt); if (ret < 0) { count = ret; goto out_a4l_write; ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: some coding style corrections
Module: xenomai-head Branch: master Commit: 6f52418ef2208548929c2b6288f3d14161a6bafe URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=6f52418ef2208548929c2b6288f3d14161a6bafe Author: Alexis Berlemont Date: Fri Nov 13 02:01:40 2009 +0100 analogy: some coding style corrections --- ksrc/drivers/analogy/testing/loop.c | 12 ++-- 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ksrc/drivers/analogy/testing/loop.c b/ksrc/drivers/analogy/testing/loop.c index ec6ef76..ad6a229 100644 --- a/ksrc/drivers/analogy/testing/loop.c +++ b/ksrc/drivers/analogy/testing/loop.c @@ -128,11 +128,11 @@ int loop_cmd(a4l_subd_t *subd, a4l_cmd_t *cmd) /* Cancel callback */ int loop_cancel(a4l_subd_t *subd) { - lpprv_t *priv=(lpprv_t *)subd->dev->priv; + lpprv_t *priv = (lpprv_t *)subd->dev->priv; a4l_info(subd->dev, "loop_cancel: (subd=%d)\n", subd->idx); - priv->loop_running=0; + priv->loop_running = 0; return 0; } @@ -143,11 +143,11 @@ int loop_insn_read(a4l_subd_t *subd, a4l_kinsn_t *insn) lpprv_t *priv = (lpprv_t*)subd->dev->priv; /* Checks the buffer size */ - if (insn->data_size!=sizeof(sampl_t)) + if (insn->data_size != sizeof(sampl_t)) return -EINVAL; /* Sets the memorized value */ - insn->data[0]=priv->loop_insn_value; + insn->data[0] = priv->loop_insn_value; return 0; } @@ -158,11 +158,11 @@ int loop_insn_write(a4l_subd_t *subd, a4l_kinsn_t *insn) lpprv_t *priv = (lpprv_t*)subd->dev->priv; /* Checks the buffer size */ - if (insn->data_size!=sizeof(sampl_t)) + if (insn->data_size != sizeof(sampl_t)) return -EINVAL; /* Retrieves the value to memorize */ - priv->loop_insn_value=insn->data[0]; + priv->loop_insn_value = insn->data[0]; return 0; } ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: add an analogy driver for standard parallel port
Module: xenomai-head Branch: master Commit: 350062394f8d6d5f851fb6db7e9dc16a6f95b648 URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=350062394f8d6d5f851fb6db7e9dc16a6f95b648 Author: Alexis Berlemont Date: Sun Nov 8 02:20:48 2009 +0100 analogy: add an analogy driver for standard parallel port WARNING: the arguments management in some instruction functions is not coherent with the one in the NI PCIMIO driver. This issue has to be fixed shortly. --- ksrc/drivers/analogy/intel/Kconfig |9 +- ksrc/drivers/analogy/intel/Makefile | 15 +- ksrc/drivers/analogy/intel/parport.c | 428 ++ 3 files changed, 447 insertions(+), 5 deletions(-) diff --git a/ksrc/drivers/analogy/intel/Kconfig b/ksrc/drivers/analogy/intel/Kconfig index 6271d19..193c9da 100644 --- a/ksrc/drivers/analogy/intel/Kconfig +++ b/ksrc/drivers/analogy/intel/Kconfig @@ -1,5 +1,10 @@ config XENO_DRIVERS_ANALOGY_8255 - depends on XENO_DRIVERS_ANALOGY && EXPERIMENTAL + depends on XENO_DRIVERS_ANALOGY tristate "8255 driver" - default n \ No newline at end of file + default n + +config XENO_DRIVERS_ANALOGY_PARPORT + depends on XENO_DRIVERS_ANALOGY + tristate "Standard parallel port driver" + default n diff --git a/ksrc/drivers/analogy/intel/Makefile b/ksrc/drivers/analogy/intel/Makefile index 57ea839..e708c39 100644 --- a/ksrc/drivers/analogy/intel/Makefile +++ b/ksrc/drivers/analogy/intel/Makefile @@ -6,8 +6,13 @@ EXTRA_CFLAGS += -D__IN_XENOMAI__ -Iinclude/xenomai obj-$(CONFIG_XENO_DRIVERS_ANALOGY_8255) += analogy_8255.o +obj-$(CONFIG_XENO_DRIVERS_ANALOGY_PARPORT) += analogy_parport.o + analogy_8255-y := 8255.o +analogy_parport-y := parport.o + + else # Makefile frag for Linux v2.4 @@ -16,15 +21,19 @@ O_TARGET := built-in.o obj-$(CONFIG_XENO_DRIVERS_ANALOGY_8255) += analogy_8255.o +obj-$(CONFIG_XENO_DRIVERS_ANALOGY_PARPORT) += analogy_parport.o + analogy_8255-objs := 8255.o -export-objs := $(analgoy_8255-objs) +analogy_parport-objs := parport.o + +export-objs := $(analgoy_8255-objs) $(analgoy_parport-objs) EXTRA_CFLAGS += -D__IN_XENOMAI__ -I$(TOPDIR)/include/xenomai -I$(TOPDIR)/include/xenomai/compat include $(TOPDIR)/Rules.make -analogy_8255.o: $(analogy_8255-objs) - $(LD) -r -o $@ $(analogy_8255-objs) +analogy_8255.o: $(analogy_8255-objs) $(analgoy_parport-objs) + $(LD) -r -o $@ $(analogy_8255-objs) $(analgoy_parport-objs) endif diff --git a/ksrc/drivers/analogy/intel/parport.c b/ksrc/drivers/analogy/intel/parport.c new file mode 100644 index 000..6abc5b4 --- /dev/null +++ b/ksrc/drivers/analogy/intel/parport.c @@ -0,0 +1,428 @@ +/** + * @file + * Analogy driver for standard parallel port + * @note Copyright (C) 1998,2001 David A. Schleef + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +/* + A cheap and easy way to get a few more digital I/O lines. Steal + additional parallel ports from old computers or your neighbors' + computers. + + Option list: + 0: I/O port base for the parallel port. + 1: IRQ + + Parallel Port Lines: + + pin subdev chanaka + --- -- --- + 1 2 0 strobe + 2 0 0 data 0 + 3 0 1 data 1 + 4 0 2 data 2 + 5 0 3 data 3 + 6 0 4 data 4 + 7 0 5 data 5 + 8 0 6 data 6 + 9 0 7 data 7 + 10 1 3 acknowledge + 11 1 4 busy + 12 1 2 output + 13 1 1 printer selected + 14 2 1 auto LF + 15 1 0 error + 16 2 2 init + 17 2 3 select printer + 18-25 ground + + Notes: + + Subdevices 0 is digital I/O, subdevice 1 is digital input, and + subdevice 2 is digital output. Unlike other Analogy devices, + subdevice 0 defaults to output. + + Pins 13 and 14 are inverted once by Comedi and once by the + hardware, thus cancelling the effect. + + Pin 1 is a strobe, thus acts like one. There's no way in software + to change this, at least on a standard parallel port. + + Subdevice 3 pretends to be a digital input su
[Xenomai-git] Alexis Berlemont : analogy: make analogy_parport compile only for x86 architectures
Module: xenomai-head Branch: master Commit: 045dbe73e444feeffa1ba81392be7e92d4fd0e1d URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=045dbe73e444feeffa1ba81392be7e92d4fd0e1d Author: Alexis Berlemont Date: Sun Nov 8 16:38:41 2009 +0100 analogy: make analogy_parport compile only for x86 architectures --- ksrc/drivers/analogy/intel/Kconfig |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/ksrc/drivers/analogy/intel/Kconfig b/ksrc/drivers/analogy/intel/Kconfig index 193c9da..6907c83 100644 --- a/ksrc/drivers/analogy/intel/Kconfig +++ b/ksrc/drivers/analogy/intel/Kconfig @@ -5,6 +5,6 @@ config XENO_DRIVERS_ANALOGY_8255 default n config XENO_DRIVERS_ANALOGY_PARPORT - depends on XENO_DRIVERS_ANALOGY + depends on XENO_DRIVERS_ANALOGY && X86 tristate "Standard parallel port driver" default n ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: fix a minor bug (filename management) in insn_read
Module: xenomai-head Branch: master Commit: 8f26347359be0f2ff774a4dab189e626bee11881 URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=8f26347359be0f2ff774a4dab189e626bee11881 Author: Alexis Berlemont Date: Fri Nov 13 02:03:14 2009 +0100 analogy: fix a minor bug (filename management) in insn_read --- src/utils/analogy/insn_read.c | 11 ++- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/utils/analogy/insn_read.c b/src/utils/analogy/insn_read.c index ce78dc6..bd203a0 100644 --- a/src/utils/analogy/insn_read.c +++ b/src/utils/analogy/insn_read.c @@ -1,6 +1,6 @@ /** * @file - * Analogy for Linux, instruction test program + * Analogy for Linux, instruction read test program * * @note Copyright (C) 1997-2000 David A. Schleef * @note Copyright (C) 2008 Alexis Berlemont @@ -36,7 +36,7 @@ static unsigned char buf[BUF_SIZE]; static double dbuf[BUF_SIZE]; -static char *filename; +static char *filename = FILENAME; static int verbose; static int real_time; static int idx_subd; @@ -141,10 +141,11 @@ int main(int argc, char *argv[]) } /* Open the device */ - ret = a4l_open(&dsc, FILENAME); + ret = a4l_open(&dsc, filename); if (ret < 0) { - fprintf(stderr, "insn_read: a4l_open %s failed (ret=%d)\n", - FILENAME, ret); + fprintf(stderr, + "insn_read: a4l_open %s failed (ret=%d)\n", + filename, ret); return ret; } ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: minor cosmetic change in instruction header
Module: xenomai-head Branch: master Commit: 28cf063829dec07d627c11bed45e6dd3cc118256 URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=28cf063829dec07d627c11bed45e6dd3cc118256 Author: Alexis Berlemont Date: Fri Nov 13 01:59:29 2009 +0100 analogy: minor cosmetic change in instruction header --- include/analogy/instruction.h | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/analogy/instruction.h b/include/analogy/instruction.h index a3a82cb..1ac7484 100644 --- a/include/analogy/instruction.h +++ b/include/analogy/instruction.h @@ -127,9 +127,9 @@ * @{ */ -#define A4L_COUNTER_ARMED 0x1 +#define A4L_COUNTER_ARMED 0x1 #define A4L_COUNTER_COUNTING 0x2 -#define A4L_COUNTER_TERMINAL_COUNT 0x4 +#define A4L_COUNTER_TERMINAL_COUNT 0x4 /*! @} ANALOGY_COUNTER_xxx */ @@ -139,9 +139,9 @@ * @{ */ -#define A4L_INPUT 0 -#define A4L_OUTPUT 1 -#define A4L_OPENDRAIN 2 +#define A4L_INPUT 0 +#define A4L_OUTPUT 1 +#define A4L_OPENDRAIN 2 /*! @} ANALOGY_IO_DIRECTION */ ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: add default attach options for analogy_parport driver
Module: xenomai-head Branch: master Commit: a5107b1e8f975a7771831aa9a2e5f7a58eefbbc2 URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=a5107b1e8f975a7771831aa9a2e5f7a58eefbbc2 Author: Alexis Berlemont Date: Sun Nov 8 16:33:08 2009 +0100 analogy: add default attach options for analogy_parport driver --- ksrc/drivers/analogy/intel/parport.c | 31 +++ 1 files changed, 19 insertions(+), 12 deletions(-) diff --git a/ksrc/drivers/analogy/intel/parport.c b/ksrc/drivers/analogy/intel/parport.c index 6abc5b4..a1a1625 100644 --- a/ksrc/drivers/analogy/intel/parport.c +++ b/ksrc/drivers/analogy/intel/parport.c @@ -56,7 +56,7 @@ subdevice 2 is digital output. Unlike other Analogy devices, subdevice 0 defaults to output. - Pins 13 and 14 are inverted once by Comedi and once by the + Pins 13 and 14 are inverted once by Analogy and once by the hardware, thus cancelling the effect. Pin 1 is a strobe, thus acts like one. There's no way in software @@ -81,6 +81,9 @@ #define PARPORT_B 1 #define PARPORT_C 2 +#define DEFAULT_ADDRESS 0x378 +#define DEFAULT_IRQ 7 + typedef struct parport_subd_priv { unsigned long io_bits; } parport_spriv_t; @@ -325,24 +328,28 @@ static int dev_parport_attach(a4l_dev_t *dev, a4l_lnkdesc_t *arg) unsigned long io_base; if(arg->opts == NULL || arg->opts_size < sizeof(unsigned long)) { - a4l_err(dev, - "dev_parport_attach: " - "unable to detect any parallel port, " - "no addresses / IRQ passed as attach arguments\n"); - return -EINVAL; - } - io_base = ((unsigned long *)arg->opts)[0]; + a4l_warn(dev, +"dev_parport_attach: no attach options specified, " +"taking default options (addr=0x%x, irq=%d)\n", +DEFAULT_ADDRESS, DEFAULT_IRQ); + + io_base = DEFAULT_ADDRESS; + irq = DEFAULT_IRQ; + } else { + io_base = ((unsigned long *)arg->opts)[0]; + + if (arg->opts_size >= 2 * sizeof(unsigned long)) + irq = (int) ((unsigned long *)arg->opts)[1]; + } + if (!request_region(io_base, PARPORT_SIZE, "analogy_parport")) { a4l_err(dev, "dev_parport_attach: I/O port conflict"); return -EIO; } a4l_info(dev, "dev_parport_attach: address = 0x%lx\n", io_base); - - if (arg->opts_size == 2 * sizeof(unsigned long)) - irq = (int) ((unsigned long *)arg->opts)[1]; for (i = 0; i < 3; i++) { @@ -360,7 +367,7 @@ static int dev_parport_attach(a4l_dev_t *dev, a4l_lnkdesc_t *arg) a4l_subd_t *subd; - a4l_info(dev, "dev_parport_attach: irq = 0x%d\n", irq); + a4l_info(dev, "dev_parport_attach: irq = %d\n", irq); err = a4l_request_irq(dev, irq, parport_interrupt, 0, dev); if (err < 0) { ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: remove EXPERIMENTAL flag from 2.4 Config. in files
Module: xenomai-head Branch: master Commit: a1c1350d5d62ca766d7051a0114a9fae9b2c4721 URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=a1c1350d5d62ca766d7051a0114a9fae9b2c4721 Author: Alexis Berlemont Date: Sun Nov 8 02:12:02 2009 +0100 analogy: remove EXPERIMENTAL flag from 2.4 Config.in files --- ksrc/drivers/analogy/intel/Config.in |6 +++--- .../drivers/analogy/national_instruments/Config.in |4 +--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/ksrc/drivers/analogy/intel/Config.in b/ksrc/drivers/analogy/intel/Config.in index 357bb51..515648a 100644 --- a/ksrc/drivers/analogy/intel/Config.in +++ b/ksrc/drivers/analogy/intel/Config.in @@ -3,6 +3,6 @@ # Xenomai configuration for Linux v2.4 # -if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then - dep_tristate '8255 driver' CONFIG_XENO_DRIVERS_ANALOGY_8255 $CONFIG_XENO_DRIVERS_ANALOGY -fi +dep_tristate '8255 driver' CONFIG_XENO_DRIVERS_ANALOGY_8255 $CONFIG_XENO_DRIVERS_ANALOGY + +dep_tristate 'standard parallel port driver' CONFIG_XENO_DRIVERS_ANALOGY_PARPORT $CONFIG_XENO_DRIVERS_ANALOGY \ No newline at end of file diff --git a/ksrc/drivers/analogy/national_instruments/Config.in b/ksrc/drivers/analogy/national_instruments/Config.in index 95e4d99..3dff689 100644 --- a/ksrc/drivers/analogy/national_instruments/Config.in +++ b/ksrc/drivers/analogy/national_instruments/Config.in @@ -3,6 +3,4 @@ # Xenomai configuration for Linux v2.4 # -if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then - dep_tristate 'NI MITE driver' CONFIG_XENO_DRIVERS_ANALOGY_NI_MITE $CONFIG_XENO_DRIVERS_ANALOGY -fi +dep_tristate 'NI MITE driver' CONFIG_XENO_DRIVERS_ANALOGY_NI_MITE $CONFIG_XENO_DRIVERS_ANALOGY ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: fix a mistyping error
Module: xenomai-head Branch: master Commit: 586a315937930d0fc5ddb8286b0216f6fbd29248 URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=586a315937930d0fc5ddb8286b0216f6fbd29248 Author: Alexis Berlemont Date: Sun Nov 8 02:13:42 2009 +0100 analogy: fix a mistyping error --- ksrc/drivers/analogy/buffer.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/ksrc/drivers/analogy/buffer.c b/ksrc/drivers/analogy/buffer.c index 2672d7d..16c3c1e 100644 --- a/ksrc/drivers/analogy/buffer.c +++ b/ksrc/drivers/analogy/buffer.c @@ -875,7 +875,7 @@ int a4l_ioctl_poll(a4l_cxt_t * cxt, void *arg) /* Check the subdevice */ if (poll.idx_subd >= dev->transfer.nb_subd) { __a4l_err("a4l_poll: subdevice index out of range (idx=%d)\n", - buf_cfg.idx_subd); + poll.idx_subd); return -EINVAL; } ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: add a test program which performs synchronous write
Module: xenomai-head Branch: master Commit: 2dcb363a33702a74e9cee050f7152189fb1b2740 URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=2dcb363a33702a74e9cee050f7152189fb1b2740 Author: Alexis Berlemont Date: Fri Nov 13 02:05:31 2009 +0100 analogy: add a test program which performs synchronous write --- src/utils/analogy/Makefile.am |5 +- src/utils/analogy/Makefile.in | 18 +++- src/utils/analogy/insn_write.c | 273 3 files changed, 292 insertions(+), 4 deletions(-) diff --git a/src/utils/analogy/Makefile.am b/src/utils/analogy/Makefile.am index 32d05b5..6a232aa 100644 --- a/src/utils/analogy/Makefile.am +++ b/src/utils/analogy/Makefile.am @@ -1,6 +1,6 @@ sbin_PROGRAMS = analogy_config -bin_PROGRAMS = cmd_read cmd_write insn_read +bin_PROGRAMS = cmd_read cmd_write insn_read insn_write CPPFLAGS = \ @XENO_USER_CFLAGS@ \ @@ -23,3 +23,6 @@ cmd_write_LDADD = -lanalogy -lnative -lrtdm insn_read_SOURCES = insn_read.c insn_read_LDADD = -lanalogy -lnative -lrtdm + +insn_write_SOURCES = insn_write.c +insn_write_LDADD = -lanalogy -lnative -lrtdm diff --git a/src/utils/analogy/Makefile.in b/src/utils/analogy/Makefile.in index 21a34b2..6944a71 100644 --- a/src/utils/analogy/Makefile.in +++ b/src/utils/analogy/Makefile.in @@ -36,7 +36,8 @@ build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ sbin_PROGRAMS = analogy_config$(EXEEXT) -bin_PROGRAMS = cmd_read$(EXEEXT) cmd_write$(EXEEXT) insn_read$(EXEEXT) +bin_PROGRAMS = cmd_read$(EXEEXT) cmd_write$(EXEEXT) insn_read$(EXEEXT) \ + insn_write$(EXEEXT) subdir = src/utils/analogy DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -68,6 +69,9 @@ cmd_write_DEPENDENCIES = am_insn_read_OBJECTS = insn_read.$(OBJEXT) insn_read_OBJECTS = $(am_insn_read_OBJECTS) insn_read_DEPENDENCIES = +am_insn_write_OBJECTS = insn_write.$(OBJEXT) +insn_write_OBJECTS = $(am_insn_write_OBJECTS) +insn_write_DEPENDENCIES = DEFAULT_INCLUDES = -...@am__isrc@ -I$(top_builddir)/src/include depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles @@ -82,9 +86,11 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(analogy_config_SOURCES) $(cmd_read_SOURCES) \ - $(cmd_write_SOURCES) $(insn_read_SOURCES) + $(cmd_write_SOURCES) $(insn_read_SOURCES) \ + $(insn_write_SOURCES) DIST_SOURCES = $(analogy_config_SOURCES) $(cmd_read_SOURCES) \ - $(cmd_write_SOURCES) $(insn_read_SOURCES) + $(cmd_write_SOURCES) $(insn_read_SOURCES) \ + $(insn_write_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -263,6 +269,8 @@ cmd_write_SOURCES = cmd_write.c cmd_write_LDADD = -lanalogy -lnative -lrtdm insn_read_SOURCES = insn_read.c insn_read_LDADD = -lanalogy -lnative -lrtdm +insn_write_SOURCES = insn_write.c +insn_write_LDADD = -lanalogy -lnative -lrtdm all: all-am .SUFFIXES: @@ -395,6 +403,9 @@ cmd_write$(EXEEXT): $(cmd_write_OBJECTS) $(cmd_write_DEPENDENCIES) insn_read$(EXEEXT): $(insn_read_OBJECTS) $(insn_read_DEPENDENCIES) @rm -f insn_read$(EXEEXT) $(LINK) $(insn_read_OBJECTS) $(insn_read_LDADD) $(LIBS) +insn_write$(EXEEXT): $(insn_write_OBJECTS) $(insn_write_DEPENDENCIES) + @rm -f insn_write$(EXEEXT) + $(LINK) $(insn_write_OBJECTS) $(insn_write_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -406,6 +417,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__qu...@./$(DEPDIR)/cmd_read...@am__quote@ @AMDEP_TRUE@@am__include@ @am__qu...@./$(DEPDIR)/cmd_write...@am__quote@ @AMDEP_TRUE@@am__include@ @am__qu...@./$(DEPDIR)/insn_read...@am__quote@ +...@amdep_true@@am__include@ @am__qu...@./$(DEPDIR)/insn_write...@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< diff --git a/src/utils/analogy/insn_write.c b/src/utils/analogy/insn_write.c new file mode 100644 index 000..007ef4a --- /dev/null +++ b/src/utils/analogy/insn_write.c @@ -0,0 +1,273 @@ +/** + * @file + * Analogy for Linux, instruction write test program + * + * @note Copyright (C) 1997-2000 David A. Schleef + * @note Copyright (C) 2008 Alexis Berlemont + * + * Xenomai is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Xenomai is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Xenomai; if not
[Xenomai-git] Alexis Berlemont : analogy: fix a bug in the attach procedure
Module: xenomai-head Branch: master Commit: 01bcfd898555425e96350b306155cba429a65539 URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=01bcfd898555425e96350b306155cba429a65539 Author: Alexis Berlemont Date: Sun Nov 8 02:10:20 2009 +0100 analogy: fix a bug in the attach procedure The options to be sent to the driver at attach time were badly handled if the values were hexadecimal-based. --- src/utils/analogy/analogy_config.c | 20 ++-- 1 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/utils/analogy/analogy_config.c b/src/utils/analogy/analogy_config.c index 316dcd4..1482322 100644 --- a/src/utils/analogy/analogy_config.c +++ b/src/utils/analogy/analogy_config.c @@ -50,7 +50,7 @@ struct option a4l_conf_opts[] = { {0}, }; -int compute_opts(char *opts, unsigned int *nb, unsigned int *res) +int compute_opts(char *opts, unsigned int *nb, unsigned long *res) { int ret = 0, len, ofs; @@ -60,19 +60,26 @@ int compute_opts(char *opts, unsigned int *nb, unsigned int *res) return -EINVAL; *nb = 0; + /* We set errno to 0 so as to be sure that + strtoul did not fail */ + errno = 0; + do { (*nb)++; len = strlen(opts); ofs = strcspn(opts, __OPTS_DELIMITER); - if (res != NULL && sscanf(opts, "%u", &res[(*nb) - 1]) == 0) { - ret = -EINVAL; - goto out_compute_opts; + if (res != NULL) { + res[(*nb) - 1] = strtoul(opts, NULL, 0); + if (errno != 0) { + ret = -errno; + goto out_compute_opts; + } } opts += ofs + 1; } while (len != ofs); out_compute_opts: - (*nb) *= sizeof(unsigned int); + (*nb) *= sizeof(unsigned long); return ret; } @@ -85,7 +92,8 @@ void do_print_version(void) void do_print_usage(void) { fprintf(stdout, - "usage:\tanalogy_config [OPTS] \n"); + "usage:\tanalogy_config [OPTS] devfile driver " + "\n"); fprintf(stdout, "\tOPTS:\t -v, --verbose: verbose output\n"); fprintf(stdout, "\t\t -q, --quiet: quiet output\n"); fprintf(stdout, "\t\t -V, --version: print program version\n"); ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: change prefix for traces (a4l -> Analogy)
Module: xenomai-head Branch: master Commit: 432941665db1f694e1239ca9e144e4a3eba749a2 URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=432941665db1f694e1239ca9e144e4a3eba749a2 Author: Alexis Berlemont Date: Fri Nov 13 02:00:36 2009 +0100 analogy: change prefix for traces (a4l -> Analogy) --- include/analogy/os_facilities.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/include/analogy/os_facilities.h b/include/analogy/os_facilities.h index 66a3f2e..2d882e2 100644 --- a/include/analogy/os_facilities.h +++ b/include/analogy/os_facilities.h @@ -44,7 +44,7 @@ /* --- Kernel traces functions --- */ -#define A4L_PROMPT "a4l: " +#define A4L_PROMPT "Analogy: " #define RTDM_SUBCLASS_ANALOGY 0 ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: improve ioctl error handling
Module: xenomai-head Branch: master Commit: e6e21a3e183f145dd1c583e60fbecda982e00c70 URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=e6e21a3e183f145dd1c583e60fbecda982e00c70 Author: Alexis Berlemont Date: Thu Nov 5 23:54:47 2009 +0100 analogy: improve ioctl error handling --- ksrc/drivers/analogy/buffer.c | 72 --- ksrc/drivers/analogy/command.c |9 ++-- ksrc/drivers/analogy/device.c |2 +- ksrc/drivers/analogy/instruction.c |2 +- ksrc/drivers/analogy/subdevice.c |3 +- ksrc/drivers/analogy/transfer.c| 10 - 6 files changed, 67 insertions(+), 31 deletions(-) diff --git a/ksrc/drivers/analogy/buffer.c b/ksrc/drivers/analogy/buffer.c index cad8a06..2672d7d 100644 --- a/ksrc/drivers/analogy/buffer.c +++ b/ksrc/drivers/analogy/buffer.c @@ -407,13 +407,20 @@ int a4l_ioctl_mmap(a4l_cxt_t *cxt, void *arg) return -EFAULT; /* Check the subdevice */ - if (map_cfg.idx_subd >= dev->transfer.nb_subd || - (dev->transfer.subds[map_cfg.idx_subd]->flags & A4L_SUBD_CMD) == - 0 - || (dev->transfer.subds[map_cfg.idx_subd]-> - flags & A4L_SUBD_MMAP) == 0) { - __a4l_err("a4l_ioctl_mmap: wrong subdevice selected (idx=%d)\n", - map_cfg.idx_subd); + if (map_cfg.idx_subd >= dev->transfer.nb_subd) { + __a4l_err("a4l_ioctl_mmap: subdevice index " + "out of range (idx=%d)\n", map_cfg.idx_subd); + return -EINVAL; + } + + if ((dev->transfer.subds[map_cfg.idx_subd]->flags & A4L_SUBD_CMD) == 0) { + __a4l_err("a4l_ioctl_mmap: operation not supported, " + "synchronous only subdevice\n"); + return -EINVAL; + } + + if ((dev->transfer.subds[map_cfg.idx_subd]->flags & A4L_SUBD_MMAP) == 0) { + __a4l_err("a4l_ioctl_mmap: mmap not allowed on this subdevice\n"); return -EINVAL; } @@ -476,9 +483,16 @@ int a4l_ioctl_bufcfg(a4l_cxt_t * cxt, void *arg) arg, sizeof(a4l_bufcfg_t)) != 0) return -EFAULT; - if (buf_cfg.idx_subd >= dev->transfer.nb_subd || - (dev->transfer.subds[buf_cfg.idx_subd]->flags & A4L_SUBD_CMD) == 0) { - __a4l_err("a4l_ioctl_bufcfg: wrong subdevice selected\n"); + /* Check the subdevice */ + if (buf_cfg.idx_subd >= dev->transfer.nb_subd) { + __a4l_err("a4l_ioctl_bufcfg: subdevice index " + "out of range (idx=%d)\n", buf_cfg.idx_subd); + return -EINVAL; + } + + if ((dev->transfer.subds[buf_cfg.idx_subd]->flags & A4L_SUBD_CMD) == 0) { + __a4l_err("a4l_ioctl_bufcfg: operation not supported, " + "synchronous only subdevice\n"); return -EINVAL; } @@ -491,7 +505,7 @@ int a4l_ioctl_bufcfg(a4l_cxt_t * cxt, void *arg) no buffer size change is allowed */ if (test_bit(A4L_TSF_BUSY, &(dev->transfer.status[buf_cfg.idx_subd]))) { - __a4l_err("a4l_ioctl_bufcfg: buffer size too big (<=16MB)\n"); + __a4l_err("a4l_ioctl_bufcfg: acquisition in progress\n"); return -EBUSY; } @@ -531,9 +545,16 @@ int a4l_ioctl_bufinfo(a4l_cxt_t * cxt, void *arg) &info, arg, sizeof(a4l_bufinfo_t)) != 0) return -EFAULT; - if (info.idx_subd >= dev->transfer.nb_subd || - (dev->transfer.subds[info.idx_subd]->flags & A4L_SUBD_CMD) == 0) { - __a4l_err("a4l_ioctl_bufinfo: wrong subdevice selected\n"); + /* Check the subdevice */ + if (info.idx_subd >= dev->transfer.nb_subd) { + __a4l_err("a4l_ioctl_bufinfo: subdevice index " + "out of range (idx=%d)\n", info.idx_subd); + return -EINVAL; + } + + if ((dev->transfer.subds[info.idx_subd]->flags & A4L_SUBD_CMD) == 0) { + __a4l_err("a4l_ioctl_bufinfo: operation not supported, " + "synchronous only subdevice\n"); return -EINVAL; } @@ -829,11 +850,6 @@ int a4l_select(a4l_cxt_t *cxt, return -ENOENT; } - /* TODO: to be removed - Check the subdevice capabilities */ - if ((dev->transfer.subds[idx_subd]->flags & A4L_SUBD_CMD) == 0) - return -EINVAL; - /* Performs a bind on the Analogy synchronization element */ return a4l_select_sync(&(buf->sync), selector, type, fd_index); } @@ -856,10 +872,20 @@ int a4l_ioctl_poll(a4l_cxt_t * cxt, void *arg) &poll, arg, sizeof(a4l_poll_t)) != 0) return -EFAULT; - /* Checks the subdevice capabilities */ - if ((dev->transfer.subds[poll.idx_sub
[Xenomai-git] Alexis Berlemont : analogy: fix functions declarations in the 8255 driver
Module: xenomai-head Branch: master Commit: 8bb9c840abb5dc7afd4bf2113dce0cbb4d676536 URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=8bb9c840abb5dc7afd4bf2113dce0cbb4d676536 Author: Alexis Berlemont Date: Sun Nov 8 02:16:53 2009 +0100 analogy: fix functions declarations in the 8255 driver Some "static" keywords were lacking. --- ksrc/drivers/analogy/intel/8255.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ksrc/drivers/analogy/intel/8255.c b/ksrc/drivers/analogy/intel/8255.c index 8f5010e..a5602c1 100644 --- a/ksrc/drivers/analogy/intel/8255.c +++ b/ksrc/drivers/analogy/intel/8255.c @@ -234,7 +234,7 @@ EXPORT_SYMBOL(subdev_8255_init); */ -int dev_8255_attach(a4l_dev_t *dev, a4l_lnkdesc_t *arg) +static int dev_8255_attach(a4l_dev_t *dev, a4l_lnkdesc_t *arg) { unsigned long *addrs; int i, err = 0; @@ -293,7 +293,7 @@ out_attach: return err; } -int dev_8255_detach(a4l_dev_t *dev) +static int dev_8255_detach(a4l_dev_t *dev) { a4l_subd_t *subd; int i = 0; ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: use the A4L_INSN_* constants to configure the DIO subdevice
Module: xenomai-head Branch: master Commit: 88fd5b0736b65007e65ef37465d2e39b7f68c293 URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=88fd5b0736b65007e65ef37465d2e39b7f68c293 Author: Alexis Berlemont Date: Wed Nov 11 17:39:01 2009 +0100 analogy: use the A4L_INSN_* constants to configure the DIO subdevice --- ksrc/drivers/analogy/intel/parport.c | 23 --- 1 files changed, 20 insertions(+), 3 deletions(-) diff --git a/ksrc/drivers/analogy/intel/parport.c b/ksrc/drivers/analogy/intel/parport.c index a1a1625..735656c 100644 --- a/ksrc/drivers/analogy/intel/parport.c +++ b/ksrc/drivers/analogy/intel/parport.c @@ -118,13 +118,30 @@ static int parport_insn_config_a(a4l_subd_t *subd, a4l_kinsn_t *insn) a4l_dev_t *dev = subd->dev; parport_spriv_t *spriv = (parport_spriv_t *)subd->priv; - if (insn->data[0]) { + /* No need to check the channel descriptor; the input / output + setting is global for all channels */ + + switch (insn->data[0]) { + + case A4L_INSN_CONFIG_DIO_OUTPUT: spriv->io_bits = 0xff; - devpriv->c_data &= ~(1 << 5); - } else { + devpriv->c_data &= ~(1 << 5); + break; + + case A4L_INSN_CONFIG_DIO_INPUT: spriv->io_bits = 0; devpriv->c_data |= (1 << 5); + break; + + case A4L_INSN_CONFIG_DIO_QUERY: + insn->data[1] = (spriv->io_bits == 0xff) ? + A4L_OUTPUT: A4L_INPUT; + break; + + default: + return -EINVAL; } + outb(devpriv->c_data, devpriv->io_base + PARPORT_C); return 0; ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: add error codes descriptions for range management routines
Module: xenomai-abe Branch: analogy Commit: e39a47ae10736c76de503c3ea7e8f32ac149c830 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=e39a47ae10736c76de503c3ea7e8f32ac149c830 Author: Alexis Berlemont Date: Sun Nov 22 23:53:43 2009 +0100 analogy: add error codes descriptions for range management routines --- src/drvlib/analogy/descriptor.c | 13 +++-- src/drvlib/analogy/range.c | 21 ++--- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/src/drvlib/analogy/descriptor.c b/src/drvlib/analogy/descriptor.c index a85d878..f841657 100644 --- a/src/drvlib/analogy/descriptor.c +++ b/src/drvlib/analogy/descriptor.c @@ -336,6 +336,7 @@ int a4l_close(a4l_desc_t * dsc) * - -EINVAL is returned if some argument is missing or wrong; the *the dsc pointer should be checked; check also the kernel log *("dmesg") + * - -EFAULT is returned if a user <-> kernel transfer went wrong * */ int a4l_fill_desc(a4l_desc_t * dsc) @@ -363,8 +364,8 @@ int a4l_fill_desc(a4l_desc_t * dsc) * * - -EINVAL is returned if some argument is missing or wrong; subd *and the dsc pointer should be checked; check also the kernel log - *("dmesg") - * - -EFAULT is returned if a user <-> kernel transfer went wrong + *("dmesg"); WARNING: a4l_fill_desc() should be called before + *using a4l_get_subdinfo(). * */ int a4l_get_subdinfo(a4l_desc_t * dsc, @@ -400,8 +401,8 @@ int a4l_get_subdinfo(a4l_desc_t * dsc, * * - -EINVAL is returned if some argument is missing or wrong; subd, *chan and the dsc pointer should be checked; check also the - *kernel log ("dmesg") - * - -EFAULT is returned if a user <-> kernel transfer went wrong + *kernel log ("dmesg"); WARNING: a4l_fill_desc() should be called + *before using a4l_get_chinfo() * */ int a4l_get_chinfo(a4l_desc_t * dsc, @@ -444,8 +445,8 @@ int a4l_get_chinfo(a4l_desc_t * dsc, * * - -EINVAL is returned if some argument is missing or wrong; subd, *chan, rng and the dsc pointer should be checked; check also the - *kernel log ("dmesg") - * - -EFAULT is returned if a user <-> kernel transfer went wrong + *kernel log ("dmesg"); WARNING: a4l_fill_desc() should be called + *before using a4l_get_rnginfo() * */ int a4l_get_rnginfo(a4l_desc_t * dsc, diff --git a/src/drvlib/analogy/range.c b/src/drvlib/analogy/range.c index e12242c..ab41f1e 100644 --- a/src/drvlib/analogy/range.c +++ b/src/drvlib/analogy/range.c @@ -78,7 +78,12 @@ void data8_set(void *dst, lsampl_t val) * @param[in] max Maximal limit value * @param[out] rng Found range * - * @return 0 on success, otherwise a negative error code. + * @return 0 on success. Otherwise: + * + * - -EINVAL is returned if some argument is missing or wrong; + *idx_subd, idx_chan and the dsc pointer should be checked; check + *also the kernel log ("dmesg"); WARNING: a4l_fill_desc() should + *be called before using a4l_find_range() * */ int a4l_find_range(a4l_desc_t * dsc, @@ -147,7 +152,12 @@ out_get_range: * @param[in] cnt Count of conversion to perform * * @return the count of conversion performed, otherwise a negative - * error code. + * error code: + * + * - -EINVAL is returned if some argument is missing or wrong; + *chan, rng and the pointers should be checked; check also the + *kernel log ("dmesg"); WARNING: a4l_fill_desc() should be called + *before using a4l_to_phys() * */ int a4l_to_phys(a4l_chinfo_t * chan, @@ -213,7 +223,12 @@ int a4l_to_phys(a4l_chinfo_t * chan, * @param[in] cnt Count of conversion to perform * * @return the count of conversion performed, otherwise a negative - * error code. + * error code: + * + * - -EINVAL is returned if some argument is missing or wrong; + *chan, rng and the pointers should be checked; check also the + *kernel log ("dmesg"); WARNING: a4l_fill_desc() should be called + *before using a4l_from_phys() * */ int a4l_from_phys(a4l_chinfo_t * chan, ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: add error codes descriptions for synchronous operations
Module: xenomai-abe Branch: analogy Commit: d358913a4cc26628cf69c3509f71bccc7f62feee URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=d358913a4cc26628cf69c3509f71bccc7f62feee Author: Alexis Berlemont Date: Sat Nov 21 23:50:07 2009 +0100 analogy: add error codes descriptions for synchronous operations --- src/drvlib/analogy/sync.c | 28 1 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/drvlib/analogy/sync.c b/src/drvlib/analogy/sync.c index 51d2d9b..55d56d3 100644 --- a/src/drvlib/analogy/sync.c +++ b/src/drvlib/analogy/sync.c @@ -49,7 +49,12 @@ * optionally a4l_fill_desc()) * @param[in] arg Instructions list structure * - * @return 0 on success, otherwise a negative error code. + * @return 0 on success. Otherwise: + * + * - -EINVAL is returned if some argument is missing or wrong (Please, + *type "dmesg" for more info) + * - -EFAULT is returned if a user <-> kernel transfer went wrong + * - -ENOMEM is returned if the system is out of memory * */ int a4l_snd_insnlist(a4l_desc_t * dsc, a4l_insnlst_t * arg) @@ -70,7 +75,12 @@ int a4l_snd_insnlist(a4l_desc_t * dsc, a4l_insnlst_t * arg) * optionally a4l_fill_desc()) * @param[in] arg Instruction structure * - * @return 0 on success, otherwise a negative error code. + * @return 0 on success. Otherwise: + * + * - -EINVAL is returned if some argument is missing or wrong (Please, + *type "dmesg" for more info) + * - -EFAULT is returned if a user <-> kernel transfer went wrong + * - -ENOMEM is returned if the system is out of memory * */ int a4l_snd_insn(a4l_desc_t * dsc, a4l_insn_t * arg) @@ -111,7 +121,12 @@ int a4l_snd_insn(a4l_desc_t * dsc, a4l_insn_t * arg) * @param[in] buf Output buffer * @param[in] nbyte Number of bytes to write * - * @return 0 on success, otherwise a negative error code. + * @return 0 on success. Otherwise: + * + * - -EINVAL is returned if some argument is missing or wrong (Please, + *type "dmesg" for more info) + * - -EFAULT is returned if a user <-> kernel transfer went wrong + * - -ENOMEM is returned if the system is out of memory * */ int a4l_sync_write(a4l_desc_t * dsc, @@ -179,7 +194,12 @@ int a4l_sync_write(a4l_desc_t * dsc, * @param[in] buf Input buffer * @param[in] nbyte Number of bytes to read * - * @return 0 on success, otherwise a negative error code. + * @return 0 on success. Otherwise: + * + * - -EINVAL is returned if some argument is missing or wrong (Please, + *type "dmesg" for more info) + * - -EFAULT is returned if a user <-> kernel transfer went wrong + * - -ENOMEM is returned if the system is out of memory * */ int a4l_sync_read(a4l_desc_t * dsc, ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: add error messages in instruction handling
Module: xenomai-abe Branch: analogy Commit: 9cb9354726e7aa84f4b9c48cbf6fbf68404e8629 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=9cb9354726e7aa84f4b9c48cbf6fbf68404e8629 Author: Alexis Berlemont Date: Sat Nov 21 23:49:00 2009 +0100 analogy: add error messages in instruction handling --- ksrc/drivers/analogy/instruction.c | 34 +- 1 files changed, 25 insertions(+), 9 deletions(-) diff --git a/ksrc/drivers/analogy/instruction.c b/ksrc/drivers/analogy/instruction.c index 3bd92d9..ecd28be 100644 --- a/ksrc/drivers/analogy/instruction.c +++ b/ksrc/drivers/analogy/instruction.c @@ -39,8 +39,10 @@ int a4l_do_insn_gettime(a4l_kinsn_t * dsc) unsigned long ns2; /* Basic checkings */ - if (dsc->data_size != 2) + if (dsc->data_size != 2) { + __a4l_err("a4l_do_insn_gettime: data size should be 2\n"); return -EINVAL; + } ns = a4l_get_time(); @@ -56,11 +58,15 @@ int a4l_do_insn_wait(a4l_kinsn_t * dsc) unsigned int us; /* Basic checkings */ - if (dsc->data_size != 1) + if (dsc->data_size != 1) { + __a4l_err("a4l_do_insn_wait: data size should be 1\n"); return -EINVAL; + } - if (dsc->data[0] > A4L_INSN_WAIT_MAX) + if (dsc->data[0] > A4L_INSN_WAIT_MAX) { + __a4l_err("a4l_do_insn_wait: wait duration is out of range\n"); return -EINVAL; + } /* As we use (a4l_)udelay, we have to convert the delay into microseconds */ @@ -83,19 +89,27 @@ int a4l_do_insn_trig(a4l_cxt_t * cxt, a4l_kinsn_t * dsc) lsampl_t trignum; /* Basic checkings */ - if (dsc->data_size > 1) + if (dsc->data_size > 1) { + __a4l_err("a4l_do_insn_trig: data size should not be > 1\n"); return -EINVAL; + } trignum = (dsc->data_size == 1) ? dsc->data[0] : 0; - if (dsc->idx_subd >= dev->transfer.nb_subd) + if (dsc->idx_subd >= dev->transfer.nb_subd) { + __a4l_err("a4l_do_insn_trig: " + "subdevice index is out of range\n"); return -EINVAL; + } subd = dev->transfer.subds[dsc->idx_subd]; /* Checks that the concerned subdevice is trigger-compliant */ - if ((subd->flags & A4L_SUBD_CMD) == 0 || subd->trigger == NULL) + if ((subd->flags & A4L_SUBD_CMD) == 0 || subd->trigger == NULL) { + __a4l_err("a4l_do_insn_trig: subdevice does not support " + "triggering or asynchronous acquisition\n"); return -EINVAL; + } /* Performs the trigger */ return subd->trigger(subd, trignum); @@ -112,6 +126,7 @@ int a4l_fill_insndsc(a4l_cxt_t * cxt, a4l_kinsn_t * dsc, void *arg) goto out_insndsc; if (dsc->data_size != 0 && dsc->data == NULL) { + __a4l_err("a4l_fill_insndsc: no data pointer specified\n"); ret = -EINVAL; goto out_insndsc; } @@ -197,8 +212,7 @@ int a4l_do_insn(a4l_cxt_t * cxt, a4l_kinsn_t * dsc) subd = dev->transfer.subds[dsc->idx_subd]; /* Checks the subdevice's characteristics */ - if (((subd->flags & A4L_SUBD_UNUSED) != 0) || - ((subd->flags & A4L_SUBD_CMD) == 0)) { + if ((subd->flags & A4L_SUBD_UNUSED) != 0) { __a4l_err("a4l_do_insn: wrong subdevice selected\n"); return -EINVAL; } @@ -291,8 +305,10 @@ int a4l_fill_ilstdsc(a4l_cxt_t * cxt, a4l_kilst_t * dsc, void *arg) return ret; /* Some basic checking */ - if (dsc->count == 0) + if (dsc->count == 0) { + __a4l_err("a4l_fill_ilstdsc: instruction list's count is 0\n"); return -EINVAL; + } /* Keeps the user pointer in an opaque field */ dsc->__uinsns = dsc->insns; ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: add error codes descriptions for descriptor routines
Module: xenomai-abe Branch: analogy Commit: ca7c7a978ccc0cc67b1a17006fcaf98b77d19b12 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=ca7c7a978ccc0cc67b1a17006fcaf98b77d19b12 Author: Alexis Berlemont Date: Sun Nov 22 16:42:37 2009 +0100 analogy: add error codes descriptions for descriptor routines --- src/drvlib/analogy/async.c |4 +- src/drvlib/analogy/descriptor.c | 56 ++ 2 files changed, 46 insertions(+), 14 deletions(-) diff --git a/src/drvlib/analogy/async.c b/src/drvlib/analogy/async.c index d83b032..f342af3 100644 --- a/src/drvlib/analogy/async.c +++ b/src/drvlib/analogy/async.c @@ -208,9 +208,9 @@ int a4l_get_bufsize(a4l_desc_t * dsc, * * @return 0 on success. Otherwise: * - * - -EINVAL is returned if some argument is missing or wrong, the + * - -EINVAL is returned if some argument is missing or wrong; the *descriptor and the new pointer should be checked; check also the - *kernel log + *kernel log ("dmesg") * - -EFAULT is returned if a user <-> kernel transfer went wrong * */ diff --git a/src/drvlib/analogy/descriptor.c b/src/drvlib/analogy/descriptor.c index dcfd6a3..a85d878 100644 --- a/src/drvlib/analogy/descriptor.c +++ b/src/drvlib/analogy/descriptor.c @@ -110,14 +110,12 @@ static int __a4l_get_sbsize(int fd, a4l_desc_t * dsc) if ((ret = a4l_sys_nbchaninfo(fd, i, &nb_chan)) < 0) return ret; - res += - nb_chan * (sizeof(a4l_chinfo_t) + sizeof(a4l_leaf_t)); + res += nb_chan * (sizeof(a4l_chinfo_t) + sizeof(a4l_leaf_t)); for (j = 0; j < nb_chan; j++) { if ((ret = a4l_sys_nbrnginfo(fd, i, j, &nb_rng)) < 0) return ret; - res += - nb_rng * (sizeof(a4l_rnginfo_t) + - sizeof(a4l_leaf_t)); + res += nb_rng * (sizeof(a4l_rnginfo_t) + +sizeof(a4l_leaf_t)); } } @@ -218,9 +216,15 @@ static int __a4l_fill_desc(int fd, a4l_desc_t * dsc) * is filled with characteristics about the subdevices, the channels * and the ranges. * - * @return 0 on success, otherwise negative error code. + * @return 0 on success. Otherwise: + * + * - -EINVAL is returned if some argument is missing or wrong; the + *pass argument should be checked; check also the kernel log + *("dmesg") + * - -EFAULT is returned if a user <-> kernel transfer went wrong * */ + int a4l_sys_desc(int fd, a4l_desc_t * dsc, int pass) { int ret = 0; @@ -267,7 +271,12 @@ out_a4l_sys_desc: * @param[out] dsc Device descriptor * @param[in] fname Device name * - * @return 0 on success, otherwise negative error code. + * @return 0 on success. Otherwise: + * + * - -EINVAL is returned if some argument is missing or wrong; the + *fname and the dsc pointer should be checked; check also the + *kernel log ("dmesg") + * - -EFAULT is returned if a user <-> kernel transfer went wrong * */ int a4l_open(a4l_desc_t * dsc, const char *fname) @@ -300,7 +309,11 @@ int a4l_open(a4l_desc_t * dsc, const char *fname) * * @param[in] dsc Device descriptor * - * @return 0 on success, otherwise negative error code. + * @return 0 on success. Otherwise: + * + * - -EINVAL is returned if some argument is missing or wrong; the + *the dsc pointer should be checked; check also the kernel log + *("dmesg") * */ int a4l_close(a4l_desc_t * dsc) @@ -318,7 +331,11 @@ int a4l_close(a4l_desc_t * dsc) * * @param[in] dsc Device descriptor partly filled by a4l_open(). * - * @return 0 on success, otherwise negative error code. + * @return 0 on success. Otherwise: + * + * - -EINVAL is returned if some argument is missing or wrong; the + *the dsc pointer should be checked; check also the kernel log + *("dmesg") * */ int a4l_fill_desc(a4l_desc_t * dsc) @@ -342,7 +359,12 @@ int a4l_fill_desc(a4l_desc_t * dsc) * @param[in] subd Subdevice index * @param[out] info Subdevice information structure * - * @return 0 on success, otherwise negative error code. + * @return 0 on success. Otherwise: + * + * - -EINVAL is returned if some argument is missing or wrong; subd + *and the dsc pointer should be checked; check also the kernel log + *("dmesg") + * - -EFAULT is returned if a user <-> kernel transfer went wrong * */ int a4l_get_subdinfo(a4l_desc_t * dsc, @@ -374,7 +396,12 @@ int a4l_get_subdinfo(a4l_desc_t * dsc, * @param[in] chan Channel index * @param[out] info Channel information structure * - * @return 0 on success, otherwise negative error code. + * @return 0 on success. Otherwise: + * + * - -EINVAL is returned if some argument is missing or wrong; subd, + *chan and the dsc pointer should be checked; check also the + *kernel log ("dmesg") + * - -EFAULT is retur
[Xenomai-git] Alexis Berlemont : analogy: add error codes descriptions for synchronous operations
Module: xenomai-abe Branch: analogy Commit: 4bf0866cb93ddb3a61ffac2e9baa2b5260543d67 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=4bf0866cb93ddb3a61ffac2e9baa2b5260543d67 Author: Alexis Berlemont Date: Sat Nov 21 23:50:07 2009 +0100 analogy: add error codes descriptions for synchronous operations --- src/drvlib/analogy/sync.c | 28 1 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/drvlib/analogy/sync.c b/src/drvlib/analogy/sync.c index 51d2d9b..55d56d3 100644 --- a/src/drvlib/analogy/sync.c +++ b/src/drvlib/analogy/sync.c @@ -49,7 +49,12 @@ * optionally a4l_fill_desc()) * @param[in] arg Instructions list structure * - * @return 0 on success, otherwise a negative error code. + * @return 0 on success. Otherwise: + * + * - -EINVAL is returned if some argument is missing or wrong (Please, + *type "dmesg" for more info) + * - -EFAULT is returned if a user <-> kernel transfer went wrong + * - -ENOMEM is returned if the system is out of memory * */ int a4l_snd_insnlist(a4l_desc_t * dsc, a4l_insnlst_t * arg) @@ -70,7 +75,12 @@ int a4l_snd_insnlist(a4l_desc_t * dsc, a4l_insnlst_t * arg) * optionally a4l_fill_desc()) * @param[in] arg Instruction structure * - * @return 0 on success, otherwise a negative error code. + * @return 0 on success. Otherwise: + * + * - -EINVAL is returned if some argument is missing or wrong (Please, + *type "dmesg" for more info) + * - -EFAULT is returned if a user <-> kernel transfer went wrong + * - -ENOMEM is returned if the system is out of memory * */ int a4l_snd_insn(a4l_desc_t * dsc, a4l_insn_t * arg) @@ -111,7 +121,12 @@ int a4l_snd_insn(a4l_desc_t * dsc, a4l_insn_t * arg) * @param[in] buf Output buffer * @param[in] nbyte Number of bytes to write * - * @return 0 on success, otherwise a negative error code. + * @return 0 on success. Otherwise: + * + * - -EINVAL is returned if some argument is missing or wrong (Please, + *type "dmesg" for more info) + * - -EFAULT is returned if a user <-> kernel transfer went wrong + * - -ENOMEM is returned if the system is out of memory * */ int a4l_sync_write(a4l_desc_t * dsc, @@ -179,7 +194,12 @@ int a4l_sync_write(a4l_desc_t * dsc, * @param[in] buf Input buffer * @param[in] nbyte Number of bytes to read * - * @return 0 on success, otherwise a negative error code. + * @return 0 on success. Otherwise: + * + * - -EINVAL is returned if some argument is missing or wrong (Please, + *type "dmesg" for more info) + * - -EFAULT is returned if a user <-> kernel transfer went wrong + * - -ENOMEM is returned if the system is out of memory * */ int a4l_sync_read(a4l_desc_t * dsc, ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: add error messages in instruction handling
Module: xenomai-abe Branch: analogy Commit: 76456b88f8fe8cf9885996f2c042df7d4b266df0 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=76456b88f8fe8cf9885996f2c042df7d4b266df0 Author: Alexis Berlemont Date: Sat Nov 21 23:49:00 2009 +0100 analogy: add error messages in instruction handling --- ksrc/drivers/analogy/instruction.c | 34 +- 1 files changed, 25 insertions(+), 9 deletions(-) diff --git a/ksrc/drivers/analogy/instruction.c b/ksrc/drivers/analogy/instruction.c index 3bd92d9..ecd28be 100644 --- a/ksrc/drivers/analogy/instruction.c +++ b/ksrc/drivers/analogy/instruction.c @@ -39,8 +39,10 @@ int a4l_do_insn_gettime(a4l_kinsn_t * dsc) unsigned long ns2; /* Basic checkings */ - if (dsc->data_size != 2) + if (dsc->data_size != 2) { + __a4l_err("a4l_do_insn_gettime: data size should be 2\n"); return -EINVAL; + } ns = a4l_get_time(); @@ -56,11 +58,15 @@ int a4l_do_insn_wait(a4l_kinsn_t * dsc) unsigned int us; /* Basic checkings */ - if (dsc->data_size != 1) + if (dsc->data_size != 1) { + __a4l_err("a4l_do_insn_wait: data size should be 1\n"); return -EINVAL; + } - if (dsc->data[0] > A4L_INSN_WAIT_MAX) + if (dsc->data[0] > A4L_INSN_WAIT_MAX) { + __a4l_err("a4l_do_insn_wait: wait duration is out of range\n"); return -EINVAL; + } /* As we use (a4l_)udelay, we have to convert the delay into microseconds */ @@ -83,19 +89,27 @@ int a4l_do_insn_trig(a4l_cxt_t * cxt, a4l_kinsn_t * dsc) lsampl_t trignum; /* Basic checkings */ - if (dsc->data_size > 1) + if (dsc->data_size > 1) { + __a4l_err("a4l_do_insn_trig: data size should not be > 1\n"); return -EINVAL; + } trignum = (dsc->data_size == 1) ? dsc->data[0] : 0; - if (dsc->idx_subd >= dev->transfer.nb_subd) + if (dsc->idx_subd >= dev->transfer.nb_subd) { + __a4l_err("a4l_do_insn_trig: " + "subdevice index is out of range\n"); return -EINVAL; + } subd = dev->transfer.subds[dsc->idx_subd]; /* Checks that the concerned subdevice is trigger-compliant */ - if ((subd->flags & A4L_SUBD_CMD) == 0 || subd->trigger == NULL) + if ((subd->flags & A4L_SUBD_CMD) == 0 || subd->trigger == NULL) { + __a4l_err("a4l_do_insn_trig: subdevice does not support " + "triggering or asynchronous acquisition\n"); return -EINVAL; + } /* Performs the trigger */ return subd->trigger(subd, trignum); @@ -112,6 +126,7 @@ int a4l_fill_insndsc(a4l_cxt_t * cxt, a4l_kinsn_t * dsc, void *arg) goto out_insndsc; if (dsc->data_size != 0 && dsc->data == NULL) { + __a4l_err("a4l_fill_insndsc: no data pointer specified\n"); ret = -EINVAL; goto out_insndsc; } @@ -197,8 +212,7 @@ int a4l_do_insn(a4l_cxt_t * cxt, a4l_kinsn_t * dsc) subd = dev->transfer.subds[dsc->idx_subd]; /* Checks the subdevice's characteristics */ - if (((subd->flags & A4L_SUBD_UNUSED) != 0) || - ((subd->flags & A4L_SUBD_CMD) == 0)) { + if ((subd->flags & A4L_SUBD_UNUSED) != 0) { __a4l_err("a4l_do_insn: wrong subdevice selected\n"); return -EINVAL; } @@ -291,8 +305,10 @@ int a4l_fill_ilstdsc(a4l_cxt_t * cxt, a4l_kilst_t * dsc, void *arg) return ret; /* Some basic checking */ - if (dsc->count == 0) + if (dsc->count == 0) { + __a4l_err("a4l_fill_ilstdsc: instruction list's count is 0\n"); return -EINVAL; + } /* Keeps the user pointer in an opaque field */ dsc->__uinsns = dsc->insns; ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: fix mistakes in license declarations
Module: xenomai-abe Branch: analogy Commit: 4048c79977abb0398cea0d8b15f1164aa92179e4 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=4048c79977abb0398cea0d8b15f1164aa92179e4 Author: Alexis Berlemont Date: Mon Nov 23 00:16:57 2009 +0100 analogy: fix mistakes in license declarations --- ksrc/drivers/analogy/intel/8255.c| 23 +++ ksrc/drivers/analogy/intel/parport.c | 22 +++--- 2 files changed, 22 insertions(+), 23 deletions(-) diff --git a/ksrc/drivers/analogy/intel/8255.c b/ksrc/drivers/analogy/intel/8255.c index a5602c1..cf369bb 100644 --- a/ksrc/drivers/analogy/intel/8255.c +++ b/ksrc/drivers/analogy/intel/8255.c @@ -3,22 +3,21 @@ * Analogy subdevice driver for 8255 chip * @note Copyright (C) 1999 David A. Schleef * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * This code is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published + * by the Free Software Foundation; either version 2 of the License, + * or (at your option) any later version. * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of + * This code is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Xenomai; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - #include #include #include diff --git a/ksrc/drivers/analogy/intel/parport.c b/ksrc/drivers/analogy/intel/parport.c index 735656c..72b25c5 100644 --- a/ksrc/drivers/analogy/intel/parport.c +++ b/ksrc/drivers/analogy/intel/parport.c @@ -3,19 +3,19 @@ * Analogy driver for standard parallel port * @note Copyright (C) 1998,2001 David A. Schleef * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * This code is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published + * by the Free Software Foundation; either version 2 of the License, + * or (at your option) any later version. * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of + * This code is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Xenomai; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: add error codes descriptions for descriptor routines
Module: xenomai-abe Branch: analogy Commit: f3cdb76ca37517c3c14c2464e98a5c994dde739d URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=f3cdb76ca37517c3c14c2464e98a5c994dde739d Author: Alexis Berlemont Date: Sun Nov 22 16:42:37 2009 +0100 analogy: add error codes descriptions for descriptor routines --- src/drvlib/analogy/async.c |4 +- src/drvlib/analogy/descriptor.c | 56 ++ 2 files changed, 46 insertions(+), 14 deletions(-) diff --git a/src/drvlib/analogy/async.c b/src/drvlib/analogy/async.c index d83b032..f342af3 100644 --- a/src/drvlib/analogy/async.c +++ b/src/drvlib/analogy/async.c @@ -208,9 +208,9 @@ int a4l_get_bufsize(a4l_desc_t * dsc, * * @return 0 on success. Otherwise: * - * - -EINVAL is returned if some argument is missing or wrong, the + * - -EINVAL is returned if some argument is missing or wrong; the *descriptor and the new pointer should be checked; check also the - *kernel log + *kernel log ("dmesg") * - -EFAULT is returned if a user <-> kernel transfer went wrong * */ diff --git a/src/drvlib/analogy/descriptor.c b/src/drvlib/analogy/descriptor.c index dcfd6a3..a85d878 100644 --- a/src/drvlib/analogy/descriptor.c +++ b/src/drvlib/analogy/descriptor.c @@ -110,14 +110,12 @@ static int __a4l_get_sbsize(int fd, a4l_desc_t * dsc) if ((ret = a4l_sys_nbchaninfo(fd, i, &nb_chan)) < 0) return ret; - res += - nb_chan * (sizeof(a4l_chinfo_t) + sizeof(a4l_leaf_t)); + res += nb_chan * (sizeof(a4l_chinfo_t) + sizeof(a4l_leaf_t)); for (j = 0; j < nb_chan; j++) { if ((ret = a4l_sys_nbrnginfo(fd, i, j, &nb_rng)) < 0) return ret; - res += - nb_rng * (sizeof(a4l_rnginfo_t) + - sizeof(a4l_leaf_t)); + res += nb_rng * (sizeof(a4l_rnginfo_t) + +sizeof(a4l_leaf_t)); } } @@ -218,9 +216,15 @@ static int __a4l_fill_desc(int fd, a4l_desc_t * dsc) * is filled with characteristics about the subdevices, the channels * and the ranges. * - * @return 0 on success, otherwise negative error code. + * @return 0 on success. Otherwise: + * + * - -EINVAL is returned if some argument is missing or wrong; the + *pass argument should be checked; check also the kernel log + *("dmesg") + * - -EFAULT is returned if a user <-> kernel transfer went wrong * */ + int a4l_sys_desc(int fd, a4l_desc_t * dsc, int pass) { int ret = 0; @@ -267,7 +271,12 @@ out_a4l_sys_desc: * @param[out] dsc Device descriptor * @param[in] fname Device name * - * @return 0 on success, otherwise negative error code. + * @return 0 on success. Otherwise: + * + * - -EINVAL is returned if some argument is missing or wrong; the + *fname and the dsc pointer should be checked; check also the + *kernel log ("dmesg") + * - -EFAULT is returned if a user <-> kernel transfer went wrong * */ int a4l_open(a4l_desc_t * dsc, const char *fname) @@ -300,7 +309,11 @@ int a4l_open(a4l_desc_t * dsc, const char *fname) * * @param[in] dsc Device descriptor * - * @return 0 on success, otherwise negative error code. + * @return 0 on success. Otherwise: + * + * - -EINVAL is returned if some argument is missing or wrong; the + *the dsc pointer should be checked; check also the kernel log + *("dmesg") * */ int a4l_close(a4l_desc_t * dsc) @@ -318,7 +331,11 @@ int a4l_close(a4l_desc_t * dsc) * * @param[in] dsc Device descriptor partly filled by a4l_open(). * - * @return 0 on success, otherwise negative error code. + * @return 0 on success. Otherwise: + * + * - -EINVAL is returned if some argument is missing or wrong; the + *the dsc pointer should be checked; check also the kernel log + *("dmesg") * */ int a4l_fill_desc(a4l_desc_t * dsc) @@ -342,7 +359,12 @@ int a4l_fill_desc(a4l_desc_t * dsc) * @param[in] subd Subdevice index * @param[out] info Subdevice information structure * - * @return 0 on success, otherwise negative error code. + * @return 0 on success. Otherwise: + * + * - -EINVAL is returned if some argument is missing or wrong; subd + *and the dsc pointer should be checked; check also the kernel log + *("dmesg") + * - -EFAULT is returned if a user <-> kernel transfer went wrong * */ int a4l_get_subdinfo(a4l_desc_t * dsc, @@ -374,7 +396,12 @@ int a4l_get_subdinfo(a4l_desc_t * dsc, * @param[in] chan Channel index * @param[out] info Channel information structure * - * @return 0 on success, otherwise negative error code. + * @return 0 on success. Otherwise: + * + * - -EINVAL is returned if some argument is missing or wrong; subd, + *chan and the dsc pointer should be checked; check also the + *kernel log ("dmesg") + * - -EFAULT is retur
[Xenomai-git] Alexis Berlemont : analogy: add error codes descriptions for range management routines
Module: xenomai-abe Branch: analogy Commit: d474fbd60bcb800fde9360d3ecac94f5c589f996 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=d474fbd60bcb800fde9360d3ecac94f5c589f996 Author: Alexis Berlemont Date: Sun Nov 22 23:53:43 2009 +0100 analogy: add error codes descriptions for range management routines --- src/drvlib/analogy/descriptor.c | 13 +++-- src/drvlib/analogy/range.c | 21 ++--- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/src/drvlib/analogy/descriptor.c b/src/drvlib/analogy/descriptor.c index a85d878..f841657 100644 --- a/src/drvlib/analogy/descriptor.c +++ b/src/drvlib/analogy/descriptor.c @@ -336,6 +336,7 @@ int a4l_close(a4l_desc_t * dsc) * - -EINVAL is returned if some argument is missing or wrong; the *the dsc pointer should be checked; check also the kernel log *("dmesg") + * - -EFAULT is returned if a user <-> kernel transfer went wrong * */ int a4l_fill_desc(a4l_desc_t * dsc) @@ -363,8 +364,8 @@ int a4l_fill_desc(a4l_desc_t * dsc) * * - -EINVAL is returned if some argument is missing or wrong; subd *and the dsc pointer should be checked; check also the kernel log - *("dmesg") - * - -EFAULT is returned if a user <-> kernel transfer went wrong + *("dmesg"); WARNING: a4l_fill_desc() should be called before + *using a4l_get_subdinfo(). * */ int a4l_get_subdinfo(a4l_desc_t * dsc, @@ -400,8 +401,8 @@ int a4l_get_subdinfo(a4l_desc_t * dsc, * * - -EINVAL is returned if some argument is missing or wrong; subd, *chan and the dsc pointer should be checked; check also the - *kernel log ("dmesg") - * - -EFAULT is returned if a user <-> kernel transfer went wrong + *kernel log ("dmesg"); WARNING: a4l_fill_desc() should be called + *before using a4l_get_chinfo() * */ int a4l_get_chinfo(a4l_desc_t * dsc, @@ -444,8 +445,8 @@ int a4l_get_chinfo(a4l_desc_t * dsc, * * - -EINVAL is returned if some argument is missing or wrong; subd, *chan, rng and the dsc pointer should be checked; check also the - *kernel log ("dmesg") - * - -EFAULT is returned if a user <-> kernel transfer went wrong + *kernel log ("dmesg"); WARNING: a4l_fill_desc() should be called + *before using a4l_get_rnginfo() * */ int a4l_get_rnginfo(a4l_desc_t * dsc, diff --git a/src/drvlib/analogy/range.c b/src/drvlib/analogy/range.c index e12242c..ab41f1e 100644 --- a/src/drvlib/analogy/range.c +++ b/src/drvlib/analogy/range.c @@ -78,7 +78,12 @@ void data8_set(void *dst, lsampl_t val) * @param[in] max Maximal limit value * @param[out] rng Found range * - * @return 0 on success, otherwise a negative error code. + * @return 0 on success. Otherwise: + * + * - -EINVAL is returned if some argument is missing or wrong; + *idx_subd, idx_chan and the dsc pointer should be checked; check + *also the kernel log ("dmesg"); WARNING: a4l_fill_desc() should + *be called before using a4l_find_range() * */ int a4l_find_range(a4l_desc_t * dsc, @@ -147,7 +152,12 @@ out_get_range: * @param[in] cnt Count of conversion to perform * * @return the count of conversion performed, otherwise a negative - * error code. + * error code: + * + * - -EINVAL is returned if some argument is missing or wrong; + *chan, rng and the pointers should be checked; check also the + *kernel log ("dmesg"); WARNING: a4l_fill_desc() should be called + *before using a4l_to_phys() * */ int a4l_to_phys(a4l_chinfo_t * chan, @@ -213,7 +223,12 @@ int a4l_to_phys(a4l_chinfo_t * chan, * @param[in] cnt Count of conversion to perform * * @return the count of conversion performed, otherwise a negative - * error code. + * error code: + * + * - -EINVAL is returned if some argument is missing or wrong; + *chan, rng and the pointers should be checked; check also the + *kernel log ("dmesg"); WARNING: a4l_fill_desc() should be called + *before using a4l_from_phys() * */ int a4l_from_phys(a4l_chinfo_t * chan, ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: add error codes descriptions for synchronous operations
Module: xenomai-head Branch: master Commit: 4bf0866cb93ddb3a61ffac2e9baa2b5260543d67 URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=4bf0866cb93ddb3a61ffac2e9baa2b5260543d67 Author: Alexis Berlemont Date: Sat Nov 21 23:50:07 2009 +0100 analogy: add error codes descriptions for synchronous operations --- src/drvlib/analogy/sync.c | 28 1 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/drvlib/analogy/sync.c b/src/drvlib/analogy/sync.c index 51d2d9b..55d56d3 100644 --- a/src/drvlib/analogy/sync.c +++ b/src/drvlib/analogy/sync.c @@ -49,7 +49,12 @@ * optionally a4l_fill_desc()) * @param[in] arg Instructions list structure * - * @return 0 on success, otherwise a negative error code. + * @return 0 on success. Otherwise: + * + * - -EINVAL is returned if some argument is missing or wrong (Please, + *type "dmesg" for more info) + * - -EFAULT is returned if a user <-> kernel transfer went wrong + * - -ENOMEM is returned if the system is out of memory * */ int a4l_snd_insnlist(a4l_desc_t * dsc, a4l_insnlst_t * arg) @@ -70,7 +75,12 @@ int a4l_snd_insnlist(a4l_desc_t * dsc, a4l_insnlst_t * arg) * optionally a4l_fill_desc()) * @param[in] arg Instruction structure * - * @return 0 on success, otherwise a negative error code. + * @return 0 on success. Otherwise: + * + * - -EINVAL is returned if some argument is missing or wrong (Please, + *type "dmesg" for more info) + * - -EFAULT is returned if a user <-> kernel transfer went wrong + * - -ENOMEM is returned if the system is out of memory * */ int a4l_snd_insn(a4l_desc_t * dsc, a4l_insn_t * arg) @@ -111,7 +121,12 @@ int a4l_snd_insn(a4l_desc_t * dsc, a4l_insn_t * arg) * @param[in] buf Output buffer * @param[in] nbyte Number of bytes to write * - * @return 0 on success, otherwise a negative error code. + * @return 0 on success. Otherwise: + * + * - -EINVAL is returned if some argument is missing or wrong (Please, + *type "dmesg" for more info) + * - -EFAULT is returned if a user <-> kernel transfer went wrong + * - -ENOMEM is returned if the system is out of memory * */ int a4l_sync_write(a4l_desc_t * dsc, @@ -179,7 +194,12 @@ int a4l_sync_write(a4l_desc_t * dsc, * @param[in] buf Input buffer * @param[in] nbyte Number of bytes to read * - * @return 0 on success, otherwise a negative error code. + * @return 0 on success. Otherwise: + * + * - -EINVAL is returned if some argument is missing or wrong (Please, + *type "dmesg" for more info) + * - -EFAULT is returned if a user <-> kernel transfer went wrong + * - -ENOMEM is returned if the system is out of memory * */ int a4l_sync_read(a4l_desc_t * dsc, ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: add error codes descriptions for descriptor routines
Module: xenomai-head Branch: master Commit: f3cdb76ca37517c3c14c2464e98a5c994dde739d URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=f3cdb76ca37517c3c14c2464e98a5c994dde739d Author: Alexis Berlemont Date: Sun Nov 22 16:42:37 2009 +0100 analogy: add error codes descriptions for descriptor routines --- src/drvlib/analogy/async.c |4 +- src/drvlib/analogy/descriptor.c | 56 ++ 2 files changed, 46 insertions(+), 14 deletions(-) diff --git a/src/drvlib/analogy/async.c b/src/drvlib/analogy/async.c index d83b032..f342af3 100644 --- a/src/drvlib/analogy/async.c +++ b/src/drvlib/analogy/async.c @@ -208,9 +208,9 @@ int a4l_get_bufsize(a4l_desc_t * dsc, * * @return 0 on success. Otherwise: * - * - -EINVAL is returned if some argument is missing or wrong, the + * - -EINVAL is returned if some argument is missing or wrong; the *descriptor and the new pointer should be checked; check also the - *kernel log + *kernel log ("dmesg") * - -EFAULT is returned if a user <-> kernel transfer went wrong * */ diff --git a/src/drvlib/analogy/descriptor.c b/src/drvlib/analogy/descriptor.c index dcfd6a3..a85d878 100644 --- a/src/drvlib/analogy/descriptor.c +++ b/src/drvlib/analogy/descriptor.c @@ -110,14 +110,12 @@ static int __a4l_get_sbsize(int fd, a4l_desc_t * dsc) if ((ret = a4l_sys_nbchaninfo(fd, i, &nb_chan)) < 0) return ret; - res += - nb_chan * (sizeof(a4l_chinfo_t) + sizeof(a4l_leaf_t)); + res += nb_chan * (sizeof(a4l_chinfo_t) + sizeof(a4l_leaf_t)); for (j = 0; j < nb_chan; j++) { if ((ret = a4l_sys_nbrnginfo(fd, i, j, &nb_rng)) < 0) return ret; - res += - nb_rng * (sizeof(a4l_rnginfo_t) + - sizeof(a4l_leaf_t)); + res += nb_rng * (sizeof(a4l_rnginfo_t) + +sizeof(a4l_leaf_t)); } } @@ -218,9 +216,15 @@ static int __a4l_fill_desc(int fd, a4l_desc_t * dsc) * is filled with characteristics about the subdevices, the channels * and the ranges. * - * @return 0 on success, otherwise negative error code. + * @return 0 on success. Otherwise: + * + * - -EINVAL is returned if some argument is missing or wrong; the + *pass argument should be checked; check also the kernel log + *("dmesg") + * - -EFAULT is returned if a user <-> kernel transfer went wrong * */ + int a4l_sys_desc(int fd, a4l_desc_t * dsc, int pass) { int ret = 0; @@ -267,7 +271,12 @@ out_a4l_sys_desc: * @param[out] dsc Device descriptor * @param[in] fname Device name * - * @return 0 on success, otherwise negative error code. + * @return 0 on success. Otherwise: + * + * - -EINVAL is returned if some argument is missing or wrong; the + *fname and the dsc pointer should be checked; check also the + *kernel log ("dmesg") + * - -EFAULT is returned if a user <-> kernel transfer went wrong * */ int a4l_open(a4l_desc_t * dsc, const char *fname) @@ -300,7 +309,11 @@ int a4l_open(a4l_desc_t * dsc, const char *fname) * * @param[in] dsc Device descriptor * - * @return 0 on success, otherwise negative error code. + * @return 0 on success. Otherwise: + * + * - -EINVAL is returned if some argument is missing or wrong; the + *the dsc pointer should be checked; check also the kernel log + *("dmesg") * */ int a4l_close(a4l_desc_t * dsc) @@ -318,7 +331,11 @@ int a4l_close(a4l_desc_t * dsc) * * @param[in] dsc Device descriptor partly filled by a4l_open(). * - * @return 0 on success, otherwise negative error code. + * @return 0 on success. Otherwise: + * + * - -EINVAL is returned if some argument is missing or wrong; the + *the dsc pointer should be checked; check also the kernel log + *("dmesg") * */ int a4l_fill_desc(a4l_desc_t * dsc) @@ -342,7 +359,12 @@ int a4l_fill_desc(a4l_desc_t * dsc) * @param[in] subd Subdevice index * @param[out] info Subdevice information structure * - * @return 0 on success, otherwise negative error code. + * @return 0 on success. Otherwise: + * + * - -EINVAL is returned if some argument is missing or wrong; subd + *and the dsc pointer should be checked; check also the kernel log + *("dmesg") + * - -EFAULT is returned if a user <-> kernel transfer went wrong * */ int a4l_get_subdinfo(a4l_desc_t * dsc, @@ -374,7 +396,12 @@ int a4l_get_subdinfo(a4l_desc_t * dsc, * @param[in] chan Channel index * @param[out] info Channel information structure * - * @return 0 on success, otherwise negative error code. + * @return 0 on success. Otherwise: + * + * - -EINVAL is returned if some argument is missing or wrong; subd, + *chan and the dsc pointer should be checked; check also the + *kernel log ("dmesg") + * - -EFAULT is retu
[Xenomai-git] Alexis Berlemont : analogy: fix mistakes in license declarations
Module: xenomai-head Branch: master Commit: 4048c79977abb0398cea0d8b15f1164aa92179e4 URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=4048c79977abb0398cea0d8b15f1164aa92179e4 Author: Alexis Berlemont Date: Mon Nov 23 00:16:57 2009 +0100 analogy: fix mistakes in license declarations --- ksrc/drivers/analogy/intel/8255.c| 23 +++ ksrc/drivers/analogy/intel/parport.c | 22 +++--- 2 files changed, 22 insertions(+), 23 deletions(-) diff --git a/ksrc/drivers/analogy/intel/8255.c b/ksrc/drivers/analogy/intel/8255.c index a5602c1..cf369bb 100644 --- a/ksrc/drivers/analogy/intel/8255.c +++ b/ksrc/drivers/analogy/intel/8255.c @@ -3,22 +3,21 @@ * Analogy subdevice driver for 8255 chip * @note Copyright (C) 1999 David A. Schleef * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * This code is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published + * by the Free Software Foundation; either version 2 of the License, + * or (at your option) any later version. * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of + * This code is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Xenomai; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - #include #include #include diff --git a/ksrc/drivers/analogy/intel/parport.c b/ksrc/drivers/analogy/intel/parport.c index 735656c..72b25c5 100644 --- a/ksrc/drivers/analogy/intel/parport.c +++ b/ksrc/drivers/analogy/intel/parport.c @@ -3,19 +3,19 @@ * Analogy driver for standard parallel port * @note Copyright (C) 1998,2001 David A. Schleef * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * This code is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published + * by the Free Software Foundation; either version 2 of the License, + * or (at your option) any later version. * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of + * This code is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Xenomai; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: add error messages in instruction handling
Module: xenomai-head Branch: master Commit: 76456b88f8fe8cf9885996f2c042df7d4b266df0 URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=76456b88f8fe8cf9885996f2c042df7d4b266df0 Author: Alexis Berlemont Date: Sat Nov 21 23:49:00 2009 +0100 analogy: add error messages in instruction handling --- ksrc/drivers/analogy/instruction.c | 34 +- 1 files changed, 25 insertions(+), 9 deletions(-) diff --git a/ksrc/drivers/analogy/instruction.c b/ksrc/drivers/analogy/instruction.c index 3bd92d9..ecd28be 100644 --- a/ksrc/drivers/analogy/instruction.c +++ b/ksrc/drivers/analogy/instruction.c @@ -39,8 +39,10 @@ int a4l_do_insn_gettime(a4l_kinsn_t * dsc) unsigned long ns2; /* Basic checkings */ - if (dsc->data_size != 2) + if (dsc->data_size != 2) { + __a4l_err("a4l_do_insn_gettime: data size should be 2\n"); return -EINVAL; + } ns = a4l_get_time(); @@ -56,11 +58,15 @@ int a4l_do_insn_wait(a4l_kinsn_t * dsc) unsigned int us; /* Basic checkings */ - if (dsc->data_size != 1) + if (dsc->data_size != 1) { + __a4l_err("a4l_do_insn_wait: data size should be 1\n"); return -EINVAL; + } - if (dsc->data[0] > A4L_INSN_WAIT_MAX) + if (dsc->data[0] > A4L_INSN_WAIT_MAX) { + __a4l_err("a4l_do_insn_wait: wait duration is out of range\n"); return -EINVAL; + } /* As we use (a4l_)udelay, we have to convert the delay into microseconds */ @@ -83,19 +89,27 @@ int a4l_do_insn_trig(a4l_cxt_t * cxt, a4l_kinsn_t * dsc) lsampl_t trignum; /* Basic checkings */ - if (dsc->data_size > 1) + if (dsc->data_size > 1) { + __a4l_err("a4l_do_insn_trig: data size should not be > 1\n"); return -EINVAL; + } trignum = (dsc->data_size == 1) ? dsc->data[0] : 0; - if (dsc->idx_subd >= dev->transfer.nb_subd) + if (dsc->idx_subd >= dev->transfer.nb_subd) { + __a4l_err("a4l_do_insn_trig: " + "subdevice index is out of range\n"); return -EINVAL; + } subd = dev->transfer.subds[dsc->idx_subd]; /* Checks that the concerned subdevice is trigger-compliant */ - if ((subd->flags & A4L_SUBD_CMD) == 0 || subd->trigger == NULL) + if ((subd->flags & A4L_SUBD_CMD) == 0 || subd->trigger == NULL) { + __a4l_err("a4l_do_insn_trig: subdevice does not support " + "triggering or asynchronous acquisition\n"); return -EINVAL; + } /* Performs the trigger */ return subd->trigger(subd, trignum); @@ -112,6 +126,7 @@ int a4l_fill_insndsc(a4l_cxt_t * cxt, a4l_kinsn_t * dsc, void *arg) goto out_insndsc; if (dsc->data_size != 0 && dsc->data == NULL) { + __a4l_err("a4l_fill_insndsc: no data pointer specified\n"); ret = -EINVAL; goto out_insndsc; } @@ -197,8 +212,7 @@ int a4l_do_insn(a4l_cxt_t * cxt, a4l_kinsn_t * dsc) subd = dev->transfer.subds[dsc->idx_subd]; /* Checks the subdevice's characteristics */ - if (((subd->flags & A4L_SUBD_UNUSED) != 0) || - ((subd->flags & A4L_SUBD_CMD) == 0)) { + if ((subd->flags & A4L_SUBD_UNUSED) != 0) { __a4l_err("a4l_do_insn: wrong subdevice selected\n"); return -EINVAL; } @@ -291,8 +305,10 @@ int a4l_fill_ilstdsc(a4l_cxt_t * cxt, a4l_kilst_t * dsc, void *arg) return ret; /* Some basic checking */ - if (dsc->count == 0) + if (dsc->count == 0) { + __a4l_err("a4l_fill_ilstdsc: instruction list's count is 0\n"); return -EINVAL; + } /* Keeps the user pointer in an opaque field */ dsc->__uinsns = dsc->insns; ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : analogy: add error codes descriptions for range management routines
Module: xenomai-head Branch: master Commit: d474fbd60bcb800fde9360d3ecac94f5c589f996 URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=d474fbd60bcb800fde9360d3ecac94f5c589f996 Author: Alexis Berlemont Date: Sun Nov 22 23:53:43 2009 +0100 analogy: add error codes descriptions for range management routines --- src/drvlib/analogy/descriptor.c | 13 +++-- src/drvlib/analogy/range.c | 21 ++--- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/src/drvlib/analogy/descriptor.c b/src/drvlib/analogy/descriptor.c index a85d878..f841657 100644 --- a/src/drvlib/analogy/descriptor.c +++ b/src/drvlib/analogy/descriptor.c @@ -336,6 +336,7 @@ int a4l_close(a4l_desc_t * dsc) * - -EINVAL is returned if some argument is missing or wrong; the *the dsc pointer should be checked; check also the kernel log *("dmesg") + * - -EFAULT is returned if a user <-> kernel transfer went wrong * */ int a4l_fill_desc(a4l_desc_t * dsc) @@ -363,8 +364,8 @@ int a4l_fill_desc(a4l_desc_t * dsc) * * - -EINVAL is returned if some argument is missing or wrong; subd *and the dsc pointer should be checked; check also the kernel log - *("dmesg") - * - -EFAULT is returned if a user <-> kernel transfer went wrong + *("dmesg"); WARNING: a4l_fill_desc() should be called before + *using a4l_get_subdinfo(). * */ int a4l_get_subdinfo(a4l_desc_t * dsc, @@ -400,8 +401,8 @@ int a4l_get_subdinfo(a4l_desc_t * dsc, * * - -EINVAL is returned if some argument is missing or wrong; subd, *chan and the dsc pointer should be checked; check also the - *kernel log ("dmesg") - * - -EFAULT is returned if a user <-> kernel transfer went wrong + *kernel log ("dmesg"); WARNING: a4l_fill_desc() should be called + *before using a4l_get_chinfo() * */ int a4l_get_chinfo(a4l_desc_t * dsc, @@ -444,8 +445,8 @@ int a4l_get_chinfo(a4l_desc_t * dsc, * * - -EINVAL is returned if some argument is missing or wrong; subd, *chan, rng and the dsc pointer should be checked; check also the - *kernel log ("dmesg") - * - -EFAULT is returned if a user <-> kernel transfer went wrong + *kernel log ("dmesg"); WARNING: a4l_fill_desc() should be called + *before using a4l_get_rnginfo() * */ int a4l_get_rnginfo(a4l_desc_t * dsc, diff --git a/src/drvlib/analogy/range.c b/src/drvlib/analogy/range.c index e12242c..ab41f1e 100644 --- a/src/drvlib/analogy/range.c +++ b/src/drvlib/analogy/range.c @@ -78,7 +78,12 @@ void data8_set(void *dst, lsampl_t val) * @param[in] max Maximal limit value * @param[out] rng Found range * - * @return 0 on success, otherwise a negative error code. + * @return 0 on success. Otherwise: + * + * - -EINVAL is returned if some argument is missing or wrong; + *idx_subd, idx_chan and the dsc pointer should be checked; check + *also the kernel log ("dmesg"); WARNING: a4l_fill_desc() should + *be called before using a4l_find_range() * */ int a4l_find_range(a4l_desc_t * dsc, @@ -147,7 +152,12 @@ out_get_range: * @param[in] cnt Count of conversion to perform * * @return the count of conversion performed, otherwise a negative - * error code. + * error code: + * + * - -EINVAL is returned if some argument is missing or wrong; + *chan, rng and the pointers should be checked; check also the + *kernel log ("dmesg"); WARNING: a4l_fill_desc() should be called + *before using a4l_to_phys() * */ int a4l_to_phys(a4l_chinfo_t * chan, @@ -213,7 +223,12 @@ int a4l_to_phys(a4l_chinfo_t * chan, * @param[in] cnt Count of conversion to perform * * @return the count of conversion performed, otherwise a negative - * error code. + * error code: + * + * - -EINVAL is returned if some argument is missing or wrong; + *chan, rng and the pointers should be checked; check also the + *kernel log ("dmesg"); WARNING: a4l_fill_desc() should be called + *before using a4l_from_phys() * */ int a4l_from_phys(a4l_chinfo_t * chan, ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Gilles Chanteperdrix : skins: add per-skin signal handler, and dispatch function.
Module: xenomai-gch Branch: for-head Commit: 3d2494278dde2a7c81487786955688f0bbccd89e URL: http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=3d2494278dde2a7c81487786955688f0bbccd89e Author: Gilles Chanteperdrix Date: Sun Nov 22 23:07:21 2009 +0100 skins: add per-skin signal handler, and dispatch function. --- include/asm-generic/bits/bind.h | 10 +++--- include/asm-generic/syscall.h | 24 ++-- src/skins/common/bind.c | 20 +++- src/skins/native/init.c |2 +- src/skins/posix/init.c |3 +-- src/skins/psos+/init.c |3 ++- src/skins/rtai/init.c |3 ++- src/skins/rtdm/init.c |3 ++- src/skins/uitron/init.c |3 ++- src/skins/vrtx/init.c |2 +- src/skins/vxworks/init.c|2 +- 11 files changed, 60 insertions(+), 15 deletions(-) diff --git a/include/asm-generic/bits/bind.h b/include/asm-generic/bits/bind.h index 7da2c43..83b2c7e 100644 --- a/include/asm-generic/bits/bind.h +++ b/include/asm-generic/bits/bind.h @@ -5,15 +5,19 @@ #include #include +typedef void xnsighandler(union xnsiginfo *si); + void xeno_handle_mlock_alert(int sig); int -xeno_bind_skin_opt(unsigned skin_magic, const char *skin, const char *module); +xeno_bind_skin_opt(unsigned skin_magic, const char *skin, + const char *module, xnsighandler *sighandler); static inline int -xeno_bind_skin(unsigned skin_magic, const char *skin, const char *module) +xeno_bind_skin(unsigned skin_magic, const char *skin, + const char *module, xnsighandler *sighandler) { - int muxid = xeno_bind_skin_opt(skin_magic, skin, module); + int muxid = xeno_bind_skin_opt(skin_magic, skin, module, sighandler); struct sigaction sa; if (muxid == -1) { diff --git a/include/asm-generic/syscall.h b/include/asm-generic/syscall.h index 09c9128..5a9f0a1 100644 --- a/include/asm-generic/syscall.h +++ b/include/asm-generic/syscall.h @@ -51,12 +51,16 @@ typedef struct xnsysinfo { #define sigshadow_arg(code) (((code) >> 8) & 0xff) #define sigshadow_int(action, arg) ((action) | ((arg) << 8)) + +struct xnsig; + #ifdef __KERNEL__ -#include #include #include #include +#include +#include struct task_struct; struct pt_regs; @@ -138,11 +142,27 @@ static inline int __xn_safe_strncpy_from_user(char *dst, #else /* !__KERNEL__ */ #include -#endif /* __KERNEL__ */ +#include + +void xnsig_dispatch(struct xnsig *sigs); +#endif /* !__KERNEL__ */ typedef struct xncompletion { long syncflag; /* Semaphore variable. */ pid_t pid; /* Single waiter ID. */ } xncompletion_t; +union xnsiginfo { + struct siginfo pse51_si; +}; + +struct xnsig { + unsigned nsigs; + unsigned remaining; + struct { + unsigned skin; + union xnsiginfo si; + } pending[16]; +}; + #endif /* !_XENO_ASM_GENERIC_SYSCALL_H */ diff --git a/src/skins/common/bind.c b/src/skins/common/bind.c index e8bb454..6956d9a 100644 --- a/src/skins/common/bind.c +++ b/src/skins/common/bind.c @@ -8,6 +8,8 @@ #include #include "sem_heap.h" +static xnsighandler *xnsig_handlers[32]; + void __attribute__((weak)) xeno_sigill_handler(int sig) { fprintf(stderr, "Xenomai or CONFIG_XENO_OPT_PERVASIVE disabled.\n" @@ -17,8 +19,22 @@ void __attribute__((weak)) xeno_sigill_handler(int sig) struct xnfeatinfo xeno_featinfo; +void xnsig_dispatch(struct xnsig *sigs) +{ + unsigned i; + + for (i = 0; i < sigs->nsigs; i++) { + xnsighandler *handler; + + handler = xnsig_handlers[sigs->pending[i].skin]; + if (handler) + handler(&sigs->pending[i].si); + } +} + int -xeno_bind_skin_opt(unsigned skin_magic, const char *skin, const char *module) +xeno_bind_skin_opt(unsigned skin_magic, const char *skin, + const char *module, xnsighandler *handler) { sighandler_t old_sigill_handler; xnfeatinfo_t finfo; @@ -63,6 +79,8 @@ xeno_bind_skin_opt(unsigned skin_magic, const char *skin, const char *module) exit(EXIT_FAILURE); } + xnsig_handlers[muxid] = handler; + #ifdef xeno_arch_features_check xeno_arch_features_check(); #endif /* xeno_arch_features_check */ diff --git a/src/skins/native/init.c b/src/skins/native/init.c index 215acc1..197f3ce 100644 --- a/src/skins/native/init.c +++ b/src/skins/native/init.c @@ -55,7 +55,7 @@ static __attribute__ ((constructor)) void __init_xeno_interface(void) { __native_muxid = - xeno_bind_skin(XENO_SKIN_MAGIC, "native", "xeno_native"); + xeno_bind_skin(XENO_SKIN_MAGIC, "native", "xeno_native", NULL); native_timer_init(__native_muxid); diff --git a/src/skins/posix/init.c b/src/skins/posix/init.c index 415997f..6028dd9 100644 --- a/src/skins/p
[Xenomai-git] Gilles Chanteperdrix : Replace the function definitions in bind. h with a convenience library.
Module: xenomai-gch Branch: for-head Commit: e459f88b66539d37cebb2381dd7a034eb447ec0a URL: http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=e459f88b66539d37cebb2381dd7a034eb447ec0a Author: Gilles Chanteperdrix Date: Sun Nov 15 19:21:43 2009 +0100 Replace the function definitions in bind.h with a convenience library. --- configure.in|4 + include/asm-generic/bits/bind.h | 301 +--- src/skins/Makefile.am |2 +- src/skins/common/Makefile.am| 12 + src/skins/common/Makefile.in| 495 +++ src/skins/common/bind.c | 75 ++ src/skins/common/current.c | 74 ++ src/skins/common/sem_heap.c | 87 +++ src/skins/common/sem_heap.h | 12 + 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 + 17 files changed, 782 insertions(+), 296 deletions(-) diff --git a/configure.in b/configure.in index 9cce885..d0d9a1c 100644 --- a/configure.in +++ b/configure.in @@ -620,6 +620,8 @@ dnl test x$CONFIG_XENO_X86_SEP = xy && AC_DEFINE(CONFIG_XENO_X86_SEP,1,[config]) test x$CONFIG_SMP = xy && AC_DEFINE(CONFIG_SMP,1,[config]) test x$CONFIG_XENO_FASTSYNCH = xy && AC_DEFINE(CONFIG_XENO_FASTSYNCH,1,[config]) +AM_CONDITIONAL(CONFIG_XENO_FASTSYNCH,[test "$CONFIG_XENO_FASTSYNCH" = y]) + test x$CONFIG_X86_TSC = xy && AC_DEFINE(CONFIG_X86_TSC,1,[config]) test -n "$CONFIG_XENO_ARM_ARCH" && AC_DEFINE_UNQUOTED(CONFIG_XENO_ARM_ARCH,$CONFIG_XENO_ARM_ARCH,[config]) @@ -628,6 +630,7 @@ test x$CONFIG_XENO_CPU_XSC3 = xy && AC_DEFINE(CONFIG_XENO_CPU_XSC3,1,[config]) test $XNARCH_ARM_TSC_TYPE && AC_DEFINE_UNQUOTED(XNARCH_ARM_TSC_TYPE,$XNARCH_ARM_TSC_TYPE,[config]) test x$CONFIG_XENO_ARM_EABI = xy && AC_DEFINE(CONFIG_XENO_ARM_EABI,1,[config]) + # Default sampling period (ns) used in various tests AC_DEFINE_UNQUOTED(CONFIG_XENO_DEFAULT_PERIOD,$CONFIG_XENO_DEFAULT_PERIOD,[config]) @@ -889,6 +892,7 @@ AC_CONFIG_FILES([ \ src/Makefile \ src/rtdk/Makefile \ src/skins/Makefile \ + src/skins/common/Makefile \ src/skins/posix/Makefile \ src/skins/native/Makefile \ src/skins/vxworks/Makefile \ diff --git a/include/asm-generic/bits/bind.h b/include/asm-generic/bits/bind.h index 3684b21..7da2c43 100644 --- a/include/asm-generic/bits/bind.h +++ b/include/asm-generic/bits/bind.h @@ -3,320 +3,31 @@ #include #include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include - -#ifdef HAVE___THREAD -__thread __attribute__ ((tls_model ("initial-exec"), weak)) -xnhandle_t xeno_current = XN_NO_HANDLE; -__thread __attribute__ ((tls_model ("initial-exec"), weak)) -unsigned long xeno_current_mode; - -static inline void __xeno_set_current(xnhandle_t current) -{ - xeno_current = current; -} -#else /* !HAVE___THREAD */ -pthread_once_t xeno_init_current_keys_once __attribute__((weak)); -pthread_key_t xeno_current_key __attribute__ ((weak)); -pthread_key_t xeno_current_mode_key __attribute__ ((weak)); - -static inline void __xeno_set_current(xnhandle_t current) -{ - pthread_setspecific(xeno_current_key, (void *)current); -} - -__attribute__ ((weak)) -unsigned long *xeno_init_current_mode(void) -{ - unsigned long *mode = malloc(sizeof(unsigned long)); - pthread_setspecific(xeno_current_mode_key, mode); - return mode; -} - -static void cleanup_current_mode(void *ptr) -{ - free(ptr); -} - -static void __init_current_keys(void) -{ - int err = pthread_key_create(&xeno_current_key, NULL); - if (err) - goto error_exit; - - err = pthread_key_create(&xeno_current_mode_key, cleanup_current_mode); - if (err) { - error_exit: - fprintf(stderr, "Xenomai: error creating TSD key: %s\n", - strerror(-err)); - exit(1); - } -} - -static __attribute__((constructor)) -void init_current_keys(void) -{ - pthread_once(&xeno_init_current_keys_once, __init_current_keys); -} -#endif /* !HAVE___THREAD */ - -__attribute__ ((weak)) -void xeno_set_current(void) -{ - xnhandle_t current; - int err; - - err = XENOMAI_SYSCALL1(__xn_sys_current, ¤t); - if (err) { - fprintf(stderr, "Xenomai: error obtaining handle for current " - "thread: %s\n", strerror(-err)); - exit(1); - } - __xeno_set_current(current); -} - -#ifdef CONFIG_XENO_FASTSYNCH -__attribute__ ((weak)) -unsigned long xeno_sem_heap[2] = { 0, 0 }; -#endif /* CONFIG_XENO_FASTSYNCH */ void xeno_handle_mlock_alert(int sig); -#ifdef CONFIG_XENO_F
[Xenomai-git] Gilles Chanteperdrix : arm: implement signals handling for the arm architecture
Module: xenomai-gch Branch: for-head Commit: 774a2930e2333dc57e461aff3a228bc5068eb6e2 URL: http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=774a2930e2333dc57e461aff3a228bc5068eb6e2 Author: Gilles Chanteperdrix Date: Mon Nov 23 00:36:41 2009 +0100 arm: implement signals handling for the arm architecture --- include/asm-arm/syscall.h | 64 +++-- 1 files changed, 44 insertions(+), 20 deletions(-) diff --git a/include/asm-arm/syscall.h b/include/asm-arm/syscall.h index 2ff4a28..f0daca0 100644 --- a/include/asm-arm/syscall.h +++ b/include/asm-arm/syscall.h @@ -49,6 +49,7 @@ #define __xn_reg_arg3(regs) ((regs)->ARM_r3) #define __xn_reg_arg4(regs) ((regs)->ARM_r4) #define __xn_reg_arg5(regs) ((regs)->ARM_r5) +#define __xn_reg_arg6(regs) ((regs)->ARM_r6) /* In OABI_COMPAT mode, handle both OABI and EABI userspace syscalls */ #ifdef CONFIG_OABI_COMPAT @@ -86,6 +87,8 @@ static inline int __xn_interrupted_p(struct pt_regs *regs) #else /* !__KERNEL__ */ +#include /* For -ERESTART */ + /* * Some of the following macros have been adapted from Linux's * implementation of the syscall mechanism in : @@ -99,32 +102,33 @@ static inline int __xn_interrupted_p(struct pt_regs *regs) #error __thread is too buggy with gcc 4.3 and later, please do not pass --with-__thread to configure #endif -#define LOADARGS_0(muxcode, dummy...) \ - __a0 = (unsigned long) (muxcode) -#define LOADARGS_1(muxcode, arg1) \ - LOADARGS_0(muxcode);\ +#define LOADARGS_0(muxcode, arg6, dummy...)\ + __a0 = (unsigned long) (muxcode); \ + __a6 = (unsigned long) (arg6) +#define LOADARGS_1(muxcode, arg6, arg1)\ + LOADARGS_0(muxcode, arg6); \ __a1 = (unsigned long) (arg1) -#define LOADARGS_2(muxcode, arg1, arg2)\ - LOADARGS_1(muxcode, arg1); \ +#define LOADARGS_2(muxcode, arg6, arg1, arg2) \ + LOADARGS_1(muxcode, arg6, arg1);\ __a2 = (unsigned long) (arg2) -#define LOADARGS_3(muxcode, arg1, arg2, arg3) \ - LOADARGS_2(muxcode, arg1, arg2);\ +#define LOADARGS_3(muxcode, arg6, arg1, arg2, arg3)\ + LOADARGS_2(muxcode, arg6, arg1, arg2); \ __a3 = (unsigned long) (arg3) -#define LOADARGS_4(muxcode, arg1, arg2, arg3, arg4)\ - LOADARGS_3(muxcode, arg1, arg2, arg3); \ +#define LOADARGS_4(muxcode, arg6, arg1, arg2, arg3, arg4) \ + LOADARGS_3(muxcode, arg6, arg1, arg2, arg3);\ __a4 = (unsigned long) (arg4) -#define LOADARGS_5(muxcode, arg1, arg2, arg3, arg4, arg5) \ - LOADARGS_4(muxcode, arg1, arg2, arg3, arg4);\ +#define LOADARGS_5(muxcode, arg6, arg1, arg2, arg3, arg4, arg5)\ + LOADARGS_4(muxcode, arg6, arg1, arg2, arg3, arg4); \ __a5 = (unsigned long) (arg5) -#define CLOBBER_REGS_0 "r0" +#define CLOBBER_REGS_0 "r0", "r6" #define CLOBBER_REGS_1 CLOBBER_REGS_0, "r1" #define CLOBBER_REGS_2 CLOBBER_REGS_1, "r2" #define CLOBBER_REGS_3 CLOBBER_REGS_2, "r3" #define CLOBBER_REGS_4 CLOBBER_REGS_3, "r4" #define CLOBBER_REGS_5 CLOBBER_REGS_4, "r5" -#define LOADREGS_0 __r0 = __a0 +#define LOADREGS_0 __r0 = __a0; __r6 = __a6 #define LOADREGS_1 LOADREGS_0; __r1 = __a1 #define LOADREGS_2 LOADREGS_1; __r2 = __a2 #define LOADREGS_3 LOADREGS_2; __r3 = __a3 @@ -132,7 +136,8 @@ static inline int __xn_interrupted_p(struct pt_regs *regs) #define LOADREGS_5 LOADREGS_4; __r5 = __a5 #define ASM_INDECL_0 \ - unsigned long __a0; register unsigned long __r0 __asm__ ("r0") + unsigned long __a0; register unsigned long __r0 __asm__ ("r0"); \ + unsigned long __a6; register unsigned long __r6 __asm__ ("r6") #define ASM_INDECL_1 ASM_INDECL_0; \ unsigned long __a1; register unsigned long __r1 __asm__ ("r1") #define ASM_INDECL_2 ASM_INDECL_1; \ @@ -144,7 +149,7 @@ static inline int __xn_interrupted_p(struct pt_regs *regs) #define ASM_INDECL_5 ASM_INDECL_4; \ unsigned long __a5; register unsigned long __r5 __asm__ ("r5") -#define ASM_INPUT_0 "0" (__r0) +#define ASM_INPUT_0 "0" (__r0), "r" (__r6) #define ASM_INPUT_1 ASM_INPUT_0, "r" (__r1) #define ASM_INPUT_2 ASM_INPUT_1, "r" (__r2) #define ASM_INPUT_3 ASM_INPUT_2, "r" (__r3) @@ -169,7 +174,7 @@ static inline int __xn_interrupted_p(struct pt_regs *regs) #define __xn_syscall "swi\t" __sys1(__NR_OABI_SYSCALL_BASE + XENO_ARM_SYSCALL) "" #endif -#define XENOMAI_DO_SYSCALL(nr, shifted_id, op, args...) \ +#define XENOMAI_DO_SYSCALL_INNER(nr, shifted_id, op, args...) \ ({ \ ASM_INDECL_##nr;
[Xenomai-git] Gilles Chanteperdrix : Regenerate autotools files
Module: xenomai-gch Branch: for-head Commit: b259c67600bea5767a6c89dcab7cac459ae20dd1 URL: http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=b259c67600bea5767a6c89dcab7cac459ae20dd1 Author: Gilles Chanteperdrix Date: Sun Nov 15 19:24:00 2009 +0100 Regenerate autotools files --- Makefile.in| 193 +- aclocal.m4 | 323 +- config/Makefile.in | 43 +- configure | 5868 doc/Makefile.in| 131 +- doc/docbook/Makefile.in| 131 +- doc/docbook/custom-stylesheets/Makefile.in | 131 +- doc/docbook/custom-stylesheets/xsl/Makefile.in | 131 +- .../custom-stylesheets/xsl/common/Makefile.in | 43 +- doc/docbook/custom-stylesheets/xsl/fo/Makefile.in | 43 +- .../custom-stylesheets/xsl/html/Makefile.in| 43 +- doc/docbook/xenomai/Makefile.in| 43 +- doc/doxygen/Makefile.in| 43 +- doc/man/Makefile.in| 215 +- doc/txt/Makefile.in| 82 +- include/Makefile.in| 192 +- include/analogy/Makefile.in| 105 +- include/asm-arm/Makefile.in| 170 +- include/asm-arm/bits/Makefile.in | 105 +- include/asm-blackfin/Makefile.in | 170 +- include/asm-blackfin/bits/Makefile.in | 105 +- include/asm-generic/Makefile.in| 170 +- include/asm-generic/bits/Makefile.in | 105 +- include/asm-nios2/Makefile.in | 170 +- include/asm-nios2/bits/Makefile.in | 105 +- include/asm-powerpc/Makefile.in| 170 +- include/asm-powerpc/bits/Makefile.in | 105 +- include/asm-sim/Makefile.in| 170 +- include/asm-sim/bits/Makefile.in | 105 +- include/asm-x86/Makefile.in| 170 +- include/asm-x86/bits/Makefile.in | 105 +- include/native/Makefile.in | 105 +- include/nucleus/Makefile.in| 105 +- include/posix/Makefile.in | 170 +- include/posix/sys/Makefile.in | 105 +- include/psos+/Makefile.in | 105 +- include/rtai/Makefile.in | 105 +- include/rtdm/Makefile.in | 105 +- include/uitron/Makefile.in | 105 +- include/vrtx/Makefile.in | 105 +- include/vxworks/Makefile.in| 105 +- scripts/Makefile.in| 104 +- src/Makefile.in| 131 +- src/drvlib/Makefile.in | 131 +- src/drvlib/analogy/Makefile.in | 149 +- src/include/Makefile.in| 47 +- src/include/xeno_config.h.in |3 - src/rtdk/Makefile.in | 137 +- src/skins/Makefile.in | 133 +- src/skins/common/Makefile.in | 45 +- src/skins/native/Makefile.in | 206 +- src/skins/posix/Makefile.in| 194 +- src/skins/psos+/Makefile.in| 158 +- src/skins/rtai/Makefile.in | 128 +- src/skins/rtdm/Makefile.in | 128 +- src/skins/uitron/Makefile.in | 146 +- src/skins/vrtx/Makefile.in | 182 +- src/skins/vxworks/Makefile.in | 188 +- src/testsuite/Makefile.in | 131 +- src/testsuite/clocktest/Makefile.in| 133 +- src/testsuite/cyclic/Makefile.in | 133 +- src/testsuite/irqbench/Makefile.in | 137 +- src/testsuite/klatency/Makefile.in | 133 +- src/testsuite/latency/Makefile.in | 133 +- src/testsuite/switchtest/Makefile.in | 133 +- src/testsuite/unit/Makefile.in | 149 +- src/utils/Makefile.in | 131 +- src/utils/analogy/Makefile.in | 185 +- src/utils/can/Makefile.in | 185 +- src/utils/ps/Makefile.in | 129 +- 70 files changed, 6322 insertions(+), 8400 deletions(-) Diff: http://git.xenomai.org/?p=xenomai-gch.git;a=commitdiff;h=b259c67600bea5767a6c89dcab7cac459ae20dd1 ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Sebastian Smolorz : can: Free I/O region when unloading the xeno_can_isa. ko driver
Module: xenomai-jki Branch: for-upstream Commit: c84135a5f94a7201281b6f9f7fb29bad12d72368 URL: http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=c84135a5f94a7201281b6f9f7fb29bad12d72368 Author: Sebastian Smolorz Date: Mon Nov 23 19:25:40 2009 +0100 can: Free I/O region when unloading the xeno_can_isa.ko driver Signed-off-by: Sebastian Smolorz Signed-off-by: Wolfgang Grandegger Signed-off-by: Jan Kiszka --- ksrc/drivers/can/sja1000/rtcan_isa.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ksrc/drivers/can/sja1000/rtcan_isa.c b/ksrc/drivers/can/sja1000/rtcan_isa.c index 6debb16..ec32393 100644 --- a/ksrc/drivers/can/sja1000/rtcan_isa.c +++ b/ksrc/drivers/can/sja1000/rtcan_isa.c @@ -1,8 +1,8 @@ /* * Copyright (C) 2006 Wolfgang Grandegger * - * Copyright (C) 2005, 2006 Sebastian Smolorz - * + * Copyright (C) 2005, 2006, 2009 Sebastian Smolorz + * * * * This program is free software; you can redistribute it and/or modify it @@ -189,6 +189,7 @@ static void rtcan_isa_exit(void) if (!dev) continue; rtcan_sja1000_unregister(dev); + release_region(io[i], RTCAN_ISA_PORT_SIZE); rtcan_dev_free(dev); } } ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git