[Xenomai-git] Philippe Gerum : scripts/xeno-config: fix --skin=posix --ldflags call form

2010-03-28 Thread GIT version control
Module: xenomai-2.5
Branch: master
Commit: 572bcf5a0e6f04f7a9edc44cffb3229ce09d94bd
URL:
http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=572bcf5a0e6f04f7a9edc44cffb3229ce09d94bd

Author: Philippe Gerum r...@xenomai.org
Date:   Wed Mar 10 18:30:45 2010 +0100

scripts/xeno-config: fix --skin=posix --ldflags call form

Ensure the symbol wrapping directive is output for both the legacy
(--posix-ldflags) and new (--skin=posix --ldflags) forms.

---

 scripts/xeno-config.in |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/scripts/xeno-config.in b/scripts/xeno-config.in
index 1a2fbec..fd8 100644
--- a/scripts/xeno-config.in
+++ b/scripts/xeno-config.in
@@ -136,7 +136,8 @@ while test $# -gt 0; do
--ldflags)
case $skin in
posix)
-   echo $XENO_POSIX_LDFLAGS
+   posix_ldflags
+   echo
;;
native|psos|psos+|rtai|uitron|vrtx|vxworks)
if [ x$skin = xpsos+ ]; then


___
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git


[Xenomai-git] Philippe Gerum : testsuite/latency: fix false positive in mode switch detection

2010-03-28 Thread GIT version control
Module: xenomai-2.5
Branch: master
Commit: 9be1830070b705c7a00139814ed50c385bd0c8e1
URL:
http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=9be1830070b705c7a00139814ed50c385bd0c8e1

Author: Philippe Gerum r...@xenomai.org
Date:   Wed Mar 10 12:13:46 2010 +0100

testsuite/latency: fix false positive in mode switch detection

When ^C is depressed to stop the test, receiving SIGINT on the
sampling task must have caused a mode switch notification
earlier. This is a false positive wrt involuntary mode switch
reporting.

To avoid this, block SIGINT (and most termination signals altogether)
for test threads, and receive them explicitely on the main thread via
sigwait().

---

 src/testsuite/latency/latency.c |   27 ---
 1 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/src/testsuite/latency/latency.c b/src/testsuite/latency/latency.c
index 4df8e7f..e9e741e 100644
--- a/src/testsuite/latency/latency.c
+++ b/src/testsuite/latency/latency.c
@@ -435,11 +435,6 @@ void cleanup(void)
exit(0);
 }
 
