[Xenomai-git] Philippe Gerum : nios2: upgrade I-pipe support to 2.6.30-nios2-1.2-00

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: for-upstream
Commit: 786ec7c5fbef94a1ec2192ba2b43c0680cad6f1c
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=786ec7c5fbef94a1ec2192ba2b43c0680cad6f1c

Author: Philippe Gerum 
Date:   Wed Jun 16 07:58:47 2010 +0200

nios2: upgrade I-pipe support to 2.6.30-nios2-1.2-00

---

 ...patch => adeos-ipipe-2.6.30-nios2-1.2-00.patch} |  683 
 1 files changed, 410 insertions(+), 273 deletions(-)

diff --git a/ksrc/arch/nios2/patches/adeos-ipipe-2.6.30-nios2-1.1-00.patch 
b/ksrc/arch/nios2/patches/adeos-ipipe-2.6.30-nios2-1.2-00.patch
similarity index 94%
rename from ksrc/arch/nios2/patches/adeos-ipipe-2.6.30-nios2-1.1-00.patch
rename to ksrc/arch/nios2/patches/adeos-ipipe-2.6.30-nios2-1.2-00.patch
index 1c01a97..a89727a 100644
--- a/ksrc/arch/nios2/patches/adeos-ipipe-2.6.30-nios2-1.1-00.patch
+++ b/ksrc/arch/nios2/patches/adeos-ipipe-2.6.30-nios2-1.2-00.patch
@@ -1,6 +1,6 @@
-diff --git d01303a1/arch/nios2/Kconfig b/arch/nios2/Kconfig
+diff --git a/arch/nios2/Kconfig b/arch/nios2/Kconfig
 index 66b9348..82f997d 100644
 d01303a1/arch/nios2/Kconfig
+--- a/arch/nios2/Kconfig
 +++ b/arch/nios2/Kconfig
 @@ -309,6 +309,13 @@ config PASS_CMDLINE
  will override "Default kernel command string".
@@ -16,9 +16,9 @@ index 66b9348..82f997d 100644
  source "mm/Kconfig"
  
  config BOOT_LINK_OFFSET
-diff --git d01303a1/arch/nios2/boot/compressed/Makefile 
b/arch/nios2/boot/compressed/Makefile
+diff --git a/arch/nios2/boot/compressed/Makefile 
b/arch/nios2/boot/compressed/Makefile
 index c5413ef..b5048f5 100644
 d01303a1/arch/nios2/boot/compressed/Makefile
+--- a/arch/nios2/boot/compressed/Makefile
 +++ b/arch/nios2/boot/compressed/Makefile
 @@ -7,6 +7,13 @@
  targets   := vmlinux head.o misc.o \
@@ -34,9 +34,9 @@ index c5413ef..b5048f5 100644
  
  OBJECTS = $(obj)/head.o $(obj)/misc.o
  
-diff --git d01303a1/arch/nios2/kernel/Makefile b/arch/nios2/kernel/Makefile
+diff --git a/arch/nios2/kernel/Makefile b/arch/nios2/kernel/Makefile
 index 2f2425f..e12b3c7 100644
 d01303a1/arch/nios2/kernel/Makefile
+--- a/arch/nios2/kernel/Makefile
 +++ b/arch/nios2/kernel/Makefile
 @@ -14,6 +14,8 @@ obj-y   := entry.o traps.o irq.o syscalltable.o \
usb.o config.o dma-mapping.o \
@@ -47,9 +47,9 @@ index 2f2425f..e12b3c7 100644
  obj-$(CONFIG_MODULES) += module.o
  obj-$(CONFIG_PIO_DEVICES) += pio.o
  obj-$(CONFIG_AVALON_DMA) += dma.o
-diff --git d01303a1/arch/nios2/kernel/entry.S b/arch/nios2/kernel/entry.S
+diff --git a/arch/nios2/kernel/entry.S b/arch/nios2/kernel/entry.S
 index 8e275fb..7a15e36 100644
 d01303a1/arch/nios2/kernel/entry.S
+--- a/arch/nios2/kernel/entry.S
 +++ b/arch/nios2/kernel/entry.S
 @@ -52,6 +52,23 @@ ENTRY(system_call)
stw r2,PT_R2(sp)/* default return value in r2 */
@@ -151,12 +151,12 @@ index 8e275fb..7a15e36 100644
*/
  
  ENTRY(instruction_trap)
-diff --git d01303a1/arch/nios2/kernel/ipipe.c b/arch/nios2/kernel/ipipe.c
+diff --git a/arch/nios2/kernel/ipipe.c b/arch/nios2/kernel/ipipe.c
 new file mode 100644
-index 000..e88d788
+index 000..e86e08f
 --- /dev/null
 +++ b/arch/nios2/kernel/ipipe.c
-@@ -0,0 +1,446 @@
+@@ -0,0 +1,467 @@
 +/* -*- linux-c -*-
 + * linux/arch/nios2/kernel/ipipe.c
 + *
@@ -460,6 +460,18 @@ index 000..e88d788
 +  __ipipe_handle_irq(irq, regs);
 +  ipipe_trace_irq_exit(irq);
 +
++  if (user_mode(regs) &&
++  (current->ipipe_flags & PF_EVTRET) != 0) {
++  /*
++   * Testing for user_regs() eliminates foreign stack
++   * contexts, including from careless domains which did
++   * not set the foreign stack bit (foreign stacks are
++   * always kernel-based).
++   */
++  current->ipipe_flags &= ~PF_EVTRET;
++  __ipipe_dispatch_event(IPIPE_EVENT_RETURN, regs);
++  }
++
 +  if (__ipipe_root_domain_p) {
 +  if (!test_bit(IPIPE_STALL_FLAG, &ipipe_root_cpudom_var(status)))
 +  return 1;
@@ -578,6 +590,15 @@ index 000..e88d788
 +
 +  local_irq_save_hw(flags);
 +
++  /*
++   * This is the end of the syscall path, so we may
++   * safely assume a valid Linux task stack here.
++   */
++  if (current->ipipe_flags & PF_EVTRET) {
++  current->ipipe_flags &= ~PF_EVTRET;
++  __ipipe_dispatch_event(IPIPE_EVENT_RETURN, regs);
++  }
++
 +if (!__ipipe_root_domain_p) {
 +  local_irq_restore_hw(flags);
 +  return 1;
@@ -603,9 +624,9 @@ index 000..e88d788
 +void notrace mcount(void);
 +EXPORT_SYMBOL(mcount);
 +#endif /* CONFIG_IPIPE_TRACE_MCOUNT */
-diff --git d01303a1/arch/nios2/kernel/irq.c b/arch/nios2/kernel/irq.c
+diff --git a/arch/nios2/kernel/irq.c b/arch/nios2/kernel/irq.c
 index bcd915c..6b68f82 100644
 d01303a1/arch/nios2/kernel/irq.c
+--- a/arch/nios2/kernel/irq.c
 +++ b/arch/nios2/kernel/irq.c
 @@ -39,18 +39,26 @

[Xenomai-git] Philippe Gerum : rtai: disable for MMU-less and 64bit builds

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: for-upstream
Commit: 0cb79ba4056f0a6f08ace53ce7eedd39f8382aa9
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=0cb79ba4056f0a6f08ace53ce7eedd39f8382aa9

Author: Philippe Gerum 
Date:   Wed Jun 16 08:33:33 2010 +0200

rtai: disable for MMU-less and 64bit builds

This emulator is massively broken on those platforms, and fixing it
would require an ABI change, which would make no sense given that it
is on its way out.

---

 ksrc/skins/rtai/Kconfig |8 ++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/ksrc/skins/rtai/Kconfig b/ksrc/skins/rtai/Kconfig
index ac411eb..2555354 100644
--- a/ksrc/skins/rtai/Kconfig
+++ b/ksrc/skins/rtai/Kconfig
@@ -1,10 +1,14 @@
 menuconfig XENO_SKIN_RTAI
-   depends on XENO_OPT_NUCLEUS
-   tristate "RTAI emulator (DEPRECATED)"
+   depends on XENO_OPT_NUCLEUS && MMU && WORD_SIZE != 64
+   tristate "RTAI emulator (BROKEN, DEPRECATED)"
help
 
An emulator of the RTAI system.
 
+   This emulator is actually broken beyond all recognition:
+   - on MMU-less targets
+   - on 64bit targets
+
WARNING: This emulator is DEPRECATED. It is planned for
removal in v2.6.x. Legacy applications depending on it should
be converted to the native Xenomai API, which provides


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


[Xenomai-git] Philippe Gerum : nucleus: fix uninit variable

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: for-upstream
Commit: cd3c28d63c855d95b32015fc1001962da1554fec
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=cd3c28d63c855d95b32015fc1001962da1554fec

Author: Philippe Gerum 
Date:   Tue Jun 15 23:49:51 2010 +0200

nucleus: fix uninit variable

---

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

diff --git a/ksrc/nucleus/select.c b/ksrc/nucleus/select.c
index 29be0bc..656671d 100644
--- a/ksrc/nucleus/select.c
+++ b/ksrc/nucleus/select.c
@@ -179,7 +179,7 @@ EXPORT_SYMBOL_GPL(__xnselect_signal);
 void xnselect_destroy(struct xnselect *select_block)
 {
xnholder_t *holder;
-   int resched;
+   int resched = 0;
spl_t s;
 
xnlock_get_irqsave(&nklock, s);


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


[Xenomai-git] Philippe Gerum : x86: upgrade I-pipe support to 2.6.32.15-x86-2.7-01, 2.6. 34-x86-2.7-01

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: for-upstream
Commit: 41487b9f36ebe85033ba217f49e502d7f8d40f35
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=41487b9f36ebe85033ba217f49e502d7f8d40f35

Author: Philippe Gerum 
Date:   Mon Jun 14 11:48:11 2010 +0200

x86: upgrade I-pipe support to 2.6.32.15-x86-2.7-01, 2.6.34-x86-2.7-01

---

 ...atch => adeos-ipipe-2.6.32.15-x86-2.7-01.patch} |   11 ++-
 ...0.patch => adeos-ipipe-2.6.34-x86-2.7-01.patch} |   11 ++-
 2 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/ksrc/arch/x86/patches/adeos-ipipe-2.6.32.15-x86-2.7-00.patch 
b/ksrc/arch/x86/patches/adeos-ipipe-2.6.32.15-x86-2.7-01.patch
similarity index 99%
rename from ksrc/arch/x86/patches/adeos-ipipe-2.6.32.15-x86-2.7-00.patch
rename to ksrc/arch/x86/patches/adeos-ipipe-2.6.32.15-x86-2.7-01.patch
index 57287d9..fa5203e 100644
--- a/ksrc/arch/x86/patches/adeos-ipipe-2.6.32.15-x86-2.7-00.patch
+++ b/ksrc/arch/x86/patches/adeos-ipipe-2.6.32.15-x86-2.7-01.patch
@@ -168,7 +168,7 @@ index 0b72282..6574056 100644
  /*
 diff --git a/arch/x86/include/asm/ipipe.h b/arch/x86/include/asm/ipipe.h
 new file mode 100644
-index 000..a090aeb
+index 000..8b95530
 --- /dev/null
 +++ b/arch/x86/include/asm/ipipe.h
 @@ -0,0 +1,158 @@
@@ -199,10 +199,10 @@ index 000..a090aeb
 +#ifdef CONFIG_IPIPE
 +
 +#ifndef IPIPE_ARCH_STRING
-+#define IPIPE_ARCH_STRING "2.7-00"
++#define IPIPE_ARCH_STRING "2.7-01"
 +#define IPIPE_MAJOR_NUMBER2
 +#define IPIPE_MINOR_NUMBER7
-+#define IPIPE_PATCH_NUMBER0
++#define IPIPE_PATCH_NUMBER1
 +#endif
 +
 +DECLARE_PER_CPU(struct pt_regs, __ipipe_tick_regs);
@@ -6840,10 +6840,10 @@ index 000..6257dfa
 +obj-$(CONFIG_IPIPE_TRACE) += tracer.o
 diff --git a/kernel/ipipe/core.c b/kernel/ipipe/core.c
 new file mode 100644
-index 000..c6f4507
+index 000..b6731a4
 --- /dev/null
 +++ b/kernel/ipipe/core.c
-@@ -0,0 +1,1954 @@
+@@ -0,0 +1,1955 @@
 +/* -*- linux-c -*-
 + * linux/kernel/ipipe/core.c
 + *
@@ -8786,6 +8786,7 @@ index 000..c6f4507
 +EXPORT_SYMBOL(ipipe_send_ipi);
 +EXPORT_SYMBOL(__ipipe_pend_irq);
 +EXPORT_SYMBOL(__ipipe_set_irq_pending);
++EXPORT_SYMBOL(__ipipe_event_monitors);
 +#if defined(CONFIG_IPIPE_DEBUG_INTERNAL) && defined(CONFIG_SMP)
 +EXPORT_SYMBOL(__ipipe_check_percpu_access);
 +#endif
diff --git a/ksrc/arch/x86/patches/adeos-ipipe-2.6.34-x86-2.7-00.patch 
b/ksrc/arch/x86/patches/adeos-ipipe-2.6.34-x86-2.7-01.patch
similarity index 99%
rename from ksrc/arch/x86/patches/adeos-ipipe-2.6.34-x86-2.7-00.patch
rename to ksrc/arch/x86/patches/adeos-ipipe-2.6.34-x86-2.7-01.patch
index 4d6b31b..d214c88 100644
--- a/ksrc/arch/x86/patches/adeos-ipipe-2.6.34-x86-2.7-00.patch
+++ b/ksrc/arch/x86/patches/adeos-ipipe-2.6.34-x86-2.7-01.patch
@@ -168,7 +168,7 @@ index 0b72282..6574056 100644
  /*
 diff --git a/arch/x86/include/asm/ipipe.h b/arch/x86/include/asm/ipipe.h
 new file mode 100644
-index 000..92d6b4d
+index 000..ef806d7
 --- /dev/null
 +++ b/arch/x86/include/asm/ipipe.h
 @@ -0,0 +1,181 @@
@@ -199,10 +199,10 @@ index 000..92d6b4d
 +#ifdef CONFIG_IPIPE
 +
 +#ifndef IPIPE_ARCH_STRING
-+#define IPIPE_ARCH_STRING "2.7-00"
++#define IPIPE_ARCH_STRING "2.7-01"
 +#define IPIPE_MAJOR_NUMBER2
 +#define IPIPE_MINOR_NUMBER7
-+#define IPIPE_PATCH_NUMBER0
++#define IPIPE_PATCH_NUMBER1
 +#endif
 +
 +DECLARE_PER_CPU(struct pt_regs, __ipipe_tick_regs);
@@ -6929,10 +6929,10 @@ index 000..6257dfa
 +obj-$(CONFIG_IPIPE_TRACE) += tracer.o
 diff --git a/kernel/ipipe/core.c b/kernel/ipipe/core.c
 new file mode 100644
-index 000..b7d863d
+index 000..e2503bd
 --- /dev/null
 +++ b/kernel/ipipe/core.c
-@@ -0,0 +1,1976 @@
+@@ -0,0 +1,1977 @@
 +/* -*- linux-c -*-
 + * linux/kernel/ipipe/core.c
 + *
@@ -8897,6 +8897,7 @@ index 000..b7d863d
 +EXPORT_SYMBOL(ipipe_send_ipi);
 +EXPORT_SYMBOL(__ipipe_pend_irq);
 +EXPORT_SYMBOL(__ipipe_set_irq_pending);
++EXPORT_SYMBOL(__ipipe_event_monitors);
 +#if defined(CONFIG_IPIPE_DEBUG_INTERNAL) && defined(CONFIG_SMP)
 +EXPORT_SYMBOL(__ipipe_check_percpu_access);
 +#endif


___
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.33.5-powerpc-2. 10-02, 2.6.34-powerpc-2.10-01

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: for-upstream
Commit: 0419b5ae2d2d2355fe2db7d368098686d49f6a89
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=0419b5ae2d2d2355fe2db7d368098686d49f6a89

Author: Philippe Gerum 
Date:   Mon Jun 14 11:47:15 2010 +0200

powerpc: upgrade I-pipe support to 2.6.33.5-powerpc-2.10-02, 
2.6.34-powerpc-2.10-01

---

 ... => adeos-ipipe-2.6.33.5-powerpc-2.10-02.patch} |   11 ++-
 ...ch => adeos-ipipe-2.6.34-powerpc-2.10-01.patch} |   11 ++-
 2 files changed, 12 insertions(+), 10 deletions(-)

diff --git 
a/ksrc/arch/powerpc/patches/adeos-ipipe-2.6.33.5-powerpc-2.10-01.patch 
b/ksrc/arch/powerpc/patches/adeos-ipipe-2.6.33.5-powerpc-2.10-02.patch
similarity index 99%
rename from ksrc/arch/powerpc/patches/adeos-ipipe-2.6.33.5-powerpc-2.10-01.patch
rename to ksrc/arch/powerpc/patches/adeos-ipipe-2.6.33.5-powerpc-2.10-02.patch
index 8cf975e..9ae5e24 100644
--- a/ksrc/arch/powerpc/patches/adeos-ipipe-2.6.33.5-powerpc-2.10-01.patch
+++ b/ksrc/arch/powerpc/patches/adeos-ipipe-2.6.33.5-powerpc-2.10-02.patch
@@ -262,7 +262,7 @@ index bd100fc..8fa1901 100644
   * or should we not care like we do now ? --BenH.
 diff --git a/arch/powerpc/include/asm/ipipe.h 
b/arch/powerpc/include/asm/ipipe.h
 new file mode 100644
-index 000..b8befae
+index 000..8ec5cd7
 --- /dev/null
 +++ b/arch/powerpc/include/asm/ipipe.h
 @@ -0,0 +1,276 @@
@@ -313,10 +313,10 @@ index 000..b8befae
 +#include 
 +#endif
 +
-+#define IPIPE_ARCH_STRING "2.10-01"
++#define IPIPE_ARCH_STRING "2.10-02"
 +#define IPIPE_MAJOR_NUMBER2
 +#define IPIPE_MINOR_NUMBER10
-+#define IPIPE_PATCH_NUMBER1
++#define IPIPE_PATCH_NUMBER2
 +
 +#ifdef CONFIG_IPIPE_WANT_PREEMPTIBLE_SWITCH
 +
@@ -7871,10 +7871,10 @@ index 000..6257dfa
 +obj-$(CONFIG_IPIPE_TRACE) += tracer.o
 diff --git a/kernel/ipipe/core.c b/kernel/ipipe/core.c
 new file mode 100644
-index 000..fdb84db
+index 000..75f5d42
 --- /dev/null
 +++ b/kernel/ipipe/core.c
-@@ -0,0 +1,1970 @@
+@@ -0,0 +1,1971 @@
 +/* -*- linux-c -*-
 + * linux/kernel/ipipe/core.c
 + *
@@ -9833,6 +9833,7 @@ index 000..fdb84db
 +EXPORT_SYMBOL(ipipe_send_ipi);
 +EXPORT_SYMBOL(__ipipe_pend_irq);
 +EXPORT_SYMBOL(__ipipe_set_irq_pending);
++EXPORT_SYMBOL(__ipipe_event_monitors);
 +#if defined(CONFIG_IPIPE_DEBUG_INTERNAL) && defined(CONFIG_SMP)
 +EXPORT_SYMBOL(__ipipe_check_percpu_access);
 +#endif
diff --git a/ksrc/arch/powerpc/patches/adeos-ipipe-2.6.34-powerpc-2.10-00.patch 
b/ksrc/arch/powerpc/patches/adeos-ipipe-2.6.34-powerpc-2.10-01.patch
similarity index 99%
rename from ksrc/arch/powerpc/patches/adeos-ipipe-2.6.34-powerpc-2.10-00.patch
rename to ksrc/arch/powerpc/patches/adeos-ipipe-2.6.34-powerpc-2.10-01.patch
index aa050eb..ba5e550 100644
--- a/ksrc/arch/powerpc/patches/adeos-ipipe-2.6.34-powerpc-2.10-00.patch
+++ b/ksrc/arch/powerpc/patches/adeos-ipipe-2.6.34-powerpc-2.10-01.patch
@@ -262,7 +262,7 @@ index bd100fc..8fa1901 100644
   * or should we not care like we do now ? --BenH.
 diff --git a/arch/powerpc/include/asm/ipipe.h 
b/arch/powerpc/include/asm/ipipe.h
 new file mode 100644
-index 000..f345359
+index 000..4bb5021
 --- /dev/null
 +++ b/arch/powerpc/include/asm/ipipe.h
 @@ -0,0 +1,277 @@
@@ -313,10 +313,10 @@ index 000..f345359
 +#include 
 +#endif
 +
-+#define IPIPE_ARCH_STRING "2.10-00"
++#define IPIPE_ARCH_STRING "2.10-01"
 +#define IPIPE_MAJOR_NUMBER2
 +#define IPIPE_MINOR_NUMBER10
-+#define IPIPE_PATCH_NUMBER0
++#define IPIPE_PATCH_NUMBER1
 +
 +#ifdef CONFIG_IPIPE_WANT_PREEMPTIBLE_SWITCH
 +
@@ -7295,10 +7295,10 @@ index 000..6257dfa
 +obj-$(CONFIG_IPIPE_TRACE) += tracer.o
 diff --git a/kernel/ipipe/core.c b/kernel/ipipe/core.c
 new file mode 100644
-index 000..b7d863d
+index 000..e2503bd
 --- /dev/null
 +++ b/kernel/ipipe/core.c
-@@ -0,0 +1,1976 @@
+@@ -0,0 +1,1977 @@
 +/* -*- linux-c -*-
 + * linux/kernel/ipipe/core.c
 + *
@@ -9263,6 +9263,7 @@ index 000..b7d863d
 +EXPORT_SYMBOL(ipipe_send_ipi);
 +EXPORT_SYMBOL(__ipipe_pend_irq);
 +EXPORT_SYMBOL(__ipipe_set_irq_pending);
++EXPORT_SYMBOL(__ipipe_event_monitors);
 +#if defined(CONFIG_IPIPE_DEBUG_INTERNAL) && defined(CONFIG_SMP)
 +EXPORT_SYMBOL(__ipipe_check_percpu_access);
 +#endif


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


[Xenomai-git] Philippe Gerum : common: warn early about missing /dev/rtheap

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: for-upstream
Commit: ec57f101c01bb7d3efa4d96452ca279470041825
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=ec57f101c01bb7d3efa4d96452ca279470041825

Author: Philippe Gerum 
Date:   Mon Jun 14 17:35:13 2010 +0200

common: warn early about missing /dev/rtheap

---

 include/nucleus/heap.h  |3 +--
 src/skins/common/bind.c |9 +
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/include/nucleus/heap.h b/include/nucleus/heap.h
index e837bf2..9758f5f 100644
--- a/include/nucleus/heap.h
+++ b/include/nucleus/heap.h
@@ -190,8 +190,6 @@ extern "C" {
 
 #ifdef __KERNEL__
 
-#define XNHEAP_DEV_MINOR 254
-
 int xnheap_mount(void);
 
 void xnheap_umount(void);
@@ -281,6 +279,7 @@ int xnheap_check_block(xnheap_t *heap,
 #endif /* __KERNEL__ || __XENO_SIM__ */
 
 #define XNHEAP_DEV_NAME  "/dev/rtheap"
+#define XNHEAP_DEV_MINOR 254
 
 #ifdef CONFIG_MMU
 /* XXX: 2.5.x ABI preserved for MMU-enabled only. */
diff --git a/src/skins/common/bind.c b/src/skins/common/bind.c
index d511072..fb15bf5 100644
--- a/src/skins/common/bind.c
+++ b/src/skins/common/bind.c
@@ -1,9 +1,11 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -86,6 +88,13 @@ xeno_bind_skin_opt(unsigned skin_magic, const char *skin,
xnfeatinfo_t finfo;
int muxid;
 
+   /* Some sanity checks first. */
+   if (access(XNHEAP_DEV_NAME, 0)) {
+   fprintf(stderr, "Xenomai: %s is missing\n(chardev, major=10 
minor=%d)\n",
+   XNHEAP_DEV_NAME, XNHEAP_DEV_MINOR);
+   exit(EXIT_FAILURE);
+   }
+   
old_sigill_handler = signal(SIGILL, xeno_sigill_handler);
if (old_sigill_handler == SIG_ERR) {
perror("signal(SIGILL)");


___
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.34-blackfin-1. 14-01

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: for-upstream
Commit: a995e179badef15103012acbdb1e9df88282cd80
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=a995e179badef15103012acbdb1e9df88282cd80

Author: Philippe Gerum 
Date:   Mon Jun 14 11:46:02 2010 +0200

blackfin: upgrade I-pipe support to 2.6.34-blackfin-1.14-01

---

 ...h => adeos-ipipe-2.6.34-blackfin-1.14-01.patch} |   28 +++
 1 files changed, 22 insertions(+), 6 deletions(-)

diff --git 
a/ksrc/arch/blackfin/patches/adeos-ipipe-2.6.34-blackfin-1.14-00.patch 
b/ksrc/arch/blackfin/patches/adeos-ipipe-2.6.34-blackfin-1.14-01.patch
similarity index 99%
rename from ksrc/arch/blackfin/patches/adeos-ipipe-2.6.34-blackfin-1.14-00.patch
rename to ksrc/arch/blackfin/patches/adeos-ipipe-2.6.34-blackfin-1.14-01.patch
index e57f536..d62e225 100644
--- a/ksrc/arch/blackfin/patches/adeos-ipipe-2.6.34-blackfin-1.14-00.patch
+++ b/ksrc/arch/blackfin/patches/adeos-ipipe-2.6.34-blackfin-1.14-01.patch
@@ -1,21 +1,36 @@
+diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig
+index c078849..799b1c0 100644
+--- a/arch/blackfin/Kconfig
 b/arch/blackfin/Kconfig
+@@ -84,6 +84,8 @@ source "kernel/Kconfig.freezer"
+ 
+ menu "Blackfin Processor Options"
+ 
++source "kernel/ipipe/Kconfig"
++
+ comment "Processor and Board Settings"
+ 
+ choice
 diff --git a/arch/blackfin/include/asm/ipipe.h 
b/arch/blackfin/include/asm/ipipe.h
-index d3b4044..32b7bad 100644
+index d3b4044..331ef0b 100644
 --- a/arch/blackfin/include/asm/ipipe.h
 +++ b/arch/blackfin/include/asm/ipipe.h
-@@ -34,10 +34,11 @@
+@@ -34,11 +34,12 @@
  #include 
  #include 
  #include 
 +#include 
  
 -#define IPIPE_ARCH_STRING "1.12-00"
-+#define IPIPE_ARCH_STRING "1.14-00"
++#define IPIPE_ARCH_STRING "1.14-01"
  #define IPIPE_MAJOR_NUMBER1
 -#define IPIPE_MINOR_NUMBER12
+-#define IPIPE_PATCH_NUMBER0
 +#define IPIPE_MINOR_NUMBER14
- #define IPIPE_PATCH_NUMBER0
++#define IPIPE_PATCH_NUMBER1
  
  #ifdef CONFIG_SMP
+ #error "I-pipe/blackfin: SMP not implemented"
 @@ -129,11 +130,11 @@ void __ipipe_enable_pipeline(void);
  #define __ipipe_hook_critical_ipi(ipd) do { } while (0)
  
@@ -2679,10 +2694,10 @@ index 000..6257dfa
 +obj-$(CONFIG_IPIPE_TRACE) += tracer.o
 diff --git a/kernel/ipipe/core.c b/kernel/ipipe/core.c
 new file mode 100644
-index 000..b7d863d
+index 000..e2503bd
 --- /dev/null
 +++ b/kernel/ipipe/core.c
-@@ -0,0 +1,1976 @@
+@@ -0,0 +1,1977 @@
 +/* -*- linux-c -*-
 + * linux/kernel/ipipe/core.c
 + *
@@ -4647,6 +4662,7 @@ index 000..b7d863d
 +EXPORT_SYMBOL(ipipe_send_ipi);
 +EXPORT_SYMBOL(__ipipe_pend_irq);
 +EXPORT_SYMBOL(__ipipe_set_irq_pending);
++EXPORT_SYMBOL(__ipipe_event_monitors);
 +#if defined(CONFIG_IPIPE_DEBUG_INTERNAL) && defined(CONFIG_SMP)
 +EXPORT_SYMBOL(__ipipe_check_percpu_access);
 +#endif


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


[Xenomai-git] Philippe Gerum : arm: upgrade I-pipe support to 2.6.33-arm-1.17-01

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: for-upstream
Commit: 38f9413a2a7a84cb573c33dbe6f9f19b3e74849c
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=38f9413a2a7a84cb573c33dbe6f9f19b3e74849c

Author: Philippe Gerum 
Date:   Mon Jun 14 11:45:16 2010 +0200

arm: upgrade I-pipe support to 2.6.33-arm-1.17-01

---

 patch => adeos-ipipe-2.6.33-arm-1.17-01.patch} |   11 ++-
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/ksrc/arch/arm/patches/adeos-ipipe-2.6.33-arm-1.17-00.patch 
b/ksrc/arch/arm/patches/adeos-ipipe-2.6.33-arm-1.17-01.patch
similarity index 99%
rename from ksrc/arch/arm/patches/adeos-ipipe-2.6.33-arm-1.17-00.patch
rename to ksrc/arch/arm/patches/adeos-ipipe-2.6.33-arm-1.17-01.patch
index d2ab300..22f5d3f 100644
--- a/ksrc/arch/arm/patches/adeos-ipipe-2.6.33-arm-1.17-00.patch
+++ b/ksrc/arch/arm/patches/adeos-ipipe-2.6.33-arm-1.17-01.patch
@@ -630,7 +630,7 @@ index 000..cfdf14a
 +#endif /* __ASM_ARM_FCSE_H */
 diff --git a/arch/arm/include/asm/ipipe.h b/arch/arm/include/asm/ipipe.h
 new file mode 100644
-index 000..ada91f3
+index 000..f8880e0
 --- /dev/null
 +++ b/arch/arm/include/asm/ipipe.h
 @@ -0,0 +1,274 @@
@@ -665,10 +665,10 @@ index 000..ada91f3
 +#include 
 +#include /* For __IPIPE_FEATURE_PIC_MUTE */
 +
-+#define IPIPE_ARCH_STRING "1.17-00"
++#define IPIPE_ARCH_STRING "1.17-01"
 +#define IPIPE_MAJOR_NUMBER1
 +#define IPIPE_MINOR_NUMBER17
-+#define IPIPE_PATCH_NUMBER0
++#define IPIPE_PATCH_NUMBER1
 +
 +#ifdef CONFIG_SMP
 +#error "I-pipe/arm: SMP not yet implemented"
@@ -10835,10 +10835,10 @@ index 000..6257dfa
 +obj-$(CONFIG_IPIPE_TRACE) += tracer.o
 diff --git a/kernel/ipipe/core.c b/kernel/ipipe/core.c
 new file mode 100644
-index 000..fdb84db
+index 000..75f5d42
 --- /dev/null
 +++ b/kernel/ipipe/core.c
-@@ -0,0 +1,1970 @@
+@@ -0,0 +1,1971 @@
 +/* -*- linux-c -*-
 + * linux/kernel/ipipe/core.c
 + *
@@ -12797,6 +12797,7 @@ index 000..fdb84db
 +EXPORT_SYMBOL(ipipe_send_ipi);
 +EXPORT_SYMBOL(__ipipe_pend_irq);
 +EXPORT_SYMBOL(__ipipe_set_irq_pending);
++EXPORT_SYMBOL(__ipipe_event_monitors);
 +#if defined(CONFIG_IPIPE_DEBUG_INTERNAL) && defined(CONFIG_SMP)
 +EXPORT_SYMBOL(__ipipe_check_percpu_access);
 +#endif


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


[Xenomai-git] Philippe Gerum : nios2: enable MAYDAY support

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: for-upstream
Commit: 20f800566917ed7e3ca7396a6edd1cca9cb6bacc
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=20f800566917ed7e3ca7396a6edd1cca9cb6bacc

Author: Philippe Gerum 
Date:   Mon Jun 14 18:24:14 2010 +0200

nios2: enable MAYDAY support

---

 include/asm-nios2/bits/shadow.h |   65 +++
 include/asm-nios2/system.h  |8 +
 2 files changed, 73 insertions(+), 0 deletions(-)

diff --git a/include/asm-nios2/bits/shadow.h b/include/asm-nios2/bits/shadow.h
index 1d1969a..8917045 100644
--- a/include/asm-nios2/bits/shadow.h
+++ b/include/asm-nios2/bits/shadow.h
@@ -24,6 +24,8 @@
 #error "Pure kernel header included from user-space!"
 #endif
 
+#include 
+
 static inline void xnarch_init_shadow_tcb(xnarchtcb_t * tcb,
  struct xnthread *thread,
  const char *name)
@@ -63,4 +65,67 @@ static inline int xnarch_local_syscall(struct pt_regs *regs)
 
 #define xnarch_schedule_tail(prev) do { } while(0)
 
+#ifdef XNARCH_HAVE_MAYDAY
+
+static inline void xnarch_setup_mayday_page(void *page)
+{
+   /*
+* We want this code to appear at the top of the MAYDAY page:
+*
+*  00c00334movhi   r3,#__xn_sys_mayday
+*  18c08ac4addir3,r3,#__xn_sys_mux
+*  0084movir2,0
+*  0244movir9,0
+*  003b683atrap
+*  003fff06br  .
+*/
+   static const struct {
+   u32 movhi_r3h;
+   u32 addi_r3l;
+   u32 movi_r2;
+   u32 movi_r9;
+   u32 syscall;
+   u32 bug;
+   } code = {
+   .movhi_r3h = 0x00c00334,
+   .addi_r3l = 0x18c08ac4,
+   .movi_r2 = 0x0084,
+   .movi_r9 = 0x0244,
+   .syscall = 0x003b683a,
+   .bug = 0x003fff06
+   };
+
+   memcpy(page, &code, sizeof(code));
+
+   flush_dcache_range((unsigned long)page,
+  (unsigned long)page + sizeof(code));
+}
+
+static inline void xnarch_call_mayday(void)
+{
+   rthal_return_intercept(current);
+}
+
+static inline void xnarch_handle_mayday(struct xnarchtcb *tcb,
+   struct pt_regs *regs,
+   unsigned long tramp)
+{
+   tcb->mayday.ea = regs->ea;
+   tcb->mayday.r2 = regs->r2;
+   tcb->mayday.r3 = regs->r3;
+   tcb->mayday.r9 = regs->r9;
+   regs->ea = tramp;
+}
+
+static inline void xnarch_fixup_mayday(struct xnarchtcb *tcb,
+  struct pt_regs *regs)
+{
+   regs->ea = tcb->mayday.ea;
+   regs->r2 = tcb->mayday.r2;
+   regs->r3 = tcb->mayday.r3;
+   regs->r9 = tcb->mayday.r9;
+}
+
+#endif /* XNARCH_HAVE_MAYDAY */
+
 #endif /* !_XENO_ASM_NIOS2_BITS_SHADOW_H */
