[Xenomai-git] Jan Kiszka : POSIX: Fix error reporting of __real_accept

2009-10-25 Thread GIT version control
Module: xenomai-gch
Branch: for-head
Commit: 34234ca456a898cee2e31e133e0d87766f9cafe1
URL:
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=34234ca456a898cee2e31e133e0d87766f9cafe1

Author: Jan Kiszka jan.kis...@siemens.com
Date:   Fri Oct  2 11:18:25 2009 +0200

POSIX: Fix error reporting of __real_accept

The return values of __real_accept must not be processed via set_errno
as errno is already set correctly at this point.

Signed-off-by: Jan Kiszka jan.kis...@siemens.com

---

 src/skins/posix/rtdm.c |   13 -
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/skins/posix/rtdm.c b/src/skins/posix/rtdm.c
index 6e347fb..4e6685f 100644
--- a/src/skins/posix/rtdm.c
+++ b/src/skins/posix/rtdm.c
@@ -404,18 +404,21 @@ int __wrap_accept(int fd, struct sockaddr *addr, 
socklen_t * addrlen)
 
pthread_setcanceltype(oldtype, NULL);
 
-   if (fd = 0)
-   fd += __rtdm_fd_start;
+   if (fd  0)
+   return set_errno(fd);
+
+   return fd + __rtdm_fd_start;
} else {
fd = __real_accept(fd, addr, addrlen);
 
if (fd = __rtdm_fd_start) {
__real_close(fd);
-   fd = -EMFILE;
+   errno = EMFILE;
+   fd = -1;
}
-   }
 
-   return set_errno(fd);
+   return fd;
+   }
 }
 
 int __wrap_getsockname(int fd, struct sockaddr *name, socklen_t * namelen)


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


[Xenomai-git] Philippe Gerum : x86: fix 64bit build for SMP kernels 2.6.31

2009-10-25 Thread GIT version control
Module: xenomai-gch
Branch: for-head
Commit: fe7a1f7dc35f16a883297e257fb0b86cc1dca70a
URL:
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=fe7a1f7dc35f16a883297e257fb0b86cc1dca70a

Author: Philippe Gerum r...@xenomai.org
Date:   Sun Oct  4 00:11:28 2009 +0200

x86: fix 64bit build for SMP kernels  2.6.31

---

 ksrc/arch/x86/hal-common.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/ksrc/arch/x86/hal-common.c b/ksrc/arch/x86/hal-common.c
index b0be990..d037538 100644
--- a/ksrc/arch/x86/hal-common.c
+++ b/ksrc/arch/x86/hal-common.c
@@ -193,7 +193,7 @@ static inline void send_IPI_allbutself(int vector)
  | vector);
rthal_local_irq_restore_hw(flags);
 }
-#elif defined(__i386__)  LINUX_VERSION_CODE  KERNEL_VERSION(2,6,30)
+#elif LINUX_VERSION_CODE  KERNEL_VERSION(2,6,30)
 #include mach_ipi.h
 #else
 #define send_IPI_allbutself(vector)apic-send_IPI_allbutself(vector)


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


[Xenomai-git] Philippe Gerum : Merge commit 'jan'

2009-10-25 Thread GIT version control
Module: xenomai-gch
Branch: for-head
Commit: ba3e916833d91cad45ad04f45ed62551cfc3a7df
URL:
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=ba3e916833d91cad45ad04f45ed62551cfc3a7df

Author: Philippe Gerum r...@xenomai.org
Date:   Wed Oct  7 15:10:23 2009 +0200

Merge commit 'jan'

---




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


[Xenomai-git] Philippe Gerum : powerpc: fix commit number for 2.6.30.3-DENX

2009-10-25 Thread GIT version control
Module: xenomai-gch
Branch: for-head
Commit: 8c847c4bf43fa65c3ec541850ecdb7e96113e94f
URL:
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=8c847c4bf43fa65c3ec541850ecdb7e96113e94f

Author: Philippe Gerum r...@xenomai.org
Date:   Mon Oct 12 16:23:14 2009 +0200

powerpc: fix commit number for 2.6.30.3-DENX

---

 ksrc/arch/powerpc/patches/README |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/ksrc/arch/powerpc/patches/README b/ksrc/arch/powerpc/patches/README
index 3a5689a..cbabcc2 100644
--- a/ksrc/arch/powerpc/patches/README
+++ b/ksrc/arch/powerpc/patches/README
@@ -9,6 +9,7 @@ form of a kernel patch you have to apply against a vanilla 
kernel
 tree, before you attempt to compile the Xenomai codebase against the
 latter kernel.
 
+
 On the PowerPC 32bit architecture, Xenomai is supported on both the
 v2.4 and v2.6 Linux kernel series, for which the appropriate Adeos
 patches exist. The v2.4 kernel tree of reference for Xenomai/PowerPC
