[Xenomai-git] Philippe Gerum : doc: prebuild

2016-09-11 Thread git repository hosting
Module: xenomai-3
Branch: refs/tags/v3.0.3
Commit: 4993d845b9af8a51255aa2978e25715f0207162e
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=4993d845b9af8a51255aa2978e25715f0207162e

Author: Philippe Gerum 
Date:   Fri Sep  9 19:34:07 2016 +0200

doc: prebuild

---

 doc/prebuilt/html/MIGRATION/index.html |6 +-
 doc/prebuilt/html/README.APPLICATIONS/index.html   |2 +-
 doc/prebuilt/html/README.INSTALL/index.html|2 +-
 .../html/TROUBLESHOOTING.COBALT/index.html |2 +-
 .../html/TROUBLESHOOTING.MERCURY/index.html|2 +-
 doc/prebuilt/html/man1/xeno-config/index.html  |   25 +-
 .../html/xeno3prm/16550A__io_8h_source.html|2 +-
 .../html/xeno3prm/16550A__pci_8h_source.html   |4 +-
 .../html/xeno3prm/16550A__pnp_8h_source.html   |2 +-
 doc/prebuilt/html/xeno3prm/8255_8h_source.html |2 +-
 doc/prebuilt/html/xeno3prm/af__inet_8h_source.html |2 +-
 .../html/xeno3prm/alchemy_2compat_8h_source.html   |2 +-
 doc/prebuilt/html/xeno3prm/analogy_2driver_8h.html |2 +-
 .../html/xeno3prm/analogy_2driver_8h_source.html   |2 +-
 doc/prebuilt/html/xeno3prm/analogy_8h.html |   28 +-
 doc/prebuilt/html/xeno3prm/analogy_8h__incl.map|   26 +-
 doc/prebuilt/html/xeno3prm/analogy_8h__incl.md5|2 +-
 doc/prebuilt/html/xeno3prm/analogy_8h__incl.png|  Bin 59700 -> 69464 bytes
 doc/prebuilt/html/xeno3prm/analogy_8h_source.html  |2 +-
 doc/prebuilt/html/xeno3prm/annotated.html  |2 +-
 doc/prebuilt/html/xeno3prm/apc_8h_source.html  |2 +-
 doc/prebuilt/html/xeno3prm/api-tags.html   |   10 +-
 ..._2include_2asm_2xenomai_2machine_8h_source.html |  149 ++
 ...include_2asm_2xenomai_2syscall32_8h_source.html |  133 ++
 ..._2include_2asm_2xenomai_2machine_8h_source.html |2 +-
 ...include_2asm_2xenomai_2syscall32_8h_source.html |2 +-
 ..._2include_2asm_2xenomai_2machine_8h_source.html |2 +-
 ...include_2asm_2xenomai_2syscall32_8h_source.html |2 +-
 ..._2include_2asm_2xenomai_2machine_8h_source.html |2 +-
 ...include_2asm_2xenomai_2syscall32_8h_source.html |2 +-
 ..._2include_2asm_2xenomai_2machine_8h_source.html |2 +-
 ...include_2asm_2xenomai_2syscall32_8h_source.html |2 +-
 ...4_2include_2asm_2xenomai_2fptest_8h_source.html |  156 ++
 ...lude_2asm_2xenomai_2uapi_2fptest_8h_source.html |  214 +++
 ...m_2include_2asm_2xenomai_2fptest_8h_source.html |2 +-
 ...lude_2asm_2xenomai_2uapi_2fptest_8h_source.html |2 +-
 doc/prebuilt/html/xeno3prm/arp_8h_source.html  |2 +-
 doc/prebuilt/html/xeno3prm/assert_8h_source.html   |2 +-
 doc/prebuilt/html/xeno3prm/async_8c.html   |   46 +-
 doc/prebuilt/html/xeno3prm/async_8c__incl.map  |   44 +-
 doc/prebuilt/html/xeno3prm/async_8c__incl.md5  |2 +-
 doc/prebuilt/html/xeno3prm/async_8c__incl.png  |  Bin 120089 -> 139291 
bytes
 doc/prebuilt/html/xeno3prm/atomic_8h_source.html   |2 +-
 ...n_2include_2asm_2xenomai_2fptest_8h_source.html |2 +-
 ...lude_2asm_2xenomai_2uapi_2fptest_8h_source.html |2 +-
 .../boilerplate_2ancillaries_8h_source.html|2 +-
 .../html/xeno3prm/boilerplate_2list_8h_source.html |2 +-
 .../html/xeno3prm/boilerplate_2lock_8h_source.html |2 +-
 .../html/xeno3prm/boilerplate_2time_8h_source.html |2 +-
 .../xeno3prm/boilerplate_2tunables_8h_source.html  |2 +-
 doc/prebuilt/html/xeno3prm/bufd_8h_source.html |2 +-
 .../html/xeno3prm/bufp-label_8c-example.html   |2 +-
 .../html/xeno3prm/bufp-readwrite_8c-example.html   |2 +-
 doc/prebuilt/html/xeno3prm/c1e_8h_source.html  |2 +-
 doc/prebuilt/html/xeno3prm/calibration_8c.html |   34 +-
 .../html/xeno3prm/calibration_8c__incl.map |   32 +-
 .../html/xeno3prm/calibration_8c__incl.md5 |2 +-
 .../html/xeno3prm/calibration_8c__incl.png |  Bin 89552 -> 99227 bytes
 doc/prebuilt/html/xeno3prm/can-rtt_8c-example.html |2 +-
 doc/prebuilt/html/xeno3prm/channel__range_8h.html  |2 +-
 .../html/xeno3prm/channel__range_8h_source.html|2 +-
 doc/prebuilt/html/xeno3prm/classes.html|2 +-
 doc/prebuilt/html/xeno3prm/clockobj_8h_source.html |2 +-
 doc/prebuilt/html/xeno3prm/cluster_8h_source.html  |2 +-
 .../html/xeno3prm/cobalt-core_8h_source.html   |2 +-
 .../html/xeno3prm/cobalt-posix_8h_source.html  | 1873 ++--
 .../html/xeno3prm/cobalt-rtdm_8h_source.html   |   10 +-
 .../cobalt_2boilerplate_2limits_8h_source.html |2 +-
 .../cobalt_2boilerplate_2trace_8h_source.html  |2 +-
 .../cobalt_2kernel_2ancillaries_8h_source.html |2 +-
 .../xeno3prm/cobalt_2kernel_2compat_8h_source.html |2 +-
 .../xeno3prm/cobalt_2kernel_2init_8h_source.html   |2 +-
 .../xeno3prm/cobalt_2kernel_2list_8h_source.html   |2 +-
 .../xeno3prm/cobalt_2kernel_2lock_8h_source.html   |2 +-
 

[Xenomai-git] Philippe Gerum : cobalt/arm64: thread: move all TCB initializers out of line

2016-09-11 Thread git repository hosting
Module: xenomai-3
Branch: next
Commit: a8756945ffe493c3f3bb5ad59cbe9f45cb5065ba
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=a8756945ffe493c3f3bb5ad59cbe9f45cb5065ba

Author: Philippe Gerum 
Date:   Fri Sep  9 16:07:54 2016 +0200

cobalt/arm64: thread: move all TCB initializers out of line

Does not impact performances and fixes inclusion hell for pulling the
struct xnthread definition for good.

---

 kernel/cobalt/arch/arm64/include/asm/xenomai/thread.h |6 +-
 kernel/cobalt/arch/arm64/thread.c |6 ++
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/kernel/cobalt/arch/arm64/include/asm/xenomai/thread.h 
b/kernel/cobalt/arch/arm64/include/asm/xenomai/thread.h
index ac1f1f7..319f4d8 100644
--- a/kernel/cobalt/arch/arm64/include/asm/xenomai/thread.h
+++ b/kernel/cobalt/arch/arm64/include/asm/xenomai/thread.h
@@ -60,11 +60,7 @@ int xnarch_escalate(void);
 
 #if defined(CONFIG_XENO_ARCH_FPU)
 
-static inline void xnarch_init_root_tcb(struct xnthread *thread)
-{
-   struct xnarchtcb *tcb = xnthread_archtcb(thread);
-   tcb->fpup = NULL;
-}
+void xnarch_init_root_tcb(struct xnthread *thread);
 
 void xnarch_init_shadow_tcb(struct xnthread *thread);
 
diff --git a/kernel/cobalt/arch/arm64/thread.c 
b/kernel/cobalt/arch/arm64/thread.c
index b987e09..3097aeb 100644
--- a/kernel/cobalt/arch/arm64/thread.c
+++ b/kernel/cobalt/arch/arm64/thread.c
@@ -98,6 +98,12 @@ void xnarch_init_shadow_tcb(struct xnthread *thread)
tcb->fpup = >core.host_task->thread.fpsimd_state;
 }
 
+void xnarch_init_root_tcb(struct xnthread *thread)
+{
+   struct xnarchtcb *tcb = >tcb;
+   tcb->fpup = NULL;
+}
+
 #endif /* CONFIG_XENO_ARCH_FPU */
 
 void xnarch_switch_to(struct xnthread *out, struct xnthread *in)


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


[Xenomai-git] Philippe Gerum : doc: prebuild

2016-09-11 Thread git repository hosting
Module: xenomai-3
Branch: stable-3.0.x
Commit: 4993d845b9af8a51255aa2978e25715f0207162e
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=4993d845b9af8a51255aa2978e25715f0207162e

Author: Philippe Gerum 
Date:   Fri Sep  9 19:34:07 2016 +0200

doc: prebuild

---

 doc/prebuilt/html/MIGRATION/index.html |6 +-
 doc/prebuilt/html/README.APPLICATIONS/index.html   |2 +-
 doc/prebuilt/html/README.INSTALL/index.html|2 +-
 .../html/TROUBLESHOOTING.COBALT/index.html |2 +-
 .../html/TROUBLESHOOTING.MERCURY/index.html|2 +-
 doc/prebuilt/html/man1/xeno-config/index.html  |   25 +-
 .../html/xeno3prm/16550A__io_8h_source.html|2 +-
 .../html/xeno3prm/16550A__pci_8h_source.html   |4 +-
 .../html/xeno3prm/16550A__pnp_8h_source.html   |2 +-
 doc/prebuilt/html/xeno3prm/8255_8h_source.html |2 +-
 doc/prebuilt/html/xeno3prm/af__inet_8h_source.html |2 +-
 .../html/xeno3prm/alchemy_2compat_8h_source.html   |2 +-
 doc/prebuilt/html/xeno3prm/analogy_2driver_8h.html |2 +-
 .../html/xeno3prm/analogy_2driver_8h_source.html   |2 +-
 doc/prebuilt/html/xeno3prm/analogy_8h.html |   28 +-
 doc/prebuilt/html/xeno3prm/analogy_8h__incl.map|   26 +-
 doc/prebuilt/html/xeno3prm/analogy_8h__incl.md5|2 +-
 doc/prebuilt/html/xeno3prm/analogy_8h__incl.png|  Bin 59700 -> 69464 bytes
 doc/prebuilt/html/xeno3prm/analogy_8h_source.html  |2 +-
 doc/prebuilt/html/xeno3prm/annotated.html  |2 +-
 doc/prebuilt/html/xeno3prm/apc_8h_source.html  |2 +-
 doc/prebuilt/html/xeno3prm/api-tags.html   |   10 +-
 ..._2include_2asm_2xenomai_2machine_8h_source.html |  149 ++
 ...include_2asm_2xenomai_2syscall32_8h_source.html |  133 ++
 ..._2include_2asm_2xenomai_2machine_8h_source.html |2 +-
 ...include_2asm_2xenomai_2syscall32_8h_source.html |2 +-
 ..._2include_2asm_2xenomai_2machine_8h_source.html |2 +-
 ...include_2asm_2xenomai_2syscall32_8h_source.html |2 +-
 ..._2include_2asm_2xenomai_2machine_8h_source.html |2 +-
 ...include_2asm_2xenomai_2syscall32_8h_source.html |2 +-
 ..._2include_2asm_2xenomai_2machine_8h_source.html |2 +-
 ...include_2asm_2xenomai_2syscall32_8h_source.html |2 +-
 ...4_2include_2asm_2xenomai_2fptest_8h_source.html |  156 ++
 ...lude_2asm_2xenomai_2uapi_2fptest_8h_source.html |  214 +++
 ...m_2include_2asm_2xenomai_2fptest_8h_source.html |2 +-
 ...lude_2asm_2xenomai_2uapi_2fptest_8h_source.html |2 +-
 doc/prebuilt/html/xeno3prm/arp_8h_source.html  |2 +-
 doc/prebuilt/html/xeno3prm/assert_8h_source.html   |2 +-
 doc/prebuilt/html/xeno3prm/async_8c.html   |   46 +-
 doc/prebuilt/html/xeno3prm/async_8c__incl.map  |   44 +-
 doc/prebuilt/html/xeno3prm/async_8c__incl.md5  |2 +-
 doc/prebuilt/html/xeno3prm/async_8c__incl.png  |  Bin 120089 -> 139291 
bytes
 doc/prebuilt/html/xeno3prm/atomic_8h_source.html   |2 +-
 ...n_2include_2asm_2xenomai_2fptest_8h_source.html |2 +-
 ...lude_2asm_2xenomai_2uapi_2fptest_8h_source.html |2 +-
 .../boilerplate_2ancillaries_8h_source.html|2 +-
 .../html/xeno3prm/boilerplate_2list_8h_source.html |2 +-
 .../html/xeno3prm/boilerplate_2lock_8h_source.html |2 +-
 .../html/xeno3prm/boilerplate_2time_8h_source.html |2 +-
 .../xeno3prm/boilerplate_2tunables_8h_source.html  |2 +-
 doc/prebuilt/html/xeno3prm/bufd_8h_source.html |2 +-
 .../html/xeno3prm/bufp-label_8c-example.html   |2 +-
 .../html/xeno3prm/bufp-readwrite_8c-example.html   |2 +-
 doc/prebuilt/html/xeno3prm/c1e_8h_source.html  |2 +-
 doc/prebuilt/html/xeno3prm/calibration_8c.html |   34 +-
 .../html/xeno3prm/calibration_8c__incl.map |   32 +-
 .../html/xeno3prm/calibration_8c__incl.md5 |2 +-
 .../html/xeno3prm/calibration_8c__incl.png |  Bin 89552 -> 99227 bytes
 doc/prebuilt/html/xeno3prm/can-rtt_8c-example.html |2 +-
 doc/prebuilt/html/xeno3prm/channel__range_8h.html  |2 +-
 .../html/xeno3prm/channel__range_8h_source.html|2 +-
 doc/prebuilt/html/xeno3prm/classes.html|2 +-
 doc/prebuilt/html/xeno3prm/clockobj_8h_source.html |2 +-
 doc/prebuilt/html/xeno3prm/cluster_8h_source.html  |2 +-
 .../html/xeno3prm/cobalt-core_8h_source.html   |2 +-
 .../html/xeno3prm/cobalt-posix_8h_source.html  | 1873 ++--
 .../html/xeno3prm/cobalt-rtdm_8h_source.html   |   10 +-
 .../cobalt_2boilerplate_2limits_8h_source.html |2 +-
 .../cobalt_2boilerplate_2trace_8h_source.html  |2 +-
 .../cobalt_2kernel_2ancillaries_8h_source.html |2 +-
 .../xeno3prm/cobalt_2kernel_2compat_8h_source.html |2 +-
 .../xeno3prm/cobalt_2kernel_2init_8h_source.html   |2 +-
 .../xeno3prm/cobalt_2kernel_2list_8h_source.html   |2 +-
 .../xeno3prm/cobalt_2kernel_2lock_8h_source.html   |2 +-
 