diff --git a/include/asm-nios2/system.h b/include/asm-nios2/system.h
index 65426d1..a31aadf 100644
--- a/include/asm-nios2/system.h
+++ b/include/asm-nios2/system.h
@@ -48,6 +48,14 @@ typedef struct xnarchtcb {   /* Per-thread arch-dependent 
block */
struct thread_struct ts;/* Holds kernel-based thread context. */
struct task_struct *user_task;  /* Shadowed user-space task */
struct thread_struct *tsp;  /* Active thread struct */
+#ifdef XNARCH_HAVE_MAYDAY
+   struct {
+   unsigned long ea;
+   unsigned long r2;
+   unsigned long r3;
+   unsigned long r9;
+   } mayday;
+#endif
 
/* Init block */
struct xnthread *self;


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


[Xenomai-git] Philippe Gerum : blackfin: enable MAYDAY support

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: for-upstream
Commit: 85f466a53585264406c698b6eaf4daab33ea3299
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=85f466a53585264406c698b6eaf4daab33ea3299

Author: Philippe Gerum 
Date:   Sun Jun 13 17:26:05 2010 +0200

blackfin: enable MAYDAY support

---

 include/asm-blackfin/bits/shadow.h |   78 
 include/asm-blackfin/system.h  |7 +++
 2 files changed, 85 insertions(+), 0 deletions(-)

diff --git a/include/asm-blackfin/bits/shadow.h 
b/include/asm-blackfin/bits/shadow.h
index f44d25d..1a77fe4 100644
--- a/include/asm-blackfin/bits/shadow.h
+++ b/include/asm-blackfin/bits/shadow.h
@@ -24,6 +24,8 @@
 #error "Pure kernel header included from user-space!"
 #endif
 
+#include 
+
 static inline void xnarch_init_shadow_tcb(xnarchtcb_t * tcb,
  struct xnthread *thread,
  const char *name)
@@ -66,4 +68,80 @@ static inline int xnarch_local_syscall(struct pt_regs *regs)
 
 #define xnarch_schedule_tail(prev) do { } while(0)
 
+#ifdef XNARCH_HAVE_MAYDAY
+
+static inline void xnarch_setup_mayday_page(void *page)
+{
+   /*
+* We want this code to appear at the top of the MAYDAY page:
+*
+* 45 e1 0c 00R5.H = 0xc
+* 05 e1 2b 02R5.L = 0x22b
+* 05 32  P0 = R5
+* 05 60  R5 = 0x0 (X)
+* a0 00  EXCPT 0x0
+* cd ef  
+*
+* We don't mess with ASTAT here, so no need to save/restore
+* it in handle/fixup code.
+*/
+   static const struct {
+   struct __attribute__ ((__packed__)) {
+   u16 op;
+   u16 imm;
+   } load_r5h;
+   struct __attribute__ ((__packed__)) {
+   u16 op;
+   u16 imm;
+   } load_r5l;
+   u16 mov_p0;
+   u16 clear_r5;
+   u16 syscall;
+   u16 bug;
+   } code = {
+   .load_r5h = {
+   .op = 0xe145,
+   .imm = __xn_mux_code(0, __xn_sys_mayday) >> 16
+   },
+   .load_r5l = {
+   .op = 0xe105,
+   .imm = __xn_mux_code(0, __xn_sys_mayday) & 0x
+   },
+   .mov_p0 = 0x3205,
+   .clear_r5 = 0x6005,
+   .syscall = 0x00a0,
+   .bug = BFIN_BUG_OPCODE,
+   };
+
+   memcpy(page, &code, sizeof(code));
+
+   flush_dcache_range((unsigned long)page,
+  (unsigned long)page + sizeof(code));
+}
+
+static inline void xnarch_call_mayday(void)
+{
+   rthal_return_intercept(current);
+}
+
+static inline void xnarch_handle_mayday(struct xnarchtcb *tcb,
+   struct pt_regs *regs,
+   unsigned long tramp)
+{
+   tcb->mayday.pc = regs->pc;
+   tcb->mayday.p0 = regs->p0;
+   tcb->mayday.r5 = regs->r5;
+   regs->pc = tramp;   /* i.e. RETI */
+}
+
+static inline void xnarch_fixup_mayday(struct xnarchtcb *tcb,
+  struct pt_regs *regs)
+{
+   regs->pc = tcb->mayday.pc;
+   regs->p0 = tcb->mayday.p0;
+   regs->r5 = tcb->mayday.r5;
+}
+
+#endif /* XNARCH_HAVE_MAYDAY */
+
 #endif /* !_XENO_ASM_BLACKFIN_BITS_SHADOW_H */
diff --git a/include/asm-blackfin/system.h b/include/asm-blackfin/system.h
index f7a46b2..b4be882 100644
--- a/include/asm-blackfin/system.h
+++ b/include/asm-blackfin/system.h
@@ -53,6 +53,13 @@ typedef struct xnarchtcb {   /* Per-thread arch-dependent 
block */
 struct task_struct *active_task;/* Active user-space task */
 #endif
 struct thread_struct *tsp; /* Pointer to the active thread struct (&ts or 
&user->thread). */
+#ifdef XNARCH_HAVE_MAYDAY
+   struct {
+   unsigned long pc;
+   unsigned long p0;
+   unsigned long r5;
+   } mayday;
+#endif
 
 /* Init block */
 struct xnthread *self;


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


[Xenomai-git] Philippe Gerum : arm: enable MAYDAY support

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: for-upstream
Commit: 974220a585811a50a515fb6d83c2fd89229c11c2
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=974220a585811a50a515fb6d83c2fd89229c11c2

Author: Philippe Gerum 
Date:   Sat Jun 12 08:28:29 2010 +0200

arm: enable MAYDAY support

---

 include/asm-arm/bits/shadow.h |  111 +
 include/asm-arm/system.h  |   10 
 2 files changed, 121 insertions(+), 0 deletions(-)

diff --git a/include/asm-arm/bits/shadow.h b/include/asm-arm/bits/shadow.h
index a396510..6021dad 100644
--- a/include/asm-arm/bits/shadow.h
+++ b/include/asm-arm/bits/shadow.h
@@ -27,6 +27,8 @@
 #error "Pure kernel header included from user-space!"
 #endif
 
+#include 
+
 static inline void xnarch_init_shadow_tcb(xnarchtcb_t * tcb,
  struct xnthread *thread,
  const char *name)
@@ -182,4 +184,113 @@ static inline int xnarch_local_syscall(struct pt_regs 
*regs)
 
 #define xnarch_schedule_tail(prev) do { } while(0)
 
+#ifdef XNARCH_HAVE_MAYDAY
+
+static inline void xnarch_setup_mayday_page(void *page)
+{
+   /*
+* We want this code to appear at the top of the MAYDAY page:
+*
+* ifdef ARM_EABI
+*
+* e3a00f8a mov r0, #552; 0x228
+* e28003c3 add r0, r0, #201326595  ; 0xc03
+* e3a0780f mov r7, #983040 ; 0xf
+* e2877042 add r7, r7, #66 ; 0x42
+* e3a06000 mov r6, #0
+* ef00 svc 0x
+* e3a0 mov r0, #0
+* e580 str r0, [r0]; 
+*
+* elif ARM_OABI
+*
+* e3a00f8a mov r0, #552; 0x228
+* e28003c3 add r0, r0, #201326595  ; 0xc03
+* e3a06000 mov r6, #0
+* ef9f0042 swi 0x009f0042
+* e3a0 mov r0, #0
+* e580 str r0, [r0]; 
+*
+* endif
+*
+* 32bit instruction words will be laid out by the compiler as
+* the target endianness requires.
+*
+* We don't mess with CPSR here, so no need to save/restore it
+* in handle/fixup code.
+*/
+#ifdef CONFIG_XENO_ARM_EABI
+   static const struct {
+   u32 mov_muxl;
+   u32 add_muxh;
+   u32 mov_sysh;
+   u32 add_sysl;
+   u32 mov_sigp;
+   u32 swi_0;
+   u32 mov_r0;
+   u32 str_r0;
+   } code = {
+   .mov_muxl = 0xe3a00f8a,
+   .add_muxh = 0xe28003c3,
+   .mov_sysh = 0xe3a0780f,
+   .add_sysl = 0xe2877042,
+   .mov_sigp = 0xe3a06000,
+   .swi_0 = 0xef00,
+   .mov_r0 = 0xe3a0,
+   .str_r0 = 0xe580
+   };
+#else /* OABI */
+   static const struct {
+   u32 mov_muxl;
+   u32 add_muxh;
+   u32 mov_sigp;
+   u32 swi_syscall;
+   u32 mov_r0;
+   u32 str_r0;
+   } code = {
+   .mov_muxl = 0xe3a00f8a,
+   .add_muxh = 0xe28003c3,
+   .mov_sigp = 0xe3a06000,
+   .swi_syscall = 0x009f0042,
+   .mov_r0 = 0xe3a0,
+   .str_r0 = 0xe580
+   };
+#endif /* OABI */
+
+   memcpy(page, &code, sizeof(code));
+
+   flush_dcache_page(vmalloc_to_page(page));
+}
+
+static inline void xnarch_call_mayday(void)
+{
+   rthal_return_intercept(current);
+}
+
+static inline void xnarch_handle_mayday(struct xnarchtcb *tcb,
+   struct pt_regs *regs,
+   unsigned long tramp)
+{
+   tcb->mayday.pc = regs->ARM_pc;
+   tcb->mayday.r0 = regs->ARM_r0;
+   tcb->mayday.r6 = regs->ARM_r6;
+#ifdef CONFIG_XENO_ARM_EABI
+   tcb->mayday.r7 = regs->ARM_r7;
+#endif
+   regs->ARM_pc = tramp;
+}
+
+static inline void xnarch_fixup_mayday(struct xnarchtcb *tcb,
+  struct pt_regs *regs)
+{
+   regs->ARM_pc = tcb->mayday.pc;
+   regs->ARM_r0 = tcb->mayday.r0;
+   regs->ARM_r6 = tcb->mayday.r6;
+#ifdef CONFIG_XENO_ARM_EABI
+   regs->ARM_r7 = tcb->mayday.r7;
+#endif
+}
+
+#endif /* XNARCH_HAVE_MAYDAY */
+
 #endif /* !_XENO_ASM_ARM_BITS_SHADOW_H */
diff --git a/include/asm-arm/system.h b/include/asm-arm/system.h
index 3cbf43b..2b7b734 100644
--- a/include/asm-arm/system.h
+++ b/include/asm-arm/system.h
@@ -69,6 +69,16 @@ typedef struct xnarchtcb {  /* Per-thread arch-dependent 
block */
struct mm_struct *active_mm;
struct thread_info ti;  /* Holds kernel-based thread info */
struct thread_info *tip;/* Pointer to the active thread 
info (ti or user->thread_info). */
+#ifdef XNARCH_HAVE_MAYDAY
+   struct 

[Xenomai-git] Philippe Gerum : powerpc: enable MAYDAY support

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: for-upstream
Commit: 7c11867db1368aa0a280c4d6d4bf7f682ee51ce3
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=7c11867db1368aa0a280c4d6d4bf7f682ee51ce3

Author: Philippe Gerum 
Date:   Sat Jun  5 11:57:40 2010 +0200

powerpc: enable MAYDAY support

---

 include/asm-powerpc/bits/shadow.h |   61 +
 include/asm-powerpc/system.h  |8 -
 2 files changed, 68 insertions(+), 1 deletions(-)

diff --git a/include/asm-powerpc/bits/shadow.h 
b/include/asm-powerpc/bits/shadow.h
index 47b65a2..7f3554e 100644
--- a/include/asm-powerpc/bits/shadow.h
+++ b/include/asm-powerpc/bits/shadow.h
@@ -27,6 +27,12 @@
 #error "Pure kernel header included from user-space!"
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
+#include 
+#else
+#include 
+#endif
+
 static inline void xnarch_init_shadow_tcb(xnarchtcb_t * tcb,
  struct xnthread *thread,
  const char *name)
@@ -59,4 +65,59 @@ static inline int xnarch_local_syscall(struct pt_regs *regs)
 
 #define xnarch_schedule_tail(prev) do { } while(0)
 
+#ifdef XNARCH_HAVE_MAYDAY
+
+static inline void xnarch_setup_mayday_page(void *page)
+{
+   /*
+* We want this code to appear at the top of the MAYDAY page:
+*
+* 3c 00 0b 00  lis r0,mux_c...@h
+* 60 00 02 2b  ori r0,r0,mux_c...@l
+* 39 00 00 00  li  r8,0
+* 44 00 00 02  sc
+* 00 b0 0b 00  .long   0x00b00b00 
+*
+* We don't mess with CCR here, so no need to save/restore it
+* in handle/fixup code.
+*/
+   u32 mux, insn[5];
+
+   mux = __xn_mux_code(0, __xn_sys_mayday);
+   insn[0] = 0x3c00 | (mux >> 16);
+   insn[1] = 0x6000 | (mux & 0x);
+   insn[2] = 0x3900;
+   insn[3] = 0x4402;
+   insn[4] = 0x00b00b00;
+   memcpy(page, insn, sizeof(insn));
+
+   flush_dcache_range((unsigned long)page,
+  (unsigned long)page + sizeof(insn));
+}
+
+static inline void xnarch_call_mayday(void)
+{
+   rthal_return_intercept(current);
+}
+
+static inline void xnarch_handle_mayday(struct xnarchtcb *tcb,
+   struct pt_regs *regs,
+   unsigned long tramp)
+{
+   tcb->mayday.nip = regs->nip;
+   tcb->mayday.r0 = regs->gpr[0];
+   tcb->mayday.r8 = regs->gpr[8];
+   regs->nip = tramp;
+}
+
+static inline void xnarch_fixup_mayday(struct xnarchtcb *tcb,
+  struct pt_regs *regs)
+{
+   regs->nip = tcb->mayday.nip;
+   regs->gpr[0] = tcb->mayday.r0;
+   regs->gpr[8] = tcb->mayday.r8;
+}
+
+#endif /* XNARCH_HAVE_MAYDAY */
+
 #endif /* !_XENO_ASM_POWERPC_BITS_SHADOW_H */
diff --git a/include/asm-powerpc/system.h b/include/asm-powerpc/system.h
index 0e1072a..4044f43 100644
--- a/include/asm-powerpc/system.h
+++ b/include/asm-powerpc/system.h
@@ -51,7 +51,13 @@ typedef struct xnarchtcb {   /* Per-thread arch-dependent 
block */
struct thread_struct *tsp;  /* Pointer to the active thread struct 
(&ts or &user->thread). */
struct mm_struct *mm;
struct mm_struct *active_mm;
-
+#ifdef XNARCH_HAVE_MAYDAY
+   struct {
+   unsigned long nip;
+   unsigned long r0;
+   unsigned long r8;
+   } mayday;
+#endif
/* Kernel mode side */
struct thread_struct ts;/* Holds kernel-based thread context. */
 #ifdef CONFIG_XENO_HW_UNLOCKED_SWITCH


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


[Xenomai-git] Philippe Gerum : x86: enable MAYDAY support

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: for-upstream
Commit: a1fe23dc6a39e584c88a471447b1fae7c86f3183
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=a1fe23dc6a39e584c88a471447b1fae7c86f3183

Author: Philippe Gerum 
Date:   Sun Jun  6 16:25:36 2010 +0200

x86: enable MAYDAY support

---

 include/asm-x86/bits/shadow_32.h |  111 ++
 include/asm-x86/bits/shadow_64.h |   71 
 include/asm-x86/system_32.h  |7 +++
 include/asm-x86/system_64.h  |7 +++
 4 files changed, 196 insertions(+), 0 deletions(-)

diff --git a/include/asm-x86/bits/shadow_32.h b/include/asm-x86/bits/shadow_32.h
index 9fc37a2..40ccc62 100644
--- a/include/asm-x86/bits/shadow_32.h
+++ b/include/asm-x86/bits/shadow_32.h
@@ -49,4 +49,115 @@ static void xnarch_schedule_tail(struct task_struct *prev)
wrap_switch_iobitmap(prev, rthal_processor_id());
 }
 
+#ifdef XNARCH_HAVE_MAYDAY
+
+static inline void xnarch_setup_mayday_page(void *page)
+{
+   /*
+* We want this code to appear at the top of the MAYDAY page:
+*
+*  b8 2b 02 00 0c  mov$,%eax
+*  bd 00 00 00 00  mov$0x0,%ebp
+* if HAVE_SEP
+*  65 ff 15 10 00 00 00call   *%gs:0x10
+* else
+*  cd 80   int$0x80
+* endif
+*  0f 0b   ud2a
+*
+* We intentionally don't mess with EFLAGS here, so that we
+* don't have to save/restore it in handle/fixup code.
+*
+* Also note that if SEP is present, we always assume NPTL on
+* the user side.
+*/
+   static const struct {
+   struct __attribute__ ((__packed__)) {
+   u8 op;
+   u32 imm;
+   } mov_eax;
+   struct __attribute__ ((__packed__)) {
+   u8 op;
+   u32 imm;
+   } mov_ebp;
+   struct __attribute__ ((__packed__)) {
+   u8 op[3];
+   u32 moffs;
+   } syscall;
+   u16 bug;
+   } code_sep = {
+   .mov_eax = {
+   .op = 0xb8,
+   .imm = __xn_mux_code(0, __xn_sys_mayday)
+   },
+   .mov_ebp = {
+   .op = 0xbd,
+   .imm = 0
+   },
+   .syscall = {
+   .op = {
+   0x65, 0xff, 0x15
+   },
+   .moffs = 0x10
+   },
+   .bug = 0x0b0f,
+   };
+
+   static const struct {
+   struct __attribute__ ((__packed__)) {
+   u8 op;
+   u32 imm;
+   } mov_eax;
+   struct __attribute__ ((__packed__)) {
+   u8 op;
+   u32 imm;
+   } mov_ebp;
+   u16 syscall;
+   u16 bug;
+   } code_nosep = {
+   .mov_eax = {
+   .op = 0xb8,
+   .imm = __xn_mux_code(0, __xn_sys_mayday)
+   },
+   .mov_ebp = {
+   .op = 0xbd,
+   .imm = 0
+   },
+   .syscall = 0x80cd,
+   .bug = 0x0b0f,
+   };
+
+   if (cpu_has_sep)
+   memcpy(page, &code_sep, sizeof(code_sep));
+   else
+   memcpy(page, &code_nosep, sizeof(code_nosep));
+
+   /* no cache flush required. */
+}
+
+static inline void xnarch_call_mayday(void)
+{
+   rthal_return_intercept(current);
+}
+
+static inline void xnarch_handle_mayday(struct xnarchtcb *tcb,
+   struct pt_regs *regs,
+   unsigned long tramp)
+{
+   tcb->mayday.eip = regs->x86reg_ip;
+   tcb->mayday.eax = regs->x86reg_ax;
+   tcb->mayday.ebp = regs->x86reg_bp;
+   regs->x86reg_ip = tramp;
+}
+
+static inline void xnarch_fixup_mayday(struct xnarchtcb *tcb,
+  struct pt_regs *regs)
+{
+   regs->x86reg_ip = tcb->mayday.eip;
+   regs->x86reg_ax = tcb->mayday.eax;
+   regs->x86reg_bp = tcb->mayday.ebp;
+}
+
+#endif /* XNARCH_HAVE_MAYDAY */
+
 #endif /* !_XENO_ASM_X86_BITS_SHADOW_32_H */
diff --git a/include/asm-x86/bits/shadow_64.h b/include/asm-x86/bits/shadow_64.h
index ddaa86a..41a266f 100644
--- a/include/asm-x86/bits/shadow_64.h
+++ b/include/asm-x86/bits/shadow_64.h
@@ -52,4 +52,75 @@ static void xnarch_schedule_tail(struct task_struct *prev)
 {
 }
 
+#ifdef XNARCH_HAVE_MAYDAY
+
+static inline void xnarch_setup_mayday_page(void *page)
+{
+   /*
+* We want this code to appear at the top of the MAYDAY page:
+*
+*  b8 2b 02 00 0c  mov$,%eax
+*  49 c7 c1 00 00 00 00mov$0

[Xenomai-git] Philippe Gerum : nucleus: introduce generic bits for MAYDAY support

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: for-upstream
Commit: bcc3145ee0ae8a5b87df83b3133dbdee4f28a416
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=bcc3145ee0ae8a5b87df83b3133dbdee4f28a416

Author: Philippe Gerum 
Date:   Sat Jun  5 11:39:24 2010 +0200

nucleus: introduce generic bits for MAYDAY support

This patch enables the nucleus to force a user-space thread running
syscall-less code in primary mode, to call the nucleus back on its way
out from an interrupt via a dedicated syscall (__xn_sys_mayday).

This feature is currently useful for recovering gracefully from a
runaway thread situation detected by the nucleus watchdog. Instead of
killing the runaway thread bluntly, this feature allows to force a
relax on it, despite the syscall-less nature of the code it was
running in primary mode.

The trick is to force the thread to run a piece of user-space code
that issues the mayday syscall, by fixing up its program counter on
its way back to userland. This code is laid on the special "mayday
page", mapped to the process address space at binding time. The
implementation relies on the new IPIPE_EVENT_RETURN notification
available from the latest I-pipe patches, to run the fixup code.

In the future, Xenomai real-time signals will be rebased on this
feature to make them able to preempt syscall-less code as well.  In
the same move, the mayday page allocation and setup should move to
user-space. We do this from kernel space for now only to preserve the
2.5.x ABI.

---

 include/asm-generic/hal.h |   28 ++-
 include/asm-generic/syscall.h |1 +
 include/nucleus/ppd.h |4 +
 include/nucleus/shadow.h  |   10 ++
 ksrc/nucleus/sched.c  |1 +
 ksrc/nucleus/shadow.c |  186 ++---
 6 files changed, 216 insertions(+), 14 deletions(-)

diff --git a/include/asm-generic/hal.h b/include/asm-generic/hal.h
index f03219d..f90cafa 100644
--- a/include/asm-generic/hal.h
+++ b/include/asm-generic/hal.h
@@ -259,7 +259,7 @@ static int hdlr (unsigned event, struct ipipe_domain *ipd, 
void *data) \
 static int hdlr (unsigned event, struct ipipe_domain *ipd, void *data) \
 {  \
struct task_struct *p = (struct task_struct *)data; \
-   do_##hdlr(p,p->rt_priority);\
+   do_##hdlr(p, p->rt_priority);   \
return RTHAL_EVENT_PROPAGATE;   \
 }
 
@@ -287,6 +287,14 @@ static int hdlr (unsigned event, struct ipipe_domain *ipd, 
void *data) \
return RTHAL_EVENT_PROPAGATE;  \
 }
 
+#define RTHAL_DECLARE_MAYDAY_EVENT(hdlr) \
+static int hdlr(unsigned event, struct ipipe_domain *ipd, void *data) \
+{\
+   struct pt_regs *regs = data;  \
+   do_##hdlr(regs);  \
+   return RTHAL_EVENT_PROPAGATE; \
+}
+
 #ifndef TASK_ATOMICSWITCH
 #ifdef CONFIG_PREEMPT
 /* We want this feature for preemptible kernels, or the behaviour when
@@ -321,6 +329,15 @@ static inline void clear_task_nowakeup(struct task_struct 
*p)
 #define rthal_set_foreign_stack(ipd)   ipipe_set_foreign_stack(ipd)
 #define rthal_clear_foreign_stack(ipd) ipipe_clear_foreign_stack(ipd)
 
+#ifdef __IPIPE_FEATURE_ENABLE_NOTIFIER
+#define rthal_enable_notifier(p)   ipipe_enable_notifier(p)
+#else
+static inline void rthal_enable_notifier(struct task_struct *p)
+{
+   p->flags |= PF_EVNOTIFY;
+}
+#endif
+
 #define rthal_catch_cleanup(hdlr) \
 ipipe_catch_event(ipipe_root_domain,IPIPE_EVENT_CLEANUP,hdlr)
 #define rthal_catch_taskexit(hdlr) \
@@ -338,6 +355,15 @@ static inline void clear_task_nowakeup(struct task_struct 
*p)
 #define rthal_catch_exception(ex,hdlr) \
 ipipe_catch_event(&rthal_domain,ex|IPIPE_EVENT_SELF,hdlr)
 
+#ifdef IPIPE_EVENT_RETURN
+#define RTHAL_HAVE_RETURN_EVENT
+#define rthal_catch_return(hdlr) \
+ipipe_catch_event(&rthal_domain,IPIPE_EVENT_RETURN,hdlr)
+#define rthal_return_intercept(p)  ipipe_return_notify(p)
+#else
+#define rthal_catch_return(hdlr)   do { } while(0)
+#endif
+
 #define rthal_register_domain(_dom,_name,_id,_prio,_entry) \
 ({ \
struct ipipe_domain_attr attr;  \
diff --git a/include/asm-generic/syscall.h b/include/asm-generic/syscall.h
index 3f10065..7e3d01a 100644
--- a/include/asm-generic/syscall.h
+++ b/include/asm-generic/syscall.h
@@ -47,6 +47,7 @@
 #define __xn_sys_current_info  9   /* r = xnshadow_current_info(&info) */
 #define __xn_sys_get_next_sigs 10  /* only unqueue pending signals. */
 #define __xn_sys_drop_u_mode   11  /* stop updating thread->u_mode */
+#defin

[Xenomai-git] Philippe Gerum : x86: upgrade I-pipe support to 2.6.32.15-x86-2.7-00, 2.6. 34-x86-2.7-00

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: for-upstream
Commit: d42654aaae2269289d345b674096faf104fe4568
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=d42654aaae2269289d345b674096faf104fe4568

Author: Philippe Gerum 
Date:   Wed Jun  9 14:47:01 2010 +0200

x86: upgrade I-pipe support to 2.6.32.15-x86-2.7-00, 2.6.34-x86-2.7-00

---

 .../patches/adeos-ipipe-2.6.32.15-x86-2.7-00.patch |11475 +++
 .../patches/adeos-ipipe-2.6.34-x86-2.7-00.patch|11570 
 2 files changed, 23045 insertions(+), 0 deletions(-)

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

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


[Xenomai-git] Philippe Gerum : arm: upgrade I-pipe support to 2.6.33-arm-1.17-00

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: for-upstream
Commit: eef66b5f40a194a57c47ad2c7ada5b92edbc98f4
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=eef66b5f40a194a57c47ad2c7ada5b92edbc98f4

Author: Philippe Gerum 
Date:   Sat Jun 12 09:38:33 2010 +0200

arm: upgrade I-pipe support to 2.6.33-arm-1.17-00

---

 patch => adeos-ipipe-2.6.33-arm-1.17-00.patch} |  263 +---
 1 files changed, 168 insertions(+), 95 deletions(-)

diff --git a/ksrc/arch/arm/patches/adeos-ipipe-2.6.33-arm-1.16-01.patch 
b/ksrc/arch/arm/patches/adeos-ipipe-2.6.33-arm-1.17-00.patch
similarity index 98%
rename from ksrc/arch/arm/patches/adeos-ipipe-2.6.33-arm-1.16-01.patch
rename to ksrc/arch/arm/patches/adeos-ipipe-2.6.33-arm-1.17-00.patch
index cbb3fb6..d2ab300 100644
--- a/ksrc/arch/arm/patches/adeos-ipipe-2.6.33-arm-1.16-01.patch
+++ b/ksrc/arch/arm/patches/adeos-ipipe-2.6.33-arm-1.17-00.patch
@@ -630,7 +630,7 @@ index 000..cfdf14a
 +#endif /* __ASM_ARM_FCSE_H */
 diff --git a/arch/arm/include/asm/ipipe.h b/arch/arm/include/asm/ipipe.h
 new file mode 100644
-index 000..8ae0cb3
+index 000..ada91f3
 --- /dev/null
 +++ b/arch/arm/include/asm/ipipe.h
 @@ -0,0 +1,274 @@
@@ -665,10 +665,10 @@ index 000..8ae0cb3
 +#include 
 +#include /* For __IPIPE_FEATURE_PIC_MUTE */
 +
-+#define IPIPE_ARCH_STRING "1.16-01"
++#define IPIPE_ARCH_STRING "1.17-00"
 +#define IPIPE_MAJOR_NUMBER1
-+#define IPIPE_MINOR_NUMBER16
-+#define IPIPE_PATCH_NUMBER1
++#define IPIPE_MINOR_NUMBER17
++#define IPIPE_PATCH_NUMBER0
 +
 +#ifdef CONFIG_SMP
 +#error "I-pipe/arm: SMP not yet implemented"
@@ -880,7 +880,7 @@ index 000..8ae0cb3
 +} while(0)
 +
 +#define __ipipe_syscall_watched_p(p, sc)  \
-+  (((p)->flags & PF_EVNOTIFY) || (unsigned long)sc >= __ARM_NR_BASE + 64)
++  (ipipe_notifier_enabled_p(p) || (unsigned long)sc >= __ARM_NR_BASE + 64)
 +
 +#define __ipipe_root_tick_p(regs) (!raw_irqs_disabled_flags(regs->ARM_cpsr))
 +
@@ -910,10 +910,10 @@ index 000..8ae0cb3
 +#endif/* !__ARM_IPIPE_H */
 diff --git a/arch/arm/include/asm/ipipe_base.h 
b/arch/arm/include/asm/ipipe_base.h
 new file mode 100644
-index 000..20e97a4
+index 000..f78523d
 --- /dev/null
 +++ b/arch/arm/include/asm/ipipe_base.h
-@@ -0,0 +1,108 @@
+@@ -0,0 +1,109 @@
 +/* -*- linux-c -*-
 + * arch/arm/include/asm/ipipe_base.h
 + *
@@ -966,7 +966,8 @@ index 000..20e97a4
 +#define IPIPE_EVENT_INIT  (IPIPE_FIRST_EVENT + 4)
 +#define IPIPE_EVENT_EXIT  (IPIPE_FIRST_EVENT + 5)
 +#define IPIPE_EVENT_CLEANUP   (IPIPE_FIRST_EVENT + 6)
-+#define IPIPE_LAST_EVENT  IPIPE_EVENT_CLEANUP
++#define IPIPE_EVENT_RETURN(IPIPE_FIRST_EVENT + 7)
++#define IPIPE_LAST_EVENT  IPIPE_EVENT_RETURN
 +#define IPIPE_NR_EVENTS   (IPIPE_LAST_EVENT + 1)
 +
 +#ifndef __ASSEMBLY__
@@ -2706,10 +2707,10 @@ index 000..1b9550c
 +#endif /* CONFIG_ARM_FCSE_MESSAGES */
 diff --git a/arch/arm/kernel/ipipe.c b/arch/arm/kernel/ipipe.c
 new file mode 100644
-index 000..41b1013
+index 000..0ee9ee1
 --- /dev/null
 +++ b/arch/arm/kernel/ipipe.c
-@@ -0,0 +1,549 @@
+@@ -0,0 +1,571 @@
 +/* -*- linux-c -*-
 + * linux/arch/arm/kernel/ipipe.c
 + *
@@ -3062,11 +3063,17 @@ index 000..41b1013
 +asmlinkage int __ipipe_syscall_root(unsigned long scno, struct pt_regs *regs)
 +{
 +  struct ipipe_percpu_domain_data *p;
-+  unsigned long flags, origr7;
++  unsigned long orig_r7;
++int ret = 0;
 +
-+  /* We use r7 to pass the syscall number to the other domains */
-+  origr7 = regs->ARM_r7;
++  WARN_ON_ONCE(irqs_disabled_hw());
++
++  /*
++   * We use r7 to pass the syscall number to the other domains.
++   */
++  orig_r7 = regs->ARM_r7;
 +  regs->ARM_r7 = __NR_SYSCALL_BASE + scno;
++
 +  /*
 +   * This routine either returns:
 +   * 0 -- if the syscall is to be passed to Linux;
@@ -3076,32 +3083,36 @@ index 000..41b1013
 +   * tail work has to be performed (for handling signals etc).
 +   */
 +
-+  WARN_ON_ONCE(irqs_disabled_hw());
-+
 +  if (!__ipipe_syscall_watched_p(current, regs->ARM_r7) ||
 +  !__ipipe_event_monitored_p(IPIPE_EVENT_SYSCALL))
-+  goto done;
++  goto out;
 +
-+  if (__ipipe_dispatch_event(IPIPE_EVENT_SYSCALL,regs) > 0){
-+  if (ipipe_root_domain_p && !in_atomic()) {
-+  /*
-+   * Sync pending VIRQs before _TIF_NEED_RESCHED
-+   * is tested.
-+   */
-+  local_irq_save_hw(flags);
-+  p = ipipe_root_cpudom_ptr();
-+  if (__ipipe_ipending_p(p))
-+  __ipipe_sync_pipeline(IPIPE_IRQ_DOVIRT);
-+  local_irq_restore_hw(flags);
-+  regs->ARM_r7 = origr7;
-+  return -1;
-+  }
-+  regs->ARM_r7 

[Xenomai-git] Philippe Gerum : powerpc: upgrade I-pipe support to 2.6.33.5-powerpc-2. 10-01, 2.6.34-powerpc-2.10-00

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: for-upstream
Commit: 6e10ca0d356a76d447cc347c1d324358aeaa9471
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=6e10ca0d356a76d447cc347c1d324358aeaa9471

Author: Philippe Gerum 
Date:   Wed Jun  9 11:31:28 2010 +0200

powerpc: upgrade I-pipe support to 2.6.33.5-powerpc-2.10-01, 
2.6.34-powerpc-2.10-00

---

 ksrc/arch/powerpc/patches/README   |8 +
 .../adeos-ipipe-2.6.30.3-powerpc-DENX-2.7-06.patch |11728 
 ... => adeos-ipipe-2.6.33.5-powerpc-2.10-01.patch} |  460 +-
 ...ch => adeos-ipipe-2.6.34-powerpc-2.10-00.patch} |  428 +-
 4 files changed, 548 insertions(+), 12076 deletions(-)

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

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


[Xenomai-git] Philippe Gerum : x86: upgrade I-pipe support to 2.6.32.15-x86-2.7-00, 2.6. 34-x86-2.7-00

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: for-upstream
Commit: 4ab7343f799b64572d254b0bca0f19cee6480a82
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=4ab7343f799b64572d254b0bca0f19cee6480a82

Author: Philippe Gerum 
Date:   Wed Jun  9 11:32:52 2010 +0200

x86: upgrade I-pipe support to 2.6.32.15-x86-2.7-00, 2.6.34-x86-2.7-00

---

 .../patches/adeos-ipipe-2.6.32.13-x86-2.6-04.patch |11424 ---
 .../patches/adeos-ipipe-2.6.34-x86-2.6-04.patch|11613 
 2 files changed, 0 insertions(+), 23037 deletions(-)

Diff:   
http://git.xenomai.org/?p=xenomai-rpm.git;a=commitdiff;h=4ab7343f799b64572d254b0bca0f19cee6480a82

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


[Xenomai-git] Philippe Gerum : wrappers: no need to reserve pages passed to vm_insert_page

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: for-upstream
Commit: e740665f1c0c4d8a2a9394256eb0cdcab6529102
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=e740665f1c0c4d8a2a9394256eb0cdcab6529102

Author: Philippe Gerum 
Date:   Wed Jun  9 09:35:58 2010 +0200

wrappers: no need to reserve pages passed to vm_insert_page

---

 include/asm-generic/wrappers.h |7 +++
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/include/asm-generic/wrappers.h b/include/asm-generic/wrappers.h
index ecc1867..a7349db 100644
--- a/include/asm-generic/wrappers.h
+++ b/include/asm-generic/wrappers.h
@@ -343,10 +343,9 @@ unsigned long find_next_bit(const unsigned long *addr,
 /* VM */
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15) && defined(CONFIG_MMU)
-#define wrap_remap_vm_page(vma,from,to) ({ \
-vma->vm_flags |= VM_RESERVED; \
-vm_insert_page(vma,from,vmalloc_to_page((void *)to)); \
-})
+#define wrap_remap_vm_page(vma,from,to) \
+vm_insert_page(vma,from,vmalloc_to_page((void *)to))
+
 #define wrap_remap_io_page_range(vma,from,to,size,prot)  ({\
 (vma)->vm_page_prot = pgprot_noncached((vma)->vm_page_prot);   \
 /* Sets VM_RESERVED | VM_IO | VM_PFNMAP on the vma. */ \


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