@@ -62,7 +63,8 @@ Patch Based on GIT commit # / TAG
 2.6.29.1-DENX-*/powerpcad6bad4bf6888f89353945ba90df3b6a5b42b8fa
 2.6.29.4-DENX-*/powerpc5e2fc2073ede8e33409fad91f4caf6db30cbfd76
 2.6.30-DENX-*/powerpc  7cb16ec2590815a67e5fb5c8994ead536613d922
-2.6.30.3-DENX-*/powerpc10b6847d1ba9d1db9572350b1fe169a957cf03de
+2.6.30.3-DENX-*/powerpc193e7866fc30ae29454fcc4d110166a86a963c9f
+
 [1] http://www.gna.org/projects/adeos/
 [2] git://www.denx.de/git/linuxppc_2_4_devel
 [3] git://www.denx.de/git/linux-2.6-denx.git


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


[Xenomai-git] Alexis Berlemont : Fix internal trigger via instruction ( we do not need any data in the

2009-10-25 Thread GIT version control
Module: xenomai-gch
Branch: for-head
Commit: a5e630c644d67aaffb524ba5b0f80ed4e8912c58
URL:
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=a5e630c644d67aaffb524ba5b0f80ed4e8912c58

Author: Alexis Berlemont alexis.berlem...@gmail.com
Date:   Sun Sep 27 16:24:15 2009 +0200

Fix internal trigger via instruction (we do not need any data in the
instruction structure)

---

 ksrc/drivers/comedi/instruction.c |9 ++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/ksrc/drivers/comedi/instruction.c 
b/ksrc/drivers/comedi/instruction.c
index 62579c8..67c75d6 100644
--- a/ksrc/drivers/comedi/instruction.c
+++ b/ksrc/drivers/comedi/instruction.c
@@ -80,11 +80,14 @@ int comedi_do_insn_trig(comedi_cxt_t * cxt, comedi_kinsn_t 
* dsc)
 {
comedi_subd_t *subd;
comedi_dev_t *dev = comedi_get_dev(cxt);
+   lsampl_t trignum;
 
/* Basic checkings */
-   if (dsc-data_size != 1)
+   if (dsc-data_size  1)
return -EINVAL;
-
+   
+   trignum = (dsc-data_size == 1) ? dsc-data[0] : 0;
+   
if (dsc-idx_subd = dev-transfer.nb_subd)
return -EINVAL;
 
@@ -95,7 +98,7 @@ int comedi_do_insn_trig(comedi_cxt_t * cxt, comedi_kinsn_t * 
dsc)
return -EINVAL;
 
/* Performs the trigger */
-   return subd-trigger(subd, dsc-data[0]);
+   return subd-trigger(subd, trignum);
 }
 
 int comedi_fill_insndsc(comedi_cxt_t * cxt, comedi_kinsn_t * dsc, void *arg)


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


[Xenomai-git] Alexis Berlemont : Add a trigger instruction

2009-10-25 Thread GIT version control
Module: xenomai-gch
Branch: for-head
Commit: bd71ec003c850e49146021dead566c6a3f0bef9a
URL:
http://git.xenomai.org/?p=xenomai-gch.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

2009-10-25 Thread GIT version control
Module: xenomai-gch
Branch: for-head
Commit: 8b50a6f567bec93f9a35e524c3a209bb47d9398f
URL:
http://git.xenomai.org/?p=xenomai-gch.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)

2009-10-25 Thread GIT version control
Module: xenomai-gch
Branch: for-head
Commit: 7268c3cc9708d45324471b9bc758e41c39b2b942
URL:
http://git.xenomai.org/?p=xenomai-gch.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 : Align fake macro declarations with real functions declarations

2009-10-25 Thread GIT version control
Module: xenomai-gch
Branch: for-head
Commit: 0fcf0021e4bce05aa48504d2b5190bd593270ebf
URL:
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=0fcf0021e4bce05aa48504d2b5190bd593270ebf

Author: Alexis Berlemont alexis.berlem...@gmail.com
Date:   Sat Oct 17 16:09:25 2009 +0200

Align fake macro declarations with real functions declarations

---

 ksrc/drivers/comedi/intel/8255.h |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/ksrc/drivers/comedi/intel/8255.h b/ksrc/drivers/comedi/intel/8255.h
index 70b9dca..79177d3 100644
--- a/ksrc/drivers/comedi/intel/8255.h
+++ b/ksrc/drivers/comedi/intel/8255.h
@@ -53,8 +53,8 @@ void subdev_8255_interrupt(comedi_subd_t *subd);
 
 #else /* !CONFIG_XENO_DRIVERS_COMEDI_8255 */
 
-#define subdev_8255_init(x, y) do { } while(0)
-#define subdev_8255_interrupt(x, y)do { } while(0)
+#define subdev_8255_init(x)do { } while(0)
+#define subdev_8255_interrupt(x)   do { } while(0)
 
 #endif /* CONFIG_XENO_DRIVERS_COMEDI_8255 */
 


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


[Xenomai-git] Alexis Berlemont : Fix modules compilations issues

2009-10-25 Thread GIT version control
Module: xenomai-gch
Branch: for-head
Commit: 094c9365f41b07ef5e368c74104ae837f1f7c759
URL:
http://git.xenomai.org/?p=xenomai-gch.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)

2009-10-25 Thread GIT version control
Module: xenomai-gch
Branch: for-head
Commit: 192b2587b299422ec460129862ca960ad54526e1
URL:
http://git.xenomai.org/?p=xenomai-gch.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 : Comedi4RTDM - Analogy (third part, kernel side compiles )

2009-10-25 Thread GIT version control
Module: xenomai-gch
Branch: for-head
Commit: e4c3fdc4e698f3f3effb95c032445d4401c2a90d
URL:
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=e4c3fdc4e698f3f3effb95c032445d4401c2a90d

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-gch.git;a=commitdiff;h=e4c3fdc4e698f3f3effb95c032445d4401c2a90d

___
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)