[Xenomai-git] Philippe Gerum : cobalt/powerpc: upgrade I-pipe support

2016-09-11 Thread git repository hosting
Module: xenomai-3
Branch: stable-3.0.x
Commit: b88368afe7545b6900660785b1cb131d68e72839
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=b88368afe7545b6900660785b1cb131d68e72839

Author: Philippe Gerum 
Date:   Fri Sep  9 18:59:32 2016 +0200

cobalt/powerpc: upgrade I-pipe support

---

 ...-6.patch => ipipe-core-3.18.20-powerpc-8.patch} |   94 +-
 ...c-3.patch => ipipe-core-4.1.18-powerpc-7.patch} | 1133 +++-
 2 files changed, 924 insertions(+), 303 deletions(-)

diff --git 
a/kernel/cobalt/arch/powerpc/patches/ipipe-core-3.18.20-powerpc-6.patch 
b/kernel/cobalt/arch/powerpc/patches/ipipe-core-3.18.20-powerpc-8.patch
similarity index 99%
rename from 
kernel/cobalt/arch/powerpc/patches/ipipe-core-3.18.20-powerpc-6.patch
rename to kernel/cobalt/arch/powerpc/patches/ipipe-core-3.18.20-powerpc-8.patch
index a3792aa..f92259f 100644
--- a/kernel/cobalt/arch/powerpc/patches/ipipe-core-3.18.20-powerpc-6.patch
+++ b/kernel/cobalt/arch/powerpc/patches/ipipe-core-3.18.20-powerpc-8.patch
@@ -304,7 +304,7 @@ index b59ac27..9cc1d25 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..f79050e
+index 000..40aca5b
 --- /dev/null
 +++ b/arch/powerpc/include/asm/ipipe.h
 @@ -0,0 +1,157 @@
@@ -349,7 +349,7 @@ index 000..f79050e
 +#include 
 +#include 
 +
-+#define IPIPE_CORE_RELEASE6
++#define IPIPE_CORE_RELEASE8
 +
 +struct ipipe_domain;
 +
@@ -1640,7 +1640,7 @@ index 22b45a4..e973007 100644
   * PROM code for specific machines follows.  Put it
   * here so it's easy to add arch-specific sections later.
 diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
-index 0905c8d..df2cc87 100644
+index 0905c8d..f9293c9 100644
 --- a/arch/powerpc/kernel/entry_64.S
 +++ b/arch/powerpc/kernel/entry_64.S
 @@ -33,6 +33,7 @@
@@ -1879,25 +1879,21 @@ index 0905c8d..df2cc87 100644
  #endif /* CONFIG_PREEMPT */
  
.globl  fast_exc_return_irq
-@@ -751,6 +806,17 @@ restore:
+@@ -751,6 +806,13 @@ restore:
 * are about to re-enable interrupts
 */
ld  r5,SOFTE(r1)
 +#ifdef CONFIG_IPIPE
-+  cmpwi   cr0,r5,0
-+  nor r5,r5,r5/* IPIPE_STALL_FLAG = !SOFTE */
 +  ld  r4,PACAROOTPCPU(r13)
-+  ld  r3,0(r4)
-+  insrdi  r3,r5,1,63
-+  std r3,0(r4)
-+  beq 1f
++  cmpwi   cr0,r4,0
++  bne 1f
 +  TRACE_ENABLE_INTS
 +1:
 +#else /* !CONFIG_IPIPE */
lbz r6,PACASOFTIRQEN(r13)
cmpwi   cr0,r5,0
beq restore_irq_off
-@@ -777,6 +843,7 @@ restore_no_replay:
+@@ -777,6 +839,7 @@ restore_no_replay:
TRACE_ENABLE_INTS
li  r0,1
stb r0,PACASOFTIRQEN(r13);
@@ -1905,7 +1901,7 @@ index 0905c8d..df2cc87 100644
  
/*
 * Final return path. BookE is handled in a different file
-@@ -867,6 +934,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_HAS_PPR)
+@@ -867,6 +930,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_HAS_PPR)
  
  #endif /* CONFIG_PPC_BOOK3E */
  
@@ -1913,7 +1909,7 @@ index 0905c8d..df2cc87 100644
/*
 * We are returning to a context with interrupts soft disabled.
 *
-@@ -948,6 +1016,8 @@ restore_check_irq_replay:
+@@ -948,6 +1012,8 @@ restore_check_irq_replay:
b   ret_from_except
  #endif /* CONFIG_PPC_DOORBELL */
  1:b   ret_from_except /* What else to do here ? */
@@ -1922,7 +1918,7 @@ index 0905c8d..df2cc87 100644
   
  unrecov_restore:
addir3,r1,STACK_FRAME_OVERHEAD
-@@ -994,7 +1064,7 @@ _GLOBAL(enter_rtas)
+@@ -994,7 +1060,7 @@ _GLOBAL(enter_rtas)
li  r0,0
mtcrr0
  
@@ -2835,7 +2831,7 @@ index 000..292fed5
 +#endif/* !CONFIG_PPC64 */
 +#endif /* !CONFIG_IPIPE_LEGACY */
 diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
-index c143835..6b92a8b 100644
+index c143835..82279ee 100644
 --- a/arch/powerpc/kernel/irq.c
 +++ b/arch/powerpc/kernel/irq.c
 @@ -95,6 +95,36 @@ extern int tau_interrupts(int);
@@ -2867,7 +2863,7 @@ index c143835..6b92a8b 100644
 +static inline notrace int decrementer_check_overflow(void)
 +{
 +  u64 now = get_tb_or_rtc();
-+  u64 *next_tb = &__get_cpu_var(decrementers_next_tb);
++  u64 *next_tb = this_cpu_ptr(_next_tb);
 + 
 +  return now >= *next_tb;
 +}
@@ -6004,6 +6000,18 @@ index abcafaa..a8440e4 100644
  } cacheline_aligned;
  
  /*
+diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
+index 662697b..6a9b6ad 100644
+--- a/include/linux/ftrace.h
 b/include/linux/ftrace.h
+@@ -108,6 +108,7 @@ enum {
+   FTRACE_OPS_FL_ADDING= 1 << 9,
+   FTRACE_OPS_FL_REMOVING  = 1 << 10,
+   FTRACE_OPS_FL_MODIFYING = 1 << 11,
++  FTRACE_OPS_FL_IPIPE_EXCLUSIVE   = 1 << 12,
+ };
+ 
+ #ifdef CONFIG_DYNAMIC_FTRACE
 diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h
 index 

[Xenomai-git] Philippe Gerum : cobalt/powerpc: fpu: drop obsolete xnarch_save_fpu()

2016-09-11 Thread git repository hosting
Module: xenomai-3
Branch: stable-3.0.x
Commit: 2856ff3c0c6199352fac11b4c6dab07a6e8b7b3b
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=2856ff3c0c6199352fac11b4c6dab07a6e8b7b3b

Author: Philippe Gerum 
Date:   Thu Sep  8 16:29:44 2016 +0200

cobalt/powerpc: fpu: drop obsolete xnarch_save_fpu()

---

 kernel/cobalt/arch/powerpc/include/asm/xenomai/thread.h |2 --
 kernel/cobalt/arch/powerpc/thread.c |6 +++---
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/kernel/cobalt/arch/powerpc/include/asm/xenomai/thread.h 
b/kernel/cobalt/arch/powerpc/include/asm/xenomai/thread.h
index 8d6be84..1de5cac 100644
--- a/kernel/cobalt/arch/powerpc/include/asm/xenomai/thread.h
+++ b/kernel/cobalt/arch/powerpc/include/asm/xenomai/thread.h
@@ -93,8 +93,6 @@ static inline int xnarch_escalate(void)
 
 void xnarch_switch_to(struct xnthread *out, struct xnthread *in);
 
-void xnarch_save_fpu(struct xnthread *thread);
-
 void xnarch_switch_fpu(struct xnthread *from, struct xnthread *thread);
 
 #endif /* !_COBALT_POWERPC_ASM_THREAD_H */
diff --git a/kernel/cobalt/arch/powerpc/thread.c 
b/kernel/cobalt/arch/powerpc/thread.c
index 2a61d50..e3be67f 100644
--- a/kernel/cobalt/arch/powerpc/thread.c
+++ b/kernel/cobalt/arch/powerpc/thread.c
@@ -92,7 +92,7 @@ static void xnarch_enable_fpu(struct xnthread *thread)
__asm_enable_fpu();
 }
 
-void xnarch_save_fpu(struct xnthread *thread)
+static void do_save_fpu(struct xnthread *thread)
 {
struct xnarchtcb *tcb = xnthread_archtcb(thread);
 
@@ -145,7 +145,7 @@ void xnarch_switch_fpu(struct xnthread *from, struct 
xnthread *to)
}

if (from)
-   xnarch_save_fpu(from);
+   do_save_fpu(from);

xnarch_restore_fpu(to);
 }
@@ -154,7 +154,7 @@ void xnarch_leave_root(struct xnthread *root)
 {
struct xnarchtcb *rootcb = xnthread_archtcb(root);
rootcb->core.user_fpu_owner = get_fpu_owner(rootcb->core.host_task);
-   /* So that xnarch_save_fpu() will operate on the right FPU area. */
+   /* So that do_save_fpu() operates on the right FPU area. */
rootcb->fpup = rootcb->core.user_fpu_owner ?
>core.user_fpu_owner->thread : NULL;
 }


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


[Xenomai-git] Philippe Gerum : cobalt/blackfin: upgrade I-pipe support

2016-09-11 Thread git repository hosting
Module: xenomai-3
Branch: stable-3.0.x
Commit: 2111a07350c4651f34c9d4972d7c06f63e1eb077
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=2111a07350c4651f34c9d4972d7c06f63e1eb077

Author: Philippe Gerum 
Date:   Fri Sep  9 18:58:13 2016 +0200

cobalt/blackfin: upgrade I-pipe support

---

 ...6.patch => ipipe-core-3.18.20-blackfin-8.patch} |   70 +++--
 ...-2.patch => ipipe-core-4.1.18-blackfin-6.patch} |  298 +++-
 2 files changed, 282 insertions(+), 86 deletions(-)

diff --git 
a/kernel/cobalt/arch/blackfin/patches/ipipe-core-3.18.20-blackfin-6.patch 
b/kernel/cobalt/arch/blackfin/patches/ipipe-core-3.18.20-blackfin-8.patch
similarity index 99%
rename from 
kernel/cobalt/arch/blackfin/patches/ipipe-core-3.18.20-blackfin-6.patch
rename to 
kernel/cobalt/arch/blackfin/patches/ipipe-core-3.18.20-blackfin-8.patch
index 6ecaf7f..e5d0f88 100644
--- a/kernel/cobalt/arch/blackfin/patches/ipipe-core-3.18.20-blackfin-6.patch
+++ b/kernel/cobalt/arch/blackfin/patches/ipipe-core-3.18.20-blackfin-8.patch
@@ -12,7 +12,7 @@ index af76634..ebff376 100644
  
  comment "Processor and Board Settings"
 diff --git a/arch/blackfin/include/asm/ipipe.h 
b/arch/blackfin/include/asm/ipipe.h
-index fe1160f..cc10543 100644
+index fe1160fb..44ed44e 100644
 --- a/arch/blackfin/include/asm/ipipe.h
 +++ b/arch/blackfin/include/asm/ipipe.h
 @@ -28,7 +28,7 @@
@@ -32,7 +32,7 @@ index fe1160f..cc10543 100644
 -#define IPIPE_MAJOR_NUMBER1
 -#define IPIPE_MINOR_NUMBER16
 -#define IPIPE_PATCH_NUMBER1
-+#define IPIPE_CORE_RELEASE6
++#define IPIPE_CORE_RELEASE8
  
  #ifdef CONFIG_SMP
  #error "I-pipe/blackfin: SMP not implemented"
@@ -2214,6 +2214,18 @@ index abcafaa..a8440e4 100644
  } cacheline_aligned;
  
  /*
+diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
+index 662697b..6a9b6ad 100644
+--- a/include/linux/ftrace.h
 b/include/linux/ftrace.h
+@@ -108,6 +108,7 @@ enum {
+   FTRACE_OPS_FL_ADDING= 1 << 9,
+   FTRACE_OPS_FL_REMOVING  = 1 << 10,
+   FTRACE_OPS_FL_MODIFYING = 1 << 11,
++  FTRACE_OPS_FL_IPIPE_EXCLUSIVE   = 1 << 12,
+ };
+ 
+ #ifdef CONFIG_DYNAMIC_FTRACE
 diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h
 index cba442e..b513a46 100644
 --- a/include/linux/hardirq.h
@@ -8159,7 +8171,7 @@ index 000..143f9e6
 +#endif /* CONFIG_IPIPE_HAVE_HOSTRT */
 diff --git a/kernel/ipipe/tracer.c b/kernel/ipipe/tracer.c
 new file mode 100644
-index 000..da272c50
+index 000..8388671
 --- /dev/null
 +++ b/kernel/ipipe/tracer.c
 @@ -0,0 +1,1468 @@