[Xenomai-git] Philippe Gerum : nucleus: fix heap mapping for nommu

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: for-upstream
Commit: ada72009aa6a3734b65938b1c2abe00f5c278956
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=ada72009aa6a3734b65938b1c2abe00f5c278956

Author: Philippe Gerum 
Date:   Sun Jun 13 21:49:01 2010 +0200

nucleus: fix heap mapping for nommu

Despite the kernel sees a single backing device with direct mapping
capabilities on nommu targets (/dev/rtheap), we do map different heaps
through it, so we want a brand new mapping region for each of
them. Therefore, we must make sure to request mappings on
non-overlapping areas.

To this end, we request mappings from offsets representing the start
RAM address of the heap memory instead of mapping from offset 0 like
previously.  Otherwise, the kernel could match the same region for
different heaps, for all mmap() requests directed to /dev/rtheap which
appear to be a subset of a previous one, i.e. [offset=0, length <=
largest mapped size to date]. Which does happen most of the time.

Basically, this also means that shared heap mapping on nommu systems
has always been badly broken on all Xenomai releases prior to this
commit. Yeepeee.

For this reason, we do break the nommu ABI to introduce this fix
(i.e. blackfin and nios2), simply because the previous implementation
did not work at all.

---

 include/asm-blackfin/features.h |2 +-
 include/asm-nios2/features.h|2 +-
 include/native/heap.h   |   14 +++--
 include/native/queue.h  |   14 +++--
 include/nucleus/heap.h  |   19 +++--
 include/vrtx/vrtx.h |8 ++---
 ksrc/nucleus/heap.c |   53 +--
 ksrc/nucleus/shadow.c   |   13 ++---
 ksrc/skins/native/syscall.c |7 +++--
 ksrc/skins/psos+/syscall.c  |2 +
 ksrc/skins/vrtx/syscall.c   |4 +-
 src/skins/common/sem_heap.c |   41 +
 src/skins/native/heap.c |9 +-
 src/skins/native/queue.c|   10 ++-
 src/skins/psos+/rn.c|9 +-
 src/skins/rtai/shm.c|8 -
 src/skins/vrtx/heap.c   |8 -
 src/skins/vrtx/pt.c |8 -
 18 files changed, 145 insertions(+), 86 deletions(-)

diff --git a/include/asm-blackfin/features.h b/include/asm-blackfin/features.h
index 9dbee9c..c365c38 100644
--- a/include/asm-blackfin/features.h
+++ b/include/asm-blackfin/features.h
@@ -22,7 +22,7 @@
 #include 
 
 /* The ABI revision level we use on this arch. */
-#define XENOMAI_ABI_REV   3UL
+#define XENOMAI_ABI_REV   4UL
 
 #define XENOMAI_FEAT_DEP  __xn_feat_generic_mask
 
diff --git a/include/asm-nios2/features.h b/include/asm-nios2/features.h
index eb4589a..534c052 100644
--- a/include/asm-nios2/features.h
+++ b/include/asm-nios2/features.h
@@ -36,7 +36,7 @@ static inline void collect_arch_features(struct xnfeatinfo 
*finfo)
 #endif
 
 /* The ABI revision level we use on this arch. */
-#define XENOMAI_ABI_REV   1UL
+#define XENOMAI_ABI_REV   2UL
 
 #define XENOMAI_FEAT_DEP  __xn_feat_generic_mask
 
diff --git a/include/native/heap.h b/include/native/heap.h
index 0c2a7a2..443fd82 100644
--- a/include/native/heap.h
+++ b/include/native/heap.h
@@ -58,15 +58,11 @@ typedef struct rt_heap_info {
 } RT_HEAP_INFO;
 
 typedef struct rt_heap_placeholder {
-
-xnhandle_t opaque;
-
-void *opaque2;
-
-caddr_t mapbase;
-
-size_t mapsize;
-
+   xnhandle_t opaque;
+   void *opaque2;
+   caddr_t mapbase;
+   size_t mapsize;
+   xnheap_area_decl();
 } RT_HEAP_PLACEHOLDER;
 
 #if defined(__KERNEL__) || defined(__XENO_SIM__)
diff --git a/include/native/queue.h b/include/native/queue.h
index 2951c42..b266c1d 100644
--- a/include/native/queue.h
+++ b/include/native/queue.h
@@ -58,15 +58,11 @@ typedef struct rt_queue_info {
 } RT_QUEUE_INFO;
 
 typedef struct rt_queue_placeholder {
-
-xnhandle_t opaque;
-
-void *opaque2;
-
-caddr_t mapbase;
-
-size_t mapsize;
-
+   xnhandle_t opaque;
+   void *opaque2;
+   caddr_t mapbase;
+   size_t mapsize;
+   xnheap_area_decl();
 } RT_QUEUE_PLACEHOLDER;
 
 #if defined(__KERNEL__) || defined(__XENO_SIM__)
diff --git a/include/nucleus/heap.h b/include/nucleus/heap.h
index f4ebe11..e837bf2 100644
--- a/include/nucleus/heap.h
+++ b/include/nucleus/heap.h
@@ -208,14 +208,17 @@ void xnheap_destroy_mapped(xnheap_t *heap,
   void (*release)(struct xnheap *heap),
   void __user *mapaddr);
 
+#define xnheap_base_memory(heap) \
+   ((caddr_t)(heap)->archdep.heapbase)
+
 #define xnheap_mapped_offset(heap,ptr) \
-(((caddr_t)(ptr)) - ((caddr_t)(heap)->archdep.heapbase))
+   (((caddr_t)(ptr)) - xnheap_base_memory(heap))
 
 #define xnheap_mapped_address(heap,off) \
-(((caddr_t)(heap)->archdep.heapbase) + (off))
+   (xnheap_base_memory(heap) + (off))
 
 #define xnheap_mapped_p(heap) \
-((heap)->archdep.heapbase != NULL)
+   (xnheap_base_memory(heap) != NU

[Xenomai-git] Alexis Berlemont : analogy: [loop] add a debug trace when trigger is called

2010-06-15 Thread GIT version control
Module: xenomai-abe
Branch: experimental
Commit: aa54cdf050192d578e8078930c257f44fa08c75f
URL:
http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=aa54cdf050192d578e8078930c257f44fa08c75f

Author: Alexis Berlemont 
Date:   Wed Jun 16 00:34:20 2010 +0200

analogy: [loop] add a debug trace when trigger is called

---

 ksrc/drivers/analogy/testing/loop.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/ksrc/drivers/analogy/testing/loop.c 
b/ksrc/drivers/analogy/testing/loop.c
index f73ad09..72748d8 100644
--- a/ksrc/drivers/analogy/testing/loop.c
+++ b/ksrc/drivers/analogy/testing/loop.c
@@ -124,6 +124,9 @@ int loop_cmd(a4l_subd_t *subd, a4l_cmd_t *cmd)
 int loop_trigger(a4l_subd_t *subd, lsampl_t trignum)
 {
lpprv_t *priv = (lpprv_t *)subd->dev->priv;
+
+   a4l_info(subd->dev, "loop_trigger: (subd=%d)\n", subd->idx);  
+
priv->loop_running = 1;
return 0;
 }


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


[Xenomai-git] Alexis Berlemont : analogy: fix test of subdevice status in a4l_write

2010-06-15 Thread GIT version control
Module: xenomai-abe
Branch: experimental
Commit: 6b4122827fdfbb80e6b290cff0b846cdaf34ba87
URL:
http://git.xenomai.org/?p=xenomai-abe.git;a=commit;h=6b4122827fdfbb80e6b290cff0b846cdaf34ba87

Author: Alexis Berlemont 
Date:   Wed Jun 16 00:35:03 2010 +0200

analogy: fix test of subdevice status in a4l_write

---

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

diff --git a/ksrc/drivers/analogy/buffer.c b/ksrc/drivers/analogy/buffer.c
index 04922be..12b8b9b 100644
--- a/ksrc/drivers/analogy/buffer.c
+++ b/ksrc/drivers/analogy/buffer.c
@@ -828,7 +828,7 @@ ssize_t a4l_write_buffer(a4l_cxt_t *cxt, const void 
*bufdata, size_t nbytes)
return -EINVAL;
}
 
-   if (!subd || !test_bit(A4L_SUBD_BUSY, &subd->status)) {
+   if (!subd || !a4l_subd_is_busy(subd)) {
__a4l_err("a4l_write: idle subdevice on this context\n");
return -ENOENT;
}


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


[Xenomai-git] Philippe Gerum : x86: upgrade I-pipe support to 2.6.32.15-x86-2.7-01, 2.6. 34-x86-2.7-01

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: queue/mayday
Commit: ec40cb47c0413c3f907a572b7d17819494e8dda5
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=ec40cb47c0413c3f907a572b7d17819494e8dda5

Author: Philippe Gerum 
Date:   Mon Jun 14 11:48:11 2010 +0200

x86: upgrade I-pipe support to 2.6.32.15-x86-2.7-01, 2.6.34-x86-2.7-01

---

 ...atch => adeos-ipipe-2.6.32.15-x86-2.7-01.patch} |   11 ++-
 ...0.patch => adeos-ipipe-2.6.34-x86-2.7-01.patch} |   11 ++-
 2 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/ksrc/arch/x86/patches/adeos-ipipe-2.6.32.15-x86-2.7-00.patch 
b/ksrc/arch/x86/patches/adeos-ipipe-2.6.32.15-x86-2.7-01.patch
similarity index 99%
rename from ksrc/arch/x86/patches/adeos-ipipe-2.6.32.15-x86-2.7-00.patch
rename to ksrc/arch/x86/patches/adeos-ipipe-2.6.32.15-x86-2.7-01.patch
index 57287d9..fa5203e 100644
--- a/ksrc/arch/x86/patches/adeos-ipipe-2.6.32.15-x86-2.7-00.patch
+++ b/ksrc/arch/x86/patches/adeos-ipipe-2.6.32.15-x86-2.7-01.patch
@@ -168,7 +168,7 @@ index 0b72282..6574056 100644
  /*
 diff --git a/arch/x86/include/asm/ipipe.h b/arch/x86/include/asm/ipipe.h
 new file mode 100644
-index 000..a090aeb
+index 000..8b95530
 --- /dev/null
 +++ b/arch/x86/include/asm/ipipe.h
 @@ -0,0 +1,158 @@
@@ -199,10 +199,10 @@ index 000..a090aeb
 +#ifdef CONFIG_IPIPE
 +
 +#ifndef IPIPE_ARCH_STRING
-+#define IPIPE_ARCH_STRING "2.7-00"
++#define IPIPE_ARCH_STRING "2.7-01"
 +#define IPIPE_MAJOR_NUMBER2
 +#define IPIPE_MINOR_NUMBER7
-+#define IPIPE_PATCH_NUMBER0
++#define IPIPE_PATCH_NUMBER1
 +#endif
 +
 +DECLARE_PER_CPU(struct pt_regs, __ipipe_tick_regs);
@@ -6840,10 +6840,10 @@ index 000..6257dfa
 +obj-$(CONFIG_IPIPE_TRACE) += tracer.o
 diff --git a/kernel/ipipe/core.c b/kernel/ipipe/core.c
 new file mode 100644
-index 000..c6f4507
+index 000..b6731a4
 --- /dev/null
 +++ b/kernel/ipipe/core.c
-@@ -0,0 +1,1954 @@
+@@ -0,0 +1,1955 @@
 +/* -*- linux-c -*-
 + * linux/kernel/ipipe/core.c
 + *
@@ -8786,6 +8786,7 @@ index 000..c6f4507
 +EXPORT_SYMBOL(ipipe_send_ipi);
 +EXPORT_SYMBOL(__ipipe_pend_irq);
 +EXPORT_SYMBOL(__ipipe_set_irq_pending);
++EXPORT_SYMBOL(__ipipe_event_monitors);
 +#if defined(CONFIG_IPIPE_DEBUG_INTERNAL) && defined(CONFIG_SMP)
 +EXPORT_SYMBOL(__ipipe_check_percpu_access);
 +#endif
diff --git a/ksrc/arch/x86/patches/adeos-ipipe-2.6.34-x86-2.7-00.patch 
b/ksrc/arch/x86/patches/adeos-ipipe-2.6.34-x86-2.7-01.patch
similarity index 99%
rename from ksrc/arch/x86/patches/adeos-ipipe-2.6.34-x86-2.7-00.patch
rename to ksrc/arch/x86/patches/adeos-ipipe-2.6.34-x86-2.7-01.patch
index 4d6b31b..d214c88 100644
--- a/ksrc/arch/x86/patches/adeos-ipipe-2.6.34-x86-2.7-00.patch
+++ b/ksrc/arch/x86/patches/adeos-ipipe-2.6.34-x86-2.7-01.patch
@@ -168,7 +168,7 @@ index 0b72282..6574056 100644
  /*
 diff --git a/arch/x86/include/asm/ipipe.h b/arch/x86/include/asm/ipipe.h
 new file mode 100644
-index 000..92d6b4d
+index 000..ef806d7
 --- /dev/null
 +++ b/arch/x86/include/asm/ipipe.h
 @@ -0,0 +1,181 @@
@@ -199,10 +199,10 @@ index 000..92d6b4d
 +#ifdef CONFIG_IPIPE
 +
 +#ifndef IPIPE_ARCH_STRING
-+#define IPIPE_ARCH_STRING "2.7-00"
++#define IPIPE_ARCH_STRING "2.7-01"
 +#define IPIPE_MAJOR_NUMBER2
 +#define IPIPE_MINOR_NUMBER7
-+#define IPIPE_PATCH_NUMBER0
++#define IPIPE_PATCH_NUMBER1
 +#endif
 +
 +DECLARE_PER_CPU(struct pt_regs, __ipipe_tick_regs);
@@ -6929,10 +6929,10 @@ index 000..6257dfa
 +obj-$(CONFIG_IPIPE_TRACE) += tracer.o
 diff --git a/kernel/ipipe/core.c b/kernel/ipipe/core.c
 new file mode 100644
-index 000..b7d863d
+index 000..e2503bd
 --- /dev/null
 +++ b/kernel/ipipe/core.c
-@@ -0,0 +1,1976 @@
+@@ -0,0 +1,1977 @@
 +/* -*- linux-c -*-
 + * linux/kernel/ipipe/core.c
 + *
@@ -8897,6 +8897,7 @@ index 000..b7d863d
 +EXPORT_SYMBOL(ipipe_send_ipi);
 +EXPORT_SYMBOL(__ipipe_pend_irq);
 +EXPORT_SYMBOL(__ipipe_set_irq_pending);
++EXPORT_SYMBOL(__ipipe_event_monitors);
 +#if defined(CONFIG_IPIPE_DEBUG_INTERNAL) && defined(CONFIG_SMP)
 +EXPORT_SYMBOL(__ipipe_check_percpu_access);
 +#endif


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


[Xenomai-git] Philippe Gerum : common: warn early about missing /dev/rtheap

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: queue/mayday
Commit: 01a89baf0177ea3c84335ed3a98a499da1595047
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=01a89baf0177ea3c84335ed3a98a499da1595047

Author: Philippe Gerum 
Date:   Mon Jun 14 17:35:13 2010 +0200

common: warn early about missing /dev/rtheap

---

 include/nucleus/heap.h  |3 +--
 src/skins/common/bind.c |9 +
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/include/nucleus/heap.h b/include/nucleus/heap.h
index da5732e..85ab3a3 100644
--- a/include/nucleus/heap.h
+++ b/include/nucleus/heap.h
@@ -190,8 +190,6 @@ extern "C" {
 
 #ifdef __KERNEL__
 
-#define XNHEAP_DEV_MINOR 254
-
 int xnheap_mount(void);
 
 void xnheap_umount(void);
@@ -278,6 +276,7 @@ int xnheap_check_block(xnheap_t *heap,
 #endif /* __KERNEL__ || __XENO_SIM__ */
 
 #define XNHEAP_DEV_NAME  "/dev/rtheap"
+#define XNHEAP_DEV_MINOR 254
 
 struct xnheap_desc {
unsigned long handle;
diff --git a/src/skins/common/bind.c b/src/skins/common/bind.c
index d511072..fb15bf5 100644
--- a/src/skins/common/bind.c
+++ b/src/skins/common/bind.c
@@ -1,9 +1,11 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -86,6 +88,13 @@ xeno_bind_skin_opt(unsigned skin_magic, const char *skin,
xnfeatinfo_t finfo;
int muxid;
 
+   /* Some sanity checks first. */
+   if (access(XNHEAP_DEV_NAME, 0)) {
+   fprintf(stderr, "Xenomai: %s is missing\n(chardev, major=10 
minor=%d)\n",
+   XNHEAP_DEV_NAME, XNHEAP_DEV_MINOR);
+   exit(EXIT_FAILURE);
+   }
+   
old_sigill_handler = signal(SIGILL, xeno_sigill_handler);
if (old_sigill_handler == SIG_ERR) {
perror("signal(SIGILL)");


___
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.33.5-powerpc-2. 10-02, 2.6.34-powerpc-2.10-01

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: queue/mayday
Commit: 845e1e5c9784cbde1148d7359d9f13b265d086e8
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=845e1e5c9784cbde1148d7359d9f13b265d086e8

Author: Philippe Gerum 
Date:   Mon Jun 14 11:47:15 2010 +0200

powerpc: upgrade I-pipe support to 2.6.33.5-powerpc-2.10-02, 
2.6.34-powerpc-2.10-01

---

 ... => adeos-ipipe-2.6.33.5-powerpc-2.10-02.patch} |   11 ++-
 ...ch => adeos-ipipe-2.6.34-powerpc-2.10-01.patch} |   11 ++-
 2 files changed, 12 insertions(+), 10 deletions(-)

