[Xenomai-git] Alexis Berlemont : Comedi4RTDM - Analogy (third part, kernel side compiles )
Module: xenomai-abe Branch: analogy Commit: b8da988b8fb8605bdfd6641888345814f103ac02 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=b8da988b8fb8605bdfd6641888345814f103ac02 Author: Alexis Berlemont alexis.berlem...@gmail.com Date: Fri Oct 16 16:11:37 2009 +0200 Comedi4RTDM - Analogy (third part, kernel side compiles) --- include/analogy/command.h |6 +- include/analogy/instruction.h |8 +- include/analogy/os_facilities.h|2 +- ksrc/drivers/analogy/device.c | 248 ++-- ksrc/drivers/analogy/driver.c | 40 +- ksrc/drivers/analogy/instruction.c | 134 +- ksrc/drivers/analogy/intel/8255.c | 110 +- ksrc/drivers/analogy/intel/8255.h | 24 +- ksrc/drivers/analogy/intel/Config.in |2 +- ksrc/drivers/analogy/intel/Kconfig |6 +- ksrc/drivers/analogy/intel/Makefile| 14 +- .../drivers/analogy/national_instruments/Config.in |2 +- ksrc/drivers/analogy/national_instruments/Kconfig | 24 +- ksrc/drivers/analogy/national_instruments/Makefile | 56 +- .../analogy/national_instruments/mio_common.c | 2016 ++-- ksrc/drivers/analogy/national_instruments/mite.c | 158 +- ksrc/drivers/analogy/national_instruments/mite.h | 19 +- ksrc/drivers/analogy/national_instruments/ni_mio.h | 26 +- ksrc/drivers/analogy/national_instruments/ni_stc.h | 22 +- ksrc/drivers/analogy/national_instruments/ni_tio.h | 32 +- ksrc/drivers/analogy/national_instruments/pcimio.c | 82 +- .../analogy/national_instruments/tio_common.c | 114 +- 22 files changed, 1572 insertions(+), 1573 deletions(-) Diff: http://git.xenomai.org/?p=xenomai-abe.git;a=commitdiff;h=b8da988b8fb8605bdfd6641888345814f103ac02 ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : Fix modules compilations issues
Module: xenomai-abe Branch: analogy Commit: d442bf472f8f4e5e1038fb4df6efe421175e8f24 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=d442bf472f8f4e5e1038fb4df6efe421175e8f24 Author: Alexis Berlemont alexis.berlem...@gmail.com Date: Sat Oct 17 16:41:00 2009 +0200 Fix modules compilations issues --- ksrc/drivers/comedi/intel/8255.c |6 +-- ksrc/drivers/comedi/intel/8255.h |3 +- .../comedi/national_instruments/mio_common.c | 57 +--- ksrc/drivers/comedi/national_instruments/mite.c|1 + 4 files changed, 42 insertions(+), 25 deletions(-) diff --git a/ksrc/drivers/comedi/intel/8255.c b/ksrc/drivers/comedi/intel/8255.c index f6321f6..e9c2ae1 100644 --- a/ksrc/drivers/comedi/intel/8255.c +++ b/ksrc/drivers/comedi/intel/8255.c @@ -51,10 +51,6 @@ void subdev_8255_interrupt(comedi_subd_t *subd) { sampl_t d; - /* Considering the current Comedi API, using asynchronous - buffer is only possible on the main read/write subdevice. - Then, this function needs only one argument: the device */ - /* Retrieve the sample... */ d = CALLBACK_FUNC(0, _8255_DATA, 0, CALLBACK_ARG); d |= (CALLBACK_FUNC(0, _8255_DATA + 1, 0, CALLBACK_ARG) 8); @@ -64,6 +60,7 @@ void subdev_8255_interrupt(comedi_subd_t *subd) comedi_buf_evt(subd, 0); } +EXPORT_SYMBOL(subdev_8255_interrupt); static int subdev_8255_cb(int dir, int port, int data, unsigned long arg) { @@ -229,6 +226,7 @@ void subdev_8255_init(comedi_subd_t *subd) do_config(subd); } +EXPORT_SYMBOL(subdev_8255_init); /* diff --git a/ksrc/drivers/comedi/intel/8255.h b/ksrc/drivers/comedi/intel/8255.h index 79177d3..45bc850 100644 --- a/ksrc/drivers/comedi/intel/8255.h +++ b/ksrc/drivers/comedi/intel/8255.h @@ -33,7 +33,8 @@ typedef struct subd_8255_struct { int io_bits; } subd_8255_t; -#ifdef CONFIG_XENO_DRIVERS_COMEDI_8255 +#if (defined(CONFIG_XENO_DRIVERS_COMEDI_8255) || \ + defined(CONFIG_XENO_DRIVERS_COMEDI_8255_MODULE)) #define _8255_SIZE 4 diff --git a/ksrc/drivers/comedi/national_instruments/mio_common.c b/ksrc/drivers/comedi/national_instruments/mio_common.c index 68e87ff..9f0b1b7 100644 --- a/ksrc/drivers/comedi/national_instruments/mio_common.c +++ b/ksrc/drivers/comedi/national_instruments/mio_common.c @@ -206,7 +206,8 @@ static void handle_cdio_interrupt(comedi_dev_t *dev); static void ni_load_channelgain_list(comedi_dev_t *dev, unsigned int n_chan, unsigned int *list); -#ifndef CONFIG_XENO_DRIVERS_COMEDI_NI_MITE +#if (!defined(CONFIG_XENO_DRIVERS_COMEDI_NI_MITE) \ + !defined(CONFIG_XENO_DRIVERS_COMEDI_NI_MITE_MODULE)) static void ni_handle_fifo_half_full(comedi_subd_t *subd); static int ni_ao_fifo_half_empty(comedi_subd_t *subd); #endif /* !CONFIG_XENO_DRIVERS_COMEDI_NI_MITE */ @@ -779,7 +780,8 @@ static void handle_a_interrupt(comedi_dev_t *dev, a_status=%04x ai_mite_status=%08x\n,status, ai_mite_status); ni_mio_print_status_a(status); -#ifdef CONFIG_XENO_DRIVERS_COMEDI_NI_MITE +#if (defined(CONFIG_XENO_DRIVERS_COMEDI_NI_MITE) || \ + defined(CONFIG_XENO_DRIVERS_COMEDI_NI_MITE_MODULE)) if (ai_mite_status CHSR_LINKC) ni_sync_ai_dma(subd); @@ -827,8 +829,8 @@ static void handle_a_interrupt(comedi_dev_t *dev, } } -#ifndef CONFIG_XENO_DRIVERS_COMEDI_NI_MITE - +#if (!defined(CONFIG_XENO_DRIVERS_COMEDI_NI_MITE) \ + !defined(CONFIG_XENO_DRIVERS_COMEDI_NI_MITE_MODULE)) if (status AI_FIFO_Half_Full_St) { int i; static const int timeout = 10; @@ -894,7 +896,8 @@ static void handle_b_interrupt(comedi_dev_t * dev, b_status, ao_mite_status); ni_mio_print_status_b(b_status); -#ifdef CONFIG_XENO_DRIVERS_COMEDI_NI_MITE +#if (defined(CONFIG_XENO_DRIVERS_COMEDI_NI_MITE) || \ + defined(CONFIG_XENO_DRIVERS_COMEDI_NI_MITE_MODULE)) /* Currently, mite.c requires us to handle LINKC */ if (ao_mite_status CHSR_LINKC) { mite_handle_b_linkc(subd); @@ -928,7 +931,8 @@ static void handle_b_interrupt(comedi_dev_t * dev, comedi_buf_evt(subd, COMEDI_BUF_EOA); } -#ifndef CONFIG_XENO_DRIVERS_COMEDI_NI_MITE +#if (!defined(CONFIG_XENO_DRIVERS_COMEDI_NI_MITE) \ + !defined(CONFIG_XENO_DRIVERS_COMEDI_NI_MITE_MODULE)) if (b_status AO_FIFO_Request_St) { int ret; @@ -1002,7 +1006,8 @@ int ni_E_interrupt(unsigned int irq, void *d) return 0; } -#ifndef CONFIG_XENO_DRIVERS_COMEDI_NI_MITE +#if (!defined(CONFIG_XENO_DRIVERS_COMEDI_NI_MITE) \ + !defined(CONFIG_XENO_DRIVERS_COMEDI_NI_MITE_MODULE)) static void ni_ao_fifo_load(comedi_subd_t *subd, int n) { @@ -1163,7 +1168,8 @@ static void ni_handle_fifo_half_full(comedi_subd_t *subd) #endif /* !CONFIG_XENO_DRIVERS_COMEDI_NI_MITE */ -#ifdef
[Xenomai-git] Alexis Berlemont : Comedi4RTDM - Analogy (second part)
Module: xenomai-abe Branch: analogy Commit: b814f22ee993c57198f998bc4c0fb0df475ae65b URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=b814f22ee993c57198f998bc4c0fb0df475ae65b Author: Alexis Berlemont alexis.berlem...@gmail.com Date: Thu Oct 15 00:49:49 2009 +0200 Comedi4RTDM - Analogy (second part) --- include/analogy/Makefile.am |6 +- include/analogy/analogy.h | 144 include/analogy/command.h | 14 ++-- include/analogy/context.h |2 +- include/analogy/descriptor.h| 28 +++--- include/analogy/device.h| 58 +++--- include/analogy/driver.h| 34 include/analogy/instruction.h | 174 +++--- include/analogy/ioctl.h | 40 +- include/analogy/os_facilities.h | 138 +++--- include/analogy/subdevice.h | 172 +++--- include/analogy/transfer.h | 84 ++-- include/analogy/types.h | 14 ++-- 13 files changed, 454 insertions(+), 454 deletions(-) diff --git a/include/analogy/Makefile.am b/include/analogy/Makefile.am index 4ea560e..d9344ad 100644 --- a/include/analogy/Makefile.am +++ b/include/analogy/Makefile.am @@ -1,10 +1,10 @@ -includesubdir = $(includedir)/comedi +includesubdir = $(includedir)/analogy includesub_HEADERS = \ buffer.h\ channel_range.h \ - comedi_driver.h \ - comedi.h\ + analogy_driver.h \ + analogy.h \ command.h \ context.h \ descriptor.h\ diff --git a/include/analogy/analogy.h b/include/analogy/analogy.h index 754d001..8d11047 100644 --- a/include/analogy/analogy.h +++ b/include/analogy/analogy.h @@ -1,6 +1,6 @@ /** * @file - * Analogy, library facilities + * Analogy for Linux, library facilities * @note Copyright (C) 1997-2000 David A. Schleef d...@schleef.org * @note Copyright (C) 2008 Alexis Berlemont alexis.berlem...@free.fr * @@ -35,114 +35,114 @@ extern C { /* --- Level 0 API (not supposed to be used) --- */ -int analogy_sys_open(const char *fname); +int a4l_sys_open(const char *fname); -int analogy_sys_close(int fd); +int a4l_sys_close(int fd); -int analogy_sys_read(int fd, void *buf, size_t nbyte); +int a4l_sys_read(int fd, void *buf, size_t nbyte); -int analogy_sys_write(int fd, void *buf, size_t nbyte); +int a4l_sys_write(int fd, void *buf, size_t nbyte); -int analogy_sys_attach(int fd, analogy_lnkdesc_t * arg); +int a4l_sys_attach(int fd, a4l_lnkdesc_t * arg); -int analogy_sys_detach(int fd); +int a4l_sys_detach(int fd); -int analogy_sys_desc(int fd, analogy_desc_t * dsc, int pass); +int a4l_sys_desc(int fd, a4l_desc_t * dsc, int pass); -int analogy_sys_devinfo(int fd, analogy_dvinfo_t * info); +int a4l_sys_devinfo(int fd, a4l_dvinfo_t * info); -int analogy_sys_subdinfo(int fd, analogy_sbinfo_t * info); +int a4l_sys_subdinfo(int fd, a4l_sbinfo_t * info); -int analogy_sys_nbchaninfo(int fd, unsigned int idx_subd, unsigned int *nb); +int a4l_sys_nbchaninfo(int fd, unsigned int idx_subd, unsigned int *nb); -int analogy_sys_chaninfo(int fd, -unsigned int idx_subd, analogy_chinfo_t * info); +int a4l_sys_chaninfo(int fd, +unsigned int idx_subd, a4l_chinfo_t * info); -int analogy_sys_nbrnginfo(int fd, - unsigned int idx_subd, - unsigned int idx_chan, unsigned int *nb); +int a4l_sys_nbrnginfo(int fd, + unsigned int idx_subd, + unsigned int idx_chan, unsigned int *nb); -int analogy_sys_rnginfo(int fd, - unsigned int idx_subd, - unsigned int idx_chan, analogy_rnginfo_t * info); +int a4l_sys_rnginfo(int fd, + unsigned int idx_subd, + unsigned int idx_chan, a4l_rnginfo_t * info); /* --- Level 1 API (supposed to be used) --- */ -int analogy_get_desc(int fd, analogy_desc_t * dsc, int pass); +int a4l_get_desc(int fd, a4l_desc_t * dsc, int pass); -int analogy_open(analogy_desc_t * dsc, const char *fname); +int a4l_open(a4l_desc_t * dsc, const char *fname); -int analogy_close(analogy_desc_t * dsc); +int a4l_close(a4l_desc_t * dsc); -int analogy_fill_desc(analogy_desc_t * dsc); +int a4l_fill_desc(a4l_desc_t * dsc); -int analogy_get_subdinfo(analogy_desc_t * dsc, -unsigned int subd, analogy_sbinfo_t ** info); +int a4l_get_subdinfo(a4l_desc_t * dsc, +unsigned int subd, a4l_sbinfo_t ** info); -int analogy_get_chinfo(analogy_desc_t * dsc, - unsigned int subd, - unsigned int chan, analogy_chinfo_t ** info); +int a4l_get_chinfo(a4l_desc_t * dsc, + unsigned int subd, + unsigned int chan, a4l_chinfo_t ** info); -#define analogy_get_chan_max(x)
[Xenomai-git] Wolfgang Mauerer : Make marker string for faults less ambiguous
Module: xenomai-abe Branch: analogy Commit: 778a7111bf6d09e0df4ff7a358685796edf64d57 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=778a7111bf6d09e0df4ff7a358685796edf64d57 Author: Wolfgang Mauerer wolfgang.maue...@siemens.com Date: Fri Oct 2 10:49:31 2009 +0200 Make marker string for faults less ambiguous The trace mark string for faults uses an address element to notify about the location of the instruction that caused the fault. address is a bit dubious in this context because it can mean either faulting address or IP address. Replacing address with ip also makes the message more consistent with Linux' page_fault_entry trace point. Signed-off-by: Wolfgang Mauerer wolfgang.maue...@siemens.com Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- ksrc/nucleus/pod.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/ksrc/nucleus/pod.c b/ksrc/nucleus/pod.c index 78dda09..370ad28 100644 --- a/ksrc/nucleus/pod.c +++ b/ksrc/nucleus/pod.c @@ -2533,7 +2533,7 @@ int xnpod_trap_fault(xnarch_fltinfo_t *fltinfo) thread = xnpod_current_thread(); trace_mark(xn_nucleus, thread_fault, - thread %p thread_name %s address %lu type %d, + thread %p thread_name %s ip %p type %d, thread, xnthread_name(thread), xnarch_fault_pc(fltinfo), xnarch_fault_trap(fltinfo)); ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Wolfgang Mauerer : Fix handling of deleted message queue objects
Module: xenomai-abe Branch: analogy Commit: 167da0577e4be86bb46e21f2f164e0495d296a24 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=167da0577e4be86bb46e21f2f164e0495d296a24 Author: Wolfgang Mauerer wolfgang.maue...@siemens.com Date: Fri Oct 2 10:49:27 2009 +0200 Fix handling of deleted message queue objects When a Xenomai thread tries to access a deleted message queue, it should obtain -ESRCH as error code both from within the kernel and for userland applications. However, userland sometimes receives wrong error codes because failure of the handle lookup operation is not correctly handled, which leads to subsequently different errors. This patch fixes the faulty patterns, and also provides a documentation update. Signed-off-by: Wolfgang Mauerer wolfgang.maue...@siemens.com Signed-off-by: Jan Kiszka jan.kis...@siemens.com Reported-by: Victor Metsch victor.met...@siemens.com --- ksrc/skins/native/queue.c |2 ++ ksrc/skins/native/syscall.c |6 ++ 2 files changed, 8 insertions(+), 0 deletions(-) diff --git a/ksrc/skins/native/queue.c b/ksrc/skins/native/queue.c index 963c029..527bde8 100644 --- a/ksrc/skins/native/queue.c +++ b/ksrc/skins/native/queue.c @@ -713,6 +713,8 @@ int rt_queue_send(RT_QUEUE *q, void *mbuf, size_t size, int mode) * defined for the queue at creation, or if no memory can be obtained * to convey the message data internally. * + * - -ESRCH is returned if a @a q represents a stale userland handle + * * Environments: * * This service can be called from: diff --git a/ksrc/skins/native/syscall.c b/ksrc/skins/native/syscall.c index 1e8ece9..28c720e 100644 --- a/ksrc/skins/native/syscall.c +++ b/ksrc/skins/native/syscall.c @@ -2270,6 +2270,9 @@ static int __rt_queue_write(struct pt_regs *regs) q = (RT_QUEUE *)xnregistry_fetch(ph.opaque); + if (!q) + return -ESRCH; + /* Buffer to write to the queue. */ buf = (void __user *)__xn_reg_arg2(regs); @@ -2385,6 +2388,9 @@ static int __rt_queue_read(struct pt_regs *regs) q = (RT_QUEUE *)xnregistry_fetch(ph.opaque); + if (!q) + return -ESRCH; + /* Address of message space to write to. */ buf = (void __user *)__xn_reg_arg2(regs); ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : Fix some error checkings in analog output command test function
Module: xenomai-abe Branch: analogy Commit: 310dd51a93b47ce29e1d4226584bfc070c93dea6 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=310dd51a93b47ce29e1d4226584bfc070c93dea6 Author: Alexis Berlemont alexis.berlem...@gmail.com Date: Tue Sep 22 00:41:23 2009 +0200 Fix some error checkings in analog output command test function --- .../comedi/national_instruments/mio_common.c | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ksrc/drivers/comedi/national_instruments/mio_common.c b/ksrc/drivers/comedi/national_instruments/mio_common.c index 0e40fab..fbb4d59 100644 --- a/ksrc/drivers/comedi/national_instruments/mio_common.c +++ b/ksrc/drivers/comedi/national_instruments/mio_common.c @@ -2987,8 +2987,6 @@ int ni_ao_cmdtest(comedi_subd_t *subd, comedi_cmd_t *cmd) { comedi_dev_t *dev = subd-dev; - int err = 0; - /* Make sure trigger sources are unique and mutually compatible */ if (cmd-stop_src != TRIG_COUNT cmd-stop_src != TRIG_NONE) @@ -2998,19 +2996,21 @@ int ni_ao_cmdtest(comedi_subd_t *subd, comedi_cmd_t *cmd) if (cmd-start_arg != 0) { cmd-start_arg = 0; - err++; + return -EINVAL; } + if (cmd-scan_begin_src == TRIG_TIMER) { if (cmd-scan_begin_arg boardtype.ao_speed) { cmd-scan_begin_arg = boardtype.ao_speed; - err++; + return -EINVAL; } if (cmd-scan_begin_arg devpriv-clock_ns * 0xff) { /* XXX check */ cmd-scan_begin_arg = devpriv-clock_ns * 0xff; - err++; + return -EINVAL; } } + if (cmd-convert_arg != 0) { cmd-convert_arg = 0; return -EINVAL; ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : Add a trigger instruction
Module: xenomai-abe Branch: analogy Commit: bd71ec003c850e49146021dead566c6a3f0bef9a URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=bd71ec003c850e49146021dead566c6a3f0bef9a Author: Alexis Berlemont alexis.berlem...@gmail.com Date: Sun Sep 27 16:26:53 2009 +0200 Add a trigger instruction --- src/utils/comedi/cmd_write.c | 29 +++-- 1 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/utils/comedi/cmd_write.c b/src/utils/comedi/cmd_write.c index ab57ee1..851b943 100644 --- a/src/utils/comedi/cmd_write.c +++ b/src/utils/comedi/cmd_write.c @@ -75,6 +75,12 @@ comedi_cmd_t cmd = { .chan_descs = chans, }; +comedi_insn_t insn = { + .type = COMEDI_INSN_INTTRIG, + .idx_subd = ID_SUBD, + .data_size = 0, +}; + struct option cmd_write_opts[] = { {verbose, no_argument, NULL, 'v'}, {real-time, no_argument, NULL, 'r'}, @@ -123,7 +129,7 @@ int main(int argc, char *argv[]) filename = optarg; break; case 's': - cmd.idx_subd = strtoul(optarg, NULL, 0); + cmd.idx_subd = insn.idx_subd = strtoul(optarg, NULL, 0); break; case 'S': cmd.stop_arg = strtoul(optarg, NULL, 0); @@ -319,8 +325,17 @@ int main(int argc, char *argv[]) ret); goto out_main; } - cnt += ret; + + if (cnt == ret cnt != 0) { + ret = comedi_snd_insn(dsc, insn); + if (ret 0) { + fprintf(stderr, + cmd_write: triggering failed (ret=%d)\n, + ret); + goto out_main; + } + } } } else { unsigned long front = 0; @@ -372,6 +387,16 @@ int main(int argc, char *argv[]) ret); goto out_main; } + + if (cnt == front cnt != 0) { + ret = comedi_snd_insn(dsc, insn); + if (ret 0) { + fprintf(stderr, + cmd_write: triggering failed (ret=%d)\n, + ret); + goto out_main; + } + } } } ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : Replace an info message by an error message
Module: xenomai-abe Branch: analogy Commit: 8b50a6f567bec93f9a35e524c3a209bb47d9398f URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=8b50a6f567bec93f9a35e524c3a209bb47d9398f Author: Alexis Berlemont alexis.berlem...@gmail.com Date: Thu Oct 1 23:39:56 2009 +0200 Replace an info message by an error message --- ksrc/drivers/comedi/national_instruments/mite.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/ksrc/drivers/comedi/national_instruments/mite.c b/ksrc/drivers/comedi/national_instruments/mite.c index c776f12..e322529 100644 --- a/ksrc/drivers/comedi/national_instruments/mite.c +++ b/ksrc/drivers/comedi/national_instruments/mite.c @@ -458,7 +458,7 @@ void mite_prep_dma(struct mite_channel *mite_chan, mcr |= CR_PSIZE32; break; default: - __comedi_info(MITE: bug! + __comedi_err(MITE: bug! invalid mem bit width for dma transfer\n); break; } ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : Fix a problem in the mite configuration (only for AI)
Module: xenomai-abe Branch: analogy Commit: 7268c3cc9708d45324471b9bc758e41c39b2b942 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=7268c3cc9708d45324471b9bc758e41c39b2b942 Author: Alexis Berlemont alexis.berlem...@gmail.com Date: Thu Oct 1 23:41:11 2009 +0200 Fix a problem in the mite configuration (only for AI) --- .../comedi/national_instruments/mio_common.c |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/ksrc/drivers/comedi/national_instruments/mio_common.c b/ksrc/drivers/comedi/national_instruments/mio_common.c index 8e9b5e1..68e87ff 100644 --- a/ksrc/drivers/comedi/national_instruments/mio_common.c +++ b/ksrc/drivers/comedi/national_instruments/mio_common.c @@ -1367,8 +1367,13 @@ static int ni_ai_setup_MITE_dma(comedi_dev_t *dev) break; }; + /* Huge hack */ + mite_buf_change(devpriv-ai_mite_chan-ring, + dev-transfer.bufs[NI_AI_SUBDEV]); + /* start the MITE */ mite_dma_arm(devpriv-ai_mite_chan); + return 0; } ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : Fix modules compilations issues
Module: xenomai-abe Branch: analogy Commit: 094c9365f41b07ef5e368c74104ae837f1f7c759 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=094c9365f41b07ef5e368c74104ae837f1f7c759 Author: Alexis Berlemont alexis.berlem...@gmail.com Date: Sat Oct 17 16:41:00 2009 +0200 Fix modules compilations issues --- ksrc/drivers/comedi/intel/8255.c |6 +-- ksrc/drivers/comedi/intel/8255.h |3 +- .../comedi/national_instruments/mio_common.c | 57 +--- ksrc/drivers/comedi/national_instruments/mite.c|1 + 4 files changed, 42 insertions(+), 25 deletions(-) diff --git a/ksrc/drivers/comedi/intel/8255.c b/ksrc/drivers/comedi/intel/8255.c index f6321f6..e9c2ae1 100644 --- a/ksrc/drivers/comedi/intel/8255.c +++ b/ksrc/drivers/comedi/intel/8255.c @@ -51,10 +51,6 @@ void subdev_8255_interrupt(comedi_subd_t *subd) { sampl_t d; - /* Considering the current Comedi API, using asynchronous - buffer is only possible on the main read/write subdevice. - Then, this function needs only one argument: the device */ - /* Retrieve the sample... */ d = CALLBACK_FUNC(0, _8255_DATA, 0, CALLBACK_ARG); d |= (CALLBACK_FUNC(0, _8255_DATA + 1, 0, CALLBACK_ARG) 8); @@ -64,6 +60,7 @@ void subdev_8255_interrupt(comedi_subd_t *subd) comedi_buf_evt(subd, 0); } +EXPORT_SYMBOL(subdev_8255_interrupt); static int subdev_8255_cb(int dir, int port, int data, unsigned long arg) { @@ -229,6 +226,7 @@ void subdev_8255_init(comedi_subd_t *subd) do_config(subd); } +EXPORT_SYMBOL(subdev_8255_init); /* diff --git a/ksrc/drivers/comedi/intel/8255.h b/ksrc/drivers/comedi/intel/8255.h index 79177d3..45bc850 100644 --- a/ksrc/drivers/comedi/intel/8255.h +++ b/ksrc/drivers/comedi/intel/8255.h @@ -33,7 +33,8 @@ typedef struct subd_8255_struct { int io_bits; } subd_8255_t; -#ifdef CONFIG_XENO_DRIVERS_COMEDI_8255 +#if (defined(CONFIG_XENO_DRIVERS_COMEDI_8255) || \ + defined(CONFIG_XENO_DRIVERS_COMEDI_8255_MODULE)) #define _8255_SIZE 4 diff --git a/ksrc/drivers/comedi/national_instruments/mio_common.c b/ksrc/drivers/comedi/national_instruments/mio_common.c index 68e87ff..9f0b1b7 100644 --- a/ksrc/drivers/comedi/national_instruments/mio_common.c +++ b/ksrc/drivers/comedi/national_instruments/mio_common.c @@ -206,7 +206,8 @@ static void handle_cdio_interrupt(comedi_dev_t *dev); static void ni_load_channelgain_list(comedi_dev_t *dev, unsigned int n_chan, unsigned int *list); -#ifndef CONFIG_XENO_DRIVERS_COMEDI_NI_MITE +#if (!defined(CONFIG_XENO_DRIVERS_COMEDI_NI_MITE) \ + !defined(CONFIG_XENO_DRIVERS_COMEDI_NI_MITE_MODULE)) static void ni_handle_fifo_half_full(comedi_subd_t *subd); static int ni_ao_fifo_half_empty(comedi_subd_t *subd); #endif /* !CONFIG_XENO_DRIVERS_COMEDI_NI_MITE */ @@ -779,7 +780,8 @@ static void handle_a_interrupt(comedi_dev_t *dev, a_status=%04x ai_mite_status=%08x\n,status, ai_mite_status); ni_mio_print_status_a(status); -#ifdef CONFIG_XENO_DRIVERS_COMEDI_NI_MITE +#if (defined(CONFIG_XENO_DRIVERS_COMEDI_NI_MITE) || \ + defined(CONFIG_XENO_DRIVERS_COMEDI_NI_MITE_MODULE)) if (ai_mite_status CHSR_LINKC) ni_sync_ai_dma(subd); @@ -827,8 +829,8 @@ static void handle_a_interrupt(comedi_dev_t *dev, } } -#ifndef CONFIG_XENO_DRIVERS_COMEDI_NI_MITE - +#if (!defined(CONFIG_XENO_DRIVERS_COMEDI_NI_MITE) \ + !defined(CONFIG_XENO_DRIVERS_COMEDI_NI_MITE_MODULE)) if (status AI_FIFO_Half_Full_St) { int i; static const int timeout = 10; @@ -894,7 +896,8 @@ static void handle_b_interrupt(comedi_dev_t * dev, b_status, ao_mite_status); ni_mio_print_status_b(b_status); -#ifdef CONFIG_XENO_DRIVERS_COMEDI_NI_MITE +#if (defined(CONFIG_XENO_DRIVERS_COMEDI_NI_MITE) || \ + defined(CONFIG_XENO_DRIVERS_COMEDI_NI_MITE_MODULE)) /* Currently, mite.c requires us to handle LINKC */ if (ao_mite_status CHSR_LINKC) { mite_handle_b_linkc(subd); @@ -928,7 +931,8 @@ static void handle_b_interrupt(comedi_dev_t * dev, comedi_buf_evt(subd, COMEDI_BUF_EOA); } -#ifndef CONFIG_XENO_DRIVERS_COMEDI_NI_MITE +#if (!defined(CONFIG_XENO_DRIVERS_COMEDI_NI_MITE) \ + !defined(CONFIG_XENO_DRIVERS_COMEDI_NI_MITE_MODULE)) if (b_status AO_FIFO_Request_St) { int ret; @@ -1002,7 +1006,8 @@ int ni_E_interrupt(unsigned int irq, void *d) return 0; } -#ifndef CONFIG_XENO_DRIVERS_COMEDI_NI_MITE +#if (!defined(CONFIG_XENO_DRIVERS_COMEDI_NI_MITE) \ + !defined(CONFIG_XENO_DRIVERS_COMEDI_NI_MITE_MODULE)) static void ni_ao_fifo_load(comedi_subd_t *subd, int n) { @@ -1163,7 +1168,8 @@ static void ni_handle_fifo_half_full(comedi_subd_t *subd) #endif /* !CONFIG_XENO_DRIVERS_COMEDI_NI_MITE */ -#ifdef
[Xenomai-git] Alexis Berlemont : Comedi4RTDM - Analogy (second part)
Module: xenomai-abe Branch: analogy Commit: 192b2587b299422ec460129862ca960ad54526e1 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=192b2587b299422ec460129862ca960ad54526e1 Author: Alexis Berlemont alexis.berlem...@gmail.com Date: Thu Oct 15 00:49:49 2009 +0200 Comedi4RTDM - Analogy (second part) --- include/analogy/Makefile.am |6 +- include/analogy/analogy.h | 144 include/analogy/command.h | 14 ++-- include/analogy/context.h |2 +- include/analogy/descriptor.h| 28 +++--- include/analogy/device.h| 58 +++--- include/analogy/driver.h| 34 include/analogy/instruction.h | 174 +++--- include/analogy/ioctl.h | 40 +- include/analogy/os_facilities.h | 138 +++--- include/analogy/subdevice.h | 172 +++--- include/analogy/transfer.h | 84 ++-- include/analogy/types.h | 14 ++-- 13 files changed, 454 insertions(+), 454 deletions(-) diff --git a/include/analogy/Makefile.am b/include/analogy/Makefile.am index 4ea560e..d9344ad 100644 --- a/include/analogy/Makefile.am +++ b/include/analogy/Makefile.am @@ -1,10 +1,10 @@ -includesubdir = $(includedir)/comedi +includesubdir = $(includedir)/analogy includesub_HEADERS = \ buffer.h\ channel_range.h \ - comedi_driver.h \ - comedi.h\ + analogy_driver.h \ + analogy.h \ command.h \ context.h \ descriptor.h\ diff --git a/include/analogy/analogy.h b/include/analogy/analogy.h index 754d001..8d11047 100644 --- a/include/analogy/analogy.h +++ b/include/analogy/analogy.h @@ -1,6 +1,6 @@ /** * @file - * Analogy, library facilities + * Analogy for Linux, library facilities * @note Copyright (C) 1997-2000 David A. Schleef d...@schleef.org * @note Copyright (C) 2008 Alexis Berlemont alexis.berlem...@free.fr * @@ -35,114 +35,114 @@ extern C { /* --- Level 0 API (not supposed to be used) --- */ -int analogy_sys_open(const char *fname); +int a4l_sys_open(const char *fname); -int analogy_sys_close(int fd); +int a4l_sys_close(int fd); -int analogy_sys_read(int fd, void *buf, size_t nbyte); +int a4l_sys_read(int fd, void *buf, size_t nbyte); -int analogy_sys_write(int fd, void *buf, size_t nbyte); +int a4l_sys_write(int fd, void *buf, size_t nbyte); -int analogy_sys_attach(int fd, analogy_lnkdesc_t * arg); +int a4l_sys_attach(int fd, a4l_lnkdesc_t * arg); -int analogy_sys_detach(int fd); +int a4l_sys_detach(int fd); -int analogy_sys_desc(int fd, analogy_desc_t * dsc, int pass); +int a4l_sys_desc(int fd, a4l_desc_t * dsc, int pass); -int analogy_sys_devinfo(int fd, analogy_dvinfo_t * info); +int a4l_sys_devinfo(int fd, a4l_dvinfo_t * info); -int analogy_sys_subdinfo(int fd, analogy_sbinfo_t * info); +int a4l_sys_subdinfo(int fd, a4l_sbinfo_t * info); -int analogy_sys_nbchaninfo(int fd, unsigned int idx_subd, unsigned int *nb); +int a4l_sys_nbchaninfo(int fd, unsigned int idx_subd, unsigned int *nb); -int analogy_sys_chaninfo(int fd, -unsigned int idx_subd, analogy_chinfo_t * info); +int a4l_sys_chaninfo(int fd, +unsigned int idx_subd, a4l_chinfo_t * info); -int analogy_sys_nbrnginfo(int fd, - unsigned int idx_subd, - unsigned int idx_chan, unsigned int *nb); +int a4l_sys_nbrnginfo(int fd, + unsigned int idx_subd, + unsigned int idx_chan, unsigned int *nb); -int analogy_sys_rnginfo(int fd, - unsigned int idx_subd, - unsigned int idx_chan, analogy_rnginfo_t * info); +int a4l_sys_rnginfo(int fd, + unsigned int idx_subd, + unsigned int idx_chan, a4l_rnginfo_t * info); /* --- Level 1 API (supposed to be used) --- */ -int analogy_get_desc(int fd, analogy_desc_t * dsc, int pass); +int a4l_get_desc(int fd, a4l_desc_t * dsc, int pass); -int analogy_open(analogy_desc_t * dsc, const char *fname); +int a4l_open(a4l_desc_t * dsc, const char *fname); -int analogy_close(analogy_desc_t * dsc); +int a4l_close(a4l_desc_t * dsc); -int analogy_fill_desc(analogy_desc_t * dsc); +int a4l_fill_desc(a4l_desc_t * dsc); -int analogy_get_subdinfo(analogy_desc_t * dsc, -unsigned int subd, analogy_sbinfo_t ** info); +int a4l_get_subdinfo(a4l_desc_t * dsc, +unsigned int subd, a4l_sbinfo_t ** info); -int analogy_get_chinfo(analogy_desc_t * dsc, - unsigned int subd, - unsigned int chan, analogy_chinfo_t ** info); +int a4l_get_chinfo(a4l_desc_t * dsc, + unsigned int subd, + unsigned int chan, a4l_chinfo_t ** info); -#define analogy_get_chan_max(x)
[Xenomai-git] Alexis Berlemont : Update *_alloc_subd() after bugfix backport from comedi branch
Module: xenomai-abe Branch: analogy Commit: c9ea90d682b692f591610c4a73d63867ddcaec61 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=c9ea90d682b692f591610c4a73d63867ddcaec61 Author: Alexis Berlemont alexis.berlem...@gmail.com Date: Mon Oct 19 22:49:55 2009 +0200 Update *_alloc_subd() after bugfix backport from comedi branch --- ksrc/drivers/analogy/driver_facilities.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ksrc/drivers/analogy/driver_facilities.c b/ksrc/drivers/analogy/driver_facilities.c index 9cfe60a..b350a46 100644 --- a/ksrc/drivers/analogy/driver_facilities.c +++ b/ksrc/drivers/analogy/driver_facilities.c @@ -154,9 +154,9 @@ EXPORT_SYMBOL(range_fake); * case of error a negative error code is returned. * */ -comedi_subd_t * comedi_alloc_subd(int sizeof_priv, - void (*setup)(comedi_subd_t *)); -EXPORT_SYMBOL(comedi_alloc_subd); +a4l_subd_t * a4l_alloc_subd(int sizeof_priv, + void (*setup)(a4l_subd_t *)); +EXPORT_SYMBOL(a4l_alloc_subd); /** * @brief Add a subdevice to the driver descriptor ___ Xenomai-git mailing list Xenomai-git@gna.org https://mail.gna.org/listinfo/xenomai-git
[Xenomai-git] Alexis Berlemont : Comedi4RTDM - Analogy (last part, user side compiles and runs)
Module: xenomai-abe Branch: analogy Commit: 12c49468b60730738170ea59191d1fdea9cdc291 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=12c49468b60730738170ea59191d1fdea9cdc291 Author: Alexis Berlemont alexis.berlem...@gmail.com Date: Mon Oct 19 22:33:38 2009 +0200 Comedi4RTDM - Analogy (last part, user side compiles and runs) --- Makefile.in|1 + aclocal.m4 |4 +- config/Makefile.in |1 + configure | 5454 +++- configure.in |6 +- doc/Makefile.in|1 + doc/docbook/Makefile.in|1 + doc/docbook/custom-stylesheets/Makefile.in |1 + doc/docbook/custom-stylesheets/xsl/Makefile.in |1 + .../custom-stylesheets/xsl/common/Makefile.in |1 + doc/docbook/custom-stylesheets/xsl/fo/Makefile.in |1 + .../custom-stylesheets/xsl/html/Makefile.in|1 + doc/docbook/xenomai/Makefile.in|1 + doc/doxygen/Makefile.in|1 + doc/man/Makefile.in|1 + doc/txt/Makefile.in|1 + include/Makefile.am|2 +- include/Makefile.in|3 +- include/analogy/Makefile.in| 13 +- include/analogy/descriptor.h |4 +- include/asm-arm/Makefile.in|1 + include/asm-arm/bits/Makefile.in |1 + include/asm-blackfin/Makefile.in |1 + include/asm-blackfin/bits/Makefile.in |1 + include/asm-generic/Makefile.in|1 + include/asm-generic/bits/Makefile.in |1 + include/asm-nios2/Makefile.in |1 + include/asm-nios2/bits/Makefile.in |1 + include/asm-powerpc/Makefile.in|1 + include/asm-powerpc/bits/Makefile.in |1 + include/asm-sim/Makefile.in|1 + include/asm-sim/bits/Makefile.in |1 + include/asm-x86/Makefile.in|1 + include/asm-x86/bits/Makefile.in |1 + include/native/Makefile.in |1 + include/nucleus/Makefile.in|1 + include/posix/Makefile.in |1 + include/posix/sys/Makefile.in |1 + include/psos+/Makefile.in |1 + include/rtai/Makefile.in |1 + include/rtdm/Makefile.in |1 + include/uitron/Makefile.in |1 + include/vrtx/Makefile.in |1 + include/vxworks/Makefile.in|1 + ksrc/drivers/analogy/buffer.c |4 +- scripts/Makefile.in|1 + src/Makefile.in|1 + src/drvlib/Makefile.am |2 +- src/drvlib/Makefile.in |3 +- src/drvlib/{comedi = analogy}/Makefile.am |8 +- src/drvlib/{comedi = analogy}/Makefile.in | 110 +- src/drvlib/{comedi = analogy}/async.c | 191 +- src/drvlib/{comedi = analogy}/descriptor.c| 211 +- src/drvlib/{comedi = analogy}/info.c | 47 +- src/drvlib/{comedi = analogy}/range.c | 55 +- src/drvlib/{comedi = analogy}/root_leaf.h | 27 +- src/drvlib/{comedi = analogy}/sync.c | 127 +- src/drvlib/{comedi = analogy}/sys.c | 61 +- src/drvlib/{comedi = analogy}/syscall.h |9 +- src/include/Makefile.in|1 + src/include/xeno_config.h.in |3 + src/rtdk/Makefile.in |1 + src/skins/Makefile.in |1 + src/skins/native/Makefile.in |1 + src/skins/posix/Makefile.in|1 + src/skins/psos+/Makefile.in|1 + src/skins/rtai/Makefile.in |1 + src/skins/rtdm/Makefile.in |1 + src/skins/uitron/Makefile.in |1 + src/skins/vrtx/Makefile.in |1 + src/skins/vxworks/Makefile.in |1 + src/testsuite/Makefile.in |1 + src/testsuite/clocktest/Makefile.in|1 + src/testsuite/cyclic/Makefile.in |1 + src/testsuite/irqbench/Makefile.in |1 + src/testsuite/klatency/Makefile.in
[Xenomai-git] Alexis Berlemont : Remove useless wrappers (comedi_copy_*_user())
Module: xenomai-abe Branch: analogy Commit: 074a36753037591dd7de699df20db4bb3ef7e8b3 URL: http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=074a36753037591dd7de699df20db4bb3ef7e8b3 Author: Alexis Berlemont alexis.berlem...@gmail.com Date: Sun Sep 20 16:03:20 2009 +0200 Remove useless wrappers (comedi_copy_*_user()) --- include/comedi/buffer.h | 14 include/comedi/context.h | 10 +- include/comedi/os_facilities.h| 20 ksrc/drivers/comedi/buffer.c | 27 ++--- ksrc/drivers/comedi/command.c | 11 --- ksrc/drivers/comedi/device.c | 23 +++--- ksrc/drivers/comedi/instruction.c | 18 ++- ksrc/drivers/comedi/subdevice.c | 61 +++- 8 files changed, 85 insertions(+), 99 deletions(-) diff --git a/include/comedi/buffer.h b/include/comedi/buffer.h index 81298dd..8b3a954 100644 --- a/include/comedi/buffer.h +++ b/include/comedi/buffer.h @@ -95,9 +95,9 @@ static inline int __produce(comedi_cxt_t * cxt, if (cxt == NULL) memcpy(buf-buf + start_ptr, pin, blk_size); else - ret = comedi_copy_from_user(cxt, - buf-buf + start_ptr, - pin, blk_size); + ret = rtdm_safe_copy_from_user(cxt-user_info, + buf-buf + start_ptr, + pin, blk_size); /* Updates pointers/counts */ pin += blk_size; @@ -125,10 +125,10 @@ static inline int __consume(comedi_cxt_t * cxt, if (cxt == NULL) memcpy(pout, buf-buf + start_ptr, blk_size); else - ret = comedi_copy_to_user(cxt, - pout, - buf-buf + start_ptr, - blk_size); + ret = rtdm_safe_copy_to_user(cxt-user_info, +pout, +buf-buf + start_ptr, +blk_size); /* Updates pointers/counts */ pout += blk_size; diff --git a/include/comedi/context.h b/include/comedi/context.h index 3670d69..e9c2d08 100644 --- a/include/comedi/context.h +++ b/include/comedi/context.h @@ -35,7 +35,7 @@ struct comedi_context { setting it at the head of the structure may save useless operations */ struct comedi_device *dev; - rtdm_user_info_t *rtdm_usrinf; + rtdm_user_info_t *user_info; struct rtdm_dev_context *rtdm_cxt; }; typedef struct comedi_context comedi_cxt_t; @@ -45,16 +45,10 @@ typedef struct comedi_context comedi_cxt_t; #define comedi_init_cxt(c, u, x) \ { \ (x)-rtdm_cxt = c; \ - (x)-rtdm_usrinf = u; \ + (x)-user_info = u; \ (x)-dev = NULL;\ } -#define comedi_copy_from_user(x, d, r, s) \ -__comedi_copy_from_user(x-rtdm_usrinf, d, r, s) - -#define comedi_copy_to_user(x, d, r, s) \ -__comedi_copy_to_user(x-rtdm_usrinf, d, r, s) - #endif /* __KERNEL__ !DOXYGEN_CPP */ #endif /* __COMEDI_CONTEXT__ */ diff --git a/include/comedi/os_facilities.h b/include/comedi/os_facilities.h index e9315b7..405c9d4 100644 --- a/include/comedi/os_facilities.h +++ b/include/comedi/os_facilities.h @@ -87,26 +87,6 @@ #define comedi_dbg(level, debug, dev, fmt, args...)\ __comedi_dbg(level, debug, %s: fmt, __comedi_dev_name(dev), ##args) -/* --- Allocation / MMU section --- */ - -static inline int __comedi_copy_from_user(rtdm_user_info_t * user_info, - void *pind, void *pins, int size) -{ - if (rtdm_read_user_ok(user_info, pins, size)) - return rtdm_copy_from_user(user_info, pind, pins, size); - else - return -EFAULT; -} - -static inline int __comedi_copy_to_user(rtdm_user_info_t * user_info, - void *pind, void *pins, int size) -{ - if (rtdm_rw_user_ok(user_info, pind, size)) - return rtdm_copy_to_user(user_info, pind, pins, size); - else - return -EFAULT; -} - /* --- Spinlock section --- */ typedef rtdm_lock_t comedi_lock_t; diff --git a/ksrc/drivers/comedi/buffer.c b/ksrc/drivers/comedi/buffer.c index 27696d8..d5afc67 100644 --- a/ksrc/drivers/comedi/buffer.c +++ b/ksrc/drivers/comedi/buffer.c @@ -397,8 +397,8 @@ int comedi_ioctl_mmap(comedi_cxt_t * cxt,