@@ -9497,7 +9509,7 @@ index 000..da272c50
 +
 +static struct ftrace_ops ipipe_trace_ops = {
 +  .func = ipipe_trace_function,
-+  .flags = FTRACE_OPS_FL_RECURSION_SAFE,
++  .flags = FTRACE_OPS_FL_IPIPE_EXCLUSIVE,
 +};
 +
 +static ssize_t __ipipe_wr_enable(struct file *file, const char __user *buffer,
@@ -11058,7 +11070,7 @@ index a5da09c..6650799 100644
help
  This option will modify all the calls to function tracing
 diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
-index d1eff3d..2a324bc 100644
+index d1eff3d..f8b9472 100644
 --- a/kernel/trace/ftrace.c
 +++ b/kernel/trace/ftrace.c
 @@ -32,6 +32,7 @@
@@ -11069,7 +11081,33 @@ index d1eff3d..2a324bc 100644
  
  #include 
  
-@@ -2298,6 +2299,9 @@ void __weak arch_ftrace_update_code(int command)
+@@ -251,8 +252,17 @@ static inline void update_function_graph_func(void) { }
+ 
+ static void update_ftrace_function(void)
+ {
++  struct ftrace_ops *ops;
+   ftrace_func_t func;
+ 
++  for (ops = ftrace_ops_list;
++   ops != _list_end; ops = ops->next)
++  if (ops->flags & FTRACE_OPS_FL_IPIPE_EXCLUSIVE) {
++  set_function_trace_op = ops;
++  func = ops->func;
++  goto set_pointers;
++  }
++
+   /*
+* Prepare the ftrace_ops that the arch callback will use.
+* If there's only one ftrace_ops registered, the ftrace_ops_list
+@@ -280,6 +290,7 @@ static void update_ftrace_function(void)
+ 
+   update_function_graph_func();
+ 
++  set_pointers:
+   /* If there's no change, then do nothing more here */
+   if (ftrace_trace_function == func)
+   return;
+@@ -2298,6 +2309,9 @@ void __weak arch_ftrace_update_code(int command)
  
  static void ftrace_run_update_code(int command)
  {
@@ -11079,7 +7,7 @@ index d1eff3d..2a324bc 100644
int ret;
  
ret = ftrace_arch_code_modify_prepare();
-@@ -2311,7 +2315,13 @@ static void ftrace_run_update_code(int command)
+@@ -2311,7 +2325,13 @@ static void ftrace_run_update_code(int command)
 * is safe. The stop_machine() is the safest, but also
 * produces the most overhead.
 */
@@ -11093,7 +11131,7 @@ index d1eff3d..2a324bc 100644
  
ret = ftrace_arch_code_modify_post_process();
FTRACE_WARN_ON(ret);
-@@ -4621,10 

[Xenomai-git] Philippe Gerum : cobalt/x86: fpu: fixup for kernel 4.2+

2016-09-11 Thread git repository hosting
Module: xenomai-3
Branch: stable-3.0.x
Commit: eddbb24f651ee2b2594715099b638ae8cddf485d
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=eddbb24f651ee2b2594715099b638ae8cddf485d

Author: Philippe Gerum 
Date:   Mon Sep  5 15:11:24 2016 +0200

cobalt/x86: fpu: fixup for kernel 4.2+

---

 .../cobalt/arch/x86/include/asm/xenomai/fptest.h   |2 +-
 .../cobalt/arch/x86/include/asm/xenomai/thread.h   |   15 ++-
 .../cobalt/arch/x86/include/asm/xenomai/wrappers.h |7 +-
 kernel/cobalt/arch/x86/machine.c   |9 +-
 kernel/cobalt/arch/x86/thread.c|  124 +++-
 kernel/cobalt/include/asm-generic/xenomai/thread.h |2 -
 6 files changed, 119 insertions(+), 40 deletions(-)

diff --git a/kernel/cobalt/arch/x86/include/asm/xenomai/fptest.h 
b/kernel/cobalt/arch/x86/include/asm/xenomai/fptest.h
index a05d54e..f0ecd00 100644
--- a/kernel/cobalt/arch/x86/include/asm/xenomai/fptest.h
+++ b/kernel/cobalt/arch/x86/include/asm/xenomai/fptest.h
@@ -20,8 +20,8 @@
 #define _COBALT_X86_ASM_FPTEST_H
 
 #include 
-#include 
 #include 
+#include 
 #include 
 
 static inline int fp_kernel_supported(void)
diff --git a/kernel/cobalt/arch/x86/include/asm/xenomai/thread.h 
b/kernel/cobalt/arch/x86/include/asm/xenomai/thread.h
index bd39f5a..d8a6a78 100644
--- a/kernel/cobalt/arch/x86/include/asm/xenomai/thread.h
+++ b/kernel/cobalt/arch/x86/include/asm/xenomai/thread.h
@@ -23,11 +23,15 @@
 #include 
 #include 
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,0)
 typedef union thread_xstate x86_fpustate;
 #define x86_fpustate_ptr(t) ((t)->fpu.state)
+#else
+typedef union fpregs_state x86_fpustate;
+#define x86_fpustate_ptr(t) ((t)->fpu.active_state)
+#endif
 
 struct xnarchtcb {
-   x86_fpustate i387;
struct xntcb core;
unsigned long sp;
unsigned long *spp;
@@ -36,17 +40,13 @@ struct xnarchtcb {
x86_fpustate *fpup;
unsigned int root_kfpu: 1;
unsigned int root_used_math: 1;
+   x86_fpustate *kfpu_state;
struct {
unsigned long ip;
unsigned long ax;
} mayday;
 };
 
-static inline int xnarch_shadow_p(struct xnarchtcb *tcb, struct task_struct 
*task)
-{
-   return tcb->spp == >thread.sp;
-}
-
 #define xnarch_fpu_ptr(tcb) ((tcb)->fpup)
 
 #define xnarch_fault_regs(d)   ((d)->regs)
@@ -84,4 +84,7 @@ static inline int xnarch_escalate(void)
return 0;
 }
 
+int mach_x86_thread_init(void);
+void mach_x86_thread_cleanup(void);
+
 #endif /* !_COBALT_X86_ASM_THREAD_H */
diff --git a/kernel/cobalt/arch/x86/include/asm/xenomai/wrappers.h 
b/kernel/cobalt/arch/x86/include/asm/xenomai/wrappers.h
index bfff14b..5f9cff3 100644
--- a/kernel/cobalt/arch/x86/include/asm/xenomai/wrappers.h
+++ b/kernel/cobalt/arch/x86/include/asm/xenomai/wrappers.h
@@ -24,9 +24,14 @@
 #define __get_user_inatomic __get_user
 #define __put_user_inatomic __put_user
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)
 #include 
 #include 
+#else
+#include 
+#endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0)
 
 static inline void kernel_fpu_disable(void)
 {
diff --git a/kernel/cobalt/arch/x86/machine.c b/kernel/cobalt/arch/x86/machine.c
index 14443e0..d9eb66d 100644
--- a/kernel/cobalt/arch/x86/machine.c
+++ b/kernel/cobalt/arch/x86/machine.c
@@ -17,10 +17,10 @@
  *   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  *   02111-1307, USA.
  */
-
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -148,6 +148,12 @@ static unsigned long mach_x86_calibrate(void)
 
 static int mach_x86_init(void)
 {
+   int ret;
+
+   ret = mach_x86_thread_init();
+   if (ret)
+   return ret;
+
mach_x86_c1e_disable();
mach_x86_smi_init();
mach_x86_smi_disable();
@@ -158,6 +164,7 @@ static int mach_x86_init(void)
 static void mach_x86_cleanup(void)
 {
mach_x86_smi_restore();
+   mach_x86_thread_cleanup();
 }
 
 static const char *const fault_labels[] = {
diff --git a/kernel/cobalt/arch/x86/thread.c b/kernel/cobalt/arch/x86/thread.c
index 0383f00..9e1dea2 100644
--- a/kernel/cobalt/arch/x86/thread.c
+++ b/kernel/cobalt/arch/x86/thread.c
@@ -21,10 +21,43 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
+#include 
+
+static struct kmem_cache *xstate_cache;
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)
 #include 
 #include 
+#define x86_fpregs_active(t)   __thread_has_fpu(t)
+#define x86_fpregs_deactivate(t)   __thread_clear_has_fpu(t)
+#define x86_fpregs_activate(t) __thread_set_has_fpu(t)
+#define x86_xstate_alignment   __alignof__(union thread_xstate)
+#else
+#include 
+
+static inline int x86_fpregs_active(struct task_struct *t)
+{
+   return t->thread.fpu.fpregs_active;
+}
+
+static inline void x86_fpregs_deactivate(struct task_struct *t)
+{
+   if (x86_fpregs_active(t))
+   

[Xenomai-git] Philippe Gerum : config: bump version code

2016-09-11 Thread git repository hosting
Module: xenomai-3
Branch: stable-3.0.x
Commit: 1f465de48fb93c7bccf58454798c52a6a6bfaa7e
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=1f465de48fb93c7bccf58454798c52a6a6bfaa7e

Author: Philippe Gerum 
Date:   Fri Sep  9 19:04:10 2016 +0200

config: bump version code

---

 config/version-code  |2 +-
 config/version-label |2 +-
 config/version-name  |2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/config/version-code b/config/version-code
index b502146..75a22a2 100644
--- a/config/version-code
+++ b/config/version-code
@@ -1 +1 @@
-3.0.2
+3.0.3
diff --git a/config/version-label b/config/version-label
index b502146..75a22a2 100644
--- a/config/version-label
+++ b/config/version-label
@@ -1 +1 @@
-3.0.2
+3.0.3
diff --git a/config/version-name b/config/version-name
index 272395d..09ba594 100644
--- a/config/version-name
+++ b/config/version-name
@@ -1 +1 @@
-Exact Zero
+Groovy Cosmic Halo


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


[Xenomai-git] Philippe Gerum : cobalt/powerpc: thread: move all TCB initializers out of line

2016-09-11 Thread git repository hosting
Module: xenomai-3
Branch: stable-3.0.x
Commit: d1ff8ae209e91b5cef29e46e0c1f8d89b3053fe8
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=d1ff8ae209e91b5cef29e46e0c1f8d89b3053fe8

Author: Philippe Gerum 
Date:   Fri Sep  9 16:07:54 2016 +0200

cobalt/powerpc: thread: move all TCB initializers out of line

Does not impact performances and fixes inclusion hell for pulling the
struct xnthread definition for good.

---

 kernel/cobalt/arch/powerpc/include/asm/xenomai/thread.h |   12 ++--
 kernel/cobalt/arch/powerpc/thread.c |   12 
 2 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/kernel/cobalt/arch/powerpc/include/asm/xenomai/thread.h 
b/kernel/cobalt/arch/powerpc/include/asm/xenomai/thread.h
index 1de5cac..0ab48be 100644
--- a/kernel/cobalt/arch/powerpc/include/asm/xenomai/thread.h
+++ b/kernel/cobalt/arch/powerpc/include/asm/xenomai/thread.h
@@ -52,17 +52,9 @@ static inline void xnarch_enter_root(struct xnthread *root) 
{ }
 
 #ifdef CONFIG_XENO_ARCH_FPU
 
-static inline void xnarch_init_root_tcb(struct xnthread *thread)
-{
-   struct xnarchtcb *tcb = xnthread_archtcb(thread);
-   tcb->fpup = NULL;
-}
+void xnarch_init_root_tcb(struct xnthread *thread);
 
-static inline void xnarch_init_shadow_tcb(struct xnthread *thread)
-{
-   struct xnarchtcb *tcb = xnthread_archtcb(thread);
-   tcb->fpup = >core.host_task->thread;
-}
+void xnarch_init_shadow_tcb(struct xnthread *thread);
 
 void xnarch_leave_root(struct xnthread *root);
 
diff --git a/kernel/cobalt/arch/powerpc/thread.c 
b/kernel/cobalt/arch/powerpc/thread.c
index e3be67f..062d33d 100644
--- a/kernel/cobalt/arch/powerpc/thread.c
+++ b/kernel/cobalt/arch/powerpc/thread.c
@@ -159,4 +159,16 @@ void xnarch_leave_root(struct xnthread *root)
>core.user_fpu_owner->thread : NULL;
 }
 
+void xnarch_init_root_tcb(struct xnthread *thread)
+{
+   struct xnarchtcb *tcb = >tcb;
+   tcb->fpup = NULL;
+}
+
+void xnarch_init_shadow_tcb(struct xnthread *thread)
+{
+   struct xnarchtcb *tcb = >tcb;
+   tcb->fpup = >core.host_task->thread;
+}
+
 #endif /* CONFIG_XENO_ARCH_FPU */


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


[Xenomai-git] Philippe Gerum : drivers/udd: fix profile information

2016-09-11 Thread git repository hosting
Module: xenomai-3
Branch: stable-3.0.x
Commit: 64db3d1f97a745c99fb666c13c09eaa27e7a5e61
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=64db3d1f97a745c99fb666c13c09eaa27e7a5e61

Author: Philippe Gerum 
Date:   Sat Sep 10 16:05:35 2016 +0200

drivers/udd: fix profile information

---

 kernel/drivers/udd/udd.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/drivers/udd/udd.c b/kernel/drivers/udd/udd.c
index e14ff0b..972db12 100644
--- a/kernel/drivers/udd/udd.c
+++ b/kernel/drivers/udd/udd.c
@@ -286,7 +286,7 @@ static inline int register_mapper(struct udd_device *udd)
return -ENOMEM;
 
drv->profile_info = (struct rtdm_profile_info)
-   RTDM_PROFILE_INFO("mapper", RTDM_CLASS_MEMORY,
+   RTDM_PROFILE_INFO(mapper, RTDM_CLASS_MEMORY,
  RTDM_SUBCLASS_GENERIC, 0);
drv->device_flags = RTDM_NAMED_DEVICE|RTDM_FIXED_MINOR;
drv->device_count = UDD_NR_MAPS;


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


[Xenomai-git] Philippe Gerum : cobalt/arm: fpu: drop obsolete xnarch_save_fpu()

2016-09-11 Thread git repository hosting
Module: xenomai-3
Branch: stable-3.0.x
Commit: 37253b634f258a1de3ee29f93a9b6a133a7391b0
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=37253b634f258a1de3ee29f93a9b6a133a7391b0

Author: Philippe Gerum 
Date:   Thu Sep  8 16:29:54 2016 +0200

cobalt/arm: fpu: drop obsolete xnarch_save_fpu()

---

 kernel/cobalt/arch/arm/include/asm/xenomai/thread.h |4 
 kernel/cobalt/arch/arm/thread.c |7 ---
 2 files changed, 11 deletions(-)

diff --git a/kernel/cobalt/arch/arm/include/asm/xenomai/thread.h 
b/kernel/cobalt/arch/arm/include/asm/xenomai/thread.h
index 3e332b2..bfe0b9c 100644
--- a/kernel/cobalt/arch/arm/include/asm/xenomai/thread.h
+++ b/kernel/cobalt/arch/arm/include/asm/xenomai/thread.h
@@ -89,8 +89,6 @@ int xnarch_fault_fpu_p(struct ipipe_trap_data *d);
 
 void xnarch_leave_root(struct xnthread *root);
 
-void xnarch_save_fpu(struct xnthread *thread);
-
 void xnarch_switch_fpu(struct xnthread *from, struct xnthread *thread);
 
 int xnarch_handle_fpu_fault(struct xnthread *from, 
@@ -113,8 +111,6 @@ static inline int xnarch_fault_fpu_p(struct ipipe_trap_data 
*d)
 
 static inline void xnarch_leave_root(struct xnthread *root) { }
 
-static inline void xnarch_save_fpu(struct xnthread *thread) { }
-
 static inline void xnarch_switch_fpu(struct xnthread *f, struct xnthread *t) { 
}
 
 static inline int xnarch_handle_fpu_fault(struct xnthread *from, 
diff --git a/kernel/cobalt/arch/arm/thread.c b/kernel/cobalt/arch/arm/thread.c
index 7e2b7cf..5224218 100644
--- a/kernel/cobalt/arch/arm/thread.c
+++ b/kernel/cobalt/arch/arm/thread.c
@@ -211,13 +211,6 @@ void xnarch_leave_root(struct xnthread *root)
rootcb->fpup = get_fpu_owner();
 }
 
-void xnarch_save_fpu(struct xnthread *thread)
-{
-   struct xnarchtcb *tcb = >tcb;
-   if (tcb->fpup)
-   __asm_vfp_save(tcb->fpup, do_enable_vfp());
-}
-
 void xnarch_switch_fpu(struct xnthread *from, struct xnthread *to)
 {
union vfp_state *const from_fpup = from ? from->tcb.fpup : NULL;


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


[Xenomai-git] Philippe Gerum : cobalt/x86: upgrade I-pipe support

2016-09-11 Thread git repository hosting
Module: xenomai-3
Branch: stable-3.0.x
Commit: be6f3c41769cacbcfa9efc9add46543be0d09bde
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=be6f3c41769cacbcfa9efc9add46543be0d09bde

Author: Philippe Gerum 
Date:   Fri Sep  9 19:00:22 2016 +0200

cobalt/x86: upgrade I-pipe support

---

 ...-x86-6.patch => ipipe-core-3.18.20-x86-8.patch} |   79 +++--
 ...8-x86-3.patch => ipipe-core-4.1.18-x86-7.patch} |  313 +++-
 2 files changed, 302 insertions(+), 90 deletions(-)

diff --git a/kernel/cobalt/arch/x86/patches/ipipe-core-3.18.20-x86-6.patch 
b/kernel/cobalt/arch/x86/patches/ipipe-core-3.18.20-x86-8.patch
similarity index 99%
rename from kernel/cobalt/arch/x86/patches/ipipe-core-3.18.20-x86-6.patch
rename to kernel/cobalt/arch/x86/patches/ipipe-core-3.18.20-x86-8.patch
index 128c382..51ebf67 100644
--- a/kernel/cobalt/arch/x86/patches/ipipe-core-3.18.20-x86-6.patch
+++ b/kernel/cobalt/arch/x86/patches/ipipe-core-3.18.20-x86-8.patch
@@ -449,7 +449,7 @@ index 615fa90..e0a62ab 100644
  extern void default_send_IPI_mask_sequence_phys(const struct cpumask *mask,
 diff --git a/arch/x86/include/asm/ipipe.h b/arch/x86/include/asm/ipipe.h
 new file mode 100644
-index 000..ccc8945
+index 000..12305ff
 --- /dev/null
 +++ b/arch/x86/include/asm/ipipe.h
 @@ -0,0 +1,118 @@
@@ -479,7 +479,7 @@ index 000..ccc8945
 +
 +#ifdef CONFIG_IPIPE
 +
-+#define IPIPE_CORE_RELEASE6
++#define IPIPE_CORE_RELEASE8
 +
 +struct ipipe_domain;
 +struct pt_regs;
@@ -3426,10 +3426,10 @@ index e7cc537..bc5e8f8 100644
  handle_real_irq:
 diff --git a/arch/x86/kernel/ipipe.c b/arch/x86/kernel/ipipe.c
 new file mode 100644
-index 000..a06e6bb
+index 000..d756d17
 --- /dev/null
 +++ b/arch/x86/kernel/ipipe.c
-@@ -0,0 +1,499 @@
+@@ -0,0 +1,504 @@
 +/*   -*- linux-c -*-
 + *   linux/arch/x86/kernel/ipipe.c
 + *
@@ -3465,6 +3465,7 @@ index 000..a06e6bb
 +#include 
 +#include 
 +#include 
++#include 
 +#include 
 +#include 
 +#include 
@@ -3929,6 +3930,10 @@ index 000..a06e6bb
 +#if defined(CONFIG_CC_STACKPROTECTOR) && defined(CONFIG_X86_64)
 +EXPORT_PER_CPU_SYMBOL_GPL(irq_stack_union);
 +#endif
++
++#if defined(CONFIG_TRACEPOINTS) && defined(CONFIG_IPIPE_LEGACY)
++EXPORT_TRACEPOINT_SYMBOL_GPL(tlb_flush);
++#endif
 diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c
 index 3790775..218eb83 100644
 --- a/arch/x86/kernel/irq.c
@@ -5831,6 +5836,18 @@ index abcafaa..a8440e4 100644
  } cacheline_aligned;
  
  /*
+diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
+index 662697b..6a9b6ad 100644
+--- a/include/linux/ftrace.h
 b/include/linux/ftrace.h
+@@ -108,6 +108,7 @@ enum {
+   FTRACE_OPS_FL_ADDING= 1 << 9,
+   FTRACE_OPS_FL_REMOVING  = 1 << 10,
+   FTRACE_OPS_FL_MODIFYING = 1 << 11,
++  FTRACE_OPS_FL_IPIPE_EXCLUSIVE   = 1 << 12,
+ };
+ 
+ #ifdef CONFIG_DYNAMIC_FTRACE
 diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h
 index cba442e..b513a46 100644
 --- a/include/linux/hardirq.h
@@ -11776,7 +11793,7 @@ index 000..143f9e6
 +#endif /* CONFIG_IPIPE_HAVE_HOSTRT */
 diff --git a/kernel/ipipe/tracer.c b/kernel/ipipe/tracer.c
 new file mode 100644
-index 000..da272c50
+index 000..8388671
 --- /dev/null
 +++ b/kernel/ipipe/tracer.c
 @@ -0,0 +1,1468 @@
@@ -13114,7 +13131,7 @@ index 000..da272c50
 +
 +static struct ftrace_ops ipipe_trace_ops = {
 +  .func = ipipe_trace_function,
-+  .flags = FTRACE_OPS_FL_RECURSION_SAFE,
++  .flags = FTRACE_OPS_FL_IPIPE_EXCLUSIVE,
 +};
 +
 +static ssize_t __ipipe_wr_enable(struct file *file, const char __user *buffer,
@@ -14675,7 +14692,7 @@ index a5da09c..6650799 100644
help
  This option will modify all the calls to function tracing
 diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
-index d1eff3d..2a324bc 100644
+index d1eff3d..f8b9472 100644
 --- a/kernel/trace/ftrace.c
 +++ b/kernel/trace/ftrace.c
 @@ -32,6 +32,7 @@
@@ -14686,7 +14703,33 @@ index d1eff3d..2a324bc 100644
  
  #include 
  
-@@ -2298,6 +2299,9 @@ void __weak arch_ftrace_update_code(int command)
+@@ -251,8 +252,17 @@ static inline void update_function_graph_func(void) { }
+ 
+ static void update_ftrace_function(void)
+ {
++  struct ftrace_ops *ops;
+   ftrace_func_t func;
+ 
++  for (ops = ftrace_ops_list;
++   ops != _list_end; ops = ops->next)
++  if (ops->flags & FTRACE_OPS_FL_IPIPE_EXCLUSIVE) {
++  set_function_trace_op = ops;
++  func = ops->func;
++  goto set_pointers;
++  }
++
+   /*
+* Prepare the ftrace_ops that the arch callback will use.
+* If there's only one ftrace_ops registered, the ftrace_ops_list
+@@ -280,6 +290,7 @@ static void update_ftrace_function(void)
+ 
+   update_function_graph_func();
+ 
++  set_pointers:
+   /* If there's no change, then do nothing more here */
+   

[Xenomai-git] Philippe Gerum : cobalt/blackfin: fpu: drop obsolete xnarch_save_fpu()

2016-09-11 Thread git repository hosting
Module: xenomai-3
Branch: stable-3.0.x
Commit: d38b04ec28aa4865ececc07b696b725ada9dbd53
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=d38b04ec28aa4865ececc07b696b725ada9dbd53

Author: Philippe Gerum 
Date:   Thu Sep  8 16:29:50 2016 +0200

cobalt/blackfin: fpu: drop obsolete xnarch_save_fpu()

---

 kernel/cobalt/arch/blackfin/include/asm/xenomai/thread.h |1 -
 1 file changed, 1 deletion(-)

diff --git a/kernel/cobalt/arch/blackfin/include/asm/xenomai/thread.h 
b/kernel/cobalt/arch/blackfin/include/asm/xenomai/thread.h
index e270fa8..9956ec5 100644
--- a/kernel/cobalt/arch/blackfin/include/asm/xenomai/thread.h
+++ b/kernel/cobalt/arch/blackfin/include/asm/xenomai/thread.h
@@ -54,7 +54,6 @@ static inline void xnarch_init_root_tcb(struct xnthread 
*thread) { }
 static inline void xnarch_init_shadow_tcb(struct xnthread *thread) { }
 static inline void xnarch_enter_root(struct xnthread *root) { }
 static inline void xnarch_leave_root(struct xnthread *root) { }
-static inline void xnarch_save_fpu(struct xnthread *thread) { }
 static inline void
 xnarch_switch_fpu(struct xnthread *from, struct xnthread *thread)
 { 


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


[Xenomai-git] Philippe Gerum : drivers/ipc: fix potential race in select()

2016-09-11 Thread git repository hosting
Module: xenomai-3
Branch: stable-3.0.x
Commit: 59284782ac15e24a55f57581bdb4dccd4bc84a73
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=59284782ac15e24a55f57581bdb4dccd4bc84a73

Author: Philippe Gerum 
Date:   Tue Sep  6 09:40:34 2016 +0200

drivers/ipc: fix potential race in select()

Acquiring the poll state and binding the selector must be done
atomically, so that such state does not change before xnselect_bind()
decides whether the caller should wait.

---

 kernel/drivers/ipc/bufp.c  |7 +--
 kernel/drivers/ipc/iddp.c  |7 +--
 kernel/drivers/ipc/rtipc.c |   26 +-
 kernel/drivers/ipc/xddp.c  |7 +--
 4 files changed, 16 insertions(+), 31 deletions(-)

diff --git a/kernel/drivers/ipc/bufp.c b/kernel/drivers/ipc/bufp.c
index f129eaa..2e7f5ad 100644
--- a/kernel/drivers/ipc/bufp.c
+++ b/kernel/drivers/ipc/bufp.c
@@ -1043,15 +1043,12 @@ static int bufp_ioctl(struct rtdm_fd *fd,
return ret;
 }
 
-static unsigned int bufp_pollstate(struct rtdm_fd *fd)
+static unsigned int bufp_pollstate(struct rtdm_fd *fd) /* atomic */
 {
struct rtipc_private *priv = rtdm_fd_to_private(fd);
struct bufp_socket *sk = priv->state, *rsk;
unsigned int mask = 0;
struct rtdm_fd *rfd;
-   spl_t s;
-
-   cobalt_atomic_enter(s);
 
if (test_bit(_BUFP_BOUND, >status) && sk->fillsz > 0)
mask |= POLLIN;
@@ -1072,8 +1069,6 @@ static unsigned int bufp_pollstate(struct rtdm_fd *fd)
} else
mask |= POLLOUT;
 
-   cobalt_atomic_leave(s);
-
return mask;
 }
 
diff --git a/kernel/drivers/ipc/iddp.c b/kernel/drivers/ipc/iddp.c
index 028e40a..6d3da57 100644
--- a/kernel/drivers/ipc/iddp.c
+++ b/kernel/drivers/ipc/iddp.c
@@ -935,15 +935,12 @@ static void iddp_exit(void)
xnmap_delete(portmap);
 }
 
-static unsigned int iddp_pollstate(struct rtdm_fd *fd)
+static unsigned int iddp_pollstate(struct rtdm_fd *fd) /* atomic */
 {
struct rtipc_private *priv = rtdm_fd_to_private(fd);
struct iddp_socket *sk = priv->state;
unsigned int mask = 0;
struct rtdm_fd *rfd;
-   spl_t s;
-
-   cobalt_atomic_enter(s);
 
if (test_bit(_IDDP_BOUND, >status) && !list_empty(>inq))
mask |= POLLIN;
@@ -966,8 +963,6 @@ static unsigned int iddp_pollstate(struct rtdm_fd *fd)
} else
mask |= POLLOUT;
 
-   cobalt_atomic_leave(s);
-
return mask;
 }
 
diff --git a/kernel/drivers/ipc/rtipc.c b/kernel/drivers/ipc/rtipc.c
index 77fc7dd..7bd4950 100644
--- a/kernel/drivers/ipc/rtipc.c
+++ b/kernel/drivers/ipc/rtipc.c
@@ -481,28 +481,28 @@ static int rtipc_select(struct rtdm_fd *fd, struct 
xnselector *selector,
spl_t s;
int ret;

+   if (type != XNSELECT_READ && type != XNSELECT_WRITE)
+   return -EINVAL;
+
+   binding = xnmalloc(sizeof(*binding));
+   if (binding == NULL)
+   return -ENOMEM;
+
+   cobalt_atomic_enter(s);
+
pollstate = priv->proto->proto_ops.pollstate(fd);
 
-   switch (type) {
-   case XNSELECT_READ:
+   if (type == XNSELECT_READ) {
mask = pollstate & POLLIN;
block = >recv_block;
-   break;
-   case XNSELECT_WRITE:
+   } else {
mask = pollstate & POLLOUT;
block = >send_block;
-   break;
-   default:
-   return -EINVAL;
}
 
-   binding = xnmalloc(sizeof(*binding));
-   if (binding == NULL)
-   return -ENOMEM;
-
-   xnlock_get_irqsave(, s);
ret = xnselect_bind(block, binding, selector, type, index, mask);
-   xnlock_put_irqrestore(, s);
+
+   cobalt_atomic_leave(s);
 
if (ret)
xnfree(binding);
diff --git a/kernel/drivers/ipc/xddp.c b/kernel/drivers/ipc/xddp.c
index c91aa02..c48b935 100644
--- a/kernel/drivers/ipc/xddp.c
+++ b/kernel/drivers/ipc/xddp.c
@@ -1081,15 +1081,12 @@ static int xddp_ioctl(struct rtdm_fd *fd,
return ret;
 }
 
-static unsigned int xddp_pollstate(struct rtdm_fd *fd)
+static unsigned int xddp_pollstate(struct rtdm_fd *fd) /* atomic */
 {
struct rtipc_private *priv = rtdm_fd_to_private(fd);
struct xddp_socket *sk = priv->state, *rsk;
unsigned int mask = 0, pollstate;
struct rtdm_fd *rfd;
-   spl_t s;
-
-   cobalt_atomic_enter(s);
 
pollstate = __xnpipe_pollstate(sk->minor);
if (test_bit(_XDDP_BOUND, >status))
@@ -1110,8 +1107,6 @@ static unsigned int xddp_pollstate(struct rtdm_fd *fd)
} else
mask |= POLLOUT;
 
-   cobalt_atomic_leave(s);
-
return mask;
 }
 


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


[Xenomai-git] Philippe Gerum : boilerplate: allow for auto-init of external shared libraries

2016-09-11 Thread git repository hosting
Module: xenomai-3
Branch: stable-3.0.x
Commit: 21845c9cc173283840245927031cc7e40da1c429
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=21845c9cc173283840245927031cc7e40da1c429

Author: Philippe Gerum 
Date:   Fri Aug 26 21:21:40 2016 +0200

boilerplate: allow for auto-init of external shared libraries

3rd-party shared libraries for which Xenomai auto-initialization is
required must include a position-independent version of the bootstrap
module.

This means that we need to export a PIC object such libraries can
include, in addition to a non-PIC object to be linked in regular
executables as usual. Such objects are available as
@libdir@/xenomai/bootstrap-pic.o and @libdir@/xenomai/bootstrap.o
respectively.

xeno-config* scripts now accept the --auto-init-solib option to emit
the proper link directives for including the PIC bootstrap module into
shared libraries when --ldflags is given.

---

 configure.ac |   10 +-
 lib/boilerplate/init/Makefile.am |   19 ---
 scripts/xeno-config-cobalt.in|   30 +++---
 scripts/xeno-config-mercury.in   |   30 +++---
 4 files changed, 67 insertions(+), 22 deletions(-)

diff --git a/configure.ac b/configure.ac
index 8bbeeef..38a1749 100644
--- a/configure.ac
+++ b/configure.ac
@@ -803,16 +803,16 @@ dnl in-tree executables which require POSIX symbol 
wrapping.
AC_SUBST([CONFIG_STATUS_DEPENDENCIES], ["$cobalt_wrappers"])
 fi
 
-XENO_AUTOINIT_LDFLAGS='$(top_builddir)/lib/boilerplate/init/bootstrap.o'" 
-Wl,--wrap=main -Wl,--dynamic-list=$topdir/scripts/dynlist.ld"
+dnl
+dnl Build the Makefiles
+dnl
+
+XENO_AUTOINIT_LDFLAGS='$(top_builddir)/lib/boilerplate/init/bootstrap-internal.o'"
 -Wl,--wrap=main -Wl,--dynamic-list=$topdir/scripts/dynlist.ld"
 AC_SUBST(XENO_AUTOINIT_LDFLAGS)
 
 XENO_CORE_LIB=$rtcore_type/lib${rtcore_type}.la
 AC_SUBST(XENO_CORE_LIB)
 
-dnl
-dnl Build the Makefiles
-dnl
-
 AC_SUBST(DOXYGEN_SHOW_INCLUDE_FILES)
 AC_SUBST(DOXYGEN_HAVE_DOT)
 AC_SUBST(DOXYGEN)
diff --git a/lib/boilerplate/init/Makefile.am b/lib/boilerplate/init/Makefile.am
index 7a58f54..f41f419 100644
--- a/lib/boilerplate/init/Makefile.am
+++ b/lib/boilerplate/init/Makefile.am
@@ -7,12 +7,25 @@ libbootstrap_a_CPPFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/lib
 
+noinst_LTLIBRARIES = libbootstrap-pic.la
+
+libbootstrap_pic_la_SOURCES = bootstrap.c
+
+libbootstrap_pic_la_CPPFLAGS = \
+   @XENO_USER_CFLAGS@  \
+   -I$(top_srcdir)/include \
+   -I$(top_srcdir)/lib
+
+get_pic_object = $(shell source ./$(libbootstrap_pic_la_OBJECTS) && echo 
$$pic_object)
+
 all-local: $(libbootstrap_a_OBJECTS)
-   cp $(libbootstrap_a_OBJECTS) bootstrap.o
+   @cp $< bootstrap-internal.o
 
 install-data-local:
-   $(mkinstalldirs) $(DESTDIR)$(libdir)/xenomai
-   $(INSTALL_DATA) $(libbootstrap_a_OBJECTS) 
$(DESTDIR)$(libdir)/xenomai/bootstrap.o
+   @$(mkinstalldirs) $(DESTDIR)$(libdir)/xenomai
+   @$(INSTALL_DATA) $(libbootstrap_a_OBJECTS) 
$(DESTDIR)$(libdir)/xenomai/bootstrap.o
+   @test -r $(call get_pic_object) && \
+   $(INSTALL_DATA) $(call get_pic_object) 
$(DESTDIR)$(libdir)/xenomai/bootstrap-pic.o || true
 
 uninstall-local:
$(RM) -r $(DESTDIR)$(libdir)/xenomai
diff --git a/scripts/xeno-config-cobalt.in b/scripts/xeno-config-cobalt.in
index fec0e28..38f8208 100644
--- a/scripts/xeno-config-cobalt.in
+++ b/scripts/xeno-config-cobalt.in
@@ -18,10 +18,8 @@ XENO_BASE_CFLAGS="-I$XENO_INCLUDE_DIR/cobalt 
-I$XENO_INCLUDE_DIR @XENO_USER_APP_
 XENO_POSIX_LDFLAGS="-L${staging}${libdir} -lcobalt -lpthread -lrt 
@XENO_USER_APP_LDFLAGS@"
 XENO_LIBRARY_DIR="${staging}${libdir}"
 LD_FILE_OPTION="@LD_FILE_OPTION@"
-WRAP_MAIN_OPT="${staging}${libdir}/xenomai/bootstrap.o -Wl,--wrap=main 
-Wl,--dynamic-list=${XENO_LIBRARY_DIR}/dynlist.ld"
-WRAP_MAIN="$WRAP_MAIN_OPT"
 
-unset prefix exec_prefix libdir datadir datarootdir pkgdatadir includedir 
skin_list compat
+unset skin_list compat codegen
 
 dump_wrappers()
 {
@@ -53,7 +51,7 @@ Options :
 --arch
 --prefix
 --[skin=]posix|vxworks|psos|alchemy|rtdm|smokey|cobalt
---auto-init|no-auto-init
+--auto-init|auto-init-solib|no-auto-init
 --cflags
 --ldflags
 --lib*-dir,--libdir,--user-libdir
@@ -109,6 +107,8 @@ fi
 do_ldflags=
 do_cflags=
 do_setinit=
+do_autoinit=y
+do_autoinit_solib=
 
 while test $# -gt 0; do
 case "$1" in
@@ -133,11 +133,22 @@ while test $# -gt 0; do
 ;;
--no-auto-init)
do_setinit=y
-   WRAP_MAIN=
+   do_autoinit=
+   do_autoinit_solib=
;;
--auto-init)
do_setinit=y
-   WRAP_MAIN="$WRAP_MAIN_OPT"
+   do_autoinit=y
+   do_autoinit_solib=
+   ;;
+   --auto-init-solib)
+   if test \! -r 

[Xenomai-git] Philippe Gerum : cobalt/arm: upgrade I-pipe support

2016-09-11 Thread git repository hosting
Module: xenomai-3
Branch: stable-3.0.x
Commit: 2eae1185f359e6da8746333077d38e194352d805
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=2eae1185f359e6da8746333077d38e194352d805

Author: Philippe Gerum 
Date:   Fri Sep  9 18:55:43 2016 +0200

cobalt/arm: upgrade I-pipe support

---

 ...arm-9.patch => ipipe-core-3.18.20-arm-11.patch} |  342 +-
 ...8-arm-4.patch => ipipe-core-4.1.18-arm-8.patch} |  487 +++-
 2 files changed, 704 insertions(+), 125 deletions(-)

diff --git a/kernel/cobalt/arch/arm/patches/ipipe-core-3.18.20-arm-9.patch 
b/kernel/cobalt/arch/arm/patches/ipipe-core-3.18.20-arm-11.patch
similarity index 98%
rename from kernel/cobalt/arch/arm/patches/ipipe-core-3.18.20-arm-9.patch
rename to kernel/cobalt/arch/arm/patches/ipipe-core-3.18.20-arm-11.patch
index d594401..efe7c8f 100644
--- a/kernel/cobalt/arch/arm/patches/ipipe-core-3.18.20-arm-9.patch
+++ b/kernel/cobalt/arch/arm/patches/ipipe-core-3.18.20-arm-11.patch
@@ -1,5 +1,5 @@
 diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
-index 89c4b5c..46ec8f8 100644
+index 89c4b5c..6b13805 100644
 --- a/arch/arm/Kconfig
 +++ b/arch/arm/Kconfig
 @@ -33,8 +33,8 @@ config ARM
@@ -80,6 +80,14 @@ index 89c4b5c..46ec8f8 100644
  source kernel/Kconfig.preempt
  
  config HZ_FIXED
+@@ -1741,6 +1760,7 @@ config ALIGNMENT_TRAP
+ config UACCESS_WITH_MEMCPY
+   bool "Use kernel mem{cpy,set}() for {copy_to,clear}_user()"
+   depends on MMU
++  depends on !IPIPE
+   default y if CPU_FEROCEON
+   help
+ Implement faster copy_to_user and clear_user methods for CPU
 diff --git a/arch/arm/boot/compressed/decompress.c 
b/arch/arm/boot/compressed/decompress.c
 index bd245d3..65f2238 100644
 --- a/arch/arm/boot/compressed/decompress.c
@@ -1653,7 +1661,7 @@ index bb28af7..780ca50 100644
  static inline void sp804_clockevents_init(void __iomem *base, unsigned int 
irq, const char *name)
 diff --git a/arch/arm/include/asm/ipipe.h b/arch/arm/include/asm/ipipe.h
 new file mode 100644
-index 000..d1c125d
+index 000..5ec5eff
 --- /dev/null
 +++ b/arch/arm/include/asm/ipipe.h
 @@ -0,0 +1,272 @@
@@ -1701,7 +1709,7 @@ index 000..d1c125d
 +#include 
 +#include 
 +
-+#define IPIPE_CORE_RELEASE9
++#define IPIPE_CORE_RELEASE11
 +
 +struct ipipe_domain;
 +
@@ -4301,10 +4309,10 @@ index 000..8024a79
 +EXPORT_SYMBOL_GPL(cpu_architecture);
 diff --git a/arch/arm/kernel/ipipe_tsc.c b/arch/arm/kernel/ipipe_tsc.c
 new file mode 100644
-index 000..414ada5
+index 000..6bcabb3
 --- /dev/null
 +++ b/arch/arm/kernel/ipipe_tsc.c
-@@ -0,0 +1,203 @@
+@@ -0,0 +1,207 @@
 +#include 
 +#include 
 +#include 
@@ -4378,6 +4386,10 @@ index 000..414ada5
 +  tsc_addr = &__ipipe_tsc_addr;
 +#endif
 +  registered = ipipe_tsc_value != NULL;
++
++  if (registered && info->freq < tsc_info.freq)
++  return;
++
 +  ipipe_tsc_value = (struct ipipe_tsc_value_t *)tsc_area;
 +  vector_tsc_value = (struct ipipe_tsc_value_t *)__ipipe_tsc_area;
 +
@@ -7090,7 +7102,7 @@ index 5211f62..c0a8610 100644
platform_device_register_simple("imx31-audmux", 0, imx25_audmux_res,
ARRAY_SIZE(imx25_audmux_res));
 diff --git a/arch/arm/mach-imx/mm-imx27.c b/arch/arm/mach-imx/mm-imx27.c
-index 7d82a5a..9bbd0f4 100644
+index 7d82a5a5..9bbd0f4 100644
 --- a/arch/arm/mach-imx/mm-imx27.c
 +++ b/arch/arm/mach-imx/mm-imx27.c
 @@ -81,6 +81,10 @@ static const struct resource imx27_audmux_res[] __initconst 
= {
@@ -12308,6 +12320,85 @@ index 9f06825..1087ed1 100644
irq_find_mapping(d->irq_domain,
 d->chip.base + bit));
}
+diff --git a/drivers/gpio/gpio-mvebu.c b/drivers/gpio/gpio-mvebu.c
+index a93ddbc..7c74176 100644
+--- a/drivers/gpio/gpio-mvebu.c
 b/drivers/gpio/gpio-mvebu.c
+@@ -295,10 +295,11 @@ static void mvebu_gpio_irq_ack(struct irq_data *d)
+   struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
+   struct mvebu_gpio_chip *mvchip = gc->private;
+   u32 mask = ~(1 << (d->irq - gc->irq_base));
++  unsigned long flags;
+ 
+-  irq_gc_lock(gc);
++  flags = irq_gc_lock(gc);
+   writel_relaxed(mask, mvebu_gpioreg_edge_cause(mvchip));
+-  irq_gc_unlock(gc);
++  irq_gc_unlock(gc, flags);
+ }
+ 
+ static void mvebu_gpio_edge_irq_mask(struct irq_data *d)
+@@ -307,12 +308,13 @@ static void mvebu_gpio_edge_irq_mask(struct irq_data *d)
+   struct mvebu_gpio_chip *mvchip = gc->private;
+   struct irq_chip_type *ct = irq_data_get_chip_type(d);
+   u32 mask = 1 << (d->irq - gc->irq_base);
++  unsigned long flags;
+ 
+-  irq_gc_lock(gc);
++  flags = irq_gc_lock(gc);
+   ct->mask_cache_priv &= ~mask;
+ 
+   writel_relaxed(ct->mask_cache_priv, mvebu_gpioreg_edge_mask(mvchip));
+-  irq_gc_unlock(gc);
++  irq_gc_unlock(gc, flags);
+ }
+ 
+ static void 