diff --git 
a/ksrc/arch/powerpc/patches/adeos-ipipe-2.6.33.5-powerpc-2.10-01.patch 
b/ksrc/arch/powerpc/patches/adeos-ipipe-2.6.33.5-powerpc-2.10-02.patch
similarity index 99%
rename from ksrc/arch/powerpc/patches/adeos-ipipe-2.6.33.5-powerpc-2.10-01.patch
rename to ksrc/arch/powerpc/patches/adeos-ipipe-2.6.33.5-powerpc-2.10-02.patch
index 8cf975e..9ae5e24 100644
--- a/ksrc/arch/powerpc/patches/adeos-ipipe-2.6.33.5-powerpc-2.10-01.patch
+++ b/ksrc/arch/powerpc/patches/adeos-ipipe-2.6.33.5-powerpc-2.10-02.patch
@@ -262,7 +262,7 @@ index bd100fc..8fa1901 100644
   * or should we not care like we do now ? --BenH.
 diff --git a/arch/powerpc/include/asm/ipipe.h 
b/arch/powerpc/include/asm/ipipe.h
 new file mode 100644
-index 000..b8befae
+index 000..8ec5cd7
 --- /dev/null
 +++ b/arch/powerpc/include/asm/ipipe.h
 @@ -0,0 +1,276 @@
@@ -313,10 +313,10 @@ index 000..b8befae
 +#include 
 +#endif
 +
-+#define IPIPE_ARCH_STRING "2.10-01"
++#define IPIPE_ARCH_STRING "2.10-02"
 +#define IPIPE_MAJOR_NUMBER2
 +#define IPIPE_MINOR_NUMBER10
-+#define IPIPE_PATCH_NUMBER1
++#define IPIPE_PATCH_NUMBER2
 +
 +#ifdef CONFIG_IPIPE_WANT_PREEMPTIBLE_SWITCH
 +
@@ -7871,10 +7871,10 @@ index 000..6257dfa
 +obj-$(CONFIG_IPIPE_TRACE) += tracer.o
 diff --git a/kernel/ipipe/core.c b/kernel/ipipe/core.c
 new file mode 100644
-index 000..fdb84db
+index 000..75f5d42
 --- /dev/null
 +++ b/kernel/ipipe/core.c
-@@ -0,0 +1,1970 @@
+@@ -0,0 +1,1971 @@
 +/* -*- linux-c -*-
 + * linux/kernel/ipipe/core.c
 + *
@@ -9833,6 +9833,7 @@ index 000..fdb84db
 +EXPORT_SYMBOL(ipipe_send_ipi);
 +EXPORT_SYMBOL(__ipipe_pend_irq);
 +EXPORT_SYMBOL(__ipipe_set_irq_pending);
++EXPORT_SYMBOL(__ipipe_event_monitors);
 +#if defined(CONFIG_IPIPE_DEBUG_INTERNAL) && defined(CONFIG_SMP)
 +EXPORT_SYMBOL(__ipipe_check_percpu_access);
 +#endif
diff --git a/ksrc/arch/powerpc/patches/adeos-ipipe-2.6.34-powerpc-2.10-00.patch 
b/ksrc/arch/powerpc/patches/adeos-ipipe-2.6.34-powerpc-2.10-01.patch
similarity index 99%
rename from ksrc/arch/powerpc/patches/adeos-ipipe-2.6.34-powerpc-2.10-00.patch
rename to ksrc/arch/powerpc/patches/adeos-ipipe-2.6.34-powerpc-2.10-01.patch
index aa050eb..ba5e550 100644
--- a/ksrc/arch/powerpc/patches/adeos-ipipe-2.6.34-powerpc-2.10-00.patch
+++ b/ksrc/arch/powerpc/patches/adeos-ipipe-2.6.34-powerpc-2.10-01.patch
@@ -262,7 +262,7 @@ index bd100fc..8fa1901 100644
   * or should we not care like we do now ? --BenH.
 diff --git a/arch/powerpc/include/asm/ipipe.h 
b/arch/powerpc/include/asm/ipipe.h
 new file mode 100644
-index 000..f345359
+index 000..4bb5021
 --- /dev/null
 +++ b/arch/powerpc/include/asm/ipipe.h
 @@ -0,0 +1,277 @@
@@ -313,10 +313,10 @@ index 000..f345359
 +#include 
 +#endif
 +
-+#define IPIPE_ARCH_STRING "2.10-00"
++#define IPIPE_ARCH_STRING "2.10-01"
 +#define IPIPE_MAJOR_NUMBER2
 +#define IPIPE_MINOR_NUMBER10
-+#define IPIPE_PATCH_NUMBER0
++#define IPIPE_PATCH_NUMBER1
 +
 +#ifdef CONFIG_IPIPE_WANT_PREEMPTIBLE_SWITCH
 +
@@ -7295,10 +7295,10 @@ index 000..6257dfa
 +obj-$(CONFIG_IPIPE_TRACE) += tracer.o
 diff --git a/kernel/ipipe/core.c b/kernel/ipipe/core.c
 new file mode 100644
-index 000..b7d863d
+index 000..e2503bd
 --- /dev/null
 +++ b/kernel/ipipe/core.c
-@@ -0,0 +1,1976 @@
+@@ -0,0 +1,1977 @@
 +/* -*- linux-c -*-
 + * linux/kernel/ipipe/core.c
 + *
@@ -9263,6 +9263,7 @@ index 000..b7d863d
 +EXPORT_SYMBOL(ipipe_send_ipi);
 +EXPORT_SYMBOL(__ipipe_pend_irq);
 +EXPORT_SYMBOL(__ipipe_set_irq_pending);
++EXPORT_SYMBOL(__ipipe_event_monitors);
 +#if defined(CONFIG_IPIPE_DEBUG_INTERNAL) && defined(CONFIG_SMP)
 +EXPORT_SYMBOL(__ipipe_check_percpu_access);
 +#endif


___
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.34-blackfin-1. 14-01

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: queue/mayday
Commit: d9ed9c014a650896fbd1b1bba14b10372f20028a
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=d9ed9c014a650896fbd1b1bba14b10372f20028a

Author: Philippe Gerum 
Date:   Mon Jun 14 11:46:02 2010 +0200

blackfin: upgrade I-pipe support to 2.6.34-blackfin-1.14-01

---

 ...h => adeos-ipipe-2.6.34-blackfin-1.14-01.patch} |   28 +++
 1 files changed, 22 insertions(+), 6 deletions(-)

diff --git 
a/ksrc/arch/blackfin/patches/adeos-ipipe-2.6.34-blackfin-1.14-00.patch 
b/ksrc/arch/blackfin/patches/adeos-ipipe-2.6.34-blackfin-1.14-01.patch
similarity index 99%
rename from ksrc/arch/blackfin/patches/adeos-ipipe-2.6.34-blackfin-1.14-00.patch
rename to ksrc/arch/blackfin/patches/adeos-ipipe-2.6.34-blackfin-1.14-01.patch
index e57f536..d62e225 100644
--- a/ksrc/arch/blackfin/patches/adeos-ipipe-2.6.34-blackfin-1.14-00.patch
+++ b/ksrc/arch/blackfin/patches/adeos-ipipe-2.6.34-blackfin-1.14-01.patch
@@ -1,21 +1,36 @@
+diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig
+index c078849..799b1c0 100644
+--- a/arch/blackfin/Kconfig
 b/arch/blackfin/Kconfig
+@@ -84,6 +84,8 @@ source "kernel/Kconfig.freezer"
+ 
+ menu "Blackfin Processor Options"
+ 
++source "kernel/ipipe/Kconfig"
++
+ comment "Processor and Board Settings"
+ 
+ choice
 diff --git a/arch/blackfin/include/asm/ipipe.h 
b/arch/blackfin/include/asm/ipipe.h
-index d3b4044..32b7bad 100644
+index d3b4044..331ef0b 100644
 --- a/arch/blackfin/include/asm/ipipe.h
 +++ b/arch/blackfin/include/asm/ipipe.h
-@@ -34,10 +34,11 @@
+@@ -34,11 +34,12 @@
  #include 
  #include 
  #include 
 +#include 
  
 -#define IPIPE_ARCH_STRING "1.12-00"
-+#define IPIPE_ARCH_STRING "1.14-00"
++#define IPIPE_ARCH_STRING "1.14-01"
  #define IPIPE_MAJOR_NUMBER1
 -#define IPIPE_MINOR_NUMBER12
+-#define IPIPE_PATCH_NUMBER0
 +#define IPIPE_MINOR_NUMBER14
- #define IPIPE_PATCH_NUMBER0
++#define IPIPE_PATCH_NUMBER1
  
  #ifdef CONFIG_SMP
+ #error "I-pipe/blackfin: SMP not implemented"
 @@ -129,11 +130,11 @@ void __ipipe_enable_pipeline(void);
  #define __ipipe_hook_critical_ipi(ipd) do { } while (0)
  
@@ -2679,10 +2694,10 @@ index 000..6257dfa
 +obj-$(CONFIG_IPIPE_TRACE) += tracer.o
 diff --git a/kernel/ipipe/core.c b/kernel/ipipe/core.c
 new file mode 100644
-index 000..b7d863d
+index 000..e2503bd
 --- /dev/null
 +++ b/kernel/ipipe/core.c
-@@ -0,0 +1,1976 @@
+@@ -0,0 +1,1977 @@
 +/* -*- linux-c -*-
 + * linux/kernel/ipipe/core.c
 + *
@@ -4647,6 +4662,7 @@ index 000..b7d863d
 +EXPORT_SYMBOL(ipipe_send_ipi);
 +EXPORT_SYMBOL(__ipipe_pend_irq);
 +EXPORT_SYMBOL(__ipipe_set_irq_pending);
++EXPORT_SYMBOL(__ipipe_event_monitors);
 +#if defined(CONFIG_IPIPE_DEBUG_INTERNAL) && defined(CONFIG_SMP)
 +EXPORT_SYMBOL(__ipipe_check_percpu_access);
 +#endif


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


[Xenomai-git] Philippe Gerum : arm: upgrade I-pipe support to 2.6.33-arm-1.17-01

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: queue/mayday
Commit: 34ffc0f45740fdc5aec6bfdc1783dfb850c9fc28
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=34ffc0f45740fdc5aec6bfdc1783dfb850c9fc28

Author: Philippe Gerum 
Date:   Mon Jun 14 11:45:16 2010 +0200

arm: upgrade I-pipe support to 2.6.33-arm-1.17-01

---

 patch => adeos-ipipe-2.6.33-arm-1.17-01.patch} |   11 ++-
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/ksrc/arch/arm/patches/adeos-ipipe-2.6.33-arm-1.17-00.patch 
b/ksrc/arch/arm/patches/adeos-ipipe-2.6.33-arm-1.17-01.patch
similarity index 99%
rename from ksrc/arch/arm/patches/adeos-ipipe-2.6.33-arm-1.17-00.patch
rename to ksrc/arch/arm/patches/adeos-ipipe-2.6.33-arm-1.17-01.patch
index d2ab300..22f5d3f 100644
--- a/ksrc/arch/arm/patches/adeos-ipipe-2.6.33-arm-1.17-00.patch
+++ b/ksrc/arch/arm/patches/adeos-ipipe-2.6.33-arm-1.17-01.patch
@@ -630,7 +630,7 @@ index 000..cfdf14a
 +#endif /* __ASM_ARM_FCSE_H */
 diff --git a/arch/arm/include/asm/ipipe.h b/arch/arm/include/asm/ipipe.h
 new file mode 100644
-index 000..ada91f3
+index 000..f8880e0
 --- /dev/null
 +++ b/arch/arm/include/asm/ipipe.h
 @@ -0,0 +1,274 @@
@@ -665,10 +665,10 @@ index 000..ada91f3
 +#include 
 +#include /* For __IPIPE_FEATURE_PIC_MUTE */
 +
-+#define IPIPE_ARCH_STRING "1.17-00"
++#define IPIPE_ARCH_STRING "1.17-01"
 +#define IPIPE_MAJOR_NUMBER1
 +#define IPIPE_MINOR_NUMBER17
-+#define IPIPE_PATCH_NUMBER0
++#define IPIPE_PATCH_NUMBER1
 +
 +#ifdef CONFIG_SMP
 +#error "I-pipe/arm: SMP not yet implemented"
@@ -10835,10 +10835,10 @@ index 000..6257dfa
 +obj-$(CONFIG_IPIPE_TRACE) += tracer.o
 diff --git a/kernel/ipipe/core.c b/kernel/ipipe/core.c
 new file mode 100644
-index 000..fdb84db
+index 000..75f5d42
 --- /dev/null
 +++ b/kernel/ipipe/core.c
-@@ -0,0 +1,1970 @@
+@@ -0,0 +1,1971 @@
 +/* -*- linux-c -*-
 + * linux/kernel/ipipe/core.c
 + *
@@ -12797,6 +12797,7 @@ index 000..fdb84db
 +EXPORT_SYMBOL(ipipe_send_ipi);
 +EXPORT_SYMBOL(__ipipe_pend_irq);
 +EXPORT_SYMBOL(__ipipe_set_irq_pending);
++EXPORT_SYMBOL(__ipipe_event_monitors);
 +#if defined(CONFIG_IPIPE_DEBUG_INTERNAL) && defined(CONFIG_SMP)
 +EXPORT_SYMBOL(__ipipe_check_percpu_access);
 +#endif


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


[Xenomai-git] Philippe Gerum : nios2: enable MAYDAY support

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: queue/mayday
Commit: 0ca265931a10245885aaefb9344710711b2e1791
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=0ca265931a10245885aaefb9344710711b2e1791

Author: Philippe Gerum 
Date:   Mon Jun 14 18:24:14 2010 +0200

nios2: enable MAYDAY support

---

 include/asm-nios2/bits/shadow.h |   65 +++
 include/asm-nios2/system.h  |8 +
 2 files changed, 73 insertions(+), 0 deletions(-)

diff --git a/include/asm-nios2/bits/shadow.h b/include/asm-nios2/bits/shadow.h
index 1d1969a..8917045 100644
--- a/include/asm-nios2/bits/shadow.h
+++ b/include/asm-nios2/bits/shadow.h
@@ -24,6 +24,8 @@
 #error "Pure kernel header included from user-space!"
 #endif
 
+#include 
+
 static inline void xnarch_init_shadow_tcb(xnarchtcb_t * tcb,
  struct xnthread *thread,
  const char *name)
@@ -63,4 +65,67 @@ static inline int xnarch_local_syscall(struct pt_regs *regs)
 
 #define xnarch_schedule_tail(prev) do { } while(0)
 
+#ifdef XNARCH_HAVE_MAYDAY
+
+static inline void xnarch_setup_mayday_page(void *page)
+{
+   /*
+* We want this code to appear at the top of the MAYDAY page:
+*
+*  00c00334movhi   r3,#__xn_sys_mayday
+*  18c08ac4addir3,r3,#__xn_sys_mux
+*  0084movir2,0
+*  0244movir9,0
+*  003b683atrap
+*  003fff06br  .
+*/
+   static const struct {
+   u32 movhi_r3h;
+   u32 addi_r3l;
+   u32 movi_r2;
+   u32 movi_r9;
+   u32 syscall;
+   u32 bug;
+   } code = {
+   .movhi_r3h = 0x00c00334,
+   .addi_r3l = 0x18c08ac4,
+   .movi_r2 = 0x0084,
+   .movi_r9 = 0x0244,
+   .syscall = 0x003b683a,
+   .bug = 0x003fff06
+   };
+
+   memcpy(page, &code, sizeof(code));
+
+   flush_dcache_range((unsigned long)page,
+  (unsigned long)page + sizeof(code));
+}
+
+static inline void xnarch_call_mayday(void)
+{
+   rthal_return_intercept(current);
+}
+
+static inline void xnarch_handle_mayday(struct xnarchtcb *tcb,
+   struct pt_regs *regs,
+   unsigned long tramp)
+{
+   tcb->mayday.ea = regs->ea;
+   tcb->mayday.r2 = regs->r2;
+   tcb->mayday.r3 = regs->r3;
+   tcb->mayday.r9 = regs->r9;
+   regs->ea = tramp;
+}
+
+static inline void xnarch_fixup_mayday(struct xnarchtcb *tcb,
+  struct pt_regs *regs)
+{
+   regs->ea = tcb->mayday.ea;
+   regs->r2 = tcb->mayday.r2;
+   regs->r3 = tcb->mayday.r3;
+   regs->r9 = tcb->mayday.r9;
+}
+
+#endif /* XNARCH_HAVE_MAYDAY */
+
 #endif /* !_XENO_ASM_NIOS2_BITS_SHADOW_H */