2009-10-25 Thread GIT version control
Module: xenomai-gch
Branch: for-head
Commit: 12c49468b60730738170ea59191d1fdea9cdc291
URL:
http://git.xenomai.org/?p=xenomai-gch.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] Jan Kiszka : native: Fix memory leak on heap/queue auto-deletion

2009-10-25 Thread GIT version control
Module: xenomai-gch
Branch: for-head
Commit: 3a7330b1642e9e07bfa35590b2d755d9652cd7a2
URL:
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=3a7330b1642e9e07bfa35590b2d755d9652cd7a2

Author: Jan Kiszka jan.kis...@siemens.com
Date:   Tue Oct 20 13:15:00 2009 +0200

native: Fix memory leak on heap/queue auto-deletion

We are currently leaking user space heap/queue objects when the owner
terminates without deleting them before. Fix it by releasing the objects
in the corresponding cleanup callbacks which are also called on owner
termination.

Signed-off-by: Jan Kiszka jan.kis...@siemens.com

---

 ksrc/skins/native/heap.c|5 +
 ksrc/skins/native/queue.c   |5 +
 ksrc/skins/native/syscall.c |   25 ++---
 3 files changed, 16 insertions(+), 19 deletions(-)

diff --git a/ksrc/skins/native/heap.c b/ksrc/skins/native/heap.c
index 9480f64..465b348 100644
--- a/ksrc/skins/native/heap.c
+++ b/ksrc/skins/native/heap.c
@@ -340,6 +340,11 @@ static void __heap_post_release(struct xnheap *h)
xnpod_schedule();
 
xnlock_put_irqrestore(nklock, s);
+
+#ifdef CONFIG_XENO_OPT_PERVASIVE
+   if (heap-cpid)
+   xnfree(heap);
+#endif
 }
 
 /**
diff --git a/ksrc/skins/native/queue.c b/ksrc/skins/native/queue.c
index f913675..845a1b6 100644
--- a/ksrc/skins/native/queue.c
+++ b/ksrc/skins/native/queue.c
@@ -303,6 +303,11 @@ static void __queue_post_release(struct xnheap *heap)
xnpod_schedule();
 
xnlock_put_irqrestore(nklock, s);
+
+#ifdef CONFIG_XENO_OPT_PERVASIVE
+   if (q-cpid)
+   xnfree(q);
+#endif
 }
 
 /**
diff --git a/ksrc/skins/native/syscall.c b/ksrc/skins/native/syscall.c
index 28c720e..cb9f075 100644
--- a/ksrc/skins/native/syscall.c
+++ b/ksrc/skins/native/syscall.c
@@ -2073,24 +2073,17 @@ static int __rt_queue_delete(struct pt_regs *regs)
 {
RT_QUEUE_PLACEHOLDER ph;
RT_QUEUE *q;
-   int err;
 
if (__xn_safe_copy_from_user(ph, (void __user *)__xn_reg_arg1(regs),
 sizeof(ph)))
return -EFAULT;
 
q = (RT_QUEUE *)xnregistry_fetch(ph.opaque);
-
if (!q)
-   err = -ESRCH;
-   else {
-   /* Callee will check the queue descriptor for validity again. */
-   err = rt_queue_delete_inner(q, (void __user *)ph.mapbase);
-   if (!err  q-cpid)
-   xnfree(q);
-   }
+   return -ESRCH;
 
-   return err;
+   /* Callee will check the queue descriptor for validity again. */
+   return rt_queue_delete_inner(q, (void __user *)ph.mapbase);
 }
 
 /*
@@ -2604,7 +2597,6 @@ static int __rt_heap_delete(struct pt_regs *regs)
 {
RT_HEAP_PLACEHOLDER ph;
RT_HEAP *heap;
-   int err;
 
if (__xn_safe_copy_from_user(ph, (void __user *)__xn_reg_arg1(regs),
 sizeof(ph)))
@@ -2613,15 +2605,10 @@ static int __rt_heap_delete(struct pt_regs *regs)
heap = (RT_HEAP *)xnregistry_fetch(ph.opaque);
 
if (!heap)
-   err = -ESRCH;
-   else {
-   /* Callee will check the heap descriptor for validity again. */
-   err = rt_heap_delete_inner(heap, (void __user *)ph.mapbase);
-   if (!err  heap-cpid)
-   xnfree(heap);
-   }
+   return -ESRCH;
 
