[Xenomai-git] Philippe Gerum : lib/cobalt: fix build with --enable-debug=full

2013-07-08 Thread git repository hosting
Module: xenomai-forge
Branch: next
Commit: 955d14398cb64fd328b5fe54423b4eafa69cc4f9
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=955d14398cb64fd328b5fe54423b4eafa69cc4f9

Author: Philippe Gerum r...@xenomai.org
Date:   Mon Jul  8 15:20:25 2013 +0200

lib/cobalt: fix build with --enable-debug=full

---

 lib/cobalt/wrappers.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/lib/cobalt/wrappers.c b/lib/cobalt/wrappers.c
index d322068..2bc1694 100644
--- a/lib/cobalt/wrappers.c
+++ b/lib/cobalt/wrappers.c
@@ -30,6 +30,7 @@
 #include sys/time.h
 #include stdio.h
 #include stdarg.h
+#include stdlib.h
 #include signal.h
 #include syslog.h
 #include pthread.h


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


[Xenomai-git] Philippe Gerum : cobalt/blackfin: add calibration data for bf60x

2013-07-08 Thread git repository hosting
Module: xenomai-forge
Branch: master
Commit: 4a200b0746e2c3c0edd8296327647e6cb280923a
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=4a200b0746e2c3c0edd8296327647e6cb280923a

Author: Philippe Gerum r...@xenomai.org
Date:   Sun Jun 23 22:03:01 2013 +0200

cobalt/blackfin: add calibration data for bf60x

---

 include/cobalt/asm-blackfin/calibration.h |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/include/cobalt/asm-blackfin/calibration.h 
b/include/cobalt/asm-blackfin/calibration.h
index beebb3c..6167ad5 100644
--- a/include/cobalt/asm-blackfin/calibration.h
+++ b/include/cobalt/asm-blackfin/calibration.h
@@ -36,12 +36,16 @@ static inline unsigned long xnarch_get_sched_latency (void)
 #define __sched_latency 5000
 #elif defined(CONFIG_BF561)
 #define __sched_latency 4500
+#elif defined(CONFIG_BF609)
+#define __sched_latency 5500
 #elif defined(CONFIG_BF54x)
 #define __sched_latency 5000
 #elif defined(CONFIG_BF52x)
 #define __sched_latency 7000
 #elif defined(CONFIG_BF51x)
 #define __sched_latency 6000
+#elif defined(CONFIG_BF60x)
+#define __sched_latency 5500
 #else
 #error unsupported Blackfin processor
 #endif


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


[Xenomai-git] Philippe Gerum : include/asm-generic/features.h: drop useless indirection file

2013-07-08 Thread git repository hosting
Module: xenomai-forge
Branch: master
Commit: d8966401a46b9f05c00cc21fde876e12e7855d72
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=d8966401a46b9f05c00cc21fde876e12e7855d72

Author: Philippe Gerum r...@xenomai.org
Date:   Thu Jul  4 09:51:08 2013 +0200

include/asm-generic/features.h: drop useless indirection file

---

 include/cobalt/asm-arm/features.h   |4 ++-
 include/cobalt/asm-arm/uapi/features.h  |2 +
 include/cobalt/asm-blackfin/features.h  |4 ++-
 include/cobalt/asm-blackfin/uapi/features.h |4 ++-
 include/cobalt/asm-generic/Makefile.am  |1 -
 include/cobalt/asm-generic/Makefile.in  |1 -
 include/cobalt/asm-generic/features.h   |   28 ---
 include/cobalt/asm-generic/uapi/features.h  |2 -
 include/cobalt/asm-nios2/features.h |5 +--
 include/cobalt/asm-nios2/uapi/features.h|   10 +++-
 include/cobalt/asm-powerpc/features.h   |4 ++-
 include/cobalt/asm-powerpc/uapi/features.h  |2 +
 include/cobalt/asm-sh/features.h|5 +--
 include/cobalt/asm-sh/uapi/features.h   |   10 +++-
 include/cobalt/asm-x86/features.h   |4 ++-
 include/cobalt/asm-x86/uapi/features.h  |2 +
 16 files changed, 33 insertions(+), 55 deletions(-)

diff --git a/include/cobalt/asm-arm/features.h 
b/include/cobalt/asm-arm/features.h
index a95f293..127f927 100644
--- a/include/cobalt/asm-arm/features.h
+++ b/include/cobalt/asm-arm/features.h
@@ -26,7 +26,9 @@
 #define CONFIG_XENO_ARM_EABI 1
 #endif
 
+struct xnfeatinfo;
+static inline void collect_arch_features(struct xnfeatinfo *p) { }
+
 #include asm/xenomai/uapi/features.h
-#include asm-generic/xenomai/features.h
 
 #endif /* !_COBALT_ASM_ARM_FEATURES_H */
diff --git a/include/cobalt/asm-arm/uapi/features.h 
b/include/cobalt/asm-arm/uapi/features.h
index b1af2cd..686ee93 100644
--- a/include/cobalt/asm-arm/uapi/features.h
+++ b/include/cobalt/asm-arm/uapi/features.h
@@ -38,6 +38,8 @@
 #define XNARCH_HAVE_LLMULSHFT1
 #define XNARCH_HAVE_NODIV_LLIMD  1
 
+struct xnfeatinfo_archdep { /* no arch-specific feature */ };
+
 #include asm-generic/xenomai/uapi/features.h
 
 static inline const char *get_feature_label(unsigned int feature)
diff --git a/include/cobalt/asm-blackfin/features.h 
b/include/cobalt/asm-blackfin/features.h
index 370005d..8bcdda1 100644
--- a/include/cobalt/asm-blackfin/features.h
+++ b/include/cobalt/asm-blackfin/features.h
@@ -19,7 +19,9 @@
 #ifndef _COBALT_ASM_BLACKFIN_FEATURES_H
 #define _COBALT_ASM_BLACKFIN_FEATURES_H
 
+struct xnfeatinfo;
+static inline void collect_arch_features(struct xnfeatinfo *p) { }
+
 #include asm/xenomai/uapi/features.h
-#include asm-generic/xenomai/features.h
 
 #endif /* !_COBALT_ASM_BLACKFIN_FEATURES_H */
diff --git a/include/cobalt/asm-blackfin/uapi/features.h 
b/include/cobalt/asm-blackfin/uapi/features.h
index 9436371..8f5e5d3 100644
--- a/include/cobalt/asm-blackfin/uapi/features.h
+++ b/include/cobalt/asm-blackfin/uapi/features.h
@@ -28,7 +28,9 @@
 #define XNARCH_HAVE_LLMULSHFT1
 #define XNARCH_HAVE_NODIV_LLIMD  1
 
-#include asm-generic/xenomai/features.h
+struct xnfeatinfo_archdep { /* no arch-specific feature */ };
+
+#include asm-generic/xenomai/uapi/features.h
 
 static inline const char *get_feature_label(unsigned int feature)
 {
diff --git a/include/cobalt/asm-generic/Makefile.am 
b/include/cobalt/asm-generic/Makefile.am
index ab80c4f..913c7a7 100644
--- a/include/cobalt/asm-generic/Makefile.am
+++ b/include/cobalt/asm-generic/Makefile.am
@@ -1,7 +1,6 @@
 includesubdir = $(includedir)/asm-generic
 
 includesub_HEADERS =   \
-   features.h  \
machine.h   \
mayday.h\
pci_ids.h   \
diff --git a/include/cobalt/asm-generic/Makefile.in 
b/include/cobalt/asm-generic/Makefile.in
index 0f3aed5..5ec533d 100644
--- a/include/cobalt/asm-generic/Makefile.in
+++ b/include/cobalt/asm-generic/Makefile.in
@@ -312,7 +312,6 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 includesubdir = $(includedir)/asm-generic
 includesub_HEADERS = \
-   features.h  \
machine.h   \
mayday.h\
pci_ids.h   \
diff --git a/include/cobalt/asm-generic/features.h 
b/include/cobalt/asm-generic/features.h
deleted file mode 100644
index 983c735..000
--- a/include/cobalt/asm-generic/features.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (C) 2005 Philippe Gerum r...@xenomai.org.
- *
- *   This program is free software; you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139,
- *   USA; either version 2 of the License, or (at your option) any later
- *   version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A 

[Xenomai-git] Philippe Gerum : include: fixup irregular headers

2013-07-08 Thread git repository hosting
Module: xenomai-forge
Branch: master
Commit: d93c065c6c5cc13496eeef9aa7c14c80daec47c2
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=d93c065c6c5cc13496eeef9aa7c14c80daec47c2

Author: Philippe Gerum r...@xenomai.org
Date:   Thu Jul  4 10:26:30 2013 +0200

include: fixup irregular headers

---

 include/cobalt/asm-arm/calibration.h   |5 +-
 include/cobalt/asm-arm/features.h  |4 +
 include/cobalt/asm-arm/fptest.h|   18 
 include/cobalt/asm-arm/machine.h   |1 -
 include/cobalt/asm-arm/syscall.h   |4 +
 include/cobalt/asm-arm/thread.h|5 +-
 include/cobalt/asm-arm/uapi/tsc.h  |1 -
 include/cobalt/asm-arm/wrappers.h  |1 -
 include/cobalt/asm-blackfin/calibration.h  |5 +-
 include/cobalt/asm-blackfin/features.h |4 +
 include/cobalt/asm-blackfin/fptest.h   |   18 
 include/cobalt/asm-blackfin/machine.h  |5 +-
 include/cobalt/asm-blackfin/syscall.h  |5 +-
 include/cobalt/asm-blackfin/thread.h   |5 +-
 include/cobalt/asm-blackfin/uapi/arith.h   |   24 +++---
 include/cobalt/asm-blackfin/wrappers.h |1 -
 include/cobalt/asm-generic/ipipe/thread_info.h |2 +-
 include/cobalt/asm-generic/machine.h   |3 +-
 include/cobalt/asm-generic/mayday.h|5 +-
 include/cobalt/asm-generic/pci_ids.h   |   18 
 include/cobalt/asm-generic/syscall.h   |5 +-
 include/cobalt/asm-generic/thread.h|1 -
 include/cobalt/asm-generic/wrappers.h  |3 -
 include/cobalt/asm-nios2/calibration.h |5 +-
 include/cobalt/asm-nios2/features.h|4 +
 include/cobalt/asm-nios2/fptest.h  |   18 
 include/cobalt/asm-nios2/machine.h |1 -
 include/cobalt/asm-nios2/syscall.h |5 +-
 include/cobalt/asm-nios2/thread.h  |5 +-
 include/cobalt/asm-nios2/uapi/arith.h  |   24 +++---
 include/cobalt/asm-nios2/wrappers.h|1 -
 include/cobalt/asm-powerpc/calibration.h   |5 +-
 include/cobalt/asm-powerpc/features.h  |4 +
 include/cobalt/asm-powerpc/fptest.h|   18 
 include/cobalt/asm-powerpc/machine.h   |9 +-
 include/cobalt/asm-powerpc/syscall.h   |5 +-
 include/cobalt/asm-powerpc/thread.h|5 +-
 include/cobalt/asm-powerpc/uapi/features.h |1 -
 include/cobalt/asm-powerpc/wrappers.h  |1 -
 include/cobalt/asm-sh/calibration.h|7 +-
 include/cobalt/asm-sh/features.h   |4 +
 include/cobalt/asm-sh/fptest.h |   18 
 include/cobalt/asm-sh/machine.h|1 -
 include/cobalt/asm-sh/switch.h |  105 
 include/cobalt/asm-sh/syscall.h|4 +
 include/cobalt/asm-sh/thread.h |5 +-
 include/cobalt/asm-sh/uapi/arith.h |   23 +++---
 include/cobalt/asm-sh/uapi/features.h  |1 -
 include/cobalt/asm-sh/wrappers.h   |1 -
 include/cobalt/asm-x86/calibration.h   |5 +-
 include/cobalt/asm-x86/features.h  |4 +
 include/cobalt/asm-x86/fptest.h|   18 
 include/cobalt/asm-x86/machine.h   |1 -
 include/cobalt/asm-x86/smi.h   |3 +-
 include/cobalt/asm-x86/switch.h|5 -
 include/cobalt/asm-x86/syscall.h   |4 +
 include/cobalt/asm-x86/thread.h|5 +-
 include/cobalt/asm-x86/uapi/arith.h|   27 +++
 include/cobalt/asm-x86/wrappers.h  |1 -
 include/cobalt/kernel/arith.h  |2 +-
 include/cobalt/kernel/registry.h   |2 +-
 include/cobalt/kernel/vfile.h  |2 +-
 include/cobalt/uapi/rtdm/syscall.h |   22 +++---
 include/rtdm/rtipc.h   |2 +-
 include/version.h  |   24 +++---
 65 files changed, 313 insertions(+), 237 deletions(-)

diff --git a/include/cobalt/asm-arm/calibration.h 
b/include/cobalt/asm-arm/calibration.h
index 121ebf4..78a4331 100644
--- a/include/cobalt/asm-arm/calibration.h
+++ b/include/cobalt/asm-arm/calibration.h
@@ -19,10 +19,13 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  * 02111-1307, USA.
  */
-
 #ifndef _COBALT_ASM_ARM_CALIBRATION_H
 #define _COBALT_ASM_ARM_CALIBRATION_H
 
+#ifndef __KERNEL__
+#error Pure kernel header included from user-space!
+#endif
+
 #if LINUX_VERSION_CODE = KERNEL_VERSION(3,8,0)
 extern unsigned omap_rev(void);
 #define cpu_is_omap44xx() ((omap_rev()  0xff) == 0x44)
diff --git a/include/cobalt/asm-arm/features.h 
b/include/cobalt/asm-arm/features.h
index 127f927..da6fc64 100644
--- a/include/cobalt/asm-arm/features.h
+++ b/include/cobalt/asm-arm/features.h
@@ -22,6 +22,10 

[Xenomai-git] Philippe Gerum : cobalt/kernel/timer: fix assertion family

2013-07-08 Thread git repository hosting
Module: xenomai-forge
Branch: master
Commit: e6700706414f137202f9832d0cfda8c436f9b209
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=e6700706414f137202f9832d0cfda8c436f9b209

Author: Philippe Gerum r...@xenomai.org
Date:   Sat Jun 22 18:29:47 2013 +0200

cobalt/kernel/timer: fix assertion family

---

 include/cobalt/kernel/bheap.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/cobalt/kernel/bheap.h b/include/cobalt/kernel/bheap.h
index cd8cd08..42dff9a 100644
--- a/include/cobalt/kernel/bheap.h
+++ b/include/cobalt/kernel/bheap.h
@@ -64,7 +64,7 @@ static inline int bheap_ordered(bheap_t *heap)
 }
 
 #define BHEAP_CHECK(heap)  \
-   XENO_BUGON(QUEUES, ((heap)-sz == 0) || !bheap_ordered(heap))
+   XENO_BUGON(TIMERS, ((heap)-sz == 0) || !bheap_ordered(heap))
 
 #define bheap_gethead(heap)\