diff --git a/include/asm-nios2/system.h b/include/asm-nios2/system.h
index 65426d1..a31aadf 100644
--- a/include/asm-nios2/system.h
+++ b/include/asm-nios2/system.h
@@ -48,6 +48,14 @@ typedef struct xnarchtcb {   /* Per-thread arch-dependent 
block */
struct thread_struct ts;/* Holds kernel-based thread context. */
struct task_struct *user_task;  /* Shadowed user-space task */
struct thread_struct *tsp;  /* Active thread struct */
+#ifdef XNARCH_HAVE_MAYDAY
+   struct {
+   unsigned long ea;
+   unsigned long r2;
+   unsigned long r3;
+   unsigned long r9;
+   } mayday;
+#endif
 
/* Init block */
struct xnthread *self;


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


[Xenomai-git] Philippe Gerum : blackfin: enable MAYDAY support

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: queue/mayday
Commit: 35e39960e6adec45d5d7de626dc6404e530920c0
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=35e39960e6adec45d5d7de626dc6404e530920c0

Author: Philippe Gerum 
Date:   Sun Jun 13 17:26:05 2010 +0200

blackfin: enable MAYDAY support

---

 include/asm-blackfin/bits/shadow.h |   78 
 include/asm-blackfin/system.h  |7 +++
 2 files changed, 85 insertions(+), 0 deletions(-)

diff --git a/include/asm-blackfin/bits/shadow.h 
b/include/asm-blackfin/bits/shadow.h
index f44d25d..1a77fe4 100644
--- a/include/asm-blackfin/bits/shadow.h
+++ b/include/asm-blackfin/bits/shadow.h
@@ -24,6 +24,8 @@
 #error "Pure kernel header included from user-space!"
 #endif
 
+#include 
+
 static inline void xnarch_init_shadow_tcb(xnarchtcb_t * tcb,
  struct xnthread *thread,
  const char *name)
@@ -66,4 +68,80 @@ static inline int xnarch_local_syscall(struct pt_regs *regs)
 
 #define xnarch_schedule_tail(prev) do { } while(0)
 
+#ifdef XNARCH_HAVE_MAYDAY
+
+static inline void xnarch_setup_mayday_page(void *page)
+{
+   /*
+* We want this code to appear at the top of the MAYDAY page:
+*
+* 45 e1 0c 00R5.H = 0xc
+* 05 e1 2b 02R5.L = 0x22b
+* 05 32  P0 = R5
+* 05 60  R5 = 0x0 (X)
+* a0 00  EXCPT 0x0
+* cd ef  
+*
+* We don't mess with ASTAT here, so no need to save/restore
+* it in handle/fixup code.
+*/
+   static const struct {
+   struct __attribute__ ((__packed__)) {
+   u16 op;
+   u16 imm;
+   } load_r5h;
+   struct __attribute__ ((__packed__)) {
+   u16 op;
+   u16 imm;
+   } load_r5l;
+   u16 mov_p0;
+   u16 clear_r5;
+   u16 syscall;
+   u16 bug;
+   } code = {
+   .load_r5h = {
+   .op = 0xe145,
+   .imm = __xn_mux_code(0, __xn_sys_mayday) >> 16
+   },
+   .load_r5l = {
+   .op = 0xe105,
+   .imm = __xn_mux_code(0, __xn_sys_mayday) & 0x
+   },
+   .mov_p0 = 0x3205,
+   .clear_r5 = 0x6005,
+   .syscall = 0x00a0,
+   .bug = BFIN_BUG_OPCODE,
+   };
+
+   memcpy(page, &code, sizeof(code));
+
+   flush_dcache_range((unsigned long)page,
+  (unsigned long)page + sizeof(code));
+}
+
+static inline void xnarch_call_mayday(void)
+{
+   rthal_return_intercept(current);
+}
+
+static inline void xnarch_handle_mayday(struct xnarchtcb *tcb,
+   struct pt_regs *regs,
+   unsigned long tramp)
+{
+   tcb->mayday.pc = regs->pc;
+   tcb->mayday.p0 = regs->p0;
+   tcb->mayday.r5 = regs->r5;
+   regs->pc = tramp;   /* i.e. RETI */
+}
+
+static inline void xnarch_fixup_mayday(struct xnarchtcb *tcb,
+  struct pt_regs *regs)
+{
+   regs->pc = tcb->mayday.pc;
+   regs->p0 = tcb->mayday.p0;
+   regs->r5 = tcb->mayday.r5;
+}
+
+#endif /* XNARCH_HAVE_MAYDAY */
+
 #endif /* !_XENO_ASM_BLACKFIN_BITS_SHADOW_H */
diff --git a/include/asm-blackfin/system.h b/include/asm-blackfin/system.h
index f7a46b2..b4be882 100644
--- a/include/asm-blackfin/system.h
+++ b/include/asm-blackfin/system.h
@@ -53,6 +53,13 @@ typedef struct xnarchtcb {   /* Per-thread arch-dependent 
block */
 struct task_struct *active_task;/* Active user-space task */
 #endif
 struct thread_struct *tsp; /* Pointer to the active thread struct (&ts or 
&user->thread). */
+#ifdef XNARCH_HAVE_MAYDAY
+   struct {
+   unsigned long pc;
+   unsigned long p0;
+   unsigned long r5;
+   } mayday;
+#endif
 
 /* Init block */
 struct xnthread *self;


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


[Xenomai-git] Philippe Gerum : arm: enable MAYDAY support

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: queue/mayday
Commit: 36c3eebd17f73a4038485f97ae6734a646b1d4ed
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=36c3eebd17f73a4038485f97ae6734a646b1d4ed

Author: Philippe Gerum 
Date:   Sat Jun 12 08:28:29 2010 +0200

arm: enable MAYDAY support

---

 include/asm-arm/bits/shadow.h |  111 +
 include/asm-arm/system.h  |   10 
 2 files changed, 121 insertions(+), 0 deletions(-)

diff --git a/include/asm-arm/bits/shadow.h b/include/asm-arm/bits/shadow.h
index a396510..6021dad 100644
--- a/include/asm-arm/bits/shadow.h
+++ b/include/asm-arm/bits/shadow.h
@@ -27,6 +27,8 @@
 #error "Pure kernel header included from user-space!"
 #endif
 
+#include 
+
 static inline void xnarch_init_shadow_tcb(xnarchtcb_t * tcb,
  struct xnthread *thread,
  const char *name)
@@ -182,4 +184,113 @@ static inline int xnarch_local_syscall(struct pt_regs 
*regs)
 
 #define xnarch_schedule_tail(prev) do { } while(0)
 
+#ifdef XNARCH_HAVE_MAYDAY
+
+static inline void xnarch_setup_mayday_page(void *page)
+{
+   /*
+* We want this code to appear at the top of the MAYDAY page:
+*
+* ifdef ARM_EABI
+*
+* e3a00f8a mov r0, #552; 0x228
+* e28003c3 add r0, r0, #201326595  ; 0xc03
+* e3a0780f mov r7, #983040 ; 0xf
+* e2877042 add r7, r7, #66 ; 0x42
+* e3a06000 mov r6, #0
+* ef00 svc 0x
+* e3a0 mov r0, #0
+* e580 str r0, [r0]; 
+*
+* elif ARM_OABI
+*
+* e3a00f8a mov r0, #552; 0x228
+* e28003c3 add r0, r0, #201326595  ; 0xc03
+* e3a06000 mov r6, #0
+* ef9f0042 swi 0x009f0042
+* e3a0 mov r0, #0
+* e580 str r0, [r0]; 
+*
+* endif
+*
+* 32bit instruction words will be laid out by the compiler as
+* the target endianness requires.
+*
+* We don't mess with CPSR here, so no need to save/restore it
+* in handle/fixup code.
+*/
+#ifdef CONFIG_XENO_ARM_EABI
+   static const struct {
+   u32 mov_muxl;
+   u32 add_muxh;
+   u32 mov_sysh;
+   u32 add_sysl;
+   u32 mov_sigp;
+   u32 swi_0;
+   u32 mov_r0;
+   u32 str_r0;
+   } code = {
+   .mov_muxl = 0xe3a00f8a,
+   .add_muxh = 0xe28003c3,
+   .mov_sysh = 0xe3a0780f,
+   .add_sysl = 0xe2877042,
+   .mov_sigp = 0xe3a06000,
+   .swi_0 = 0xef00,
+   .mov_r0 = 0xe3a0,
+   .str_r0 = 0xe580
+   };
+#else /* OABI */
+   static const struct {
+   u32 mov_muxl;
+   u32 add_muxh;
+   u32 mov_sigp;
+   u32 swi_syscall;
+   u32 mov_r0;
+   u32 str_r0;
+   } code = {
+   .mov_muxl = 0xe3a00f8a,
+   .add_muxh = 0xe28003c3,
+   .mov_sigp = 0xe3a06000,
+   .swi_syscall = 0x009f0042,
+   .mov_r0 = 0xe3a0,
+   .str_r0 = 0xe580
+   };
+#endif /* OABI */
+
+   memcpy(page, &code, sizeof(code));
+
+   flush_dcache_page(vmalloc_to_page(page));
+}
+
+static inline void xnarch_call_mayday(void)
+{
+   rthal_return_intercept(current);
+}
+
+static inline void xnarch_handle_mayday(struct xnarchtcb *tcb,
+   struct pt_regs *regs,
+   unsigned long tramp)
+{
+   tcb->mayday.pc = regs->ARM_pc;
+   tcb->mayday.r0 = regs->ARM_r0;
+   tcb->mayday.r6 = regs->ARM_r6;
+#ifdef CONFIG_XENO_ARM_EABI
+   tcb->mayday.r7 = regs->ARM_r7;
+#endif
+   regs->ARM_pc = tramp;
+}
+
+static inline void xnarch_fixup_mayday(struct xnarchtcb *tcb,
+  struct pt_regs *regs)
+{
+   regs->ARM_pc = tcb->mayday.pc;
+   regs->ARM_r0 = tcb->mayday.r0;
+   regs->ARM_r6 = tcb->mayday.r6;
+#ifdef CONFIG_XENO_ARM_EABI
+   regs->ARM_r7 = tcb->mayday.r7;
+#endif
+}
+
+#endif /* XNARCH_HAVE_MAYDAY */
+
 #endif /* !_XENO_ASM_ARM_BITS_SHADOW_H */
diff --git a/include/asm-arm/system.h b/include/asm-arm/system.h
index 3cbf43b..2b7b734 100644
--- a/include/asm-arm/system.h
+++ b/include/asm-arm/system.h
@@ -69,6 +69,16 @@ typedef struct xnarchtcb {  /* Per-thread arch-dependent 
block */
struct mm_struct *active_mm;
struct thread_info ti;  /* Holds kernel-based thread info */
struct thread_info *tip;/* Pointer to the active thread 
info (ti or user->thread_info). */
+#ifdef XNARCH_HAVE_MAYDAY
+   struct 

[Xenomai-git] Philippe Gerum : arm: upgrade I-pipe support to 2.6.33-arm-1.17-00

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: queue/mayday
Commit: b2ec9b9f299ff08ddedc8806e903c2a3e4567115
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=b2ec9b9f299ff08ddedc8806e903c2a3e4567115

Author: Philippe Gerum 
Date:   Sat Jun 12 09:38:33 2010 +0200

arm: upgrade I-pipe support to 2.6.33-arm-1.17-00

---

 patch => adeos-ipipe-2.6.33-arm-1.17-00.patch} |  263 +---
 1 files changed, 168 insertions(+), 95 deletions(-)

diff --git a/ksrc/arch/arm/patches/adeos-ipipe-2.6.33-arm-1.16-01.patch 
b/ksrc/arch/arm/patches/adeos-ipipe-2.6.33-arm-1.17-00.patch
similarity index 98%
rename from ksrc/arch/arm/patches/adeos-ipipe-2.6.33-arm-1.16-01.patch
rename to ksrc/arch/arm/patches/adeos-ipipe-2.6.33-arm-1.17-00.patch
index cbb3fb6..d2ab300 100644
--- a/ksrc/arch/arm/patches/adeos-ipipe-2.6.33-arm-1.16-01.patch
+++ b/ksrc/arch/arm/patches/adeos-ipipe-2.6.33-arm-1.17-00.patch
@@ -630,7 +630,7 @@ index 000..cfdf14a
 +#endif /* __ASM_ARM_FCSE_H */
 diff --git a/arch/arm/include/asm/ipipe.h b/arch/arm/include/asm/ipipe.h
 new file mode 100644
-index 000..8ae0cb3
+index 000..ada91f3
 --- /dev/null
 +++ b/arch/arm/include/asm/ipipe.h
 @@ -0,0 +1,274 @@
@@ -665,10 +665,10 @@ index 000..8ae0cb3
 +#include 
 +#include /* For __IPIPE_FEATURE_PIC_MUTE */
 +
-+#define IPIPE_ARCH_STRING "1.16-01"
++#define IPIPE_ARCH_STRING "1.17-00"
 +#define IPIPE_MAJOR_NUMBER1
-+#define IPIPE_MINOR_NUMBER16
-+#define IPIPE_PATCH_NUMBER1
++#define IPIPE_MINOR_NUMBER17
++#define IPIPE_PATCH_NUMBER0
 +
 +#ifdef CONFIG_SMP
 +#error "I-pipe/arm: SMP not yet implemented"
@@ -880,7 +880,7 @@ index 000..8ae0cb3
 +} while(0)
 +
 +#define __ipipe_syscall_watched_p(p, sc)  \
-+  (((p)->flags & PF_EVNOTIFY) || (unsigned long)sc >= __ARM_NR_BASE + 64)
++  (ipipe_notifier_enabled_p(p) || (unsigned long)sc >= __ARM_NR_BASE + 64)
 +
 +#define __ipipe_root_tick_p(regs) (!raw_irqs_disabled_flags(regs->ARM_cpsr))
 +
@@ -910,10 +910,10 @@ index 000..8ae0cb3
 +#endif/* !__ARM_IPIPE_H */
 diff --git a/arch/arm/include/asm/ipipe_base.h 
b/arch/arm/include/asm/ipipe_base.h
 new file mode 100644
-index 000..20e97a4
+index 000..f78523d
 --- /dev/null
 +++ b/arch/arm/include/asm/ipipe_base.h
-@@ -0,0 +1,108 @@
+@@ -0,0 +1,109 @@
 +/* -*- linux-c -*-
 + * arch/arm/include/asm/ipipe_base.h
 + *
@@ -966,7 +966,8 @@ index 000..20e97a4
 +#define IPIPE_EVENT_INIT  (IPIPE_FIRST_EVENT + 4)
 +#define IPIPE_EVENT_EXIT  (IPIPE_FIRST_EVENT + 5)
 +#define IPIPE_EVENT_CLEANUP   (IPIPE_FIRST_EVENT + 6)
-+#define IPIPE_LAST_EVENT  IPIPE_EVENT_CLEANUP
++#define IPIPE_EVENT_RETURN(IPIPE_FIRST_EVENT + 7)
++#define IPIPE_LAST_EVENT  IPIPE_EVENT_RETURN
 +#define IPIPE_NR_EVENTS   (IPIPE_LAST_EVENT + 1)
 +
 +#ifndef __ASSEMBLY__
@@ -2706,10 +2707,10 @@ index 000..1b9550c
 +#endif /* CONFIG_ARM_FCSE_MESSAGES */
 diff --git a/arch/arm/kernel/ipipe.c b/arch/arm/kernel/ipipe.c
 new file mode 100644
-index 000..41b1013
+index 000..0ee9ee1
 --- /dev/null
 +++ b/arch/arm/kernel/ipipe.c
-@@ -0,0 +1,549 @@
+@@ -0,0 +1,571 @@
 +/* -*- linux-c -*-
 + * linux/arch/arm/kernel/ipipe.c
 + *
@@ -3062,11 +3063,17 @@ index 000..41b1013
 +asmlinkage int __ipipe_syscall_root(unsigned long scno, struct pt_regs *regs)
 +{
 +  struct ipipe_percpu_domain_data *p;
-+  unsigned long flags, origr7;
++  unsigned long orig_r7;
++int ret = 0;
 +
-+  /* We use r7 to pass the syscall number to the other domains */
-+  origr7 = regs->ARM_r7;
++  WARN_ON_ONCE(irqs_disabled_hw());
++
++  /*
++   * We use r7 to pass the syscall number to the other domains.
++   */
++  orig_r7 = regs->ARM_r7;
 +  regs->ARM_r7 = __NR_SYSCALL_BASE + scno;
++
 +  /*
 +   * This routine either returns:
 +   * 0 -- if the syscall is to be passed to Linux;
@@ -3076,32 +3083,36 @@ index 000..41b1013
 +   * tail work has to be performed (for handling signals etc).
 +   */
 +
-+  WARN_ON_ONCE(irqs_disabled_hw());
-+
 +  if (!__ipipe_syscall_watched_p(current, regs->ARM_r7) ||
 +  !__ipipe_event_monitored_p(IPIPE_EVENT_SYSCALL))
-+  goto done;
++  goto out;
 +
-+  if (__ipipe_dispatch_event(IPIPE_EVENT_SYSCALL,regs) > 0){
-+  if (ipipe_root_domain_p && !in_atomic()) {
-+  /*
-+   * Sync pending VIRQs before _TIF_NEED_RESCHED
-+   * is tested.
-+   */
-+  local_irq_save_hw(flags);
-+  p = ipipe_root_cpudom_ptr();
-+  if (__ipipe_ipending_p(p))
-+  __ipipe_sync_pipeline(IPIPE_IRQ_DOVIRT);
-+  local_irq_restore_hw(flags);
-+  regs->ARM_r7 = origr7;
-+  return -1;
-+  }
-+  regs->ARM_r7 

[Xenomai-git] Philippe Gerum : powerpc: enable MAYDAY support

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: queue/mayday
Commit: 2df7960de3e7061e8b0ea6ecd50cec2484a7fbf9
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=2df7960de3e7061e8b0ea6ecd50cec2484a7fbf9

Author: Philippe Gerum 
Date:   Sat Jun  5 11:57:40 2010 +0200

powerpc: enable MAYDAY support

---

 include/asm-powerpc/bits/shadow.h |   61 +
 include/asm-powerpc/system.h  |8 -
 2 files changed, 68 insertions(+), 1 deletions(-)

diff --git a/include/asm-powerpc/bits/shadow.h 
b/include/asm-powerpc/bits/shadow.h
index 47b65a2..7f3554e 100644
--- a/include/asm-powerpc/bits/shadow.h
+++ b/include/asm-powerpc/bits/shadow.h
@@ -27,6 +27,12 @@
 #error "Pure kernel header included from user-space!"
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
+#include 
+#else
+#include 
+#endif
+
 static inline void xnarch_init_shadow_tcb(xnarchtcb_t * tcb,
  struct xnthread *thread,
  const char *name)
@@ -59,4 +65,59 @@ static inline int xnarch_local_syscall(struct pt_regs *regs)
 
 #define xnarch_schedule_tail(prev) do { } while(0)
 
+#ifdef XNARCH_HAVE_MAYDAY
+
+static inline void xnarch_setup_mayday_page(void *page)
+{
+   /*
+* We want this code to appear at the top of the MAYDAY page:
+*
+* 3c 00 0b 00  lis r0,mux_c...@h
+* 60 00 02 2b  ori r0,r0,mux_c...@l
+* 39 00 00 00  li  r8,0
+* 44 00 00 02  sc
+* 00 b0 0b 00  .long   0x00b00b00 
+*
+* We don't mess with CCR here, so no need to save/restore it
+* in handle/fixup code.
+*/
+   u32 mux, insn[5];
+
+   mux = __xn_mux_code(0, __xn_sys_mayday);
+   insn[0] = 0x3c00 | (mux >> 16);
+   insn[1] = 0x6000 | (mux & 0x);
+   insn[2] = 0x3900;
+   insn[3] = 0x4402;
+   insn[4] = 0x00b00b00;
+   memcpy(page, insn, sizeof(insn));
+
+   flush_dcache_range((unsigned long)page,
+  (unsigned long)page + sizeof(insn));
+}
+
+static inline void xnarch_call_mayday(void)
+{
+   rthal_return_intercept(current);
+}
+
+static inline void xnarch_handle_mayday(struct xnarchtcb *tcb,
+   struct pt_regs *regs,
+   unsigned long tramp)
+{
+   tcb->mayday.nip = regs->nip;
+   tcb->mayday.r0 = regs->gpr[0];
+   tcb->mayday.r8 = regs->gpr[8];
+   regs->nip = tramp;
+}
+
+static inline void xnarch_fixup_mayday(struct xnarchtcb *tcb,
+  struct pt_regs *regs)
+{
+   regs->nip = tcb->mayday.nip;
+   regs->gpr[0] = tcb->mayday.r0;
+   regs->gpr[8] = tcb->mayday.r8;
+}
+
+#endif /* XNARCH_HAVE_MAYDAY */
+
 #endif /* !_XENO_ASM_POWERPC_BITS_SHADOW_H */
diff --git a/include/asm-powerpc/system.h b/include/asm-powerpc/system.h
index 0e1072a..4044f43 100644
--- a/include/asm-powerpc/system.h
+++ b/include/asm-powerpc/system.h
@@ -51,7 +51,13 @@ typedef struct xnarchtcb {   /* Per-thread arch-dependent 
block */
struct thread_struct *tsp;  /* Pointer to the active thread struct 
(&ts or &user->thread). */
struct mm_struct *mm;
struct mm_struct *active_mm;
-
+#ifdef XNARCH_HAVE_MAYDAY
+   struct {
+   unsigned long nip;
+   unsigned long r0;
+   unsigned long r8;
+   } mayday;
+#endif
/* Kernel mode side */
struct thread_struct ts;/* Holds kernel-based thread context. */
 #ifdef CONFIG_XENO_HW_UNLOCKED_SWITCH


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


[Xenomai-git] Philippe Gerum : nucleus: introduce generic bits for MAYDAY support

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: queue/mayday
Commit: e5adade24257b6ebed40ad03eecbe8fc0ed08d5c
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=e5adade24257b6ebed40ad03eecbe8fc0ed08d5c

Author: Philippe Gerum 
Date:   Sat Jun  5 11:39:24 2010 +0200

nucleus: introduce generic bits for MAYDAY support

This patch enables the nucleus to force a user-space thread running
syscall-less code in primary mode, to call the nucleus back on its way
out from an interrupt via a dedicated syscall (__xn_sys_mayday).

This feature is currently useful for recovering gracefully from a
runaway thread situation detected by the nucleus watchdog. Instead of
killing the runaway thread bluntly, this feature allows to force a
relax on it, despite the syscall-less nature of the code it was
running in primary mode.

The trick is to force the thread to run a piece of user-space code
that issues the mayday syscall, by fixing up its program counter on
its way back to userland. This code is laid on the special "mayday
page", mapped to the process address space at binding time. The
implementation relies on the new IPIPE_EVENT_RETURN notification
available from the latest I-pipe patches, to run the fixup code.

In the future, Xenomai real-time signals will be rebased on this
feature to make them able to preempt syscall-less code as well.  In
the same move, the mayday page allocation and setup should move to
user-space. We do this from kernel space for now only to preserve the
2.5.x ABI.

---

 include/asm-generic/hal.h |   28 ++-
 include/asm-generic/syscall.h |1 +
 include/nucleus/ppd.h |4 +
 include/nucleus/shadow.h  |   10 ++
 ksrc/nucleus/sched.c  |1 +
 ksrc/nucleus/shadow.c |  186 ++---
 6 files changed, 216 insertions(+), 14 deletions(-)

diff --git a/include/asm-generic/hal.h b/include/asm-generic/hal.h
index f03219d..f90cafa 100644
--- a/include/asm-generic/hal.h
+++ b/include/asm-generic/hal.h
@@ -259,7 +259,7 @@ static int hdlr (unsigned event, struct ipipe_domain *ipd, 
void *data) \
 static int hdlr (unsigned event, struct ipipe_domain *ipd, void *data) \
 {  \
struct task_struct *p = (struct task_struct *)data; \
-   do_##hdlr(p,p->rt_priority);\
+   do_##hdlr(p, p->rt_priority);   \
return RTHAL_EVENT_PROPAGATE;   \
 }
 
@@ -287,6 +287,14 @@ static int hdlr (unsigned event, struct ipipe_domain *ipd, 
void *data) \
return RTHAL_EVENT_PROPAGATE;  \
 }
 
+#define RTHAL_DECLARE_MAYDAY_EVENT(hdlr) \
+static int hdlr(unsigned event, struct ipipe_domain *ipd, void *data) \
+{\
+   struct pt_regs *regs = data;  \
+   do_##hdlr(regs);  \
+   return RTHAL_EVENT_PROPAGATE; \
+}
+
 #ifndef TASK_ATOMICSWITCH
 #ifdef CONFIG_PREEMPT
 /* We want this feature for preemptible kernels, or the behaviour when
@@ -321,6 +329,15 @@ static inline void clear_task_nowakeup(struct task_struct 
*p)
 #define rthal_set_foreign_stack(ipd)   ipipe_set_foreign_stack(ipd)
 #define rthal_clear_foreign_stack(ipd) ipipe_clear_foreign_stack(ipd)
 
+#ifdef __IPIPE_FEATURE_ENABLE_NOTIFIER
+#define rthal_enable_notifier(p)   ipipe_enable_notifier(p)
+#else
+static inline void rthal_enable_notifier(struct task_struct *p)
+{
+   p->flags |= PF_EVNOTIFY;
+}
+#endif
+
 #define rthal_catch_cleanup(hdlr) \
 ipipe_catch_event(ipipe_root_domain,IPIPE_EVENT_CLEANUP,hdlr)
 #define rthal_catch_taskexit(hdlr) \
@@ -338,6 +355,15 @@ static inline void clear_task_nowakeup(struct task_struct 
*p)
 #define rthal_catch_exception(ex,hdlr) \
 ipipe_catch_event(&rthal_domain,ex|IPIPE_EVENT_SELF,hdlr)
 
+#ifdef IPIPE_EVENT_RETURN
+#define RTHAL_HAVE_RETURN_EVENT
+#define rthal_catch_return(hdlr) \
+ipipe_catch_event(&rthal_domain,IPIPE_EVENT_RETURN,hdlr)
+#define rthal_return_intercept(p)  ipipe_return_notify(p)
+#else
+#define rthal_catch_return(hdlr)   do { } while(0)
+#endif
+
 #define rthal_register_domain(_dom,_name,_id,_prio,_entry) \
 ({ \
struct ipipe_domain_attr attr;  \
diff --git a/include/asm-generic/syscall.h b/include/asm-generic/syscall.h
index 3f10065..7e3d01a 100644
--- a/include/asm-generic/syscall.h
+++ b/include/asm-generic/syscall.h
@@ -47,6 +47,7 @@
 #define __xn_sys_current_info  9   /* r = xnshadow_current_info(&info) */
 #define __xn_sys_get_next_sigs 10  /* only unqueue pending signals. */
 #define __xn_sys_drop_u_mode   11  /* stop updating thread->u_mode */
+#defin

[Xenomai-git] Philippe Gerum : x86: enable MAYDAY support

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: queue/mayday
Commit: 7472558b941f15e5fcf8d207df8ef0dc79201ae4
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=7472558b941f15e5fcf8d207df8ef0dc79201ae4

Author: Philippe Gerum 
Date:   Sun Jun  6 16:25:36 2010 +0200

x86: enable MAYDAY support

---

 include/asm-x86/bits/shadow_32.h |  111 ++
 include/asm-x86/bits/shadow_64.h |   71 
 include/asm-x86/system_32.h  |7 +++
 include/asm-x86/system_64.h  |7 +++
 4 files changed, 196 insertions(+), 0 deletions(-)

diff --git a/include/asm-x86/bits/shadow_32.h b/include/asm-x86/bits/shadow_32.h
index 9fc37a2..40ccc62 100644
--- a/include/asm-x86/bits/shadow_32.h
+++ b/include/asm-x86/bits/shadow_32.h
@@ -49,4 +49,115 @@ static void xnarch_schedule_tail(struct task_struct *prev)
wrap_switch_iobitmap(prev, rthal_processor_id());
 }
 
+#ifdef XNARCH_HAVE_MAYDAY
+
+static inline void xnarch_setup_mayday_page(void *page)
+{
+   /*
+* We want this code to appear at the top of the MAYDAY page:
+*
+*  b8 2b 02 00 0c  mov$,%eax
+*  bd 00 00 00 00  mov$0x0,%ebp
+* if HAVE_SEP
+*  65 ff 15 10 00 00 00call   *%gs:0x10
+* else
+*  cd 80   int$0x80
+* endif
+*  0f 0b   ud2a
+*
+* We intentionally don't mess with EFLAGS here, so that we
+* don't have to save/restore it in handle/fixup code.
+*
+* Also note that if SEP is present, we always assume NPTL on
+* the user side.
+*/
+   static const struct {
+   struct __attribute__ ((__packed__)) {
+   u8 op;
+   u32 imm;
+   } mov_eax;
+   struct __attribute__ ((__packed__)) {
+   u8 op;
+   u32 imm;
+   } mov_ebp;
+   struct __attribute__ ((__packed__)) {
+   u8 op[3];
+   u32 moffs;
+   } syscall;
+   u16 bug;
+   } code_sep = {
+   .mov_eax = {
+   .op = 0xb8,
+   .imm = __xn_mux_code(0, __xn_sys_mayday)
+   },
+   .mov_ebp = {
+   .op = 0xbd,
+   .imm = 0
+   },
+   .syscall = {
+   .op = {
+   0x65, 0xff, 0x15
+   },
+   .moffs = 0x10
+   },
+   .bug = 0x0b0f,
+   };
+
+   static const struct {
+   struct __attribute__ ((__packed__)) {
+   u8 op;
+   u32 imm;
+   } mov_eax;
+   struct __attribute__ ((__packed__)) {
+   u8 op;
+   u32 imm;
+   } mov_ebp;
+   u16 syscall;
+   u16 bug;
+   } code_nosep = {
+   .mov_eax = {
+   .op = 0xb8,
+   .imm = __xn_mux_code(0, __xn_sys_mayday)
+   },
+   .mov_ebp = {
+   .op = 0xbd,
+   .imm = 0
+   },
+   .syscall = 0x80cd,
+   .bug = 0x0b0f,
+   };
+
+   if (cpu_has_sep)
+   memcpy(page, &code_sep, sizeof(code_sep));
+   else
+   memcpy(page, &code_nosep, sizeof(code_nosep));
+
+   /* no cache flush required. */
+}
+
+static inline void xnarch_call_mayday(void)
+{
+   rthal_return_intercept(current);
+}
+
+static inline void xnarch_handle_mayday(struct xnarchtcb *tcb,
+   struct pt_regs *regs,
+   unsigned long tramp)
+{
+   tcb->mayday.eip = regs->x86reg_ip;
+   tcb->mayday.eax = regs->x86reg_ax;
+   tcb->mayday.ebp = regs->x86reg_bp;
+   regs->x86reg_ip = tramp;
+}
+
+static inline void xnarch_fixup_mayday(struct xnarchtcb *tcb,
+  struct pt_regs *regs)
+{
+   regs->x86reg_ip = tcb->mayday.eip;
+   regs->x86reg_ax = tcb->mayday.eax;
+   regs->x86reg_bp = tcb->mayday.ebp;
+}
+
+#endif /* XNARCH_HAVE_MAYDAY */
+
 #endif /* !_XENO_ASM_X86_BITS_SHADOW_32_H */
diff --git a/include/asm-x86/bits/shadow_64.h b/include/asm-x86/bits/shadow_64.h
index ddaa86a..41a266f 100644
--- a/include/asm-x86/bits/shadow_64.h
+++ b/include/asm-x86/bits/shadow_64.h
@@ -52,4 +52,75 @@ static void xnarch_schedule_tail(struct task_struct *prev)
 {
 }
 
+#ifdef XNARCH_HAVE_MAYDAY
+
+static inline void xnarch_setup_mayday_page(void *page)
+{
+   /*
+* We want this code to appear at the top of the MAYDAY page:
+*
+*  b8 2b 02 00 0c  mov$,%eax
+*  49 c7 c1 00 00 00 00mov$0

[Xenomai-git] Philippe Gerum : x86: upgrade I-pipe support to 2.6.32.15-x86-2.7-00, 2.6. 34-x86-2.7-00

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: queue/mayday
Commit: 9295d686be49c3bbbddfafcf6d819135f229a872
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=9295d686be49c3bbbddfafcf6d819135f229a872

Author: Philippe Gerum 
Date:   Wed Jun  9 14:47:01 2010 +0200

x86: upgrade I-pipe support to 2.6.32.15-x86-2.7-00, 2.6.34-x86-2.7-00

---

 .../patches/adeos-ipipe-2.6.32.15-x86-2.7-00.patch |11475 +++
 .../patches/adeos-ipipe-2.6.34-x86-2.7-00.patch|11570 
 2 files changed, 23045 insertions(+), 0 deletions(-)

Diff:   
http://git.xenomai.org/?p=xenomai-rpm.git;a=commitdiff;h=9295d686be49c3bbbddfafcf6d819135f229a872

___
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.33.5-powerpc-2. 10-01, 2.6.34-powerpc-2.10-00

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: queue/mayday
Commit: b45b6ddb24932a283fbbba6598dc7fdadedae1b3
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=b45b6ddb24932a283fbbba6598dc7fdadedae1b3

Author: Philippe Gerum 
Date:   Wed Jun  9 11:31:28 2010 +0200

powerpc: upgrade I-pipe support to 2.6.33.5-powerpc-2.10-01, 
2.6.34-powerpc-2.10-00

---

 ksrc/arch/powerpc/patches/README   |8 +
 .../adeos-ipipe-2.6.30.3-powerpc-DENX-2.7-06.patch |11728 
 ... => adeos-ipipe-2.6.33.5-powerpc-2.10-01.patch} |  460 +-
 ...ch => adeos-ipipe-2.6.34-powerpc-2.10-00.patch} |  428 +-
 4 files changed, 548 insertions(+), 12076 deletions(-)

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

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


[Xenomai-git] Philippe Gerum : wrappers: no need to reserve pages passed to vm_insert_page

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: queue/mayday
Commit: bbcc7c1d5e8101fca9bc81e59a52b372ff33fabd
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=bbcc7c1d5e8101fca9bc81e59a52b372ff33fabd

Author: Philippe Gerum 
Date:   Wed Jun  9 09:35:58 2010 +0200

wrappers: no need to reserve pages passed to vm_insert_page

---

 include/asm-generic/wrappers.h |7 +++
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/include/asm-generic/wrappers.h b/include/asm-generic/wrappers.h
index ecc1867..a7349db 100644
--- a/include/asm-generic/wrappers.h
+++ b/include/asm-generic/wrappers.h
@@ -343,10 +343,9 @@ unsigned long find_next_bit(const unsigned long *addr,
 /* VM */
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15) && defined(CONFIG_MMU)
-#define wrap_remap_vm_page(vma,from,to) ({ \
-vma->vm_flags |= VM_RESERVED; \
-vm_insert_page(vma,from,vmalloc_to_page((void *)to)); \
-})
+#define wrap_remap_vm_page(vma,from,to) \
+vm_insert_page(vma,from,vmalloc_to_page((void *)to))
+
 #define wrap_remap_io_page_range(vma,from,to,size,prot)  ({\
 (vma)->vm_page_prot = pgprot_noncached((vma)->vm_page_prot);   \
 /* Sets VM_RESERVED | VM_IO | VM_PFNMAP on the vma. */ \


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


[Xenomai-git] Philippe Gerum : x86: upgrade I-pipe support to 2.6.32.15-x86-2.7-00, 2.6. 34-x86-2.7-00

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: queue/mayday
Commit: 443219d6075f9489d32981ff8fc4f31865de710e
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=443219d6075f9489d32981ff8fc4f31865de710e

Author: Philippe Gerum 
Date:   Wed Jun  9 11:32:52 2010 +0200

x86: upgrade I-pipe support to 2.6.32.15-x86-2.7-00, 2.6.34-x86-2.7-00

---

 .../patches/adeos-ipipe-2.6.32.13-x86-2.6-04.patch |11424 ---
 .../patches/adeos-ipipe-2.6.34-x86-2.6-04.patch|11613 
 2 files changed, 0 insertions(+), 23037 deletions(-)

Diff:   
http://git.xenomai.org/?p=xenomai-rpm.git;a=commitdiff;h=443219d6075f9489d32981ff8fc4f31865de710e

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


[Xenomai-git] Philippe Gerum : nucleus: fix heap mapping for nommu

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: queue/mayday
Commit: 11221fefff6ceddca51d70a48d3fae67e0103d3c
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=11221fefff6ceddca51d70a48d3fae67e0103d3c

Author: Philippe Gerum 
Date:   Sun Jun 13 21:49:01 2010 +0200

nucleus: fix heap mapping for nommu

Despite the kernel sees a single backing device with direct mapping
capabilities on nommu targets (/dev/rtheap), we do map different heaps
through it, so we want a brand new mapping region for each of
them. Therefore, we must make sure to request mappings on
non-overlapping areas.

To this end, we request mappings from offsets representing the start
RAM address of the heap memory instead of mapping from offset 0 like
previously.  Otherwise, the kernel could match the same region for
different heaps, for all mmap() requests directed to /dev/rtheap which
appear to be a subset of a previous one, i.e. [offset=0, length <=
largest mapped size to date]. Which does happen most of the time.

Basically, this also means that shared heap mapping on nommu systems
has always been badly broken on all Xenomai releases prior to this
commit. Yeepeee.

For this reason, we do break the nommu ABI to introduce this fix
(i.e. blackfin and nios2), simply because the previous implementation
did not work at all.

---

 include/asm-blackfin/features.h |2 +-
 include/asm-nios2/features.h|2 +-
 include/nucleus/heap.h  |1 +
 ksrc/nucleus/heap.c |   53 +--
 ksrc/nucleus/shadow.c   |   17 +---
 src/skins/common/sem_heap.c |   45 
 6 files changed, 77 insertions(+), 43 deletions(-)

diff --git a/include/asm-blackfin/features.h b/include/asm-blackfin/features.h
index 9dbee9c..c365c38 100644
--- a/include/asm-blackfin/features.h
+++ b/include/asm-blackfin/features.h
@@ -22,7 +22,7 @@
 #include 
 
 /* The ABI revision level we use on this arch. */
-#define XENOMAI_ABI_REV   3UL
+#define XENOMAI_ABI_REV   4UL
 
 #define XENOMAI_FEAT_DEP  __xn_feat_generic_mask
 
diff --git a/include/asm-nios2/features.h b/include/asm-nios2/features.h
index eb4589a..534c052 100644
--- a/include/asm-nios2/features.h
+++ b/include/asm-nios2/features.h
@@ -36,7 +36,7 @@ static inline void collect_arch_features(struct xnfeatinfo 
*finfo)
 #endif
 
 /* The ABI revision level we use on this arch. */
-#define XENOMAI_ABI_REV   1UL
+#define XENOMAI_ABI_REV   2UL
 
 #define XENOMAI_FEAT_DEP  __xn_feat_generic_mask
 