-   return err;
+   /* Callee will check the heap descriptor for validity again. */
+   return rt_heap_delete_inner(heap, (void __user *)ph.mapbase);
 }
 
 /*


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


[Xenomai-git] Jan Kiszka : native: Release fastlock to the proper heap

2009-10-25 Thread GIT version control
Module: xenomai-gch
Branch: for-head
Commit: 527ad0232f5b27d48335d89eb6f32aa760673c3e
URL:
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=527ad0232f5b27d48335d89eb6f32aa760673c3e

Author: Jan Kiszka jan.kis...@siemens.com
Date:   Mon Oct 19 21:24:32 2009 +0200

native: Release fastlock to the proper heap

Don't assume rt_task_delete is only called for in-kernel users, it may
be triggered via auto-cleanup also on user space objects. So check for
the creator and release the fastlock to the correct heap.

Signed-off-by: Jan Kiszka jan.kis...@siemens.com

---

 ksrc/skins/native/mutex.c |   14 --
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/ksrc/skins/native/mutex.c b/ksrc/skins/native/mutex.c
index 20eb484..6cf7eb1 100644
--- a/ksrc/skins/native/mutex.c
+++ b/ksrc/skins/native/mutex.c
@@ -47,6 +47,7 @@
 #include nucleus/pod.h
 #include nucleus/registry.h
 #include nucleus/heap.h
+#include nucleus/sys_ppd.h
 #include native/task.h
 #include native/mutex.h
 
@@ -316,8 +317,17 @@ int rt_mutex_delete(RT_MUTEX *mutex)
err = rt_mutex_delete_inner(mutex);
 
 #ifdef CONFIG_XENO_FASTSYNCH
-   if (!err)
-   xnfree(mutex-synch_base.fastlock);
+   if (!err) {
+#ifdef CONFIG_XENO_OPT_PERVASIVE
+   if (mutex-cpid) {
+   int global = xnsynch_test_flags(mutex-synch_base,
+   RT_MUTEX_EXPORTED);
+   xnheap_free(xnsys_ppd_get(global)-sem_heap,
+   mutex-synch_base.fastlock);
+   } else
+#endif /* CONFIG_XENO_OPT_PERVASIVE */
+   xnfree(mutex-synch_base.fastlock);
+   }
 #endif /* CONFIG_XENO_FASTSYNCH */
 
return err;


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


[Xenomai-git] Jan Kiszka : nucleus: Use Linux spin lock for heap list management

2009-10-25 Thread GIT version control
Module: xenomai-gch
Branch: for-head
Commit: a302da0ecd8bdd61e5e28e6a4b54646658951b75
URL:
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=a302da0ecd8bdd61e5e28e6a4b54646658951b75

Author: Jan Kiszka jan.kis...@siemens.com
Date:   Mon Oct 19 21:24:32 2009 +0200

nucleus: Use Linux spin lock for heap list management

No need for hard nklock protection of kheapq and the map counter, a
normal spin lock suffices as all users must run over the root thread
anyway.

Signed-off-by: Jan Kiszka jan.kis...@siemens.com

---

 ksrc/nucleus/heap.c |   26 --
 1 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/ksrc/nucleus/heap.c b/ksrc/nucleus/heap.c
index 5080201..0784e35 100644
--- a/ksrc/nucleus/heap.c
+++ b/ksrc/nucleus/heap.c
@@ -947,8 +947,10 @@ EXPORT_SYMBOL_GPL(xnheap_check_block);
 #include linux/device.h
 #include linux/vmalloc.h
 #include linux/mm.h
+#include linux/spinlock.h
 
 static DEFINE_XNQUEUE(kheapq); /* Shared heap queue. */