-void sighand(int sig __attribute__ ((unused)))
-{
-   finished = 1;
-}
-
 void faulthand(int sig)
 {
xntrace_user_freeze(0, 1);
@@ -451,12 +446,11 @@ void mode_sw(int sig)
 {
 #ifndef __UCLIBC__
const char buffer[] = Mode switch, aborting. Backtrace:\n;
+   static void *bt[200];
 #else /* __UCLIBC__ */
const char buffer[] = Mode switch, aborting.
 Backtrace unavailable with uclibc.\n;
 #endif /* __UCLIBC__ */
-   
-   static void *bt[200];
unsigned n;
 
if (!stop_upon_switch) {
@@ -476,9 +470,9 @@ void mode_sw(int sig)
 
 int main(int argc, char **argv)
 {
-   int c, err;
+   int cpu = 0, c, err, sig;
char task_name[16];
-   int cpu = 0;
+   sigset_t mask;
 
while ((c = getopt(argc, argv, hp:l:T:qH:B:sD:t:fc:P:b)) != EOF)
switch (c) {
@@ -600,10 +594,13 @@ int main(int argc, char **argv)
else if (priority  T_HIPRIO)
priority = T_HIPRIO;
 
-   signal(SIGINT, sighand);
-   signal(SIGTERM, sighand);
-   signal(SIGHUP, sighand);
-   signal(SIGALRM, sighand);
+   sigemptyset(mask);
+   sigaddset(mask, SIGINT);
+   sigaddset(mask, SIGTERM);
+   sigaddset(mask, SIGHUP);
+   sigaddset(mask, SIGALRM);
+   pthread_sigmask(SIG_BLOCK, mask, NULL);
+
signal(SIGXCPU, mode_sw);
 
if (freeze_max) {
@@ -681,8 +678,8 @@ int main(int argc, char **argv)
}
}
 
-   while (!finished)
-   pause();
+   sigwait(mask, sig);
+   finished = 1;
 
cleanup();
 


___
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git


[Xenomai-git] Philippe Gerum : blackfin: upgrade I-pipe support to 2.6.33-blackfin-1. 13-00

2010-03-28 Thread GIT version control
Module: xenomai-2.5
Branch: master
Commit: a821ec7095e4d5c7807999c0016349b43d8de2a5
URL:
http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=a821ec7095e4d5c7807999c0016349b43d8de2a5

Author: Philippe Gerum r...@xenomai.org
Date:   Wed Mar 10 16:27:58 2010 +0100

blackfin: upgrade I-pipe support to 2.6.33-blackfin-1.13-00

---

 ksrc/arch/blackfin/patches/README  |   58 +-
 .../adeos-ipipe-2.6.33-blackfin-1.13-00.patch  | 7596 +
 .../adeos-ipipe-2008R1.5-RC3-bf5xx-1.8-00.patch| 8629 
 3 files changed, 7638 insertions(+), 8645 deletions(-)

Diff:   
http://git.xenomai.org/?p=xenomai-2.5.git;a=commitdiff;h=a821ec7095e4d5c7807999c0016349b43d8de2a5

___
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git


[Xenomai-git] Philippe Gerum : native: introduce rt_task_same()

2010-03-28 Thread GIT version control
Module: xenomai-2.5
Branch: master
Commit: 55b0aa9de28891fcfd4b4ab097583bd7619223ab
URL:
http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=55b0aa9de28891fcfd4b4ab097583bd7619223ab

Author: Philippe Gerum r...@xenomai.org
Date:   Wed Mar 10 11:42:36 2010 +0100

native: introduce rt_task_same()

This new service checks whether two task descriptors refer to the same
task.

It is particularly useful in user-space, since rt_task_self() does
return a task descriptor which is different from the original
descriptor used by the application, but still refers to the same task
internally.

---

 include/native/task.h |7 +++
 ksrc/skins/native/API.CHANGES |8 
 ksrc/skins/native/task.c  |   25 +
 src/skins/native/task.c   |5 +
 4 files changed, 45 insertions(+), 0 deletions(-)

diff --git a/include/native/task.h b/include/native/task.h
index 59a40a4..95187f1 100644
--- a/include/native/task.h
+++ b/include/native/task.h
@@ -200,6 +200,11 @@ int rt_task_remove_hook(int type,
 
 int rt_task_catch(void (*handler)(rt_sigset_t));
 
+static inline int rt_task_same(RT_TASK *task1, RT_TASK *task2)
+{
+   return task1 == task2;
+}
+
 #ifdef __cplusplus
 }
 #endif
@@ -317,6 +322,8 @@ static inline int rt_task_spawn(RT_TASK *task,
 return err;
 }
 
+int rt_task_same(RT_TASK *task1, RT_TASK *task2);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/ksrc/skins/native/API.CHANGES b/ksrc/skins/native/API.CHANGES
index 5f73cbf..b9ee04e 100644
--- a/ksrc/skins/native/API.CHANGES
+++ b/ksrc/skins/native/API.CHANGES
@@ -280,3 +280,11 @@ 
___
 
* New rt_queue_flush() service to discard all unread messages
from a queue.
+
+___
+
+
+2.5.1 - 2.5.2
+
+   * New rt_task_same() call. Returns true whenever two task
+ descriptors refer to the same task, false otherwise.
diff --git a/ksrc/skins/native/task.c b/ksrc/skins/native/task.c
index 08cde01..6d2472e 100644
--- a/ksrc/skins/native/task.c
+++ b/ksrc/skins/native/task.c
@@ -2426,6 +2426,31 @@ int rt_task_reply(int flowid, RT_TASK_MCB *mcb_s)
  * Rescheduling: always unless the task was already terminated.
  */
 
+/**
+ * @fn int rt_task_same(RT_TASK *task1, RT_TASK *task2)
+ *
+ * @brief Compare two task descriptors.
+ *
+ * This service checks whether two task descriptors refer to the same
+ * task. This service is particularly useful in user-space, since
+ * rt_task_self() does return a task descriptor which is different
+ * from the original descriptor used by the application, but still
+ * refers to the same task internally.
+ *
+ * @param task1 The address of the first task descriptor to compare.
+ * @param task2 The address of the second task descriptor to compare.
+ *
+ * @return non-zero whenever the two task descriptors refer to the
+ * same task, zero otherwise.
+ *
+ * This service can be called from:
+ *
+ * - Kernel-based task.
+ * - User-space task.
+ *
+ * Rescheduling: never.
+ */
+
 /*...@}*/
 
 EXPORT_SYMBOL(rt_task_create);
diff --git a/src/skins/native/task.c b/src/skins/native/task.c
index 2c0c114..d975508 100644
--- a/src/skins/native/task.c
+++ b/src/skins/native/task.c
@@ -392,3 +392,8 @@ int rt_task_reply(int flowid, RT_TASK_MCB *mcb_s)
return XENOMAI_SKINCALL2(__native_muxid,
 __native_task_reply, flowid, mcb_s);
 }
+
+int rt_task_same(RT_TASK *task1, RT_TASK *task2)
+{
+   return task1-opaque == task2-opaque;
+}


___
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git


[Xenomai-git] Alexis Berlemont : analogy: in insn_read, no more real-time mode and automatic subd selection

2010-03-28 Thread GIT version control
Module: xenomai-2.5
Branch: master
Commit: 6fc5d49a8d978ff5b76afcb029fd6ba05dbd6e51
URL:
http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=6fc5d49a8d978ff5b76afcb029fd6ba05dbd6e51

Author: Alexis Berlemont alexis.berlem...@gmail.com
Date:   Sun Feb  7 00:34:06 2010 +0100

analogy: in insn_read, no more real-time mode and automatic subd selection

Turning insn_read into a real-time process was useless even for
testing. That is why the option was removed. 

Starting from now, the analog input subdevice is automatically
selected if the option -s is not filled

---

 src/utils/analogy/insn_read.c |  131 +---
 1 files changed, 56 insertions(+), 75 deletions(-)

diff --git a/src/utils/analogy/insn_read.c b/src/utils/analogy/insn_read.c
index 16fbb5a..47be76d 100644
--- a/src/utils/analogy/insn_read.c
+++ b/src/utils/analogy/insn_read.c
@@ -27,8 +27,6 @@
 #include errno.h
 #include getopt.h
 
-#include native/task.h
-
 #include analogy/analogy.h
 
 #define FILENAME analogy0
@@ -38,17 +36,13 @@
 static unsigned char buf[BUF_SIZE];
 static char *filename = FILENAME;
 static int verbose;
-static int real_time;
-static int idx_subd;
+static int idx_subd = -1;
 static int idx_chan;
 static int idx_rng = -1;
 static unsigned int scan_size = SCAN_CNT;
 
-static RT_TASK rt_task_desc;
-
 struct option insn_read_opts[] = {
{verbose, no_argument, NULL, 'v'},
-   {real-time, no_argument, NULL, 'r'},
{device, required_argument, NULL, 'd'},
{subdevice, required_argument, NULL, 's'},
{scan-count, required_argument, NULL, 'S'},
@@ -64,8 +58,6 @@ void do_print_usage(void)
fprintf(stdout, usage:\tinsn_read [OPTS]\n);
fprintf(stdout, \tOPTS:\t -v, --verbose: verbose output\n);
fprintf(stdout,
-   \t\t -r, --real-time: enable real-time acquisition mode\n);
-   fprintf(stdout,
\t\t -d, --device: device filename (analogy0, analogy1, 
...)\n);
fprintf(stdout, \t\t -s, --subdevice: subdevice index\n);
fprintf(stdout, \t\t -S, --scan-count: count of scan to perform\n);
@@ -193,26 +185,24 @@ out:
 
 int main(int argc, char *argv[])
 {
-   int ret = 0;
+   int i = 0, err = 0;
unsigned int cnt = 0;
a4l_desc_t dsc = { .sbdata = NULL };
+   a4l_sbinfo_t *sbinfo;
a4l_chinfo_t *chinfo;
a4l_rnginfo_t *rnginfo;
 
int (*dump_function) (a4l_desc_t *, unsigned char *, int) = dump_text;
 
/* Compute arguments */
-   while ((ret = getopt_long(argc,
+   while ((err = getopt_long(argc,
  argv,
  vrd:s:S:c:R:wh, insn_read_opts,
  NULL)) = 0) {
-   switch (ret) {
+   switch (err) {
case 'v':
verbose = 1;
break;
-   case 'r':
-   real_time = 1;
-   break;
case 'd':
filename = optarg;
break;
@@ -245,43 +235,18 @@ int main(int argc, char *argv[])
return -EINVAL;
}

-   if (real_time != 0) {
-
-   if (verbose != 0)
-   printf(insn_read: switching to real-time mode\n);
-
-   /* Prevent any memory-swapping for this program */
-   ret = mlockall(MCL_CURRENT | MCL_FUTURE);
-   if (ret  0) {
-   ret = errno;
-   fprintf(stderr, insn_read: mlockall failed (ret=%d)\n,
-   ret);
-   goto out_insn_read;
-   }
-
-   /* Turn the current process into an RT task */
-   ret = rt_task_shadow(rt_task_desc, NULL, 1, 0);
-   if (ret  0) {
-   fprintf(stderr,
-   insn_read: rt_task_shadow failed (ret=%d)\n,
-   ret);
-   goto out_insn_read;
-   }
-
-   }
-
/* Open the device */
-   ret = a4l_open(dsc, filename);
-   if (ret  0) {
+   err = a4l_open(dsc, filename);
+   if (err  0) {
fprintf(stderr, 
-   insn_read: a4l_open %s failed (ret=%d)\n,
-   filename, ret);
-   return ret;
+   insn_read: a4l_open %s failed (err=%d)\n,
+   filename, err);
+   return err;
}
 
/* Check there is an input subdevice */
if (dsc.idx_read_subd  0) {
-   ret = -ENOENT;
+   err = -ENOENT;
fprintf(stderr, insn_read: no input subdevice available\n);
goto out_insn_read;
}
@@ -298,27 +263,52 @@ int main(int argc, char *argv[])
/* Allocate a buffer so as to get more info (subd, chan, rng) */
dsc.sbdata = 

[Xenomai-git] Stefan Schaal : analogy: add a4l_config_subd() declaration in analogy.h

2010-03-28 Thread GIT version control
Module: xenomai-2.5
Branch: master
Commit: 18f01559067cf9130524eced060255509c00c1c1
URL:
http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=18f01559067cf9130524eced060255509c00c1c1

Author: Stefan Schaal ssch...@usc.edu
Date:   Tue Feb  9 00:41:55 2010 +0100

analogy: add a4l_config_subd() declaration in analogy.h

---

 include/analogy/analogy.h |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/include/analogy/analogy.h b/include/analogy/analogy.h
index ca05d60..faff80f 100644
--- a/include/analogy/analogy.h
+++ b/include/analogy/analogy.h
@@ -130,6 +130,9 @@ int a4l_sync_read(a4l_desc_t * dsc,
  unsigned int chan_desc,
  unsigned int delay, void *buf, size_t nbyte);
 
+int a4l_config_subd(a4l_desc_t * dsc,
+   unsigned int idx_subd, unsigned int type, ...);
+
 int a4l_sync_dio(a4l_desc_t *dsc,
 unsigned int idx_subd, void *mask, void *buf);
 


___
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git


[Xenomai-git] Alexis Berlemont : analogy: minor changes in comments

2010-03-28 Thread GIT version control
Module: xenomai-2.5
Branch: master
Commit: c9fb5b9dac6883a90dfca42e4a4c71082a979f0b
URL:
http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=c9fb5b9dac6883a90dfca42e4a4c71082a979f0b

Author: Alexis Berlemont alexis.berlem...@gmail.com
Date:   Tue Feb  9 00:41:23 2010 +0100

analogy: minor changes in comments

---

 ksrc/drivers/analogy/device.c |   22 +++---
 1 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/ksrc/drivers/analogy/device.c b/ksrc/drivers/analogy/device.c
index cd586f7..082053f 100644
--- a/ksrc/drivers/analogy/device.c
+++ b/ksrc/drivers/analogy/device.c
@@ -95,7 +95,7 @@ int a4l_rdproc_devs(char *page,
p += sprintf(p, |  %02d | %s | %s\n, i, status, name);
}
 
-   /* Handles any proc-file reading way */
+   /* Handle any proc-file reading way */
len = p - page - off;
/* If the requested size is greater than we provide,
   the read operation is over */
@@ -122,18 +122,18 @@ int a4l_proc_attach(a4l_cxt_t * cxt)
struct proc_dir_entry *entry;
char *entry_name, *p;
 
-   /* Allocates the buffer for the file name */
+   /* Allocate the buffer for the file name */
entry_name = rtdm_malloc(A4L_NAMELEN + 4);
if ((p = entry_name) == NULL) {
__a4l_err(a4l_proc_attach: failed to allocate buffer\n);
return -ENOMEM;
}
 
-   /* Creates the proc file name */
+   /* Create the proc file name */
p += sprintf(p, %02d-, a4l_get_minor(cxt));
strncpy(p, dev-driver-board_name, A4L_NAMELEN);
 
-   /* Creates the proc entry */
+   /* Create the proc entry */
entry = create_proc_entry(entry_name, 0444, a4l_proc_root);
if (entry == NULL) {
__a4l_err(a4l_proc_attach: 
@@ -150,7 +150,7 @@ int a4l_proc_attach(a4l_cxt_t * cxt)
wrap_proc_dir_entry_owner(entry);
 
   out_setup_proc_transfer:
-   /* Frees the file name buffer */
+   /* Free the file name buffer */
rtdm_free(entry_name);
 
return ret;
@@ -161,7 +161,7 @@ void a4l_proc_detach(a4l_cxt_t * cxt)
char *entry_name, *p;
a4l_dev_t *dev = a4l_get_dev(cxt);
 
-   /* Allocates the buffer for the file name */
+   /* Allocate the buffer for the file name */
entry_name = rtdm_malloc(A4L_NAMELEN + 4);
if ((p = entry_name) == NULL) {
__a4l_err(a4l_proc_detach: 
@@ -169,14 +169,14 @@ void a4l_proc_detach(a4l_cxt_t * cxt)
return;
}
 
-   /* Builds the name */
+   /* Build the name */
p += sprintf(p, %02d-, a4l_get_minor(cxt));
strncpy(p, dev-driver-board_name, A4L_NAMELEN);
 
-   /* Removes the proc file */
+   /* Remove the proc file */
remove_proc_entry(entry_name, a4l_proc_root);
 
-   /* Frees the temporary buffer */
+   /* Free the temporary buffer */
rtdm_free(entry_name);
 }
 
@@ -460,10 +460,10 @@ int a4l_ioctl_devcfg(a4l_cxt_t * cxt, void *arg)
}
/* Pre-initialization of the transfer structure */
a4l_presetup_transfer(cxt);
-   /* Links the device with the driver */
+   /* Link the device with the driver */
if ((ret = a4l_device_attach(cxt, arg)) != 0)
return ret;
-   /* Creates the transfer structure and
+   /* Create the transfer structure and
   the related proc file */
if ((ret = a4l_setup_transfer(cxt)) != 0 ||
(ret = a4l_proc_attach(cxt)) != 0)


___
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git


[Xenomai-git] Alexis Berlemont : analogy: improve robustness of the detach procedure

2010-03-28 Thread GIT version control
Module: xenomai-2.5
Branch: master
Commit: 7682ee62bf180ccdf95fc300c7e40595a68e909a
URL:
http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=7682ee62bf180ccdf95fc300c7e40595a68e909a

Author: Alexis Berlemont alexis.berlem...@gmail.com
Date:   Tue Feb  9 00:40:51 2010 +0100

analogy: improve robustness of the detach procedure

If a subdevice was busy because of an acquisition, the detach
procedure failed and left the device in an incoherent state which
needed reboot. This bug was fixed by adding a pre-cleanup function
which tests subdevices' status.

---

 include/analogy/transfer.h  |2 +
 ksrc/drivers/analogy/device.c   |   13 ++---
 ksrc/drivers/analogy/transfer.c |   53 ++
 3 files changed, 52 insertions(+), 16 deletions(-)

diff --git a/include/analogy/transfer.h b/include/analogy/transfer.h
index e50d574..3d44ac6 100644
--- a/include/analogy/transfer.h
+++ b/include/analogy/transfer.h
@@ -33,6 +33,7 @@
 #define A4L_TSF_BUSY 0
 #define A4L_TSF_BULK 1
 #define A4L_TSF_MMAP 2
+#define A4L_TSF_CLEAN 3
 
 /* Fields init values */
 #define A4L_IRQ_UNUSED (unsigned int)((unsigned short)(~0))
@@ -81,6 +82,7 @@ int a4l_rdproc_transfer(char *page,
 
 void a4l_presetup_transfer(a4l_cxt_t * cxt);
 int a4l_setup_transfer(a4l_cxt_t * cxt);
+int a4l_precleanup_transfer(a4l_cxt_t * cxt);
 int a4l_cleanup_transfer(a4l_cxt_t * cxt);
 int a4l_reserve_transfer(a4l_cxt_t * cxt, int idx_subd);
 int a4l_init_transfer(a4l_cxt_t * cxt, a4l_cmd_t * cmd);
diff --git a/ksrc/drivers/analogy/device.c b/ksrc/drivers/analogy/device.c
index 1b7a012..cd586f7 100644
--- a/ksrc/drivers/analogy/device.c
+++ b/ksrc/drivers/analogy/device.c
@@ -432,18 +432,21 @@ int a4l_ioctl_devcfg(a4l_cxt_t * cxt, void *arg)
 
if (arg == NULL) {
/* Basic checking */
-   if (!test_bit
-   (A4L_DEV_ATTACHED, (a4l_get_dev(cxt)-flags))) {
+   if (!test_bit(A4L_DEV_ATTACHED, (a4l_get_dev(cxt)-flags))) {
__a4l_err(a4l_ioctl_devcfg: 
  free device, no driver to detach\n);
return -EINVAL;
}
-   /* Removes the related proc file */
+   /* Pre-cleanup of the transfer structure, we ensure
+  that nothing is busy */
+   if ((ret = a4l_precleanup_transfer(cxt)) != 0)
+   return ret;
+   /* Remove the related proc file */
a4l_proc_detach(cxt);
-   /* Frees the transfer structure and its related data */
+   /* Free the transfer structure and its related data */
if ((ret = a4l_cleanup_transfer(cxt)) != 0)
return ret;
-   /* Frees the device and the driver from each other */
+   /* Free the device and the driver from each other */
if ((ret = a4l_device_detach(cxt)) == 0)
clear_bit(A4L_DEV_ATTACHED,
  (a4l_get_dev(cxt)-flags));
diff --git a/ksrc/drivers/analogy/transfer.c b/ksrc/drivers/analogy/transfer.c
index b2c91bd..5239d08 100644
--- a/ksrc/drivers/analogy/transfer.c
+++ b/ksrc/drivers/analogy/transfer.c
@@ -33,39 +33,70 @@
 
 /* --- Initialization / cleanup / cancel functions --- */
 
-int a4l_cleanup_transfer(a4l_cxt_t * cxt)
+int a4l_precleanup_transfer(a4l_cxt_t * cxt)
 {
a4l_dev_t *dev;
a4l_trf_t *tsf;
-   int i;
+   int i, err = 0;
 
__a4l_dbg(1, core_dbg, 
- a4l_cleanup_transfer: minor=%d\n, 
+ a4l_precleanup_transfer: minor=%d\n, 
  a4l_get_minor(cxt));
 
dev = a4l_get_dev(cxt);
tsf = dev-transfer;
 
if (tsf == NULL) {
-   __a4l_err(a4l_cleanup_transfer: 
+   __a4l_err(a4l_precleanup_transfer: 
  incoherent status, transfer block not reachable\n);
return -ENODEV;
}
 
for (i = 0; i  tsf-nb_subd; i++) {
-   if (test_bit(A4L_TSF_BUSY, (tsf-status[i]))) {
-   __a4l_err(a4l_cleanup_transfer: 
- device busy, acquisition occuring\n);
-   return -EBUSY;
-   }
 
if (test_bit(A4L_TSF_MMAP, (tsf-status[i]))) {
-   __a4l_err(a4l_cleanup_transfer: 
+   __a4l_err(a4l_precleanup_transfer: 
  device busy, buffer must be unmapped\n);
-   return -EPERM;
+   err = -EPERM;
+   goto out_error;
}
+
+   if (test_and_set_bit(A4L_TSF_BUSY, (tsf-status[i]))) {
+   __a4l_err(a4l_precleanup_transfer: 
+ device busy, acquisition occuring\n);
+   err = -EBUSY;
+   goto out_error;
+

[Xenomai-git] Alexis Berlemont : analogy: fix a potential missing initialization of the subd descriptor

2010-03-28 Thread GIT version control
Module: xenomai-2.5
Branch: master
Commit: 6469e07b0a6069ccb91de0fa79b28e8f094ab1c6
URL:
http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=6469e07b0a6069ccb91de0fa79b28e8f094ab1c6

Author: Alexis Berlemont alexis.berlem...@gmail.com
Date:   Thu Feb 11 01:02:08 2010 +0100

analogy: fix a potential missing initialization of the subd descriptor

---

 src/utils/analogy/insn_bits.c  |   20 +++
 src/utils/analogy/insn_read.c  |   50 --
 src/utils/analogy/insn_write.c |   52 ---
 3 files changed, 73 insertions(+), 49 deletions(-)

diff --git a/src/utils/analogy/insn_bits.c b/src/utils/analogy/insn_bits.c
index d7a8e1b..9e672c4 100644
--- a/src/utils/analogy/insn_bits.c
+++ b/src/utils/analogy/insn_bits.c
@@ -152,6 +152,26 @@ int main(int argc, char *argv[])
if (verbose != 0)
printf(insn_bits: selected subdevice index = %d\n, idx_subd);
 
+   /* We must check that the subdevice is really a digital one
+  (in case, the subdevice index was set with the option -s) */
+   err = a4l_get_subdinfo(dsc, idx_subd, sbinfo);
+   if (err  0) {
+   fprintf(stderr, 
+   insn_bits: get_sbinfo(%d) failed (err = %d)\n,
+   idx_subd, err);
+   err = -EINVAL;
+   goto out_insn_bits;
+   }
+
+   if ((sbinfo-flags  A4L_SUBD_TYPES) != A4L_SUBD_DIO 
+   (sbinfo-flags  A4L_SUBD_TYPES) != A4L_SUBD_DI 
+   (sbinfo-flags  A4L_SUBD_TYPES) != A4L_SUBD_DO) {
+   fprintf(stderr, 
+   insn_bits: selected subdevice is not digital\n);
+   err = -EINVAL;
+   goto out_insn_bits; 
+   }
+   
/* Set the data size to read / write */
scan_size = a4l_sizeof_subd(sbinfo);
 
diff --git a/src/utils/analogy/insn_read.c b/src/utils/analogy/insn_read.c
index 47be76d..b3501ac 100644
--- a/src/utils/analogy/insn_read.c
+++ b/src/utils/analogy/insn_read.c
@@ -185,7 +185,7 @@ out:
 
 int main(int argc, char *argv[])
 {
-   int i = 0, err = 0;
+   int err = 0;
unsigned int cnt = 0;
a4l_desc_t dsc = { .sbdata = NULL };
a4l_sbinfo_t *sbinfo;
@@ -244,13 +244,6 @@ int main(int argc, char *argv[])
return err;
}
 
-   /* Check there is an input subdevice */
-   if (dsc.idx_read_subd  0) {
-   err = -ENOENT;
-   fprintf(stderr, insn_read: no input subdevice available\n);
-   goto out_insn_read;
-   }
-
if (verbose != 0) {
printf(insn_read: device %s opened (fd=%d)\n, filename,
   dsc.fd);
@@ -280,22 +273,9 @@ int main(int argc, char *argv[])
printf(insn_read: complex descriptor retrieved\n);
 
/* If no subdevice index was set, look for an analog input
-  subdevice (the first found will be selected) */
-   while (idx_subd == -1  i  dsc.nb_subd) {
-   
-   err = a4l_get_subdinfo(dsc, i, sbinfo);
-   if (err  0) {
-   fprintf(stderr, 
-   insn_read: get_sbinfo(%d) failed (err = %d)\n,
-   i, err);
-   goto out_insn_read;
-   }
-   
-   if ((sbinfo-flags  A4L_SUBD_TYPES) == A4L_SUBD_AI)
-   idx_subd = i;
-
-   i++;
-   }
+  subdevice */
+   if (idx_subd == -1)
+   idx_subd = dsc.idx_read_subd;
 
if (idx_subd == -1) {
fprintf(stderr, 
@@ -304,6 +284,28 @@ int main(int argc, char *argv[])
goto  out_insn_read;
}
 
+   if (verbose != 0)
+   printf(insn_read: selected subdevice index = %d\n, idx_subd);
+
+   /* We must check that the subdevice is really an AI one
+  (in case, the subdevice index was set with the option -s) */
+   err = a4l_get_subdinfo(dsc, idx_subd, sbinfo);
+   if (err  0) {
+   fprintf(stderr, 
+   insn_read: get_sbinfo(%d) failed (err = %d)\n,
+   idx_subd, err);
+   err = -EINVAL;
+   goto out_insn_read;
+   }
+
+   if ((sbinfo-flags  A4L_SUBD_TYPES) != A4L_SUBD_AI) {
+   fprintf(stderr, 
+   insn_read: wrong subdevice selected 
+   (not an analog input)\n);
+   err = -EINVAL;
+   goto out_insn_read; 
+   }
+
if (idx_rng = 0) {
 
err = a4l_get_rnginfo(dsc, 
diff --git a/src/utils/analogy/insn_write.c b/src/utils/analogy/insn_write.c
index 829b7d7..4039b90 100644
--- a/src/utils/analogy/insn_write.c
+++ b/src/utils/analogy/insn_write.c
@@ -70,7 +70,7 @@ void do_print_usage(void)
 
 int main(int argc, char *argv[])
 {
-   int i = 0, err = 0;
+   

[Xenomai-git] Alexis Berlemont : analogy: make a4l_config_subd support open drain configuration

2010-03-28 Thread GIT version control
Module: xenomai-2.5
Branch: master
Commit: 4d8bc9f203b926fb316b9695660ca187e13881da
URL:
http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=4d8bc9f203b926fb316b9695660ca187e13881da

Author: Alexis Berlemont alexis.berlem...@gmail.com
Date:   Sat Feb 20 17:34:14 2010 +0100

analogy: make a4l_config_subd support open drain configuration

---

 src/drvlib/analogy/sync.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/drvlib/analogy/sync.c b/src/drvlib/analogy/sync.c
index 73f1dd6..4bcde62 100644
--- a/src/drvlib/analogy/sync.c
+++ b/src/drvlib/analogy/sync.c
@@ -315,7 +315,7 @@ int a4l_sync_dio(a4l_desc_t *dsc,
return -EINVAL;
}
 
-   /* Send the config instruction */
+   /* Send the insn_bits instruction */
ret = a4l_snd_insn(dsc, insn);
 
/* Update the buffer if need be */
@@ -375,6 +375,7 @@ int a4l_config_subd(a4l_desc_t * dsc,
switch (type) {
case A4L_INSN_CONFIG_DIO_OUTPUT:
case A4L_INSN_CONFIG_DIO_INPUT:
+   case A4L_INSN_CONFIG_DIO_OPENDRAIN:
{
unsigned int idx_chan = va_arg(args, unsigned int);
insn.chan_desc = CHAN(idx_chan);


___
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git


[Xenomai-git] Alexis Berlemont : analogy: [pcimio] fix many race conditions in DMA output transfers

2010-03-28 Thread GIT version control
Module: xenomai-2.5
Branch: master
Commit: 07bae25974ad76d29a427b195c6b7de1c0d30c63
URL:
http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=07bae25974ad76d29a427b195c6b7de1c0d30c63

Author: Alexis Berlemont alexis.berlem...@gmail.com
Date:   Mon Mar  1 01:08:28 2010 +0100

analogy: [pcimio] fix many race conditions in DMA output transfers

WARNING: Some parts of the driver mio_common cannot be tolerated in a
real-time system. For example, the function ni_ao_wait_for_dma_load
must be reviewed; it contains two busy waiting loops which can last up
to 1 micro-seconds.

---

 .../analogy/national_instruments/mio_common.c  |   98 +++
 ksrc/drivers/analogy/national_instruments/mite.c   |   17 +++-
 2 files changed, 72 insertions(+), 43 deletions(-)

diff --git a/ksrc/drivers/analogy/national_instruments/mio_common.c 
b/ksrc/drivers/analogy/national_instruments/mio_common.c
index db9762a..1a39206 100644
--- a/ksrc/drivers/analogy/national_instruments/mio_common.c
+++ b/ksrc/drivers/analogy/national_instruments/mio_common.c
@@ -506,17 +506,28 @@ void mite_handle_b_linkc(a4l_subd_t *subd)
a4l_unlock_irqrestore(devpriv-mite_channel_lock, flags);
 }
 
-static int ni_ao_wait_for_dma_load(a4l_dev_t *dev)
+static int ni_ao_wait_for_dma_load(a4l_subd_t *subd)
 {
static const int timeout = 1;
+
+   a4l_dev_t *dev = subd-dev;
+   a4l_buf_t *buf = dev-transfer.bufs[subd-idx];
+
int i;
 
for (i = 0; i  timeout; i++) {
+   
+   int buffer_filled;
unsigned short b_status;
 
b_status = devpriv-stc_readw(dev, AO_Status_1_Register);
-   if (b_status  AO_FIFO_Half_Full_St)
+
+   buffer_filled = test_bit(A4L_BUF_EOA_NR, buf-evt_flags);
+   buffer_filled |= (b_status  AO_FIFO_Half_Full_St);
+
+   if (buffer_filled)
break;
+
/* If we poll too often, the pci bus activity seems
   to slow the dma transfer down */
a4l_udelay(10);
@@ -569,7 +580,7 @@ static inline int ni_request_cdo_mite_channel(a4l_dev_t 
*dev)
 #define ni_sync_ai_dma(x) do { } while (0)
 #define mite_handle_b_linkc(x) do { } while (0)
 
-static inline int ni_ao_wait_for_dma_load(a4l_dev_t *dev)
+static inline int ni_ao_wait_for_dma_load(a4l_subd_t *subd)
 {
return -ENOTSUPP;
 }
@@ -714,14 +725,12 @@ static void ni_handle_eos(a4l_subd_t *subd)
 }
 
 static void ni_event(a4l_subd_t * subd)
-{
-   
+{  
/* Temporary hack */
a4l_dev_t *dev = subd-dev;
a4l_buf_t *buf = dev-transfer.bufs[subd-idx];
 
-   if(test_bit(A4L_BUF_ERROR, buf-evt_flags)) {
-
+   if(test_bit(A4L_BUF_ERROR_NR, buf-evt_flags)) {
if (subd-cancel != NULL)
subd-cancel(subd);
}
@@ -939,28 +948,15 @@ static void handle_b_interrupt(a4l_dev_t * dev,
 
a4l_subd_t *subd = a4l_get_subd(dev, NI_AO_SUBDEV);
 
-   a4l_info(dev, ni_mio_common: interrupt: b_status=%04x 
m1_status=%08x\n,
-b_status, ao_mite_status);
-   ni_mio_print_status_b(b_status);
-
-#if (defined(CONFIG_XENO_DRIVERS_ANALOGY_NI_MITE) || \
- defined(CONFIG_XENO_DRIVERS_ANALOGY_NI_MITE_MODULE))
-   /* Currently, mite.c requires us to handle LINKC */
-   if (ao_mite_status  CHSR_LINKC) {
-   mite_handle_b_linkc(subd);
-   }
+   a4l_dbg(1, drv_dbg, dev, 
+   ni_mio_common: interrupt: b_status=%04x m1_status=%08x\n,
+   b_status, ao_mite_status);
 
-   if (ao_mite_status  ~(CHSR_INT | CHSR_LINKC | CHSR_DONE | CHSR_MRDY |
-  CHSR_DRDY | CHSR_DRQ1 | CHSR_DRQ0 | CHSR_ERROR |
-  CHSR_SABORT | CHSR_XFERR | CHSR_LxERR_mask)) {
-   a4l_info(dev, unknown mite interrupt, ack! 
(ao_mite_status=%08x)\n,
-ao_mite_status);
-   a4l_buf_evt(subd, A4L_BUF_ERROR);
-   }
-#endif /* CONFIG_XENO_DRIVERS_ANALOGY_NI_MITE */
+   ni_mio_print_status_b(b_status);
 
if (b_status == 0x)
return;
+
if (b_status  AO_Overrun_St) {
a4l_err(dev,
ni_mio_common: interrupt: 
@@ -971,15 +967,38 @@ static void handle_b_interrupt(a4l_dev_t * dev,
}
 
if (b_status  AO_BC_TC_St) {
-   a4l_info(dev,
-ni_mio_common: interrupt: 
-AO BC_TC status=0x%04x status2=0x%04x\n, 
-b_status, devpriv-stc_readw(dev, 
AO_Status_2_Register));
+   a4l_dbg(1, drv_dbg, dev,
+   ni_mio_common: interrupt: 
+   AO BC_TC status=0x%04x status2=0x%04x\n, 
+   b_status, devpriv-stc_readw(dev, 
AO_Status_2_Register));
a4l_buf_evt(subd, A4L_BUF_EOA);
}
 
+#if 

[Xenomai-git] Alexis Berlemont : analogy: make __pre_abs_get more robust at ends of acquisitions

2010-03-28 Thread GIT version control
Module: xenomai-2.5
Branch: master
Commit: fe740c3a21a886e58b52f51c9874a1b1a445aa99
URL:
http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=fe740c3a21a886e58b52f51c9874a1b1a445aa99

Author: Alexis Berlemont alexis.berlem...@gmail.com
Date:   Mon Mar  1 01:09:44 2010 +0100

analogy: make __pre_abs_get more robust at ends of acquisitions

---

 include/analogy/buffer.h |   28 ++--
 1 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/include/analogy/buffer.h b/include/analogy/buffer.h
index 7b210b8..0e8f279 100644
--- a/include/analogy/buffer.h
+++ b/include/analogy/buffer.h
@@ -201,12 +201,36 @@ static inline int __pre_put(a4l_buf_t * buf, unsigned 
long count)
 
 static inline int __pre_abs_get(a4l_buf_t * buf, unsigned long count)
 {
-   if (!(buf-tmp_count == 0  buf-cns_count == 0) 
-   (long)(count - buf-tmp_count)  0) {
+
+   /* The first time, we expect the buffer to be properly filled
+   before the trigger occurence; by the way, we need tmp_count to
+   have been initialized and tmp_count is updated right here */
+   if (buf-tmp_count == 0 || buf-cns_count == 0) 
+   goto out;
+
+   /* At the end of the acquisition, the user application has
+   written the defined amount of data into the buffer; so the
+   last time, the DMA channel can easily overtake the tmp
+   frontier because no more data were sent from user space;
+   therefore no useless alarm should be sent */
+   if ((long)(count - buf-end_count)  0)
+   goto out;
+
+   /* Once the exception are passed, we check that the DMA
+   transfer has not overtaken the last record of the production
+   count (tmp_count was updated with prd_count the last time
+   __pre_abs_get was called). We must understand that we cannot
+   compare the current DMA count with the current production
+   count because even if, right now, the production count is
+   higher than the DMA count, it does not mean that the DMA count
+   was not greater a few cycles before; in such case, the DMA
+   channel would have retrieved the wrong data */
+   if ((long)(count - buf-tmp_count)  0) {
set_bit(A4L_BUF_ERROR_NR, buf-evt_flags);
return -EPIPE;
}
 
+out:
buf-tmp_count = buf-prd_count;
 
return 0;


___
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git


[Xenomai-git] Alexis Berlemont : analogy: fix a bug in cmd_read with real-time mode enabled

2010-03-28 Thread GIT version control
Module: xenomai-2.5
Branch: master
Commit: 0584265f069be4447cdb853062b095b0c3889627
URL:
http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=0584265f069be4447cdb853062b095b0c3889627

Author: Alexis Berlemont alexis.berlem...@gmail.com
Date:   Sun Mar 14 01:25:51 2010 +0100

analogy: fix a bug in cmd_read with real-time mode enabled

The count of read bytes was overwritten by the results of the call to
rt_task_set_mode().

---

 src/utils/analogy/cmd_read.c |   15 +--
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/utils/analogy/cmd_read.c b/src/utils/analogy/cmd_read.c
index 1562a21..32d3db0 100644
--- a/src/utils/analogy/cmd_read.c
+++ b/src/utils/analogy/cmd_read.c
@@ -410,14 +410,16 @@ int main(int argc, char *argv[])
cnt += ret;
 
if (real_time != 0) {
-   ret = rt_task_set_mode(0, T_PRIMARY, NULL);
-   if (ret  0) {
+   int err = rt_task_set_mode(0, T_PRIMARY, NULL);
+   if (err  0) {
fprintf(stderr,
cmd_read: rt_task_set_mode 
failed (ret=%d)\n,
-   ret);
+   err);
+   ret = err;
goto out_main;
}
}
+
} while (ret  0);
 
} else {
@@ -465,11 +467,12 @@ int main(int argc, char *argv[])
}
 
if (real_time != 0) {
-   ret = rt_task_set_mode(0, T_PRIMARY, NULL);
-   if (ret  0) {
+   int err = rt_task_set_mode(0, T_PRIMARY, NULL);
+   if (err  0) {
fprintf(stderr,
cmd_read: rt_task_set_mode 
failed (ret=%d)\n,
-   ret);
+   err);
+   ret = err;
goto out_main;
}
}


___
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git


[Xenomai-git] Alexis Berlemont : analogy: remove rt_task_set_mode from test programs

2010-03-28 Thread GIT version control
Module: xenomai-2.5
Branch: master
Commit: 4be0333bef1a7dd41ef79b4d31209642b05e5593
URL:
http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=4be0333bef1a7dd41ef79b4d31209642b05e5593

Author: Alexis Berlemont alexis.berlem...@gmail.com
Date:   Tue Mar 16 01:11:55 2010 +0100

analogy: remove rt_task_set_mode from test programs

---

 src/utils/analogy/cmd_read.c  |   33 -
 src/utils/analogy/cmd_write.c |   11 ---
 2 files changed, 0 insertions(+), 44 deletions(-)

diff --git a/src/utils/analogy/cmd_read.c b/src/utils/analogy/cmd_read.c
index 32d3db0..1345f5b 100644
--- a/src/utils/analogy/cmd_read.c
+++ b/src/utils/analogy/cmd_read.c
@@ -375,17 +375,6 @@ int main(int argc, char *argv[])
if (verbose != 0)
printf(cmd_read: command successfully sent\n);
 
-   if (real_time != 0) {
-
-   ret = rt_task_set_mode(0, T_PRIMARY, NULL);
-   if (ret  0) {
-   fprintf(stderr,
-   cmd_read: rt_task_set_mode failed (ret=%d)\n,
-   ret);
-   goto out_main;
-   }
-   }
-
if (use_mmap == 0) {
 
/* Fetch data */
@@ -409,17 +398,6 @@ int main(int argc, char *argv[])
/* Update the counter */
cnt += ret;
 
-   if (real_time != 0) {
-   int err = rt_task_set_mode(0, T_PRIMARY, NULL);
-   if (err  0) {
-   fprintf(stderr,
-   cmd_read: rt_task_set_mode 
failed (ret=%d)\n,
-   err);
-   ret = err;
-   goto out_main;
-   }
-   }
-
} while (ret  0);
 
} else {
@@ -466,17 +444,6 @@ int main(int argc, char *argv[])
goto out_main;
}
 
-   if (real_time != 0) {
-   int err = rt_task_set_mode(0, T_PRIMARY, NULL);
-   if (err  0) {
-   fprintf(stderr,
-   cmd_read: rt_task_set_mode 
failed (ret=%d)\n,
-   err);
-   ret = err;
-   goto out_main;
-   }
-   }
-
/* Update the counter */
cnt += front;
 
diff --git a/src/utils/analogy/cmd_write.c b/src/utils/analogy/cmd_write.c
index 2e152ed..c76fa81 100644
--- a/src/utils/analogy/cmd_write.c
+++ b/src/utils/analogy/cmd_write.c
@@ -300,17 +300,6 @@ int main(int argc, char *argv[])
for (i = 0; i  BUF_SIZE; i++)
buf[i] = i;
 
-   if (real_time != 0) {
-
-   ret = rt_task_set_mode(0, T_PRIMARY, NULL);
-   if (ret  0) {
-   fprintf(stderr, 
-   cmd_read: rt_task_set_mode failed (ret=%d)\n,
-   ret);
-   goto out_main;
-   }
-   }
-
if (use_mmap == 0) {
 
/* Send data */


___
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git


[Xenomai-git] Alexis Berlemont : analogy: change the error code in case of context error (-EPERM - -ENOSYS)

2010-03-28 Thread GIT version control
Module: xenomai-2.5
Branch: master
Commit: de2005541a6eb13888a355cfe20f9c423cabb7bd
URL:
http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=de2005541a6eb13888a355cfe20f9c423cabb7bd

Author: Alexis Berlemont alexis.berlem...@gmail.com
Date:   Tue Mar 16 01:19:23 2010 +0100

analogy: change the error code in case of context error (-EPERM - -ENOSYS)

Replace the -EPERM code by the -ENOSYS in bufconfig and mmap
ioctls. These two ioctls must be performed in NRT context. With the
__xn_exec_adaptive flag, the syscalls may be restarted in the proper
domain (NRT in our case) if the suitable error code is sent.

---

 ksrc/drivers/analogy/buffer.c |7 ++-
 ksrc/drivers/analogy/device.c |2 +-
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/ksrc/drivers/analogy/buffer.c b/ksrc/drivers/analogy/buffer.c
index 0c66b4a..aa6acac 100644
--- a/ksrc/drivers/analogy/buffer.c
+++ b/ksrc/drivers/analogy/buffer.c
@@ -397,8 +397,7 @@ int a4l_ioctl_mmap(a4l_cxt_t *cxt, void *arg)
/* The mmap operation cannot be performed in a 
   real-time context */
if (a4l_test_rt() != 0) {
-   __a4l_err(a4l_ioctl_mmap: mmap must be done in NRT context\n);
-   return -EPERM;
+   return -ENOSYS;
}
 
/* Recover the argument structure */
@@ -473,9 +472,7 @@ int a4l_ioctl_bufcfg(a4l_cxt_t * cxt, void *arg)
/* As Linux API is used to allocate a virtual buffer,
   the calling process must not be in primary mode */
if (a4l_test_rt() != 0) {
-   __a4l_err(a4l_ioctl_bufcfg: buffer config must done 
- in NRT context\n);
-   return -EPERM;
+   return -ENOSYS;
}
 
if (rtdm_safe_copy_from_user(cxt-user_info,
diff --git a/ksrc/drivers/analogy/device.c b/ksrc/drivers/analogy/device.c
index 082053f..ec40b95 100644
--- a/ksrc/drivers/analogy/device.c
+++ b/ksrc/drivers/analogy/device.c
@@ -428,7 +428,7 @@ int a4l_ioctl_devcfg(a4l_cxt_t * cxt, void *arg)
  a4l_ioctl_devcfg: minor=%d\n, a4l_get_minor(cxt));
 
if (a4l_test_rt() != 0)
-   return -EPERM;
+   return -ENOSYS;
 
if (arg == NULL) {
/* Basic checking */


___
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git


[Xenomai-git] Philippe Gerum : Merge branch 'master' into for-upstream

2010-03-28 Thread GIT version control
Module: xenomai-2.5
Branch: master
Commit: a842c8bee849c4c60e89ec8a4f9b079b8cfd951f
URL:
http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=a842c8bee849c4c60e89ec8a4f9b079b8cfd951f

Author: Philippe Gerum r...@xenomai.org
Date:   Tue Mar 16 11:13:49 2010 +0100

Merge branch 'master' into for-upstream

---




___
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git


[Xenomai-git] Alexis Berlemont : analogy: [loop] add the asynchronous callbacks for the write subdevice

2010-03-28 Thread GIT version control
Module: xenomai-2.5
Branch: master
Commit: 83dafb0c04ed4693e6e9ecf2a4104fdb53dd9ae7
URL:
http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=83dafb0c04ed4693e6e9ecf2a4104fdb53dd9ae7

Author: Alexis Berlemont alexis.berlem...@gmail.com
Date:   Thu Mar 18 23:32:09 2010 +0100

analogy: [loop] add the asynchronous callbacks for the write subdevice

---

 ksrc/drivers/analogy/testing/loop.c |   23 ++-
 1 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/ksrc/drivers/analogy/testing/loop.c 
b/ksrc/drivers/analogy/testing/loop.c
index 1255f54..1f553c9 100644
--- a/ksrc/drivers/analogy/testing/loop.c
+++ b/ksrc/drivers/analogy/testing/loop.c
@@ -30,11 +30,11 @@ a4l_rngdesc_t loop_rngdesc = RNG_GLOBAL(loop_rngtab);
 /* Command options mask */
 static a4l_cmd_t loop_cmd_mask = {
.idx_subd = 0,
-   .start_src = TRIG_NOW,
+   .start_src = TRIG_NOW | TRIG_INT,
.scan_begin_src = TRIG_TIMER,
-   .convert_src = TRIG_NOW|TRIG_TIMER,
+   .convert_src = TRIG_NOW | TRIG_TIMER,
.scan_end_src = TRIG_COUNT,
-   .stop_src = TRIG_COUNT|TRIG_NONE,
+   .stop_src = TRIG_COUNT| TRIG_NONE,
 };
 
 /* Private data organization */
@@ -115,14 +115,17 @@ static void loop_task_proc(void *arg)
 /* Command callback */
 int loop_cmd(a4l_subd_t *subd, a4l_cmd_t *cmd)
 {
-   lpprv_t *priv = (lpprv_t *)subd-dev-priv;
-
-   a4l_info(subd-dev, loop_cmd: (subd=%d)\n, subd-idx);
+   a4l_info(subd-dev, loop_cmd: (subd=%d)\n, subd-idx);  
+   return 0;
+  
+}
 
+/* Trigger callback */
+int loop_trigger(a4l_subd_t *subd, lsampl_t trignum)
+{
+   lpprv_t *priv = (lpprv_t *)subd-dev-priv;
priv-loop_running = 1;
-  
return 0;
-  
 }
 
 /* Cancel callback */
@@ -179,7 +182,6 @@ void setup_input_subd(a4l_subd_t *subd)
subd-rng_desc = loop_rngdesc;
subd-chan_desc = loop_chandesc;
subd-do_cmd = loop_cmd;
-   subd-do_cmdtest = NULL;
subd-cancel = loop_cancel;
subd-cmd_mask = loop_cmd_mask;
subd-insn_read = loop_insn_read;
@@ -195,6 +197,9 @@ void setup_output_subd(a4l_subd_t *subd)
subd-flags |= A4L_SUBD_MMAP;
subd-rng_desc = loop_rngdesc;
subd-chan_desc = loop_chandesc;
+   subd-do_cmd = loop_cmd;
+   subd-trigger = loop_trigger;
+   subd-cmd_mask = loop_cmd_mask;
subd-insn_read = loop_insn_read;
subd-insn_write = loop_insn_write;
 }


___
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git


[Xenomai-git] Alexis Berlemont : analogy: in cmd_{read, write}, replace a4l_sys_* by a4l_async_*

2010-03-28 Thread GIT version control
Module: xenomai-2.5
Branch: master
Commit: e5d83a81b5ff7e77e67c229e66c6057126702c01
URL:
http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=e5d83a81b5ff7e77e67c229e66c6057126702c01

Author: Alexis Berlemont alexis.berlem...@gmail.com
Date:   Thu Mar 18 23:36:48 2010 +0100

analogy: in cmd_{read, write}, replace a4l_sys_* by a4l_async_*

The function a4l_sys_read and a4l_sys_write are not the default
functions to use in common applications; a4l_async_read and
a4l_async_write were provided on that purpose.

---

 src/utils/analogy/cmd_read.c  |3 +--
 src/utils/analogy/cmd_write.c |2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/utils/analogy/cmd_read.c b/src/utils/analogy/cmd_read.c
index 1345f5b..ee65dc9 100644
--- a/src/utils/analogy/cmd_read.c
+++ b/src/utils/analogy/cmd_read.c
@@ -379,9 +379,8 @@ int main(int argc, char *argv[])
 
/* Fetch data */
do {
-
/* Perform the read operation */
-   ret = a4l_sys_read(dsc.fd, buf, BUF_SIZE);
+   ret = a4l_async_read(dsc, buf, BUF_SIZE, A4L_INFINITE);
if (ret  0) {
fprintf(stderr,
cmd_read: a4l_read failed (ret=%d)\n,
diff --git a/src/utils/analogy/cmd_write.c b/src/utils/analogy/cmd_write.c
index c76fa81..5ce9218 100644
--- a/src/utils/analogy/cmd_write.c
+++ b/src/utils/analogy/cmd_write.c
@@ -308,7 +308,7 @@ int main(int argc, char *argv[])
(scan_size * cmd.stop_arg - cnt)  BUF_SIZE ? 
BUF_SIZE : (scan_size * cmd.stop_arg - cnt);
 
-   ret = a4l_sys_write(dsc.fd, buf, tmp);
+   ret = a4l_async_write(dsc, buf, tmp, A4L_INFINITE);
if (ret  0) {
fprintf(stderr,
cmd_write: a4l_write failed 
(ret=%d)\n,


___
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git


[Xenomai-git] Alexis Berlemont : analogy: declare a4l_async_read and a4l_async_write in analogy.h

2010-03-28 Thread GIT version control
Module: xenomai-2.5
Branch: master
Commit: dda990d9e6ed9299039614c6799c91a43c158243
URL:
http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=dda990d9e6ed9299039614c6799c91a43c158243

Author: Alexis Berlemont alexis.berlem...@gmail.com
Date:   Thu Mar 18 23:37:50 2010 +0100

analogy: declare a4l_async_read and a4l_async_write in analogy.h

---

 include/analogy/analogy.h |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/include/analogy/analogy.h b/include/analogy/analogy.h
index faff80f..c40f2e7 100644
--- a/include/analogy/analogy.h
+++ b/include/analogy/analogy.h
@@ -114,6 +114,12 @@ int a4l_poll(a4l_desc_t * dsc,
 int a4l_mmap(a4l_desc_t * dsc,
 unsigned int idx_subd, unsigned long size, void **ptr);
 
+int a4l_async_read(a4l_desc_t * dsc,
+  void *buf, size_t nbyte, unsigned long ms_timeout);
+
+int a4l_async_write(a4l_desc_t * dsc,
+   void *buf, size_t nbyte, unsigned long ms_timeout);
+
 int a4l_snd_insnlist(a4l_desc_t * dsc, a4l_insnlst_t * arg);
 
 int a4l_snd_insn(a4l_desc_t * dsc, a4l_insn_t *arg);


___
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git


[Xenomai-git] Daniele Nicolodi : analogy: [pcimio] enable subdevice buffer mmapping

2010-03-28 Thread GIT version control
Module: xenomai-2.5
Branch: master
Commit: efe65c75f8d38ac02459fab902150dde9ba39521
URL:
http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=efe65c75f8d38ac02459fab902150dde9ba39521

Author: Daniele Nicolodi nicol...@science.unitn.it
Date:   Fri Mar 19 00:11:31 2010 +0100

analogy: [pcimio] enable subdevice buffer mmapping

---

 .../analogy/national_instruments/mio_common.c  |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/ksrc/drivers/analogy/national_instruments/mio_common.c 
b/ksrc/drivers/analogy/national_instruments/mio_common.c
index 1a39206..a51a3cd 100644
--- a/ksrc/drivers/analogy/national_instruments/mio_common.c
+++ b/ksrc/drivers/analogy/national_instruments/mio_common.c
@@ -4913,7 +4913,7 @@ int ni_E_init(a4l_dev_t *dev)
a4l_dbg(1, drv_dbg, dev, 
mio_common: AI: %d channels\n, boardtype.n_adchan);
 
-   subd-flags = A4L_SUBD_AI | A4L_SUBD_CMD;
+   subd-flags = A4L_SUBD_AI | A4L_SUBD_CMD | A4L_SUBD_MMAP;
subd-rng_desc = ni_range_lkup[boardtype.gainlkup];
 
subd-chan_desc = kmalloc(sizeof(a4l_chdesc_t) + 
@@ -4981,7 +4981,7 @@ int ni_E_init(a4l_dev_t *dev)

 
if (boardtype.ao_fifo_depth) {
-   subd-flags |= A4L_SUBD_CMD;
+   subd-flags |= A4L_SUBD_CMD | A4L_SUBD_MMAP;
subd-do_cmd = ni_ao_cmd;
subd-cmd_mask = mio_ao_cmd_mask;
subd-do_cmdtest = ni_ao_cmdtest;


___
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git


[Xenomai-git] Daniele Nicolodi : analogy: fix a bug in a4l_ioctl_bufinfo when idle

2010-03-28 Thread GIT version control
Module: xenomai-2.5
Branch: master
Commit: 2b1efb3818166b57bfa87286309243a1aa20914c
URL:
http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=2b1efb3818166b57bfa87286309243a1aa20914c

Author: Daniele Nicolodi nicol...@science.unitn.it
Date:   Fri Mar 19 00:17:23 2010 +0100

analogy: fix a bug in a4l_ioctl_bufinfo when idle

---

 ksrc/drivers/analogy/buffer.c |   10 ++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/ksrc/drivers/analogy/buffer.c b/ksrc/drivers/analogy/buffer.c
index aa6acac..bbd79ec 100644
--- a/ksrc/drivers/analogy/buffer.c
+++ b/ksrc/drivers/analogy/buffer.c
@@ -557,6 +557,14 @@ int a4l_ioctl_bufinfo(a4l_cxt_t * cxt, void *arg)
 
buf = dev-transfer.bufs[info.idx_subd];
 
+   /* If a transfer is not occuring, simply return buffer
+  informations, otherwise make the transfer progress */
+   if (!test_bit(A4L_TSF_BUSY,
+  (dev-transfer.status[info.idx_subd]))) {
+   info.rw_count = 0;
+   goto a4l_ioctl_bufinfo_out;
+   }
+
ret = __handle_event(buf);
 
if (info.idx_subd == dev-transfer.idx_read_subd) {
@@ -618,6 +626,8 @@ int a4l_ioctl_bufinfo(a4l_cxt_t * cxt, void *arg)
buf-mng_count += tmp_cnt;
}
 
+a4l_ioctl_bufinfo_out: 
+
/* Sets the buffer size */
info.buf_size = buf-size;
 


___
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git


[Xenomai-git] Alexis Berlemont : analogy: add a description of TRIG_WAKE_EOS

2010-03-28 Thread GIT version control
Module: xenomai-2.5
Branch: master
Commit: b7b3659e92cc3ede73bb1ff8d9ed9f7afcdaf523
URL:
http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=b7b3659e92cc3ede73bb1ff8d9ed9f7afcdaf523

Author: Alexis Berlemont alexis.berlem...@gmail.com
Date:   Fri Mar 19 00:29:40 2010 +0100

analogy: add a description of TRIG_WAKE_EOS

---

 include/analogy/command.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/analogy/command.h b/include/analogy/command.h
index e0e84ec..29120bf 100644
--- a/include/analogy/command.h
+++ b/include/analogy/command.h
@@ -94,7 +94,7 @@
  */
 #define TRIG_OTHER 0x0100
 /** 
- * Trigger not implemented yet
+ * Wake up on end-of-scan
  */
 #define TRIG_WAKE_EOS  0x0020
 /** 


___
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git


[Xenomai-git] Alexis Berlemont : analogy: at close time, cancel any busy subdevice

2010-03-28 Thread GIT version control
Module: xenomai-2.5
Branch: master
Commit: c8f0dc05f19e15ea22852b1a2df28ccab3cc9c5c
URL:
http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=c8f0dc05f19e15ea22852b1a2df28ccab3cc9c5c

Author: Alexis Berlemont alexis.berlem...@gmail.com
Date:   Fri Mar 19 01:03:09 2010 +0100

analogy: at close time, cancel any busy subdevice

---

 include/analogy/transfer.h|1 +
 ksrc/drivers/analogy/rtdm_interface.c |5 +++--
 ksrc/drivers/analogy/transfer.c   |   16 
 3 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/include/analogy/transfer.h b/include/analogy/transfer.h
index 3d44ac6..e6bdc3c 100644
--- a/include/analogy/transfer.h
+++ b/include/analogy/transfer.h
@@ -87,6 +87,7 @@ int a4l_cleanup_transfer(a4l_cxt_t * cxt);
 int a4l_reserve_transfer(a4l_cxt_t * cxt, int idx_subd);
 int a4l_init_transfer(a4l_cxt_t * cxt, a4l_cmd_t * cmd);
 int a4l_cancel_transfer(a4l_cxt_t * cxt, int idx_subd);
+int a4l_cancel_transfers(a4l_cxt_t * cxt);
 
 ssize_t a4l_put(a4l_cxt_t * cxt, void *buf, size_t nbytes);
 ssize_t a4l_get(a4l_cxt_t * cxt, void *buf, size_t nbytes);
diff --git a/ksrc/drivers/analogy/rtdm_interface.c 
b/ksrc/drivers/analogy/rtdm_interface.c
index 86d3f9d..f769e4a 100644
--- a/ksrc/drivers/analogy/rtdm_interface.c
+++ b/ksrc/drivers/analogy/rtdm_interface.c
@@ -33,6 +33,7 @@
 #include analogy/context.h
 #include analogy/ioctl.h
 #include analogy/device.h
+#include analogy/transfer.h
 
 int (*a4l_ioctl_functions[NB_IOCTL_FUNCTIONS]) (a4l_cxt_t *, void *) = {
a4l_ioctl_devcfg,
@@ -141,9 +142,9 @@ int a4l_rt_close(struct rtdm_dev_context *context,
a4l_init_cxt(context, user_info, cxt);
a4l_set_dev(cxt);
__a4l_dbg(1, core_dbg, 
- a4l_rt_close: minor=%d\n, a4l_get_minor(cxt));
+ a4l_rt_close: minor=%d\n, a4l_get_minor(cxt)); 
 
-   return 0;
+   return a4l_cancel_transfers(cxt);;
 }
 
 ssize_t a4l_rt_read(struct rtdm_dev_context * context,
diff --git a/ksrc/drivers/analogy/transfer.c b/ksrc/drivers/analogy/transfer.c
index 5239d08..f25f912 100644
--- a/ksrc/drivers/analogy/transfer.c
+++ b/ksrc/drivers/analogy/transfer.c
@@ -337,6 +337,22 @@ int a4l_cancel_transfer(a4l_cxt_t * cxt, int idx_subd)
return ret;
 }
 
+int a4l_cancel_transfers(a4l_cxt_t * cxt)
+{
+   a4l_dev_t *dev = a4l_get_dev(cxt);
+   int i, ret = 0;
+
+   /* The caller of a4l_cancel_transfers is bound not to have
+  checked whether the subdevice was attached; so we do it here */
+   if (!test_bit(A4L_DEV_ATTACHED, dev-flags))
+   return 0;
+
+   for (i = 0; i  dev-transfer.nb_subd  ret == 0; i++)
+   ret = a4l_cancel_transfer(cxt, i);
+
+   return ret;
+}
+
 /* --- IRQ handling section --- */
 
 int a4l_request_irq(a4l_dev_t * dev,


___
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git


[Xenomai-git] Philippe Gerum : nucleus: reset deferred cancellation bit properly

2010-03-28 Thread GIT version control
Module: xenomai-2.5
Branch: master
Commit: b95f09bd0f00515482846efc8062aa6418e4e63b
URL:
http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=b95f09bd0f00515482846efc8062aa6418e4e63b

Author: Philippe Gerum r...@xenomai.org
Date:   Wed Mar 24 11:54:15 2010 +0100

nucleus: reset deferred cancellation bit properly

---

 ksrc/nucleus/thread.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/ksrc/nucleus/thread.c b/ksrc/nucleus/thread.c
index 77fa442..73163f2 100644
--- a/ksrc/nucleus/thread.c
+++ b/ksrc/nucleus/thread.c
@@ -337,7 +337,7 @@ void xnthread_finish_wait(struct xnthread_wait_context *wc,
 
curr-wcontext = NULL;
if ((wc-oldstate  XNDEFCAN) == 0)
-   xnthread_clear_state(curr, wc-oldstate);
+   xnthread_clear_state(curr, XNDEFCAN);
 
if (xnthread_test_state(curr, XNCANPND)) {
if (cleanup)


___
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git


[Xenomai-git] Gilles Chanteperdrix : common: use vdso to detect presence of the drop_u_mode syscall.

2010-03-28 Thread GIT version control
Module: xenomai-2.5
Branch: master
Commit: adf59b6c7744c3ca434b1fab78a3b510a3708d01
URL:
http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=adf59b6c7744c3ca434b1fab78a3b510a3708d01

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Sun Mar 28 19:42:50 2010 +0200

common: use vdso to detect presence of the drop_u_mode syscall.

---

 include/asm-generic/bits/current.h |1 +
 include/nucleus/vdso.h |4 ++--
 src/skins/common/current.c |   19 ---
 src/skins/common/sem_heap.c|4 
 4 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/include/asm-generic/bits/current.h 
b/include/asm-generic/bits/current.h
index 8a213d2..0f299ea 100644
--- a/include/asm-generic/bits/current.h
+++ b/include/asm-generic/bits/current.h
@@ -8,6 +8,7 @@ extern pthread_key_t xeno_current_mode_key;
 
 xnhandle_t xeno_slow_get_current(void);
 unsigned long xeno_slow_get_current_mode(void);
+void xeno_current_warn_old(void);
 
 #ifdef HAVE___THREAD
 extern __thread xnhandle_t xeno_current __attribute__ ((tls_model 
(initial-exec)));
diff --git a/include/nucleus/vdso.h b/include/nucleus/vdso.h
index 65e081a..c431f88 100644
--- a/include/nucleus/vdso.h
+++ b/include/nucleus/vdso.h
@@ -47,8 +47,8 @@ struct xnvdso {
 #define XNVDSO_FEAT_C  0x0004ULL
 #define XNVDSO_FEATURES(XNVDSO_FEAT_A | XNVDSO_FEAT_B | XVDSO_FEAT_C)
 */
-
-#define XNVDSO_FEATURES 0xULL
+#define XNVDSO_FEAT_DROP_U_MODE 0x0001ULL
+#define XNVDSO_FEATURES (XNVDSO_FEAT_DROP_U_MODE)
 
 extern struct xnvdso *nkvdso;
 
diff --git a/src/skins/common/current.c b/src/skins/common/current.c
index 4011cae..7f36991 100644
--- a/src/skins/common/current.c
+++ b/src/skins/common/current.c
@@ -6,6 +6,7 @@
 #include asm/xenomai/syscall.h
 #include nucleus/types.h
 #include nucleus/thread.h
+#include nucleus/vdso.h
 
 pthread_key_t xeno_current_mode_key;
 
@@ -66,24 +67,20 @@ static inline void free_current_mode(unsigned long *mode)
 
 #endif /* !HAVE___THREAD */
 
+void xeno_current_warn_old(void)
+{
+   fprintf(stderr, XENO_MODE_LEAK_WARNING);
+}
+
 static void cleanup_current_mode(void *key)
 {
unsigned long *mode = key;
-   int err;
 
*mode = -1;
 
-   err = XENOMAI_SYSCALL0(__xn_sys_drop_u_mode);
-
-   if (!err)
+   if (xnvdso_test_feature(XNVDSO_FEAT_DROP_U_MODE)) {
+   XENOMAI_SYSCALL0(__xn_sys_drop_u_mode);
free_current_mode(mode);
-   else {
-   static int warned;
-
-   if (!warned) {
-   warned = 1;
-   fprintf(stderr, XENO_MODE_LEAK_WARNING);
-   }
}
 }
 
diff --git a/src/skins/common/sem_heap.c b/src/skins/common/sem_heap.c
index 97888f1..bf7031d 100644
--- a/src/skins/common/sem_heap.c
+++ b/src/skins/common/sem_heap.c
@@ -10,7 +10,9 @@
 #include sys/ioctl.h
 #include sys/mman.h
 
+#include nucleus/vdso.h
 #include asm/xenomai/syscall.h
+#include asm-generic/bits/current.h
 
 #include sem_heap.h
 
@@ -91,6 +93,8 @@ static void xeno_init_vdso(void)
}
 
nkvdso = (struct xnvdso *)(xeno_sem_heap[1] + sysinfo.vdso);
+   if (!xnvdso_test_feature(XNVDSO_FEAT_DROP_U_MODE))
+   xeno_current_warn_old();
 }
 
 static void xeno_init_sem_heaps_inner(void)


___
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git


[Xenomai-git] Philippe Gerum : rtipc/bufp: prevent I/O waiters from missing a pulse

2010-03-28 Thread GIT version control
Module: xenomai-2.5
Branch: master
Commit: 7b0bb509f6a9b5a0bad8e7ae7609d26e9d4e06c2
URL:
http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=7b0bb509f6a9b5a0bad8e7ae7609d26e9d4e06c2

Author: Philippe Gerum r...@xenomai.org
Date:   Wed Mar 24 14:39:28 2010 +0100

rtipc/bufp: prevent I/O waiters from missing a pulse

---

 ksrc/drivers/ipc/bufp.c |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/ksrc/drivers/ipc/bufp.c b/ksrc/drivers/ipc/bufp.c
index 88200ab..04b3209 100644
--- a/ksrc/drivers/ipc/bufp.c
+++ b/ksrc/drivers/ipc/bufp.c
@@ -273,10 +273,12 @@ redo:
wait.len = len;
wait.sk = sk;
rtipc_prepare_wait(wait.wc);
-   rtipc_leave_atomic(wait.lockctx);
+   /*
+* Keep the nucleus lock across the wait call, so that
+* we don't miss a pulse.
+*/
ret = rtdm_event_timedwait(sk-i_event,
   sk-rx_timeout, toseq);
-   rtipc_enter_atomic(wait.lockctx);
rtipc_finish_wait(wait.wc, __bufp_cleanup_handler);
 
if (unlikely(ret))
@@ -504,10 +506,12 @@ redo:
wait.len = len;
wait.sk = rsk;
rtipc_prepare_wait(wait.wc);
-   rtipc_leave_atomic(wait.lockctx);
+   /*
+* Keep the nucleus lock across the wait call, so that
+* we don't miss a pulse.
+*/
ret = rtdm_event_timedwait(rsk-o_event,
   sk-tx_timeout, toseq);
-   rtipc_enter_atomic(wait.lockctx);
rtipc_finish_wait(wait.wc, __bufp_cleanup_handler);
if (unlikely(ret))
break;


___
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git


[Xenomai-git] Gilles Chanteperdrix : Merge commit 'rpm'

2010-03-28 Thread GIT version control
Module: xenomai-2.5
Branch: master
Commit: 82d75c91f7eb61aad7be1b3f61fb3a48a14ba6e1
URL:
http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=82d75c91f7eb61aad7be1b3f61fb3a48a14ba6e1

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Sun Mar 28 18:45:28 2010 +0200

Merge commit 'rpm'

---




___
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git


[Xenomai-git] Gilles Chanteperdrix : build: update version stamp

2010-03-28 Thread GIT version control
Module: xenomai-2.5
Branch: master
Commit: 036d47a16d9d78d7b8ade595181205772bc6487e
URL:
http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=036d47a16d9d78d7b8ade595181205772bc6487e

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Sun Mar 28 19:45:53 2010 +0200

build: update version stamp

---

 config/version|2 +-
 configure |   20 ++--
 include/nucleus/version.h |4 ++--
 3 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/config/version b/config/version
index 73462a5..f225a78 100644
--- a/config/version
+++ b/config/version
@@ -1 +1 @@
-2.5.1
+2.5.2
diff --git a/configure b/configure
index 665ae48..b643cc5 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.65 for Xenomai 2.5.1.
+# Generated by GNU Autoconf 2.65 for Xenomai 2.5.2.
 #
 # Report bugs to xenomai-h...@gna.org.
 #
@@ -701,8 +701,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='Xenomai'
 PACKAGE_TARNAME='xenomai'
-PACKAGE_VERSION='2.5.1'
-PACKAGE_STRING='Xenomai 2.5.1'
+PACKAGE_VERSION='2.5.2'
+PACKAGE_STRING='Xenomai 2.5.2'
 PACKAGE_BUGREPORT='xenomai-h...@gna.org'
 PACKAGE_URL=''
 
@@ -1505,7 +1505,7 @@ if test $ac_init_help = long; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat _ACEOF
-\`configure' configures Xenomai 2.5.1 to adapt to many kinds of systems.
+\`configure' configures Xenomai 2.5.2 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1576,7 +1576,7 @@ fi
 
 if test -n $ac_init_help; then
   case $ac_init_help in
- short | recursive ) echo Configuration of Xenomai 2.5.1:;;
+ short | recursive ) echo Configuration of Xenomai 2.5.2:;;
esac
   cat \_ACEOF
 
@@ -1742,7 +1742,7 @@ fi
 test -n $ac_init_help  exit $ac_status
 if $ac_init_version; then
   cat \_ACEOF
-Xenomai configure 2.5.1
+Xenomai configure 2.5.2
 generated by GNU Autoconf 2.65
 
 Copyright (C) 2009 Free Software Foundation, Inc.
@@ -2113,7 +2113,7 @@ cat config.log _ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by Xenomai $as_me 2.5.1, which was
+It was created by Xenomai $as_me 2.5.2, which was
 generated by GNU Autoconf 2.65.  Invocation command line was
 
   $ $0 $@
@@ -4639,7 +4639,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='xenomai'
- VERSION='2.5.1'
+ VERSION='2.5.2'
 
 
 cat confdefs.h _ACEOF
@@ -13462,7 +13462,7 @@ cat $CONFIG_STATUS \_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log=
-This file was extended by Xenomai $as_me 2.5.1, which was
+This file was extended by Xenomai $as_me 2.5.2, which was
 generated by GNU Autoconf 2.65.  Invocation command line was
 
   CONFIG_FILES= $CONFIG_FILES
@@ -13532,7 +13532,7 @@ _ACEOF
 cat $CONFIG_STATUS _ACEOF || ac_write_fail=1
 ac_cs_config=`$as_echo $ac_configure_args | sed 's/^ //; 
s/[\\\`\$]//g'`
 ac_cs_version=\\
-Xenomai config.status 2.5.1
+Xenomai config.status 2.5.2
 configured by $0, generated by GNU Autoconf 2.65,
   with options \\\$ac_cs_config\\
 
diff --git a/include/nucleus/version.h b/include/nucleus/version.h
index fd93e8c..f590a3f 100644
--- a/include/nucleus/version.h
+++ b/include/nucleus/version.h
@@ -26,8 +26,8 @@
CONFIG_XENO_VERSION_MINOR, \
CONFIG_XENO_REVISION_LEVEL)
 
-#define XENO_VERSION_NAME  Speed Of Light
+#define XENO_VERSION_NAME  Souls Of Distortion
 
-#define XENO_VERSION_STRING2.5.1
+#define XENO_VERSION_STRING2.5.2
 
 #endif /* _XENO_NUCLEUS_VERSION_H */


___
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git


[Xenomai-git] Gilles Chanteperdrix : doc: regenerate

2010-03-28 Thread GIT version control
Module: xenomai-2.5
Branch: master
Commit: 6b3e8f2e5c69397814cb2f4029cdfbaff16e113e
URL:
http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=6b3e8f2e5c69397814cb2f4029cdfbaff16e113e

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Sun Mar 28 19:48:04 2010 +0200

doc: regenerate

---

 doc/generated/html/api/8255_8c.html|2 +-
 doc/generated/html/api/8255_8h-source.html |2 +-
 doc/generated/html/api/8255_8h.html|2 +-
 doc/generated/html/api/alarm_8h-source.html|2 +-
 doc/generated/html/api/alarm_8h.html   |2 +-
 .../html/api/analogy_2buffer_8h-source.html|  392 +-
 doc/generated/html/api/analogy_2buffer_8h.html |2 +-
 .../html/api/analogy_2types_8h-source.html |2 +-
 doc/generated/html/api/analogy_2types_8h.html  |2 +-
 doc/generated/html/api/analogy_8h-source.html  |  102 +-
 doc/generated/html/api/analogy_8h.html |2 +-
 .../html/api/analogy__driver_8h-source.html|2 +-
 doc/generated/html/api/analogy__driver_8h.html |2 +-
 doc/generated/html/api/annotated.html  |2 +-
 doc/generated/html/api/apc_8h-source.html  |2 +-
 doc/generated/html/api/arm_2hal_8c.html|2 +-
 doc/generated/html/api/assert_8h-source.html   |2 +-
 doc/generated/html/api/async_8c.html   |2 +-
 doc/generated/html/api/bheap_8h-source.html|2 +-
 doc/generated/html/api/blackfin_2hal_8c.html   |2 +-
 doc/generated/html/api/blackfin_2nmi_8c.html   |2 +-
 doc/generated/html/api/bound__task_8c-example.html |2 +-
 doc/generated/html/api/bufd_8c.html|2 +-
 doc/generated/html/api/bufd_8h-source.html |2 +-
 doc/generated/html/api/bufd_8h.html|2 +-
 doc/generated/html/api/cancel_8h-source.html   |2 +-
 doc/generated/html/api/cb__lock_8h-source.html |2 +-
 .../html/api/channel__range_8h-source.html |2 +-
 doc/generated/html/api/channel__range_8h.html  |2 +-
 doc/generated/html/api/command_8c.html |2 +-
 doc/generated/html/api/command_8h-source.html  |2 +-
 doc/generated/html/api/command_8h.html |4 +-
 doc/generated/html/api/compiler_8h-source.html |2 +-
 doc/generated/html/api/cond__var_8c-example.html   |2 +-
 doc/generated/html/api/context_8h-source.html  |2 +-
 doc/generated/html/api/context_8h.html |2 +-
 doc/generated/html/api/cross-link_8c-example.html  |2 +-
 doc/generated/html/api/deprecated.html |2 +-
 doc/generated/html/api/descriptor_8c.html  |2 +-
 doc/generated/html/api/descriptor_8h-source.html   |2 +-
 doc/generated/html/api/descriptor_8h.html  |2 +-
 doc/generated/html/api/device_8h-source.html   |2 +-
 doc/generated/html/api/device_8h.html  |2 +-
 doc/generated/html/api/driver_8c.html  |2 +-
 doc/generated/html/api/driver_8h-source.html   |2 +-
 doc/generated/html/api/driver_8h.html  |2 +-
 doc/generated/html/api/driver__facilities_8c.html  |2 +-
 .../html/api/drivers_2analogy_2device_8c.html  |2 +-
 doc/generated/html/api/drvlib_8c.html  |2 +-
 doc/generated/html/api/event_8h-source.html|2 +-
 doc/generated/html/api/event_8h.html   |2 +-
 .../html/api/event__flags_8c-example.html  |2 +-
 doc/generated/html/api/examples.html   |2 +-
 doc/generated/html/api/files.html  |2 +-
 doc/generated/html/api/functions.html  |2 +-
 doc/generated/html/api/functions_func.html |2 +-
 doc/generated/html/api/functions_vars.html |2 +-
 doc/generated/html/api/generic_2hal_8c.html|2 +-
 doc/generated/html/api/generic_2nmi_8c.html|2 +-
 doc/generated/html/api/globals.html|4 +-
 doc/generated/html/api/globals_0x63.html   |2 +-
 doc/generated/html/api/globals_0x66.html   |2 +-
 doc/generated/html/api/globals_0x6e.html   |2 +-
 doc/generated/html/api/globals_0x70.html   |2 +-
 doc/generated/html/api/globals_0x72.html   |   52 +-
 doc/generated/html/api/globals_0x73.html   |2 +-
 doc/generated/html/api/globals_0x74.html   |2 +-
 doc/generated/html/api/globals_0x78.html   |2 +-
 doc/generated/html/api/globals_defs.html   |2 +-
 doc/generated/html/api/globals_defs_0x63.html  |2 +-
 doc/generated/html/api/globals_defs_0x66.html  |2 +-
 doc/generated/html/api/globals_defs_0x70.html  |2 +-
 doc/generated/html/api/globals_defs_0x72.html  |2 +-
 doc/generated/html/api/globals_defs_0x73.html  |2 +-
 doc/generated/html/api/globals_defs_0x74.html  |2 +-