[Xenomai-git] Philippe Gerum : cobalt/x86: fpu: drop obsolete xnarch_save_fpu()

2016-09-11 Thread git repository hosting
Module: xenomai-3
Branch: next
Commit: f6e5114e7b788f52152ac7d09fa54be11e345440
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=f6e5114e7b788f52152ac7d09fa54be11e345440

Author: Philippe Gerum 
Date:   Thu Sep  8 16:29:38 2016 +0200

cobalt/x86: fpu: drop obsolete xnarch_save_fpu()

---

 kernel/cobalt/arch/x86/include/asm/xenomai/thread.h |2 --
 kernel/cobalt/arch/x86/thread.c |   17 -
 2 files changed, 19 deletions(-)

diff --git a/kernel/cobalt/arch/x86/include/asm/xenomai/thread.h 
b/kernel/cobalt/arch/x86/include/asm/xenomai/thread.h
index 3862e33..bd39f5a 100644
--- a/kernel/cobalt/arch/x86/include/asm/xenomai/thread.h
+++ b/kernel/cobalt/arch/x86/include/asm/xenomai/thread.h
@@ -59,8 +59,6 @@ static inline int xnarch_shadow_p(struct xnarchtcb *tcb, 
struct task_struct *tas
 ((d)->exception == 1 || (d)->exception == 3))
 #define xnarch_fault_notify(d) (!xnarch_fault_bp_p(d))
 