diff --git a/include/nucleus/heap.h b/include/nucleus/heap.h
index f4ebe11..da5732e 100644
--- a/include/nucleus/heap.h
+++ b/include/nucleus/heap.h
@@ -282,6 +282,7 @@ int xnheap_check_block(xnheap_t *heap,
 struct xnheap_desc {
unsigned long handle;
unsigned int size;
+   unsigned long area;
 };
 
 #endif /* !_XENO_NUCLEUS_HEAP_H */
diff --git a/ksrc/nucleus/heap.c b/ksrc/nucleus/heap.c
index afcc4f8..a152567 100644
--- a/ksrc/nucleus/heap.c
+++ b/ksrc/nucleus/heap.c
@@ -1136,8 +1136,8 @@ static int xnheap_ioctl(struct inode *inode,
 static int xnheap_mmap(struct file *file, struct vm_area_struct *vma)
 {
unsigned long offset, size, vaddr;
-   xnheap_t *heap;
-   int err;
+   struct xnheap *heap;
+   int ret;
 
if (vma->vm_ops != NULL || file->private_data == NULL)
/* Caller should mmap() once for a given file instance, after
@@ -1147,9 +1147,6 @@ static int xnheap_mmap(struct file *file, struct 
vm_area_struct *vma)
if ((vma->vm_flags & VM_WRITE) && !(vma->vm_flags & VM_SHARED))
return -EINVAL; /* COW unsupported. */
 
-   offset = vma->vm_pgoff << PAGE_SHIFT;
-   size = vma->vm_end - vma->vm_start;
-
spin_lock(&kheapq_lock);
 
heap = __validate_heap_addr(file->private_data);
@@ -1163,22 +1160,28 @@ static int xnheap_mmap(struct file *file, struct 
vm_area_struct *vma)
spin_unlock(&kheapq_lock);
 
vma->vm_private_data = file->private_data;
-
-   err = -ENXIO;
-   if (offset + size > xnheap_extentsize(heap))
-   goto deref_out;
+   vma->vm_ops = &xnheap_vmops;
+   size = vma->vm_end - vma->vm_start;
+   ret = -ENXIO;
 
if (countq(&heap->extents) > 1)
/* Cannot map multi-extent heaps, we need the memory
   area we map from to be contiguous. */
goto deref_out;
 
-   vma->vm_ops = &xnheap_vmops;
+   offset = vma->vm_pgoff << PAGE_SHIFT;
+   vaddr = (unsigned long)heap->archdep.heapbase;
 
 #ifdef CONFIG_MMU
-   vaddr = (unsigned long)heap->archdep.heapbase + offset;
+   /*
+* offset is actually an offset from the start of the heap
+* memory.
+*/
+   if (offset + size > xnheap_extentsize(heap))
+   goto deref_out;
 
-   err = -EAGAIN;
+   vaddr += offset;
+   ret = -EAGAIN;
if ((heap->archdep.kmflags & ~XNHEAP_GFP_NONCACHED) == 0) {
unsi

[Xenomai-git] Philippe Gerum : build: check for CONFIG_MMU in user-space

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: queue/mayday
Commit: 79008a73d85a16e25ad6c06cbc21b0333c5bc2bc
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=79008a73d85a16e25ad6c06cbc21b0333c5bc2bc

Author: Philippe Gerum 
Date:   Tue Jun 15 12:37:21 2010 +0200

build: check for CONFIG_MMU in user-space

---

 Makefile.in|  196 +-
 aclocal.m4 | 6980 +---
 config/Makefile.in |   46 +-
 configure  |  679 +-
 configure.in   |   17 +-
 doc/Makefile.in|  136 +-
 doc/docbook/Makefile.in|  136 +-
 doc/docbook/custom-stylesheets/Makefile.in |  136 +-
 doc/docbook/custom-stylesheets/xsl/Makefile.in |  136 +-
 .../custom-stylesheets/xsl/common/Makefile.in  |   46 +-
 doc/docbook/custom-stylesheets/xsl/fo/Makefile.in  |   46 +-
 .../custom-stylesheets/xsl/html/Makefile.in|   46 +-
 doc/docbook/xenomai/Makefile.in|   46 +-
 doc/doxygen/Makefile.in|   46 +-
 doc/man/Makefile.in|  218 +-
 doc/txt/Makefile.in|   85 +-
 include/Makefile.in|  197 +-
 include/analogy/Makefile.in|  110 +-
 include/asm-arm/Makefile.in|  175 +-
 include/asm-arm/bits/Makefile.in   |  110 +-
 include/asm-blackfin/Makefile.in   |  175 +-
 include/asm-blackfin/bits/Makefile.in  |  110 +-
 include/asm-generic/Makefile.in|  175 +-
 include/asm-generic/bits/Makefile.in   |  110 +-
 include/asm-nios2/Makefile.in  |  175 +-
 include/asm-nios2/bits/Makefile.in |  110 +-
 include/asm-powerpc/Makefile.in|  175 +-
 include/asm-powerpc/bits/Makefile.in   |  110 +-
 include/asm-sim/Makefile.in|  175 +-
 include/asm-sim/bits/Makefile.in   |  110 +-
 include/asm-x86/Makefile.in|  175 +-
 include/asm-x86/bits/Makefile.in   |  110 +-
 include/native/Makefile.in |  110 +-
 include/nucleus/Makefile.in|  110 +-
 include/posix/Makefile.in  |  175 +-
 include/posix/sys/Makefile.in  |  110 +-
 include/psos+/Makefile.in  |  110 +-
 include/rtai/Makefile.in   |  110 +-
 include/rtdm/Makefile.in   |  110 +-
 include/uitron/Makefile.in |  110 +-
 include/vrtx/Makefile.in   |  110 +-
 include/vxworks/Makefile.in|  110 +-
 scripts/Makefile.in|  107 +-
 src/Makefile.in|  136 +-
 src/drvlib/Makefile.in |  136 +-
 src/drvlib/analogy/Makefile.in |  154 +-
 src/include/Makefile.in|   50 +-
 src/include/xeno_config.h.in   |6 +
 src/rtdk/Makefile.in   |  142 +-
 src/skins/Makefile.in  |  136 +-
 src/skins/common/Makefile.in   |  148 +-
 src/skins/native/Makefile.in   |  208 +-
 src/skins/posix/Makefile.in|  196 +-
 src/skins/psos+/Makefile.in|  160 +-
 src/skins/rtai/Makefile.in |  130 +-
 src/skins/rtdm/Makefile.in |  130 +-
 src/skins/uitron/Makefile.in   |  148 +-
 src/skins/vrtx/Makefile.in |  184 +-
 src/skins/vxworks/Makefile.in  |  190 +-
 src/testsuite/Makefile.in  |  136 +-
 src/testsuite/clocktest/Makefile.in|  138 +-
 src/testsuite/cyclic/Makefile.in   |  138 +-
 src/testsuite/irqbench/Makefile.in |  142 +-
 src/testsuite/klatency/Makefile.in |  138 +-
 src/testsuite/latency/Makefile.in  |  138 +-
 src/testsuite/sigtest/Makefile.in  |  138 +-
 src/testsuite/switchtest/Makefile.in   |  138 +-
 src/testsuite/unit/Makefile.in |  170 +-
 src/utils/Makefile.in  |  136 +-
 src/utils/analogy/Makefile.in  |  190 +-
 src/utils/can/Makefile.in  |  190 +-
 src/utils/ps/Makefile.in   |  134 +-
 72 files changed, 6855 insertions(+), 9894 deletions(-)

Diff:   
http://git.xenomai.org/?p=xenomai-rpm.git;a=commitdiff;h=79008a73d85a16e25ad6c06cbc21b0333c5bc2bc

__

[Xenomai-git] Philippe Gerum : skins: sanitize heap binding

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: queue/mayday
Commit: bcd7078ddc7ac3ece81bf45279912691932b7205
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=bcd7078ddc7ac3ece81bf45279912691932b7205

Author: Philippe Gerum 
Date:   Sun Jun 13 17:27:06 2010 +0200

skins: sanitize heap binding

---

 include/nucleus/heap.h  |5 +++
 ksrc/nucleus/shadow.c   |   16 +++--
 src/skins/common/sem_heap.c |   76 +++
 src/skins/native/heap.c |   38 -
 src/skins/native/queue.c|   38 -
 src/skins/psos+/rn.c|   36 +++-
 src/skins/rtai/shm.c|   61 +++---
 src/skins/vrtx/heap.c   |   36 +++-
 src/skins/vrtx/pt.c |   36 +++-
 9 files changed, 90 insertions(+), 252 deletions(-)

diff --git a/include/nucleus/heap.h b/include/nucleus/heap.h
index fecdb79..f4ebe11 100644
--- a/include/nucleus/heap.h
+++ b/include/nucleus/heap.h
@@ -279,4 +279,9 @@ int xnheap_check_block(xnheap_t *heap,
 
 #define XNHEAP_DEV_NAME  "/dev/rtheap"
 
+struct xnheap_desc {
+   unsigned long handle;
+   unsigned int size;
+};
+
 #endif /* !_XENO_NUCLEUS_HEAP_H */
diff --git a/ksrc/nucleus/shadow.c b/ksrc/nucleus/shadow.c
index 1a32527..cc313cf 100644
--- a/ksrc/nucleus/shadow.c
+++ b/ksrc/nucleus/shadow.c
@@ -702,8 +702,7 @@ void __init xnheap_init_vdso(void)
 {
nkvdso = (struct xnvdso *)
xnheap_alloc(&__xnsys_global_ppd.sem_heap, sizeof(*nkvdso));
-
-   if (!nkvdso)
+   if (nkvdso == NULL)
xnpod_fatal("Xenomai: cannot allocate memory for xnvdso!\n");
 
nkvdso->features = XNVDSO_FEATURES;
@@ -1891,20 +1890,15 @@ static int xnshadow_sys_trace(struct pt_regs *regs)
return err;
 }
 
-struct heap_info {
-   xnheap_t *addr;
-   unsigned size;
-};
-
 static int xnshadow_sys_sem_heap(struct pt_regs *regs)
 {
-   struct heap_info hinfo, __user *us_hinfo;
+   struct xnheap_desc hinfo, __user *us_hinfo;
unsigned global;
 
global = __xn_reg_arg2(regs);
-   us_hinfo = (struct heap_info __user *) __xn_reg_arg1(regs);
-   hinfo.addr = &xnsys_ppd_get(global)->sem_heap;
-   hinfo.size = xnheap_extentsize(hinfo.addr);
+   us_hinfo = (struct xnheap_desc __user *) __xn_reg_arg1(regs);
+   hinfo.handle = (unsigned long)&xnsys_ppd_get(global)->sem_heap;
+   hinfo.size = xnheap_extentsize(&xnsys_ppd_get(global)->sem_heap);
 
return __xn_safe_copy_to_user(us_hinfo, &hinfo, sizeof(*us_hinfo));
 }
diff --git a/src/skins/common/sem_heap.c b/src/skins/common/sem_heap.c
index bf7031d..acb655b 100644
--- a/src/skins/common/sem_heap.c
+++ b/src/skins/common/sem_heap.c
@@ -11,62 +11,68 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
-
 #include "sem_heap.h"
 
 unsigned long xeno_sem_heap[2] = { 0, 0 };
+
 struct xnvdso *nkvdso;
 
-static void *map_sem_heap(unsigned shared)
+void *xeno_map_heap(unsigned long handle, unsigned int size)
 {
-   struct heap_info {
-   void *addr;
-   unsigned size;
-   } hinfo;
-   int fd, err;
+   int fd, ret;
+   void *addr;
 
-   fd = open("/dev/rtheap", O_RDWR, 0);
+   fd = open(XNHEAP_DEV_NAME, O_RDWR, 0);
if (fd < 0) {
-   fprintf(stderr, "Xenomai: open: %m\n");
+   perror("Xenomai: open");
return MAP_FAILED;
}
 
-   err = XENOMAI_SYSCALL2(__xn_sys_sem_heap, &hinfo, shared);
-   if (err < 0) {
-   fprintf(stderr, "Xenomai: sys_sem_heap: %m\n");
+   ret = ioctl(fd, 0, handle);
+   if (ret) {
+   perror("Xenomai: ioctl");
return MAP_FAILED;
}
 
-   err = ioctl(fd, 0, hinfo.addr);
-   if (err < 0) {
-   fprintf(stderr, "Xenomai: ioctl: %m\n");
-   return MAP_FAILED;
-   }
+   addr = mmap(NULL, size, PROT_READ|PROT_WRITE,
+   MAP_SHARED, fd, 0L);
 
-   hinfo.addr = mmap(NULL, hinfo.size,
- PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
close(fd);
 
-   return hinfo.addr;
+   return addr;
 }
 
-static void unmap_sem_heap(unsigned long heap_addr, unsigned shared)
+static void *map_sem_heap(unsigned int shared)
 {
-   struct heap_info {
-   void *addr;
-   unsigned size;
-   } hinfo;
-   int err;
+   struct xnheap_desc hinfo;
+   int ret;
 
-   err = XENOMAI_SYSCALL2(__xn_sys_sem_heap, &hinfo, shared);
-   if (err < 0) {
-   fprintf(stderr, "Xenomai: sys_sem_heap: %m\n");
+   ret = XENOMAI_SYSCALL2(__xn_sys_sem_heap, &hinfo, shared);
+   if (ret < 0) {
+   errno = -ret;
+   perror("Xenomai: sys_sem_heap");
+   return MAP_FAILED;
+   }
+
+   return xeno_map_heap(hinfo.handle, hinfo.size);
+}
+
+static void unmap_sem_heap(unsigned long

[Xenomai-git] Philippe Gerum : common: warn early about missing /dev/rtheap

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: for-upstream
Commit: 01a89baf0177ea3c84335ed3a98a499da1595047
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=01a89baf0177ea3c84335ed3a98a499da1595047

Author: Philippe Gerum 
Date:   Mon Jun 14 17:35:13 2010 +0200

common: warn early about missing /dev/rtheap

---

 include/nucleus/heap.h  |3 +--
 src/skins/common/bind.c |9 +
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/include/nucleus/heap.h b/include/nucleus/heap.h
index da5732e..85ab3a3 100644
--- a/include/nucleus/heap.h
+++ b/include/nucleus/heap.h
@@ -190,8 +190,6 @@ extern "C" {
 
 #ifdef __KERNEL__
 
-#define XNHEAP_DEV_MINOR 254
-
 int xnheap_mount(void);
 
 void xnheap_umount(void);
@@ -278,6 +276,7 @@ int xnheap_check_block(xnheap_t *heap,
 #endif /* __KERNEL__ || __XENO_SIM__ */
 
 #define XNHEAP_DEV_NAME  "/dev/rtheap"
+#define XNHEAP_DEV_MINOR 254
 
 struct xnheap_desc {
unsigned long handle;
diff --git a/src/skins/common/bind.c b/src/skins/common/bind.c
index d511072..fb15bf5 100644
--- a/src/skins/common/bind.c
+++ b/src/skins/common/bind.c
@@ -1,9 +1,11 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -86,6 +88,13 @@ xeno_bind_skin_opt(unsigned skin_magic, const char *skin,
xnfeatinfo_t finfo;
int muxid;
 
+   /* Some sanity checks first. */
+   if (access(XNHEAP_DEV_NAME, 0)) {
+   fprintf(stderr, "Xenomai: %s is missing\n(chardev, major=10 
minor=%d)\n",
+   XNHEAP_DEV_NAME, XNHEAP_DEV_MINOR);
+   exit(EXIT_FAILURE);
+   }
+   
old_sigill_handler = signal(SIGILL, xeno_sigill_handler);
if (old_sigill_handler == SIG_ERR) {
perror("signal(SIGILL)");


___
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.33.5-powerpc-2. 10-02, 2.6.34-powerpc-2.10-01

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: for-upstream
Commit: 845e1e5c9784cbde1148d7359d9f13b265d086e8
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=845e1e5c9784cbde1148d7359d9f13b265d086e8

Author: Philippe Gerum 
Date:   Mon Jun 14 11:47:15 2010 +0200

powerpc: upgrade I-pipe support to 2.6.33.5-powerpc-2.10-02, 
2.6.34-powerpc-2.10-01

---

 ... => adeos-ipipe-2.6.33.5-powerpc-2.10-02.patch} |   11 ++-
 ...ch => adeos-ipipe-2.6.34-powerpc-2.10-01.patch} |   11 ++-
 2 files changed, 12 insertions(+), 10 deletions(-)

diff --git 
a/ksrc/arch/powerpc/patches/adeos-ipipe-2.6.33.5-powerpc-2.10-01.patch 
b/ksrc/arch/powerpc/patches/adeos-ipipe-2.6.33.5-powerpc-2.10-02.patch
similarity index 99%
rename from ksrc/arch/powerpc/patches/adeos-ipipe-2.6.33.5-powerpc-2.10-01.patch
rename to ksrc/arch/powerpc/patches/adeos-ipipe-2.6.33.5-powerpc-2.10-02.patch
index 8cf975e..9ae5e24 100644
--- a/ksrc/arch/powerpc/patches/adeos-ipipe-2.6.33.5-powerpc-2.10-01.patch
+++ b/ksrc/arch/powerpc/patches/adeos-ipipe-2.6.33.5-powerpc-2.10-02.patch
@@ -262,7 +262,7 @@ index bd100fc..8fa1901 100644
   * or should we not care like we do now ? --BenH.
 diff --git a/arch/powerpc/include/asm/ipipe.h 
b/arch/powerpc/include/asm/ipipe.h
 new file mode 100644
-index 000..b8befae
+index 000..8ec5cd7
 --- /dev/null
 +++ b/arch/powerpc/include/asm/ipipe.h
 @@ -0,0 +1,276 @@
@@ -313,10 +313,10 @@ index 000..b8befae
 +#include 
 +#endif
 +
-+#define IPIPE_ARCH_STRING "2.10-01"
++#define IPIPE_ARCH_STRING "2.10-02"
 +#define IPIPE_MAJOR_NUMBER2
 +#define IPIPE_MINOR_NUMBER10
-+#define IPIPE_PATCH_NUMBER1
++#define IPIPE_PATCH_NUMBER2
 +
 +#ifdef CONFIG_IPIPE_WANT_PREEMPTIBLE_SWITCH
 +
@@ -7871,10 +7871,10 @@ index 000..6257dfa
 +obj-$(CONFIG_IPIPE_TRACE) += tracer.o
 diff --git a/kernel/ipipe/core.c b/kernel/ipipe/core.c
 new file mode 100644
-index 000..fdb84db
+index 000..75f5d42
 --- /dev/null
 +++ b/kernel/ipipe/core.c
-@@ -0,0 +1,1970 @@
+@@ -0,0 +1,1971 @@
 +/* -*- linux-c -*-
 + * linux/kernel/ipipe/core.c
 + *
@@ -9833,6 +9833,7 @@ index 000..fdb84db
 +EXPORT_SYMBOL(ipipe_send_ipi);
 +EXPORT_SYMBOL(__ipipe_pend_irq);
 +EXPORT_SYMBOL(__ipipe_set_irq_pending);
++EXPORT_SYMBOL(__ipipe_event_monitors);
 +#if defined(CONFIG_IPIPE_DEBUG_INTERNAL) && defined(CONFIG_SMP)
 +EXPORT_SYMBOL(__ipipe_check_percpu_access);
 +#endif
diff --git a/ksrc/arch/powerpc/patches/adeos-ipipe-2.6.34-powerpc-2.10-00.patch 
b/ksrc/arch/powerpc/patches/adeos-ipipe-2.6.34-powerpc-2.10-01.patch
similarity index 99%
rename from ksrc/arch/powerpc/patches/adeos-ipipe-2.6.34-powerpc-2.10-00.patch
rename to ksrc/arch/powerpc/patches/adeos-ipipe-2.6.34-powerpc-2.10-01.patch
index aa050eb..ba5e550 100644
--- a/ksrc/arch/powerpc/patches/adeos-ipipe-2.6.34-powerpc-2.10-00.patch
+++ b/ksrc/arch/powerpc/patches/adeos-ipipe-2.6.34-powerpc-2.10-01.patch
@@ -262,7 +262,7 @@ index bd100fc..8fa1901 100644
   * or should we not care like we do now ? --BenH.
 diff --git a/arch/powerpc/include/asm/ipipe.h 
b/arch/powerpc/include/asm/ipipe.h
 new file mode 100644
-index 000..f345359
+index 000..4bb5021
 --- /dev/null
 +++ b/arch/powerpc/include/asm/ipipe.h
 @@ -0,0 +1,277 @@
@@ -313,10 +313,10 @@ index 000..f345359
 +#include 
 +#endif
 +
-+#define IPIPE_ARCH_STRING "2.10-00"
++#define IPIPE_ARCH_STRING "2.10-01"
 +#define IPIPE_MAJOR_NUMBER2
 +#define IPIPE_MINOR_NUMBER10
-+#define IPIPE_PATCH_NUMBER0
++#define IPIPE_PATCH_NUMBER1
 +
 +#ifdef CONFIG_IPIPE_WANT_PREEMPTIBLE_SWITCH
 +
@@ -7295,10 +7295,10 @@ index 000..6257dfa
 +obj-$(CONFIG_IPIPE_TRACE) += tracer.o
 diff --git a/kernel/ipipe/core.c b/kernel/ipipe/core.c
 new file mode 100644
-index 000..b7d863d
+index 000..e2503bd
 --- /dev/null
 +++ b/kernel/ipipe/core.c
-@@ -0,0 +1,1976 @@
+@@ -0,0 +1,1977 @@
 +/* -*- linux-c -*-
 + * linux/kernel/ipipe/core.c
 + *
@@ -9263,6 +9263,7 @@ index 000..b7d863d
 +EXPORT_SYMBOL(ipipe_send_ipi);
 +EXPORT_SYMBOL(__ipipe_pend_irq);
 +EXPORT_SYMBOL(__ipipe_set_irq_pending);
++EXPORT_SYMBOL(__ipipe_event_monitors);
 +#if defined(CONFIG_IPIPE_DEBUG_INTERNAL) && defined(CONFIG_SMP)
 +EXPORT_SYMBOL(__ipipe_check_percpu_access);
 +#endif


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


[Xenomai-git] Philippe Gerum : x86: upgrade I-pipe support to 2.6.32.15-x86-2.7-01, 2.6. 34-x86-2.7-01

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: for-upstream
Commit: ec40cb47c0413c3f907a572b7d17819494e8dda5
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=ec40cb47c0413c3f907a572b7d17819494e8dda5

Author: Philippe Gerum 
Date:   Mon Jun 14 11:48:11 2010 +0200

x86: upgrade I-pipe support to 2.6.32.15-x86-2.7-01, 2.6.34-x86-2.7-01

---

 ...atch => adeos-ipipe-2.6.32.15-x86-2.7-01.patch} |   11 ++-
 ...0.patch => adeos-ipipe-2.6.34-x86-2.7-01.patch} |   11 ++-
 2 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/ksrc/arch/x86/patches/adeos-ipipe-2.6.32.15-x86-2.7-00.patch 
b/ksrc/arch/x86/patches/adeos-ipipe-2.6.32.15-x86-2.7-01.patch
similarity index 99%
rename from ksrc/arch/x86/patches/adeos-ipipe-2.6.32.15-x86-2.7-00.patch
rename to ksrc/arch/x86/patches/adeos-ipipe-2.6.32.15-x86-2.7-01.patch
index 57287d9..fa5203e 100644
--- a/ksrc/arch/x86/patches/adeos-ipipe-2.6.32.15-x86-2.7-00.patch
+++ b/ksrc/arch/x86/patches/adeos-ipipe-2.6.32.15-x86-2.7-01.patch
@@ -168,7 +168,7 @@ index 0b72282..6574056 100644
  /*
 diff --git a/arch/x86/include/asm/ipipe.h b/arch/x86/include/asm/ipipe.h
 new file mode 100644
-index 000..a090aeb
+index 000..8b95530
 --- /dev/null
 +++ b/arch/x86/include/asm/ipipe.h
 @@ -0,0 +1,158 @@
@@ -199,10 +199,10 @@ index 000..a090aeb
 +#ifdef CONFIG_IPIPE
 +
 +#ifndef IPIPE_ARCH_STRING
-+#define IPIPE_ARCH_STRING "2.7-00"
++#define IPIPE_ARCH_STRING "2.7-01"
 +#define IPIPE_MAJOR_NUMBER2
 +#define IPIPE_MINOR_NUMBER7
-+#define IPIPE_PATCH_NUMBER0
++#define IPIPE_PATCH_NUMBER1
 +#endif
 +
 +DECLARE_PER_CPU(struct pt_regs, __ipipe_tick_regs);
@@ -6840,10 +6840,10 @@ index 000..6257dfa
 +obj-$(CONFIG_IPIPE_TRACE) += tracer.o
 diff --git a/kernel/ipipe/core.c b/kernel/ipipe/core.c
 new file mode 100644
-index 000..c6f4507
+index 000..b6731a4
 --- /dev/null
 +++ b/kernel/ipipe/core.c
-@@ -0,0 +1,1954 @@
+@@ -0,0 +1,1955 @@
 +/* -*- linux-c -*-
 + * linux/kernel/ipipe/core.c
 + *
@@ -8786,6 +8786,7 @@ index 000..c6f4507
 +EXPORT_SYMBOL(ipipe_send_ipi);
 +EXPORT_SYMBOL(__ipipe_pend_irq);
 +EXPORT_SYMBOL(__ipipe_set_irq_pending);
++EXPORT_SYMBOL(__ipipe_event_monitors);
 +#if defined(CONFIG_IPIPE_DEBUG_INTERNAL) && defined(CONFIG_SMP)
 +EXPORT_SYMBOL(__ipipe_check_percpu_access);
 +#endif
diff --git a/ksrc/arch/x86/patches/adeos-ipipe-2.6.34-x86-2.7-00.patch 
b/ksrc/arch/x86/patches/adeos-ipipe-2.6.34-x86-2.7-01.patch
similarity index 99%
rename from ksrc/arch/x86/patches/adeos-ipipe-2.6.34-x86-2.7-00.patch
rename to ksrc/arch/x86/patches/adeos-ipipe-2.6.34-x86-2.7-01.patch
index 4d6b31b..d214c88 100644
--- a/ksrc/arch/x86/patches/adeos-ipipe-2.6.34-x86-2.7-00.patch
+++ b/ksrc/arch/x86/patches/adeos-ipipe-2.6.34-x86-2.7-01.patch
@@ -168,7 +168,7 @@ index 0b72282..6574056 100644
  /*
 diff --git a/arch/x86/include/asm/ipipe.h b/arch/x86/include/asm/ipipe.h
 new file mode 100644
-index 000..92d6b4d
+index 000..ef806d7
 --- /dev/null
 +++ b/arch/x86/include/asm/ipipe.h
 @@ -0,0 +1,181 @@
@@ -199,10 +199,10 @@ index 000..92d6b4d
 +#ifdef CONFIG_IPIPE
 +
 +#ifndef IPIPE_ARCH_STRING
-+#define IPIPE_ARCH_STRING "2.7-00"
++#define IPIPE_ARCH_STRING "2.7-01"
 +#define IPIPE_MAJOR_NUMBER2
 +#define IPIPE_MINOR_NUMBER7
-+#define IPIPE_PATCH_NUMBER0
++#define IPIPE_PATCH_NUMBER1
 +#endif
 +
 +DECLARE_PER_CPU(struct pt_regs, __ipipe_tick_regs);
@@ -6929,10 +6929,10 @@ index 000..6257dfa
 +obj-$(CONFIG_IPIPE_TRACE) += tracer.o
 diff --git a/kernel/ipipe/core.c b/kernel/ipipe/core.c
 new file mode 100644
-index 000..b7d863d
+index 000..e2503bd
 --- /dev/null
 +++ b/kernel/ipipe/core.c
-@@ -0,0 +1,1976 @@
+@@ -0,0 +1,1977 @@
 +/* -*- linux-c -*-
 + * linux/kernel/ipipe/core.c
 + *
@@ -8897,6 +8897,7 @@ index 000..b7d863d
 +EXPORT_SYMBOL(ipipe_send_ipi);
 +EXPORT_SYMBOL(__ipipe_pend_irq);
 +EXPORT_SYMBOL(__ipipe_set_irq_pending);
++EXPORT_SYMBOL(__ipipe_event_monitors);
 +#if defined(CONFIG_IPIPE_DEBUG_INTERNAL) && defined(CONFIG_SMP)
 +EXPORT_SYMBOL(__ipipe_check_percpu_access);
 +#endif


___
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.34-blackfin-1. 14-01

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: for-upstream
Commit: d9ed9c014a650896fbd1b1bba14b10372f20028a
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=d9ed9c014a650896fbd1b1bba14b10372f20028a

Author: Philippe Gerum 
Date:   Mon Jun 14 11:46:02 2010 +0200

blackfin: upgrade I-pipe support to 2.6.34-blackfin-1.14-01

---

 ...h => adeos-ipipe-2.6.34-blackfin-1.14-01.patch} |   28 +++
 1 files changed, 22 insertions(+), 6 deletions(-)

diff --git 
a/ksrc/arch/blackfin/patches/adeos-ipipe-2.6.34-blackfin-1.14-00.patch 
b/ksrc/arch/blackfin/patches/adeos-ipipe-2.6.34-blackfin-1.14-01.patch
similarity index 99%
rename from ksrc/arch/blackfin/patches/adeos-ipipe-2.6.34-blackfin-1.14-00.patch
rename to ksrc/arch/blackfin/patches/adeos-ipipe-2.6.34-blackfin-1.14-01.patch
index e57f536..d62e225 100644
--- a/ksrc/arch/blackfin/patches/adeos-ipipe-2.6.34-blackfin-1.14-00.patch
+++ b/ksrc/arch/blackfin/patches/adeos-ipipe-2.6.34-blackfin-1.14-01.patch
@@ -1,21 +1,36 @@
+diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig
+index c078849..799b1c0 100644
+--- a/arch/blackfin/Kconfig
 b/arch/blackfin/Kconfig
+@@ -84,6 +84,8 @@ source "kernel/Kconfig.freezer"
+ 
+ menu "Blackfin Processor Options"
+ 
++source "kernel/ipipe/Kconfig"
++
+ comment "Processor and Board Settings"
+ 
+ choice
 diff --git a/arch/blackfin/include/asm/ipipe.h 
b/arch/blackfin/include/asm/ipipe.h
-index d3b4044..32b7bad 100644
+index d3b4044..331ef0b 100644
 --- a/arch/blackfin/include/asm/ipipe.h
 +++ b/arch/blackfin/include/asm/ipipe.h
-@@ -34,10 +34,11 @@
+@@ -34,11 +34,12 @@
  #include 
  #include 
  #include 
 +#include 
  
 -#define IPIPE_ARCH_STRING "1.12-00"
-+#define IPIPE_ARCH_STRING "1.14-00"
++#define IPIPE_ARCH_STRING "1.14-01"
  #define IPIPE_MAJOR_NUMBER1
 -#define IPIPE_MINOR_NUMBER12
+-#define IPIPE_PATCH_NUMBER0
 +#define IPIPE_MINOR_NUMBER14
- #define IPIPE_PATCH_NUMBER0
++#define IPIPE_PATCH_NUMBER1
  
  #ifdef CONFIG_SMP
+ #error "I-pipe/blackfin: SMP not implemented"
 @@ -129,11 +130,11 @@ void __ipipe_enable_pipeline(void);
  #define __ipipe_hook_critical_ipi(ipd) do { } while (0)
  
@@ -2679,10 +2694,10 @@ index 000..6257dfa
 +obj-$(CONFIG_IPIPE_TRACE) += tracer.o
 diff --git a/kernel/ipipe/core.c b/kernel/ipipe/core.c
 new file mode 100644
-index 000..b7d863d
+index 000..e2503bd
 --- /dev/null
 +++ b/kernel/ipipe/core.c
-@@ -0,0 +1,1976 @@
+@@ -0,0 +1,1977 @@
 +/* -*- linux-c -*-
 + * linux/kernel/ipipe/core.c
 + *
@@ -4647,6 +4662,7 @@ index 000..b7d863d
 +EXPORT_SYMBOL(ipipe_send_ipi);
 +EXPORT_SYMBOL(__ipipe_pend_irq);
 +EXPORT_SYMBOL(__ipipe_set_irq_pending);
++EXPORT_SYMBOL(__ipipe_event_monitors);
 +#if defined(CONFIG_IPIPE_DEBUG_INTERNAL) && defined(CONFIG_SMP)
 +EXPORT_SYMBOL(__ipipe_check_percpu_access);
 +#endif


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


[Xenomai-git] Philippe Gerum : arm: upgrade I-pipe support to 2.6.33-arm-1.17-01

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: for-upstream
Commit: 34ffc0f45740fdc5aec6bfdc1783dfb850c9fc28
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=34ffc0f45740fdc5aec6bfdc1783dfb850c9fc28

Author: Philippe Gerum 
Date:   Mon Jun 14 11:45:16 2010 +0200

arm: upgrade I-pipe support to 2.6.33-arm-1.17-01

---

 patch => adeos-ipipe-2.6.33-arm-1.17-01.patch} |   11 ++-
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/ksrc/arch/arm/patches/adeos-ipipe-2.6.33-arm-1.17-00.patch 
b/ksrc/arch/arm/patches/adeos-ipipe-2.6.33-arm-1.17-01.patch
similarity index 99%
rename from ksrc/arch/arm/patches/adeos-ipipe-2.6.33-arm-1.17-00.patch
rename to ksrc/arch/arm/patches/adeos-ipipe-2.6.33-arm-1.17-01.patch
index d2ab300..22f5d3f 100644
--- a/ksrc/arch/arm/patches/adeos-ipipe-2.6.33-arm-1.17-00.patch
+++ b/ksrc/arch/arm/patches/adeos-ipipe-2.6.33-arm-1.17-01.patch
@@ -630,7 +630,7 @@ index 000..cfdf14a
 +#endif /* __ASM_ARM_FCSE_H */
 diff --git a/arch/arm/include/asm/ipipe.h b/arch/arm/include/asm/ipipe.h
 new file mode 100644
-index 000..ada91f3
+index 000..f8880e0
 --- /dev/null
 +++ b/arch/arm/include/asm/ipipe.h
 @@ -0,0 +1,274 @@
@@ -665,10 +665,10 @@ index 000..ada91f3
 +#include 
 +#include /* For __IPIPE_FEATURE_PIC_MUTE */
 +
-+#define IPIPE_ARCH_STRING "1.17-00"
++#define IPIPE_ARCH_STRING "1.17-01"
 +#define IPIPE_MAJOR_NUMBER1
 +#define IPIPE_MINOR_NUMBER17
-+#define IPIPE_PATCH_NUMBER0
++#define IPIPE_PATCH_NUMBER1
 +
 +#ifdef CONFIG_SMP
 +#error "I-pipe/arm: SMP not yet implemented"
@@ -10835,10 +10835,10 @@ index 000..6257dfa
 +obj-$(CONFIG_IPIPE_TRACE) += tracer.o
 diff --git a/kernel/ipipe/core.c b/kernel/ipipe/core.c
 new file mode 100644
-index 000..fdb84db
+index 000..75f5d42
 --- /dev/null
 +++ b/kernel/ipipe/core.c
-@@ -0,0 +1,1970 @@
+@@ -0,0 +1,1971 @@
 +/* -*- linux-c -*-
 + * linux/kernel/ipipe/core.c
 + *
@@ -12797,6 +12797,7 @@ index 000..fdb84db
 +EXPORT_SYMBOL(ipipe_send_ipi);
 +EXPORT_SYMBOL(__ipipe_pend_irq);
 +EXPORT_SYMBOL(__ipipe_set_irq_pending);
++EXPORT_SYMBOL(__ipipe_event_monitors);
 +#if defined(CONFIG_IPIPE_DEBUG_INTERNAL) && defined(CONFIG_SMP)
 +EXPORT_SYMBOL(__ipipe_check_percpu_access);
 +#endif


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


[Xenomai-git] Philippe Gerum : blackfin: enable MAYDAY support

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: for-upstream
Commit: 35e39960e6adec45d5d7de626dc6404e530920c0
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=35e39960e6adec45d5d7de626dc6404e530920c0

Author: Philippe Gerum 
Date:   Sun Jun 13 17:26:05 2010 +0200

blackfin: enable MAYDAY support

---

 include/asm-blackfin/bits/shadow.h |   78 
 include/asm-blackfin/system.h  |7 +++
 2 files changed, 85 insertions(+), 0 deletions(-)

diff --git a/include/asm-blackfin/bits/shadow.h 
b/include/asm-blackfin/bits/shadow.h
index f44d25d..1a77fe4 100644
--- a/include/asm-blackfin/bits/shadow.h
+++ b/include/asm-blackfin/bits/shadow.h
@@ -24,6 +24,8 @@
 #error "Pure kernel header included from user-space!"
 #endif
 
+#include 
+
 static inline void xnarch_init_shadow_tcb(xnarchtcb_t * tcb,
  struct xnthread *thread,
  const char *name)
@@ -66,4 +68,80 @@ static inline int xnarch_local_syscall(struct pt_regs *regs)
 
 #define xnarch_schedule_tail(prev) do { } while(0)
 
+#ifdef XNARCH_HAVE_MAYDAY
+
+static inline void xnarch_setup_mayday_page(void *page)
+{
+   /*
+* We want this code to appear at the top of the MAYDAY page:
+*
+* 45 e1 0c 00R5.H = 0xc
+* 05 e1 2b 02R5.L = 0x22b
+* 05 32  P0 = R5
+* 05 60  R5 = 0x0 (X)
+* a0 00  EXCPT 0x0
+* cd ef  
+*
+* We don't mess with ASTAT here, so no need to save/restore
+* it in handle/fixup code.
+*/
+   static const struct {
+   struct __attribute__ ((__packed__)) {
+   u16 op;
+   u16 imm;
+   } load_r5h;
+   struct __attribute__ ((__packed__)) {
+   u16 op;
+   u16 imm;
+   } load_r5l;
+   u16 mov_p0;
+   u16 clear_r5;
+   u16 syscall;
+   u16 bug;
+   } code = {
+   .load_r5h = {
+   .op = 0xe145,
+   .imm = __xn_mux_code(0, __xn_sys_mayday) >> 16
+   },
+   .load_r5l = {
+   .op = 0xe105,
+   .imm = __xn_mux_code(0, __xn_sys_mayday) & 0x
+   },
+   .mov_p0 = 0x3205,
+   .clear_r5 = 0x6005,
+   .syscall = 0x00a0,
+   .bug = BFIN_BUG_OPCODE,
+   };
+
+   memcpy(page, &code, sizeof(code));
+
+   flush_dcache_range((unsigned long)page,
+  (unsigned long)page + sizeof(code));
+}
+
+static inline void xnarch_call_mayday(void)
+{
+   rthal_return_intercept(current);
+}
+
+static inline void xnarch_handle_mayday(struct xnarchtcb *tcb,
+   struct pt_regs *regs,
+   unsigned long tramp)
+{
+   tcb->mayday.pc = regs->pc;
+   tcb->mayday.p0 = regs->p0;
+   tcb->mayday.r5 = regs->r5;
+   regs->pc = tramp;   /* i.e. RETI */
+}
+
+static inline void xnarch_fixup_mayday(struct xnarchtcb *tcb,
+  struct pt_regs *regs)
+{
+   regs->pc = tcb->mayday.pc;
+   regs->p0 = tcb->mayday.p0;
+   regs->r5 = tcb->mayday.r5;
+}
+
+#endif /* XNARCH_HAVE_MAYDAY */
+
 #endif /* !_XENO_ASM_BLACKFIN_BITS_SHADOW_H */
diff --git a/include/asm-blackfin/system.h b/include/asm-blackfin/system.h
index f7a46b2..b4be882 100644
--- a/include/asm-blackfin/system.h
+++ b/include/asm-blackfin/system.h
@@ -53,6 +53,13 @@ typedef struct xnarchtcb {   /* Per-thread arch-dependent 
block */
 struct task_struct *active_task;/* Active user-space task */
 #endif
 struct thread_struct *tsp; /* Pointer to the active thread struct (&ts or 
&user->thread). */
+#ifdef XNARCH_HAVE_MAYDAY
+   struct {
+   unsigned long pc;
+   unsigned long p0;
+   unsigned long r5;
+   } mayday;
+#endif
 
 /* Init block */
 struct xnthread *self;


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


[Xenomai-git] Philippe Gerum : nios2: enable MAYDAY support

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: for-upstream
Commit: 0ca265931a10245885aaefb9344710711b2e1791
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=0ca265931a10245885aaefb9344710711b2e1791

Author: Philippe Gerum 
Date:   Mon Jun 14 18:24:14 2010 +0200

nios2: enable MAYDAY support

---

 include/asm-nios2/bits/shadow.h |   65 +++
 include/asm-nios2/system.h  |8 +
 2 files changed, 73 insertions(+), 0 deletions(-)

diff --git a/include/asm-nios2/bits/shadow.h b/include/asm-nios2/bits/shadow.h
index 1d1969a..8917045 100644
--- a/include/asm-nios2/bits/shadow.h
+++ b/include/asm-nios2/bits/shadow.h
@@ -24,6 +24,8 @@
 #error "Pure kernel header included from user-space!"
 #endif
 
+#include 
+
 static inline void xnarch_init_shadow_tcb(xnarchtcb_t * tcb,
  struct xnthread *thread,
  const char *name)
@@ -63,4 +65,67 @@ static inline int xnarch_local_syscall(struct pt_regs *regs)
 
 #define xnarch_schedule_tail(prev) do { } while(0)
 
+#ifdef XNARCH_HAVE_MAYDAY
+
+static inline void xnarch_setup_mayday_page(void *page)
+{
+   /*
+* We want this code to appear at the top of the MAYDAY page:
+*
+*  00c00334movhi   r3,#__xn_sys_mayday
+*  18c08ac4addir3,r3,#__xn_sys_mux
+*  0084movir2,0
+*  0244movir9,0
+*  003b683atrap
+*  003fff06br  .
+*/
+   static const struct {
+   u32 movhi_r3h;
+   u32 addi_r3l;
+   u32 movi_r2;
+   u32 movi_r9;
+   u32 syscall;
+   u32 bug;
+   } code = {
+   .movhi_r3h = 0x00c00334,
+   .addi_r3l = 0x18c08ac4,
+   .movi_r2 = 0x0084,
+   .movi_r9 = 0x0244,
+   .syscall = 0x003b683a,
+   .bug = 0x003fff06
+   };
+
+   memcpy(page, &code, sizeof(code));
+
+   flush_dcache_range((unsigned long)page,
+  (unsigned long)page + sizeof(code));
+}
+
+static inline void xnarch_call_mayday(void)
+{
+   rthal_return_intercept(current);
+}
+
+static inline void xnarch_handle_mayday(struct xnarchtcb *tcb,
+   struct pt_regs *regs,
+   unsigned long tramp)
+{
+   tcb->mayday.ea = regs->ea;
+   tcb->mayday.r2 = regs->r2;
+   tcb->mayday.r3 = regs->r3;
+   tcb->mayday.r9 = regs->r9;
+   regs->ea = tramp;
+}
+
+static inline void xnarch_fixup_mayday(struct xnarchtcb *tcb,
+  struct pt_regs *regs)
+{
+   regs->ea = tcb->mayday.ea;
+   regs->r2 = tcb->mayday.r2;
+   regs->r3 = tcb->mayday.r3;
+   regs->r9 = tcb->mayday.r9;
+}
+
+#endif /* XNARCH_HAVE_MAYDAY */
+
 #endif /* !_XENO_ASM_NIOS2_BITS_SHADOW_H */
diff --git a/include/asm-nios2/system.h b/include/asm-nios2/system.h
index 65426d1..a31aadf 100644
--- a/include/asm-nios2/system.h
+++ b/include/asm-nios2/system.h
@@ -48,6 +48,14 @@ typedef struct xnarchtcb {   /* Per-thread arch-dependent 
block */
struct thread_struct ts;/* Holds kernel-based thread context. */
struct task_struct *user_task;  /* Shadowed user-space task */
struct thread_struct *tsp;  /* Active thread struct */
+#ifdef XNARCH_HAVE_MAYDAY
+   struct {
+   unsigned long ea;
+   unsigned long r2;
+   unsigned long r3;
+   unsigned long r9;
+   } mayday;
+#endif
 
/* Init block */
struct xnthread *self;


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


[Xenomai-git] Philippe Gerum : arm: enable MAYDAY support

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: for-upstream
Commit: 36c3eebd17f73a4038485f97ae6734a646b1d4ed
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=36c3eebd17f73a4038485f97ae6734a646b1d4ed

Author: Philippe Gerum 
Date:   Sat Jun 12 08:28:29 2010 +0200

arm: enable MAYDAY support

---

 include/asm-arm/bits/shadow.h |  111 +
 include/asm-arm/system.h  |   10 
 2 files changed, 121 insertions(+), 0 deletions(-)

diff --git a/include/asm-arm/bits/shadow.h b/include/asm-arm/bits/shadow.h
index a396510..6021dad 100644
--- a/include/asm-arm/bits/shadow.h
+++ b/include/asm-arm/bits/shadow.h
@@ -27,6 +27,8 @@
 #error "Pure kernel header included from user-space!"
 #endif
 
+#include 
+
 static inline void xnarch_init_shadow_tcb(xnarchtcb_t * tcb,
  struct xnthread *thread,
  const char *name)
@@ -182,4 +184,113 @@ static inline int xnarch_local_syscall(struct pt_regs 
*regs)
 
 #define xnarch_schedule_tail(prev) do { } while(0)
 
+#ifdef XNARCH_HAVE_MAYDAY
+
+static inline void xnarch_setup_mayday_page(void *page)
+{
+   /*
+* We want this code to appear at the top of the MAYDAY page:
+*
+* ifdef ARM_EABI
+*
+* e3a00f8a mov r0, #552; 0x228
+* e28003c3 add r0, r0, #201326595  ; 0xc03
+* e3a0780f mov r7, #983040 ; 0xf
+* e2877042 add r7, r7, #66 ; 0x42
+* e3a06000 mov r6, #0
+* ef00 svc 0x
+* e3a0 mov r0, #0
+* e580 str r0, [r0]; 
+*
+* elif ARM_OABI
+*
+* e3a00f8a mov r0, #552; 0x228
+* e28003c3 add r0, r0, #201326595  ; 0xc03
+* e3a06000 mov r6, #0
+* ef9f0042 swi 0x009f0042
+* e3a0 mov r0, #0
+* e580 str r0, [r0]; 
+*
+* endif
+*
+* 32bit instruction words will be laid out by the compiler as
+* the target endianness requires.
+*
+* We don't mess with CPSR here, so no need to save/restore it
+* in handle/fixup code.
+*/
+#ifdef CONFIG_XENO_ARM_EABI
+   static const struct {
+   u32 mov_muxl;
+   u32 add_muxh;
+   u32 mov_sysh;
+   u32 add_sysl;
+   u32 mov_sigp;
+   u32 swi_0;
+   u32 mov_r0;
+   u32 str_r0;
+   } code = {
+   .mov_muxl = 0xe3a00f8a,
+   .add_muxh = 0xe28003c3,
+   .mov_sysh = 0xe3a0780f,
+   .add_sysl = 0xe2877042,
+   .mov_sigp = 0xe3a06000,
+   .swi_0 = 0xef00,
+   .mov_r0 = 0xe3a0,
+   .str_r0 = 0xe580
+   };
+#else /* OABI */
+   static const struct {
+   u32 mov_muxl;
+   u32 add_muxh;
+   u32 mov_sigp;
+   u32 swi_syscall;
+   u32 mov_r0;
+   u32 str_r0;
+   } code = {
+   .mov_muxl = 0xe3a00f8a,
+   .add_muxh = 0xe28003c3,
+   .mov_sigp = 0xe3a06000,
+   .swi_syscall = 0x009f0042,
+   .mov_r0 = 0xe3a0,
+   .str_r0 = 0xe580
+   };
+#endif /* OABI */
+
+   memcpy(page, &code, sizeof(code));
+
+   flush_dcache_page(vmalloc_to_page(page));
+}
+
+static inline void xnarch_call_mayday(void)
+{
+   rthal_return_intercept(current);
+}
+
+static inline void xnarch_handle_mayday(struct xnarchtcb *tcb,
+   struct pt_regs *regs,
+   unsigned long tramp)
+{
+   tcb->mayday.pc = regs->ARM_pc;
+   tcb->mayday.r0 = regs->ARM_r0;
+   tcb->mayday.r6 = regs->ARM_r6;
+#ifdef CONFIG_XENO_ARM_EABI
+   tcb->mayday.r7 = regs->ARM_r7;
+#endif
+   regs->ARM_pc = tramp;
+}
+
+static inline void xnarch_fixup_mayday(struct xnarchtcb *tcb,
+  struct pt_regs *regs)
+{
+   regs->ARM_pc = tcb->mayday.pc;
+   regs->ARM_r0 = tcb->mayday.r0;
+   regs->ARM_r6 = tcb->mayday.r6;
+#ifdef CONFIG_XENO_ARM_EABI
+   regs->ARM_r7 = tcb->mayday.r7;
+#endif
+}
+
+#endif /* XNARCH_HAVE_MAYDAY */
+
 #endif /* !_XENO_ASM_ARM_BITS_SHADOW_H */
diff --git a/include/asm-arm/system.h b/include/asm-arm/system.h
index 3cbf43b..2b7b734 100644
--- a/include/asm-arm/system.h
+++ b/include/asm-arm/system.h
@@ -69,6 +69,16 @@ typedef struct xnarchtcb {  /* Per-thread arch-dependent 
block */
struct mm_struct *active_mm;
struct thread_info ti;  /* Holds kernel-based thread info */
struct thread_info *tip;/* Pointer to the active thread 
info (ti or user->thread_info). */
+#ifdef XNARCH_HAVE_MAYDAY
+   struct 

[Xenomai-git] Philippe Gerum : x86: enable MAYDAY support

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: for-upstream
Commit: 7472558b941f15e5fcf8d207df8ef0dc79201ae4
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=7472558b941f15e5fcf8d207df8ef0dc79201ae4

Author: Philippe Gerum 
Date:   Sun Jun  6 16:25:36 2010 +0200

x86: enable MAYDAY support

---

 include/asm-x86/bits/shadow_32.h |  111 ++
 include/asm-x86/bits/shadow_64.h |   71 
 include/asm-x86/system_32.h  |7 +++
 include/asm-x86/system_64.h  |7 +++
 4 files changed, 196 insertions(+), 0 deletions(-)

diff --git a/include/asm-x86/bits/shadow_32.h b/include/asm-x86/bits/shadow_32.h
index 9fc37a2..40ccc62 100644
--- a/include/asm-x86/bits/shadow_32.h
+++ b/include/asm-x86/bits/shadow_32.h
@@ -49,4 +49,115 @@ static void xnarch_schedule_tail(struct task_struct *prev)
wrap_switch_iobitmap(prev, rthal_processor_id());
 }
 
+#ifdef XNARCH_HAVE_MAYDAY
+
+static inline void xnarch_setup_mayday_page(void *page)
+{
+   /*
+* We want this code to appear at the top of the MAYDAY page:
+*
+*  b8 2b 02 00 0c  mov$,%eax
+*  bd 00 00 00 00  mov$0x0,%ebp
+* if HAVE_SEP
+*  65 ff 15 10 00 00 00call   *%gs:0x10
+* else
+*  cd 80   int$0x80
+* endif
+*  0f 0b   ud2a
+*
+* We intentionally don't mess with EFLAGS here, so that we
+* don't have to save/restore it in handle/fixup code.
+*
+* Also note that if SEP is present, we always assume NPTL on
+* the user side.
+*/
+   static const struct {
+   struct __attribute__ ((__packed__)) {
+   u8 op;
+   u32 imm;
+   } mov_eax;
+   struct __attribute__ ((__packed__)) {
+   u8 op;
+   u32 imm;
+   } mov_ebp;
+   struct __attribute__ ((__packed__)) {
+   u8 op[3];
+   u32 moffs;
+   } syscall;
+   u16 bug;
+   } code_sep = {
+   .mov_eax = {
+   .op = 0xb8,
+   .imm = __xn_mux_code(0, __xn_sys_mayday)
+   },
+   .mov_ebp = {
+   .op = 0xbd,
+   .imm = 0
+   },
+   .syscall = {
+   .op = {
+   0x65, 0xff, 0x15
+   },
+   .moffs = 0x10
+   },
+   .bug = 0x0b0f,
+   };
+
+   static const struct {
+   struct __attribute__ ((__packed__)) {
+   u8 op;
+   u32 imm;
+   } mov_eax;
+   struct __attribute__ ((__packed__)) {
+   u8 op;
+   u32 imm;
+   } mov_ebp;
+   u16 syscall;
+   u16 bug;
+   } code_nosep = {
+   .mov_eax = {
+   .op = 0xb8,
+   .imm = __xn_mux_code(0, __xn_sys_mayday)
+   },
+   .mov_ebp = {
+   .op = 0xbd,
+   .imm = 0
+   },
+   .syscall = 0x80cd,
+   .bug = 0x0b0f,
+   };
+
+   if (cpu_has_sep)
+   memcpy(page, &code_sep, sizeof(code_sep));
+   else
+   memcpy(page, &code_nosep, sizeof(code_nosep));
+
+   /* no cache flush required. */
+}
+
+static inline void xnarch_call_mayday(void)
+{
+   rthal_return_intercept(current);
+}
+
+static inline void xnarch_handle_mayday(struct xnarchtcb *tcb,
+   struct pt_regs *regs,
+   unsigned long tramp)
+{
+   tcb->mayday.eip = regs->x86reg_ip;
+   tcb->mayday.eax = regs->x86reg_ax;
+   tcb->mayday.ebp = regs->x86reg_bp;
+   regs->x86reg_ip = tramp;
+}
+
+static inline void xnarch_fixup_mayday(struct xnarchtcb *tcb,
+  struct pt_regs *regs)
+{
+   regs->x86reg_ip = tcb->mayday.eip;
+   regs->x86reg_ax = tcb->mayday.eax;
+   regs->x86reg_bp = tcb->mayday.ebp;
+}
+
+#endif /* XNARCH_HAVE_MAYDAY */
+
 #endif /* !_XENO_ASM_X86_BITS_SHADOW_32_H */
diff --git a/include/asm-x86/bits/shadow_64.h b/include/asm-x86/bits/shadow_64.h
index ddaa86a..41a266f 100644
--- a/include/asm-x86/bits/shadow_64.h
+++ b/include/asm-x86/bits/shadow_64.h
@@ -52,4 +52,75 @@ static void xnarch_schedule_tail(struct task_struct *prev)
 {
 }
 
+#ifdef XNARCH_HAVE_MAYDAY
+
+static inline void xnarch_setup_mayday_page(void *page)
+{
+   /*
+* We want this code to appear at the top of the MAYDAY page:
+*
+*  b8 2b 02 00 0c  mov$,%eax
+*  49 c7 c1 00 00 00 00mov$0

[Xenomai-git] Philippe Gerum : powerpc: enable MAYDAY support

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: for-upstream
Commit: 2df7960de3e7061e8b0ea6ecd50cec2484a7fbf9
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=2df7960de3e7061e8b0ea6ecd50cec2484a7fbf9

Author: Philippe Gerum 
Date:   Sat Jun  5 11:57:40 2010 +0200

powerpc: enable MAYDAY support

---

 include/asm-powerpc/bits/shadow.h |   61 +
 include/asm-powerpc/system.h  |8 -
 2 files changed, 68 insertions(+), 1 deletions(-)

diff --git a/include/asm-powerpc/bits/shadow.h 
b/include/asm-powerpc/bits/shadow.h
index 47b65a2..7f3554e 100644
--- a/include/asm-powerpc/bits/shadow.h
+++ b/include/asm-powerpc/bits/shadow.h
@@ -27,6 +27,12 @@
 #error "Pure kernel header included from user-space!"
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
+#include 
+#else
+#include 
+#endif
+
 static inline void xnarch_init_shadow_tcb(xnarchtcb_t * tcb,
  struct xnthread *thread,
  const char *name)
@@ -59,4 +65,59 @@ static inline int xnarch_local_syscall(struct pt_regs *regs)
 
 #define xnarch_schedule_tail(prev) do { } while(0)
 
+#ifdef XNARCH_HAVE_MAYDAY
+
+static inline void xnarch_setup_mayday_page(void *page)
+{
+   /*
+* We want this code to appear at the top of the MAYDAY page:
+*
+* 3c 00 0b 00  lis r0,mux_c...@h
+* 60 00 02 2b  ori r0,r0,mux_c...@l
+* 39 00 00 00  li  r8,0
+* 44 00 00 02  sc
+* 00 b0 0b 00  .long   0x00b00b00 
+*
+* We don't mess with CCR here, so no need to save/restore it
+* in handle/fixup code.
+*/
+   u32 mux, insn[5];
+
+   mux = __xn_mux_code(0, __xn_sys_mayday);
+   insn[0] = 0x3c00 | (mux >> 16);
+   insn[1] = 0x6000 | (mux & 0x);
+   insn[2] = 0x3900;
+   insn[3] = 0x4402;
+   insn[4] = 0x00b00b00;
+   memcpy(page, insn, sizeof(insn));
+
+   flush_dcache_range((unsigned long)page,
+  (unsigned long)page + sizeof(insn));
+}
+
+static inline void xnarch_call_mayday(void)
+{
+   rthal_return_intercept(current);
+}
+
+static inline void xnarch_handle_mayday(struct xnarchtcb *tcb,
+   struct pt_regs *regs,
+   unsigned long tramp)
+{
+   tcb->mayday.nip = regs->nip;
+   tcb->mayday.r0 = regs->gpr[0];
+   tcb->mayday.r8 = regs->gpr[8];
+   regs->nip = tramp;
+}
+
+static inline void xnarch_fixup_mayday(struct xnarchtcb *tcb,
+  struct pt_regs *regs)
+{
+   regs->nip = tcb->mayday.nip;
+   regs->gpr[0] = tcb->mayday.r0;
+   regs->gpr[8] = tcb->mayday.r8;
+}
+
+#endif /* XNARCH_HAVE_MAYDAY */
+
 #endif /* !_XENO_ASM_POWERPC_BITS_SHADOW_H */
diff --git a/include/asm-powerpc/system.h b/include/asm-powerpc/system.h
index 0e1072a..4044f43 100644
--- a/include/asm-powerpc/system.h
+++ b/include/asm-powerpc/system.h
@@ -51,7 +51,13 @@ typedef struct xnarchtcb {   /* Per-thread arch-dependent 
block */
struct thread_struct *tsp;  /* Pointer to the active thread struct 
(&ts or &user->thread). */
struct mm_struct *mm;
struct mm_struct *active_mm;
-
+#ifdef XNARCH_HAVE_MAYDAY
+   struct {
+   unsigned long nip;
+   unsigned long r0;
+   unsigned long r8;
+   } mayday;
+#endif
/* Kernel mode side */
struct thread_struct ts;/* Holds kernel-based thread context. */
 #ifdef CONFIG_XENO_HW_UNLOCKED_SWITCH


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


[Xenomai-git] Philippe Gerum : arm: upgrade I-pipe support to 2.6.33-arm-1.17-00

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: for-upstream
Commit: b2ec9b9f299ff08ddedc8806e903c2a3e4567115
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=b2ec9b9f299ff08ddedc8806e903c2a3e4567115

Author: Philippe Gerum 
Date:   Sat Jun 12 09:38:33 2010 +0200

arm: upgrade I-pipe support to 2.6.33-arm-1.17-00

---

 patch => adeos-ipipe-2.6.33-arm-1.17-00.patch} |  263 +---
 1 files changed, 168 insertions(+), 95 deletions(-)

diff --git a/ksrc/arch/arm/patches/adeos-ipipe-2.6.33-arm-1.16-01.patch 
b/ksrc/arch/arm/patches/adeos-ipipe-2.6.33-arm-1.17-00.patch
similarity index 98%
rename from ksrc/arch/arm/patches/adeos-ipipe-2.6.33-arm-1.16-01.patch
rename to ksrc/arch/arm/patches/adeos-ipipe-2.6.33-arm-1.17-00.patch
index cbb3fb6..d2ab300 100644
--- a/ksrc/arch/arm/patches/adeos-ipipe-2.6.33-arm-1.16-01.patch
+++ b/ksrc/arch/arm/patches/adeos-ipipe-2.6.33-arm-1.17-00.patch
@@ -630,7 +630,7 @@ index 000..cfdf14a
 +#endif /* __ASM_ARM_FCSE_H */
 diff --git a/arch/arm/include/asm/ipipe.h b/arch/arm/include/asm/ipipe.h
 new file mode 100644
-index 000..8ae0cb3
+index 000..ada91f3
 --- /dev/null
 +++ b/arch/arm/include/asm/ipipe.h
 @@ -0,0 +1,274 @@
@@ -665,10 +665,10 @@ index 000..8ae0cb3
 +#include 
 +#include /* For __IPIPE_FEATURE_PIC_MUTE */
 +
-+#define IPIPE_ARCH_STRING "1.16-01"
++#define IPIPE_ARCH_STRING "1.17-00"
 +#define IPIPE_MAJOR_NUMBER1
-+#define IPIPE_MINOR_NUMBER16
-+#define IPIPE_PATCH_NUMBER1
++#define IPIPE_MINOR_NUMBER17
++#define IPIPE_PATCH_NUMBER0
 +
 +#ifdef CONFIG_SMP
 +#error "I-pipe/arm: SMP not yet implemented"
@@ -880,7 +880,7 @@ index 000..8ae0cb3
 +} while(0)
 +
 +#define __ipipe_syscall_watched_p(p, sc)  \
-+  (((p)->flags & PF_EVNOTIFY) || (unsigned long)sc >= __ARM_NR_BASE + 64)
++  (ipipe_notifier_enabled_p(p) || (unsigned long)sc >= __ARM_NR_BASE + 64)
 +
 +#define __ipipe_root_tick_p(regs) (!raw_irqs_disabled_flags(regs->ARM_cpsr))
 +
@@ -910,10 +910,10 @@ index 000..8ae0cb3
 +#endif/* !__ARM_IPIPE_H */
 diff --git a/arch/arm/include/asm/ipipe_base.h 
b/arch/arm/include/asm/ipipe_base.h
 new file mode 100644
-index 000..20e97a4
+index 000..f78523d
 --- /dev/null
 +++ b/arch/arm/include/asm/ipipe_base.h
-@@ -0,0 +1,108 @@
+@@ -0,0 +1,109 @@
 +/* -*- linux-c -*-
 + * arch/arm/include/asm/ipipe_base.h
 + *
@@ -966,7 +966,8 @@ index 000..20e97a4
 +#define IPIPE_EVENT_INIT  (IPIPE_FIRST_EVENT + 4)
 +#define IPIPE_EVENT_EXIT  (IPIPE_FIRST_EVENT + 5)
 +#define IPIPE_EVENT_CLEANUP   (IPIPE_FIRST_EVENT + 6)
-+#define IPIPE_LAST_EVENT  IPIPE_EVENT_CLEANUP
++#define IPIPE_EVENT_RETURN(IPIPE_FIRST_EVENT + 7)
++#define IPIPE_LAST_EVENT  IPIPE_EVENT_RETURN
 +#define IPIPE_NR_EVENTS   (IPIPE_LAST_EVENT + 1)
 +
 +#ifndef __ASSEMBLY__
@@ -2706,10 +2707,10 @@ index 000..1b9550c
 +#endif /* CONFIG_ARM_FCSE_MESSAGES */
 diff --git a/arch/arm/kernel/ipipe.c b/arch/arm/kernel/ipipe.c
 new file mode 100644
-index 000..41b1013
+index 000..0ee9ee1
 --- /dev/null
 +++ b/arch/arm/kernel/ipipe.c
-@@ -0,0 +1,549 @@
+@@ -0,0 +1,571 @@
 +/* -*- linux-c -*-
 + * linux/arch/arm/kernel/ipipe.c
 + *
@@ -3062,11 +3063,17 @@ index 000..41b1013
 +asmlinkage int __ipipe_syscall_root(unsigned long scno, struct pt_regs *regs)
 +{
 +  struct ipipe_percpu_domain_data *p;
-+  unsigned long flags, origr7;
++  unsigned long orig_r7;
++int ret = 0;
 +
-+  /* We use r7 to pass the syscall number to the other domains */
-+  origr7 = regs->ARM_r7;
++  WARN_ON_ONCE(irqs_disabled_hw());
++
++  /*
++   * We use r7 to pass the syscall number to the other domains.
++   */
++  orig_r7 = regs->ARM_r7;
 +  regs->ARM_r7 = __NR_SYSCALL_BASE + scno;
++
 +  /*
 +   * This routine either returns:
 +   * 0 -- if the syscall is to be passed to Linux;
@@ -3076,32 +3083,36 @@ index 000..41b1013
 +   * tail work has to be performed (for handling signals etc).
 +   */
 +
-+  WARN_ON_ONCE(irqs_disabled_hw());
-+
 +  if (!__ipipe_syscall_watched_p(current, regs->ARM_r7) ||
 +  !__ipipe_event_monitored_p(IPIPE_EVENT_SYSCALL))
-+  goto done;
++  goto out;
 +
-+  if (__ipipe_dispatch_event(IPIPE_EVENT_SYSCALL,regs) > 0){
-+  if (ipipe_root_domain_p && !in_atomic()) {
-+  /*
-+   * Sync pending VIRQs before _TIF_NEED_RESCHED
-+   * is tested.
-+   */
-+  local_irq_save_hw(flags);
-+  p = ipipe_root_cpudom_ptr();
-+  if (__ipipe_ipending_p(p))
-+  __ipipe_sync_pipeline(IPIPE_IRQ_DOVIRT);
-+  local_irq_restore_hw(flags);
-+  regs->ARM_r7 = origr7;
-+  return -1;
-+  }
-+  regs->ARM_r7 

[Xenomai-git] Philippe Gerum : nucleus: introduce generic bits for MAYDAY support

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: for-upstream
Commit: e5adade24257b6ebed40ad03eecbe8fc0ed08d5c
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=e5adade24257b6ebed40ad03eecbe8fc0ed08d5c

Author: Philippe Gerum 
Date:   Sat Jun  5 11:39:24 2010 +0200

nucleus: introduce generic bits for MAYDAY support

This patch enables the nucleus to force a user-space thread running
syscall-less code in primary mode, to call the nucleus back on its way
out from an interrupt via a dedicated syscall (__xn_sys_mayday).

This feature is currently useful for recovering gracefully from a
runaway thread situation detected by the nucleus watchdog. Instead of
killing the runaway thread bluntly, this feature allows to force a
relax on it, despite the syscall-less nature of the code it was
running in primary mode.

The trick is to force the thread to run a piece of user-space code
that issues the mayday syscall, by fixing up its program counter on
its way back to userland. This code is laid on the special "mayday
page", mapped to the process address space at binding time. The
implementation relies on the new IPIPE_EVENT_RETURN notification
available from the latest I-pipe patches, to run the fixup code.

In the future, Xenomai real-time signals will be rebased on this
feature to make them able to preempt syscall-less code as well.  In
the same move, the mayday page allocation and setup should move to
user-space. We do this from kernel space for now only to preserve the
2.5.x ABI.

---

 include/asm-generic/hal.h |   28 ++-
 include/asm-generic/syscall.h |1 +
 include/nucleus/ppd.h |4 +
 include/nucleus/shadow.h  |   10 ++
 ksrc/nucleus/sched.c  |1 +
 ksrc/nucleus/shadow.c |  186 ++---
 6 files changed, 216 insertions(+), 14 deletions(-)

diff --git a/include/asm-generic/hal.h b/include/asm-generic/hal.h
index f03219d..f90cafa 100644
--- a/include/asm-generic/hal.h
+++ b/include/asm-generic/hal.h
@@ -259,7 +259,7 @@ static int hdlr (unsigned event, struct ipipe_domain *ipd, 
void *data) \
 static int hdlr (unsigned event, struct ipipe_domain *ipd, void *data) \
 {  \
struct task_struct *p = (struct task_struct *)data; \
-   do_##hdlr(p,p->rt_priority);\
+   do_##hdlr(p, p->rt_priority);   \
return RTHAL_EVENT_PROPAGATE;   \
 }
 
@@ -287,6 +287,14 @@ static int hdlr (unsigned event, struct ipipe_domain *ipd, 
void *data) \
return RTHAL_EVENT_PROPAGATE;  \
 }
 
+#define RTHAL_DECLARE_MAYDAY_EVENT(hdlr) \
+static int hdlr(unsigned event, struct ipipe_domain *ipd, void *data) \
+{\
+   struct pt_regs *regs = data;  \
+   do_##hdlr(regs);  \
+   return RTHAL_EVENT_PROPAGATE; \
+}
+
 #ifndef TASK_ATOMICSWITCH
 #ifdef CONFIG_PREEMPT
 /* We want this feature for preemptible kernels, or the behaviour when
@@ -321,6 +329,15 @@ static inline void clear_task_nowakeup(struct task_struct 
*p)
 #define rthal_set_foreign_stack(ipd)   ipipe_set_foreign_stack(ipd)
 #define rthal_clear_foreign_stack(ipd) ipipe_clear_foreign_stack(ipd)
 
+#ifdef __IPIPE_FEATURE_ENABLE_NOTIFIER
+#define rthal_enable_notifier(p)   ipipe_enable_notifier(p)
+#else
+static inline void rthal_enable_notifier(struct task_struct *p)
+{
+   p->flags |= PF_EVNOTIFY;
+}
+#endif
+
 #define rthal_catch_cleanup(hdlr) \
 ipipe_catch_event(ipipe_root_domain,IPIPE_EVENT_CLEANUP,hdlr)
 #define rthal_catch_taskexit(hdlr) \
@@ -338,6 +355,15 @@ static inline void clear_task_nowakeup(struct task_struct 
*p)
 #define rthal_catch_exception(ex,hdlr) \
 ipipe_catch_event(&rthal_domain,ex|IPIPE_EVENT_SELF,hdlr)
 
+#ifdef IPIPE_EVENT_RETURN
+#define RTHAL_HAVE_RETURN_EVENT
+#define rthal_catch_return(hdlr) \
+ipipe_catch_event(&rthal_domain,IPIPE_EVENT_RETURN,hdlr)
+#define rthal_return_intercept(p)  ipipe_return_notify(p)
+#else
+#define rthal_catch_return(hdlr)   do { } while(0)
+#endif
+
 #define rthal_register_domain(_dom,_name,_id,_prio,_entry) \
 ({ \
struct ipipe_domain_attr attr;  \
diff --git a/include/asm-generic/syscall.h b/include/asm-generic/syscall.h
index 3f10065..7e3d01a 100644
--- a/include/asm-generic/syscall.h
+++ b/include/asm-generic/syscall.h
@@ -47,6 +47,7 @@
 #define __xn_sys_current_info  9   /* r = xnshadow_current_info(&info) */
 #define __xn_sys_get_next_sigs 10  /* only unqueue pending signals. */
 #define __xn_sys_drop_u_mode   11  /* stop updating thread->u_mode */
+#defin

[Xenomai-git] Philippe Gerum : powerpc: upgrade I-pipe support to 2.6.33.5-powerpc-2. 10-01, 2.6.34-powerpc-2.10-00

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: for-upstream
Commit: b45b6ddb24932a283fbbba6598dc7fdadedae1b3
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=b45b6ddb24932a283fbbba6598dc7fdadedae1b3

Author: Philippe Gerum 
Date:   Wed Jun  9 11:31:28 2010 +0200

powerpc: upgrade I-pipe support to 2.6.33.5-powerpc-2.10-01, 
2.6.34-powerpc-2.10-00

---

 ksrc/arch/powerpc/patches/README   |8 +
 .../adeos-ipipe-2.6.30.3-powerpc-DENX-2.7-06.patch |11728 
 ... => adeos-ipipe-2.6.33.5-powerpc-2.10-01.patch} |  460 +-
 ...ch => adeos-ipipe-2.6.34-powerpc-2.10-00.patch} |  428 +-
 4 files changed, 548 insertions(+), 12076 deletions(-)

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

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


[Xenomai-git] Philippe Gerum : x86: upgrade I-pipe support to 2.6.32.15-x86-2.7-00, 2.6. 34-x86-2.7-00

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: for-upstream
Commit: 9295d686be49c3bbbddfafcf6d819135f229a872
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=9295d686be49c3bbbddfafcf6d819135f229a872

Author: Philippe Gerum 
Date:   Wed Jun  9 14:47:01 2010 +0200

x86: upgrade I-pipe support to 2.6.32.15-x86-2.7-00, 2.6.34-x86-2.7-00

---

 .../patches/adeos-ipipe-2.6.32.15-x86-2.7-00.patch |11475 +++
 .../patches/adeos-ipipe-2.6.34-x86-2.7-00.patch|11570 
 2 files changed, 23045 insertions(+), 0 deletions(-)

Diff:   
http://git.xenomai.org/?p=xenomai-rpm.git;a=commitdiff;h=9295d686be49c3bbbddfafcf6d819135f229a872

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


[Xenomai-git] Philippe Gerum : x86: upgrade I-pipe support to 2.6.32.15-x86-2.7-00, 2.6. 34-x86-2.7-00

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: for-upstream
Commit: 443219d6075f9489d32981ff8fc4f31865de710e
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=443219d6075f9489d32981ff8fc4f31865de710e

Author: Philippe Gerum 
Date:   Wed Jun  9 11:32:52 2010 +0200

x86: upgrade I-pipe support to 2.6.32.15-x86-2.7-00, 2.6.34-x86-2.7-00

---

 .../patches/adeos-ipipe-2.6.32.13-x86-2.6-04.patch |11424 ---
 .../patches/adeos-ipipe-2.6.34-x86-2.6-04.patch|11613 
 2 files changed, 0 insertions(+), 23037 deletions(-)

Diff:   
http://git.xenomai.org/?p=xenomai-rpm.git;a=commitdiff;h=443219d6075f9489d32981ff8fc4f31865de710e

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


[Xenomai-git] Philippe Gerum : wrappers: no need to reserve pages passed to vm_insert_page

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: for-upstream
Commit: bbcc7c1d5e8101fca9bc81e59a52b372ff33fabd
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=bbcc7c1d5e8101fca9bc81e59a52b372ff33fabd

Author: Philippe Gerum 
Date:   Wed Jun  9 09:35:58 2010 +0200

wrappers: no need to reserve pages passed to vm_insert_page

---

 include/asm-generic/wrappers.h |7 +++
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/include/asm-generic/wrappers.h b/include/asm-generic/wrappers.h
index ecc1867..a7349db 100644
--- a/include/asm-generic/wrappers.h
+++ b/include/asm-generic/wrappers.h
@@ -343,10 +343,9 @@ unsigned long find_next_bit(const unsigned long *addr,
 /* VM */
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15) && defined(CONFIG_MMU)
-#define wrap_remap_vm_page(vma,from,to) ({ \
-vma->vm_flags |= VM_RESERVED; \
-vm_insert_page(vma,from,vmalloc_to_page((void *)to)); \
-})
+#define wrap_remap_vm_page(vma,from,to) \
+vm_insert_page(vma,from,vmalloc_to_page((void *)to))
+
 #define wrap_remap_io_page_range(vma,from,to,size,prot)  ({\
 (vma)->vm_page_prot = pgprot_noncached((vma)->vm_page_prot);   \
 /* Sets VM_RESERVED | VM_IO | VM_PFNMAP on the vma. */ \


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


[Xenomai-git] Philippe Gerum : build: check for CONFIG_MMU in user-space

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: for-upstream
Commit: 79008a73d85a16e25ad6c06cbc21b0333c5bc2bc
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=79008a73d85a16e25ad6c06cbc21b0333c5bc2bc

Author: Philippe Gerum 
Date:   Tue Jun 15 12:37:21 2010 +0200

build: check for CONFIG_MMU in user-space

---

 Makefile.in|  196 +-
 aclocal.m4 | 6980 +---
 config/Makefile.in |   46 +-
 configure  |  679 +-
 configure.in   |   17 +-
 doc/Makefile.in|  136 +-
 doc/docbook/Makefile.in|  136 +-
 doc/docbook/custom-stylesheets/Makefile.in |  136 +-
 doc/docbook/custom-stylesheets/xsl/Makefile.in |  136 +-
 .../custom-stylesheets/xsl/common/Makefile.in  |   46 +-
 doc/docbook/custom-stylesheets/xsl/fo/Makefile.in  |   46 +-
 .../custom-stylesheets/xsl/html/Makefile.in|   46 +-
 doc/docbook/xenomai/Makefile.in|   46 +-
 doc/doxygen/Makefile.in|   46 +-
 doc/man/Makefile.in|  218 +-
 doc/txt/Makefile.in|   85 +-
 include/Makefile.in|  197 +-
 include/analogy/Makefile.in|  110 +-
 include/asm-arm/Makefile.in|  175 +-
 include/asm-arm/bits/Makefile.in   |  110 +-
 include/asm-blackfin/Makefile.in   |  175 +-
 include/asm-blackfin/bits/Makefile.in  |  110 +-
 include/asm-generic/Makefile.in|  175 +-
 include/asm-generic/bits/Makefile.in   |  110 +-
 include/asm-nios2/Makefile.in  |  175 +-
 include/asm-nios2/bits/Makefile.in |  110 +-
 include/asm-powerpc/Makefile.in|  175 +-
 include/asm-powerpc/bits/Makefile.in   |  110 +-
 include/asm-sim/Makefile.in|  175 +-
 include/asm-sim/bits/Makefile.in   |  110 +-
 include/asm-x86/Makefile.in|  175 +-
 include/asm-x86/bits/Makefile.in   |  110 +-
 include/native/Makefile.in |  110 +-
 include/nucleus/Makefile.in|  110 +-
 include/posix/Makefile.in  |  175 +-
 include/posix/sys/Makefile.in  |  110 +-
 include/psos+/Makefile.in  |  110 +-
 include/rtai/Makefile.in   |  110 +-
 include/rtdm/Makefile.in   |  110 +-
 include/uitron/Makefile.in |  110 +-
 include/vrtx/Makefile.in   |  110 +-
 include/vxworks/Makefile.in|  110 +-
 scripts/Makefile.in|  107 +-
 src/Makefile.in|  136 +-
 src/drvlib/Makefile.in |  136 +-
 src/drvlib/analogy/Makefile.in |  154 +-
 src/include/Makefile.in|   50 +-
 src/include/xeno_config.h.in   |6 +
 src/rtdk/Makefile.in   |  142 +-
 src/skins/Makefile.in  |  136 +-
 src/skins/common/Makefile.in   |  148 +-
 src/skins/native/Makefile.in   |  208 +-
 src/skins/posix/Makefile.in|  196 +-
 src/skins/psos+/Makefile.in|  160 +-
 src/skins/rtai/Makefile.in |  130 +-
 src/skins/rtdm/Makefile.in |  130 +-
 src/skins/uitron/Makefile.in   |  148 +-
 src/skins/vrtx/Makefile.in |  184 +-
 src/skins/vxworks/Makefile.in  |  190 +-
 src/testsuite/Makefile.in  |  136 +-
 src/testsuite/clocktest/Makefile.in|  138 +-
 src/testsuite/cyclic/Makefile.in   |  138 +-
 src/testsuite/irqbench/Makefile.in |  142 +-
 src/testsuite/klatency/Makefile.in |  138 +-
 src/testsuite/latency/Makefile.in  |  138 +-
 src/testsuite/sigtest/Makefile.in  |  138 +-
 src/testsuite/switchtest/Makefile.in   |  138 +-
 src/testsuite/unit/Makefile.in |  170 +-
 src/utils/Makefile.in  |  136 +-
 src/utils/analogy/Makefile.in  |  190 +-
 src/utils/can/Makefile.in  |  190 +-
 src/utils/ps/Makefile.in   |  134 +-
 72 files changed, 6855 insertions(+), 9894 deletions(-)

Diff:   
http://git.xenomai.org/?p=xenomai-rpm.git;a=commitdiff;h=79008a73d85a16e25ad6c06cbc21b0333c5bc2bc

__

[Xenomai-git] Philippe Gerum : nucleus: fix heap mapping for nommu

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: for-upstream
Commit: 11221fefff6ceddca51d70a48d3fae67e0103d3c
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=11221fefff6ceddca51d70a48d3fae67e0103d3c

Author: Philippe Gerum 
Date:   Sun Jun 13 21:49:01 2010 +0200

nucleus: fix heap mapping for nommu

Despite the kernel sees a single backing device with direct mapping
capabilities on nommu targets (/dev/rtheap), we do map different heaps
through it, so we want a brand new mapping region for each of
them. Therefore, we must make sure to request mappings on
non-overlapping areas.

To this end, we request mappings from offsets representing the start
RAM address of the heap memory instead of mapping from offset 0 like
previously.  Otherwise, the kernel could match the same region for
different heaps, for all mmap() requests directed to /dev/rtheap which
appear to be a subset of a previous one, i.e. [offset=0, length <=
largest mapped size to date]. Which does happen most of the time.

Basically, this also means that shared heap mapping on nommu systems
has always been badly broken on all Xenomai releases prior to this
commit. Yeepeee.

For this reason, we do break the nommu ABI to introduce this fix
(i.e. blackfin and nios2), simply because the previous implementation
did not work at all.

---

 include/asm-blackfin/features.h |2 +-
 include/asm-nios2/features.h|2 +-
 include/nucleus/heap.h  |1 +
 ksrc/nucleus/heap.c |   53 +--
 ksrc/nucleus/shadow.c   |   17 +---
 src/skins/common/sem_heap.c |   45 
 6 files changed, 77 insertions(+), 43 deletions(-)

diff --git a/include/asm-blackfin/features.h b/include/asm-blackfin/features.h
index 9dbee9c..c365c38 100644
--- a/include/asm-blackfin/features.h
+++ b/include/asm-blackfin/features.h
@@ -22,7 +22,7 @@
 #include 
 
 /* The ABI revision level we use on this arch. */
-#define XENOMAI_ABI_REV   3UL
+#define XENOMAI_ABI_REV   4UL
 
 #define XENOMAI_FEAT_DEP  __xn_feat_generic_mask
 
diff --git a/include/asm-nios2/features.h b/include/asm-nios2/features.h
index eb4589a..534c052 100644
--- a/include/asm-nios2/features.h
+++ b/include/asm-nios2/features.h
@@ -36,7 +36,7 @@ static inline void collect_arch_features(struct xnfeatinfo 
*finfo)
 #endif
 
 /* The ABI revision level we use on this arch. */
-#define XENOMAI_ABI_REV   1UL
+#define XENOMAI_ABI_REV   2UL
 
 #define XENOMAI_FEAT_DEP  __xn_feat_generic_mask
 
diff --git a/include/nucleus/heap.h b/include/nucleus/heap.h
index f4ebe11..da5732e 100644
--- a/include/nucleus/heap.h
+++ b/include/nucleus/heap.h
@@ -282,6 +282,7 @@ int xnheap_check_block(xnheap_t *heap,
 struct xnheap_desc {
unsigned long handle;
unsigned int size;
+   unsigned long area;
 };
 
 #endif /* !_XENO_NUCLEUS_HEAP_H */
diff --git a/ksrc/nucleus/heap.c b/ksrc/nucleus/heap.c
index afcc4f8..a152567 100644
--- a/ksrc/nucleus/heap.c
+++ b/ksrc/nucleus/heap.c
@@ -1136,8 +1136,8 @@ static int xnheap_ioctl(struct inode *inode,
 static int xnheap_mmap(struct file *file, struct vm_area_struct *vma)
 {
unsigned long offset, size, vaddr;
-   xnheap_t *heap;
-   int err;
+   struct xnheap *heap;
+   int ret;
 
if (vma->vm_ops != NULL || file->private_data == NULL)
/* Caller should mmap() once for a given file instance, after
@@ -1147,9 +1147,6 @@ static int xnheap_mmap(struct file *file, struct 
vm_area_struct *vma)
if ((vma->vm_flags & VM_WRITE) && !(vma->vm_flags & VM_SHARED))
return -EINVAL; /* COW unsupported. */
 
-   offset = vma->vm_pgoff << PAGE_SHIFT;
-   size = vma->vm_end - vma->vm_start;
-
spin_lock(&kheapq_lock);
 
heap = __validate_heap_addr(file->private_data);
@@ -1163,22 +1160,28 @@ static int xnheap_mmap(struct file *file, struct 
vm_area_struct *vma)
spin_unlock(&kheapq_lock);
 
vma->vm_private_data = file->private_data;
-
-   err = -ENXIO;
-   if (offset + size > xnheap_extentsize(heap))
-   goto deref_out;
+   vma->vm_ops = &xnheap_vmops;
+   size = vma->vm_end - vma->vm_start;
+   ret = -ENXIO;
 
if (countq(&heap->extents) > 1)
/* Cannot map multi-extent heaps, we need the memory
   area we map from to be contiguous. */
goto deref_out;
 
-   vma->vm_ops = &xnheap_vmops;
+   offset = vma->vm_pgoff << PAGE_SHIFT;
+   vaddr = (unsigned long)heap->archdep.heapbase;
 
 #ifdef CONFIG_MMU
-   vaddr = (unsigned long)heap->archdep.heapbase + offset;
+   /*
+* offset is actually an offset from the start of the heap
+* memory.
+*/
+   if (offset + size > xnheap_extentsize(heap))
+   goto deref_out;
 
-   err = -EAGAIN;
+   vaddr += offset;
+   ret = -EAGAIN;
if ((heap->archdep.kmflags & ~XNHEAP_GFP_NONCACHED) == 0) {
unsi

[Xenomai-git] Philippe Gerum : skins: sanitize heap binding

2010-06-15 Thread GIT version control
Module: xenomai-rpm
Branch: for-upstream
Commit: bcd7078ddc7ac3ece81bf45279912691932b7205
URL:
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=bcd7078ddc7ac3ece81bf45279912691932b7205

Author: Philippe Gerum 
Date:   Sun Jun 13 17:27:06 2010 +0200

skins: sanitize heap binding

---

 include/nucleus/heap.h  |5 +++
 ksrc/nucleus/shadow.c   |   16 +++--
 src/skins/common/sem_heap.c |   76 +++
 src/skins/native/heap.c |   38 -
 src/skins/native/queue.c|   38 -
 src/skins/psos+/rn.c|   36 +++-
 src/skins/rtai/shm.c|   61 +++---
 src/skins/vrtx/heap.c   |   36 +++-
 src/skins/vrtx/pt.c |   36 +++-
 9 files changed, 90 insertions(+), 252 deletions(-)

diff --git a/include/nucleus/heap.h b/include/nucleus/heap.h
index fecdb79..f4ebe11 100644
--- a/include/nucleus/heap.h
+++ b/include/nucleus/heap.h
@@ -279,4 +279,9 @@ int xnheap_check_block(xnheap_t *heap,
 
 #define XNHEAP_DEV_NAME  "/dev/rtheap"
 
+struct xnheap_desc {
+   unsigned long handle;
+   unsigned int size;
+};
+
 #endif /* !_XENO_NUCLEUS_HEAP_H */
diff --git a/ksrc/nucleus/shadow.c b/ksrc/nucleus/shadow.c
index 1a32527..cc313cf 100644
--- a/ksrc/nucleus/shadow.c
+++ b/ksrc/nucleus/shadow.c
@@ -702,8 +702,7 @@ void __init xnheap_init_vdso(void)
 {
nkvdso = (struct xnvdso *)
xnheap_alloc(&__xnsys_global_ppd.sem_heap, sizeof(*nkvdso));
-
-   if (!nkvdso)
+   if (nkvdso == NULL)
xnpod_fatal("Xenomai: cannot allocate memory for xnvdso!\n");
 
nkvdso->features = XNVDSO_FEATURES;
@@ -1891,20 +1890,15 @@ static int xnshadow_sys_trace(struct pt_regs *regs)
return err;
 }
 
-struct heap_info {
-   xnheap_t *addr;
-   unsigned size;
-};
-
 static int xnshadow_sys_sem_heap(struct pt_regs *regs)
 {
-   struct heap_info hinfo, __user *us_hinfo;
+   struct xnheap_desc hinfo, __user *us_hinfo;
unsigned global;
 
global = __xn_reg_arg2(regs);
-   us_hinfo = (struct heap_info __user *) __xn_reg_arg1(regs);
-   hinfo.addr = &xnsys_ppd_get(global)->sem_heap;
-   hinfo.size = xnheap_extentsize(hinfo.addr);
+   us_hinfo = (struct xnheap_desc __user *) __xn_reg_arg1(regs);
+   hinfo.handle = (unsigned long)&xnsys_ppd_get(global)->sem_heap;
+   hinfo.size = xnheap_extentsize(&xnsys_ppd_get(global)->sem_heap);
 
return __xn_safe_copy_to_user(us_hinfo, &hinfo, sizeof(*us_hinfo));
 }
diff --git a/src/skins/common/sem_heap.c b/src/skins/common/sem_heap.c
index bf7031d..acb655b 100644
--- a/src/skins/common/sem_heap.c
+++ b/src/skins/common/sem_heap.c
@@ -11,62 +11,68 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
-
 #include "sem_heap.h"
 
 unsigned long xeno_sem_heap[2] = { 0, 0 };
+
 struct xnvdso *nkvdso;
 
-static void *map_sem_heap(unsigned shared)
+void *xeno_map_heap(unsigned long handle, unsigned int size)
 {
-   struct heap_info {
-   void *addr;
-   unsigned size;
-   } hinfo;
-   int fd, err;
+   int fd, ret;
+   void *addr;
 
-   fd = open("/dev/rtheap", O_RDWR, 0);
+   fd = open(XNHEAP_DEV_NAME, O_RDWR, 0);
if (fd < 0) {
-   fprintf(stderr, "Xenomai: open: %m\n");
+   perror("Xenomai: open");
return MAP_FAILED;
}
 
-   err = XENOMAI_SYSCALL2(__xn_sys_sem_heap, &hinfo, shared);
-   if (err < 0) {
-   fprintf(stderr, "Xenomai: sys_sem_heap: %m\n");
+   ret = ioctl(fd, 0, handle);
+   if (ret) {
+   perror("Xenomai: ioctl");
return MAP_FAILED;
}
 
-   err = ioctl(fd, 0, hinfo.addr);
-   if (err < 0) {
-   fprintf(stderr, "Xenomai: ioctl: %m\n");
-   return MAP_FAILED;
-   }
+   addr = mmap(NULL, size, PROT_READ|PROT_WRITE,
+   MAP_SHARED, fd, 0L);
 
-   hinfo.addr = mmap(NULL, hinfo.size,
- PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
close(fd);
 
-   return hinfo.addr;
+   return addr;
 }
 
-static void unmap_sem_heap(unsigned long heap_addr, unsigned shared)
+static void *map_sem_heap(unsigned int shared)
 {
-   struct heap_info {
-   void *addr;
-   unsigned size;
-   } hinfo;
-   int err;
+   struct xnheap_desc hinfo;
+   int ret;
 
-   err = XENOMAI_SYSCALL2(__xn_sys_sem_heap, &hinfo, shared);
-   if (err < 0) {
-   fprintf(stderr, "Xenomai: sys_sem_heap: %m\n");
+   ret = XENOMAI_SYSCALL2(__xn_sys_sem_heap, &hinfo, shared);
+   if (ret < 0) {
+   errno = -ret;
+   perror("Xenomai: sys_sem_heap");
+   return MAP_FAILED;
+   }
+
+   return xeno_map_heap(hinfo.handle, hinfo.size);
+}
+
+static void unmap_sem_heap(unsigned long