({  \


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


[Xenomai-git] Philippe Gerum : copperplate/clockobj: disable low resolution clock by default

2013-07-08 Thread git repository hosting
Module: xenomai-forge
Branch: master
Commit: 695b7224f2eeb0b17c60425db71a8a746b735070
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=695b7224f2eeb0b17c60425db71a8a746b735070

Author: Philippe Gerum r...@xenomai.org
Date:   Sat Jun 22 15:21:04 2013 +0200

copperplate/clockobj: disable low resolution clock by default

Switch default setting to the most frequent use case. People running
tick-based RTOS emulators (e.g. psos, vxworks) have to turn it on
explicitly using --enable-lores-clock.

---

 configure  |2 +-
 configure.in   |4 ++--
 lib/copperplate/clockobj.c |2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/configure b/configure
index a8aa220..67e5646 100755
--- a/configure
+++ b/configure
@@ -12690,7 +12690,7 @@ $as_echo #define CONFIG_XENO_DEBUG_FULL 1 confdefs.h
 
 
 
-lores_clock=y
+unset lores_clock
 { $as_echo $as_me:${as_lineno-$LINENO}: checking whether to enable the low 
resolution clock 5
 $as_echo_n checking whether to enable the low resolution clock...  6; }
 # Check whether --enable-lores-clock was given.
diff --git a/configure.in b/configure.in
index b14fae5..816af87 100644
--- a/configure.in
+++ b/configure.in
@@ -170,9 +170,9 @@ test \! x$debug_mode = x  
AC_DEFINE(CONFIG_XENO_DEBUG,1,[config])
 AM_CONDITIONAL(XENO_DEBUG_FULL,[test x$debug_mode = xfull])
 test x$debug_mode = xfull  AC_DEFINE(CONFIG_XENO_DEBUG_FULL,1,[config])
 
-dnl Low resolution clock (default: on)
+dnl Low resolution clock (default: off)
 
-lores_clock=y
+unset lores_clock
 AC_MSG_CHECKING(whether to enable the low resolution clock)
 AC_ARG_ENABLE(lores-clock,
AS_HELP_STRING([--enable-lores-clock], [Enable low resolution clock]),
diff --git a/lib/copperplate/clockobj.c b/lib/copperplate/clockobj.c
index 52ecb6c..a2ed56e 100644
--- a/lib/copperplate/clockobj.c
+++ b/lib/copperplate/clockobj.c
@@ -92,7 +92,7 @@ int __clockobj_set_resolution(struct clockobj *clkobj,
  unsigned int resolution_ns)
 {
if (resolution_ns  1) {
-   warning(support for low resolution clock disabled);
+   warning(low resolution clock disabled [--enable-lores-clock]);
return __bt(-EINVAL);
}
 


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


[Xenomai-git] Philippe Gerum : include/asm-generic/stack.h: stack-related helpers belong to userland

2013-07-08 Thread git repository hosting
Module: xenomai-forge
Branch: master
Commit: a2ea259396c85cefd7aca10759f8b50530ba7613
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=a2ea259396c85cefd7aca10759f8b50530ba7613

Author: Philippe Gerum r...@xenomai.org
Date:   Wed Jul  3 16:09:33 2013 +0200

include/asm-generic/stack.h: stack-related helpers belong to userland

---

 include/cobalt/asm-generic/Makefile.am |1 -
 include/cobalt/asm-generic/Makefile.in |1 -
 include/cobalt/asm-generic/stack.h |   34 
 lib/cobalt/init.c  |   15 ++---
 lib/cobalt/internal.c  |   18 
 lib/cobalt/internal.h  |5 +++-
 lib/cobalt/printf.c|1 -
 lib/cobalt/thread.c|   13 +--
 testsuite/cyclic/cyclictest.c  |2 +-
 testsuite/switchtest/Makefile.am   |6 ++--
 testsuite/switchtest/Makefile.in   |4 +-
 testsuite/switchtest/switchtest.c  |   13 ++-
 testsuite/unit/cond-torture.c  |4 +-
 testsuite/unit/mutex-torture.c |8 ++
 testsuite/unit/sched-tp.c  |3 +-
 15 files changed, 51 insertions(+), 77 deletions(-)

diff --git a/include/cobalt/asm-generic/Makefile.am 
b/include/cobalt/asm-generic/Makefile.am
index cff1c94..4a57452 100644
--- a/include/cobalt/asm-generic/Makefile.am
+++ b/include/cobalt/asm-generic/Makefile.am
@@ -6,7 +6,6 @@ includesub_HEADERS =\
machine.h   \
mayday.h\
pci_ids.h   \
-   stack.h \
syscall.h   \
thread.h\
wrappers.h
diff --git a/include/cobalt/asm-generic/Makefile.in 
b/include/cobalt/asm-generic/Makefile.in
index 7655bb6..2fdc584 100644
--- a/include/cobalt/asm-generic/Makefile.in
+++ b/include/cobalt/asm-generic/Makefile.in
@@ -317,7 +317,6 @@ includesub_HEADERS = \
machine.h   \
mayday.h\
pci_ids.h   \
-   stack.h \
syscall.h   \
thread.h\
wrappers.h
diff --git a/include/cobalt/asm-generic/stack.h 
b/include/cobalt/asm-generic/stack.h
deleted file mode 100644
index f863df6..000
--- a/include/cobalt/asm-generic/stack.h
+++ /dev/null
@@ -1,34 +0,0 @@
-#ifndef STACKSIZE_H
-#define STACKSIZE_H
-
-#include stdint.h
-#include limits.h
-#include unistd.h
-#include pthread.h
-
-#ifdef __cplusplus
-extern C {
-#endif /* __cplusplus */
-
-static inline unsigned cobalt_get_stacksize(unsigned size)
-{
-   static const unsigned default_size = __WORDSIZE * 1024;
-   static unsigned min_size;
-   if (!min_size)
-   min_size = PTHREAD_STACK_MIN + getpagesize();
-
-   if (!size)
-   size = default_size;
-   if (size  min_size)
-   size = min_size;
-
-   return size;
-}
-
-void cobalt_prefault_stack(void);
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* STACKSIZE_H */
diff --git a/lib/cobalt/init.c b/lib/cobalt/init.c
index 66c075d..f13f7e7 100644
--- a/lib/cobalt/init.c
+++ b/lib/cobalt/init.c
@@ -25,7 +25,6 @@
 #include signal.h
 #include limits.h
 #include unistd.h
-#include asm-generic/xenomai/stack.h
 #include cobalt/uapi/sys/heap.h
 #include cobalt/uapi/rtdm/syscall.h
 #include cobalt/ticks.h
@@ -38,14 +37,14 @@ int __cobalt_muxid = -1;
 
 struct sigaction __cobalt_orig_sigdebug;
 
+pthread_t __cobalt_main_tid;
+
 int __rtdm_muxid = -1;
 
 int __rtdm_fd_start = INT_MAX;
 
 static int fork_handler_registered;
 
-static pthread_t main_tid;
-
 static void sigill_handler(int sig)
 {
const char m[] = Xenomai disabled in kernel?\n;
@@ -53,14 +52,6 @@ static void sigill_handler(int sig)
exit(EXIT_FAILURE);
 }
 
-void cobalt_prefault_stack(void)
-{
-   if (pthread_self() == main_tid) {
-   char stk[cobalt_get_stacksize(1)];
-   stk[0] = stk[sizeof(stk) - 1] = 0xA5;
-   }
-}
-
 static int bind_interface(void)
 {
sighandler_t old_sigill_handler;
@@ -124,7 +115,7 @@ static int bind_interface(void)
 
cobalt_init_current_keys();
 
-   main_tid = pthread_self();
+   __cobalt_main_tid = pthread_self();
 
cobalt_ticks_init(sysinfo.clockfreq);
 
diff --git a/lib/cobalt/internal.c b/lib/cobalt/internal.c
index c9b1bdd..5b2513f 100644
--- a/lib/cobalt/internal.c
+++ b/lib/cobalt/internal.c
@@ -23,6 +23,7 @@
 #include sys/types.h
 #include stddef.h
 #include stdlib.h
+#include limits.h
 #include stdio.h
 #include unistd.h
 #include signal.h
@@ -59,6 +60,23 @@ void ___cobalt_prefault(void *p, size_t len)
} while (_p  end);
 }
 
+size_t cobalt_get_stacksize(size_t size)
+{
+   static const size_t default_size = PTHREAD_STACK_MIN * 4;
+   static size_t min_size;
+
+   if (min_size == 0)
+   min_size = PTHREAD_STACK_MIN + getpagesize();
+
+   if (size == 0)
+   size = default_size;
+
+   if (size  min_size)
+   

[Xenomai-git] Philippe Gerum : cobalt/arm: drop prev arg in __asm_thread_switch()

2013-07-08 Thread git repository hosting
Module: xenomai-forge
Branch: master
Commit: 7ca0c5f2054915c9fba903056f85cc13570f1f71
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=7ca0c5f2054915c9fba903056f85cc13570f1f71

Author: Philippe Gerum r...@xenomai.org
Date:   Sat Jun 29 16:53:09 2013 +0200

cobalt/arm: drop prev arg in __asm_thread_switch()

---

 kernel/cobalt/arch/arm/switch.S |   12 ++--
 kernel/cobalt/arch/arm/thread.c |5 ++---
 2 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/kernel/cobalt/arch/arm/switch.S b/kernel/cobalt/arch/arm/switch.S
index 8c88cee..969b28d 100644
--- a/kernel/cobalt/arch/arm/switch.S
+++ b/kernel/cobalt/arch/arm/switch.S
@@ -137,17 +137,17 @@ ENDPROC(__asm_vfp_load)
  *  CONFIG_IWMMXT
  *
  *  Calling args:
- * r0 = previous task_struct, r1 = previous thread_info, r2 = next thread_info
+ * r0 = previous thread_info, r1 = next thread_info
  */
 ENTRY(__asm_thread_switch)
-   add ip, r1, #TI_CPU_SAVE
-   ldr r3, [r2, #TI_TP_VALUE]
+   add ip, r0, #TI_CPU_SAVE
+   ldr r3, [r1, #TI_TP_VALUE]
  ARM(  stmia   ip!, {r4 - sl, fp, sp, lr} )@ Store most regs on stack
  THUMB(stmia   ip!, {r4 - sl, fp} )@ Store most regs on 
stack
  THUMB(str sp, [ip], #4   )
  THUMB(str lr, [ip], #4   )
 #ifdef USE_DOMAINS
-   ldr r6, [r2, #TI_CPU_DOMAIN]
+   ldr r6, [r1, #TI_CPU_DOMAIN]
 #endif
clear_exclusive_monitor
set_tls r3, r4, r5
@@ -155,9 +155,9 @@ ENTRY(__asm_thread_switch)
mcr p15, 0, r6, c3, c0, 0   @ Set domain register
 #endif
fpu_switch r4
- ARM(  add r4, r2, #TI_CPU_SAVE   )
+ ARM(  add r4, r1, #TI_CPU_SAVE   )
  ARM(  ldmia   r4, {r4 - sl, fp, sp, pc}  )@ Load all regs saved previously
- THUMB(add ip, r2, #TI_CPU_SAVE   )
+ THUMB(add ip, r1, #TI_CPU_SAVE   )
  THUMB(ldmia   ip!, {r4 - sl, fp} )@ Load all regs saved 
previously
  THUMB(ldr sp, [ip], #4   )
  THUMB(ldr pc, [ip]   )
diff --git a/kernel/cobalt/arch/arm/thread.c b/kernel/cobalt/arch/arm/thread.c
index 9c33f20..55313ab 100644
--- a/kernel/cobalt/arch/arm/thread.c
+++ b/kernel/cobalt/arch/arm/thread.c
@@ -26,8 +26,7 @@
 #include asm/mmu_context.h
 #include cobalt/kernel/thread.h
 
-asmlinkage void __asm_thread_switch(struct task_struct *prev,
-   struct thread_info *out,
+asmlinkage void __asm_thread_switch(struct thread_info *out,
struct thread_info *in);
 
 asmlinkage void __asm_thread_trampoline(void);
@@ -289,7 +288,7 @@ void xnarch_switch_to(struct xnarchtcb *out_tcb, struct 
xnarchtcb *in_tcb)
enter_lazy_tlb(prev_mm, next);
}
 
-   __asm_thread_switch(prev, out_tcb-core.tip, in_tcb-core.tip);
+   __asm_thread_switch(out_tcb-core.tip, in_tcb-core.tip);
 }
 
 void xnarch_enable_fpu(struct xnarchtcb *tcb)


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


[Xenomai-git] Philippe Gerum : cobalt/kernel: stop wrapping common memory barriers

2013-07-08 Thread git repository hosting
Module: xenomai-forge
Branch: master
Commit: d9493f51ea13c662002c8068eccfdf7132533e30
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=d9493f51ea13c662002c8068eccfdf7132533e30

Author: Philippe Gerum r...@xenomai.org
Date:   Tue Jun 25 09:39:27 2013 +0200

cobalt/kernel: stop wrapping common memory barriers

As the simulator build was dropped long ago, there is no point in
wrapping membars anymore. Use generic kernel memory barriers when
applicable.

---

 include/cobalt/asm-generic/atomic.h |   36 --
 include/cobalt/kernel/pod.h |7 +++--
 include/cobalt/kernel/seqlock.h |8 +++---
 include/cobalt/kernel/stat.h|2 +-
 kernel/cobalt/intr.c|6 ++--
 kernel/cobalt/pod.c |5 +--
 lib/cobalt/printf.c |8 +++---
 7 files changed, 35 insertions(+), 37 deletions(-)

diff --git a/include/cobalt/asm-generic/atomic.h 
b/include/cobalt/asm-generic/atomic.h
index aeeca83..7b44887 100644
--- a/include/cobalt/asm-generic/atomic.h
+++ b/include/cobalt/asm-generic/atomic.h
@@ -30,12 +30,10 @@ typedef unsigned long atomic_flags_t;
 #include asm/atomic.h
 #include asm/xenomai/wrappers.h
 
-#define xnarch_memory_barrier()smp_mb()
-#define xnarch_read_memory_barrier()rmb()
-#define xnarch_write_memory_barrier()   wmb()
-
-/* atomic_set_mask, atomic_clear_mask are not standard among linux
-   ports */
+/*
+ * atomic_set_mask, atomic_clear_mask may not be available from all
+ * linux ports.
+ */
 #ifndef xnarch_atomic_set_mask
 #define xnarch_atomic_set_mask(pflags,mask) atomic_set_mask((mask),(pflags))
 #endif
@@ -52,20 +50,8 @@ typedef struct {
unsigned long v;
 } atomic_long_t;
 
-#ifndef xnarch_memory_barrier
-#define xnarch_memory_barrier() __sync_synchronize()
-#endif
-
-#ifndef xnarch_read_memory_barrier
-#define xnarch_read_memory_barrier() xnarch_memory_barrier()
-#endif
-
-#ifndef xnarch_write_memory_barrier
-#define xnarch_write_memory_barrier() xnarch_memory_barrier()
-#endif
-
 #ifndef cpu_relax
-#define cpu_relax() xnarch_memory_barrier()
+#define cpu_relax() __sync_synchronize()
 #endif
 
 #ifndef atomic_long_read
@@ -83,6 +69,18 @@ typedef struct {
(typeof((p)-v))(n))
 #endif
 
+#ifndef smp_mb
+#define smp_mb() __sync_synchronize()
+#endif
+
+#ifndef smp_rmb
+#define smp_rmb() __sync_synchronize()
+#endif
+
+#ifndef smp_wmb
+#define smp_wmb() __sync_synchronize()
+#endif
+
 #endif /* !__KERNEL__ */
 
 #endif /* _COBALT_ASM_GENERIC_ATOMIC_H */
diff --git a/include/cobalt/kernel/pod.h b/include/cobalt/kernel/pod.h
index 2840d2d..c01cd8e 100644
--- a/include/cobalt/kernel/pod.h
+++ b/include/cobalt/kernel/pod.h
@@ -232,10 +232,11 @@ static inline void xnpod_schedule(void)
 * be either valid, or unused.
 */
sched = xnpod_current_sched();
+   smp_rmb();
/*
-* No immediate rescheduling is possible if an ISR or callout
-* context is active, or if we are caught in the middle of a
-* unlocked context switch.
+* No immediate rescheduling is possible if an ISR context is
+* active, or if we are caught in the middle of a unlocked
+* context switch.
 */
 #if XENO_DEBUG(NUCLEUS)
if (testbits(sched-status | sched-lflags,
diff --git a/include/cobalt/kernel/seqlock.h b/include/cobalt/kernel/seqlock.h
index 7732a8f..9abe1a3 100644
--- a/include/cobalt/kernel/seqlock.h
+++ b/include/cobalt/kernel/seqlock.h
@@ -19,7 +19,7 @@ static inline unsigned xnread_seqcount_begin(const 
xnseqcount_t *s)
 
 repeat:
ret = s-sequence;
-   xnarch_read_memory_barrier();
+   smp_rmb();
if (ret  1) {
cpu_relax();
goto repeat;
@@ -32,7 +32,7 @@ repeat:
  */
 static inline int xnread_seqcount_retry(const xnseqcount_t *s, unsigned start)
 {
-   xnarch_read_memory_barrier();
+   smp_rmb();
 
return s-sequence != start;
 }
@@ -45,12 +45,12 @@ static inline int xnread_seqcount_retry(const xnseqcount_t 
*s, unsigned start)
 static inline void xnwrite_seqcount_begin(xnseqcount_t *s)
 {
s-sequence++;
-   xnarch_write_memory_barrier();
+   smp_wmb();
 }
 
 static inline void xnwrite_seqcount_end(xnseqcount_t *s)
 {
-   xnarch_write_memory_barrier();
+   smp_wmb();
s-sequence++;
 }
 
diff --git a/include/cobalt/kernel/stat.h b/include/cobalt/kernel/stat.h
index c9a182f..df9f983 100644
--- a/include/cobalt/kernel/stat.h
+++ b/include/cobalt/kernel/stat.h
@@ -46,7 +46,7 @@ do { \
(sched)-last_account_switch = date; \
/* All changes must be committed before changing the current_account \
   reference in sched (required for xnintr_sync_stat_references) */ \
-   xnarch_memory_barrier(); \
+   smp_wmb(); \
 } while (0)
 
 /* Update the current account reference, returning the previous one. */
diff --git a/kernel/cobalt/intr.c 

[Xenomai-git] Philippe Gerum : cobalt/kernel: drop xnflags_t

2013-07-08 Thread git repository hosting
Module: xenomai-forge
Branch: master
Commit: 575c762adb98c7d23eebda96bf57d13cc840f17e
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=575c762adb98c7d23eebda96bf57d13cc840f17e

Author: Philippe Gerum r...@xenomai.org
Date:   Tue Jun 25 10:29:06 2013 +0200

cobalt/kernel: drop xnflags_t

This abstraction is overkill and logically wrong. What we want is two
mutually convertible types:

- a portable base type which is wide enough for representing a set of
  bitwise conditions/statuses. Therefore, this type still has to be
  32bit wide at most nowadays.

- another type which can be used with atomic operations on any
  platform, typically a long integer type.

We drop xnflags_t, replacing it with a basic int type in function
prototypes, or long integer type when atomic operations are involved
internally. At any rate, atomic operations will produce significant
results for us only for the first 32 LSBs of such word.

---

 include/cobalt/kernel/intr.h|4 ++--
 include/cobalt/kernel/pipe.h|2 +-
 include/cobalt/kernel/pod.h |   12 ++--
 include/cobalt/kernel/sched.h   |4 ++--
 include/cobalt/kernel/synch.h   |   18 +-
 include/cobalt/kernel/thread.h  |   10 +-
 include/cobalt/kernel/timer.h   |2 +-
 include/cobalt/kernel/types.h   |2 --
 kernel/cobalt/clock.c   |2 +-
 kernel/cobalt/intr.c|4 ++--
 kernel/cobalt/pipe.c|2 +-
 kernel/cobalt/pod.c |   25 -
 kernel/cobalt/posix/cond.c  |3 +--
 kernel/cobalt/posix/event.c |3 +--
 kernel/cobalt/posix/monitor.c   |6 ++
 kernel/cobalt/posix/mutex.c |2 +-
 kernel/cobalt/posix/sem.c   |3 +--
 kernel/cobalt/posix/thread.c|7 +++
 kernel/cobalt/registry.c|6 ++
 kernel/cobalt/sched.c   |4 ++--
 kernel/cobalt/synch.c   |   35 +++
 kernel/cobalt/thread.c  |   10 --
 kernel/drivers/testing/switchtest.c |2 +-
 23 files changed, 75 insertions(+), 93 deletions(-)

diff --git a/include/cobalt/kernel/intr.h b/include/cobalt/kernel/intr.h
index 7973f19..c58128c 100644
--- a/include/cobalt/kernel/intr.h
+++ b/include/cobalt/kernel/intr.h
@@ -56,7 +56,7 @@ typedef struct xnintr {
 
 void *cookie;  /* ! User-defined cookie value. */
 
-xnflags_t flags;   /* ! Creation flags. */
+int flags; /* ! Creation flags. */
 
 unsigned irq;  /* ! IRQ number. */
 
@@ -109,7 +109,7 @@ int xnintr_init(xnintr_t *intr,
unsigned irq,
xnisr_t isr,
xniack_t iack,
-   xnflags_t flags);
+   int flags);
 
 int xnintr_destroy(xnintr_t *intr);
 
diff --git a/include/cobalt/kernel/pipe.h b/include/cobalt/kernel/pipe.h
index 7976f7e..5415fa6 100644
--- a/include/cobalt/kernel/pipe.h
+++ b/include/cobalt/kernel/pipe.h
@@ -90,7 +90,7 @@ struct xnpipe_state {
void *xstate;   /* Extra state managed by caller */
 
/* Linux kernel part */
-   xnflags_t status;
+   unsigned long status;
struct fasync_struct *asyncq;
wait_queue_head_t readq;/* open/read/poll waiters */
wait_queue_head_t syncq;/* sync waiters */
diff --git a/include/cobalt/kernel/pod.h b/include/cobalt/kernel/pod.h
index c01cd8e..809930a 100644
--- a/include/cobalt/kernel/pod.h
+++ b/include/cobalt/kernel/pod.h
@@ -66,7 +66,7 @@ struct xnsynch;
  */
 
 struct xnpod {
-   xnflags_t status;   /*! Status bitmask. */
+   unsigned long status; /*! Status bitmask. */
xnsched_t sched[NR_CPUS];   /*! Per-cpu scheduler slots. */
struct list_head threadq;   /*! All existing threads. */
int nrthreads;
@@ -188,18 +188,18 @@ void xnpod_cancel_thread(xnthread_t *thread);
 
 void xnpod_join_thread(xnthread_t *thread);
 
-xnflags_t xnpod_set_thread_mode(xnthread_t *thread,
-   xnflags_t clrmask,
-   xnflags_t setmask);
+int xnpod_set_thread_mode(xnthread_t *thread,
+ int clrmask,
+ int setmask);
 
 void xnpod_suspend_thread(xnthread_t *thread,
- xnflags_t mask,
+ int mask,
  xnticks_t timeout,
  xntmode_t timeout_mode,
  struct xnsynch *wchan);
 
 void xnpod_resume_thread(xnthread_t *thread,
-xnflags_t mask);
+int mask);
 
 int xnpod_unblock_thread(xnthread_t *thread);
 
diff --git a/include/cobalt/kernel/sched.h b/include/cobalt/kernel/sched.h
index 0101131..aba9794 100644
--- a/include/cobalt/kernel/sched.h
+++ b/include/cobalt/kernel/sched.h
@@ -60,8 +60,8 @@ struct xnsched_rt {
 
 typedef struct xnsched {
 

[Xenomai-git] Philippe Gerum : cobalt/posix/thread: drop .fp support flag

2013-07-08 Thread git repository hosting
Module: xenomai-forge
Branch: master
Commit: 6cd3fe535e1b7a31f04d30aded489b5fab2fb125
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=6cd3fe535e1b7a31f04d30aded489b5fab2fb125

Author: Philippe Gerum r...@xenomai.org
Date:   Sat Jul  6 16:44:53 2013 +0200

cobalt/posix/thread: drop .fp support flag

FPU support is always available to Cobalt threads which are user-space
only.

---

 kernel/cobalt/posix/thread.c |   14 +++---
 kernel/cobalt/posix/thread.h |1 -
 2 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/kernel/cobalt/posix/thread.c b/kernel/cobalt/posix/thread.c
index 7ed80da..27641c1 100644
--- a/kernel/cobalt/posix/thread.c
+++ b/kernel/cobalt/posix/thread.c
@@ -45,7 +45,6 @@ static const pthread_attr_t default_thread_attr = {
.sched_priority = 0
},
.name = NULL,
-   .fp = 1,
.affinity = XNPOD_ALL_CPUS,
 };
 
@@ -345,9 +344,8 @@ static inline int pthread_create(pthread_t *tid, const 
pthread_attr_t *attr)
struct xnsched_class *sched_class;
union xnsched_policy_param param;
struct xnthread_init_attr iattr;
-   int prio, ret, pol, flags = 0;
pthread_t thread, cur;
-   const char *name;
+   int prio, ret, pol;
spl_t s;
 
if (attr  attr-magic != COBALT_THREAD_ATTR_MAGIC)
@@ -385,14 +383,9 @@ static inline int pthread_create(pthread_t *tid, const 
pthread_attr_t *attr)
prio = -prio;
pol = SCHED_WEAK;
}
-   name = thread-attr.name;
-   flags |= XNUSER;
 
-   if (thread-attr.fp)
-   flags |= XNFPU;
-
-   iattr.name = name;
-   iattr.flags = flags;
+   iattr.name = thread-attr.name;
+   iattr.flags = XNUSER|XNFPU;
iattr.personality = cobalt_personality;
 
/*
@@ -834,7 +827,6 @@ int cobalt_thread_create(unsigned long tid, int policy,
attr.policy = policy;
attr.detachstate = PTHREAD_CREATE_DETACHED;
attr.schedparam_ex = param;
-   attr.fp = 1;
attr.name = p-comm;
 
ret = pthread_create(pthread, attr);
diff --git a/kernel/cobalt/posix/thread.h b/kernel/cobalt/posix/thread.h
index b4963e8..791f694 100644
--- a/kernel/cobalt/posix/thread.h
+++ b/kernel/cobalt/posix/thread.h
@@ -55,7 +55,6 @@ typedef struct cobalt_threadattr {
/* Non portable */
struct sched_param_ex schedparam_ex;
char *name;
-   int fp;
cpumask_t affinity;
 
 } pthread_attr_t;


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


[Xenomai-git] Philippe Gerum : cobalt: formally disconnect user-space from kernel headers

2013-07-08 Thread git repository hosting
Module: xenomai-forge
Branch: master
Commit: 35e291db9ba97be1f19bcf576580f9062d2c9ea0
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=35e291db9ba97be1f19bcf576580f9062d2c9ea0

Author: Philippe Gerum r...@xenomai.org
Date:   Fri Jul  5 09:52:21 2013 +0200

cobalt: formally disconnect user-space from kernel headers

As a consequence of this change, only few low-level headers are still
part of the target installation. Others remain private to the kernel
and/or lib/cobalt.

---

 Makefile.in|4 +-
 config/Makefile.in |2 +-
 configure  |  111 +---
 configure.in   |   65 +-
 doc/Makefile.in|2 +-
 doc/asciidoc/Makefile.in   |2 +-
 doc/docbook/Makefile.in|2 +-
 doc/docbook/custom-stylesheets/Makefile.in |2 +-
 doc/docbook/custom-stylesheets/xsl/Makefile.in |2 +-
 .../custom-stylesheets/xsl/common/Makefile.in  |2 +-
 doc/docbook/custom-stylesheets/xsl/fo/Makefile.in  |2 +-
 .../custom-stylesheets/xsl/html/Makefile.in|2 +-
 doc/doxygen/Makefile.in|2 +-
 doc/man/Makefile.in|2 +-
 doc/txt/Makefile.in|2 +-
 include/Makefile.am|   21 -
 include/Makefile.in|   87 ++--
 include/alchemy/Makefile.in|2 +-
 include/analogy/Makefile.in|2 +-
 include/cobalt/Makefile.am |7 -
 include/cobalt/Makefile.in |9 +-
 include/cobalt/arith.h |2 +-
 include/cobalt/asm-arm/Makefile.am |   11 -
 include/cobalt/asm-arm/uapi/Makefile.am|8 -
 include/cobalt/asm-arm/uapi/Makefile.in|  562 ---
 include/cobalt/asm-blackfin/Makefile.am|   11 -
 include/cobalt/asm-blackfin/Makefile.in|  638 -
 include/cobalt/asm-blackfin/uapi/Makefile.am   |7 -
 include/cobalt/asm-generic/Makefile.am |   10 -
 include/cobalt/asm-generic/ipipe/Makefile.am   |3 -
 include/cobalt/asm-generic/uapi/Makefile.am|6 -
 include/cobalt/asm-nios2/Makefile.am   |9 -
 include/cobalt/asm-nios2/Makefile.in   |  510 --
 include/cobalt/asm-nios2/uapi/Makefile.am  |7 -
 include/cobalt/asm-powerpc/Makefile.am |   11 -
 include/cobalt/asm-powerpc/Makefile.in |  638 -
 include/cobalt/asm-powerpc/uapi/Makefile.am|7 -
 include/cobalt/asm-sh/Makefile.am  |   11 -
 include/cobalt/asm-sh/uapi/Makefile.am |7 -
 include/cobalt/asm-sh/uapi/Makefile.in |  561 ---
 include/cobalt/asm-x86/Makefile.am |   12 -
 include/cobalt/asm-x86/uapi/Makefile.am|7 -
 include/cobalt/asm-x86/uapi/Makefile.in|  561 ---
 include/cobalt/kernel/Makefile.am  |2 -
 include/cobalt/kernel/Makefile.in  |  208 ++-
 include/cobalt/kernel/clock.h  |2 +-
 include/cobalt/kernel/heap.h   |4 +-
 include/cobalt/kernel/thread.h |4 +-
 include/cobalt/kernel/trace.h  |2 +-
 include/cobalt/kernel/vdso.h   |2 +-
 include/cobalt/sys/Makefile.in |2 +-
 include/cobalt/ticks.h |2 +-
 include/cobalt/uapi/Makefile.am|2 +-
 include/cobalt/uapi/Makefile.in|4 +-
 include/cobalt/uapi/asm-generic/Makefile.am|5 +
 .../ipipe = uapi/asm-generic}/Makefile.in |   12 +-
 .../{asm-generic/uapi = uapi/asm-generic}/arith.h |6 +-
 .../uapi = uapi/asm-generic}/features.h   |6 +-
 .../uapi = uapi/asm-generic}/syscall.h|   26 +-
 .../{kernel/uapi = uapi/kernel}/Makefile.am   |2 +-
 .../{kernel/uapi = uapi/kernel}/Makefile.in   |   10 +-
 include/cobalt/{kernel/uapi = uapi/kernel}/heap.h |6 +-
 .../cobalt/{kernel/uapi = uapi/kernel}/synch.h|8 +-
 .../cobalt/{kernel/uapi = uapi/kernel}/thread.h   |8 +-
 .../cobalt/{kernel/uapi = uapi/kernel}/trace.h|6 +-
 .../cobalt/{kernel/uapi = uapi/kernel}/types.h|6 +-
 include/cobalt/{kernel/uapi = uapi/kernel}/urw.h  |6 +-
 include/cobalt/{kernel/uapi = uapi/kernel}/vdso.h |8 +-
 include/cobalt/uapi/rtdm/Makefile.in   |2 +-
 include/cobalt/uapi/signal.h   |   22 +
 include/cobalt/uapi/syscall.h  |2 +-
 include/cobalt/uapi/thread.h   

[Xenomai-git] Philippe Gerum : mercury/copperplate: remove duplicate cpu_relax() definition

2013-07-08 Thread git repository hosting
Module: xenomai-forge
Branch: master
Commit: 6fd3df8da70d2f97516bdd726628520d7f526593
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=6fd3df8da70d2f97516bdd726628520d7f526593

Author: Philippe Gerum r...@xenomai.org
Date:   Sat Jul  6 20:56:32 2013 +0200

mercury/copperplate: remove duplicate cpu_relax() definition

---

 include/mercury/core.h |2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/include/mercury/core.h b/include/mercury/core.h
index 95c7925..52f3c10 100644
--- a/include/mercury/core.h
+++ b/include/mercury/core.h
@@ -25,6 +25,4 @@
 /* Private signal used for unblocking from syscalls. */
 #define SIGRELS(SIGRTMIN + 9)
 
-#define cpu_relax()__sync_synchronize()
-
 #endif /* _MERCURY_CORE_H */


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


[Xenomai-git] Philippe Gerum : cobalt/kernel: introduce kernel/misc.h, drop kernel/types. h

2013-07-08 Thread git repository hosting
Module: xenomai-forge
Branch: master
Commit: 05c388be46e97f5fa017615c510a3f28385c1aa8
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=05c388be46e97f5fa017615c510a3f28385c1aa8

Author: Philippe Gerum r...@xenomai.org
Date:   Sat Jun 29 18:22:16 2013 +0200

cobalt/kernel: introduce kernel/misc.h, drop kernel/types.h

kernel/types.h used to be a kitchen-sink, and stopped making any sense
once actual type definitions have gone to uapi/sys/types.h.

kernel/misc.h is introduced to contain the few orphaned definitions
which don't fit in any existing header.

---

 include/cobalt/kernel/Makefile.am |1 -
 include/cobalt/kernel/Makefile.in |1 -
 include/cobalt/kernel/clock.h |1 +
 include/cobalt/kernel/heap.h  |   18 --
 include/cobalt/kernel/intr.h  |1 -
 include/cobalt/kernel/{types.h = misc.h} |   10 --
 include/cobalt/kernel/registry.h  |2 --
 include/cobalt/kernel/thread.h|1 -
 kernel/cobalt/intr.c  |1 +
 9 files changed, 14 insertions(+), 22 deletions(-)

diff --git a/include/cobalt/kernel/Makefile.am 
b/include/cobalt/kernel/Makefile.am
index 87eef94..540e02c 100644
--- a/include/cobalt/kernel/Makefile.am
+++ b/include/cobalt/kernel/Makefile.am
@@ -29,7 +29,6 @@ noinst_HEADERS =  \
thread.h\
timer.h \
trace.h \
-   types.h \
vdso.h  \
vfile.h
 
diff --git a/include/cobalt/kernel/Makefile.in 
b/include/cobalt/kernel/Makefile.in
index 3846e5c..9f11791 100644
--- a/include/cobalt/kernel/Makefile.in
+++ b/include/cobalt/kernel/Makefile.in
@@ -274,7 +274,6 @@ noinst_HEADERS = \
thread.h\
timer.h \
trace.h \
-   types.h \
vdso.h  \
vfile.h
 
diff --git a/include/cobalt/kernel/clock.h b/include/cobalt/kernel/clock.h
index c1f64ad..ae01bc6 100644
--- a/include/cobalt/kernel/clock.h
+++ b/include/cobalt/kernel/clock.h
@@ -28,6 +28,7 @@
 
 #include cobalt/kernel/list.h
 #include cobalt/kernel/vfile.h
+#include cobalt/uapi/sys/types.h
 #include asm-generic/xenomai/timeconv.h
 
 #define XNTBLCK  0x0001/* Time base is locked. */
diff --git a/include/cobalt/kernel/heap.h b/include/cobalt/kernel/heap.h
index 4c2b8d8..67ab718 100644
--- a/include/cobalt/kernel/heap.h
+++ b/include/cobalt/kernel/heap.h
@@ -22,9 +22,15 @@
 #ifndef _COBALT_KERNEL_HEAP_H
 #define _COBALT_KERNEL_HEAP_H
 
+#include cobalt/kernel/assert.h
+#include cobalt/kernel/lock.h
+#include cobalt/kernel/list.h
+#include cobalt/kernel/trace.h
+#include cobalt/kernel/misc.h
+#include cobalt/uapi/sys/types.h
+#include cobalt/uapi/sys/heap.h
+
 /*
- * CONSTRAINTS:
- *
  * Minimum page size is 2 ** XNHEAP_MINLOG2 (must be large enough to
  * hold a pointer).
  *
@@ -41,14 +47,6 @@
  * XNHEAP_MINLOG2 and XNHEAP_MAXLOG2 inclusive, plus one to honor
  * requests ranging from the maximum page size to twice this size.
  */
-
-#include cobalt/kernel/assert.h
-#include cobalt/kernel/lock.h
-#include cobalt/kernel/list.h
-#include cobalt/kernel/trace.h
-#include cobalt/kernel/types.h
-#include cobalt/uapi/sys/heap.h
-
 #define XNHEAP_PAGE_SIZE   512 /* A reasonable value for the xnheap page 
size */
 #define XNHEAP_PAGE_MASK   (~(XNHEAP_PAGE_SIZE-1))
 #define XNHEAP_PAGE_ALIGN(addr)
(((addr)+XNHEAP_PAGE_SIZE-1)XNHEAP_PAGE_MASK)
diff --git a/include/cobalt/kernel/intr.h b/include/cobalt/kernel/intr.h
index 38bf683..3aecc87 100644
--- a/include/cobalt/kernel/intr.h
+++ b/include/cobalt/kernel/intr.h
@@ -22,7 +22,6 @@
 #ifndef _COBALT_KERNEL_INTR_H
 #define _COBALT_KERNEL_INTR_H
 
-#include cobalt/kernel/types.h
 #include cobalt/kernel/stat.h
 
 /* Possible return values of ISR. */
diff --git a/include/cobalt/kernel/types.h b/include/cobalt/kernel/misc.h
similarity index 81%
rename from include/cobalt/kernel/types.h
rename to include/cobalt/kernel/misc.h
index 72e50da..a2c723a 100644
--- a/include/cobalt/kernel/types.h
+++ b/include/cobalt/kernel/misc.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2001-2013 Philippe Gerum r...@xenomai.org.
+ * Copyright (C) 2013 Philippe Gerum r...@xenomai.org.
  *
  * Xenomai is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published
@@ -17,13 +17,11 @@
  * 02111-1307, USA.
  */
 
-#ifndef _COBALT_KERNEL_TYPES_H
-#define _COBALT_KERNEL_TYPES_H
-
-#include cobalt/uapi/sys/types.h
+#ifndef _COBALT_KERNEL_MISC_H
+#define _COBALT_KERNEL_MISC_H
 
 #define XENO_INFO KERN_INFO[Xenomai] 
 #define XENO_WARN KERN_WARNING [Xenomai] 
 #define XENO_ERR  KERN_ERR [Xenomai] 
 
-#endif /* !_COBALT_KERNEL_TYPES_H */
+#endif /* !_COBALT_KERNEL_MISC_H */
diff --git a/include/cobalt/kernel/registry.h b/include/cobalt/kernel/registry.h
index 669f10f..fd472ee 100644
--- a/include/cobalt/kernel/registry.h
+++ b/include/cobalt/kernel/registry.h
@@ 

[Xenomai-git] Philippe Gerum : cobalt/kernel: drop __setbits()

2013-07-08 Thread git repository hosting
Module: xenomai-forge
Branch: master
Commit: 0dc7e0303749c694e70e8bbbe1e989296ca5b386
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=0dc7e0303749c694e70e8bbbe1e989296ca5b386

Author: Philippe Gerum r...@xenomai.org
Date:   Fri Jun 28 20:18:51 2013 +0200

cobalt/kernel: drop __setbits()

This non-atomic form cannot operate on any arbitray bit number like
__set_bit() but rather works with a plain bitmask. There is no point
in obfuscating the code via this indirection. Drop it.

---

 include/cobalt/kernel/sched.h  |   10 +-
 include/cobalt/kernel/thread.h |   23 +++
 include/cobalt/kernel/types.h  |1 -
 kernel/cobalt/intr.c   |   10 +-
 kernel/cobalt/map.c|4 ++--
 kernel/cobalt/pipe.c   |   33 -
 kernel/cobalt/pod.c|   10 +-
 kernel/cobalt/sched.c  |4 ++--
 kernel/cobalt/synch.c  |4 ++--
 kernel/cobalt/timer.c  |   18 +-
 10 files changed, 65 insertions(+), 52 deletions(-)

diff --git a/include/cobalt/kernel/sched.h b/include/cobalt/kernel/sched.h
index db0431c..d4a6480 100644
--- a/include/cobalt/kernel/sched.h
+++ b/include/cobalt/kernel/sched.h
@@ -148,7 +148,7 @@ static inline int xnsched_resched_p(struct xnsched *sched)
 /* Set self resched flag for the given scheduler. */
 #define xnsched_set_self_resched(__sched__) do {   \
   XENO_BUGON(NUCLEUS, __sched__ != xnpod_current_sched()); \
-  __setbits((__sched__)-status, XNRESCHED);   \
+  (__sched__)-status |= XNRESCHED;\
 } while (0)
 
 /* Set resched flag for the given scheduler. */
@@ -156,11 +156,11 @@ static inline int xnsched_resched_p(struct xnsched *sched)
 #define xnsched_set_resched(__sched__) do {\
   xnsched_t *current_sched = xnpod_current_sched();\
   if (current_sched == (__sched__))\
-  __setbits(current_sched-status, XNRESCHED); \
+  current_sched-status |= XNRESCHED;  \
   else if (!xnsched_resched_p(__sched__)) {\
-  cpu_set(xnsched_cpu(__sched__), current_sched-resched); \
-  __setbits((__sched__)-status, XNRESCHED);   \
-  __setbits(current_sched-status, XNRESCHED); \
+  cpu_set(xnsched_cpu(__sched__), current_sched-resched); \
+  (__sched__)-status |= XNRESCHED;
\
+  current_sched-status |= XNRESCHED;  \
   }\
 } while (0)
 #else /* !CONFIG_SMP */
diff --git a/include/cobalt/kernel/thread.h b/include/cobalt/kernel/thread.h
index 287b779..738c26b 100644
--- a/include/cobalt/kernel/thread.h
+++ b/include/cobalt/kernel/thread.h
@@ -188,16 +188,31 @@ static inline int xnthread_test_state(struct xnthread 
*thread, int bits)
return thread-state  bits;
 }
 
-#define xnthread_set_state(thread,flags)   __setbits((thread)-state,flags)
-#define xnthread_clear_state(thread,flags) __clrbits((thread)-state,flags)
+static inline void xnthread_set_state(struct xnthread *thread, int bits)
+{
+   thread-state |= bits;
+}
+
+static inline void xnthread_clear_state(struct xnthread *thread, int bits)
+{
+   thread-state = ~bits;
+}
 
 static inline int xnthread_test_info(struct xnthread *thread, int bits)
 {
return thread-info  bits;
 }
 
-#define xnthread_set_info(thread,flags)__setbits((thread)-info,flags)
-#define xnthread_clear_info(thread,flags)  __clrbits((thread)-info,flags)
+static inline void xnthread_set_info(struct xnthread *thread, int bits)
+{
+   thread-info |= bits;
+}
+
+static inline void xnthread_clear_info(struct xnthread *thread, int bits)
+{
+   thread-info = ~bits;
+}
+
 #define xnthread_lock_count(thread)((thread)-schedlck)
 #define xnthread_init_schedparam(thread)   ((thread)-init_schedparam)
 #define xnthread_base_priority(thread) ((thread)-bprio)
diff --git a/include/cobalt/kernel/types.h b/include/cobalt/kernel/types.h
index 5cf3f9a..9375c2f 100644
--- a/include/cobalt/kernel/types.h
+++ b/include/cobalt/kernel/types.h
@@ -24,7 +24,6 @@
 
 #define setbits(flags,mask)  xnarch_atomic_set_mask((flags),mask)
 #define clrbits(flags,mask)  xnarch_atomic_clear_mask((flags),mask)
-#define __setbits(flags,mask)  do { (flags) |= (mask); } while(0)
 #define __clrbits(flags,mask)  do { (flags) = ~(mask); } while(0)
 
 #define XENO_INFO KERN_INFO[Xenomai] 
diff --git a/kernel/cobalt/intr.c b/kernel/cobalt/intr.c
index 9bc5ab1..5628f27 100644
--- a/kernel/cobalt/intr.c
+++ b/kernel/cobalt/intr.c
@@ -106,7 +106,7 @@ void xnintr_clock_handler(void)
trace_mark(xn_nucleus, clock_tick, MARK_NOARGS);
 
++sched-inesting;
-   __setbits(sched-lflags, XNINIRQ);
+

[Xenomai-git] Philippe Gerum : include/cobalt: fix build over uClibc

2013-07-08 Thread git repository hosting
Module: xenomai-forge
Branch: master
Commit: ded1c7bc002bb6fa225a34dc6c0688b8fcdbc974
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=ded1c7bc002bb6fa225a34dc6c0688b8fcdbc974

Author: Philippe Gerum r...@xenomai.org
Date:   Mon Jun 24 16:29:16 2013 +0200

include/cobalt: fix build over uClibc

Cobalt does implement pthread_mutexattr_set/getprotocol(), as well as
pthread_condattr_set/getclock(), so these may be declared
unconditionally in a Cobalt-specific header file.

In addition, we detect when pthread_yield() is a macro such as in the
uClibc case, so prevent preprocessing errors with
COBALT_DECL(). uClibc wraps pthread_yield() to sched_yield(), which we
override too, so that's fine with us.

---

 include/cobalt/pthread.h |   15 +++
 1 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/include/cobalt/pthread.h b/include/cobalt/pthread.h
index a21f279..a7743d9 100644
--- a/include/cobalt/pthread.h
+++ b/include/cobalt/pthread.h
@@ -247,7 +247,10 @@ COBALT_DECL(int, pthread_getschedparam(pthread_t thread,
 COBALT_DECL(int, pthread_setschedparam(pthread_t thread,
   int policy,
   const struct sched_param *param));
+
+#ifndef pthread_yield  /* likely uClibc wrapping otherwise. */
 COBALT_DECL(int, pthread_yield(void));
+#endif
 
 COBALT_DECL(int, pthread_mutexattr_init(pthread_mutexattr_t *attr));
 
@@ -259,14 +262,6 @@ COBALT_DECL(int, pthread_mutexattr_gettype(const 
pthread_mutexattr_t *attr,
 COBALT_DECL(int, pthread_mutexattr_settype(pthread_mutexattr_t *attr,
   int type));
 
-#ifdef HAVE_PTHREAD_MUTEXATTR_SETPROTOCOL
-COBALT_DECL(int, pthread_mutexattr_getprotocol(const pthread_mutexattr_t *attr,
-  int *proto));
-
-COBALT_DECL(int, pthread_mutexattr_setprotocol(pthread_mutexattr_t *attr,
-  int proto));
-#endif
-
 COBALT_DECL(int, pthread_mutexattr_getpshared(const pthread_mutexattr_t *attr,
  int *pshared));
 
@@ -321,21 +316,17 @@ COBALT_DECL(int, pthread_cond_broadcast(pthread_cond_t 
*cond));
 
 COBALT_DECL(int, pthread_kill(pthread_t tid, int sig));
 
-#ifndef HAVE_PTHREAD_MUTEXATTR_SETPROTOCOL
 COBALT_DECL(int, pthread_mutexattr_getprotocol(const pthread_mutexattr_t *attr,
   int *proto));
 
 COBALT_DECL(int, pthread_mutexattr_setprotocol(pthread_mutexattr_t *attr,
   int proto));
-#endif
 
-#ifndef HAVE_PTHREAD_CONDATTR_SETCLOCK
 COBALT_DECL(int, pthread_condattr_getclock(const pthread_condattr_t *attr,
   clockid_t *clk_id));
 
 COBALT_DECL(int, pthread_condattr_setclock(pthread_condattr_t *attr,
   clockid_t clk_id));
-#endif
 
 int pthread_make_periodic_np(pthread_t thread,
 clockid_t clk_id,


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


[Xenomai-git] Philippe Gerum : cobalt: fan out tick/ns converters to proper locations

2013-07-08 Thread git repository hosting
Module: xenomai-forge
Branch: master
Commit: ecd37b838baa35e83704f4e8e56bef0ccc75cb12
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=ecd37b838baa35e83704f4e8e56bef0ccc75cb12

Author: Philippe Gerum r...@xenomai.org
Date:   Wed Jul  3 12:08:55 2013 +0200

cobalt: fan out tick/ns converters to proper locations

These few routines are one liners we don't want to inline, wrapping to
generic arithmetic code. Duplicating them for kernel and lib/cobalt
usage is saner than keeping non-inlined code in headers.

---

 include/cobalt/Makefile.am |1 +
 include/cobalt/Makefile.in |1 +
 include/cobalt/asm-generic/Makefile.am |   21 ++--
 include/cobalt/asm-generic/Makefile.in |   19 ++--
 include/cobalt/asm-generic/arith.h |5 +-
 include/cobalt/asm-generic/uapi/Makefile.am|4 +-
 include/cobalt/asm-generic/uapi/Makefile.in|4 +-
 include/cobalt/asm-x86/arith.h |6 +-
 include/cobalt/kernel/clock.h  |   12 ++-
 include/cobalt/{asm-generic/timeconv.h = ticks.h} |   27 --
 include/copperplate/clockobj.h |9 +-
 kernel/cobalt/arith.c  |9 +--
 kernel/cobalt/clock.c  |   99 +++-
 kernel/cobalt/init.c   |6 +-
 kernel/cobalt/pod.c|8 +-
 kernel/cobalt/posix/clock.c|2 +-
 kernel/cobalt/posix/internal.h |4 +-
 kernel/cobalt/posix/thread.c   |2 +-
 kernel/cobalt/posix/timer.c|2 +-
 kernel/cobalt/rtdm/drvlib.c|2 +-
 kernel/cobalt/sched.c  |6 +-
 kernel/cobalt/shadow.c |2 +-
 kernel/cobalt/timer.c  |   20 ++--
 kernel/drivers/ipc/internal.h  |2 +-
 lib/cobalt/Makefile.am |1 +
 lib/cobalt/Makefile.in |   14 +++-
 lib/cobalt/clock.c |9 +-
 lib/cobalt/init.c  |4 +-
 lib/cobalt/internal.c  |2 -
 lib/cobalt/internal.h  |4 +
 kernel/cobalt/timeconv.h = lib/cobalt/ticks.c |   58 ++--
 lib/copperplate/clockobj.c |4 +-
 32 files changed, 243 insertions(+), 126 deletions(-)

diff --git a/include/cobalt/Makefile.am b/include/cobalt/Makefile.am
index bc5f9fc..cece4eb 100644
--- a/include/cobalt/Makefile.am
+++ b/include/cobalt/Makefile.am
@@ -11,6 +11,7 @@ includesub_HEADERS =  \
stdio.h \
stdlib.h\
syslog.h\
+   ticks.h \
time.h  \
trace.h \
unistd.h\
diff --git a/include/cobalt/Makefile.in b/include/cobalt/Makefile.in
index d19642a..57ed864 100644
--- a/include/cobalt/Makefile.in
+++ b/include/cobalt/Makefile.in
@@ -322,6 +322,7 @@ includesub_HEADERS = \
stdio.h \
stdlib.h\
syslog.h\
+   ticks.h \
time.h  \
trace.h \
unistd.h\
diff --git a/include/cobalt/asm-generic/Makefile.am 
b/include/cobalt/asm-generic/Makefile.am
index 8d8e9ec..6371d60 100644
--- a/include/cobalt/asm-generic/Makefile.am
+++ b/include/cobalt/asm-generic/Makefile.am
@@ -1,16 +1,15 @@
 includesubdir = $(includedir)/asm-generic
 
-includesub_HEADERS = \
-   arith.h \
-   atomic.h \
-   features.h \
-   machine.h \
-   mayday.h \
-   pci_ids.h \
-   stack.h \
-   syscall.h \
-   thread.h \
-   timeconv.h \
+includesub_HEADERS =   \
+   arith.h \
+   atomic.h\
+   features.h  \
+   machine.h   \
+   mayday.h\
+   pci_ids.h   \
+   stack.h \
+   syscall.h   \
+   thread.h\
wrappers.h
 
 SUBDIRS = uapi ipipe
diff --git a/include/cobalt/asm-generic/Makefile.in 
b/include/cobalt/asm-generic/Makefile.in
index 2feb1f7..73ce649 100644
--- a/include/cobalt/asm-generic/Makefile.in
+++ b/include/cobalt/asm-generic/Makefile.in
@@ -312,16 +312,15 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 includesubdir = $(includedir)/asm-generic
 includesub_HEADERS = \
-   arith.h \
-   atomic.h \
-   features.h \
-   machine.h \
-   mayday.h \
-   pci_ids.h \
-   stack.h \
-   syscall.h \
-   thread.h \
-   timeconv.h \
+   arith.h \
+   atomic.h\
+   features.h  \
+   machine.h   \
+   mayday.h\
+   pci_ids.h   \
+   stack.h \
+   syscall.h   \
+   thread.h\
wrappers.h
 
 

[Xenomai-git] Philippe Gerum : cobalt: move arithmetic helpers to the uapi section

2013-07-08 Thread git repository hosting
Module: xenomai-forge
Branch: master
Commit: f4bd40451f6927c75b1b75f37bd7d32da6198a69
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=f4bd40451f6927c75b1b75f37bd7d32da6198a69

Author: Philippe Gerum r...@xenomai.org
Date:   Thu Jul  4 09:16:46 2013 +0200

cobalt: move arithmetic helpers to the uapi section

---

 include/cobalt/Makefile.am |1 +
 include/cobalt/Makefile.in |1 +
 include/cobalt/arith.h |   45 +
 include/cobalt/asm-arm/Makefile.am |1 -
 include/cobalt/asm-arm/Makefile.in |1 -
 include/cobalt/asm-arm/uapi/Makefile.am|1 +
 include/cobalt/asm-arm/uapi/Makefile.in|1 +
 include/cobalt/asm-arm/{ = uapi}/arith.h  |8 +-
 include/cobalt/asm-blackfin/Makefile.am|1 -
 include/cobalt/asm-blackfin/Makefile.in|1 -
 include/cobalt/asm-blackfin/uapi/Makefile.am   |1 +
 include/cobalt/asm-blackfin/uapi/Makefile.in   |1 +
 include/cobalt/asm-blackfin/{ = uapi}/arith.h |8 +-
 include/cobalt/asm-generic/Makefile.am |1 -
 include/cobalt/asm-generic/Makefile.in |1 -
 include/cobalt/asm-generic/uapi/Makefile.am|1 +
 include/cobalt/asm-generic/uapi/Makefile.in|1 +
 include/cobalt/asm-generic/{ = uapi}/arith.h  |  222 +++-
 include/cobalt/asm-generic/uapi/features.h |1 -
 include/cobalt/asm-nios2/Makefile.am   |1 -
 include/cobalt/asm-nios2/Makefile.in   |1 -
 include/cobalt/asm-nios2/uapi/Makefile.am  |1 +
 include/cobalt/asm-nios2/uapi/Makefile.in  |1 +
 include/cobalt/asm-nios2/{ = uapi}/arith.h|8 +-
 include/cobalt/asm-powerpc/Makefile.am |1 -
 include/cobalt/asm-powerpc/Makefile.in |1 -
 include/cobalt/asm-powerpc/uapi/Makefile.am|1 +
 include/cobalt/asm-powerpc/uapi/Makefile.in|1 +
 include/cobalt/asm-powerpc/{ = uapi}/arith.h  |9 +-
 include/cobalt/asm-sh/Makefile.am  |1 -
 include/cobalt/asm-sh/Makefile.in  |1 -
 include/cobalt/asm-sh/uapi/Makefile.am |1 +
 include/cobalt/asm-sh/uapi/Makefile.in |1 +
 include/cobalt/asm-sh/{ = uapi}/arith.h   |9 +-
 include/cobalt/asm-x86/Makefile.am |1 -
 include/cobalt/asm-x86/Makefile.in |1 -
 include/cobalt/asm-x86/uapi/Makefile.am|1 +
 include/cobalt/asm-x86/uapi/Makefile.in|1 +
 include/cobalt/asm-x86/{ = uapi}/arith.h  |   10 +-
 include/cobalt/kernel/Makefile.am  |1 +
 include/cobalt/kernel/Makefile.in  |1 +
 include/cobalt/kernel/arith.h  |   35 
 kernel/cobalt/arch/arm/machine.c   |2 +-
 kernel/cobalt/arch/x86/machine.c   |2 +-
 kernel/cobalt/clock.c  |2 +-
 kernel/cobalt/posix/clock.c|1 -
 kernel/cobalt/posix/internal.h |2 +-
 kernel/cobalt/sched.c  |2 +-
 kernel/cobalt/timer.c  |2 +-
 kernel/drivers/ipc/internal.h  |2 +-
 kernel/drivers/testing/timerbench.c|5 +-
 lib/cobalt/sysdeps/blackfin/Makefile.am|6 +-
 lib/cobalt/sysdeps/blackfin/Makefile.in|7 +-
 lib/cobalt/sysdeps/blackfin/features.h |   25 +++
 lib/cobalt/sysdeps/nios2/Makefile.am   |6 +-
 lib/cobalt/sysdeps/nios2/Makefile.in   |7 +-
 lib/cobalt/sysdeps/nios2/features.h|   25 +++
 lib/cobalt/sysdeps/powerpc/Makefile.am |6 +-
 lib/cobalt/sysdeps/powerpc/Makefile.in |7 +-
 lib/cobalt/sysdeps/powerpc/features.h  |   25 +++
 lib/cobalt/sysdeps/sh/Makefile.am  |6 +-
 lib/cobalt/sysdeps/sh/Makefile.in  |7 +-
 lib/cobalt/sysdeps/sh/features.h   |   25 +++
 lib/cobalt/sysdeps/x86/Makefile.am |6 +-
 lib/cobalt/sysdeps/x86/Makefile.in |7 +-
 lib/cobalt/sysdeps/x86/features.h  |   25 +++
 lib/cobalt/ticks.c |2 +-
 lib/copperplate/clockobj.c |2 +-
 testsuite/unit/arith-noinline.c|2 +-
 testsuite/unit/arith.c |2 +-
 70 files changed, 413 insertions(+), 192 deletions(-)

diff --git a/include/cobalt/Makefile.am b/include/cobalt/Makefile.am
index cece4eb..23afa9f 100644
--- a/include/cobalt/Makefile.am
+++ b/include/cobalt/Makefile.am
@@ -1,6 +1,7 @@
 includesubdir = $(includedir)/cobalt
 
 includesub_HEADERS =   \
+   arith.h \
core.h  \
fcntl.h \
mqueue.h\
diff --git a/include/cobalt/Makefile.in b/include/cobalt/Makefile.in
index 57ed864..81131d0 100644
--- a/include/cobalt/Makefile.in
+++ b/include/cobalt/Makefile.in
@@ -312,6 +312,7 @@ top_builddir = 

[Xenomai-git] Philippe Gerum : cobalt/arm: drop useless fractional data for timer

2013-07-08 Thread git repository hosting
Module: xenomai-forge
Branch: master
Commit: 76bb37b04525ff83f384053143f68ba5c287ab7a
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=76bb37b04525ff83f384053143f68ba5c287ab7a

Author: Philippe Gerum r...@xenomai.org
Date:   Thu Jul  4 10:51:30 2013 +0200

cobalt/arm: drop useless fractional data for timer

---

 include/cobalt/asm-arm/uapi/arith.h |2 --
 kernel/cobalt/arch/arm/machine.c|   12 +---
 2 files changed, 1 insertions(+), 13 deletions(-)

diff --git a/include/cobalt/asm-arm/uapi/arith.h 
b/include/cobalt/asm-arm/uapi/arith.h
index 34187e9..3a6ac66 100644
--- a/include/cobalt/asm-arm/uapi/arith.h
+++ b/include/cobalt/asm-arm/uapi/arith.h
@@ -122,6 +122,4 @@ mach_arm_nodiv_llimd(const long long op,
 }
 #endif /* arm = v4 */
 
-extern struct xnarch_u32frac mach_arm_tsc_to_timer;
-
 #endif /* _COBALT_ASM_ARM_UAPI_ARITH_H */
diff --git a/kernel/cobalt/arch/arm/machine.c b/kernel/cobalt/arch/arm/machine.c
index 0293366..5485a40 100644
--- a/kernel/cobalt/arch/arm/machine.c
+++ b/kernel/cobalt/arch/arm/machine.c
@@ -23,8 +23,6 @@
 #include asm/cacheflush.h
 #include asm/xenomai/machine.h
 
-struct xnarch_u32frac mach_arm_tsc_to_timer;
-
 #define CALIBRATION_LOOPS 10
 
 static void mach_arm_prefault(struct vm_area_struct *vma)
@@ -94,14 +92,6 @@ static unsigned long mach_arm_calibrate(void)
return result;
 }
 
-static int mach_arm_init(void)
-{
-   xnarch_init_u32frac(mach_arm_tsc_to_timer,
-   xnarch_machdata.timer_freq,
-   xnarch_machdata.clock_freq);
-   return 0;
-}
-
 static const char *const fault_labels[] = {
[IPIPE_TRAP_ACCESS] = Data or instruction access,
[IPIPE_TRAP_SECTION] = Section fault,
@@ -119,7 +109,7 @@ static const char *const fault_labels[] = {
 
 struct xnarch_machdesc xnarch_machdesc = {
.name = arm,
-   .init = mach_arm_init,
+   .init = NULL,
.cleanup = NULL,
.calibrate = mach_arm_calibrate,
.prefault = mach_arm_prefault,


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


[Xenomai-git] Philippe Gerum : include/cobalt: do not export kernel-only headers

2013-07-08 Thread git repository hosting
Module: xenomai-forge
Branch: master
Commit: e240f78fdb69a19a8140b327adaa369215d4cfc1
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=e240f78fdb69a19a8140b327adaa369215d4cfc1

Author: Philippe Gerum r...@xenomai.org
Date:   Thu Jul  4 12:04:24 2013 +0200

include/cobalt: do not export kernel-only headers

---

 include/cobalt/asm-arm/Makefile.am   |3 +-
 include/cobalt/asm-arm/Makefile.in   |   76 -
 include/cobalt/asm-blackfin/Makefile.am  |3 +-
 include/cobalt/asm-blackfin/Makefile.in  |   76 -
 include/cobalt/asm-generic/Makefile.am   |3 +-
 include/cobalt/asm-generic/Makefile.in   |   76 -
 include/cobalt/asm-generic/ipipe/Makefile.am |3 +-
 include/cobalt/asm-generic/ipipe/Makefile.in |   78 --
 include/cobalt/asm-nios2/Makefile.am |3 +-
 include/cobalt/asm-nios2/Makefile.in |   78 --
 include/cobalt/asm-powerpc/Makefile.am   |3 +-
 include/cobalt/asm-powerpc/Makefile.in   |   76 -
 include/cobalt/asm-powerpc/uapi/Makefile.am  |3 +-
 include/cobalt/asm-powerpc/uapi/Makefile.in  |3 +-
 include/cobalt/asm-sh/Makefile.am|3 +-
 include/cobalt/asm-sh/Makefile.in|   76 -
 include/cobalt/asm-x86/Makefile.am   |3 +-
 include/cobalt/asm-x86/Makefile.in   |   76 -
 18 files changed, 100 insertions(+), 542 deletions(-)

diff --git a/include/cobalt/asm-arm/Makefile.am 
b/include/cobalt/asm-arm/Makefile.am
index 2635e3c..d0cb931 100644
--- a/include/cobalt/asm-arm/Makefile.am
+++ b/include/cobalt/asm-arm/Makefile.am
@@ -1,6 +1,5 @@
-includesubdir = $(includedir)/asm-arm
 
-includesub_HEADERS =   \
+noinst_HEADERS =   \
calibration.h   \
features.h  \
fptest.h\
diff --git a/include/cobalt/asm-arm/Makefile.in 
b/include/cobalt/asm-arm/Makefile.in
index 7377a2a..09a03e5 100644
--- a/include/cobalt/asm-arm/Makefile.in
+++ b/include/cobalt/asm-arm/Makefile.in
@@ -52,7 +52,7 @@ build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
 subdir = include/cobalt/asm-arm
-DIST_COMMON = $(includesub_HEADERS) $(srcdir)/Makefile.am \
+DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/config/ac_prog_cc_for_build.m4 \
@@ -83,35 +83,7 @@ am__can_run_installinfo = \
 n|no|NO) false;; \
 *) (install-info --version) /dev/null 21;; \
   esac
-am__vpath_adj_setup = srcdirstrip=`echo $(srcdir) | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
-$(srcdir)/*) f=`echo $$p | sed s|^$$srcdirstrip/||`;; \
-*) f=$$p;; \
-  esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
-  srcdirstrip=`echo $(srcdir) | sed 's/[].[^$$\\*|]//g'`
-am__nobase_strip = \
-  for p in $$list; do echo $$p; done | sed -e s|$$srcdirstrip/||
-am__nobase_list = $(am__nobase_strip_setup); \
-  for p in $$list; do echo $$p $$p; done | \
-  sed s| $$srcdirstrip/| |;' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
-  $(AWK) 'BEGIN { files[.] =  } { files[$$2] = files[$$2]   $$1; \
-if (++n[$$2] == $(am__install_max)) \
-  { print $$2, files[$$2]; n[$$2] = 0; files[$$2] =  } } \
-END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
-  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
-  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__uninstall_files_from_dir = { \
-  test -z $$files \
-|| { test ! -d $$dir  test ! -f $$dir  test ! -r $$dir; } \
-|| { echo  ( cd '$$dir'  rm -f $$files ); \
- $(am__cd) $$dir  rm -f $$files; }; \
-  }
-am__installdirs = $(DESTDIR)$(includesubdir)
-HEADERS = $(includesub_HEADERS)
+HEADERS = $(noinst_HEADERS)
 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive\
   distclean-recursive maintainer-clean-recursive
 AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
@@ -310,8 +282,7 @@ target_vendor = @target_vendor@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-includesubdir = $(includedir)/asm-arm
-includesub_HEADERS = \
+noinst_HEADERS = \
calibration.h   \
features.h  \
fptest.h\
@@ -360,27 +331,6 @@ mostlyclean-libtool:
 
 clean-libtool:
-rm -rf .libs _libs
-install-includesubHEADERS: $(includesub_HEADERS)
-   @$(NORMAL_INSTALL)
-   @list='$(includesub_HEADERS)'; test -n $(includesubdir) || list=; \
-   if test -n $$list; then \
- echo  $(MKDIR_P) '$(DESTDIR)$(includesubdir)'; \
- $(MKDIR_P) $(DESTDIR)$(includesubdir) || exit 1; \
-   fi; \
-   for p in $$list; do \
- if test -f $$p; then d=; else d=$(srcdir)/; fi; \
- echo $$d$$p; \
-   done | 

[Xenomai-git] Philippe Gerum : include/nocore: introduce real-time core-agnostic include tree

2013-07-08 Thread git repository hosting
Module: xenomai-forge
Branch: master
Commit: 50dda51b04dabe27385e0e469e6a39708bc50f4d
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=50dda51b04dabe27385e0e469e6a39708bc50f4d

Author: Philippe Gerum r...@xenomai.org
Date:   Wed Jul  3 12:24:51 2013 +0200

include/nocore: introduce real-time core-agnostic include tree

Some headers are shared between cobalt and mercury cores. These files
are arch-independent, and user-space only in essence.

---

 configure   |3 +-
 configure.in|1 +
 include/Makefile.am |1 +
 include/Makefile.in |6 +-
 include/cobalt/asm-generic/Makefile.am  |1 -
 include/cobalt/asm-generic/Makefile.in  |1 -
 include/copperplate/syncobj.h   |2 +-
 include/nocore/Makefile.am  |4 +
 include/nocore/Makefile.in  |  558 +++
 include/{cobalt/asm-generic = nocore}/atomic.h |6 +-
 lib/cobalt/internal.h   |2 +-
 lib/cobalt/printf.c |2 +-
 testsuite/clocktest/clocktest.c |2 +-
 testsuite/unit/check-vdso.c |2 +-
 14 files changed, 577 insertions(+), 14 deletions(-)

diff --git a/configure b/configure
index 3c1fd79..aafdea1 100755
--- a/configure
+++ b/configure
@@ -14101,7 +14101,7 @@ fi
 
 
 
-ac_config_files=$ac_config_files Makefile config/Makefile scripts/Makefile 
scripts/xeno-config:scripts/xeno-config-$rtcore_type.in scripts/xeno 
lib/Makefile lib/cobalt/Makefile lib/cobalt/sysdeps/Makefile 
lib/cobalt/sysdeps/arm/Makefile lib/cobalt/sysdeps/powerpc/Makefile 
lib/cobalt/sysdeps/blackfin/Makefile lib/cobalt/sysdeps/x86/Makefile 
lib/cobalt/sysdeps/nios2/Makefile lib/cobalt/sysdeps/sh/Makefile 
lib/copperplate/Makefile lib/copperplate/regd/Makefile lib/alchemy/Makefile 
lib/vxworks/Makefile lib/psos/Makefile lib/analogy/Makefile 
lib/include/Makefile testsuite/Makefile testsuite/latency/Makefile 
testsuite/cyclic/Makefile testsuite/switchtest/Makefile 
testsuite/clocktest/Makefile testsuite/unit/Makefile 
testsuite/xeno-test/Makefile testsuite/regression/Makefile 
testsuite/regression/posix/Makefile utils/Makefile utils/can/Makefile 
utils/analogy/Makefile utils/ps/Makefile utils/slackspot/Makefile 
include/Makefile include/cobalt/uapi/Makefile include/cobalt/uapi/sys/Makefile 
inc
 lude/cobalt/uapi/rtdm/Makefile include/cobalt/asm-generic/Makefile 
include/cobalt/asm-generic/uapi/Makefile 
include/cobalt/asm-generic/ipipe/Makefile include/cobalt/asm-blackfin/Makefile 
include/cobalt/asm-blackfin/uapi/Makefile include/cobalt/asm-x86/Makefile 
include/cobalt/asm-x86/uapi/Makefile include/cobalt/asm-powerpc/Makefile 
include/cobalt/asm-powerpc/uapi/Makefile include/cobalt/asm-arm/Makefile 
include/cobalt/asm-arm/uapi/Makefile include/cobalt/asm-nios2/Makefile 
include/cobalt/asm-nios2/uapi/Makefile include/cobalt/asm-sh/Makefile 
include/cobalt/asm-sh/uapi/Makefile include/cobalt/Makefile 
include/cobalt/sys/Makefile include/cobalt/kernel/Makefile 
include/rtdm/Makefile include/analogy/Makefile include/mercury/Makefile 
include/copperplate/Makefile include/alchemy/Makefile include/vxworks/Makefile 
include/psos/Makefile
+ac_config_files=$ac_config_files Makefile config/Makefile scripts/Makefile 
scripts/xeno-config:scripts/xeno-config-$rtcore_type.in scripts/xeno 
lib/Makefile lib/cobalt/Makefile lib/cobalt/sysdeps/Makefile 
lib/cobalt/sysdeps/arm/Makefile lib/cobalt/sysdeps/powerpc/Makefile 
lib/cobalt/sysdeps/blackfin/Makefile lib/cobalt/sysdeps/x86/Makefile 
lib/cobalt/sysdeps/nios2/Makefile lib/cobalt/sysdeps/sh/Makefile 
lib/copperplate/Makefile lib/copperplate/regd/Makefile lib/alchemy/Makefile 
lib/vxworks/Makefile lib/psos/Makefile lib/analogy/Makefile 
lib/include/Makefile testsuite/Makefile testsuite/latency/Makefile 
testsuite/cyclic/Makefile testsuite/switchtest/Makefile 
testsuite/clocktest/Makefile testsuite/unit/Makefile 
testsuite/xeno-test/Makefile testsuite/regression/Makefile 
testsuite/regression/posix/Makefile utils/Makefile utils/can/Makefile 
utils/analogy/Makefile utils/ps/Makefile utils/slackspot/Makefile 
include/Makefile include/nocore/Makefile include/cobalt/uapi/Makefile 
include/coba
 lt/uapi/sys/Makefile include/cobalt/uapi/rtdm/Makefile 
include/cobalt/asm-generic/Makefile include/cobalt/asm-generic/uapi/Makefile 
include/cobalt/asm-generic/ipipe/Makefile include/cobalt/asm-blackfin/Makefile 
include/cobalt/asm-blackfin/uapi/Makefile include/cobalt/asm-x86/Makefile 
include/cobalt/asm-x86/uapi/Makefile include/cobalt/asm-powerpc/Makefile 
include/cobalt/asm-powerpc/uapi/Makefile include/cobalt/asm-arm/Makefile 
include/cobalt/asm-arm/uapi/Makefile include/cobalt/asm-nios2/Makefile 
include/cobalt/asm-nios2/uapi/Makefile include/cobalt/asm-sh/Makefile 
include/cobalt/asm-sh/uapi/Makefile 

[Xenomai-git] Philippe Gerum : cobalt/kernel: drop __clrbits()

2013-07-08 Thread git repository hosting
Module: xenomai-forge
Branch: master
Commit: 3bfbdff8db1eb08ab03d686b674b534e227114a4
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=3bfbdff8db1eb08ab03d686b674b534e227114a4

Author: Philippe Gerum r...@xenomai.org
Date:   Fri Jun 28 20:28:11 2013 +0200

cobalt/kernel: drop __clrbits()

Same as __setbits, this macro does not bring anything useful compared
to an explict bitwise operation.

---

 include/cobalt/kernel/types.h |1 -
 kernel/cobalt/intr.c  |   13 ++---
 kernel/cobalt/map.c   |5 ++---
 kernel/cobalt/pipe.c  |   22 +++---
 kernel/cobalt/pod.c   |8 
 kernel/cobalt/sched.c |6 +++---
 kernel/cobalt/synch.c |2 +-
 kernel/cobalt/timer.c |   11 +--
 8 files changed, 32 insertions(+), 36 deletions(-)

diff --git a/include/cobalt/kernel/types.h b/include/cobalt/kernel/types.h
index 9375c2f..7289923 100644
--- a/include/cobalt/kernel/types.h
+++ b/include/cobalt/kernel/types.h
@@ -24,7 +24,6 @@
 
 #define setbits(flags,mask)  xnarch_atomic_set_mask((flags),mask)
 #define clrbits(flags,mask)  xnarch_atomic_clear_mask((flags),mask)
-#define __clrbits(flags,mask)  do { (flags) = ~(mask); } while(0)
 
 #define XENO_INFO KERN_INFO[Xenomai] 
 #define XENO_WARN KERN_WARNING [Xenomai] 
diff --git a/kernel/cobalt/intr.c b/kernel/cobalt/intr.c
index 5628f27..1c2555e 100644
--- a/kernel/cobalt/intr.c
+++ b/kernel/cobalt/intr.c
@@ -84,7 +84,7 @@ static void xnintr_irq_handler(unsigned irq, void *cookie);
 
 void xnintr_host_tick(struct xnsched *sched) /* Interrupts off. */
 {
-   __clrbits(sched-lflags, XNHTICK);
+   sched-lflags = ~XNHTICK;
 #ifdef XNARCH_HOST_TICK_IRQ
ipipe_post_irq_root(per_cpu(ipipe_percpu.hrtimer_irq, 
xnsched_cpu(sched)));
 #endif
@@ -115,7 +115,7 @@ void xnintr_clock_handler(void)
xnstat_exectime_switch(sched, prev);
 
if (--sched-inesting == 0) {
-   __clrbits(sched-lflags, XNINIRQ);
+   sched-lflags = ~XNINIRQ;
xnpod_schedule();
sched = xnpod_current_sched();
}
@@ -222,7 +222,7 @@ static void xnintr_shirq_handler(unsigned irq, void *cookie)
xnstat_exectime_switch(sched, prev);
 
if (--sched-inesting == 0) {
-   __clrbits(sched-lflags, XNINIRQ);
+   sched-lflags = ~XNINIRQ;
xnpod_schedule();
}
 
@@ -305,7 +305,7 @@ static void xnintr_edge_shirq_handler(unsigned irq, void 
*cookie)
xnstat_exectime_switch(sched, prev);
 
if (--sched-inesting == 0) {
-   __clrbits(sched-lflags, XNINIRQ);
+   sched-lflags = ~XNINIRQ;
xnpod_schedule();
}
 
@@ -494,7 +494,7 @@ static void xnintr_irq_handler(unsigned irq, void *cookie)
xnstat_exectime_switch(sched, prev);
 
if (--sched-inesting == 0) {
-   __clrbits(sched-lflags, XNINIRQ);
+   sched-lflags = ~XNINIRQ;
xnpod_schedule();
}
 
@@ -786,8 +786,7 @@ int xnintr_detach(xnintr_t *intr)
goto out;
}
 
-   __clrbits(intr-flags, XN_ISR_ATTACHED);
-
+   intr-flags = ~XN_ISR_ATTACHED;
xnintr_irq_detach(intr);
xnintr_stat_counter_dec();
  out:
diff --git a/kernel/cobalt/map.c b/kernel/cobalt/map.c
index 443da87..00a0d2e 100644
--- a/kernel/cobalt/map.c
+++ b/kernel/cobalt/map.c
@@ -203,10 +203,9 @@ int xnmap_enter(xnmap_t *map, int key, void *objaddr)
ofkey = hi * BITS_PER_LONG + lo;
++map-ukeys;
 
-   __clrbits(map-lomap[hi], 1UL  lo);
-
+   map-lomap[hi] = ~(1UL  lo);
if (map-lomap[hi] == 0)
-   __clrbits(map-himap, 1UL  hi);
+   map-himap = ~(1UL  hi);
}
 
map-objarray[ofkey] = objaddr;
diff --git a/kernel/cobalt/pipe.c b/kernel/cobalt/pipe.c
index 2bba2ee..a978072 100644
--- a/kernel/cobalt/pipe.c
+++ b/kernel/cobalt/pipe.c
@@ -79,8 +79,8 @@ static inline int xnpipe_minor_alloc(int minor)
 
 static inline void xnpipe_minor_free(int minor)
 {
-   __clrbits(xnpipe_bitmap[minor / BITS_PER_LONG],
- 1UL  (minor % BITS_PER_LONG));
+   xnpipe_bitmap[minor / BITS_PER_LONG] =
+   ~(1UL  (minor % BITS_PER_LONG));
 }
 
 static inline void xnpipe_enqueue_wait(struct xnpipe_state *state, int mask)
@@ -96,7 +96,7 @@ static inline void xnpipe_dequeue_wait(struct xnpipe_state 
*state, int mask)
if (state-status  mask)
if (--state-wcount == 0) {
list_del(state-slink);
-   __clrbits(state-status, mask);
+   state-status = ~mask;
}
 }
 
@@ -106,7 +106,7 @@ static inline void xnpipe_dequeue_all(struct xnpipe_state 
*state, int mask)
if (state-wcount) {
state-wcount = 0;

[Xenomai-git] Philippe Gerum : cobalt: split syscall-related files

2013-07-08 Thread git repository hosting
Module: xenomai-forge
Branch: master
Commit: c3f168b504b4f7ad579391d953526d5f3aa26fe5
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=c3f168b504b4f7ad579391d953526d5f3aa26fe5

Author: Philippe Gerum r...@xenomai.org
Date:   Sun Jun 30 11:36:08 2013 +0200

cobalt: split syscall-related files

Shared portions between kernel and userland shall move to uapi/,
inline syscall request definitions move to lib/cobalt/sysdeps.

---

 Makefile.in|2 +-
 configure  |   13 +-
 configure.in   |9 +
 include/cobalt/asm-arm/Makefile.am |3 +-
 include/cobalt/asm-arm/Makefile.in |  209 ++--
 include/cobalt/asm-arm/arith.h |2 +-
 include/cobalt/asm-arm/features.h  |  109 +
 include/cobalt/asm-arm/syscall.h   |  158 +--
 include/cobalt/asm-arm/uapi/Makefile.am|6 +
 include/cobalt/asm-arm/uapi/Makefile.in|  560 
 include/cobalt/asm-arm/uapi/features.h |   48 ++
 include/cobalt/asm-arm/uapi/syscall.h  |   35 ++
 include/cobalt/asm-arm/uapi/tsc.h  |   30 +
 include/cobalt/asm-blackfin/Makefile.am|3 +-
 include/cobalt/asm-blackfin/Makefile.in|  209 ++--
 include/cobalt/asm-blackfin/arith.h|2 +-
 include/cobalt/asm-blackfin/features.h |   45 +--
 include/cobalt/asm-blackfin/syscall.h  |  105 +
 include/cobalt/asm-blackfin/tsc.h  |   50 --
 include/cobalt/asm-blackfin/uapi/Makefile.am   |5 +
 include/cobalt/asm-blackfin/uapi/Makefile.in   |  559 +++
 include/cobalt/asm-blackfin/uapi/features.h|   38 ++
 include/cobalt/asm-blackfin/uapi/syscall.h |   35 ++
 include/cobalt/asm-generic/Makefile.am |3 +-
 include/cobalt/asm-generic/Makefile.in |3 +-
 include/cobalt/asm-generic/atomic.h|2 +
 include/cobalt/asm-generic/features.h  |   93 +---
 include/cobalt/asm-generic/seqlock.h   |   80 ---
 include/cobalt/asm-generic/syscall.h   |   74 +---
 include/cobalt/asm-generic/uapi/Makefile.am|5 +
 include/cobalt/asm-generic/uapi/Makefile.in|  559 +++
 include/cobalt/asm-generic/uapi/features.h |   83 +++
 include/cobalt/asm-generic/uapi/syscall.h  |   74 +++
 include/cobalt/asm-nios2/Makefile.am   |1 -
 include/cobalt/asm-nios2/Makefile.in   |1 -
 include/cobalt/asm-nios2/arith.h   |2 +-
 include/cobalt/asm-nios2/features.h|   54 +--
 include/cobalt/asm-nios2/syscall.h |  198 +---
 include/cobalt/asm-nios2/uapi/Makefile.am  |5 +
 include/cobalt/asm-nios2/uapi/Makefile.in  |  559 +++
 include/cobalt/asm-nios2/uapi/features.h   |   44 ++
 include/cobalt/asm-nios2/uapi/syscall.h|   26 +
 include/cobalt/asm-powerpc/Makefile.am |3 +-
 include/cobalt/asm-powerpc/Makefile.in |  209 ++--
 include/cobalt/asm-powerpc/arith.h |2 +-
 include/cobalt/asm-powerpc/features.h  |   45 +--
 include/cobalt/asm-powerpc/syscall.h   |   99 +
 include/cobalt/asm-powerpc/tsc.h   |   54 --
 include/cobalt/asm-powerpc/uapi/Makefile.am|6 +
 include/cobalt/asm-powerpc/uapi/Makefile.in|  560 
 include/cobalt/asm-powerpc/uapi/features.h |   39 ++
 include/cobalt/asm-powerpc/uapi/syscall.h  |   24 +
 include/cobalt/asm-sh/Makefile.am  |3 +-
 include/cobalt/asm-sh/Makefile.in  |  209 ++--
 include/cobalt/asm-sh/arith.h  |2 +-
 include/cobalt/asm-sh/features.h   |   54 +--
 include/cobalt/asm-sh/syscall.h|  126 +-
 include/cobalt/asm-sh/uapi/Makefile.am |5 +
 include/cobalt/asm-sh/uapi/Makefile.in |  559 +++
 include/cobalt/asm-sh/uapi/features.h  |   45 ++
 include/cobalt/asm-sh/uapi/syscall.h   |   24 +
 include/cobalt/asm-x86/Makefile.am |3 +-
 include/cobalt/asm-x86/Makefile.in |  209 ++--
 include/cobalt/asm-x86/arith.h |2 +-
 include/cobalt/asm-x86/features.h  |   46 +--
 include/cobalt/asm-x86/syscall.h   |  259 +-
 include/cobalt/asm-x86/tsc.h   |   43 --
 include/cobalt/asm-x86/uapi/Makefile.am|5 +
 include/cobalt/asm-x86/uapi/Makefile.in|  559 +++
 include/cobalt/asm-x86/uapi/features.h |   38 ++
 

[Xenomai-git] Philippe Gerum : cobalt/kernel: drop atomic_set/clear_mask

2013-07-08 Thread git repository hosting
Module: xenomai-forge
Branch: master
Commit: 97f960b96d5bfec0800f859c3fe0664903832534
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=97f960b96d5bfec0800f859c3fe0664903832534

Author: Philippe Gerum r...@xenomai.org
Date:   Sat Jun 29 16:11:20 2013 +0200

cobalt/kernel: drop atomic_set/clear_mask

Now that setbit() and clrbits() have become useless, we have no more
users of the underlying atomic bitwise operations. Drop them all.

---

 include/cobalt/asm-arm/atomic.h   |   40 ---
 include/cobalt/asm-blackfin/atomic.h  |   12 
 include/cobalt/asm-blackfin/machine.h |6 
 include/cobalt/asm-generic/atomic.h   |   23 +---
 include/cobalt/asm-generic/seqlock.h  |9 +-
 include/cobalt/asm-nios2/atomic.h |   15 --
 include/cobalt/asm-powerpc/atomic.h   |   40 ---
 include/cobalt/asm-sh/atomic.h|   49 -
 include/cobalt/asm-x86/atomic.h   |   39 --
 include/cobalt/asm-x86/fptest.h   |1 +
 include/cobalt/kernel/heap.h  |1 +
 include/cobalt/kernel/types.h |3 --
 kernel/cobalt/arch/blackfin/Makefile  |4 ---
 kernel/cobalt/arch/blackfin/atomic.S  |   43 -
 kernel/cobalt/arch/blackfin/machine.c |3 --
 15 files changed, 10 insertions(+), 278 deletions(-)

diff --git a/include/cobalt/asm-arm/atomic.h b/include/cobalt/asm-arm/atomic.h
index f38186f..a90f89c 100644
--- a/include/cobalt/asm-arm/atomic.h
+++ b/include/cobalt/asm-arm/atomic.h
@@ -23,46 +23,6 @@
 #ifndef _COBALT_ASM_ARM_ATOMIC_H
 #define _COBALT_ASM_ARM_ATOMIC_H
 
-#ifdef __KERNEL__
-#include linux/version.h
-#include asm/irqflags.h
-
-#if __LINUX_ARM_ARCH__ = 6
-static inline void atomic_set_mask(unsigned long mask, unsigned long *addr)
-{
-unsigned long tmp, tmp2;
-
-__asm__ __volatile__(@ atomic_set_mask\n
-1:ldrex   %0, [%3]\n\t
-  orr %0, %0, %4\n\t
-  strex   %1, %0, [%3]\n
-  teq %1, #0\n
-  bne 1b
-: =r (tmp), =r (tmp2), +Qo (*addr)
-: r (addr), Ir (mask)
-: cc);
-}
-#else /* arm = armv5 */
-#define atomic_set_mask(mask, addr)\
-   ({  \
-   unsigned long flags;\
-   \
-   flags = hard_local_irq_save();  \
-   *(unsigned long *)(addr) |= (unsigned long)(mask);  \
-   hard_local_irq_restore(flags);  \
-   })
-#endif /* arm = armv5 */
-
-#else /* !__KERNEL__ */
-#include asm/xenomai/features.h
-
-#if __LINUX_ARM_ARCH__ = 5 || !defined(CONFIG_SMP)
-#define xnarch_memory_barrier() \
-   __asm__ __volatile__ (: /* */ : /* */ :memory)
-#endif /* arm = armv5 || !CONFIG_SMP */
-
-#endif /* !__KERNEL__ */
-
 #include asm-generic/xenomai/atomic.h
 
 #endif /* !_COBALT_ASM_ARM_ATOMIC_H */
diff --git a/include/cobalt/asm-blackfin/atomic.h 
b/include/cobalt/asm-blackfin/atomic.h
index 9622f31..9b6e321 100644
--- a/include/cobalt/asm-blackfin/atomic.h
+++ b/include/cobalt/asm-blackfin/atomic.h
@@ -20,18 +20,6 @@
 #ifndef _COBALT_ASM_BLACKFIN_ATOMIC_H
 #define _COBALT_ASM_BLACKFIN_ATOMIC_H
 
-#ifdef __KERNEL__
-
-#include asm/xenomai/machine.h
-
-#define xnarch_atomic_set_mask(pflags, mask)   \
-   __asm_atomic_set_mask((pflags), (mask))
-
-#define xnarch_atomic_clear_mask(pflags, mask) \
-   __asm_atomic_clear_mask((pflags), (mask))
-
-#endif /* __KERNEL__ */
-
 #include asm-generic/xenomai/atomic.h
 
 #endif /* !_COBALT_ASM_BLACKFIN_ATOMIC_H */
diff --git a/include/cobalt/asm-blackfin/machine.h 
b/include/cobalt/asm-blackfin/machine.h
index af98ad0..b64b262 100644
--- a/include/cobalt/asm-blackfin/machine.h
+++ b/include/cobalt/asm-blackfin/machine.h
@@ -32,12 +32,6 @@ static inline __attribute_const__ unsigned long 
ffnz(unsigned long ul)
return ffs(ul) - 1;
 }
 
-asmlinkage void __asm_atomic_set_mask(unsigned long *addr,
- unsigned long mask);
-
-asmlinkage void __asm_atomic_clear_mask(unsigned long *addr,
-   unsigned long mask);
-
 #include asm-generic/xenomai/machine.h
 
 #endif /* !_COBALT_ASM_BLACKFIN_MACHINE_H */
diff --git a/include/cobalt/asm-generic/atomic.h 
b/include/cobalt/asm-generic/atomic.h
index 7b44887..a9a7b85 100644
--- a/include/cobalt/asm-generic/atomic.h
+++ b/include/cobalt/asm-generic/atomic.h
@@ -21,28 +21,7 @@
 #ifndef _COBALT_ASM_GENERIC_ATOMIC_H
 #define _COBALT_ASM_GENERIC_ATOMIC_H
 
-#include asm/xenomai/features.h
-
-typedef unsigned long 

[Xenomai-git] Philippe Gerum : include/cobalt: drop override of errno.h

2013-07-08 Thread git repository hosting
Module: xenomai-forge
Branch: master
Commit: 65f220ebf17c46daa379e1600a4213adc97f13fc
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=65f220ebf17c46daa379e1600a4213adc97f13fc

Author: Philippe Gerum r...@xenomai.org
Date:   Tue Jun 25 16:37:16 2013 +0200

include/cobalt: drop override of errno.h

We don't need any errno support in kernel space since we dropped the
intra-kernel API there, and we don't extend the userland section of
this file either. Just drop it.

---

 include/cobalt/Makefile.am   |1 -
 include/cobalt/Makefile.in   |1 -
 include/cobalt/errno.h   |   43 --
 kernel/cobalt/posix/clock.c  |2 +-
 kernel/cobalt/posix/internal.h   |1 -
 kernel/cobalt/posix/mutex_attr.c |4 +-
 kernel/cobalt/posix/thread.c |4 +-
 7 files changed, 5 insertions(+), 51 deletions(-)

diff --git a/include/cobalt/Makefile.am b/include/cobalt/Makefile.am
index f24b617..b8990a4 100644
--- a/include/cobalt/Makefile.am
+++ b/include/cobalt/Makefile.am
@@ -2,7 +2,6 @@ includesubdir = $(includedir)/cobalt
 
 includesub_HEADERS = \
core.h \
-   errno.h \
fcntl.h \
mqueue.h \
pthread.h \
diff --git a/include/cobalt/Makefile.in b/include/cobalt/Makefile.in
index df6e59a..1e7f9ff 100644
--- a/include/cobalt/Makefile.in
+++ b/include/cobalt/Makefile.in
@@ -313,7 +313,6 @@ top_srcdir = @top_srcdir@
 includesubdir = $(includedir)/cobalt
 includesub_HEADERS = \
core.h \
-   errno.h \
fcntl.h \
mqueue.h \
pthread.h \
diff --git a/include/cobalt/errno.h b/include/cobalt/errno.h
deleted file mode 100644
index e47ea74..000
--- a/include/cobalt/errno.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2006 Gilles Chanteperdrix gilles.chanteperd...@xenomai.org.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef _COBALT_ERRNO_H
-#define _COBALT_ERRNO_H
-
-#ifdef __KERNEL__
-
-#include linux/errno.h
-#include linux/unistd.h /* conflicting declaration of errno. */
-
-struct xnthread;
-
-/* errno values pasted from Linux asm/errno.h and bits/errno.h (ENOTSUP). */
-#define ENOTSUP EOPNOTSUPP
-#defineETIMEDOUT   110 /* Connection timed out */
-
-#define errno (*xnthread_get_errno_location(xnpod_current_thread()))
-
-int *xnthread_get_errno_location(struct xnthread *thread);
-
-#else /* !__KERNEL__ */
-
-#include_next errno.h
-
-#endif /* !__KERNEL__ */
-
-#endif /* !_COBALT_ERRNO_H */
diff --git a/kernel/cobalt/posix/clock.c b/kernel/cobalt/posix/clock.c
index 58418cf..d518068 100644
--- a/kernel/cobalt/posix/clock.c
+++ b/kernel/cobalt/posix/clock.c
@@ -218,7 +218,7 @@ int cobalt_clock_nanosleep(clockid_t clock_id, int flags,
if (clock_id != CLOCK_MONOTONIC 
clock_id != CLOCK_MONOTONIC_RAW 
clock_id != CLOCK_REALTIME)
-   return -ENOTSUP;
+   return -EOPNOTSUPP;
 
if ((unsigned long)rqt.tv_nsec = ONE_BILLION)
return -EINVAL;
diff --git a/kernel/cobalt/posix/internal.h b/kernel/cobalt/posix/internal.h
index 82ed400..5362abd 100644
--- a/kernel/cobalt/posix/internal.h
+++ b/kernel/cobalt/posix/internal.h
@@ -19,7 +19,6 @@
 #ifndef _COBALT_INTERNAL_H
 #define _COBALT_INTERNAL_H
 
-#include errno.h
 #include pthread.h
 #include sched.h
 #include signal.h
diff --git a/kernel/cobalt/posix/mutex_attr.c b/kernel/cobalt/posix/mutex_attr.c
index ab8f386..18a201b 100644
--- a/kernel/cobalt/posix/mutex_attr.c
+++ b/kernel/cobalt/posix/mutex_attr.c
@@ -274,7 +274,7 @@ pthread_mutexattr_getprotocol(const pthread_mutexattr_t * 
attr, int *proto)
  * @return 0 on success,
  * @return an error number if:
  * - EINVAL, the mutex attributes object @a attr is invalid;
- * - ENOTSUP, the value of @a proto is unsupported;
+ * - EOPNOTSUPP, the value of @a proto is unsupported;
  * - EINVAL, the value of @a proto is invalid.
  *
  * @see
@@ -306,7 +306,7 @@ pthread_mutexattr_setprotocol(pthread_mutexattr_t * attr, 
int proto)
case PTHREAD_PRIO_PROTECT:
 
xnlock_put_irqrestore(nklock, s);
-   return ENOTSUP;
+   return EOPNOTSUPP;
 
case PTHREAD_PRIO_NONE:
case PTHREAD_PRIO_INHERIT:
diff --git a/kernel/cobalt/posix/thread.c 

[Xenomai-git] Philippe Gerum : copperplate: move clockobj_get_tsc() out of line

2013-07-08 Thread git repository hosting
Module: xenomai-forge
Branch: master
Commit: 8e71e6c398e6b5f5c8c723d7c1098e7f4647a80e
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=8e71e6c398e6b5f5c8c723d7c1098e7f4647a80e

Author: Philippe Gerum r...@xenomai.org
Date:   Sat Jul  6 15:47:35 2013 +0200

copperplate: move clockobj_get_tsc() out of line

---

 include/copperplate/clockobj.h |   16 ++--
 lib/copperplate/clockobj.c |   14 ++
 2 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/include/copperplate/clockobj.h b/include/copperplate/clockobj.h
index 2619bb1..965523d 100644
--- a/include/copperplate/clockobj.h
+++ b/include/copperplate/clockobj.h
@@ -128,6 +128,8 @@ void clockobj_get_date(struct clockobj *clkobj, ticks_t 
*pticks);
 void clockobj_get_time(struct clockobj *clkobj,
   ticks_t *pticks, ticks_t *ptsc);
 
+ticks_t clockobj_get_tsc(void);
+
 void clockobj_caltime_to_timeout(struct clockobj *clkobj, const struct tm *tm,
 unsigned long rticks, struct timespec *ts);
 
@@ -159,13 +161,6 @@ int clockobj_destroy(struct clockobj *clkobj);
 #ifdef CONFIG_XENO_COBALT
 
 #include cobalt/ticks.h
-#include asm/xenomai/tsc.h
-
-static inline ticks_t clockobj_get_tsc(void)
-{
-   /* Guaranteed to be the source of CLOCK_COPPERPLATE. */
-   return __xn_rdtsc();
-}
 
 static inline sticks_t clockobj_ns_to_tsc(sticks_t ns)
 {
@@ -188,13 +183,6 @@ void clockobj_ns_to_timespec(ticks_t ns, struct timespec 
*ts)
 
 #else /* CONFIG_XENO_MERCURY */
 
-static inline ticks_t clockobj_get_tsc(void)
-{
-   struct timespec now;
-   __RT(clock_gettime(CLOCK_COPPERPLATE, now));
-   return (ticks_t)now.tv_sec * 10ULL + now.tv_nsec;
-}
-
 static inline sticks_t clockobj_ns_to_tsc(sticks_t ns)
 {
return ns;
diff --git a/lib/copperplate/clockobj.c b/lib/copperplate/clockobj.c
index 05a14db..183a27a 100644
--- a/lib/copperplate/clockobj.c
+++ b/lib/copperplate/clockobj.c
@@ -283,6 +283,13 @@ int clockobj_set_resolution(struct clockobj *clkobj, 
unsigned int resolution_ns)
 #ifdef CONFIG_XENO_COBALT
 
 #include cobalt/arith.h
+#include asm/xenomai/tsc.h
+
+ticks_t clockobj_get_tsc(void)
+{
+   /* Guaranteed to be the source of CLOCK_COPPERPLATE. */
+   return __xn_rdtsc();
+}
 
 #ifndef CONFIG_XENO_LORES_CLOCK_DISABLED
 
@@ -328,6 +335,13 @@ void clockobj_get_date(struct clockobj *clkobj, ticks_t 
*pticks)
 
 #else /* CONFIG_XENO_MERCURY */
 
+ticks_t clockobj_get_tsc(void)
+{
+   struct timespec now;
+   __RT(clock_gettime(CLOCK_COPPERPLATE, now));
+   return (ticks_t)now.tv_sec * 10ULL + now.tv_nsec;
+}
+
 #ifndef CONFIG_XENO_LORES_CLOCK_DISABLED
 
 sticks_t clockobj_ns_to_ticks(struct clockobj *clkobj, sticks_t ns)


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


[Xenomai-git] Philippe Gerum : cobalt/arm: fix typo in local syscall handler

2013-07-08 Thread git repository hosting
Module: xenomai-forge
Branch: master
Commit: fd1bb6d51315c90bfd15b7563e70c7b89fafd69b
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=fd1bb6d51315c90bfd15b7563e70c7b89fafd69b

Author: Philippe Gerum r...@xenomai.org
Date:   Sat Jun 29 16:52:40 2013 +0200

cobalt/arm: fix typo in local syscall handler

---

 kernel/cobalt/arch/arm/syscall.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/cobalt/arch/arm/syscall.c b/kernel/cobalt/arch/arm/syscall.c
index 1cc4b0d..81cea2a 100644
--- a/kernel/cobalt/arch/arm/syscall.c
+++ b/kernel/cobalt/arch/arm/syscall.c
@@ -31,7 +31,7 @@ int xnarch_local_syscall(unsigned long a1, unsigned long a2,
int ret;
 
if (a1 != XENOMAI_SYSARCH_TSCINFO)
-   return  = -EINVAL;
+   return -EINVAL;
 
ret = ipipe_get_sysinfo(ipipe_info);
if (ret)


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


[Xenomai-git] Philippe Gerum : cobalt: move fp test helpers to the uapi section

2013-07-08 Thread git repository hosting
Module: xenomai-forge
Branch: master
Commit: 8e10c77c661c2ad69966816f2e70ee86366edc7f
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=8e10c77c661c2ad69966816f2e70ee86366edc7f

Author: Philippe Gerum r...@xenomai.org
Date:   Thu Jul  4 17:32:59 2013 +0200

cobalt: move fp test helpers to the uapi section

---

 include/cobalt/asm-arm/fptest.h  |   77 +---
 include/cobalt/asm-arm/uapi/Makefile.am  |1 +
 include/cobalt/asm-arm/uapi/Makefile.in  |1 +
 include/cobalt/asm-arm/uapi/fptest.h |   61 +
 include/cobalt/asm-blackfin/fptest.h |   21 +---
 include/cobalt/asm-blackfin/uapi/Makefile.am |1 +
 include/cobalt/asm-blackfin/uapi/Makefile.in |1 +
 include/cobalt/asm-blackfin/uapi/fptest.h|   31 +
 include/cobalt/asm-nios2/fptest.h|   21 +---
 include/cobalt/asm-nios2/uapi/Makefile.am|1 +
 include/cobalt/asm-nios2/uapi/Makefile.in|1 +
 include/cobalt/asm-nios2/uapi/fptest.h   |   31 +
 include/cobalt/asm-powerpc/fptest.h  |  103 +---
 include/cobalt/asm-powerpc/uapi/Makefile.am  |1 +
 include/cobalt/asm-powerpc/uapi/Makefile.in  |1 +
 include/cobalt/asm-powerpc/uapi/fptest.h |  113 +
 include/cobalt/asm-sh/fptest.h   |   21 +---
 include/cobalt/asm-sh/uapi/Makefile.am   |1 +
 include/cobalt/asm-sh/uapi/Makefile.in   |1 +
 include/cobalt/asm-sh/uapi/fptest.h  |   31 +
 include/cobalt/asm-x86/fptest.h  |  168 +++---
 include/cobalt/asm-x86/uapi/Makefile.am  |1 +
 include/cobalt/asm-x86/uapi/Makefile.in  |1 +
 include/cobalt/asm-x86/uapi/fptest.h |  132 
 kernel/drivers/testing/switchtest.c  |   28 +++-
 lib/cobalt/arm/features.c|   27 
 lib/cobalt/arm/xenomai/features.h|2 +
 lib/cobalt/blackfin/xenomai/features.h   |5 +
 lib/cobalt/nios2/features.c  |3 +-
 lib/cobalt/nios2/xenomai/features.h  |5 +
 lib/cobalt/powerpc/xenomai/features.h|5 +
 lib/cobalt/sh/xenomai/features.h |5 +
 lib/cobalt/x86/features.c|   28 -
 lib/cobalt/x86/xenomai/features.h|2 +
 testsuite/switchtest/switchtest.c|   27 ++--
 35 files changed, 566 insertions(+), 393 deletions(-)

diff --git a/include/cobalt/asm-arm/fptest.h b/include/cobalt/asm-arm/fptest.h
index 9bc4ced..af92b86 100644
--- a/include/cobalt/asm-arm/fptest.h
+++ b/include/cobalt/asm-arm/fptest.h
@@ -19,16 +19,17 @@
 #ifndef _COBALT_ASM_ARM_FPTEST_H
 #define _COBALT_ASM_ARM_FPTEST_H
 
-#ifdef __KERNEL__
-#include linux/module.h
+#include linux/errno.h
 #include asm/hwcap.h
 
 #ifdef CONFIG_VFP
 #define have_vfp (elf_hwcap  HWCAP_VFP)
 #else /* !CONFIG_VFP */
-#define have_vfp (0)
+#define have_vfp 0
 #endif /* !CONFIG_VFP */
 
+#include asm/xenomai/uapi/fptest.h
+
 static inline int fp_kernel_supported(void)
 {
return 1;
@@ -43,75 +44,9 @@ static inline void fp_linux_end(void)
 {
 }
 
-static inline void fp_features_init(void)
+static inline int fp_detect(void)
 {
+   return have_vfp ? __COBALT_HAVE_VFP : 0;
 }
 
-#else /* !__KERNEL__ */
-#include stdio.h
-#include string.h
-#define printk(fmt, args...) fprintf(stderr, fmt, ## args)
-
-static int have_vfp;
-
-static void fp_features_init(void)
-{
-   char buffer[1024];
-   FILE *f = fopen(/proc/cpuinfo, r);
-   if(!f)
-   return;
-
-   while(fgets(buffer, sizeof(buffer), f)) {
-   if(strncmp(buffer, Features, sizeof(Features) - 1))
-   continue;
-
-   if (strstr(buffer, vfp)) {
-   have_vfp = 1;
-   break;
-   }
-   }
-
-   fclose(f);
-}
-
-#endif /* !__KERNEL__ */
-
-static inline void fp_regs_set(unsigned val)
-{
-   if (have_vfp) {
-   unsigned long long e[16];
-   unsigned i;
-
-   for (i = 0; i  16; i++)
-   e[i] = val;
-
-   /* vldm %0!, {d0-d15},
-  AKA fldmiax %0!, {d0-d15} */
-   __asm__ __volatile__(ldc p11, cr0, [%0],#32*4:
-=r(i): 0(e[0]): memory);
-   }
-}
-
-static inline unsigned fp_regs_check(unsigned val)
-{
-   unsigned result = val;
-
-   if (have_vfp) {
-   unsigned long long e[16];
-   unsigned i;
-
-   /* vstm %0!, {d0-d15},
-  AKA fstmiax %0!, {d0-d15} */
-   __asm__ __volatile__(stc p11, cr0, [%0],#32*4:
-=r(i): 0(e[0]): memory);
-
-   for (i = 0; i  16; i++)
-   if (e[i] != val) {
-   printk(d%d: %llu != %u\n, i, e[i], val);
-   result = e[i];
-   }
-   }
-

[Xenomai-git] Philippe Gerum : cobalt/kernel: drop [__]testbits

2013-07-08 Thread git repository hosting
Module: xenomai-forge
Branch: master
Commit: 2f6ba5046143ce557a8a99888cde26ce352b45a5
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=2f6ba5046143ce557a8a99888cde26ce352b45a5

Author: Philippe Gerum r...@xenomai.org
Date:   Fri Jun 28 19:55:55 2013 +0200

cobalt/kernel: drop [__]testbits

This macros bring no value. Prefer explicit, open coded bitwise tests.

---

 include/cobalt/kernel/pod.h  |8 ++--
 include/cobalt/kernel/sched.h|4 +-
 include/cobalt/kernel/synch.h|3 +-
 include/cobalt/kernel/thread.h   |   16 ++-
 include/cobalt/kernel/timer.h|8 ++--
 include/cobalt/kernel/types.h|2 -
 kernel/cobalt/clock.c|4 +-
 kernel/cobalt/intr.c |6 +-
 kernel/cobalt/pipe.c |   70 -
 kernel/cobalt/pod.c  |   14 +++---
 kernel/cobalt/rtdm/drvlib.c  |   19 +++--
 kernel/cobalt/synch.c|   30 +++---
 kernel/cobalt/timer.c|   25 ++--
 kernel/drivers/serial/16550A.c   |   64 ++
 kernel/drivers/serial/mpc52xx_uart.c |   67 +++-
 kernel/drivers/serial/rt_imx_uart.c  |   60 +---
 16 files changed, 194 insertions(+), 206 deletions(-)

diff --git a/include/cobalt/kernel/pod.h b/include/cobalt/kernel/pod.h
index 3a4a5d8..cd367bb 100644
--- a/include/cobalt/kernel/pod.h
+++ b/include/cobalt/kernel/pod.h
@@ -237,12 +237,12 @@ static inline void xnpod_schedule(void)
 * context switch.
 */
 #if XENO_DEBUG(NUCLEUS)
-   if (testbits(sched-status | sched-lflags,
-XNINIRQ|XNINSW|XNINLOCK))
+   if ((sched-status|sched-lflags) 
+   (XNINIRQ|XNINSW|XNINLOCK))
return;
 #else /* !XENO_DEBUG(NUCLEUS) */
-   if (testbits(sched-status | sched-lflags,
-XNINIRQ|XNINSW|XNRESCHED|XNINLOCK) != XNRESCHED)
+   if (((sched-status|sched-lflags) 
+(XNINIRQ|XNINSW|XNRESCHED|XNINLOCK)) != XNRESCHED)
return;
 #endif /* !XENO_DEBUG(NUCLEUS) */
 
diff --git a/include/cobalt/kernel/sched.h b/include/cobalt/kernel/sched.h
index 3e7112c..db0431c 100644
--- a/include/cobalt/kernel/sched.h
+++ b/include/cobalt/kernel/sched.h
@@ -142,7 +142,7 @@ struct xnsched_class {
 /* Test resched flag of given sched. */
 static inline int xnsched_resched_p(struct xnsched *sched)
 {
-   return testbits(sched-status, XNRESCHED);
+   return sched-status  XNRESCHED;
 }
 
 /* Set self resched flag for the given scheduler. */
@@ -186,7 +186,7 @@ struct xnsched *xnsched_finish_unlocked_switch(struct 
xnsched *sched);
 static inline
 int xnsched_maybe_resched_after_unlocked_switch(struct xnsched *sched)
 {
-   return testbits(sched-status, XNRESCHED);
+   return sched-status  XNRESCHED;
 }
 
 #else /* !CONFIG_XENO_HW_UNLOCKED_SWITCH */
diff --git a/include/cobalt/kernel/synch.h b/include/cobalt/kernel/synch.h
index f270f20..1230d49 100644
--- a/include/cobalt/kernel/synch.h
+++ b/include/cobalt/kernel/synch.h
@@ -62,8 +62,7 @@ typedef struct xnsynch {
void (*cleanup)(struct xnsynch *synch); /* Cleanup handler */
 } xnsynch_t;
 
-#define xnsynch_test_flags(synch,flags)testbits((synch)-status,flags)
-#define xnsynch_set_flags(synch,flags) setbits((synch)-status,flags)
+#define xnsynch_set_flags(synch,flags) setbits((synch)-status,flags)
 #define xnsynch_clear_flags(synch,flags)   clrbits((synch)-status,flags)
 
 #define xnsynch_for_each_sleeper(__pos, __synch)   \
diff --git a/include/cobalt/kernel/thread.h b/include/cobalt/kernel/thread.h
index cd2157e..287b779 100644
--- a/include/cobalt/kernel/thread.h
+++ b/include/cobalt/kernel/thread.h
@@ -182,10 +182,20 @@ typedef struct xnthread {
 #define xnthread_sched(thread) ((thread)-sched)
 #define xnthread_start_time(thread)((thread)-stime)
 #define xnthread_state_flags(thread)   ((thread)-state)
-#define xnthread_test_state(thread,flags)  testbits((thread)-state,flags)
+
+static inline int xnthread_test_state(struct xnthread *thread, int bits)
+{
+   return thread-state  bits;
+}
+
 #define xnthread_set_state(thread,flags)   __setbits((thread)-state,flags)
 #define xnthread_clear_state(thread,flags) __clrbits((thread)-state,flags)
-#define xnthread_test_info(thread,flags)   testbits((thread)-info,flags)
+
+static inline int xnthread_test_info(struct xnthread *thread, int bits)
+{
+   return thread-info  bits;
+}
+
 #define xnthread_set_info(thread,flags)__setbits((thread)-info,flags)
 #define xnthread_clear_info(thread,flags)  __clrbits((thread)-info,flags)
 #define xnthread_lock_count(thread)((thread)-schedlck)
@@ -277,7 +287,7 @@ xnsynch_release(struct xnsynch *synch, struct xnthread 
*thread)
atomic_long_t *lockp;
xnhandle_t threadh;
 
-   XENO_BUGON(NUCLEUS, 

[Xenomai-git] Philippe Gerum : lib/cobalt: unexport asm/xenomai/tsc.h

2013-07-08 Thread git repository hosting
Module: xenomai-forge
Branch: master
Commit: 3f2346392969710381545906be4e16a6d4ca2f97
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=3f2346392969710381545906be4e16a6d4ca2f97

Author: Philippe Gerum r...@xenomai.org
Date:   Sat Jul  6 15:51:01 2013 +0200

lib/cobalt: unexport asm/xenomai/tsc.h

---

 lib/cobalt/arch/arm/Makefile.am|2 +-
 lib/cobalt/arch/arm/Makefile.in|   12 +--
 .../arch/arm/include/asm/xenomai/Makefile.am   |   11 +-
 .../arch/arm/include/asm/xenomai/Makefile.in   |   92 ++-
 lib/cobalt/arch/arm/include/asm/xenomai/tsc.h  |   96 +++-
 lib/cobalt/arch/arm/tsc.c  |4 -
 .../arch/blackfin/include/asm/xenomai/Makefile.am  |7 +-
 .../arch/blackfin/include/asm/xenomai/Makefile.in  |   84 ++-
 .../arch/nios2/include/asm/xenomai/Makefile.am |7 +-
 .../arch/nios2/include/asm/xenomai/Makefile.in |   84 ++-
 .../arch/powerpc/include/asm/xenomai/Makefile.am   |8 -
 .../arch/powerpc/include/asm/xenomai/Makefile.in   |  164 +++-
 lib/cobalt/arch/sh/include/asm/xenomai/Makefile.am |7 +-
 lib/cobalt/arch/sh/include/asm/xenomai/Makefile.in |   84 ++-
 .../arch/x86/include/asm/xenomai/Makefile.am   |7 +-
 .../arch/x86/include/asm/xenomai/Makefile.in   |   84 ++-
 16 files changed, 197 insertions(+), 556 deletions(-)

diff --git a/lib/cobalt/arch/arm/Makefile.am b/lib/cobalt/arch/arm/Makefile.am
index b45bfbb..0aa02d6 100644
--- a/lib/cobalt/arch/arm/Makefile.am
+++ b/lib/cobalt/arch/arm/Makefile.am
@@ -2,7 +2,7 @@ noinst_LTLIBRARIES = libarch.la
 
 libarch_la_LDFLAGS = @XENO_LIB_LDFLAGS@ -version-info 0:0:0
 
-libarch_la_SOURCES = features.c tsc.c
+libarch_la_SOURCES = features.c
 
 libarch_la_CPPFLAGS =  \
@XENO_COBALT_CFLAGS@\
diff --git a/lib/cobalt/arch/arm/Makefile.in b/lib/cobalt/arch/arm/Makefile.in
index ac389f9..b2dc7ea 100644
--- a/lib/cobalt/arch/arm/Makefile.in
+++ b/lib/cobalt/arch/arm/Makefile.in
@@ -71,7 +71,7 @@ CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
 LTLIBRARIES = $(noinst_LTLIBRARIES)
 libarch_la_LIBADD =
-am_libarch_la_OBJECTS = libarch_la-features.lo libarch_la-tsc.lo
+am_libarch_la_OBJECTS = libarch_la-features.lo
 libarch_la_OBJECTS = $(am_libarch_la_OBJECTS)
 libarch_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
@@ -303,7 +303,7 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 noinst_LTLIBRARIES = libarch.la
 libarch_la_LDFLAGS = @XENO_LIB_LDFLAGS@ -version-info 0:0:0
-libarch_la_SOURCES = features.c tsc.c
+libarch_la_SOURCES = features.c
 libarch_la_CPPFLAGS = \
@XENO_COBALT_CFLAGS@\
-I$(srcdir)/../..   \
@@ -366,7 +366,6 @@ distclean-compile:
-rm -f *.tab.c
 
 @AMDEP_TRUE@@am__include@ 
@am__quote@./$(DEPDIR)/libarch_la-features.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libarch_la-tsc.Plo@am__quote@
 
 .c.o:
 @am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ 
$
@@ -396,13 +395,6 @@ libarch_la-features.lo: features.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@  DEPDIR=$(DEPDIR) $(CCDEPMODE) 
$(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) 
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) 
$(libarch_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o 
libarch_la-features.lo `test -f 'features.c' || echo '$(srcdir)/'`features.c
 
-libarch_la-tsc.lo: tsc.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) 
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) 
$(libarch_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarch_la-tsc.lo 
-MD -MP -MF $(DEPDIR)/libarch_la-tsc.Tpo -c -o libarch_la-tsc.lo `test -f 
'tsc.c' || echo '$(srcdir)/'`tsc.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libarch_la-tsc.Tpo 
$(DEPDIR)/libarch_la-tsc.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@  source='tsc.c' 
object='libarch_la-tsc.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@  DEPDIR=$(DEPDIR) $(CCDEPMODE) 
$(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) 
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) 
$(libarch_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o 
libarch_la-tsc.lo `test -f 'tsc.c' || echo '$(srcdir)/'`tsc.c
-
 mostlyclean-libtool:
-rm -f *.lo
 
diff --git a/lib/cobalt/arch/arm/include/asm/xenomai/Makefile.am 
b/lib/cobalt/arch/arm/include/asm/xenomai/Makefile.am
index 8f7d65d..d308b06 100644
--- a/lib/cobalt/arch/arm/include/asm/xenomai/Makefile.am
+++ b/lib/cobalt/arch/arm/include/asm/xenomai/Makefile.am
@@ -1,12 +1,5 @@
-includesubdir = $(includedir)/cobalt/asm/xenomai
-
-includesub_HEADERS =   \
-   tsc.h
 
 noinst_HEADERS =   \
   

[Xenomai-git] Philippe Gerum : include/cobalt: merge rtdk.h into stdio.h

2013-07-08 Thread git repository hosting
Module: xenomai-forge
Branch: master
Commit: 568da95deb5af5dd5618ea413d14922dfdbd767d
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=568da95deb5af5dd5618ea413d14922dfdbd767d

Author: Philippe Gerum r...@xenomai.org
Date:   Sun Jul  7 18:05:30 2013 +0200

include/cobalt: merge rtdk.h into stdio.h

---

 include/Makefile.am |1 -
 include/Makefile.in |   14 +++
 include/cobalt/stdio.h  |   46 +++-
 include/rtdk.h  |   84 ---
 lib/cobalt/assert_context.c |2 +-
 lib/cobalt/init.c   |1 -
 lib/cobalt/printf.c |1 -
 7 files changed, 52 insertions(+), 97 deletions(-)

diff --git a/include/Makefile.am b/include/Makefile.am
index da58ec0..9eb5001 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -10,7 +10,6 @@ SUBDIRS = \
vxworks
 
 if XENO_COBALT
-include_HEADERS += rtdk.h
 SUBDIRS += \
analogy \
cobalt  \
diff --git a/include/Makefile.in b/include/Makefile.in
index 1cc2419..76e549a 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -51,15 +51,14 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
-@XENO_COBALT_TRUE@am__append_1 = rtdk.h
-@XENO_COBALT_TRUE@am__append_2 = \
+@XENO_COBALT_TRUE@am__append_1 = \
 @XENO_COBALT_TRUE@ analogy \
 @XENO_COBALT_TRUE@ cobalt  \
 @XENO_COBALT_TRUE@ rtdm
 
-@XENO_COBALT_FALSE@am__append_3 = mercury
+@XENO_COBALT_FALSE@am__append_2 = mercury
 subdir = include
-DIST_COMMON = $(am__include_HEADERS_DIST) $(srcdir)/Makefile.am \
+DIST_COMMON = $(include_HEADERS) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/xeno_config.h.in COPYING
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/config/ac_prog_cc_for_build.m4 \
@@ -90,7 +89,6 @@ am__can_run_installinfo = \
 n|no|NO) false;; \
 *) (install-info --version) /dev/null 21;; \
   esac
-am__include_HEADERS_DIST = version.h rtdk.h
 am__vpath_adj_setup = srcdirstrip=`echo $(srcdir) | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
 $(srcdir)/*) f=`echo $$p | sed s|^$$srcdirstrip/||`;; \
@@ -321,9 +319,9 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 nodist_include_HEADERS = $(CONFIG_HEADER)
-include_HEADERS = version.h $(am__append_1)
-SUBDIRS = nocore copperplate alchemy psos vxworks $(am__append_2) \
-   $(am__append_3)
+include_HEADERS = version.h
+SUBDIRS = nocore copperplate alchemy psos vxworks $(am__append_1) \
+   $(am__append_2)
 EXTRA_DIST = testing
 all: xeno_config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
diff --git a/include/cobalt/stdio.h b/include/cobalt/stdio.h
index 2af2265..c806e8e 100644
--- a/include/cobalt/stdio.h
+++ b/include/cobalt/stdio.h
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2006 Gilles Chanteperdrix gilles.chanteperd...@xenomai.org.
+ * Copyright (C) 2007 Jan Kiszka jan.kis...@web.de.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -43,6 +44,12 @@ COBALT_DECL(int, __printf_chk(int flag, const char *fmt, 
...));
 
 COBALT_DECL(int, __fprintf_chk(FILE *fp, int flag, const char *fmt, ...));
 
+int __rt_vfprintf_chk(FILE *stream, int level,
+ const char *fmt, va_list args);
+
+void __rt_vsyslog_chk(int priority, int level,
+ const char *fmt, va_list args);
+
 #endif /* CONFIG_XENO_FORTIFY */
 
 COBALT_DECL(int, vprintf(const char *fmt, va_list args));
@@ -71,7 +78,44 @@ int __wrap_putchar(int c);
 
 #endif
 
-COBALT_DECL(size_t, fwrite(const void *ptr, size_t sz, size_t nmemb, FILE 
*stream));
+COBALT_DECL(size_t,
+   fwrite(const void *ptr, size_t sz, size_t nmemb, FILE *stream));
+
+int rt_vfprintf(FILE *stream, const char *format, va_list args);
+
+int rt_vprintf(const char *format, va_list args);
+
+int rt_fprintf(FILE *stream, const char *format, ...);
+
+int rt_printf(const char *format, ...);
+
+int rt_puts(const char *s);
+
+int rt_fputs(const char *s, FILE *stream);
+
+int rt_fputc(int c, FILE *stream);
+
+int rt_putchar(int c);
+
+size_t rt_fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream);
+
+void rt_syslog(int priority, const char *format, ...);
+
+void rt_vsyslog(int priority, const char *format, va_list args);
+
+int rt_print_init(size_t buffer_size, const char *name);
+
+void rt_print_cleanup(void);
+
+void rt_print_auto_init(int enable);
+
+const char *rt_print_buffer_name(void);
+
+void rt_print_flush_buffers(void);
+
+void assert_nrt(void);
+
+void assert_nrt_fast(void);
 
 #ifdef __cplusplus
 }
diff --git a/include/rtdk.h b/include/rtdk.h
deleted file mode 100644
index ecebbff..000
--- a/include/rtdk.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (C) 2007 Jan Kiszka jan.kis...@web.de.
- *
- * This library is free software; 

[Xenomai-git] Philippe Gerum : cobalt/shadow, blackfin: drop rescheduling check in head syscall handler

2013-07-08 Thread git repository hosting
Module: xenomai-forge
Branch: master
Commit: 30c6de32e656b21fb252e222099539e7f8dec201
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=30c6de32e656b21fb252e222099539e7f8dec201

Author: Philippe Gerum r...@xenomai.org
Date:   Sat Jul  6 17:09:20 2013 +0200

cobalt/shadow, blackfin: drop rescheduling check in head syscall handler

Only blackfin may have deferred rescheduling, which is already
performed via the arch-specific IRQ tail hook, prior to running the
Xenomai syscall handler. We don't have to duplicate this.

At this chance, Blackfin's deferred rescheduling hook is made private
to the machine support code.

---

 .../arch/blackfin/include/asm/xenomai/thread.h |8 
 kernel/cobalt/arch/blackfin/machine.c  |9 +++--
 .../cobalt/include/asm-generic/xenomai/syscall.h   |4 
 kernel/cobalt/pod.c|6 --
 kernel/cobalt/shadow.c |2 --
 5 files changed, 7 insertions(+), 22 deletions(-)

diff --git a/kernel/cobalt/arch/blackfin/include/asm/xenomai/thread.h 
b/kernel/cobalt/arch/blackfin/include/asm/xenomai/thread.h
index 5bb6ae4..302675a 100644
--- a/kernel/cobalt/arch/blackfin/include/asm/xenomai/thread.h
+++ b/kernel/cobalt/arch/blackfin/include/asm/xenomai/thread.h
@@ -50,14 +50,6 @@ struct xnarchtcb {
 
 #define xnarch_fault_notify(d) (!xnarch_fault_bp_p(d))
 
-#define __xnarch_head_syscall_entry()  \
-   do  {   \
-   if (xnsched_resched_p(xnpod_current_sched()))   \
-   xnpod_schedule();   \
-   } while(0)
-
-#define xnarch_head_syscall_entry  __xnarch_head_syscall_entry
-
 void xnarch_switch_to(struct xnarchtcb *out_tcb, struct xnarchtcb *in_tcb);
 
 int xnarch_escalate(void);
diff --git a/kernel/cobalt/arch/blackfin/machine.c 
b/kernel/cobalt/arch/blackfin/machine.c
index e48b8c4..ef279d6 100644
--- a/kernel/cobalt/arch/blackfin/machine.c
+++ b/kernel/cobalt/arch/blackfin/machine.c
@@ -18,6 +18,7 @@
  *   02111-1307, USA.
  */
 #include linux/stddef.h
+#include cobalt/kernel/pod.h
 #include asm/xenomai/machine.h
 
 static unsigned long mach_blackfin_calibrate(void)
@@ -25,11 +26,15 @@ static unsigned long mach_blackfin_calibrate(void)
return 20;  /* 20 clock cycles */
 }
 
-void xnpod_schedule_deferred(void);
+static void schedule_deferred(void)
+{
+   if (xnpod_active_p())
+   xnpod_schedule();
+}
 
 static int mach_blackfin_init(void)
 {
-   __ipipe_irq_tail_hook = (unsigned long)xnpod_schedule_deferred;
+   __ipipe_irq_tail_hook = (unsigned long)schedule_deferred;
 
return 0;
 }
diff --git a/kernel/cobalt/include/asm-generic/xenomai/syscall.h 
b/kernel/cobalt/include/asm-generic/xenomai/syscall.h
index ba4a2a5..4f2b22d 100644
--- a/kernel/cobalt/include/asm-generic/xenomai/syscall.h
+++ b/kernel/cobalt/include/asm-generic/xenomai/syscall.h
@@ -122,8 +122,4 @@ static inline int __xn_safe_strncpy_from_user(char *dst,
return __xn_strncpy_from_user(dst, src, count);
 }
 
-#ifndef xnarch_head_syscall_entry
-static inline void xnarch_head_syscall_entry(void) { }
-#endif
-
 #endif /* !_COBALT_ASM_GENERIC_SYSCALL_H */
diff --git a/kernel/cobalt/pod.c b/kernel/cobalt/pod.c
index 153bf8d..78f14c4 100644
--- a/kernel/cobalt/pod.c
+++ b/kernel/cobalt/pod.c
@@ -216,12 +216,6 @@ void __xnpod_schedule_handler(void) /* hw interrupts off. 
*/
xnpod_schedule();
 }
 
-void xnpod_schedule_deferred(void)
-{
-   if (xnpod_active_p())
-   xnpod_schedule();
-}
-
 static void xnpod_flush_heap(struct xnheap *heap,
 void *extaddr, unsigned long extsize, void *cookie)
 {
diff --git a/kernel/cobalt/shadow.c b/kernel/cobalt/shadow.c
index ca0d00f..c53d1a2 100644
--- a/kernel/cobalt/shadow.c
+++ b/kernel/cobalt/shadow.c
@@ -1869,8 +1869,6 @@ static int handle_head_syscall(struct ipipe_domain *ipd, 
struct pt_regs *regs)
if (!xnpod_active_p())
goto no_personality;
 
-   xnarch_head_syscall_entry();
-
thread = xnshadow_current();
if (thread)
thread-regs = regs;


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


[Xenomai-git] Philippe Gerum : build: introduce symbols-only debug level

2013-07-08 Thread git repository hosting
Module: xenomai-forge
Branch: master
Commit: 2b6326701c2261ab42e3203a29782ad8905f0665
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=2b6326701c2261ab42e3203a29782ad8905f0665

Author: Philippe Gerum r...@xenomai.org
Date:   Sun Jul  7 18:43:15 2013 +0200

build: introduce symbols-only debug level

--enable-debug[=partial]

symbols enables debug symbols to be compiled in the libraries and
executables, still turning on the optimizer (-O2). This option has no
overhead, it is useful to get meaningful backtraces using gdb while
running the application at nominal speed.

partial includes symbols, and also turns on internal consistency
checks within the Xenomai code (mostly present in the Copperplate
layer). The __XENO_DEBUG__ macro is defined, for both the Xenomai core
and the applications getting their C compilation flags from the
xeno-config script (i.e. xeno-config --cflags). The partial debug mode
implicitly turns on --enable-assert. A measurable overhead is
introduced by this level.  This is the default level when
--enable-debug is mentioned with no level specification.

full includes partial settings, but the optimizer is disabled
(-O0), and even more consistency checks may be performed.  In addition
to __XENO_DEBUG__, the macro __XENO_DEBUG_FULL__ is defined. This
level introduces the most overhead, which may triple the worst-case
latency, or even more.

---

 README   |   50 ++
 configure|   26 ++
 configure.in |   28 +++-
 3 files changed, 79 insertions(+), 25 deletions(-)

diff --git a/README b/README
index 17852e7..8185280 100644
--- a/README
+++ b/README
@@ -93,25 +93,43 @@ Where other-options may be any standard autoconf switch, 
such as:
 
 or Xenomai-specific knobs:
 
---enable-debug[=full]
+--enable-debug[=partial]
 
-   This switch will enable debug mode, causing debug symbols to
-   be compiled in the libraries and executables, passing the -g
-   flag to the compiler to get debug symbols. When enabled, this
-   switch also causes the __XENO_DEBUG__ macro to be defined, for
-   both the Xenomai core and the applications getting their C
-   compilation flags from the xeno-config script
-   (i.e. xeno-config --cflags).  Debug mode is off by default.
+   This switch controls the debug level. Three levels are
+   available, with varying overhead:
 
-   If the full debug level is specified along with this switch,
-   -O0 is passed to the compiler, to disable the optimizer. In
-   addition, the macro __XENO_DEBUG_FULL__ is also defined.
+   symbols enables debug symbols to be compiled in the
+   libraries and executables, still turning on the optimizer
+   (-O2). This option has no overhead, it is useful to get
+   meaningful backtraces using gdb while running the application
+   at nominal speed.
 
-   Over the Mercury core, enabling debug mode also causes the
-   standard malloc interface to be used internally instead of a
-   fast real-time allocator (TLSF). This allows debugging
-   memory-related issues with the help of Valgrind or other
-   dynamic memory analysers.
+   partial includes symbols, and also turns on internal
+   consistency checks within the Xenomai code (mostly present in
+   the Copperplate layer). The __XENO_DEBUG__ macro is defined,
+   for both the Xenomai core and the applications getting their C
+   compilation flags from the xeno-config script
+   (i.e. xeno-config --cflags). The partial debug mode implicitly
+   turns on --enable-assert. A measurable overhead is introduced
+   by this level.  This is the default level when --enable-debug
+   is mentioned with no level specification.
+
+   full includes partial settings, but the optimizer is
+   disabled (-O0), and even more consistency checks may be
+   performed.  In addition to __XENO_DEBUG__, the macro
+   __XENO_DEBUG_FULL__ is defined. This level introduces the most
+   overhead, which may triple the worst-case latency, or even
+   more.
+
+   Over the Mercury core, enabling partial or full debug
+   modes also causes the standard malloc interface to be used
+   internally instead of a fast real-time allocator (TLSF). This
+   allows debugging memory-related issues with the help of
+   Valgrind or other dynamic memory analysers.
+
+   --disable-debug fully turns off all consistency checks and
+  assertions, turns on the optimizer and disables debug symbol
+  generation.
 
 --enable-assert
 
diff --git a/configure b/configure
index c4580df..d936571 100755
--- a/configure
+++ b/configure
@@ -12656,14 +12656,30 @@ CC=$lt_save_CC
 
 
 debug_mode=
+debug_symbols=
 { $as_echo $as_me:${as_lineno-$LINENO}: checking whether to enable debug 
mode 5
 $as_echo_n checking whether to enable debug mode...  6; }
 # Check whether 

[Xenomai-git] Philippe Gerum : copperplate: rebase atomic ops over nocore/atomic.h

2013-07-08 Thread git repository hosting
Module: xenomai-forge
Branch: master
Commit: 1d62c6b5c8dd841f2427a02cf4446df57428b321
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=1d62c6b5c8dd841f2427a02cf4446df57428b321

Author: Philippe Gerum r...@xenomai.org
Date:   Sat Jul  6 17:29:15 2013 +0200

copperplate: rebase atomic ops over nocore/atomic.h

---

 include/copperplate/lock.h |   13 +
 include/nocore/atomic.h|   28 +++-
 2 files changed, 24 insertions(+), 17 deletions(-)

diff --git a/include/copperplate/lock.h b/include/copperplate/lock.h
index 7f1013c..60a1dac 100644
--- a/include/copperplate/lock.h
+++ b/include/copperplate/lock.h
@@ -20,6 +20,7 @@
 #define _COPPERPLATE_LOCK_H
 
 #include pthread.h
+#include nocore/atomic.h
 #include copperplate/wrappers.h
 #include copperplate/debug.h
 
@@ -204,18 +205,6 @@ int __check_cancel_type(const char *locktype);
 #define read_unlock_safe(__lock, __state)  \
__do_unlock_safe(__lock, __state)
 
-#define barrier()  __asm__ __volatile__(: : :memory)
-#define membar()   __sync_synchronize()
-#ifdef CONFIG_SMP
-#define smp_membar()   membar()
-#else
-#define smp_membar()   do { } while (0)
-#endif
-
-#define atomic_sub_fetch(v, n) __sync_sub_and_fetch((v), n)
-#define atomic_add_fetch(v, n) __sync_add_and_fetch((v), n)
-#define atomic_cmp_swap(ptr, old, new)  __sync_val_compare_and_swap(ptr, old, 
new)
-
 #ifdef __cplusplus
 extern C {
 #endif
diff --git a/include/nocore/atomic.h b/include/nocore/atomic.h
index 8cd236a..d4101c9 100644
--- a/include/nocore/atomic.h
+++ b/include/nocore/atomic.h
@@ -44,18 +44,36 @@ typedef struct {
(typeof((p)-v))(n))
 #endif
 
-#ifndef smp_mb
-#define smp_mb() __sync_synchronize()
+#ifndef atomic_sub_fetch
+#define atomic_sub_fetch(v, n) _sync_sub_and_fetch((v), n)
 #endif
 
-#ifndef smp_rmb
-#define smp_rmb() __sync_synchronize()
+#ifndef atomic_add_fetch
+#define atomic_add_fetch(v, n) __sync_add_and_fetch((v), n)
 #endif
 
+#ifndef atomic_cmp_swap
+#define atomic_cmp_swap(ptr, old, new)  __sync_val_compare_and_swap(ptr, old, 
new)
+#endif
+
+#ifdef CONFIG_SMP
+#ifndef smp_mb
+#define smp_mb()   __sync_synchronize()
+#endif
+#ifndef smp_rmb
+#define smp_rmb()  smp_mb()
+#endif
 #ifndef smp_wmb
-#define smp_wmb() __sync_synchronize()
+#define smp_wmb()  smp_mb()
 #endif
+#else  /* !CONFIG_SMP */
+#define smp_mb()   do { } while (0)
+#define smp_rmb()  do { } while (0)
+#define smp_wmb()  do { } while (0)
+#endif /* !CONFIG_SMP */
 
 #define ACCESS_ONCE(x) (*(volatile typeof(x) *)(x))
 
+#define barrier()  __asm__ __volatile__(: : :memory)
+
 #endif /* _NOCORE_ATOMIC_H */


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


[Xenomai-git] Philippe Gerum : scripts/xeno-config: allow shorthand for API name

2013-07-08 Thread git repository hosting
Module: xenomai-forge
Branch: master
Commit: 14372f715210df5e2330cc39fbc4bc09fe444e16
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=14372f715210df5e2330cc39fbc4bc09fe444e16

Author: Philippe Gerum r...@xenomai.org
Date:   Sun Jul  7 17:38:56 2013 +0200

scripts/xeno-config: allow shorthand for API name

--skin=api and --api are equivalent.

---

 scripts/xeno-config-cobalt.in  |8 ++--
 scripts/xeno-config-mercury.in |8 ++--
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/scripts/xeno-config-cobalt.in b/scripts/xeno-config-cobalt.in
index 618ee2f..2b5e01e 100644
--- a/scripts/xeno-config-cobalt.in
+++ b/scripts/xeno-config-cobalt.in
@@ -41,7 +41,7 @@ dump_wrappers()
 usage ()
 {
 cat EOF
-Usage xeno-config --skin=name OPTIONS
+Usage xeno-config OPTIONS
 Options :
 --help
 --v,--verbose
@@ -50,7 +50,7 @@ Options :
 --ccld
 --arch
 --prefix
---skin posix|cobalt|vxworks|psos|alchemy
+--[skin=]posix/cobalt|vxworks|psos|alchemy
 --cflags
 --ldflags
 --lib*-dir,--libdir,--user-libdir
@@ -62,6 +62,7 @@ EOF
 verbose ()
 {
 echo xeno-config --verbose
+echo --core=cobalt
 echo --version=\${XENO_VERSION}\
 echo --cc=\$XENO_CC\
 echo --ccld=\$XENO_PREFIX/bin/wrap-link.sh $XENO_CC\
@@ -106,6 +107,9 @@ while test $# -gt 0; do
--skin=*)
skin_list=$skin_list `expr $1 : '--skin=\(.*\)'`
;;
+   --posix|--cobalt|--vxworks|--psos|--alchemy)
+   skin_list=$skin_list `expr $1 : '--\(.*\)'`
+   ;;
--cflags)
if test -z $skin_list; then
echo no skin specified, missing --skin before --cflags 12
diff --git a/scripts/xeno-config-mercury.in b/scripts/xeno-config-mercury.in
index 14bcaea..1d252d5 100644
--- a/scripts/xeno-config-mercury.in
+++ b/scripts/xeno-config-mercury.in
@@ -23,7 +23,7 @@ unset prefix exec_prefix libdir datadir datarootdir 
pkgdatadir includedir skin_l
 usage ()
 {
 cat EOF
-Usage xeno-config --skin=skin OPTIONS
+Usage xeno-config OPTIONS
 Options :
 --help
 --v,--verbose
@@ -32,7 +32,7 @@ Options :
 --ccld
 --arch
 --prefix
---skin vxworks|psos|alchemy
+--[skin=]vxworks|psos|alchemy
 --cflags
 --ldflags
 --lib*-dir,--libdir,--user-libdir
@@ -44,6 +44,7 @@ EOF
 verbose ()
 {
 echo xeno-config --verbose
+echo --core=mercury
 echo --version=\${XENO_VERSION}\
 echo --cc=\$XENO_CC\
 echo --ccld=\$XENO_CC\
@@ -85,6 +86,9 @@ while test $# -gt 0; do
--skin=*)
skin_list=$skin_list `expr $1 : '--skin=\(.*\)'`
;;
+   --vxworks|--psos|--alchemy)
+   skin_list=$skin_list `expr $1 : '--\(.*\)'`
+   ;;
--cflags)
if test -z $skin_list; then
echo no skin specified, missing --skin before --cflags 12


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