-void xnarch_save_fpu(struct xnthread *thread);
-
 void xnarch_switch_fpu(struct xnthread *from, struct xnthread *to);
 
 int xnarch_handle_fpu_fault(struct xnthread *from, 
diff --git a/kernel/cobalt/arch/x86/thread.c b/kernel/cobalt/arch/x86/thread.c
index d367d13..0383f00 100644
--- a/kernel/cobalt/arch/x86/thread.c
+++ b/kernel/cobalt/arch/x86/thread.c
@@ -289,8 +289,6 @@ int xnarch_handle_fpu_fault(struct xnthread *from,
/*
 * The faulting task is a shadow using the FPU for the first
 * time, initialize the FPU context and tell linux about it.
-* The fpu usage bit is necessary for xnarch_save_fpu() to
-* save the FPU state at next switch.
 */
__asm__ __volatile__("clts; fninit");
 
@@ -346,21 +344,6 @@ void xnarch_leave_root(struct xnthread *root)
kernel_fpu_enable();
 }
 
-void xnarch_save_fpu(struct xnthread *thread)
-{
-   struct xnarchtcb *tcb = xnthread_archtcb(thread);
-   struct task_struct *p = tcb->core.host_task;
-
-   if (__thread_has_fpu(p) == 0)
-   /* Saved by last __switch_to */
-   return;
-   
-   clts();
-
-   __do_save_i387(x86_fpustate_ptr(>thread));
-   __thread_clear_has_fpu(p);
-}
-
 void xnarch_switch_fpu(struct xnthread *from, struct xnthread *to)
 {
x86_fpustate *const from_fpup = from ? from->tcb.fpup : NULL;


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


[Xenomai-git] Philippe Gerum : cobalt/x86: fpu: drop obsolete xnarch_save_fpu()

2016-09-11 Thread git repository hosting
Module: xenomai-3
Branch: stable-3.0.x
Commit: 3d7cab71c44c341ff465ca7ea2a1562ceae1e125
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=3d7cab71c44c341ff465ca7ea2a1562ceae1e125

Author: Philippe Gerum 
Date:   Thu Sep  8 16:29:38 2016 +0200

cobalt/x86: fpu: drop obsolete xnarch_save_fpu()

---

 kernel/cobalt/arch/x86/include/asm/xenomai/thread.h |2 --
 kernel/cobalt/arch/x86/thread.c |   17 -
 2 files changed, 19 deletions(-)

diff --git a/kernel/cobalt/arch/x86/include/asm/xenomai/thread.h 
b/kernel/cobalt/arch/x86/include/asm/xenomai/thread.h
index 3862e33..bd39f5a 100644
--- a/kernel/cobalt/arch/x86/include/asm/xenomai/thread.h
+++ b/kernel/cobalt/arch/x86/include/asm/xenomai/thread.h
@@ -59,8 +59,6 @@ static inline int xnarch_shadow_p(struct xnarchtcb *tcb, 
struct task_struct *tas
 ((d)->exception == 1 || (d)->exception == 3))
 #define xnarch_fault_notify(d) (!xnarch_fault_bp_p(d))
 
-void xnarch_save_fpu(struct xnthread *thread);
-
 void xnarch_switch_fpu(struct xnthread *from, struct xnthread *to);
 
 int xnarch_handle_fpu_fault(struct xnthread *from, 
diff --git a/kernel/cobalt/arch/x86/thread.c b/kernel/cobalt/arch/x86/thread.c
index d367d13..0383f00 100644
--- a/kernel/cobalt/arch/x86/thread.c
+++ b/kernel/cobalt/arch/x86/thread.c
@@ -289,8 +289,6 @@ int xnarch_handle_fpu_fault(struct xnthread *from,
/*
 * The faulting task is a shadow using the FPU for the first
 * time, initialize the FPU context and tell linux about it.
-* The fpu usage bit is necessary for xnarch_save_fpu() to
-* save the FPU state at next switch.
 */
__asm__ __volatile__("clts; fninit");
 
@@ -346,21 +344,6 @@ void xnarch_leave_root(struct xnthread *root)
kernel_fpu_enable();
 }
 
-void xnarch_save_fpu(struct xnthread *thread)
-{
-   struct xnarchtcb *tcb = xnthread_archtcb(thread);
-   struct task_struct *p = tcb->core.host_task;
-
-   if (__thread_has_fpu(p) == 0)
-   /* Saved by last __switch_to */
-   return;
-   
-   clts();
-
-   __do_save_i387(x86_fpustate_ptr(>thread));
-   __thread_clear_has_fpu(p);
-}
-
 void xnarch_switch_fpu(struct xnthread *from, struct xnthread *to)
 {
x86_fpustate *const from_fpup = from ? from->tcb.fpup : NULL;


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


[Xenomai-git] Philippe Gerum : cobalt/arm: thread: move all TCB initializers out of line

2016-09-11 Thread git repository hosting
Module: xenomai-3
Branch: stable-3.0.x
Commit: f05ad9d1de19a2360e062b183915349241eb34da
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=f05ad9d1de19a2360e062b183915349241eb34da

Author: Philippe Gerum 
Date:   Fri Sep  9 16:07:54 2016 +0200

cobalt/arm: thread: move all TCB initializers out of line

Does not impact performances and fixes inclusion hell for pulling the
struct xnthread definition for good.

---

 kernel/cobalt/arch/arm/include/asm/xenomai/thread.h |6 +-
 kernel/cobalt/arch/arm/thread.c |7 +++
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/kernel/cobalt/arch/arm/include/asm/xenomai/thread.h 
b/kernel/cobalt/arch/arm/include/asm/xenomai/thread.h
index bfe0b9c..3ab9732 100644
--- a/kernel/cobalt/arch/arm/include/asm/xenomai/thread.h
+++ b/kernel/cobalt/arch/arm/include/asm/xenomai/thread.h
@@ -77,11 +77,7 @@ static inline int xnarch_escalate(void)
 
 #if defined(CONFIG_XENO_ARCH_FPU) && defined(CONFIG_VFP)
 
-static inline void xnarch_init_root_tcb(struct xnthread *thread)
-{
-   struct xnarchtcb *tcb = xnthread_archtcb(thread);
-   tcb->fpup = NULL;
-}
+void xnarch_init_root_tcb(struct xnthread *thread);
 
 void xnarch_init_shadow_tcb(struct xnthread *thread);
 
diff --git a/kernel/cobalt/arch/arm/thread.c b/kernel/cobalt/arch/arm/thread.c
index 5224218..d3c2fed 100644
--- a/kernel/cobalt/arch/arm/thread.c
+++ b/kernel/cobalt/arch/arm/thread.c
@@ -304,6 +304,13 @@ void xnarch_init_shadow_tcb(struct xnthread *thread)
/* XNFPU is set upon first FPU fault */
xnthread_clear_state(thread, XNFPU);
 }
+
+void xnarch_init_root_tcb(struct xnthread *thread)
+{
+   struct xnarchtcb *tcb = >tcb;
+   tcb->fpup = NULL;
+}
+
 #endif /* CONFIG_XENO_ARCH_FPU && CONFIG_VFP*/
 
 void xnarch_switch_to(struct xnthread *out, struct xnthread *in)


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


[Xenomai-git] Philippe Gerum : cobalt/x86: fpu: fixup for kernel 4.2+

2016-09-11 Thread git repository hosting
Module: xenomai-3
Branch: next
Commit: d8fe5657a038ef8b735e70bc7cf57f528930ecba
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=d8fe5657a038ef8b735e70bc7cf57f528930ecba

Author: Philippe Gerum 
Date:   Mon Sep  5 15:11:24 2016 +0200

cobalt/x86: fpu: fixup for kernel 4.2+

---

 .../cobalt/arch/x86/include/asm/xenomai/fptest.h   |2 +-
 .../cobalt/arch/x86/include/asm/xenomai/thread.h   |   15 ++-
 .../cobalt/arch/x86/include/asm/xenomai/wrappers.h |7 +-
 kernel/cobalt/arch/x86/machine.c   |9 +-
 kernel/cobalt/arch/x86/thread.c|  124 +++-
 kernel/cobalt/include/asm-generic/xenomai/thread.h |2 -
 6 files changed, 119 insertions(+), 40 deletions(-)

diff --git a/kernel/cobalt/arch/x86/include/asm/xenomai/fptest.h 
b/kernel/cobalt/arch/x86/include/asm/xenomai/fptest.h
index a05d54e..f0ecd00 100644
--- a/kernel/cobalt/arch/x86/include/asm/xenomai/fptest.h
+++ b/kernel/cobalt/arch/x86/include/asm/xenomai/fptest.h
@@ -20,8 +20,8 @@
 #define _COBALT_X86_ASM_FPTEST_H
 
 #include 
-#include 
 #include 
+#include 
 #include 
 
 static inline int fp_kernel_supported(void)
diff --git a/kernel/cobalt/arch/x86/include/asm/xenomai/thread.h 
b/kernel/cobalt/arch/x86/include/asm/xenomai/thread.h
index bd39f5a..d8a6a78 100644
--- a/kernel/cobalt/arch/x86/include/asm/xenomai/thread.h
+++ b/kernel/cobalt/arch/x86/include/asm/xenomai/thread.h
@@ -23,11 +23,15 @@
 #include 
 #include 
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,0)
 typedef union thread_xstate x86_fpustate;
 #define x86_fpustate_ptr(t) ((t)->fpu.state)
+#else
+typedef union fpregs_state x86_fpustate;
+#define x86_fpustate_ptr(t) ((t)->fpu.active_state)
+#endif
 
 struct xnarchtcb {
-   x86_fpustate i387;
struct xntcb core;
unsigned long sp;
unsigned long *spp;
@@ -36,17 +40,13 @@ struct xnarchtcb {
x86_fpustate *fpup;
unsigned int root_kfpu: 1;
unsigned int root_used_math: 1;
+   x86_fpustate *kfpu_state;
struct {
unsigned long ip;
unsigned long ax;
} mayday;
 };
 
-static inline int xnarch_shadow_p(struct xnarchtcb *tcb, struct task_struct 
*task)
-{
-   return tcb->spp == >thread.sp;
-}
-
 #define xnarch_fpu_ptr(tcb) ((tcb)->fpup)
 
 #define xnarch_fault_regs(d)   ((d)->regs)
@@ -84,4 +84,7 @@ static inline int xnarch_escalate(void)
return 0;
 }
 
+int mach_x86_thread_init(void);
+void mach_x86_thread_cleanup(void);
+
 #endif /* !_COBALT_X86_ASM_THREAD_H */
diff --git a/kernel/cobalt/arch/x86/include/asm/xenomai/wrappers.h 
b/kernel/cobalt/arch/x86/include/asm/xenomai/wrappers.h
index bfff14b..5f9cff3 100644
--- a/kernel/cobalt/arch/x86/include/asm/xenomai/wrappers.h
+++ b/kernel/cobalt/arch/x86/include/asm/xenomai/wrappers.h
@@ -24,9 +24,14 @@
 #define __get_user_inatomic __get_user
 #define __put_user_inatomic __put_user
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)
 #include 
 #include 
+#else
+#include 
+#endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0)
 
 static inline void kernel_fpu_disable(void)
 {
diff --git a/kernel/cobalt/arch/x86/machine.c b/kernel/cobalt/arch/x86/machine.c
index 14443e0..d9eb66d 100644
--- a/kernel/cobalt/arch/x86/machine.c
+++ b/kernel/cobalt/arch/x86/machine.c
@@ -17,10 +17,10 @@
  *   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  *   02111-1307, USA.
  */
-
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -148,6 +148,12 @@ static unsigned long mach_x86_calibrate(void)
 
 static int mach_x86_init(void)
 {
+   int ret;
+
+   ret = mach_x86_thread_init();
+   if (ret)
+   return ret;
+
mach_x86_c1e_disable();
mach_x86_smi_init();
mach_x86_smi_disable();
@@ -158,6 +164,7 @@ static int mach_x86_init(void)
 static void mach_x86_cleanup(void)
 {
mach_x86_smi_restore();
+   mach_x86_thread_cleanup();
 }
 
 static const char *const fault_labels[] = {
diff --git a/kernel/cobalt/arch/x86/thread.c b/kernel/cobalt/arch/x86/thread.c
index 0383f00..9e1dea2 100644
--- a/kernel/cobalt/arch/x86/thread.c
+++ b/kernel/cobalt/arch/x86/thread.c
@@ -21,10 +21,43 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
+#include 
+
+static struct kmem_cache *xstate_cache;
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)
 #include 
 #include 
+#define x86_fpregs_active(t)   __thread_has_fpu(t)
+#define x86_fpregs_deactivate(t)   __thread_clear_has_fpu(t)
+#define x86_fpregs_activate(t) __thread_set_has_fpu(t)
+#define x86_xstate_alignment   __alignof__(union thread_xstate)
+#else
+#include 
+
+static inline int x86_fpregs_active(struct task_struct *t)
+{
+   return t->thread.fpu.fpregs_active;
+}
+
+static inline void x86_fpregs_deactivate(struct task_struct *t)
+{
+   if (x86_fpregs_active(t))
+   

[Xenomai-git] Philippe Gerum : doc/man: xeno-config: document --auto-init-solib

2016-09-11 Thread git repository hosting
Module: xenomai-3
Branch: next
Commit: 119603e346184ff0de19d14af84857352c488b52
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=119603e346184ff0de19d14af84857352c488b52

Author: Philippe Gerum 
Date:   Fri Sep  9 19:18:34 2016 +0200

doc/man: xeno-config: document --auto-init-solib

---

 doc/asciidoc/man1/xeno-config.adoc |   18 --
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/doc/asciidoc/man1/xeno-config.adoc 
b/doc/asciidoc/man1/xeno-config.adoc
index 2844352..62ab888 100644
--- a/doc/asciidoc/man1/xeno-config.adoc
+++ b/doc/asciidoc/man1/xeno-config.adoc
@@ -35,7 +35,7 @@ SYNOPSIS
 
 *xeno-config* *--version*
 
-*xeno-config* [*--cc*] [*--ccld*] [*--arch*] [*--prefix*] 
[*--posix|alchemy|rtdm|psos|vxworks|smokey*] [*--compat*] 
[*--auto-init*|*no-auto-init*] [*--cflags*] [*--ldflags*] 
[*--library-dir*|*--libdir*|*--user-libdir*]
+*xeno-config* [*--cc*] [*--ccld*] [*--arch*] [*--prefix*] 
[*--posix|alchemy|rtdm|psos|vxworks|smokey*] [*--compat*] 
[*--auto-init*|*no-auto-init*] [*--auto-init-solib*] [*--cflags*] [*--ldflags*] 
[*--library-dir*|*--libdir*|*--user-libdir*]
 
 DESCRIPTION
 
@@ -126,7 +126,21 @@ initialization. In such a case, the application code shall 
call the
 chores on behalf on the +main()+ routine, *before* any real-time
 service is invoked.
 
-*xeno-config* enables the Copperplate auto-init feature by default.
+This flag makes sense when passed along with --ldflags
+only. *xeno-config* enables the Copperplate auto-init feature by
+default.
+
+*--auto-init-solib*::
+
+This switch enables the auto-initialization feature described above
+for a shared library target instead of a pure executable. The main
+difference resides in a position-independent (PIC) glue code being
+used for bootstrapping the initialization.
+
+The bootstrap code runs when the shared library is attached to a
+running executable, either because it appears in the static
+dependencies of this executable, or when loaded dynamically via the
+dlopen() interface.
 
 *--core*::
 Output the name of the real-time core the current Xenomai installation


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


[Xenomai-git] Philippe Gerum : cobalt/arm64: fpu: drop obsolete xnarch_save_fpu()

2016-09-11 Thread git repository hosting
Module: xenomai-3
Branch: next
Commit: 72297f416001d5dd32c3b49d2d42b87b73f46faa
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=72297f416001d5dd32c3b49d2d42b87b73f46faa

Author: Philippe Gerum 
Date:   Thu Sep  8 16:29:59 2016 +0200

cobalt/arm64: fpu: drop obsolete xnarch_save_fpu()

---

 kernel/cobalt/arch/arm64/include/asm/xenomai/thread.h |4 
 1 file changed, 4 deletions(-)

diff --git a/kernel/cobalt/arch/arm64/include/asm/xenomai/thread.h 
b/kernel/cobalt/arch/arm64/include/asm/xenomai/thread.h
index 4b247ac..ac1f1f7 100644
--- a/kernel/cobalt/arch/arm64/include/asm/xenomai/thread.h
+++ b/kernel/cobalt/arch/arm64/include/asm/xenomai/thread.h
@@ -75,8 +75,6 @@ static inline int xnarch_fault_fpu_p(struct ipipe_trap_data 
*d)
 
 void xnarch_leave_root(struct xnthread *root);
 
-void xnarch_save_fpu(struct xnthread *thread);
-
 void xnarch_switch_fpu(struct xnthread *from, struct xnthread *thread);
 
 static inline int
@@ -103,8 +101,6 @@ static inline int xnarch_fault_fpu_p(struct ipipe_trap_data 
*d)
 
 static inline void xnarch_leave_root(struct xnthread *root) { }
 
-static inline void xnarch_save_fpu(struct xnthread *thread) { }
-
 static inline void xnarch_switch_fpu(struct xnthread *f, struct xnthread *t) { 
}
 
 static inline int xnarch_handle_fpu_fault(struct xnthread *from, 


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


[Xenomai-git] Philippe Gerum : cobalt/arm: fpu: drop obsolete xnarch_save_fpu()

2016-09-11 Thread git repository hosting
Module: xenomai-3
Branch: next
Commit: 4daa8d37c4980ef30ddae4e1317cca2a0290
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=4daa8d37c4980ef30ddae4e1317cca2a0290

Author: Philippe Gerum 
Date:   Thu Sep  8 16:29:54 2016 +0200

cobalt/arm: fpu: drop obsolete xnarch_save_fpu()

---

 kernel/cobalt/arch/arm/include/asm/xenomai/thread.h |4 
 kernel/cobalt/arch/arm/thread.c |7 ---
 2 files changed, 11 deletions(-)

diff --git a/kernel/cobalt/arch/arm/include/asm/xenomai/thread.h 
b/kernel/cobalt/arch/arm/include/asm/xenomai/thread.h
index 3e332b2..bfe0b9c 100644
--- a/kernel/cobalt/arch/arm/include/asm/xenomai/thread.h
+++ b/kernel/cobalt/arch/arm/include/asm/xenomai/thread.h
@@ -89,8 +89,6 @@ int xnarch_fault_fpu_p(struct ipipe_trap_data *d);
 
 void xnarch_leave_root(struct xnthread *root);
 
-void xnarch_save_fpu(struct xnthread *thread);
-
 void xnarch_switch_fpu(struct xnthread *from, struct xnthread *thread);
 
 int xnarch_handle_fpu_fault(struct xnthread *from, 
@@ -113,8 +111,6 @@ static inline int xnarch_fault_fpu_p(struct ipipe_trap_data 
*d)
 
 static inline void xnarch_leave_root(struct xnthread *root) { }
 
-static inline void xnarch_save_fpu(struct xnthread *thread) { }
-
 static inline void xnarch_switch_fpu(struct xnthread *f, struct xnthread *t) { 
}
 
 static inline int xnarch_handle_fpu_fault(struct xnthread *from, 
diff --git a/kernel/cobalt/arch/arm/thread.c b/kernel/cobalt/arch/arm/thread.c
index 7e2b7cf..5224218 100644
--- a/kernel/cobalt/arch/arm/thread.c
+++ b/kernel/cobalt/arch/arm/thread.c
@@ -211,13 +211,6 @@ void xnarch_leave_root(struct xnthread *root)
rootcb->fpup = get_fpu_owner();
 }
 
-void xnarch_save_fpu(struct xnthread *thread)
-{
-   struct xnarchtcb *tcb = >tcb;
-   if (tcb->fpup)
-   __asm_vfp_save(tcb->fpup, do_enable_vfp());
-}
-
 void xnarch_switch_fpu(struct xnthread *from, struct xnthread *to)
 {
union vfp_state *const from_fpup = from ? from->tcb.fpup : NULL;


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


[Xenomai-git] Philippe Gerum : cobalt/thread: drop obsolete release_fpu() helper

2016-09-11 Thread git repository hosting
Module: xenomai-3
Branch: stable-3.0.x
Commit: 3754612c93eb5f2559590da313f2bad7e09ca90e
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=3754612c93eb5f2559590da313f2bad7e09ca90e

Author: Philippe Gerum 
Date:   Thu Sep  8 16:30:27 2016 +0200

cobalt/thread: drop obsolete release_fpu() helper

---

 kernel/cobalt/thread.c |   17 -
 1 file changed, 17 deletions(-)

diff --git a/kernel/cobalt/thread.c b/kernel/cobalt/thread.c
index 01d86b3..fb856a4 100644
--- a/kernel/cobalt/thread.c
+++ b/kernel/cobalt/thread.c
@@ -435,19 +435,6 @@ static inline void giveup_fpu(struct xnsched *sched,
sched->fpuholder = NULL;
 }
 
-static inline void release_fpu(struct xnthread *thread)
-{
-   /*
-* Force the FPU save, and nullify the sched->fpuholder
-* pointer, to avoid leaving fpuholder pointing on the backup
-* area of the migrated thread.
-*/
-   if (xnthread_test_state(thread, XNFPU)) {
-   xnarch_save_fpu(thread);
-   thread->sched->fpuholder = NULL;
-   }
-}
-
 void xnthread_switch_fpu(struct xnsched *sched)
 {
struct xnthread *curr = sched->curr;
@@ -466,10 +453,6 @@ static inline void giveup_fpu(struct xnsched *sched,
 {
 }
 
-static inline void release_fpu(struct xnthread *thread)
-{
-}
-
 #endif /* !CONFIG_XENO_ARCH_FPU */
 
 static inline void cleanup_tcb(struct xnthread *thread) /* nklock held, irqs 
off */


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


[Xenomai-git] Philippe Gerum : cobalt/powerpc: thread: move all TCB initializers out of line

2016-09-11 Thread git repository hosting
Module: xenomai-3
Branch: next
Commit: cf0ec30dc2a12bc3591f971f1d2b36d1ecc36e72
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=cf0ec30dc2a12bc3591f971f1d2b36d1ecc36e72

Author: Philippe Gerum 
Date:   Fri Sep  9 16:07:54 2016 +0200

cobalt/powerpc: thread: move all TCB initializers out of line

Does not impact performances and fixes inclusion hell for pulling the
struct xnthread definition for good.

---

 kernel/cobalt/arch/powerpc/include/asm/xenomai/thread.h |   12 ++--
 kernel/cobalt/arch/powerpc/thread.c |   12 
 2 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/kernel/cobalt/arch/powerpc/include/asm/xenomai/thread.h 
b/kernel/cobalt/arch/powerpc/include/asm/xenomai/thread.h
index 1de5cac..0ab48be 100644
--- a/kernel/cobalt/arch/powerpc/include/asm/xenomai/thread.h
+++ b/kernel/cobalt/arch/powerpc/include/asm/xenomai/thread.h
@@ -52,17 +52,9 @@ static inline void xnarch_enter_root(struct xnthread *root) 
{ }
 
 #ifdef CONFIG_XENO_ARCH_FPU
 
-static inline void xnarch_init_root_tcb(struct xnthread *thread)
-{
-   struct xnarchtcb *tcb = xnthread_archtcb(thread);
-   tcb->fpup = NULL;
-}
+void xnarch_init_root_tcb(struct xnthread *thread);
 
-static inline void xnarch_init_shadow_tcb(struct xnthread *thread)
-{
-   struct xnarchtcb *tcb = xnthread_archtcb(thread);
-   tcb->fpup = >core.host_task->thread;
-}
+void xnarch_init_shadow_tcb(struct xnthread *thread);
 
 void xnarch_leave_root(struct xnthread *root);
 
diff --git a/kernel/cobalt/arch/powerpc/thread.c 
b/kernel/cobalt/arch/powerpc/thread.c
index e3be67f..062d33d 100644
--- a/kernel/cobalt/arch/powerpc/thread.c
+++ b/kernel/cobalt/arch/powerpc/thread.c
@@ -159,4 +159,16 @@ void xnarch_leave_root(struct xnthread *root)
>core.user_fpu_owner->thread : NULL;
 }
 
+void xnarch_init_root_tcb(struct xnthread *thread)
+{
+   struct xnarchtcb *tcb = >tcb;
+   tcb->fpup = NULL;
+}
+
+void xnarch_init_shadow_tcb(struct xnthread *thread)
+{
+   struct xnarchtcb *tcb = >tcb;
+   tcb->fpup = >core.host_task->thread;
+}
+
 #endif /* CONFIG_XENO_ARCH_FPU */


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


[Xenomai-git] Philippe Gerum : cobalt/kernel: stop using deprecated set_cpus_allowed()

2016-09-11 Thread git repository hosting
Module: xenomai-3
Branch: stable-3.0.x
Commit: 95e603a385e06371f082a67f7de633974935952d
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=95e603a385e06371f082a67f7de633974935952d

Author: Philippe Gerum 
Date:   Sat Sep  3 11:20:21 2016 +0200

cobalt/kernel: stop using deprecated set_cpus_allowed()

---

 kernel/cobalt/thread.c  |4 ++--
 kernel/drivers/testing/switchtest.c |   10 +-
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/kernel/cobalt/thread.c b/kernel/cobalt/thread.c
index 7daefdb..01d86b3 100644
--- a/kernel/cobalt/thread.c
+++ b/kernel/cobalt/thread.c
@@ -2196,7 +2196,7 @@ void xnthread_relax(int notify, int reason)
if (xnthread_test_localinfo(thread, XNMOVED)) {
xnthread_clear_localinfo(thread, XNMOVED);
cpu = xnsched_cpu(thread->sched);
-   set_cpus_allowed(p, *cpumask_of(cpu));
+   set_cpus_allowed_ptr(p, cpumask_of(cpu));
}
 #endif
 
@@ -2444,7 +2444,7 @@ void xnthread_pin_initial(struct xnthread *thread)
if (!cpumask_test_cpu(cpu, >affinity))
cpu = cpumask_first(>affinity);
 
-   set_cpus_allowed(p, *cpumask_of(cpu));
+   set_cpus_allowed_ptr(p, cpumask_of(cpu));
/*
 * @thread is still unstarted Xenomai-wise, we are precisely
 * in the process of mapping the current kernel task to
diff --git a/kernel/drivers/testing/switchtest.c 
b/kernel/drivers/testing/switchtest.c
index 7283dd5..3a2e0d5 100644
--- a/kernel/drivers/testing/switchtest.c
+++ b/kernel/drivers/testing/switchtest.c
@@ -495,7 +495,7 @@ static int rtswitch_create_ktask(struct rtswitch_context 
*ctx,
iattr.affinity = *cpumask_of(ctx->cpu);
param.rt.prio = 1;
 
-   set_cpus_allowed(current, *cpumask_of(ctx->cpu));
+   set_cpus_allowed_ptr(current, cpumask_of(ctx->cpu));
 
err = xnthread_init(>ktask,
, _class_rt, );
@@ -512,9 +512,9 @@ static int rtswitch_create_ktask(struct rtswitch_context 
*ctx,
task->base.flags = 0;
/*
 * Putting the argument on stack is safe, because the new
-* thread, thanks to the abovce call of set_cpus_allowed,
-* will preempt the current thread immediately, and
-* will suspend only once the arguments on stack are used.
+* thread, thanks to the above call to set_cpus_allowed_ptr(),
+* will preempt the current thread immediately, and will
+* suspend only once the arguments on stack are used.
 */
 
return err;
@@ -553,7 +553,7 @@ static void rtswitch_close(struct rtdm_fd *fd)
rtdm_nrtsig_destroy(>wake_utask);
 
if (ctx->tasks) {
-   set_cpus_allowed(current, *cpumask_of(ctx->cpu));
+   set_cpus_allowed_ptr(current, cpumask_of(ctx->cpu));
 
for (i = 0; i < ctx->next_index; i++) {
struct rtswitch_task *task = >tasks[i];


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


[Xenomai-git] Philippe Gerum : cobalt/arm: thread: move all TCB initializers out of line

2016-09-11 Thread git repository hosting
Module: xenomai-3
Branch: next
Commit: f803276c411620a4cc880b68866f3868e62e4cd8
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=f803276c411620a4cc880b68866f3868e62e4cd8

Author: Philippe Gerum 
Date:   Fri Sep  9 16:07:54 2016 +0200

cobalt/arm: thread: move all TCB initializers out of line

Does not impact performances and fixes inclusion hell for pulling the
struct xnthread definition for good.

---

 kernel/cobalt/arch/arm/include/asm/xenomai/thread.h |6 +-
 kernel/cobalt/arch/arm/thread.c |7 +++
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/kernel/cobalt/arch/arm/include/asm/xenomai/thread.h 
b/kernel/cobalt/arch/arm/include/asm/xenomai/thread.h
index bfe0b9c..3ab9732 100644
--- a/kernel/cobalt/arch/arm/include/asm/xenomai/thread.h
+++ b/kernel/cobalt/arch/arm/include/asm/xenomai/thread.h
@@ -77,11 +77,7 @@ static inline int xnarch_escalate(void)
 
 #if defined(CONFIG_XENO_ARCH_FPU) && defined(CONFIG_VFP)
 
-static inline void xnarch_init_root_tcb(struct xnthread *thread)
-{
-   struct xnarchtcb *tcb = xnthread_archtcb(thread);
-   tcb->fpup = NULL;
-}
+void xnarch_init_root_tcb(struct xnthread *thread);
 
 void xnarch_init_shadow_tcb(struct xnthread *thread);
 
diff --git a/kernel/cobalt/arch/arm/thread.c b/kernel/cobalt/arch/arm/thread.c
index 5224218..d3c2fed 100644
--- a/kernel/cobalt/arch/arm/thread.c
+++ b/kernel/cobalt/arch/arm/thread.c
@@ -304,6 +304,13 @@ void xnarch_init_shadow_tcb(struct xnthread *thread)
/* XNFPU is set upon first FPU fault */
xnthread_clear_state(thread, XNFPU);
 }
+
+void xnarch_init_root_tcb(struct xnthread *thread)
+{
+   struct xnarchtcb *tcb = >tcb;
+   tcb->fpup = NULL;
+}
+
 #endif /* CONFIG_XENO_ARCH_FPU && CONFIG_VFP*/
 
 void xnarch_switch_to(struct xnthread *out, struct xnthread *in)


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


[Xenomai-git] Philippe Gerum : cobalt/thread: drop obsolete release_fpu() helper

2016-09-11 Thread git repository hosting
Module: xenomai-3
Branch: next
Commit: c0ec6f455631de29133e24e12d51fb6a1bb4bfe5
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=c0ec6f455631de29133e24e12d51fb6a1bb4bfe5

Author: Philippe Gerum 
Date:   Thu Sep  8 16:30:27 2016 +0200

cobalt/thread: drop obsolete release_fpu() helper

---

 kernel/cobalt/thread.c |   17 -
 1 file changed, 17 deletions(-)

diff --git a/kernel/cobalt/thread.c b/kernel/cobalt/thread.c
index 6c084f7..3b57cba 100644
--- a/kernel/cobalt/thread.c
+++ b/kernel/cobalt/thread.c
@@ -435,19 +435,6 @@ static inline void giveup_fpu(struct xnsched *sched,
sched->fpuholder = NULL;
 }
 
-static inline void release_fpu(struct xnthread *thread)
-{
-   /*
-* Force the FPU save, and nullify the sched->fpuholder
-* pointer, to avoid leaving fpuholder pointing on the backup
-* area of the migrated thread.
-*/
-   if (xnthread_test_state(thread, XNFPU)) {
-   xnarch_save_fpu(thread);
-   thread->sched->fpuholder = NULL;
-   }
-}
-
 void xnthread_switch_fpu(struct xnsched *sched)
 {
struct xnthread *curr = sched->curr;
@@ -466,10 +453,6 @@ static inline void giveup_fpu(struct xnsched *sched,
 {
 }
 
-static inline void release_fpu(struct xnthread *thread)
-{
-}
-
 #endif /* !CONFIG_XENO_ARCH_FPU */
 
 static inline void release_all_ownerships(struct xnthread *curr)


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


[Xenomai-git] Philippe Gerum : cobalt/kernel: stop using deprecated set_cpus_allowed()

2016-09-11 Thread git repository hosting
Module: xenomai-3
Branch: next
Commit: 9919d041707479db52db22f053f52bfc871d2b51
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=9919d041707479db52db22f053f52bfc871d2b51

Author: Philippe Gerum 
Date:   Sat Sep  3 11:20:21 2016 +0200

cobalt/kernel: stop using deprecated set_cpus_allowed()

---

 kernel/cobalt/thread.c  |4 ++--
 kernel/drivers/testing/switchtest.c |   10 +-
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/kernel/cobalt/thread.c b/kernel/cobalt/thread.c
index 435cd4b..6c084f7 100644
--- a/kernel/cobalt/thread.c
+++ b/kernel/cobalt/thread.c
@@ -2254,7 +2254,7 @@ void xnthread_relax(int notify, int reason)
if (xnthread_test_localinfo(thread, XNMOVED)) {
xnthread_clear_localinfo(thread, XNMOVED);
cpu = xnsched_cpu(thread->sched);
-   set_cpus_allowed(p, *cpumask_of(cpu));
+   set_cpus_allowed_ptr(p, cpumask_of(cpu));
}
 #endif
 
@@ -2502,7 +2502,7 @@ void xnthread_pin_initial(struct xnthread *thread)
if (!cpumask_test_cpu(cpu, >affinity))
cpu = cpumask_first(>affinity);
 
-   set_cpus_allowed(p, *cpumask_of(cpu));
+   set_cpus_allowed_ptr(p, cpumask_of(cpu));
/*
 * @thread is still unstarted Xenomai-wise, we are precisely
 * in the process of mapping the current kernel task to
diff --git a/kernel/drivers/testing/switchtest.c 
b/kernel/drivers/testing/switchtest.c
index 7283dd5..3a2e0d5 100644
--- a/kernel/drivers/testing/switchtest.c
+++ b/kernel/drivers/testing/switchtest.c
@@ -495,7 +495,7 @@ static int rtswitch_create_ktask(struct rtswitch_context 
*ctx,
iattr.affinity = *cpumask_of(ctx->cpu);
param.rt.prio = 1;
 
-   set_cpus_allowed(current, *cpumask_of(ctx->cpu));
+   set_cpus_allowed_ptr(current, cpumask_of(ctx->cpu));
 
err = xnthread_init(>ktask,
, _class_rt, );
@@ -512,9 +512,9 @@ static int rtswitch_create_ktask(struct rtswitch_context 
*ctx,
task->base.flags = 0;
/*
 * Putting the argument on stack is safe, because the new
-* thread, thanks to the abovce call of set_cpus_allowed,
-* will preempt the current thread immediately, and
-* will suspend only once the arguments on stack are used.
+* thread, thanks to the above call to set_cpus_allowed_ptr(),
+* will preempt the current thread immediately, and will
+* suspend only once the arguments on stack are used.
 */
 
return err;
@@ -553,7 +553,7 @@ static void rtswitch_close(struct rtdm_fd *fd)
rtdm_nrtsig_destroy(>wake_utask);
 
if (ctx->tasks) {
-   set_cpus_allowed(current, *cpumask_of(ctx->cpu));
+   set_cpus_allowed_ptr(current, cpumask_of(ctx->cpu));
 
for (i = 0; i < ctx->next_index; i++) {
struct rtswitch_task *task = >tasks[i];


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


[Xenomai-git] Philippe Gerum : cobalt/powerpc: fpu: drop obsolete xnarch_save_fpu()

2016-09-11 Thread git repository hosting
Module: xenomai-3
Branch: next
Commit: 9a28f7c11241971aa7a3c2ebed43018bd2b44075
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=9a28f7c11241971aa7a3c2ebed43018bd2b44075

Author: Philippe Gerum 
Date:   Thu Sep  8 16:29:44 2016 +0200

cobalt/powerpc: fpu: drop obsolete xnarch_save_fpu()

---

 kernel/cobalt/arch/powerpc/include/asm/xenomai/thread.h |2 --
 kernel/cobalt/arch/powerpc/thread.c |6 +++---
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/kernel/cobalt/arch/powerpc/include/asm/xenomai/thread.h 
b/kernel/cobalt/arch/powerpc/include/asm/xenomai/thread.h
index 8d6be84..1de5cac 100644
--- a/kernel/cobalt/arch/powerpc/include/asm/xenomai/thread.h
+++ b/kernel/cobalt/arch/powerpc/include/asm/xenomai/thread.h
@@ -93,8 +93,6 @@ static inline int xnarch_escalate(void)
 
 void xnarch_switch_to(struct xnthread *out, struct xnthread *in);
 
-void xnarch_save_fpu(struct xnthread *thread);
-
 void xnarch_switch_fpu(struct xnthread *from, struct xnthread *thread);
 
 #endif /* !_COBALT_POWERPC_ASM_THREAD_H */
diff --git a/kernel/cobalt/arch/powerpc/thread.c 
b/kernel/cobalt/arch/powerpc/thread.c
index 2a61d50..e3be67f 100644
--- a/kernel/cobalt/arch/powerpc/thread.c
+++ b/kernel/cobalt/arch/powerpc/thread.c
@@ -92,7 +92,7 @@ static void xnarch_enable_fpu(struct xnthread *thread)
__asm_enable_fpu();
 }
 
-void xnarch_save_fpu(struct xnthread *thread)
+static void do_save_fpu(struct xnthread *thread)
 {
struct xnarchtcb *tcb = xnthread_archtcb(thread);
 
@@ -145,7 +145,7 @@ void xnarch_switch_fpu(struct xnthread *from, struct 
xnthread *to)
}

if (from)
-   xnarch_save_fpu(from);
+   do_save_fpu(from);

xnarch_restore_fpu(to);
 }
@@ -154,7 +154,7 @@ void xnarch_leave_root(struct xnthread *root)
 {
struct xnarchtcb *rootcb = xnthread_archtcb(root);
rootcb->core.user_fpu_owner = get_fpu_owner(rootcb->core.host_task);
-   /* So that xnarch_save_fpu() will operate on the right FPU area. */
+   /* So that do_save_fpu() operates on the right FPU area. */
rootcb->fpup = rootcb->core.user_fpu_owner ?
>core.user_fpu_owner->thread : NULL;
 }


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


[Xenomai-git] Philippe Gerum : drivers/ipc: fix potential race in select()

2016-09-11 Thread git repository hosting
Module: xenomai-3
Branch: next
Commit: 3a89017b103b8b58ed579bebe397106ac7c60885
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=3a89017b103b8b58ed579bebe397106ac7c60885

Author: Philippe Gerum 
Date:   Tue Sep  6 09:40:34 2016 +0200

drivers/ipc: fix potential race in select()

Acquiring the poll state and binding the selector must be done
atomically, so that such state does not change before xnselect_bind()
decides whether the caller should wait.

---

 kernel/drivers/ipc/bufp.c  |7 +--
 kernel/drivers/ipc/iddp.c  |7 +--
 kernel/drivers/ipc/rtipc.c |   26 +-
 kernel/drivers/ipc/xddp.c  |7 +--
 4 files changed, 16 insertions(+), 31 deletions(-)

diff --git a/kernel/drivers/ipc/bufp.c b/kernel/drivers/ipc/bufp.c
index f129eaa..2e7f5ad 100644
--- a/kernel/drivers/ipc/bufp.c
+++ b/kernel/drivers/ipc/bufp.c
@@ -1043,15 +1043,12 @@ static int bufp_ioctl(struct rtdm_fd *fd,
return ret;
 }
 
-static unsigned int bufp_pollstate(struct rtdm_fd *fd)
+static unsigned int bufp_pollstate(struct rtdm_fd *fd) /* atomic */
 {
struct rtipc_private *priv = rtdm_fd_to_private(fd);
struct bufp_socket *sk = priv->state, *rsk;
unsigned int mask = 0;
struct rtdm_fd *rfd;
-   spl_t s;
-
-   cobalt_atomic_enter(s);
 
if (test_bit(_BUFP_BOUND, >status) && sk->fillsz > 0)
mask |= POLLIN;
@@ -1072,8 +1069,6 @@ static unsigned int bufp_pollstate(struct rtdm_fd *fd)
} else
mask |= POLLOUT;
 
-   cobalt_atomic_leave(s);
-
return mask;
 }
 
diff --git a/kernel/drivers/ipc/iddp.c b/kernel/drivers/ipc/iddp.c
index 028e40a..6d3da57 100644
--- a/kernel/drivers/ipc/iddp.c
+++ b/kernel/drivers/ipc/iddp.c
@@ -935,15 +935,12 @@ static void iddp_exit(void)
xnmap_delete(portmap);
 }
 
-static unsigned int iddp_pollstate(struct rtdm_fd *fd)
+static unsigned int iddp_pollstate(struct rtdm_fd *fd) /* atomic */
 {
struct rtipc_private *priv = rtdm_fd_to_private(fd);
struct iddp_socket *sk = priv->state;
unsigned int mask = 0;
struct rtdm_fd *rfd;
-   spl_t s;
-
-   cobalt_atomic_enter(s);
 
if (test_bit(_IDDP_BOUND, >status) && !list_empty(>inq))
mask |= POLLIN;
@@ -966,8 +963,6 @@ static unsigned int iddp_pollstate(struct rtdm_fd *fd)
} else
mask |= POLLOUT;
 
-   cobalt_atomic_leave(s);
-
return mask;
 }
 
diff --git a/kernel/drivers/ipc/rtipc.c b/kernel/drivers/ipc/rtipc.c
index 77fc7dd..7bd4950 100644
--- a/kernel/drivers/ipc/rtipc.c
+++ b/kernel/drivers/ipc/rtipc.c
@@ -481,28 +481,28 @@ static int rtipc_select(struct rtdm_fd *fd, struct 
xnselector *selector,
spl_t s;
int ret;

+   if (type != XNSELECT_READ && type != XNSELECT_WRITE)
+   return -EINVAL;
+
+   binding = xnmalloc(sizeof(*binding));
+   if (binding == NULL)
+   return -ENOMEM;
+
+   cobalt_atomic_enter(s);
+
pollstate = priv->proto->proto_ops.pollstate(fd);
 
-   switch (type) {
-   case XNSELECT_READ:
+   if (type == XNSELECT_READ) {
mask = pollstate & POLLIN;
block = >recv_block;
-   break;
-   case XNSELECT_WRITE:
+   } else {
mask = pollstate & POLLOUT;
block = >send_block;
-   break;
-   default:
-   return -EINVAL;
}
 
-   binding = xnmalloc(sizeof(*binding));
-   if (binding == NULL)
-   return -ENOMEM;
-
-   xnlock_get_irqsave(, s);
ret = xnselect_bind(block, binding, selector, type, index, mask);
-   xnlock_put_irqrestore(, s);
+
+   cobalt_atomic_leave(s);
 
if (ret)
xnfree(binding);
diff --git a/kernel/drivers/ipc/xddp.c b/kernel/drivers/ipc/xddp.c
index c91aa02..c48b935 100644
--- a/kernel/drivers/ipc/xddp.c
+++ b/kernel/drivers/ipc/xddp.c
@@ -1081,15 +1081,12 @@ static int xddp_ioctl(struct rtdm_fd *fd,
return ret;
 }
 
-static unsigned int xddp_pollstate(struct rtdm_fd *fd)
+static unsigned int xddp_pollstate(struct rtdm_fd *fd) /* atomic */
 {
struct rtipc_private *priv = rtdm_fd_to_private(fd);
struct xddp_socket *sk = priv->state, *rsk;
unsigned int mask = 0, pollstate;
struct rtdm_fd *rfd;
-   spl_t s;
-
-   cobalt_atomic_enter(s);
 
pollstate = __xnpipe_pollstate(sk->minor);
if (test_bit(_XDDP_BOUND, >status))
@@ -1110,8 +1107,6 @@ static unsigned int xddp_pollstate(struct rtdm_fd *fd)
} else
mask |= POLLOUT;
 
-   cobalt_atomic_leave(s);
-
return mask;
 }
 


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