+static DEFINE_SPINLOCK(kheapq_lock);
 
 static inline void *__alloc_and_reserve_heap(size_t size, int kmflags)
 {
@@ -1018,14 +1020,13 @@ static void __unreserve_and_free_heap(void *ptr, size_t 
size, int kmflags)
 static void xnheap_vmclose(struct vm_area_struct *vma)
 {
xnheap_t *heap = vma-vm_private_data;
-   spl_t s;
 
-   xnlock_get_irqsave(nklock, s);
+   spin_lock(kheapq_lock);
 
if (atomic_dec_and_test(heap-archdep.numaps)) {
if (heap-archdep.release) {
removeq(kheapq, heap-link);
-   xnlock_put_irqrestore(nklock, s);
+   spin_unlock(kheapq_lock);
__unreserve_and_free_heap(heap-archdep.heapbase,
  xnheap_extentsize(heap),
  heap-archdep.kmflags);
@@ -1034,7 +1035,7 @@ static void xnheap_vmclose(struct vm_area_struct *vma)
}
}
 
-   xnlock_put_irqrestore(nklock, s);
+   spin_unlock(kheapq_lock);
 }
 
 static struct vm_operations_struct xnheap_vmops = {
@@ -1064,9 +1065,8 @@ static int xnheap_ioctl(struct inode *inode,
 {
xnheap_t *heap;
int err = 0;
-   spl_t s;
 
-   xnlock_get_irqsave(nklock, s);
+   spin_lock(kheapq_lock);
 
heap = __validate_heap_addr((void *)arg);
 
@@ -1079,7 +1079,7 @@ static int xnheap_ioctl(struct inode *inode,
 
   unlock_and_exit:
 
-   xnlock_put_irqrestore(nklock, s);
+   spin_unlock(kheapq_lock);
 
return err;
 }
@@ -1144,7 +1144,6 @@ static int xnheap_mmap(struct file *file, struct 
vm_area_struct *vma)
 int xnheap_init_mapped(xnheap_t *heap, u_long heapsize, int memflags)
 {
void *heapbase;
-   spl_t s;
int err;
 
/* Caller must have accounted for internal overhead. */
@@ -1168,9 +1167,9 @@ int xnheap_init_mapped(xnheap_t *heap, u_long heapsize, 
int memflags)
heap-archdep.heapbase = heapbase;
heap-archdep.release = NULL;
 
-   xnlock_get_irqsave(nklock, s);
+   spin_lock(kheapq_lock);
appendq(kheapq, heap-link);
-   xnlock_put_irqrestore(nklock, s);
+   spin_unlock(kheapq_lock);
 
return 0;
 }
@@ -1180,20 +1179,19 @@ int xnheap_destroy_mapped(xnheap_t *heap, void 
(*release)(struct xnheap *heap),
 {
int ret = 0, ccheck;
unsigned long len;
-   spl_t s;
 
ccheck = mapaddr ? 1 : 0;
 
-   xnlock_get_irqsave(nklock, s);
+   spin_lock(kheapq_lock);
 
if (atomic_read(heap-archdep.numaps)  ccheck) {
heap-archdep.release = release;
-   xnlock_put_irqrestore(nklock, s);
+   spin_unlock(kheapq_lock);
return -EBUSY;
}
 
removeq(kheapq, heap-link); /* Prevent further mapping. */
-   xnlock_put_irqrestore(nklock, s);
+   spin_unlock(kheapq_lock);
 
len = xnheap_extentsize(heap);
 


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


[Xenomai-git] Philippe Gerum : powerpc: upgrade I-pipe support to 2.6.30.3-powerpc-2.7-02

2009-10-25 Thread GIT version control
Module: xenomai-gch
Branch: for-head
Commit: ac2d4299e55fa10bf0bd9377b58cf11380602ed0
URL:
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=ac2d4299e55fa10bf0bd9377b58cf11380602ed0

Author: Philippe Gerum r...@xenomai.org
Date:   Wed Oct 21 18:32:27 2009 +0200

powerpc: upgrade I-pipe support to 2.6.30.3-powerpc-2.7-02

---

 .../adeos-ipipe-2.6.30.3-powerpc-DENX-2.7-02.patch |11725 
 1 files changed, 11725 insertions(+), 0 deletions(-)

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

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


[Xenomai-git] Philippe Gerum : powerpc: upgrade I-pipe support to 2.6.30.3-powerpc-2.7-02

2009-10-25 Thread GIT version control
Module: xenomai-gch
Branch: for-head
Commit: 6a9b0d32b2b6da4d74a9c6fc7709bc6c4a584daf
URL:
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=6a9b0d32b2b6da4d74a9c6fc7709bc6c4a584daf

Author: Philippe Gerum r...@xenomai.org
Date:   Wed Oct 21 16:27:28 2009 +0200

powerpc: upgrade I-pipe support to 2.6.30.3-powerpc-2.7-02

---

 .../adeos-ipipe-2.6.30.3-powerpc-DENX-2.7-01.patch |11816 
 1 files changed, 0 insertions(+), 11816 deletions(-)

Diff:   
http://git.xenomai.org/?p=xenomai-gch.git;a=commitdiff;h=6a9b0d32b2b6da4d74a9c6fc7709bc6c4a584daf

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


[Xenomai-git] Philippe Gerum : nios2: fix documentation for hwdesign v3

2009-10-25 Thread GIT version control
Module: xenomai-gch
Branch: for-head
Commit: ce7ba65a482cc70d097c84d77b2c8e92e923b6e4
URL:
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=ce7ba65a482cc70d097c84d77b2c8e92e923b6e4

Author: Philippe Gerum r...@xenomai.org
Date:   Thu Oct 22 11:16:07 2009 +0200

nios2: fix documentation for hwdesign v3

---

 ksrc/arch/nios2/hal.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/ksrc/arch/nios2/hal.c b/ksrc/arch/nios2/hal.c
index e917e4b..27e18c0 100644
--- a/ksrc/arch/nios2/hal.c
+++ b/ksrc/arch/nios2/hal.c
@@ -47,8 +47,8 @@ static struct {
 
 /*
  * We have a dedicated high resolution timer defined by our design
- * (na_timer_xenomai), which the interrupt pipeline core initialized
- * at boot up. Therefore, there is not much left to do here.
+ * (na_hrtimer), which the interrupt pipeline core initialized at boot
+ * up. Therefore, there is not much left to do here.
  */
 int rthal_timer_request(void (*tick_handler) (void), int cpu)
 {


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


[Xenomai-git] Patrice Kadionik : doc: add guidelines for nios2 build

2009-10-25 Thread GIT version control
Module: xenomai-gch
Branch: for-head
Commit: bc683f6d21dee5647c9dc643831c1f75925d2dc1
URL:
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=bc683f6d21dee5647c9dc643831c1f75925d2dc1

Author: Patrice Kadionik kadio...@enseirb.fr
Date:   Thu Oct 22 11:37:12 2009 +0200

doc: add guidelines for nios2 build

---

 README.INSTALL |   50 +-
 1 files changed, 49 insertions(+), 1 deletions(-)

diff --git a/README.INSTALL b/README.INSTALL
index f099138..e64b6e0 100644
--- a/README.INSTALL
+++ b/README.INSTALL
@@ -434,7 +434,55 @@ $ cd $build_root
 $ $xenomai_root/configure --build=i686-pc-linux-gnu --host=arm-linux 
--enable-arm-mach=at91rm9200 --enable-arm-tsc
 $ make DESTDIR=$staging_dir install
 
-2.5 Building with the --enable-linux-build option
+2.5 Building for NIOS II
+
+
+NIOS II is a softcore processor developped by Altera and is dedicated to the 
Altera's FPGA circuits. 
+NIOS II with no MMU enabled is supported by the uClinux distribution.
+
+2.5.1 Minimum hardware requirements
+
+You have to start with a minimal system with at least:
+* A Nios II processor in f or s core version, with hardware multiplier, 
(f-core suggested, s-core is slower) and with no MMU enabled.
+* SDRAM (minimum requirement 8MB).
+* One full featured timer named sys_clk_timer used for uClinux.
+* A jtag/serial uart or a real serial uart (preferred).
+
+Note in Linux, IRQ 0 means auto-detected, so you must not use IRQ 0 for ANY 
devices.
+
+The Xenomai port for NIOS II uses extra hardware that you have to add in SOPC 
builder:
+- A  full featured 32-bit Timer named hrtimer with a 1 �s period.
+- A  full featured High Resolution 64-bit Timer named hrclock used for time 
stamping (1 �s period for example).
+
+PLEASE RESPECT hrtimer, hrclock names because the Xenomai port is based on 
them!
+
+You have to use Altera's Quartus II version 9.0 at least for synthesis.
+
+A good start for your design is to use reference design shipped with your 
target board.
+For example, with an Altera's board, you may use the 'standard' design. 
'Standard' reference designs for Altera's boards are available here: 
http://www.altera.com/support/examples/nios2/exm-nios2.html
+
+2.5.2 Xenomai compilation for NIOS II
+
+You should first verify that uClinux without Xenomai can run on the target 
board.
+The typical actions for building the uClinux kernel for NIOS II (available 
here: http://www.nioswiki.com/) are:
+If $uClinux-dist is the path of NIOS II uClinux release, for example: 
/home/test/nios2-linux/uClinux-dist 
+
+$ cd $uClinux-dist
+$ make menuconfig
+$ make vendor_hwselect SYSPTF=path to your system ptf
+$ make
+
+If the NIOS II cross-compiler is called nios2-linux-gcc, a typical compilation 
will look like:
+
+$ $xenomai_root/scripts/prepare-kernel.sh --arch=nios2 \
+  --adeos=$xenomai_root/ksrc/arch/nios2/patches/adeos-ipipe-2.6.26-rc6-nios2-* 
\
+  --linux=$linux_tree
+$ $xenomai_root/configure --host=nios2-linux
+$ make install DESTDIR=$uClinux-dist/romf
+$ cd $uClinux-dist
+$ make
+
+2.6 Building with the --enable-linux-build option
 -
 
 Build the Linux kernel as part of the user space support build process:


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


[Xenomai-git] Jan Kiszka : native: Avoid double release on queue/heap auto-cleanup

2009-10-25 Thread GIT version control
Module: xenomai-gch
Branch: for-head
Commit: 9e321d764445023459f8e65d46e47d0f4e51e805
URL:
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=9e321d764445023459f8e65d46e47d0f4e51e805

Author: Jan Kiszka jan.kis...@siemens.com
Date:   Thu Oct 22 14:38:12 2009 +0200

native: Avoid double release on queue/heap auto-cleanup

Commit 3a7330b164 also requires this patch to avoid that the queue and
heap objects are released twice on automatic cleanup (via the xnheap
release handler and via the ppd object queue flush).

Signed-off-by: Jan Kiszka jan.kis...@siemens.com

---

 include/native/heap.h  |2 +-
 include/native/queue.h |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/native/heap.h b/include/native/heap.h
index 5444a43..0c2a7a2 100644
--- a/include/native/heap.h
+++ b/include/native/heap.h
@@ -117,7 +117,7 @@ void __native_heap_pkg_cleanup(void);
 
 static inline void __native_heap_flush_rq(xnqueue_t *rq)
 {
-   xeno_flush_rq(RT_HEAP, rq, heap);
+   xeno_flush_rq_norelease(RT_HEAP, rq, heap);
 }
 
 int rt_heap_delete_inner(RT_HEAP *heap,
diff --git a/include/native/queue.h b/include/native/queue.h
index 77925c2..2951c42 100644
--- a/include/native/queue.h
+++ b/include/native/queue.h
@@ -129,7 +129,7 @@ void __native_queue_pkg_cleanup(void);
 
 static inline void __native_queue_flush_rq(xnqueue_t *rq)
 {
-   xeno_flush_rq(RT_QUEUE, rq, queue);
+   xeno_flush_rq_norelease(RT_QUEUE, rq, queue);
 }
 
 ssize_t rt_queue_receive_inner(RT_QUEUE *q, void **bufp,


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


[Xenomai-git] Philippe Gerum : powerpc: upgrade legacy I-pipe support to 2.6.20-powerpc-1 .9-03

2009-10-25 Thread GIT version control
Module: xenomai-gch
Branch: for-head
Commit: bcc61b2a1c69dd3efbd91ce65312f9ab2e15196a
URL:
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=bcc61b2a1c69dd3efbd91ce65312f9ab2e15196a

Author: Philippe Gerum r...@xenomai.org
Date:   Thu Oct 22 09:54:06 2009 +0200

powerpc: upgrade legacy I-pipe support to 2.6.20-powerpc-1.9-03

---

 ...tch = adeos-ipipe-2.6.20-powerpc-1.9-03.patch} |  187 ++--
 1 files changed, 17 insertions(+), 170 deletions(-)

diff --git a/ksrc/arch/powerpc/patches/adeos-ipipe-2.6.20-powerpc-1.9-02.patch 
b/ksrc/arch/powerpc/patches/adeos-ipipe-2.6.20-powerpc-1.9-03.patch
similarity index 98%
rename from ksrc/arch/powerpc/patches/adeos-ipipe-2.6.20-powerpc-1.9-02.patch
rename to ksrc/arch/powerpc/patches/adeos-ipipe-2.6.20-powerpc-1.9-03.patch
index 0261af1..9d1e0a8 100644
--- a/ksrc/arch/powerpc/patches/adeos-ipipe-2.6.20-powerpc-1.9-02.patch
+++ b/ksrc/arch/powerpc/patches/adeos-ipipe-2.6.20-powerpc-1.9-03.patch
@@ -1,56 +1,3 @@
-diff --git a/.gitignore b/.gitignore
-deleted file mode 100644
-index 060a71d..000
 a/.gitignore
-+++ /dev/null
-@@ -1,47 +0,0 @@
--#
--# NOTE! Don't add files that are generated in specific
--# subdirectories here. Add them in the .gitignore file
--# in that subdirectory instead.
--#
--# Normal rules
--#
--.*
--*.o
--*.a
--*.s
--*.ko
--*.so
--*.mod.c
--*.i
--*.lst
--*.symtypes
--
--#
--# Top-level generic files
--#
--tags
--TAGS
--vmlinux*
--System.map
--Module.symvers
--
--#
--# Generated include files
--#
--include/asm
--include/asm-*/asm-offsets.h
--include/config
--include/linux/autoconf.h
--include/linux/compile.h
--include/linux/version.h
--include/linux/utsrelease.h
--
--# stgit generated dirs
--patches-*
--
--# quilt's files
--patches
--series
--
--# cscope files
--cscope.*
 diff --git a/Makefile b/Makefile
 index 7e2750f..055ab06 100644
 --- a/Makefile
@@ -112,40 +59,6 @@ index d2ded19..06dd614 100644
  ifeq ($(CONFIG_PPC_MERGE),y)
  
  extra-$(CONFIG_PPC_STD_MMU)   := head_32.o
-diff --git a/arch/powerpc/kernel/align.c b/arch/powerpc/kernel/align.c
-index 4734b5d..18d72cd 100644
 a/arch/powerpc/kernel/align.c
-+++ b/arch/powerpc/kernel/align.c
-@@ -492,10 +492,11 @@ int fix_alignment(struct pt_regs *regs)
-   if (flags  S) {
-   /* Single-precision FP store requires conversion... */
- #ifdef CONFIG_PPC_FPU
--  preempt_disable();
-+  unsigned long irqflags;
-+  ipipe_preempt_disable(irqflags);
-   enable_kernel_fp();
-   cvt_df(data.dd, (float *)data.v[4], current-thread);
--  preempt_enable();
-+  ipipe_preempt_enable(irqflags);
- #else
-   return 0;
- #endif
-@@ -535,10 +536,13 @@ int fix_alignment(struct pt_regs *regs)
-   /* Single-precision FP load requires conversion... */
-   case LD+F+S:
- #ifdef CONFIG_PPC_FPU
--  preempt_disable();
-+  {
-+  unsigned long irqflags;
-+  ipipe_preempt_disable(irqflags);
-   enable_kernel_fp();
-   cvt_fd((float *)data.v[4], data.dd, current-thread);
--  preempt_enable();
-+  ipipe_preempt_enable(irqflags);
-+  }
- #else
-   return 0;
- #endif
 diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
 index b742013..fa5752a 100644
 --- a/arch/powerpc/kernel/cputable.c
@@ -1469,64 +1382,10 @@ index 000..83faab8
 +  addir1,r1,48
 +  bctr
 diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
-index f3d4dd5..55cbda3 100644
+index f3d4dd5..611683b 100644
 --- a/arch/powerpc/kernel/process.c
 +++ b/arch/powerpc/kernel/process.c
-@@ -63,6 +63,8 @@ struct task_struct *last_task_used_spe = NULL;
-  */
- void flush_fp_to_thread(struct task_struct *tsk)
- {
-+  unsigned long flags;
-+
-   if (tsk-thread.regs) {
-   /*
-* We need to disable preemption here because if we didn't,
-@@ -72,7 +74,7 @@ void flush_fp_to_thread(struct task_struct *tsk)
-* FPU, and then when we get scheduled again we would store
-* bogus values for the remaining FP registers.
-*/
--  preempt_disable();
-+  ipipe_preempt_disable(flags);
-   if (tsk-thread.regs-msr  MSR_FP) {
- #ifdef CONFIG_SMP
-   /*
-@@ -86,13 +88,13 @@ void flush_fp_to_thread(struct task_struct *tsk)
- #endif
-   giveup_fpu(current);
-   }
--  preempt_enable();
-+  ipipe_preempt_enable(flags);
-   }
- }
- 
- void enable_kernel_fp(void)
- {
--  WARN_ON(preemptible());
-+  WARN_ON(ipipe_root_domain_p  preemptible());
- 
- #ifdef CONFIG_SMP
-   if (current-thread.regs  (current-thread.regs-msr  MSR_FP))
-@@ -177,15 +179,17 @@ EXPORT_SYMBOL(enable_kernel_spe);
- 
- void 

[Xenomai-git] Oliver Schlenker : Fork-safe rt_print

2009-10-25 Thread GIT version control
Module: xenomai-gch
Branch: for-head
Commit: 656f8a85325ff6fe6aa84310c0c3b0728a5fa4fc
URL:
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=656f8a85325ff6fe6aa84310c0c3b0728a5fa4fc

Author: Oliver Schlenker oliver.schlen...@smmotioncontrol.de
Date:   Fri Oct 23 20:44:01 2009 +0200

Fork-safe rt_print

Fork-safe initialisation of rt_print library, necessary child initialisation are
done via pthread_atfork() when child process is started.

Signed-off-by: Oliver Schlenker oliver.schlen...@smmotioncontrol.de
Signed-off-by: Jan Kiszka jan.kis...@siemens.com

---

 src/rtdk/rt_print.c |   33 +
 1 files changed, 29 insertions(+), 4 deletions(-)

diff --git a/src/rtdk/rt_print.c b/src/rtdk/rt_print.c
index 0615247..dca9689 100644
--- a/src/rtdk/rt_print.c
+++ b/src/rtdk/rt_print.c
@@ -417,9 +417,35 @@ static void *printer_loop(void *arg)
}
 }
 
-void __rt_print_init(void)
+static void spawn_printer_thread(void)
 {
pthread_attr_t thattr;
+
+   pthread_attr_init(thattr);
+   pthread_attr_setstacksize(thattr, PTHREAD_STACK_MIN);
+   pthread_create(printer_thread, thattr, printer_loop, NULL);
+}
+
+static void forked_child_init(void)
+{
+   struct print_buffer *my_buffer = pthread_getspecific(buffer_key);
+   struct print_buffer **pbuffer = first_buffer;
+
+   /* re-init to avoid finding it locked by some parent thread */
+   pthread_mutex_init(buffer_lock, NULL);
+
+   while (*pbuffer) {
+   if (*pbuffer == my_buffer)
+   pbuffer = (*pbuffer)-next;
+   else
+   cleanup_buffer(*pbuffer);
+   }
+
+   spawn_printer_thread();
+}
+
+void __rt_print_init(void)
+{
const char *value_str;
unsigned long long period;
 
@@ -456,7 +482,6 @@ void __rt_print_init(void)
 
pthread_cond_init(printer_wakeup, NULL);
 
-   pthread_attr_init(thattr);
-   pthread_attr_setstacksize(thattr, PTHREAD_STACK_MIN);
-   pthread_create(printer_thread, thattr, printer_loop, NULL);
+   spawn_printer_thread();
+   pthread_atfork(NULL, NULL, forked_child_init);
 }


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