[Xenomai-git] Gilles Chanteperdrix : mayday: fix xnshadow_sys_mayday return value

2012-05-15 Thread GIT version control
Module: xenomai-2.6
Branch: master
Commit: 1b8d21f4675216b0f8f687dee18fe6564f4d7ad7
URL:
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=1b8d21f4675216b0f8f687dee18fe6564f4d7ad7

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Tue May 15 14:16:26 2012 +0200

mayday: fix xnshadow_sys_mayday return value

This avoids clobbering the calling process registers

---

 ksrc/nucleus/shadow.c |7 ++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/ksrc/nucleus/shadow.c b/ksrc/nucleus/shadow.c
index 05b7a1b..16e570b 100644
--- a/ksrc/nucleus/shadow.c
+++ b/ksrc/nucleus/shadow.c
@@ -1663,7 +1663,12 @@ static int xnshadow_sys_mayday(struct pt_regs *regs)
 * relax. See do_hisyscall_event().
 */
xnarch_fixup_mayday(xnthread_archtcb(cur), regs);
-   return 0;
+
+   /* returning 0 here would clobber the register holding
+  the return value. Instead, return whatever value
+  xnarch_fixup_mayday set for this register, in order
+  not to undo what xnarch_fixup_mayday did. */
+   return __xn_reg_rval(regs);
}
 
printk(KERN_WARNING


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


[Xenomai-git] Gilles Chanteperdrix : mayday: fix xnshadow_sys_mayday return value

2012-05-15 Thread GIT version control
Module: xenomai-gch
Branch: for-forge
Commit: a4fb1e57a9f00dfa46d694435d7b4304fb77a834
URL:
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=a4fb1e57a9f00dfa46d694435d7b4304fb77a834

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Tue May 15 14:16:26 2012 +0200

mayday: fix xnshadow_sys_mayday return value

This avoids clobbering the calling process registers

---

 kernel/cobalt/nucleus/shadow.c |7 ++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/kernel/cobalt/nucleus/shadow.c b/kernel/cobalt/nucleus/shadow.c
index 8ad8e17..9661e92 100644
--- a/kernel/cobalt/nucleus/shadow.c
+++ b/kernel/cobalt/nucleus/shadow.c
@@ -1215,7 +1215,12 @@ static int xnshadow_sys_mayday(void)
 * handle_head_syscall().
 */
xnarch_fixup_mayday(xnthread_archtcb(cur), cur-regs);
-   return 0;
+
+   /* returning 0 here would clobber the register holding
+  the return value. Instead, return whatever value
+  xnarch_fixup_mayday set for this register, in order
+  not to undo what xnarch_fixup_mayday did. */
+   return __xn_reg_rval(regs);
}
 
printk(KERN_WARNING


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


[Xenomai-git] Gilles Chanteperdrix : posix: get pthread_set_name_np to set linux thread name too

2012-05-14 Thread GIT version control
Module: xenomai-2.6
Branch: master
Commit: e379fc6dac2866cae9a71eed4044186682627b4d
URL:
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=e379fc6dac2866cae9a71eed4044186682627b4d

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Tue May 15 00:52:04 2012 +0200

posix: get pthread_set_name_np to set linux thread name too

---

 ksrc/skins/posix/syscall.c |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/ksrc/skins/posix/syscall.c b/ksrc/skins/posix/syscall.c
index 455e2e1..9f5d315 100644
--- a/ksrc/skins/posix/syscall.c
+++ b/ksrc/skins/posix/syscall.c
@@ -422,6 +422,7 @@ static int __pthread_set_name_np(struct pt_regs *regs)
 {
char name[XNOBJECT_NAME_LEN];
struct pse51_hkey hkey;
+   struct task_struct *p;
pthread_t k_tid;
 
if (__xn_safe_strncpy_from_user(name,
@@ -434,6 +435,9 @@ static int __pthread_set_name_np(struct pt_regs *regs)
hkey.u_tid = __xn_reg_arg1(regs);
hkey.mm = current-mm;
k_tid = __pthread_find(hkey);
+   p = xnthread_user_task(k_tid-threadbase);
+   strncpy(p-comm, name, sizeof(p-comm));
+   p-comm[sizeof(p-comm) - 1] = '\0';
 
return -pthread_set_name_np(k_tid, name);
 }


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


[Xenomai-git] Gilles Chanteperdrix : posix: get pthread_set_name_np to set linux thread name too

2012-05-14 Thread GIT version control
Module: xenomai-gch
Branch: for-forge
Commit: efb43695ca362b73769f96fc59eadc952d2901ed
URL:
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=efb43695ca362b73769f96fc59eadc952d2901ed

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Tue May 15 00:55:03 2012 +0200

posix: get pthread_set_name_np to set linux thread name too

---

 kernel/cobalt/thread.c |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/kernel/cobalt/thread.c b/kernel/cobalt/thread.c
index d3fbb86..6459eef 100644
--- a/kernel/cobalt/thread.c
+++ b/kernel/cobalt/thread.c
@@ -1094,6 +1094,7 @@ int cobalt_thread_set_name_np(unsigned long tid, const 
char __user *u_name)
 {
char name[XNOBJECT_NAME_LEN];
struct cobalt_hkey hkey;
+   struct task_struct *p;
pthread_t k_tid;
 
if (__xn_safe_strncpy_from_user(name, u_name,
@@ -1106,6 +1107,10 @@ int cobalt_thread_set_name_np(unsigned long tid, const 
char __user *u_name)
hkey.mm = current-mm;
k_tid = cobalt_thread_find(hkey);
 
+   p = xnthread_user_task(k_tid-threadbase);
+   strncpy(p-comm, name, sizeof(p-comm));
+   p-comm[sizeof(p-comm) - 1] = '\0';
+
return pthread_set_name_np(k_tid, name);
 }
 


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


[Xenomai-git] Gilles Chanteperdrix : hal/x86: detect calibration at run-time

2012-05-13 Thread GIT version control
Module: xenomai-gch
Branch: for-forge
Commit: 02ecff5029afcf7ace8a007ffeb676baec1f9d7b
URL:
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=02ecff5029afcf7ace8a007ffeb676baec1f9d7b

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Sun May 13 16:41:47 2012 +0200

hal/x86: detect calibration at run-time

---

 include/asm-x86/calibration.h |   62 +++-
 1 files changed, 42 insertions(+), 20 deletions(-)

diff --git a/include/asm-x86/calibration.h b/include/asm-x86/calibration.h
index 864669a..8b60486 100644
--- a/include/asm-x86/calibration.h
+++ b/include/asm-x86/calibration.h
@@ -28,30 +28,52 @@ static inline unsigned long xnarch_get_sched_latency (void)
 
 #if CONFIG_XENO_OPT_TIMING_SCHEDLAT != 0
sched_latency = CONFIG_XENO_OPT_TIMING_SCHEDLAT;
-#else
+#else /* !CONFIG_XENO_OPT_TIMING_SCHEDLAT */
+
+   if (strcmp(RTHAL_TIMER_DEVICE, lapic) == 0) {
 #ifdef CONFIG_SMP
-   sched_latency = 3350;
-#elif defined(CONFIG_X86_LOCAL_APIC)
-   sched_latency = 1000;
-#else /* !CONFIG_X86_LOCAL_APIC */
-   /*
-* Use the bogomips formula to identify low-end x86 boards
-* when using the 8254 PIT. The following is still grossly
-* experimental and needs work (i.e. more specific cases), but
-* the approach is definitely saner than previous attempts to
-* guess such value dynamically.
-*/
-#if LINUX_VERSION_CODE  KERNEL_VERSION(2,6,38)
-#define __bogomips (current_cpu_data.loops_per_jiffy/(50/HZ))
-#else
+   if (num_online_cpus()  1)
+   sched_latency = 3350;
+   else
+   sched_latency = 2000;
+#else /* !SMP */
+   sched_latency = 1000;
+#endif /* !SMP */
+   } else if (strcmp(RTHAL_TIMER_DEVICE, pit)) { /* HPET */
+#ifdef CONFIG_SMP
+   if (num_online_cpus()  1)
+   sched_latency = 3350;
+   else
+   sched_latency = 1500;
+#else /* !SMP */
+   sched_latency = 1000;
+#endif /* !SMP */
+   } else {
+   /*
+* Use the bogomips formula to identify low-end x86 boards
+* when using the 8254 PIT. The following is still grossly
+* experimental and needs work (i.e. more specific cases), but
+* the approach is definitely saner than previous attempts to
+* guess such value dynamically.
+*/
+#ifdef CONFIG_IPIPE_CORE
+#define __bogomips (this_cpu_read(cpu_info.loops_per_jiffy)/(50/HZ))
+#elif LINUX_VERSION_CODE = KERNEL_VERSION(2,6,38)
 #define __bogomips (cpu_info.loops_per_jiffy/(50/HZ))
+#else
+#define __bogomips (current_cpu_data.loops_per_jiffy/(50/HZ))
 #endif
-   sched_latency = (__bogomips  250 ? 17000 :
-__bogomips  2500 ? 4200 :
-3500);
+
+   sched_latency = (__bogomips  250 ? 17000 :
+__bogomips  2500 ? 4200 :
+3500);
 #undef __bogomips
-#endif /* CONFIG_X86_LOCAL_APIC */
-#endif /* CONFIG_XENO_OPT_TIMING_SCHEDLAT */
+
+#ifdef CONFIG_SMP
+   sched_latency += 1000;
+#endif /* CONFIG_SMP */
+   }
+#endif /* !CONFIG_XENO_OPT_TIMING_SCHEDLAT */
 
return sched_latency;
 }


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


[Xenomai-git] Gilles Chanteperdrix : hal/arm: support backport of linux 3.2 VFP fixes

2012-05-13 Thread GIT version control
Module: xenomai-gch
Branch: for-forge
Commit: d63ca76f68c93c8e33d93e75c6ca9724853096a6
URL:
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=d63ca76f68c93c8e33d93e75c6ca9724853096a6

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Thu May 10 01:17:32 2012 +0200

hal/arm: support backport of linux 3.2 VFP fixes

---

 include/asm-arm/hal.h   |8 +++-
 include/asm-arm/wrappers.h  |2 +-
 kernel/cobalt/arch/arm/switch.S |3 ++-
 3 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/include/asm-arm/hal.h b/include/asm-arm/hal.h
index 1553435..a556bdb 100644
--- a/include/asm-arm/hal.h
+++ b/include/asm-arm/hal.h
@@ -227,6 +227,10 @@ static inline void rthal_init_fpu(rthal_fpenv_t *fpuenv)
/* vfpstate has already been zeroed by xnarch_init_fpu */
fpuenv-vfpstate.hard.fpexc = FPEXC_EN;
fpuenv-vfpstate.hard.fpscr = FPSCR_ROUND_NEAREST;
+#if (LINUX_VERSION_CODE = KERNEL_VERSION(3, 2, 0) \
+ || defined(CONFIG_VFP_3_2_BACKPORT))  defined(CONFIG_SMP)
+   fpuenv-vfpstate.hard.cpu = NR_CPUS;
+#endif /* linux = 3.2.0 */
 #endif
 }
 
@@ -280,7 +284,8 @@ static inline rthal_fpenv_t *rthal_get_fpu_owner(void)
if (!vfp_owner)
return NULL;
 
-#if LINUX_VERSION_CODE = KERNEL_VERSION(3, 2, 0)  defined(CONFIG_SMP)
+#if (LINUX_VERSION_CODE = KERNEL_VERSION(3, 2, 0) \
+ || defined(CONFIG_VFP_3_2_BACKPORT))  defined(CONFIG_SMP)
if (vfp_owner-hard.cpu != cpu)
return NULL;
 #endif /* linux = 3.2.0 */
@@ -301,6 +306,7 @@ static inline rthal_fpenv_t *rthal_get_fpu_owner(void)
_fpexc; \
})
 
+
 #else /* !CONFIG_VFP */
 static inline void rthal_save_fpu(rthal_fpenv_t *fpuenv)
 {
diff --git a/include/asm-arm/wrappers.h b/include/asm-arm/wrappers.h
index 0a89a03..debf745 100644
--- a/include/asm-arm/wrappers.h
+++ b/include/asm-arm/wrappers.h
@@ -33,7 +33,7 @@
 #define __put_user_inatomic __put_user
 #define __get_user_inatomic __get_user
 
-#if LINUX_VERSION_CODE  KERNEL_VERSION(3, 1, 0)
+#if LINUX_VERSION_CODE  KERNEL_VERSION(3, 1, 0)  
!defined(CONFIG_VFP_3_2_BACKPORT)
 #define vfp_current_hw_state last_VFP_context
 #endif /* Linux  3.1 */
 
diff --git a/kernel/cobalt/arch/arm/switch.S b/kernel/cobalt/arch/arm/switch.S
index 243ee7f..83f4746 100644
--- a/kernel/cobalt/arch/arm/switch.S
+++ b/kernel/cobalt/arch/arm/switch.S
@@ -100,7 +100,8 @@ ENTRY(rthal_vfp_save)
  * r1 = current cpu
  */
 ENTRY(rthal_vfp_load)
-#if LINUX_VERSION_CODE = KERNEL_VERSION(3, 2, 0)  defined(CONFIG_SMP)
+#if (LINUX_VERSION_CODE = KERNEL_VERSION(3, 2, 0) \
+   || defined(CONFIG_VFP_3_2_BACKPORT))  defined(CONFIG_SMP)
 strr1, [r0, #VFP_CPU]
 #endif
 VFPFLDMIA  r0, r2  @ reload the working registers while


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


[Xenomai-git] Gilles Chanteperdrix : testsuite: add latency options and gnuplot script to generate histograms

2012-05-13 Thread GIT version control
Module: xenomai-gch
Branch: for-forge
Commit: 4bcaa1e9655a0abf17dde7fe11b1d3b31349885c
URL:
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=4bcaa1e9655a0abf17dde7fe11b1d3b31349885c

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Sat May 12 13:37:27 2012 +0200

testsuite: add latency options and gnuplot script to generate histograms

---

 scripts/Makefile.am |3 +-
 scripts/Makefile.in |3 +-
 scripts/histo.gp|   21 +
 testsuite/latency/latency.c |   51 +--
 4 files changed, 69 insertions(+), 9 deletions(-)

diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index 98d1998..2e0c0dd 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -12,4 +12,5 @@ EXTRA_DIST = \
prepare-patch.sh \
wrap-link.sh \
Kconfig.frag \
-   $(wildcard postinstall.sh)
+   $(wildcard postinstall.sh) \
+   histo.gp
diff --git a/scripts/Makefile.in b/scripts/Makefile.in
index 3bdd1fd..766aef7 100644
--- a/scripts/Makefile.in
+++ b/scripts/Makefile.in
@@ -245,7 +245,8 @@ EXTRA_DIST = \
prepare-patch.sh \
wrap-link.sh \
Kconfig.frag \
-   $(wildcard postinstall.sh)
+   $(wildcard postinstall.sh) \
+   histo.gp
 
 all: all-am
 
diff --git a/scripts/histo.gp b/scripts/histo.gp
new file mode 100644
index 000..64a627a
--- /dev/null
+++ b/scripts/histo.gp
@@ -0,0 +1,21 @@
+#
+# Run this gnuplot script with the command line:
+#
+# gnuplot -e 
'input_file=/path/to/input;output_file=/path/to/output.png;graph_title=title
 text' /path/to/histo.gp
+#
+# where the input file is generated using latency option -g
+#
+
+set terminal png size 1024,768
+set output output_file
+
+set title graph_title
+set xlabel user-space latency in microseconds
+set ylabel occurences + 1 (log)
+set logscale y
+set key off;
+
+set bar 1.00
+set style fill  solid 1.00 border -1
+set style rectangle back fc lt -3 fillstyle  solid 1.00 border -1
+plot input_file w line
diff --git a/testsuite/latency/latency.c b/testsuite/latency/latency.c
index c12cb5f..4766488 100644
--- a/testsuite/latency/latency.c
+++ b/testsuite/latency/latency.c
@@ -56,13 +56,16 @@ int test_loops = 0; /* outer loop count */
 
 /* Warmup time : in order to avoid spurious cache effects on low-end machines. 
*/
 #define WARMUP_TIME 1
-#define HISTOGRAM_CELLS 100
+#define HISTOGRAM_CELLS 300
 int histogram_size = HISTOGRAM_CELLS;
 long *histogram_avg = NULL, *histogram_max = NULL, *histogram_min = NULL;
 
+char *do_gnuplot = NULL;
 int do_histogram = 0, do_stats = 0, finished = 0;
 int bucketsize = 1000; /* default = 1000ns, -B size to override */
 
+#define need_histo() (do_histogram || do_stats || do_gnuplot)
+
 static inline void add_histogram(long *histogram, long addval)
 {
/* bucketsize steps */
@@ -145,12 +148,12 @@ void latency(void *cookie)
gmaxjitter = dt;
}
 
-   if (!(finished || warmup)  (do_histogram || do_stats))
+   if (!(finished || warmup)  need_histo())
add_histogram(histogram_avg, dt);
}
 
if (!warmup) {
-   if (!finished  (do_histogram || do_stats)) {
+   if (!finished  need_histo()) {
add_histogram(histogram_max, maxj);
add_histogram(histogram_min, minj);
}
@@ -204,8 +207,7 @@ void display(void *cookie)
config.period = period_ns;
config.priority = priority;
config.warmup_loops = WARMUP_TIME;
-   config.histogram_size = (do_histogram
-|| do_stats) ? histogram_size : 0;
+   config.histogram_size = need_histo() ? histogram_size : 0;
config.histogram_bucketsize = bucketsize;
config.freeze_max = freeze_max;
 
@@ -327,6 +329,33 @@ double dump_histogram(long *histogram, char *kind)
return avg;
 }
 
+void dump_histo_gnuplot(long *histogram)
+{
+   unsigned start, stop;
+   FILE *f;
+   int n;
+
+   f = fopen(do_gnuplot, w);
+   if (!f)
+   return;
+
+   for (n = 0; n  histogram_size  histogram[n] == 0L; n++)
+   ;
+   start = n;
+
+   for (n = histogram_size - 1; n = 0  histogram[n] == 0L; n--)
+   ;
+   stop = n;
+
+   fprintf(f, %g 1\n, start * bucketsize / 1000.0);
+   for (n = start; n = stop; n++)
+   fprintf(f, %g %ld\n,
+   (n + 0.5) * bucketsize / 1000.0, histogram[n] + 1);
+   fprintf(f, %g 1\n, (stop + 1) * bucketsize / 1000.0);
+
+   fclose(f);
+}
+
 void dump_stats(long *histogram, char *kind, double avg)
 {
int n, total_hits = 0;
@@ -366,6 +395,9 @@ void dump_hist_stats(void)

[Xenomai-git] Gilles Chanteperdrix : posix: fix build with LFS flags on 64 bits platform

2012-05-12 Thread GIT version control
Module: xenomai-2.6
Branch: master
Commit: 3a59ec791cc756177560bb1d804cadf276feeea5
URL:
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=3a59ec791cc756177560bb1d804cadf276feeea5

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Thu May 10 01:18:18 2012 +0200

posix: fix build with LFS flags on 64 bits platform

---

 include/posix/sys/mman.h   |2 --
 include/posix/unistd.h |2 --
 src/skins/posix/shm.c  |4 +---
 src/skins/posix/wrappers.c |2 --
 4 files changed, 1 insertions(+), 9 deletions(-)

diff --git a/include/posix/sys/mman.h b/include/posix/sys/mman.h
index a304755..a542759 100644
--- a/include/posix/sys/mman.h
+++ b/include/posix/sys/mman.h
@@ -70,7 +70,6 @@ void *__real_mmap(void *addr,
  int fildes,
  long off);
 
-#if __WORDSIZE == 32
 #if defined(_LARGEFILE64_SOURCE) \
|| defined(_FILE_OFFSET_BITS)  _FILE_OFFSET_BITS == 64
 void *__real_mmap64(void *addr,
@@ -84,7 +83,6 @@ void *__real_mmap64(void *addr,
 #if defined(_FILE_OFFSET_BITS)  _FILE_OFFSET_BITS == 64
 #define __real_mmap __real_mmap64
 #endif
-#endif
 
 int __real_munmap(void *addr, size_t len);
 
diff --git a/include/posix/unistd.h b/include/posix/unistd.h
index 90cce86..4eb3ec4 100644
--- a/include/posix/unistd.h
+++ b/include/posix/unistd.h
@@ -56,7 +56,6 @@ extern C {
 
 int __real_ftruncate(int fildes, long length);
 
-#if __WORDSIZE == 32
 #if defined(_LARGEFILE64_SOURCE) \
|| defined(_FILE_OFFSET_BITS)  _FILE_OFFSET_BITS == 64
 int __real_ftruncate64(int fildes, long long length);
@@ -65,7 +64,6 @@ int __real_ftruncate64(int fildes, long long length);
 #if defined(_FILE_OFFSET_BITS)  _FILE_OFFSET_BITS == 64
 #define __real_ftruncate __real_ftruncate64
 #endif
-#endif
 
 ssize_t __real_read(int fd, void *buf, size_t nbyte);
 
diff --git a/src/skins/posix/shm.c b/src/skins/posix/shm.c
index e97ab88..964c101 100644
--- a/src/skins/posix/shm.c
+++ b/src/skins/posix/shm.c
@@ -136,8 +136,7 @@ void *__wrap_mmap(void *addr,
return MAP_FAILED;
 }
 
-/* 32 bits platform */
-#if __WORDSIZE == 32
+/* LFS support */
 int __wrap_ftruncate64(int fildes, long long length)
 {
int err;
@@ -214,7 +213,6 @@ void *__wrap_mmap64(void *addr,
errno = err;
return MAP_FAILED;
 }
-#endif
 
 int __shm_close(int fd)
 {
diff --git a/src/skins/posix/wrappers.c b/src/skins/posix/wrappers.c
index 8d3fd7e..ee49620 100644
--- a/src/skins/posix/wrappers.c
+++ b/src/skins/posix/wrappers.c
@@ -280,7 +280,6 @@ void *__real_mmap(void *addr,
 }
 
 /* 32 bits platform */
-#if __WORDSIZE == 32
 #ifdef HAVE_FTRUNCATE64
 __attribute__ ((weak))
 int __real_ftruncate64(int fildes, long long length)
@@ -297,7 +296,6 @@ void *__real_mmap64(void *addr,
return mmap64(addr, len, prot, flags, fd, off);
 }
 #endif /* HAVE_MMAP64 */
-#endif /* 32 bits */
 
 __attribute__ ((weak))
 int __real_munmap(void *addr, size_t len)


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


[Xenomai-git] Gilles Chanteperdrix : testsuite: add latency options and gnuplot script to generate histograms

2012-05-12 Thread GIT version control
Module: xenomai-2.6
Branch: master
Commit: de830fc72f761db255af5a8e65b5beaa324d8ed1
URL:
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=de830fc72f761db255af5a8e65b5beaa324d8ed1

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Sat May 12 13:37:27 2012 +0200

testsuite: add latency options and gnuplot script to generate histograms

---

 scripts/Makefile.am |3 +-
 scripts/Makefile.in |3 +-
 src/testsuite/latency/latency.c |   51 +-
 3 files changed, 48 insertions(+), 9 deletions(-)

diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index 513d0e5..2ef1a43 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -15,4 +15,5 @@ EXTRA_DIST = \
Modules.frag \
defconfig.frag \
help_from_kconfig.pl \
-   $(wildcard postinstall.sh)
+   $(wildcard postinstall.sh) \
+   histo.gp
diff --git a/scripts/Makefile.in b/scripts/Makefile.in
index 4bb4087..a036fe5 100644
--- a/scripts/Makefile.in
+++ b/scripts/Makefile.in
@@ -243,7 +243,8 @@ EXTRA_DIST = \
Modules.frag \
defconfig.frag \
help_from_kconfig.pl \
-   $(wildcard postinstall.sh)
+   $(wildcard postinstall.sh) \
+   histo.gp
 
 all: all-am
 
diff --git a/src/testsuite/latency/latency.c b/src/testsuite/latency/latency.c
index 1762a16..163cf36 100644
--- a/src/testsuite/latency/latency.c
+++ b/src/testsuite/latency/latency.c
@@ -60,13 +60,16 @@ int test_loops = 0; /* outer loop count */
 
 /* Warmup time : in order to avoid spurious cache effects on low-end machines. 
*/
 #define WARMUP_TIME 1
-#define HISTOGRAM_CELLS 100
+#define HISTOGRAM_CELLS 300
 int histogram_size = HISTOGRAM_CELLS;
 long *histogram_avg = NULL, *histogram_max = NULL, *histogram_min = NULL;
 
+char *do_gnuplot = NULL;
 int do_histogram = 0, do_stats = 0, finished = 0;
 int bucketsize = 1000; /* default = 1000ns, -B size to override */
 
+#define need_histo() (do_histogram || do_stats || do_gnuplot)
+
 static inline void add_histogram(long *histogram, long addval)
 {
/* bucketsize steps */
@@ -151,12 +154,12 @@ void latency(void *cookie)
gmaxjitter = dt;
}
 
-   if (!(finished || warmup)  (do_histogram || do_stats))
+   if (!(finished || warmup)  need_histo())
add_histogram(histogram_avg, dt);
}
 
if (!warmup) {
-   if (!finished  (do_histogram || do_stats)) {
+   if (!finished  need_histo()) {
add_histogram(histogram_max, maxj);
add_histogram(histogram_min, minj);
}
@@ -210,8 +213,7 @@ void display(void *cookie)
config.period = period_ns;
config.priority = priority;
config.warmup_loops = WARMUP_TIME;
-   config.histogram_size = (do_histogram
-|| do_stats) ? histogram_size : 0;
+   config.histogram_size = need_histo() ? histogram_size : 0;
config.histogram_bucketsize = bucketsize;
config.freeze_max = freeze_max;
 
@@ -333,6 +335,33 @@ double dump_histogram(long *histogram, char *kind)
return avg;
 }
 
+void dump_histo_gnuplot(long *histogram)
+{
+   unsigned start, stop;
+   FILE *f;
+   int n;
+
+   f = fopen(do_gnuplot, w);
+   if (!f)
+   return;
+
+   for (n = 0; n  histogram_size  histogram[n] == 0L; n++)
+   ;
+   start = n;
+
+   for (n = histogram_size - 1; n = 0  histogram[n] == 0L; n--)
+   ;
+   stop = n;
+
+   fprintf(f, %g 1\n, start * bucketsize / 1000.0);
+   for (n = start; n = stop; n++)
+   fprintf(f, %g %ld\n,
+   (n + 0.5) * bucketsize / 1000.0, histogram[n] + 1);
+   fprintf(f, %g 1\n, (stop + 1) * bucketsize / 1000.0);
+
+   fclose(f);
+}
+
 void dump_stats(long *histogram, char *kind, double avg)
 {
int n, total_hits = 0;
@@ -372,6 +401,9 @@ void dump_hist_stats(void)
dump_stats(histogram_min, min, minavg);
dump_stats(histogram_avg, avg, avgavg);
dump_stats(histogram_max, max, maxavg);
+
+   if (do_gnuplot)
+   dump_histo_gnuplot(histogram_avg);
 }
 
 void cleanup(void)
@@ -405,7 +437,7 @@ void cleanup(void)
if (benchdev = 0)
rt_dev_close(benchdev);
 
-   if (do_histogram || do_stats)
+   if (need_histo())
dump_hist_stats();
 
time(test_end);
@@ -474,8 +506,12 @@ int main(int argc, char **argv)
char task_name[16];
sigset_t mask;
 
-   while ((c = getopt(argc, argv, hp:l:T:qH:B:sD:t:fc:P:b)) != EOF)
+   while ((c = getopt(argc, argv, g:hp:l:T:qH:B:sD:t:fc:P:b)) != EOF)
switch (c) {

[Xenomai-git] Gilles Chanteperdrix : hal/arm: support backport of linux 3.2 VFP fixes

2012-05-12 Thread GIT version control
Module: xenomai-2.6
Branch: master
Commit: 40c7d95dbe4093f1e2a3202079d721c1daf0a785
URL:
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=40c7d95dbe4093f1e2a3202079d721c1daf0a785

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Thu May 10 01:17:32 2012 +0200

hal/arm: support backport of linux 3.2 VFP fixes

---

 include/asm-arm/hal.h  |8 +++-
 include/asm-arm/wrappers.h |2 +-
 ksrc/arch/arm/switch.S |3 ++-
 3 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/include/asm-arm/hal.h b/include/asm-arm/hal.h
index 42d8a34..68f6542 100644
--- a/include/asm-arm/hal.h
+++ b/include/asm-arm/hal.h
@@ -253,6 +253,10 @@ static inline void rthal_init_fpu(rthal_fpenv_t *fpuenv)
 /* vfpstate has already been zeroed by xnarch_init_fpu */
 fpuenv-vfpstate.hard.fpexc = FPEXC_EN;
 fpuenv-vfpstate.hard.fpscr = FPSCR_ROUND_NEAREST;
+#if (LINUX_VERSION_CODE = KERNEL_VERSION(3, 2, 0) \
+ || defined(CONFIG_VFP_3_2_BACKPORT))  defined(CONFIG_SMP)
+fpuenv-vfpstate.hard.cpu = NR_CPUS;
+#endif /* linux = 3.2.0 */
 #endif
 }
 
@@ -306,7 +310,8 @@ static inline rthal_fpenv_t *rthal_get_fpu_owner(void)
if (!vfp_owner)
return NULL;
 
-#if LINUX_VERSION_CODE = KERNEL_VERSION(3, 2, 0)  defined(CONFIG_SMP)
+#if (LINUX_VERSION_CODE = KERNEL_VERSION(3, 2, 0) \
+ || defined(CONFIG_VFP_3_2_BACKPORT))  defined(CONFIG_SMP)
if (vfp_owner-hard.cpu != cpu)
return NULL;
 #endif /* linux = 3.2.0 */
@@ -327,6 +332,7 @@ static inline rthal_fpenv_t *rthal_get_fpu_owner(void)
_fpexc; \
 })
 
+
 #else /* !CONFIG_VFP */
 static inline void rthal_save_fpu(rthal_fpenv_t *fpuenv)
 {
diff --git a/include/asm-arm/wrappers.h b/include/asm-arm/wrappers.h
index c33a936..91a2ec4 100644
--- a/include/asm-arm/wrappers.h
+++ b/include/asm-arm/wrappers.h
@@ -98,7 +98,7 @@ static inline void fp_init(union fp_state *state)
 #define FPEXC_EN FPEXC_ENABLE
 #endif
 
-#if LINUX_VERSION_CODE  KERNEL_VERSION(3, 1, 0)
+#if LINUX_VERSION_CODE  KERNEL_VERSION(3, 1, 0)  
!defined(CONFIG_VFP_3_2_BACKPORT)
 #define vfp_current_hw_state last_VFP_context
 #endif /* Linux  3.1 */
 
diff --git a/ksrc/arch/arm/switch.S b/ksrc/arch/arm/switch.S
index 243ee7f..83f4746 100644
--- a/ksrc/arch/arm/switch.S
+++ b/ksrc/arch/arm/switch.S
@@ -100,7 +100,8 @@ ENTRY(rthal_vfp_save)
  * r1 = current cpu
  */
 ENTRY(rthal_vfp_load)
-#if LINUX_VERSION_CODE = KERNEL_VERSION(3, 2, 0)  defined(CONFIG_SMP)
+#if (LINUX_VERSION_CODE = KERNEL_VERSION(3, 2, 0) \
+   || defined(CONFIG_VFP_3_2_BACKPORT))  defined(CONFIG_SMP)
 strr1, [r0, #VFP_CPU]
 #endif
 VFPFLDMIA  r0, r2  @ reload the working registers while


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


[Xenomai-git] Gilles Chanteperdrix : wrappers: avoid warning due to CONFIG_PREEMPT_RT

2012-05-12 Thread GIT version control
Module: xenomai-2.6
Branch: master
Commit: 379ca123ec0d1247af32e167a851e2bd9b5b21e6
URL:
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=379ca123ec0d1247af32e167a851e2bd9b5b21e6

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Sat May 12 03:34:45 2012 +0200

wrappers: avoid warning due to CONFIG_PREEMPT_RT

---

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

diff --git a/include/asm-generic/wrappers.h b/include/asm-generic/wrappers.h
index af927b5..2b8f917 100644
--- a/include/asm-generic/wrappers.h
+++ b/include/asm-generic/wrappers.h
@@ -638,7 +638,7 @@ static inline void wrap_proc_dir_entry_owner(struct 
proc_dir_entry *entry)
 #ifndef DEFINE_SEMAPHORE
 /* Legacy DECLARE_MUTEX vanished in 2.6.37 */
 #define DEFINE_BINARY_SEMAPHORE(sem) DECLARE_MUTEX(sem)
-#elif CONFIG_PREEMPT_RT
+#elif defined(CONFIG_PREEMPT_RT)
 #define DEFINE_BINARY_SEMAPHORE(sem) DEFINE_SEMAPHORE(sem, 1)
 #else
 #define DEFINE_BINARY_SEMAPHORE(sem) DEFINE_SEMAPHORE(sem)


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


[Xenomai-git] Gilles Chanteperdrix : hal/x86: fixup for refactored timers

2012-05-12 Thread GIT version control
Module: xenomai-2.6
Branch: master
Commit: 42a75ef2b77250ddbbf781eafec4de280fd909af
URL:
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=42a75ef2b77250ddbbf781eafec4de280fd909af

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Sat May 12 03:35:58 2012 +0200

hal/x86: fixup for refactored timers

---

 include/asm-x86/bits/init_32.h |2 +-
 include/asm-x86/bits/init_64.h |2 +-
 include/asm-x86/bits/timer.h   |2 +-
 include/asm-x86/calibration.h  |   62 ++-
 include/asm-x86/hal.h  |4 ++
 include/asm-x86/hal_32.h   |   22 ++
 include/asm-x86/hal_64.h   |   22 +++---
 ksrc/arch/x86/hal-common.c |   92 
 ksrc/arch/x86/hal_32.c |   39 +
 ksrc/arch/x86/hal_64.c |   32 +++---
 scripts/Kconfig.frag   |   17 
 11 files changed, 227 insertions(+), 69 deletions(-)

diff --git a/include/asm-x86/bits/init_32.h b/include/asm-x86/bits/init_32.h
index b03e7f6..589a845 100644
--- a/include/asm-x86/bits/init_32.h
+++ b/include/asm-x86/bits/init_32.h
@@ -58,7 +58,7 @@ static inline unsigned long xnarch_calibrate_timer(void)
   kernel configuration Xenomai is compiled against, the
   calibrated value will either refer to the local APIC or
   8254 timer latency value. */
-   return xnarch_ns_to_tsc(rthal_timer_calibrate())? : 1;
+   return rthal_timer_calibrate() ? : 1;
 }
 
 int xnarch_calibrate_sched(void)
diff --git a/include/asm-x86/bits/init_64.h b/include/asm-x86/bits/init_64.h
index 81776fc..922d9c4 100644
--- a/include/asm-x86/bits/init_64.h
+++ b/include/asm-x86/bits/init_64.h
@@ -55,7 +55,7 @@ static inline unsigned long xnarch_calibrate_timer(void)
/* Compute the time needed to program the APIC timer in aperiodic
   mode. The return value is expressed in CPU ticks. It is assumed
   that CONFIG_X86_LOCAL_APIC is always enabled for x86_64. */
-   return xnarch_ns_to_tsc(rthal_timer_calibrate())? : 1;
+   return rthal_timer_calibrate()? : 1;
 }
 
 int xnarch_calibrate_sched(void)
diff --git a/include/asm-x86/bits/timer.h b/include/asm-x86/bits/timer.h
index 09033af..9e9b863 100644
--- a/include/asm-x86/bits/timer.h
+++ b/include/asm-x86/bits/timer.h
@@ -39,7 +39,7 @@ static inline void xnarch_program_timer_shot(unsigned long 
delay)
 static inline void xnarch_send_timer_ipi(xnarch_cpumask_t mask)
 {
 #ifdef CONFIG_SMP
-   rthal_send_ipi(RTHAL_APIC_TIMER_IPI, mask);
+   rthal_send_ipi(RTHAL_TIMER_IPI, mask);
 #endif /* CONFIG_SMP */
 }
 
diff --git a/include/asm-x86/calibration.h b/include/asm-x86/calibration.h
index 7cd5ac9..7520244 100644
--- a/include/asm-x86/calibration.h
+++ b/include/asm-x86/calibration.h
@@ -32,30 +32,52 @@ static inline unsigned long xnarch_get_sched_latency (void)
 
 #if CONFIG_XENO_OPT_TIMING_SCHEDLAT != 0
sched_latency = CONFIG_XENO_OPT_TIMING_SCHEDLAT;
-#else
+#else /* !CONFIG_XENO_OPT_TIMING_SCHEDLAT */
+
+   if (strcmp(RTHAL_TIMER_DEVICE, lapic) == 0) {
 #ifdef CONFIG_SMP
-   sched_latency = 3350;
-#elif defined(CONFIG_X86_LOCAL_APIC)
-   sched_latency = 1000;
-#else /* !CONFIG_X86_LOCAL_APIC */
-   /*
-* Use the bogomips formula to identify low-end x86 boards
-* when using the 8254 PIT. The following is still grossly
-* experimental and needs work (i.e. more specific cases), but
-* the approach is definitely saner than previous attempts to
-* guess such value dynamically.
-*/
-#if LINUX_VERSION_CODE  KERNEL_VERSION(2,6,38)
-#define __bogomips (current_cpu_data.loops_per_jiffy/(50/HZ))
-#else
+   if (num_online_cpus()  1)
+   sched_latency = 3350;
+   else
+   sched_latency = 2000;
+#else /* !SMP */
+   sched_latency = 1000;
+#endif /* !SMP */
+   } else if (strcmp(RTHAL_TIMER_DEVICE, pit)) { /* HPET */
+#ifdef CONFIG_SMP
+   if (num_online_cpus()  1)
+   sched_latency = 3350;
+   else
+   sched_latency = 1500;
+#else /* !SMP */
+   sched_latency = 1000;
+#endif /* !SMP */
+   } else {
+   /*
+* Use the bogomips formula to identify low-end x86 boards
+* when using the 8254 PIT. The following is still grossly
+* experimental and needs work (i.e. more specific cases), but
+* the approach is definitely saner than previous attempts to
+* guess such value dynamically.
+*/
+#ifdef CONFIG_IPIPE_CORE
+#define __bogomips (this_cpu_read(cpu_info.loops_per_jiffy)/(50/HZ))
+#elif LINUX_VERSION_CODE = KERNEL_VERSION(2,6,38)
 #define __bogomips (cpu_info.loops_per_jiffy/(50/HZ))
+#else
+#define __bogomips (current_cpu_data.loops_per_jiffy/(50/HZ))
 #endif
-   sched_latency = 

[Xenomai-git] Gilles Chanteperdrix : testsuite: add latency options and gnuplot script to generate histograms

2012-05-12 Thread GIT version control
Module: xenomai-2.6
Branch: master
Commit: 6f72edf546a6e410b6e239284d6fd13c530f2912
URL:
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=6f72edf546a6e410b6e239284d6fd13c530f2912

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Sat May 12 13:37:27 2012 +0200

testsuite: add latency options and gnuplot script to generate histograms

---

 scripts/Makefile.am |3 +-
 scripts/Makefile.in |3 +-
 src/testsuite/latency/latency.c |   51 +-
 3 files changed, 48 insertions(+), 9 deletions(-)

diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index 513d0e5..2ef1a43 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -15,4 +15,5 @@ EXTRA_DIST = \
Modules.frag \
defconfig.frag \
help_from_kconfig.pl \
-   $(wildcard postinstall.sh)
+   $(wildcard postinstall.sh) \
+   histo.gp
diff --git a/scripts/Makefile.in b/scripts/Makefile.in
index 4bb4087..a036fe5 100644
--- a/scripts/Makefile.in
+++ b/scripts/Makefile.in
@@ -243,7 +243,8 @@ EXTRA_DIST = \
Modules.frag \
defconfig.frag \
help_from_kconfig.pl \
-   $(wildcard postinstall.sh)
+   $(wildcard postinstall.sh) \
+   histo.gp
 
 all: all-am
 
diff --git a/src/testsuite/latency/latency.c b/src/testsuite/latency/latency.c
index 1762a16..163cf36 100644
--- a/src/testsuite/latency/latency.c
+++ b/src/testsuite/latency/latency.c
@@ -60,13 +60,16 @@ int test_loops = 0; /* outer loop count */
 
 /* Warmup time : in order to avoid spurious cache effects on low-end machines. 
*/
 #define WARMUP_TIME 1
-#define HISTOGRAM_CELLS 100
+#define HISTOGRAM_CELLS 300
 int histogram_size = HISTOGRAM_CELLS;
 long *histogram_avg = NULL, *histogram_max = NULL, *histogram_min = NULL;
 
+char *do_gnuplot = NULL;
 int do_histogram = 0, do_stats = 0, finished = 0;
 int bucketsize = 1000; /* default = 1000ns, -B size to override */
 
+#define need_histo() (do_histogram || do_stats || do_gnuplot)
+
 static inline void add_histogram(long *histogram, long addval)
 {
/* bucketsize steps */
@@ -151,12 +154,12 @@ void latency(void *cookie)
gmaxjitter = dt;
}
 
-   if (!(finished || warmup)  (do_histogram || do_stats))
+   if (!(finished || warmup)  need_histo())
add_histogram(histogram_avg, dt);
}
 
if (!warmup) {
-   if (!finished  (do_histogram || do_stats)) {
+   if (!finished  need_histo()) {
add_histogram(histogram_max, maxj);
add_histogram(histogram_min, minj);
}
@@ -210,8 +213,7 @@ void display(void *cookie)
config.period = period_ns;
config.priority = priority;
config.warmup_loops = WARMUP_TIME;
-   config.histogram_size = (do_histogram
-|| do_stats) ? histogram_size : 0;
+   config.histogram_size = need_histo() ? histogram_size : 0;
config.histogram_bucketsize = bucketsize;
config.freeze_max = freeze_max;
 
@@ -333,6 +335,33 @@ double dump_histogram(long *histogram, char *kind)
return avg;
 }
 
+void dump_histo_gnuplot(long *histogram)
+{
+   unsigned start, stop;
+   FILE *f;
+   int n;
+
+   f = fopen(do_gnuplot, w);
+   if (!f)
+   return;
+
+   for (n = 0; n  histogram_size  histogram[n] == 0L; n++)
+   ;
+   start = n;
+
+   for (n = histogram_size - 1; n = 0  histogram[n] == 0L; n--)
+   ;
+   stop = n;
+
+   fprintf(f, %g 1\n, start * bucketsize / 1000.0);
+   for (n = start; n = stop; n++)
+   fprintf(f, %g %ld\n,
+   (n + 0.5) * bucketsize / 1000.0, histogram[n] + 1);
+   fprintf(f, %g 1\n, (stop + 1) * bucketsize / 1000.0);
+
+   fclose(f);
+}
+
 void dump_stats(long *histogram, char *kind, double avg)
 {
int n, total_hits = 0;
@@ -372,6 +401,9 @@ void dump_hist_stats(void)
dump_stats(histogram_min, min, minavg);
dump_stats(histogram_avg, avg, avgavg);
dump_stats(histogram_max, max, maxavg);
+
+   if (do_gnuplot)
+   dump_histo_gnuplot(histogram_avg);
 }
 
 void cleanup(void)
@@ -405,7 +437,7 @@ void cleanup(void)
if (benchdev = 0)
rt_dev_close(benchdev);
 
-   if (do_histogram || do_stats)
+   if (need_histo())
dump_hist_stats();
 
time(test_end);
@@ -474,8 +506,12 @@ int main(int argc, char **argv)
char task_name[16];
sigset_t mask;
 
-   while ((c = getopt(argc, argv, hp:l:T:qH:B:sD:t:fc:P:b)) != EOF)
+   while ((c = getopt(argc, argv, g:hp:l:T:qH:B:sD:t:fc:P:b)) != EOF)
switch (c) {

[Xenomai-git] Gilles Chanteperdrix : testsuite: add latency options and gnuplot script to generate histograms

2012-05-12 Thread GIT version control
Module: xenomai-2.6
Branch: master
Commit: eef023e4f7d7a6b59d4742fc95035db988ecc65b
URL:
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=eef023e4f7d7a6b59d4742fc95035db988ecc65b

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Sat May 12 13:37:27 2012 +0200

testsuite: add latency options and gnuplot script to generate histograms

---

 scripts/Makefile.am |3 +-
 scripts/Makefile.in |3 +-
 scripts/histo.gp|   21 
 src/testsuite/latency/latency.c |   51 +-
 4 files changed, 69 insertions(+), 9 deletions(-)

diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index 513d0e5..2ef1a43 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -15,4 +15,5 @@ EXTRA_DIST = \
Modules.frag \
defconfig.frag \
help_from_kconfig.pl \
-   $(wildcard postinstall.sh)
+   $(wildcard postinstall.sh) \
+   histo.gp
diff --git a/scripts/Makefile.in b/scripts/Makefile.in
index 4bb4087..a036fe5 100644
--- a/scripts/Makefile.in
+++ b/scripts/Makefile.in
@@ -243,7 +243,8 @@ EXTRA_DIST = \
Modules.frag \
defconfig.frag \
help_from_kconfig.pl \
-   $(wildcard postinstall.sh)
+   $(wildcard postinstall.sh) \
+   histo.gp
 
 all: all-am
 
diff --git a/scripts/histo.gp b/scripts/histo.gp
new file mode 100644
index 000..64a627a
--- /dev/null
+++ b/scripts/histo.gp
@@ -0,0 +1,21 @@
+#
+# Run this gnuplot script with the command line:
+#
+# gnuplot -e 
'input_file=/path/to/input;output_file=/path/to/output.png;graph_title=title
 text' /path/to/histo.gp
+#
+# where the input file is generated using latency option -g
+#
+
+set terminal png size 1024,768
+set output output_file
+
+set title graph_title
+set xlabel user-space latency in microseconds
+set ylabel occurences + 1 (log)
+set logscale y
+set key off;
+
+set bar 1.00
+set style fill  solid 1.00 border -1
+set style rectangle back fc lt -3 fillstyle  solid 1.00 border -1
+plot input_file w line
diff --git a/src/testsuite/latency/latency.c b/src/testsuite/latency/latency.c
index 1762a16..163cf36 100644
--- a/src/testsuite/latency/latency.c
+++ b/src/testsuite/latency/latency.c
@@ -60,13 +60,16 @@ int test_loops = 0; /* outer loop count */
 
 /* Warmup time : in order to avoid spurious cache effects on low-end machines. 
*/
 #define WARMUP_TIME 1
-#define HISTOGRAM_CELLS 100
+#define HISTOGRAM_CELLS 300
 int histogram_size = HISTOGRAM_CELLS;
 long *histogram_avg = NULL, *histogram_max = NULL, *histogram_min = NULL;
 
+char *do_gnuplot = NULL;
 int do_histogram = 0, do_stats = 0, finished = 0;
 int bucketsize = 1000; /* default = 1000ns, -B size to override */
 
+#define need_histo() (do_histogram || do_stats || do_gnuplot)
+
 static inline void add_histogram(long *histogram, long addval)
 {
/* bucketsize steps */
@@ -151,12 +154,12 @@ void latency(void *cookie)
gmaxjitter = dt;
}
 
-   if (!(finished || warmup)  (do_histogram || do_stats))
+   if (!(finished || warmup)  need_histo())
add_histogram(histogram_avg, dt);
}
 
if (!warmup) {
-   if (!finished  (do_histogram || do_stats)) {
+   if (!finished  need_histo()) {
add_histogram(histogram_max, maxj);
add_histogram(histogram_min, minj);
}
@@ -210,8 +213,7 @@ void display(void *cookie)
config.period = period_ns;
config.priority = priority;
config.warmup_loops = WARMUP_TIME;
-   config.histogram_size = (do_histogram
-|| do_stats) ? histogram_size : 0;
+   config.histogram_size = need_histo() ? histogram_size : 0;
config.histogram_bucketsize = bucketsize;
config.freeze_max = freeze_max;
 
@@ -333,6 +335,33 @@ double dump_histogram(long *histogram, char *kind)
return avg;
 }
 
+void dump_histo_gnuplot(long *histogram)
+{
+   unsigned start, stop;
+   FILE *f;
+   int n;
+
+   f = fopen(do_gnuplot, w);
+   if (!f)
+   return;
+
+   for (n = 0; n  histogram_size  histogram[n] == 0L; n++)
+   ;
+   start = n;
+
+   for (n = histogram_size - 1; n = 0  histogram[n] == 0L; n--)
+   ;
+   stop = n;
+
+   fprintf(f, %g 1\n, start * bucketsize / 1000.0);
+   for (n = start; n = stop; n++)
+   fprintf(f, %g %ld\n,
+   (n + 0.5) * bucketsize / 1000.0, histogram[n] + 1);
+   fprintf(f, %g 1\n, (stop + 1) * bucketsize / 1000.0);
+
+   fclose(f);
+}
+
 void dump_stats(long *histogram, char *kind, double avg)
 {
int n, total_hits = 0;
@@ -372,6 +401,9 @@ 

[Xenomai-git] Gilles Chanteperdrix : testsuite: add latency options and gnuplot script to generate histograms

2012-05-12 Thread GIT version control
Module: xenomai-gch
Branch: for-forge
Commit: 8c9ec683fe7907d7da9d359875f271e68a087cf1
URL:
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=8c9ec683fe7907d7da9d359875f271e68a087cf1

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Sat May 12 13:37:27 2012 +0200

testsuite: add latency options and gnuplot script to generate histograms

---

 scripts/Makefile.am |3 +-
 scripts/Makefile.in |3 +-
 testsuite/latency/latency.c |   51 +--
 3 files changed, 48 insertions(+), 9 deletions(-)

diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index 98d1998..2e0c0dd 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -12,4 +12,5 @@ EXTRA_DIST = \
prepare-patch.sh \
wrap-link.sh \
Kconfig.frag \
-   $(wildcard postinstall.sh)
+   $(wildcard postinstall.sh) \
+   histo.gp
diff --git a/scripts/Makefile.in b/scripts/Makefile.in
index 3bdd1fd..766aef7 100644
--- a/scripts/Makefile.in
+++ b/scripts/Makefile.in
@@ -245,7 +245,8 @@ EXTRA_DIST = \
prepare-patch.sh \
wrap-link.sh \
Kconfig.frag \
-   $(wildcard postinstall.sh)
+   $(wildcard postinstall.sh) \
+   histo.gp
 
 all: all-am
 
diff --git a/testsuite/latency/latency.c b/testsuite/latency/latency.c
index c12cb5f..4766488 100644
--- a/testsuite/latency/latency.c
+++ b/testsuite/latency/latency.c
@@ -56,13 +56,16 @@ int test_loops = 0; /* outer loop count */
 
 /* Warmup time : in order to avoid spurious cache effects on low-end machines. 
*/
 #define WARMUP_TIME 1
-#define HISTOGRAM_CELLS 100
+#define HISTOGRAM_CELLS 300
 int histogram_size = HISTOGRAM_CELLS;
 long *histogram_avg = NULL, *histogram_max = NULL, *histogram_min = NULL;
 
+char *do_gnuplot = NULL;
 int do_histogram = 0, do_stats = 0, finished = 0;
 int bucketsize = 1000; /* default = 1000ns, -B size to override */
 
+#define need_histo() (do_histogram || do_stats || do_gnuplot)
+
 static inline void add_histogram(long *histogram, long addval)
 {
/* bucketsize steps */
@@ -145,12 +148,12 @@ void latency(void *cookie)
gmaxjitter = dt;
}
 
-   if (!(finished || warmup)  (do_histogram || do_stats))
+   if (!(finished || warmup)  need_histo())
add_histogram(histogram_avg, dt);
}
 
if (!warmup) {
-   if (!finished  (do_histogram || do_stats)) {
+   if (!finished  need_histo()) {
add_histogram(histogram_max, maxj);
add_histogram(histogram_min, minj);
}
@@ -204,8 +207,7 @@ void display(void *cookie)
config.period = period_ns;
config.priority = priority;
config.warmup_loops = WARMUP_TIME;
-   config.histogram_size = (do_histogram
-|| do_stats) ? histogram_size : 0;
+   config.histogram_size = need_histo() ? histogram_size : 0;
config.histogram_bucketsize = bucketsize;
config.freeze_max = freeze_max;
 
@@ -327,6 +329,33 @@ double dump_histogram(long *histogram, char *kind)
return avg;
 }
 
+void dump_histo_gnuplot(long *histogram)
+{
+   unsigned start, stop;
+   FILE *f;
+   int n;
+
+   f = fopen(do_gnuplot, w);
+   if (!f)
+   return;
+
+   for (n = 0; n  histogram_size  histogram[n] == 0L; n++)
+   ;
+   start = n;
+
+   for (n = histogram_size - 1; n = 0  histogram[n] == 0L; n--)
+   ;
+   stop = n;
+
+   fprintf(f, %g 1\n, start * bucketsize / 1000.0);
+   for (n = start; n = stop; n++)
+   fprintf(f, %g %ld\n,
+   (n + 0.5) * bucketsize / 1000.0, histogram[n] + 1);
+   fprintf(f, %g 1\n, (stop + 1) * bucketsize / 1000.0);
+
+   fclose(f);
+}
+
 void dump_stats(long *histogram, char *kind, double avg)
 {
int n, total_hits = 0;
@@ -366,6 +395,9 @@ void dump_hist_stats(void)
dump_stats(histogram_min, min, minavg);
dump_stats(histogram_avg, avg, avgavg);
dump_stats(histogram_max, max, maxavg);
+
+   if (do_gnuplot)
+   dump_histo_gnuplot(histogram_avg);
 }
 
 void cleanup(void)
@@ -399,7 +431,7 @@ void cleanup(void)
if (benchdev = 0)
rt_dev_close(benchdev);
 
-   if (do_histogram || do_stats)
+   if (need_histo())
dump_hist_stats();
 
time(test_end);
@@ -460,8 +492,12 @@ int main(int argc, char *const *argv)
 
copperplate_init(argc, argv);
 
-   while ((c = getopt(argc, argv, hp:l:T:qH:B:sD:t:fc:P:b)) != EOF)
+   while ((c = getopt(argc, argv, g:hp:l:T:qH:B:sD:t:fc:P:b)) != EOF)
switch (c) {
+   case 'g':
+   

[Xenomai-git] Philippe Gerum : powerpc: introduce calibration data for P1022

2012-05-10 Thread GIT version control
Module: xenomai-forge
Branch: master
Commit: aa5e98ef75df437b52a3b2bfef57253383024ca0
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=aa5e98ef75df437b52a3b2bfef57253383024ca0

Author: Philippe Gerum r...@xenomai.org
Date:   Thu May 10 23:37:42 2012 +0200

powerpc: introduce calibration data for P1022

---

 include/asm-powerpc/calibration.h |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/include/asm-powerpc/calibration.h 
b/include/asm-powerpc/calibration.h
index 9fbfe7a..6c8ce8c 100644
--- a/include/asm-powerpc/calibration.h
+++ b/include/asm-powerpc/calibration.h
@@ -76,6 +76,8 @@ static inline unsigned long xnarch_get_sched_latency(void)
 #define __sched_latency 2000
 #elif defined(CONFIG_KUP4K)
 #define __sched_latency 22000
+#elif defined(CONFIG_P1022_DS)
+#define __sched_latency 3000
 /*
  * Check for the most generic configs at the bottom of this list, so
  * that the most specific choices available are picked first.


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


[Xenomai-git] Philippe Gerum : nucleus: enable back PREEMPT_RT support

2012-05-09 Thread GIT version control
Module: xenomai-2.6
Branch: master
Commit: 700b7374db69700eb739032a588472714a6c54f0
URL:
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=700b7374db69700eb739032a588472714a6c54f0

Author: Philippe Gerum r...@xenomai.org
Date:   Wed May  2 10:17:11 2012 +0200

nucleus: enable back PREEMPT_RT support

---

 include/asm-generic/wrappers.h |6 -
 ksrc/arch/generic/compat.c |2 +-
 ksrc/arch/generic/hal.c|   48 
 ksrc/drivers/can/rtcan_dev.c   |2 +-
 ksrc/nucleus/pipe.c|   13 +-
 ksrc/nucleus/registry.c|2 +-
 ksrc/nucleus/shadow.c  |2 +-
 7 files changed, 63 insertions(+), 12 deletions(-)

diff --git a/include/asm-generic/wrappers.h b/include/asm-generic/wrappers.h
index 407c203..af927b5 100644
--- a/include/asm-generic/wrappers.h
+++ b/include/asm-generic/wrappers.h
@@ -637,7 +637,11 @@ static inline void wrap_proc_dir_entry_owner(struct 
proc_dir_entry *entry)
 
 #ifndef DEFINE_SEMAPHORE
 /* Legacy DECLARE_MUTEX vanished in 2.6.37 */
-#define DEFINE_SEMAPHORE(sem) DECLARE_MUTEX(sem)
+#define DEFINE_BINARY_SEMAPHORE(sem) DECLARE_MUTEX(sem)
+#elif CONFIG_PREEMPT_RT
+#define DEFINE_BINARY_SEMAPHORE(sem) DEFINE_SEMAPHORE(sem, 1)
+#else
+#define DEFINE_BINARY_SEMAPHORE(sem) DEFINE_SEMAPHORE(sem)
 #endif
 
 #if LINUX_VERSION_CODE = KERNEL_VERSION(2,6,37)  
defined(CONFIG_GENERIC_HARDIRQS)
diff --git a/ksrc/arch/generic/compat.c b/ksrc/arch/generic/compat.c
index 0e83095..8af69da 100644
--- a/ksrc/arch/generic/compat.c
+++ b/ksrc/arch/generic/compat.c
@@ -20,7 +20,7 @@ struct kthread_stop_block {
 int ret;
 };
 
-static DEFINE_SEMAPHORE(kthread_stop_sem);
+static DEFINE_BINARY_SEMAPHORE(kthread_stop_sem);
 
 static struct kthread_stop_block kthread_stop_info;
 
diff --git a/ksrc/arch/generic/hal.c b/ksrc/arch/generic/hal.c
index 79466f8..438e09c 100644
--- a/ksrc/arch/generic/hal.c
+++ b/ksrc/arch/generic/hal.c
@@ -493,6 +493,46 @@ void rthal_apc_free(int apc)
clear_bit(apc, rthal_apc_map);
 }
 
+#ifdef CONFIG_PREEMPT_RT
+
+static inline int setup_apc_handler(void)
+{
+   int cpu;
+
+   for_each_online_cpu(cpu) {
+   rthal_apc_servers[cpu] =
+   kthread_create(rthal_apc_thread,
+  (void *)(unsigned long)cpu,
+  apc/%d, cpu);
+   if (rthal_apc_servers[cpu] == NULL)
+   return -ENOMEM;
+   wake_up_process(rthal_apc_servers[cpu]);
+   }
+
+   return 0;
+}
+
+static inline void cleanup_apc_handler(void)
+{
+   int cpu;
+
+   for_each_online_cpu(cpu) {
+   if (rthal_apc_servers[cpu])
+   kthread_stop(rthal_apc_servers[cpu]);
+   }
+}
+
+#else  /* !CONFIG_PREEMPT_RT */
+
+static inline int setup_apc_handler(void)
+{
+   return 0;
+}
+
+static inline void cleanup_apc_handler(void) { }
+
+#endif  /* !CONFIG_PREEMPT_RT */
+
 int rthal_init(void)
 {
 int err;
@@ -548,6 +588,10 @@ int rthal_init(void)
goto out_free_irq;
 }
 
+err = setup_apc_handler();
+if (err)
+   goto fail;
+
 err = rthal_register_domain(rthal_domain,
Xenomai,
RTHAL_DOMAIN_ID,
@@ -575,6 +619,8 @@ int rthal_init(void)
 rthal_virtualize_irq(rthal_current_domain, rthal_apc_virq, NULL, NULL, 
NULL,
 0);
 
+cleanup_apc_handler();
+
   out_free_irq:
 rthal_free_virq(rthal_apc_virq);
 
@@ -593,6 +639,8 @@ void rthal_exit(void)
rthal_free_virq(rthal_apc_virq);
 }
 
+cleanup_apc_handler();
+
 if (rthal_init_done)
rthal_unregister_domain(rthal_domain);
 
diff --git a/ksrc/drivers/can/rtcan_dev.c b/ksrc/drivers/can/rtcan_dev.c
index c3e9e5e..c53dddf 100644
--- a/ksrc/drivers/can/rtcan_dev.c
+++ b/ksrc/drivers/can/rtcan_dev.c
@@ -38,7 +38,7 @@ static rtdm_lock_t rtcan_devices_rt_lock = RTDM_LOCK_UNLOCKED;
 
 static int rtcan_global_init_done;
 
-DEFINE_SEMAPHORE(rtcan_devices_nrt_lock);
+DEFINE_BINARY_SEMAPHORE(rtcan_devices_nrt_lock);
 
 /* Spinlock for all reception lists and also for some members in
  * struct rtcan_socket */
diff --git a/ksrc/nucleus/pipe.c b/ksrc/nucleus/pipe.c
index 1d5e39a..064aa52 100644
--- a/ksrc/nucleus/pipe.c
+++ b/ksrc/nucleus/pipe.c
@@ -174,14 +174,14 @@ static void xnpipe_wakeup_proc(void *cookie)
xnlock_get_irqsave(nklock, s);
}
}
-#ifdef CONFIG_SMP
+#if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT_RT)
/*
-* A waiter may have entered/left the queue
-* from another CPU, so we need to refetch the
-* sleep queue head to be safe.
+* Assume a waiter might have entered/left the
+* queue, so we need to refetch 

[Xenomai-git] Gilles Chanteperdrix : hal/arm: fix compilation in the non ipipe-core case

2012-05-01 Thread GIT version control
Module: xenomai-2.6
Branch: master
Commit: c117aaf6d252220dec6a44c3a95fdd9263389db8
URL:
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=c117aaf6d252220dec6a44c3a95fdd9263389db8

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Tue May  1 17:05:32 2012 +0200

hal/arm: fix compilation in the non ipipe-core case

---

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

diff --git a/ksrc/arch/arm/hal.c b/ksrc/arch/arm/hal.c
index 159e889..9ae8873 100644
--- a/ksrc/arch/arm/hal.c
+++ b/ksrc/arch/arm/hal.c
@@ -183,7 +183,7 @@ static void rthal_timer_set_periodic(void)
 
 #define rthal_tickdev_request(tick_handler, mode_emul, tick_emul, cpu, tmfreq)\
ipipe_request_tickdev(RTHAL_TIMER_DEVICE, \
- mode_emul, iick_emul, cpu, tmfreq)
+ mode_emul, tick_emul, cpu, tmfreq)
 
 #define rthal_tickdev_release(cpu) \
ipipe_release_tickdev(cpu)


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


[Xenomai-git] Gilles Chanteperdrix : arm: upgrade I-pipe support to 3.0.13-arm-1.18-08

2012-05-01 Thread GIT version control
Module: xenomai-2.6
Branch: master
Commit: 85b5eee23ab41a1a420d3efd056c91fbf999a4ca
URL:
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=85b5eee23ab41a1a420d3efd056c91fbf999a4ca

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Tue May  1 16:58:19 2012 +0200

arm: upgrade I-pipe support to 3.0.13-arm-1.18-08

---

 patch = adeos-ipipe-3.0.13-arm-1.18-08.patch} |  392 
 1 files changed, 234 insertions(+), 158 deletions(-)

diff --git a/ksrc/arch/arm/patches/adeos-ipipe-3.0.13-arm-1.18-06.patch 
b/ksrc/arch/arm/patches/adeos-ipipe-3.0.13-arm-1.18-08.patch
similarity index 98%
rename from ksrc/arch/arm/patches/adeos-ipipe-3.0.13-arm-1.18-06.patch
rename to ksrc/arch/arm/patches/adeos-ipipe-3.0.13-arm-1.18-08.patch
index d460e5e..361079d 100644
--- a/ksrc/arch/arm/patches/adeos-ipipe-3.0.13-arm-1.18-06.patch
+++ b/ksrc/arch/arm/patches/adeos-ipipe-3.0.13-arm-1.18-08.patch
@@ -995,10 +995,10 @@ index 4384d81..f4efd23 100644
  void sp804_clockevents_init(void __iomem *, unsigned int, const char *);
 diff --git a/arch/arm/include/asm/ipipe.h b/arch/arm/include/asm/ipipe.h
 new file mode 100644
-index 000..6a91c49
+index 000..6e12980
 --- /dev/null
 +++ b/arch/arm/include/asm/ipipe.h
-@@ -0,0 +1,340 @@
+@@ -0,0 +1,341 @@
 +/* -*- linux-c -*-
 + * arch/arm/include/asm/ipipe.h
 + *
@@ -1031,10 +1031,10 @@ index 000..6a91c49
 +#include linux/ipipe_percpu.h
 +#include linux/ipipe_trace.h
 +
-+#define IPIPE_ARCH_STRING 1.18-06
++#define IPIPE_ARCH_STRING 1.18-08
 +#define IPIPE_MAJOR_NUMBER1
 +#define IPIPE_MINOR_NUMBER18
-+#define IPIPE_PATCH_NUMBER6
++#define IPIPE_PATCH_NUMBER8
 +
 +#ifdef CONFIG_SMP
 +#define ipipe_processor_id()  hard_smp_processor_id()
@@ -1286,14 +1286,15 @@ index 000..6a91c49
 +
 +void __ipipe_exit_irq(struct pt_regs *regs);
 +
-+void __ipipe_handle_irq(int irq, struct pt_regs *regs);
++#define IPIPE_IRQF_NOACK0x1
++#define IPIPE_IRQF_NOSYNC   0x2
++
++void __ipipe_handle_irq(int irq, int flags);
 +
 +static inline void ipipe_handle_chained_irq(unsigned int irq)
 +{
-+  struct pt_regs regs;/* dummy */
-+
 +  ipipe_trace_irq_entry(irq);
-+  __ipipe_handle_irq(irq, regs);
++  __ipipe_handle_irq(irq, IPIPE_IRQF_NOSYNC);
 +  ipipe_trace_irq_exit(irq);
 +}
 +
@@ -2279,7 +2280,7 @@ index 734b581..6579eec 100644
  
  #endif
 diff --git a/arch/arm/include/asm/smp_twd.h b/arch/arm/include/asm/smp_twd.h
-index fed9981..b49c8ac 100644
+index fed9981..f655b27 100644
 --- a/arch/arm/include/asm/smp_twd.h
 +++ b/arch/arm/include/asm/smp_twd.h
 @@ -22,7 +22,61 @@ struct clock_event_device;
@@ -2319,7 +2320,7 @@ index fed9981..b49c8ac 100644
 +#define __ipipe_mach_relay_ipi(ipi, thiscpu)  \
 +  ({  \
 +  (void)(thiscpu);\
-+  __ipipe_handle_irq(ipi, NULL);  \
++  __ipipe_handle_irq(ipi, IPIPE_IRQF_NOACK);  \
 +  })
 +
 +struct irq_desc;
@@ -2963,10 +2964,10 @@ index 051166c..043ca62 100644
   * have in theory up to 7 arguments to a function - r0 to r6.
 diff --git a/arch/arm/kernel/ipipe.c b/arch/arm/kernel/ipipe.c
 new file mode 100644
-index 000..92c0592
+index 000..6cb7401
 --- /dev/null
 +++ b/arch/arm/kernel/ipipe.c
-@@ -0,0 +1,675 @@
+@@ -0,0 +1,676 @@
 +/* -*- linux-c -*-
 + * linux/arch/arm/kernel/ipipe.c
 + *
@@ -3221,7 +3222,7 @@ index 000..92c0592
 +  return -EINVAL;
 +#endif
 +  local_irq_save_hw(flags);
-+  __ipipe_handle_irq(irq, NULL);
++  __ipipe_handle_irq(irq, IPIPE_IRQF_NOACK);
 +  local_irq_restore_hw(flags);
 +
 +  return 1;
@@ -3429,7 +3430,7 @@ index 000..92c0592
 + * interrupt protection log is maintained here for each domain. Hw
 + * interrupts are off on entry.
 + */
-+void __ipipe_handle_irq(int irq, struct pt_regs *regs)
++void __ipipe_handle_irq(int irq, int flags)
 +{
 +  struct ipipe_domain *this_domain, *next_domain;
 +  struct list_head *head, *pos;
@@ -3437,7 +3438,7 @@ index 000..92c0592
 +  int m_ack;
 +
 +  /* Software-triggered IRQs do not need any ack. */
-+  m_ack = (regs == NULL);
++  m_ack = (flags  IPIPE_IRQF_NOACK) != 0;
 +
 +#ifdef CONFIG_IPIPE_DEBUG
 +  if (unlikely(irq = IPIPE_NR_IRQS) ||
@@ -3452,7 +3453,8 @@ index 000..92c0592
 +  else {
 +  head = __ipipe_pipeline.next;
 +  next_domain = list_entry(head, struct ipipe_domain, p_link);
-+  if (likely(test_bit(IPIPE_WIRED_FLAG, 
next_domain-irqs[irq].control))) {
++  if (!(flags  IPIPE_IRQF_NOSYNC)
++   likely(test_bit(IPIPE_WIRED_FLAG, 
next_domain-irqs[irq].control))) {
 +  if (!m_ack  next_domain-irqs[irq].acknowledge) {
 +  desc = ipipe_virtual_irq_p(irq) ? NULL : 
irq_to_desc(irq);
 +  next_domain-irqs[irq].acknowledge(irq, desc);
@@ -3571,7 +3573,7 @@ index 

[Xenomai-git] Gilles Chanteperdrix : hal/arm: use a more sensible timer load value for calibration

2012-05-01 Thread GIT version control
Module: xenomai-2.6
Branch: master
Commit: af211f72ccc9210de45d92508327679727524d41
URL:
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=af211f72ccc9210de45d92508327679727524d41

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Tue May  1 17:05:56 2012 +0200

hal/arm: use a more sensible timer load value for calibration

---

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

diff --git a/ksrc/arch/arm/hal.c b/ksrc/arch/arm/hal.c
index 9ae8873..7db1288 100644
--- a/ksrc/arch/arm/hal.c
+++ b/ksrc/arch/arm/hal.c
@@ -193,7 +193,7 @@ static void rthal_timer_set_periodic(void)
 unsigned long rthal_timer_calibrate(void)
 {
unsigned long long start, end, sum = 0, sum_sq = 0;
-   volatile unsigned const_delay = 0x;
+   volatile unsigned const_delay = rthal_timerfreq_arg / HZ;
unsigned long result, flags, tsc_lat;
unsigned int delay = const_delay;
long long diff;


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


[Xenomai-git] Philippe Gerum : nucleus/intr: diambiguate CPU suffix

2012-04-30 Thread GIT version control
Module: xenomai-forge
Branch: master
Commit: 8052c760ffe33e2ea4c93afda3f6ed31010fccd2
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=8052c760ffe33e2ea4c93afda3f6ed31010fccd2

Author: Philippe Gerum r...@xenomai.org
Date:   Thu Apr 26 11:19:00 2012 +0200

nucleus/intr: diambiguate CPU suffix

---

 kernel/cobalt/nucleus/intr.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/cobalt/nucleus/intr.c b/kernel/cobalt/nucleus/intr.c
index ffbd2a5..cfb2e45 100644
--- a/kernel/cobalt/nucleus/intr.c
+++ b/kernel/cobalt/nucleus/intr.c
@@ -974,7 +974,7 @@ static inline int format_irq_proc(unsigned int irq,
 
for_each_online_cpu(cpu)
if (irq == XNARCH_PERCPU_TIMER_IRQ(cpu)) {
-   xnvfile_printf(it,  [timer%d], cpu);
+   xnvfile_printf(it,  [timer/%d], cpu);
return 0;
}
 


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


[Xenomai-git] Gilles Chanteperdrix : blackfin: adapt to refactored timers

2012-04-30 Thread GIT version control
Module: xenomai-forge
Branch: master
Commit: 5e090f757621d3e9c8fe62c2c91ead1a6ec94e28
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=5e090f757621d3e9c8fe62c2c91ead1a6ec94e28

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Sun Apr 15 23:25:25 2012 +0200

blackfin: adapt to refactored timers

---

 include/asm-blackfin/hal.h|   12 +++
 kernel/cobalt/arch/blackfin/hal.c |   38 ++--
 2 files changed, 43 insertions(+), 7 deletions(-)

diff --git a/include/asm-blackfin/hal.h b/include/asm-blackfin/hal.h
index 1887497..35c7f01 100644
--- a/include/asm-blackfin/hal.h
+++ b/include/asm-blackfin/hal.h
@@ -30,7 +30,11 @@
 #include asm/div64.h
 
 #define RTHAL_ARCH_NAMEblackfin
+#ifndef CONFIG_IPIPE_CORE
 #define RTHAL_TIMER_DEVICE coretmr
+#else /* CONFIG_IPIPE_CORE */
+#define RTHAL_TIMER_DEVICE (ipipe_timer_name())
+#endif /* CONFIG_IPIPE_CORE */
 #define RTHAL_CLOCK_DEVICE cyclectr
 
 typedef unsigned long long rthal_time_t;
@@ -47,7 +51,11 @@ static inline __attribute_const__ unsigned long 
ffnz(unsigned long ul)
 #include asm/processor.h
 #include asm/xenomai/atomic.h
 
+#ifndef CONFIG_IPIPE_CORE
 #define RTHAL_TIMER_IRQIRQ_CORETMR
+#else /* CONFIG_IPIPE_CORE */
+#define RTHAL_TIMER_IRQ__ipipe_hrtimer_irq
+#endif /* CONFIG_IPIPE_CORE */
 #define RTHAL_HOST_TICK_IRQRTHAL_TIMER_IRQ
 
 /* The NMI watchdog timer is clocked by the system clock. */
@@ -65,6 +73,7 @@ static inline unsigned long long rthal_rdtsc(void)
 
 static inline void rthal_timer_program_shot(unsigned long delay)
 {
+#ifndef CONFIG_IPIPE_CORE
if (delay  2)
ipipe_post_irq_head(RTHAL_TIMER_IRQ);
else {
@@ -74,6 +83,9 @@ static inline void rthal_timer_program_shot(unsigned long 
delay)
CSYNC();
bfin_write_TCNTL(TMPWR | TMREN);
}
+#else /* !CONFIG_IPIPE_CORE */
+   ipipe_timer_set(delay);
+#endif /* !CONFIG_IPIPE_CORE */
 }
 
 /* Private interface -- Internal use only */
diff --git a/kernel/cobalt/arch/blackfin/hal.c 
b/kernel/cobalt/arch/blackfin/hal.c
index 808eb2d..57b4ae1 100644
--- a/kernel/cobalt/arch/blackfin/hal.c
+++ b/kernel/cobalt/arch/blackfin/hal.c
@@ -40,6 +40,8 @@
 
 enum rthal_ktimer_mode rthal_ktimer_saved_mode;
 
+#ifndef CONFIG_IPIPE_CORE
+
 #define RTHAL_SET_ONESHOT_XENOMAI  1
 #define RTHAL_SET_ONESHOT_LINUX2
 #define RTHAL_SET_PERIODIC 3
@@ -93,6 +95,12 @@ static void rthal_timer_set_periodic(void)
rthal_setup_periodic_coretmr();
ipipe_critical_exit(flags);
 }
+#else /* I-pipe core */
+#define rthal_setup_oneshot_coretmr() do { } while (0)
+#define rthal_setup_periodic_coretmr() do { } while (0)
+#define rthal_timer_set_oneshot(rt_mode) do { } while (0)
+#define rthal_timer_set_periodic() do { } while (0)
+#endif /* I-pipe core */
 
 static int cpu_timers_requested;
 
@@ -106,11 +114,12 @@ int rthal_timer_request(void (*tick_handler)(void),
unsigned long dummy, *tmfreq = dummy;
int tickval, ret, res;
 
-   if (rthal_timerfreq_arg == 0)
-   tmfreq = rthal_archdata.timer_freq;
-
+#ifndef CONFIG_IPIPE_CORE
res = ipipe_request_tickdev(bfin_core_timer, mode_emul, tick_emul, 
cpu,
tmfreq);
+#else /* I-pipe timers */
+   res = ipipe_timer_start(tick_handler, mode_emul, tick_emul, cpu);
+#endif /* I-pipe timers */
switch (res) {
case CLOCK_EVT_MODE_PERIODIC:
/* Oneshot tick emulation callback won't be used, ask
@@ -151,12 +160,14 @@ int rthal_timer_request(void (*tick_handler)(void),
if (cpu_timers_requested++  0)
goto out;
 
+#ifndef CONFIG_IPIPE_CORE
ret = ipipe_request_irq(rthal_archdata.domain,
RTHAL_TIMER_IRQ,
(ipipe_irq_handler_t)tick_handler,
NULL, NULL);
if (ret)
return ret;
+#endif /* !I-pipe core */
 
rthal_timer_set_oneshot(1);
 
@@ -166,12 +177,18 @@ out:
 
 void rthal_timer_release(int cpu)
 {
+#ifndef CONFIG_IPIPE_CORE
ipipe_release_tickdev(cpu);
+#else /* I-pipe core */
+   ipipe_timer_stop(cpu);
+#endif /* I-pipe core */
 
if (--cpu_timers_requested  0)
return;
 
+#ifndef CONFIG_IPIPE_CORE
ipipe_free_irq(rthal_archdata.domain, RTHAL_TIMER_IRQ);
+#endif /* !I-pipe core */
 
if (rthal_ktimer_saved_mode == KTIMER_MODE_PERIODIC)
rthal_timer_set_periodic();
@@ -203,21 +220,28 @@ void xnpod_schedule_deferred(void);
 
 int rthal_arch_init(void)
 {
+#ifdef CONFIG_IPIPE_CORE
+   int rc = ipipe_timers_request();
+   if (rc  0)
+   return rc;
+#endif /* CONFIG_IPIPE_CORE */
+
__ipipe_irq_tail_hook = (unsigned long)xnpod_schedule_deferred;
 
if (rthal_clockfreq_arg == 0)

[Xenomai-git] Gilles Chanteperdrix : hal/blackfin: fixup for refactored timers

2012-04-30 Thread GIT version control
Module: xenomai-2.6
Branch: master
Commit: 5d808812cfe1352bec3a8f85b8a09c0469b60be6
URL:
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=5d808812cfe1352bec3a8f85b8a09c0469b60be6

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Sat Apr 28 19:21:33 2012 +0200

hal/blackfin: fixup for refactored timers

---

 include/asm-blackfin/bits/pod.h |   18 +++---
 include/asm-blackfin/hal.h  |   12 
 ksrc/arch/arm/hal.c |3 +-
 ksrc/arch/blackfin/hal.c|  129 ---
 4 files changed, 129 insertions(+), 33 deletions(-)

diff --git a/include/asm-blackfin/bits/pod.h b/include/asm-blackfin/bits/pod.h
index 2ad4584..806dfa5 100644
--- a/include/asm-blackfin/bits/pod.h
+++ b/include/asm-blackfin/bits/pod.h
@@ -26,14 +26,11 @@ void xnpod_welcome_thread(struct xnthread *, int);
 
 void xnpod_delete_thread(struct xnthread *);
 
-#ifdef CONFIG_GENERIC_CLOCKEVENTS
-static inline int xnarch_start_timer(void (*tick_handler)(void), int cpu)
-{
-   return rthal_timer_request(tick_handler,
-  xnarch_switch_htick_mode, 
xnarch_next_htick_shot,
-  cpu);
-}
-#else
+#ifndef CONFIG_GENERIC_CLOCKEVENTS
+#define xnarch_switch_htick_mode NULL
+#define xnarch_next_htick_shot NULL
+#endif /* CONFIG_GENERIC_CLOCKEVENTS */
+
 /*
  * When GENERIC_CLOCKEVENTS are not available, the I-pipe frees the
  * Blackfin core timer for us, therefore we don't need any host tick
@@ -42,9 +39,10 @@ static inline int xnarch_start_timer(void 
(*tick_handler)(void), int cpu)
  */
 static inline int xnarch_start_timer(void (*tick_handler)(void), int cpu)
 {
-   return rthal_timer_request(tick_handler, cpu);
+   return rthal_timer_request(tick_handler,
+  xnarch_switch_htick_mode, 
xnarch_next_htick_shot,
+  cpu);
 }
-#endif
 
 #define xnarch_stop_timer(cpu) rthal_timer_release(cpu)
 
diff --git a/include/asm-blackfin/hal.h b/include/asm-blackfin/hal.h
index 6dd1297..b630afd 100644
--- a/include/asm-blackfin/hal.h
+++ b/include/asm-blackfin/hal.h
@@ -29,7 +29,11 @@
 #include asm-generic/xenomai/hal.h   /* Read the generic bits. */
 #include asm/div64.h
 
+#ifdef CONFIG_IPIPE_CORE
+#define RTHAL_TIMER_DEVICE (ipipe_timer_name())
+#else /* !CONFIG_IPIPE_CORE */
 #define RTHAL_TIMER_DEVICE coretmr
+#endif /* !CONFIG_IPIPE_CORE */
 #define RTHAL_CLOCK_DEVICE cyclectr
 
 typedef unsigned long long rthal_time_t;
@@ -46,7 +50,11 @@ static inline __attribute_const__ unsigned long 
ffnz(unsigned long ul)
 #include asm/processor.h
 #include asm/xenomai/atomic.h
 
+#ifdef CONFIG_IPIPE_CORE
+#define RTHAL_TIMER_IRQ__ipipe_hrtimer_irq
+#else /* !CONFIG_IPIPE_CORE */
 #define RTHAL_TIMER_IRQIRQ_CORETMR
+#endif /* !CONFIG_IPIPE_CORE */
 /* The NMI watchdog timer is clocked by the system clock. */
 #define RTHAL_NMICLK_FREQ  get_sclk()
 
@@ -62,6 +70,9 @@ static inline unsigned long long rthal_rdtsc(void)
 
 static inline void rthal_timer_program_shot(unsigned long delay)
 {
+#ifdef CONFIG_IPIPE_CORE
+   ipipe_timer_set(delay);
+#else /* !CONFIG_IPIPE_CORE */
if (delay  2)
rthal_schedule_irq_head(RTHAL_TIMER_IRQ);
else {
@@ -71,6 +82,7 @@ static inline void rthal_timer_program_shot(unsigned long 
delay)
CSYNC();
bfin_write_TCNTL(TMPWR | TMREN);
}
+#endif /* !CONFIG_IPIPE_CORE */
 }
 
 /* Private interface -- Internal use only */
diff --git a/ksrc/arch/arm/hal.c b/ksrc/arch/arm/hal.c
index 78742fc..159e889 100644
--- a/ksrc/arch/arm/hal.c
+++ b/ksrc/arch/arm/hal.c
@@ -258,7 +258,8 @@ int rthal_timer_request(
unsigned long dummy, *tmfreq = dummy;
int tickval, ret;
 
-   ret = rthal_tickdev_request(tick_handler, mode_emul, tick_emul, cpu, 
tmfreq);
+   ret = rthal_tickdev_request(tick_handler,
+   mode_emul, tick_emul, cpu, tmfreq);
switch (ret) {
case CLOCK_EVT_MODE_PERIODIC:
/* oneshot tick emulation callback won't be used, ask
diff --git a/ksrc/arch/blackfin/hal.c b/ksrc/arch/blackfin/hal.c
index 555c304..a50d92d 100644
--- a/ksrc/arch/blackfin/hal.c
+++ b/ksrc/arch/blackfin/hal.c
@@ -50,6 +50,74 @@ static struct {
 
 enum rthal_ktimer_mode rthal_ktimer_saved_mode;
 
+#ifdef CONFIG_IPIPE_CORE
+
+#define rthal_tickdev_select() \
+   ipipe_timers_request()
+
+#define rthal_tickdev_unselect() \
+   ipipe_timers_release()
+
+static inline
+int rthal_timer_request(void (*tick_handler)(void),
+ void (*mode_emul)(enum clock_event_mode mode,
+   struct clock_event_device *cdev),
+ int (*tick_emul)(unsigned long delay,
+  struct clock_event_device *cdev),
+ int cpu)
+{
+   int ret, 

[Xenomai-git] Gilles Chanteperdrix : powerpc: adapt to refactored timers

2012-04-30 Thread GIT version control
Module: xenomai-forge
Branch: master
Commit: eaf88c8cd464c3053fa241f4fc85169abc17b57d
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=eaf88c8cd464c3053fa241f4fc85169abc17b57d

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Tue Apr 17 00:15:58 2012 +0200

powerpc: adapt to refactored timers

---

 include/asm-powerpc/hal.h|8 
 kernel/cobalt/arch/powerpc/hal.c |   35 +++
 2 files changed, 39 insertions(+), 4 deletions(-)

diff --git a/include/asm-powerpc/hal.h b/include/asm-powerpc/hal.h
index 4b7fa03..721f455 100644
--- a/include/asm-powerpc/hal.h
+++ b/include/asm-powerpc/hal.h
@@ -32,7 +32,11 @@
 #include asm-generic/xenomai/hal.h   /* Read the generic bits. */
 
 #define RTHAL_ARCH_NAMEpowerpc
+#ifndef CONFIG_IPIPE_CORE
 #define RTHAL_TIMER_DEVICE decrementer
+#else /* CONFIG_IPIPE_CORE */
+#define RTHAL_TIMER_DEVICE (ipipe_timer_name())
+#endif /* CONFIG_IPIPE_CORE */
 #define RTHAL_CLOCK_DEVICE timebase
 
 typedef unsigned long long rthal_time_t;
@@ -76,6 +80,7 @@ static inline unsigned long long rthal_rdtsc(void)
 
 static inline void rthal_timer_program_shot(unsigned long delay)
 {
+#ifndef CONFIG_IPIPE_CORE
if (delay  3)
ipipe_post_irq_head(RTHAL_TIMER_IRQ);
else {
@@ -91,6 +96,9 @@ static inline void rthal_timer_program_shot(unsigned long 
delay)
set_dec((int)delay);
 #endif /* CONFIG_40x */
}
+#else /* !CONFIG_IPIPE_CORE */
+   ipipe_timer_set(delay);
+#endif /* !CONFIG_IPIPE_CORE */
 }
 
 /* Private interface -- Internal use only */
diff --git a/kernel/cobalt/arch/powerpc/hal.c b/kernel/cobalt/arch/powerpc/hal.c
index 05aa1e4..9aea41d 100644
--- a/kernel/cobalt/arch/powerpc/hal.c
+++ b/kernel/cobalt/arch/powerpc/hal.c
@@ -54,6 +54,8 @@ static volatile int sync_op;
 
 enum rthal_ktimer_mode rthal_ktimer_saved_mode;
 
+#ifndef CONFIG_IPIPE_CORE
+
 #define RTHAL_SET_ONESHOT_XENOMAI  1
 #define RTHAL_SET_ONESHOT_LINUX2
 #define RTHAL_SET_PERIODIC 3
@@ -134,6 +136,12 @@ static void rthal_timer_set_periodic(void)
rthal_disarm_decr(0);
ipipe_critical_exit(flags);
 }
+#else /* I-pipe core */
+#define rthal_setup_oneshot_dec() do { } while (0)
+#define rthal_setup_periodic_dec() do { } while (0)
+#define rthal_timer_set_oneshot(rt_mode) do { } while (0)
+#define rthal_timer_set_periodic() do { } while (0)
+#endif /* I-pipe core */
 
 static int cpu_timers_requested;
 
@@ -147,11 +155,12 @@ int rthal_timer_request(void (*tick_handler)(void),
unsigned long dummy, *tmfreq = dummy;
int tickval, ret, res;
 
-   if (rthal_timerfreq_arg == 0)
-   tmfreq = rthal_archdata.timer_freq;
-
+#ifndef CONFIG_IPIPE_CORE
res = ipipe_request_tickdev(decrementer, mode_emul, tick_emul, cpu,
tmfreq);
+#else /* CONFIG_IPIPE_CORE */
+   res = ipipe_timer_start(tick_handler, mode_emul, tick_emul, cpu);
+#endif /* CONFIG_IPIPE_CORE */
switch (res) {
case CLOCK_EVT_MODE_PERIODIC:
/* oneshot tick emulation callback won't be used, ask
@@ -185,13 +194,14 @@ int rthal_timer_request(void (*tick_handler)(void),
if (cpu_timers_requested++  0)
goto out;
 
+#ifndef CONFIG_IPIPE_CORE
ret = ipipe_request_irq(rthal_archdata.domain,
RTHAL_TIMER_IRQ,
(ipipe_irq_handler_t)tick_handler,
NULL, NULL);
if (ret)
return ret;
-
+#endif /* !I-ipipe core */
 #ifdef CONFIG_SMP
ret = ipipe_request_irq(rthal_archdata.domain,
RTHAL_TIMER_IPI,
@@ -208,7 +218,11 @@ out:
 
 void rthal_timer_release(int cpu)
 {
+#ifndef CONFIG_IPIPE_CORE
ipipe_release_tickdev(cpu);
+#else /* I-pipe core */
+   ipipe_timer_stop(cpu);
+#endif /* I-pipe core */
 
if (--cpu_timers_requested  0)
return;
@@ -216,7 +230,9 @@ void rthal_timer_release(int cpu)
 #ifdef CONFIG_SMP
ipipe_free_irq(rthal_archdata.domain, RTHAL_TIMER_IPI);
 #endif /* CONFIG_SMP */
+#ifndef CONFIG_IPIPE_CORE
ipipe_free_irq(rthal_archdata.domain, RTHAL_TIMER_IRQ);
+#endif /* !I-pipe core */
 
if (rthal_ktimer_saved_mode == KTIMER_MODE_PERIODIC)
rthal_timer_set_periodic();
@@ -244,6 +260,9 @@ unsigned long rthal_timer_calibrate(void)
 
 int rthal_arch_init(void)
 {
+#ifdef CONFIG_IPIPE_CORE
+   int rc;
+#endif /* I-pipe core */
 #ifdef CONFIG_ALTIVEC
if (!cpu_has_feature(CPU_FTR_ALTIVEC)) {
printk
@@ -252,6 +271,11 @@ int rthal_arch_init(void)
return -ENODEV;
}
 #endif /* CONFIG_ALTIVEC */
+#ifdef CONFIG_IPIPE_CORE
+   rc = ipipe_timers_request();
+   if (rc  0)
+   return rc;
+#endif /* I-pipe core */
 
if (rthal_timerfreq_arg == 0)
  

[Xenomai-git] Gilles Chanteperdrix : rt_print: align with xenomai 2.6

2012-04-30 Thread GIT version control
Module: xenomai-forge
Branch: master
Commit: a75aac05b2c144b6ab9aba573fb7f921ffc38c49
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=a75aac05b2c144b6ab9aba573fb7f921ffc38c49

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Sun Apr 15 20:46:59 2012 +0200

rt_print: align with xenomai 2.6

fix puts, add fputc and putchar

---

 include/cobalt/stdio.h|8 -
 include/rtdk.h|2 +
 lib/cobalt/posix.wrappers |2 +
 lib/cobalt/printf.c   |   57 ++--
 lib/cobalt/wrappers.c |   12 +
 5 files changed, 76 insertions(+), 5 deletions(-)

diff --git a/include/cobalt/stdio.h b/include/cobalt/stdio.h
index 7d161da..cadde58 100644
--- a/include/cobalt/stdio.h
+++ b/include/cobalt/stdio.h
@@ -22,9 +22,13 @@ COBALT_DECL(int, printf(const char *fmt, ...));
 
 COBALT_DECL(int, puts(const char *s));
 
-int __real_fputs(const char *s, FILE *stream);
+COBALT_DECL(int, fputs(const char *s, FILE *stream));
 
-size_t __real_fwrite(const void *ptr, size_t sz, size_t nmemb, FILE *stream);
+COBALT_DECL(int, fputc(int c, FILE *stream));
+
+COBALT_DECL(int, putchar(int c));
+
+COBALT_DECL(size_t, fwrite(const void *ptr, size_t sz, size_t nmemb, FILE 
*stream));
 
 #ifdef __cplusplus
 }
diff --git a/include/rtdk.h b/include/rtdk.h
index 398b1c9..1b5f218 100644
--- a/include/rtdk.h
+++ b/include/rtdk.h
@@ -54,6 +54,8 @@ 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);
diff --git a/lib/cobalt/posix.wrappers b/lib/cobalt/posix.wrappers
index bb18827..c5a15fb 100644
--- a/lib/cobalt/posix.wrappers
+++ b/lib/cobalt/posix.wrappers
@@ -87,6 +87,8 @@
 --wrap printf
 --wrap puts
 --wrap fputs
+--wrap fputc
+--wrap putchar
 --wrap fwrite
 --wrap syslog
 --wrap vsyslog
diff --git a/lib/cobalt/printf.c b/lib/cobalt/printf.c
index aeddd22..6654a93 100644
--- a/lib/cobalt/printf.c
+++ b/lib/cobalt/printf.c
@@ -274,7 +274,30 @@ int rt_fputs(const char *s, FILE *stream)
 
 int rt_puts(const char *s)
 {
-   return rt_fputs(s, stdout);
+   int res;
+
+   res = rt_fputs(s, stdout);
+   if (res  0)
+   return res;
+
+   return print_to_buffer(stdout, 0, RT_PRINT_MODE_FWRITE, 1, \n);
+}
+
+int rt_fputc(int c, FILE *stream)
+{
+   unsigned char uc = c;
+   int rc;
+
+   rc = print_to_buffer(stream, 0, RT_PRINT_MODE_FWRITE, 1, (char *)uc);
+   if (rc  0)
+   return EOF;
+
+   return (int)uc;
+}
+
+int rt_putchar(int c)
+{
+   return rt_fputc(c, stdout);
 }
 
 size_t rt_fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream)
@@ -803,10 +826,38 @@ int __wrap_fputs(const char *s, FILE *stream)
 
 int __wrap_puts(const char *s)
 {
-   return __wrap_fputs(s, stdout);
+   if (unlikely(xeno_get_current() != XN_NO_HANDLE 
+!(xeno_get_current_mode()  XNRELAX)))
+   return rt_puts(s);
+   else {
+   rt_print_flush_buffers();
+   return __real_puts(s);
+   }
+}
+
+int __wrap_fputc(int c, FILE *stream)
+{
+   if (unlikely(xeno_get_current() != XN_NO_HANDLE 
+!(xeno_get_current_mode()  XNRELAX)))
+   return rt_fputc(c, stream);
+   else {
+   rt_print_flush_buffers();
+   return __real_fputc(c, stream);
+   }
+}
+
+int __wrap_putchar(int c)
+{
+   if (unlikely(xeno_get_current() != XN_NO_HANDLE 
+!(xeno_get_current_mode()  XNRELAX)))
+   return rt_putchar(c);
+   else {
+   rt_print_flush_buffers();
+   return __real_putchar(c);
+   }
 }
 
-size_t __wrap_fwrite(void *ptr, size_t size, size_t nmemb, FILE *stream)
+size_t __wrap_fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream)
 {
if (unlikely(xeno_get_current() != XN_NO_HANDLE 
 !(xeno_get_current_mode()  XNRELAX)))
diff --git a/lib/cobalt/wrappers.c b/lib/cobalt/wrappers.c
index 272cfb4..90e0029 100644
--- a/lib/cobalt/wrappers.c
+++ b/lib/cobalt/wrappers.c
@@ -319,6 +319,18 @@ int __real_fputs(const char *s, FILE *stream)
 }
 
 __attribute__ ((weak))
+int __real_fputc(int c, FILE *stream)
+{
+   return fputc(c, stream);
+}
+
+__attribute__ ((weak))
+int __real_putchar(int c)
+{
+   return putchar(c);
+}
+
+__attribute__ ((weak))
 size_t __real_fwrite(const void *ptr, size_t sz, size_t nmemb, FILE *stream)
 {
return fwrite(ptr, sz, nmemb, stream);


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


[Xenomai-git] Philippe Gerum : nucleus/sched: update scheduling class weights

2012-04-30 Thread GIT version control
Module: xenomai-forge
Branch: master
Commit: a40251687c62a7d235b3ceaed69cac9066bedd52
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=a40251687c62a7d235b3ceaed69cac9066bedd52

Author: Philippe Gerum r...@xenomai.org
Date:   Mon Apr 23 15:27:05 2012 +0200

nucleus/sched: update scheduling class weights

This patch changes the respective weights of scheduling classes, in
order to give higher priority to classes whose threads are not
throttled by any sort of mechanism, over classes limiting the
execution time of their threads.

This gives us (in ascending priority order):

IDLE
   = TP
   = PSS
= RT

The net effect is that runnable RT threads will always be picked by
the scheduler core before threads from other classes, which may be
throttled by some class-specific mechanism.

---

 include/cobalt/nucleus/sched-rt.h  |7 ---
 include/cobalt/nucleus/sched.h |4 ++--
 kernel/cobalt/nucleus/sched-rt.c   |2 +-
 kernel/cobalt/nucleus/sched-sporadic.c |2 +-
 kernel/cobalt/nucleus/sched-tp.c   |8 +++-
 kernel/cobalt/nucleus/sched.c  |8 
 6 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/include/cobalt/nucleus/sched-rt.h 
b/include/cobalt/nucleus/sched-rt.h
index bd40743..b411ea8 100644
--- a/include/cobalt/nucleus/sched-rt.h
+++ b/include/cobalt/nucleus/sched-rt.h
@@ -44,9 +44,10 @@
 
 #ifdef __KERNEL__
 
-#if defined(CONFIG_XENO_OPT_SCALABLE_SCHED)  \
-  XNSCHED_RT_NR_PRIO  XNSCHED_MLQ_LEVELS
-#error RT class cannot use multi-level queue (too many priority levels)
+#if XNSCHED_RT_NR_PRIO  XNSCHED_CLASS_MAX_PRIO || \
+  (defined(CONFIG_XENO_OPT_SCALABLE_SCHED)   \
+   XNSCHED_RT_NR_PRIO  XNSCHED_MLQ_LEVELS)
+#error RT class has too many priority levels
 #endif
 
 extern struct xnsched_class xnsched_class_rt;
diff --git a/include/cobalt/nucleus/sched.h b/include/cobalt/nucleus/sched.h
index 24d6cd0..6fbc8d2 100644
--- a/include/cobalt/nucleus/sched.h
+++ b/include/cobalt/nucleus/sched.h
@@ -133,8 +133,8 @@ struct xnsched_class {
const char *name;
 };
 
-#define XNSCHED_CLASS_MAX_THREADS  32768
-#define XNSCHED_CLASS_WEIGHT(n)(n * XNSCHED_CLASS_MAX_THREADS)
+#define XNSCHED_CLASS_MAX_PRIO 1024
+#define XNSCHED_CLASS_WEIGHT(n)(n * XNSCHED_CLASS_MAX_PRIO)
 
 /* Placeholder for current thread priority */
 #define XNSCHED_RUNPRIO   0x8000
diff --git a/kernel/cobalt/nucleus/sched-rt.c b/kernel/cobalt/nucleus/sched-rt.c
index bbd5319..c8919a7 100644
--- a/kernel/cobalt/nucleus/sched-rt.c
+++ b/kernel/cobalt/nucleus/sched-rt.c
@@ -253,7 +253,7 @@ struct xnsched_class xnsched_class_rt = {
.sched_init_vfile   =   xnsched_rt_init_vfile,
.sched_cleanup_vfile=   xnsched_rt_cleanup_vfile,
 #endif
-   .weight =   XNSCHED_CLASS_WEIGHT(1),
+   .weight =   XNSCHED_CLASS_WEIGHT(3),
.name   =   rt
 };
 EXPORT_SYMBOL_GPL(xnsched_class_rt);
diff --git a/kernel/cobalt/nucleus/sched-sporadic.c 
b/kernel/cobalt/nucleus/sched-sporadic.c
index 73f6023..4d545f3 100644
--- a/kernel/cobalt/nucleus/sched-sporadic.c
+++ b/kernel/cobalt/nucleus/sched-sporadic.c
@@ -533,7 +533,7 @@ struct xnsched_class xnsched_class_sporadic = {
.sched_init_vfile   =   xnsched_sporadic_init_vfile,
.sched_cleanup_vfile=   xnsched_sporadic_cleanup_vfile,
 #endif
-   .weight =   XNSCHED_CLASS_WEIGHT(1),
+   .weight =   XNSCHED_CLASS_WEIGHT(2),
.name   =   pss
 };
 EXPORT_SYMBOL_GPL(xnsched_class_sporadic);
diff --git a/kernel/cobalt/nucleus/sched-tp.c b/kernel/cobalt/nucleus/sched-tp.c
index 42688db..bc937d3 100644
--- a/kernel/cobalt/nucleus/sched-tp.c
+++ b/kernel/cobalt/nucleus/sched-tp.c
@@ -79,8 +79,7 @@ static void xnsched_tp_init(struct xnsched *sched)
 
/*
 * Build the runqueues. Thread priorities for the TP policy
-* are the same as RT priorities. TP is actually a superset of
-* RT.
+* are valid RT priorities. TP is actually a subset of RT.
 */
for (n = 0; n  CONFIG_XENO_OPT_SCHED_TP_NRPART; n++)
sched_initpq(tp-partitions[n].runnable,
@@ -200,7 +199,7 @@ static void xnsched_tp_migrate(struct xnthread *thread, 
struct xnsched *sched)
/*
 * Since our partition schedule is a per-scheduler property,
 * it cannot apply to a thread that moves to another CPU
-* anymore. So we downgrade that thread to the RT class when a
+* anymore. So we upgrade that thread to the RT class when a
 * CPU migration occurs. A subsequent call to
 * xnsched_set_policy() may move it back to TP scheduling,
 * with a partition assignment that fits the remote CPU's
@@ -278,7 +277,6 @@ struct vfile_sched_tp_priv {
struct xnholder *curr;
 };
 
-
 struct 

[Xenomai-git] Philippe Gerum : hal/powerpc: fixup for refactored timers (take #2)

2012-04-24 Thread GIT version control
Module: xenomai-2.6
Branch: master
Commit: 3b679a488823d347605cdc19e08c120da533dd4e
URL:
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=3b679a488823d347605cdc19e08c120da533dd4e

Author: Philippe Gerum r...@xenomai.org
Date:   Tue Apr 24 15:40:28 2012 +0200

hal/powerpc: fixup for refactored timers (take #2)

---

 include/asm-powerpc/hal.h |9 +
 ksrc/arch/powerpc/hal.c   |   18 +++---
 2 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/include/asm-powerpc/hal.h b/include/asm-powerpc/hal.h
index 9cf6134..aea960c 100644
--- a/include/asm-powerpc/hal.h
+++ b/include/asm-powerpc/hal.h
@@ -31,7 +31,12 @@
 
 #include asm-generic/xenomai/hal.h   /* Read the generic bits. */
 
+#ifdef CONFIG_IPIPE_CORE
+#include linux/ipipe_tickdev.h
+#define RTHAL_TIMER_DEVICE ipipe_timer_name()
+#else
 #define RTHAL_TIMER_DEVICE decrementer
+#endif
 #define RTHAL_CLOCK_DEVICE timebase
 
 typedef unsigned long long rthal_time_t;
@@ -84,6 +89,9 @@ static inline unsigned long long rthal_rdtsc(void)
 
 static inline void rthal_timer_program_shot(unsigned long delay)
 {
+#ifdef CONFIG_IPIPE_CORE
+   ipipe_timer_set(delay);
+#else /* !CONFIG_IPIPE_CORE */
if (delay  3)
rthal_schedule_irq_head(RTHAL_TIMER_IRQ);
else {
@@ -99,6 +107,7 @@ static inline void rthal_timer_program_shot(unsigned long 
delay)
set_dec((int)delay);
 #endif /* CONFIG_40x */
}
+#endif /* !CONFIG_IPIPE_CORE */
 }
 
 static inline struct mm_struct *rthal_get_active_mm(void)
diff --git a/ksrc/arch/powerpc/hal.c b/ksrc/arch/powerpc/hal.c
index df76568..ad1b04a 100644
--- a/ksrc/arch/powerpc/hal.c
+++ b/ksrc/arch/powerpc/hal.c
@@ -66,11 +66,6 @@ static int cpu_timers_requested;
 
 #ifdef CONFIG_IPIPE_CORE
 
-#define rthal_setup_oneshot_dec() do { } while (0)
-#define rthal_setup_periodic_dec() do { } while (0)
-#define rthal_timer_set_oneshot(rt_mode) do { } while (0)
-#define rthal_timer_set_periodic() do { } while (0)
-
 static inline
 int rthal_tickdev_request(void (*tick_handler)(void),
  void (*mode_emul)(enum clock_event_mode mode,
@@ -126,8 +121,6 @@ int rthal_tickdev_request(void (*tick_handler)(void),
if (ret)
return ret;
 #endif
-   rthal_timer_set_oneshot(1);
-
return tickval;
 }
 
@@ -141,14 +134,9 @@ static inline void rthal_tickdev_release(int cpu)
 #ifdef CONFIG_SMP
rthal_irq_release(RTHAL_TIMER_IPI);
 #endif /* CONFIG_SMP */
-
-   if (rthal_ktimer_saved_mode == KTIMER_MODE_PERIODIC)
-   rthal_timer_set_periodic();
-   else if (rthal_ktimer_saved_mode == KTIMER_MODE_ONESHOT)
-   rthal_timer_set_oneshot(0);
 }
 
-static inline int rthal_tickdev_enum(void)
+static inline int rthal_tickdev_select(void)
 {
return ipipe_timers_request();
 }
@@ -332,7 +320,7 @@ static inline void rthal_tickdev_release(int cpu)
rthal_timer_set_oneshot(0);
 }
 
-static inline int rthal_tickdev_enum(void)
+static inline int rthal_tickdev_select(void)
 {
return 0;
 }
@@ -559,7 +547,7 @@ int rthal_arch_init(void)
}
 #endif /* CONFIG_ALTIVEC */
 
-   ret = rthal_tickdev_enum();
+   ret = rthal_tickdev_select();
if (ret)
return ret;
 


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


[Xenomai-git] Gilles Chanteperdrix : hal/arm: fixup for refactored timers

2012-04-24 Thread GIT version control
Module: xenomai-2.6
Branch: master
Commit: 5e8d550b067f2bb92a1b419fc393d984c0299774
URL:
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=5e8d550b067f2bb92a1b419fc393d984c0299774

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Tue Apr 24 22:26:31 2012 +0200

hal/arm: fixup for refactored timers

---

 include/asm-arm/hal.h |   18 -
 ksrc/arch/arm/hal.c   |  185 +++-
 2 files changed, 133 insertions(+), 70 deletions(-)

diff --git a/include/asm-arm/hal.h b/include/asm-arm/hal.h
index 1d33079..42d8a34 100644
--- a/include/asm-arm/hal.h
+++ b/include/asm-arm/hal.h
@@ -39,6 +39,11 @@
 #include asm/vfp.h
 #endif /* CONFIG_VFP */
 
+#ifdef CONFIG_IPIPE_CORE
+#define RTHAL_TIMER_DEVICE (ipipe_timer_name())
+#define RTHAL_CLOCK_DEVICE ipipe_tsc
+#define RTHAL_TIMER_IRQ__ipipe_hrtimer_irq
+#else /* !CONFIG_IPIPE_CORE */
 #if defined(CONFIG_ARCH_AT91)
 #include linux/stringify.h
 #define RTHAL_TIMER_DEVICE at91_tc __stringify(CONFIG_IPIPE_AT91_TC)
@@ -93,6 +98,7 @@
 #else
 #error Unsupported ARM machine
 #endif /* CONFIG_ARCH_SA1100 */
+#endif /* !CONFIG_IPIPE_CORE */
 
 typedef unsigned long long rthal_time_t;
 
@@ -189,10 +195,14 @@ static inline struct task_struct *rthal_current_host_task 
(int cpuid)
 
 static inline void rthal_timer_program_shot (unsigned long delay)
 {
-if(!delay)
-   rthal_schedule_irq_head(RTHAL_TIMER_IRQ);
-else
-   __ipipe_mach_set_dec(delay);
+#ifdef CONFIG_IPIPE_CORE
+   ipipe_timer_set(delay);
+#else /* !CONFIG_IPIPE_CORE */
+   if(!delay)
+   rthal_schedule_irq_head(RTHAL_TIMER_IRQ);
+   else
+   __ipipe_mach_set_dec(delay);
+#endif /* !CONFIG_IPIPE_CORE */
 }
 
 static inline struct mm_struct *rthal_get_active_mm(void)
diff --git a/ksrc/arch/arm/hal.c b/ksrc/arch/arm/hal.c
index 7f77974..78742fc 100644
--- a/ksrc/arch/arm/hal.c
+++ b/ksrc/arch/arm/hal.c
@@ -61,6 +61,33 @@ static struct {
 
 enum rthal_ktimer_mode rthal_ktimer_saved_mode;
 
+static int cpu_timers_requested;
+
+#ifdef CONFIG_IPIPE_CORE
+
+#define steal_timer(stolen) do { } while (0)
+#define force_oneshot_hw_mode() do { } while (0)
+#define restore_normal_hw_mode() do { } while (0)
+#define rthal_timer_set_oneshot(rt_mode) do { } while (0)
+#define rthal_timer_set_periodic() do { } while (0)
+
+#define rthal_tickdev_select() \
+   ipipe_timers_request()
+
+#define rthal_tickdev_unselect() \
+   ipipe_timers_release()
+
+#define rthal_tickdev_request(tick_handler, mode_emul, tick_emul, cpu, tmfreq) 
\
+   ({  \
+   (void)(tmfreq); \
+   ipipe_timer_start(tick_handler, mode_emul, tick_emul, cpu); \
+   })
+
+#define rthal_tickdev_release(cpu) \
+   ipipe_timer_stop(cpu)
+
+#else /* !I-pipe core */
+
 #define RTHAL_SET_ONESHOT_XENOMAI  1
 #define RTHAL_SET_ONESHOT_LINUX2
 #define RTHAL_SET_PERIODIC 3
@@ -96,61 +123,6 @@ static inline void restore_normal_hw_mode(void)
__ipipe_mach_release_timer();
 }
 
-unsigned long rthal_timer_calibrate(void)
-{
-   unsigned long long start, end, sum = 0, sum_sq = 0;
-   volatile unsigned const_delay = 0x;
-   unsigned long result, flags, tsc_lat;
-   unsigned int delay = const_delay;
-   long long diff;
-   int i, j;
-
-   flags = rthal_critical_enter(NULL);
-
-   /*
-* Hw interrupts off, other CPUs quiesced, no migration
-* possible. We can now fiddle with the timer chip (per-cpu
-* local or global, rthal_timer_program_shot() will handle
-* this transparently via the I-pipe).
-*/
-   steal_timer(1);
-   force_oneshot_hw_mode();
-
-   rthal_read_tsc(start);
-   barrier();
-   rthal_read_tsc(end);
-   tsc_lat = end - start;
-   barrier();
-
-   for (i = 0; i  RTHAL_CALIBRATE_LOOPS; i++) {
-   flush_cache_all();
-   for (j = 0; j  RTHAL_CALIBRATE_LOOPS; j++) {
-   rthal_read_tsc(start);
-   barrier();
-   rthal_timer_program_shot(
-   rthal_nodiv_imuldiv_ceil(delay, 
rthal_tsc_to_timer));
-   barrier();
-   rthal_read_tsc(end);
-   diff = end - start - tsc_lat;
-   if (diff  0) {
-   sum += diff;
-   sum_sq += diff * diff;
-   }
-   }
-   }
-
-   restore_normal_hw_mode();
-
-   rthal_critical_exit(flags);
-
-   /* Use average + standard deviation as timer programming latency. */
-   do_div(sum, RTHAL_CALIBRATE_LOOPS * RTHAL_CALIBRATE_LOOPS);
-   do_div(sum_sq, RTHAL_CALIBRATE_LOOPS * RTHAL_CALIBRATE_LOOPS);
-   result = sum + 

[Xenomai-git] Gilles Chanteperdrix : testsuite: try running clocktest with CLOCK_HOST_REALTIME

2012-04-24 Thread GIT version control
Module: xenomai-2.6
Branch: master
Commit: 37c1f4dac9e96dd9e8808ca0f642430bc780604e
URL:
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=37c1f4dac9e96dd9e8808ca0f642430bc780604e

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Wed Apr 25 01:07:57 2012 +0200

testsuite: try running clocktest with CLOCK_HOST_REALTIME

---

 src/testsuite/xeno-test/Makefile.am  |2 +-
 src/testsuite/xeno-test/Makefile.in  |2 +-
 src/testsuite/xeno-test/xeno-test.in |2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/testsuite/xeno-test/Makefile.am 
b/src/testsuite/xeno-test/Makefile.am
index 7a59fcb..540329b 100644
--- a/src/testsuite/xeno-test/Makefile.am
+++ b/src/testsuite/xeno-test/Makefile.am
@@ -8,7 +8,7 @@ xeno_test_run_CPPFLAGS = -DTESTDIR=\$(testdir)\
 xeno_test_run_LDADD = -lrt
 
 xeno-test: $(srcdir)/xeno-test.in Makefile
-   sed s,@testdir@,$(testdir), $  $@
+   sed s,@testdir@,$(testdir),g $  $@
 
 EXTRA_DIST = $(test_SCRIPTS) xeno-test.in
 
diff --git a/src/testsuite/xeno-test/Makefile.in 
b/src/testsuite/xeno-test/Makefile.in
index ad33119..1a52d9c 100644
--- a/src/testsuite/xeno-test/Makefile.in
+++ b/src/testsuite/xeno-test/Makefile.in
@@ -666,7 +666,7 @@ uninstall-am: uninstall-binSCRIPTS uninstall-testPROGRAMS \
 
 
 xeno-test: $(srcdir)/xeno-test.in Makefile
-   sed s,@testdir@,$(testdir), $  $@
+   sed s,@testdir@,$(testdir),g $  $@
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/testsuite/xeno-test/xeno-test.in 
b/src/testsuite/xeno-test/xeno-test.in
index 3f5ba0f..8241c88 100644
--- a/src/testsuite/xeno-test/xeno-test.in
+++ b/src/testsuite/xeno-test/xeno-test.in
@@ -43,7 +43,7 @@ set -ex
 echo 0  /proc/xenomai/latency || :
 
 @testdir@/arith
-@testdir@/clocktest -T 30
+@testdir@/clocktest -C 42 -T 30 || @testdir@/clocktest -T 30
 @testdir@/switchtest -T 30
 @testdir@/cond-torture-native
 @testdir@/cond-torture-posix


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


[Xenomai-git] Gilles Chanteperdrix : nucleus: get CLOCK_HOSTRT working with ipipe-core

2012-04-24 Thread GIT version control
Module: xenomai-2.6
Branch: master
Commit: b34780d3aec5a3888ef2a503623a05392012de5d
URL:
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=b34780d3aec5a3888ef2a503623a05392012de5d

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Wed Apr 25 01:10:20 2012 +0200

nucleus: get CLOCK_HOSTRT working with ipipe-core

---

 ksrc/nucleus/Kconfig |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/ksrc/nucleus/Kconfig b/ksrc/nucleus/Kconfig
index e76984f..e058577 100644
--- a/ksrc/nucleus/Kconfig
+++ b/ksrc/nucleus/Kconfig
@@ -367,7 +367,7 @@ config XENO_OPT_SELECT
bool
 
 config XENO_OPT_HOSTRT
-   depends on HAVE_IPIPE_HOSTRT
+   depends on HAVE_IPIPE_HOSTRT || IPIPE_HAVE_HOSTRT
def_bool y
 
 menu Timing


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


[Xenomai-git] Philippe Gerum : nucleus/sched: update scheduling class weights

2012-04-23 Thread GIT version control
Module: xenomai-2.6
Branch: master
Commit: f08a18437cc22bc1d5e2389ad25eb1db26162ffe
URL:
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=f08a18437cc22bc1d5e2389ad25eb1db26162ffe

Author: Philippe Gerum r...@xenomai.org
Date:   Mon Apr 23 12:19:58 2012 +0200

nucleus/sched: update scheduling class weights

This patch changes the respective weights of scheduling classes, in
order to give higher priority to classes whose threads are not
throttled by any sort of mechanism, over classes limiting the
execution time of their threads.

This gives us (in ascending priority order):

IDLE
   = TP
   = PSS
= RT

The net effect is that runnable RT threads will always be picked by
the scheduler core before threads from other classes, which may be
throttled by some class-specific mechanism.

---

 include/nucleus/sched-rt.h|7 ---
 include/nucleus/sched.h   |4 ++--
 ksrc/nucleus/sched-rt.c   |2 +-
 ksrc/nucleus/sched-sporadic.c |2 +-
 ksrc/nucleus/sched-tp.c   |8 +++-
 ksrc/nucleus/sched.c  |8 
 6 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/include/nucleus/sched-rt.h b/include/nucleus/sched-rt.h
index 69c63ff..40a2011 100644
--- a/include/nucleus/sched-rt.h
+++ b/include/nucleus/sched-rt.h
@@ -48,9 +48,10 @@
 
 #if defined(__KERNEL__) || defined(__XENO_SIM__)
 
-#if defined(CONFIG_XENO_OPT_SCALABLE_SCHED)  \
-  XNSCHED_RT_NR_PRIO  XNSCHED_MLQ_LEVELS
-#error RT class cannot use multi-level queue (too many priority levels)
+#if XNSCHED_RT_NR_PRIO  XNSCHED_CLASS_MAX_PRIO || \
+  (defined(CONFIG_XENO_OPT_SCALABLE_SCHED)   \
+   XNSCHED_RT_NR_PRIO  XNSCHED_MLQ_LEVELS)
+#error RT class has too many priority levels
 #endif
 
 extern struct xnsched_class xnsched_class_rt;
diff --git a/include/nucleus/sched.h b/include/nucleus/sched.h
index df8853b..4657757 100644
--- a/include/nucleus/sched.h
+++ b/include/nucleus/sched.h
@@ -159,8 +159,8 @@ struct xnsched_class {
const char *name;
 };
 
-#define XNSCHED_CLASS_MAX_THREADS  32768
-#define XNSCHED_CLASS_WEIGHT(n)(n * XNSCHED_CLASS_MAX_THREADS)
+#define XNSCHED_CLASS_MAX_PRIO 1024
+#define XNSCHED_CLASS_WEIGHT(n)(n * XNSCHED_CLASS_MAX_PRIO)
 
 /* Placeholder for current thread priority */
 #define XNSCHED_RUNPRIO   0x8000
diff --git a/ksrc/nucleus/sched-rt.c b/ksrc/nucleus/sched-rt.c
index a182822..a167af6 100644
--- a/ksrc/nucleus/sched-rt.c
+++ b/ksrc/nucleus/sched-rt.c
@@ -302,7 +302,7 @@ struct xnsched_class xnsched_class_rt = {
.sched_init_vfile   =   xnsched_rt_init_vfile,
.sched_cleanup_vfile=   xnsched_rt_cleanup_vfile,
 #endif
-   .weight =   XNSCHED_CLASS_WEIGHT(1),
+   .weight =   XNSCHED_CLASS_WEIGHT(3),
.name   =   rt
 };
 EXPORT_SYMBOL_GPL(xnsched_class_rt);
diff --git a/ksrc/nucleus/sched-sporadic.c b/ksrc/nucleus/sched-sporadic.c
index ffc9bab..b890aae 100644
--- a/ksrc/nucleus/sched-sporadic.c
+++ b/ksrc/nucleus/sched-sporadic.c
@@ -588,7 +588,7 @@ struct xnsched_class xnsched_class_sporadic = {
.sched_init_vfile   =   xnsched_sporadic_init_vfile,
.sched_cleanup_vfile=   xnsched_sporadic_cleanup_vfile,
 #endif
-   .weight =   XNSCHED_CLASS_WEIGHT(1),
+   .weight =   XNSCHED_CLASS_WEIGHT(2),
.name   =   pss
 };
 EXPORT_SYMBOL_GPL(xnsched_class_sporadic);
diff --git a/ksrc/nucleus/sched-tp.c b/ksrc/nucleus/sched-tp.c
index a2af1d3..545bb4c 100644
--- a/ksrc/nucleus/sched-tp.c
+++ b/ksrc/nucleus/sched-tp.c
@@ -79,8 +79,7 @@ static void xnsched_tp_init(struct xnsched *sched)
 
/*
 * Build the runqueues. Thread priorities for the TP policy
-* are the same as RT priorities. TP is actually a superset of
-* RT.
+* are valid RT priorities. TP is actually a subset of RT.
 */
for (n = 0; n  CONFIG_XENO_OPT_SCHED_TP_NRPART; n++)
sched_initpq(tp-partitions[n].runnable,
@@ -209,7 +208,7 @@ static void xnsched_tp_migrate(struct xnthread *thread, 
struct xnsched *sched)
/*
 * Since our partition schedule is a per-scheduler property,
 * it cannot apply to a thread that moves to another CPU
-* anymore. So we downgrade that thread to the RT class when a
+* anymore. So we upgrade that thread to the RT class when a
 * CPU migration occurs. A subsequent call to
 * xnsched_set_policy() may move it back to TP scheduling,
 * with a partition assignment that fits the remote CPU's
@@ -287,7 +286,6 @@ struct vfile_sched_tp_priv {
struct xnholder *curr;
 };
 
-
 struct vfile_sched_tp_data {
int cpu;
pid_t pid;
@@ -404,7 +402,7 @@ struct xnsched_class xnsched_class_tp = {
.sched_init_vfile   =   xnsched_tp_init_vfile,

[Xenomai-git] Philippe Gerum : hal/powerpc: fixup for refactored timers of pipeline -core series

2012-04-23 Thread GIT version control
Module: xenomai-2.6
Branch: master
Commit: 56fa813678fe5d1ab5beb84f995b3a7833258c9e
URL:
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=56fa813678fe5d1ab5beb84f995b3a7833258c9e

Author: Philippe Gerum r...@xenomai.org
Date:   Mon Apr 23 12:19:17 2012 +0200

hal/powerpc: fixup for refactored timers of pipeline -core series

---

 ksrc/arch/powerpc/hal.c |  204 ++-
 1 files changed, 165 insertions(+), 39 deletions(-)

diff --git a/ksrc/arch/powerpc/hal.c b/ksrc/arch/powerpc/hal.c
index c5aede8..df76568 100644
--- a/ksrc/arch/powerpc/hal.c
+++ b/ksrc/arch/powerpc/hal.c
@@ -62,10 +62,105 @@ static struct {
 
 enum rthal_ktimer_mode rthal_ktimer_saved_mode;
 
+static int cpu_timers_requested;
+
+#ifdef CONFIG_IPIPE_CORE
+
+#define rthal_setup_oneshot_dec() do { } while (0)
+#define rthal_setup_periodic_dec() do { } while (0)
+#define rthal_timer_set_oneshot(rt_mode) do { } while (0)
+#define rthal_timer_set_periodic() do { } while (0)
+
+static inline
+int rthal_tickdev_request(void (*tick_handler)(void),
+ void (*mode_emul)(enum clock_event_mode mode,
+   struct clock_event_device *cdev),
+ int (*tick_emul)(unsigned long delay,
+  struct clock_event_device *cdev),
+ int cpu,
+ unsigned long *tmfreq)
+{
+   int ret, tickval;
+
+   ret = ipipe_timer_start(tick_handler, mode_emul, tick_emul, cpu);
+   switch (ret) {
+   case CLOCK_EVT_MODE_PERIODIC:
+   /*
+* Oneshot tick emulation callback won't be used, ask
+* the caller to start an internal timer for emulating
+* a periodic tick.
+*/
+   tickval = 10UL / HZ;
+   break;
+
+   case CLOCK_EVT_MODE_ONESHOT:
+   /* Oneshot tick emulation */
+   tickval = 1;
+   break;
+
+   case CLOCK_EVT_MODE_UNUSED:
+   /* We don't need to emulate the tick at all. */
+   tickval = 0;
+   break;
+
+   case CLOCK_EVT_MODE_SHUTDOWN:
+   return -ENODEV;
+
+   default:
+   return ret;
+   }
+
+   rthal_ktimer_saved_mode = ret;
+
+   /*
+* The rest of the initialization should only be performed
+* once by a single CPU.
+*/
+   if (cpu_timers_requested++  0)
+   return tickval;
+
+#ifdef CONFIG_SMP
+   ret = rthal_irq_request(RTHAL_TIMER_IPI,
+   (rthal_irq_handler_t)tick_handler,
+   NULL, NULL);
+   if (ret)
+   return ret;
+#endif
+   rthal_timer_set_oneshot(1);
+
+   return tickval;
+}
+
+static inline void rthal_tickdev_release(int cpu)
+{
+   ipipe_timer_stop(cpu);
+
+   if (--cpu_timers_requested  0)
+   return;
+
+#ifdef CONFIG_SMP
+   rthal_irq_release(RTHAL_TIMER_IPI);
+#endif /* CONFIG_SMP */
+
+   if (rthal_ktimer_saved_mode == KTIMER_MODE_PERIODIC)
+   rthal_timer_set_periodic();
+   else if (rthal_ktimer_saved_mode == KTIMER_MODE_ONESHOT)
+   rthal_timer_set_oneshot(0);
+}
+
+static inline int rthal_tickdev_enum(void)
+{
+   return ipipe_timers_request();
+}
+
+#else /* !CONFIG_IPIPE_CORE */
+
 #define RTHAL_SET_ONESHOT_XENOMAI  1
 #define RTHAL_SET_ONESHOT_LINUX2
 #define RTHAL_SET_PERIODIC 3
 
+#ifdef CONFIG_GENERIC_CLOCKEVENTS
+
 static inline void rthal_disarm_decr(int disarmed)
 {
 #if LINUX_VERSION_CODE  KERNEL_VERSION(2,6,24)
@@ -154,41 +249,36 @@ static void rthal_timer_set_periodic(void)
rthal_critical_exit(flags);
 }
 
-static int cpu_timers_requested;
-
-#ifdef CONFIG_GENERIC_CLOCKEVENTS
-
-int rthal_timer_request(
-   void (*tick_handler)(void),
-   void (*mode_emul)(enum clock_event_mode mode,
- struct clock_event_device *cdev),
-   int (*tick_emul)(unsigned long delay,
-struct clock_event_device *cdev),
-   int cpu)
+static inline
+int rthal_tickdev_request(void (*tick_handler)(void),
+ void (*mode_emul)(enum clock_event_mode mode,
+   struct clock_event_device *cdev),
+ int (*tick_emul)(unsigned long delay,
+  struct clock_event_device *cdev),
+ int cpu,
+ unsigned long *tmfreq)
 {
-   unsigned long dummy, *tmfreq = dummy;
-   int tickval, err, res;
+   int ret, tickval;
 
-   if (rthal_timerfreq_arg == 0)
-   tmfreq = rthal_tunables.timer_freq;
-
-   res = ipipe_request_tickdev(decrementer, mode_emul, tick_emul, cpu,
-   tmfreq);
-   switch (res) {
+   ret = 

[Xenomai-git] Philippe Gerum : nucleus: silence warning

2012-04-23 Thread GIT version control
Module: xenomai-2.6
Branch: master
Commit: 3f54a42bd19ff0daadce29b1b8a95e401d6f09a8
URL:
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=3f54a42bd19ff0daadce29b1b8a95e401d6f09a8

Author: Philippe Gerum r...@xenomai.org
Date:   Mon Apr 23 13:22:56 2012 +0200

nucleus: silence warning

---

 include/nucleus/thread.h |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/nucleus/thread.h b/include/nucleus/thread.h
index d5dc531..8934e19 100644
--- a/include/nucleus/thread.h
+++ b/include/nucleus/thread.h
@@ -401,8 +401,8 @@ typedef struct xnhook {
 #define xnthread_amok_p(thread)xnthread_test_info(thread, XNAMOK)
 #define xnthread_clear_amok(thread)xnthread_clear_info(thread, XNAMOK)
 #else /* !CONFIG_XENO_OPT_WATCHDOG */
-#define xnthread_amok_p(thread)(0)
-#define xnthread_clear_amok(thread)do { } while (0)
+#define xnthread_amok_p(thread)({ (void)(thread); 0; })
+#define xnthread_clear_amok(thread)do { (void)(thread); } while (0)
 #endif /* !CONFIG_XENO_OPT_WATCHDOG */
 
 /* Class-level operations for threads. */


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


[Xenomai-git] Philippe Gerum : powerpc: upgrade I-pipe support to 3.1.10-powerpc-2.13-07

2012-04-23 Thread GIT version control
Module: xenomai-2.6
Branch: master
Commit: ac6eee6003d95895bc95110e98c03cfda96c9f14
URL:
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=ac6eee6003d95895bc95110e98c03cfda96c9f14

Author: Philippe Gerum r...@xenomai.org
Date:   Mon Apr 23 17:02:32 2012 +0200

powerpc: upgrade I-pipe support to 3.1.10-powerpc-2.13-07

---

 ...ch = adeos-ipipe-3.1.10-powerpc-2.13-07.patch} |  124 +++-
 1 files changed, 92 insertions(+), 32 deletions(-)

diff --git a/ksrc/arch/powerpc/patches/adeos-ipipe-3.1.5-powerpc-2.13-06.patch 
b/ksrc/arch/powerpc/patches/adeos-ipipe-3.1.10-powerpc-2.13-07.patch
similarity index 99%
rename from ksrc/arch/powerpc/patches/adeos-ipipe-3.1.5-powerpc-2.13-06.patch
rename to ksrc/arch/powerpc/patches/adeos-ipipe-3.1.10-powerpc-2.13-07.patch
index eb4e27f..31a667f 100644
--- a/ksrc/arch/powerpc/patches/adeos-ipipe-3.1.5-powerpc-2.13-06.patch
+++ b/ksrc/arch/powerpc/patches/adeos-ipipe-3.1.10-powerpc-2.13-07.patch
@@ -65,6 +65,16 @@ index 6926b61..361330a 100644
  config HIGHMEM
bool High memory support
depends on PPC32
+diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
+index 57af16e..90e3387 100644
+--- a/arch/powerpc/Makefile
 b/arch/powerpc/Makefile
+@@ -264,3 +264,5 @@ checkbin:
+ 
+ CLEAN_FILES += $(TOUT)
+ 
++
++drivers-$(CONFIG_XENOMAI) += arch/powerpc/xenomai/
 diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
 index c26200b..29e87da 100644
 --- a/arch/powerpc/boot/Makefile
@@ -296,7 +306,7 @@ index bb712c9..8885e9b 100644
   * or should we not care like we do now ? --BenH.
 diff --git a/arch/powerpc/include/asm/ipipe.h 
b/arch/powerpc/include/asm/ipipe.h
 new file mode 100644
-index 000..977028d
+index 000..43d81fd
 --- /dev/null
 +++ b/arch/powerpc/include/asm/ipipe.h
 @@ -0,0 +1,280 @@
@@ -348,10 +358,10 @@ index 000..977028d
 +#include asm/paca.h
 +#endif
 +
-+#define IPIPE_ARCH_STRING 2.13-06
++#define IPIPE_ARCH_STRING 2.13-07
 +#define IPIPE_MAJOR_NUMBER2
 +#define IPIPE_MINOR_NUMBER13
-+#define IPIPE_PATCH_NUMBER6
++#define IPIPE_PATCH_NUMBER7
 +
 +#ifdef CONFIG_IPIPE_WANT_PREEMPTIBLE_SWITCH
 +
@@ -1395,7 +1405,7 @@ index 836f231..7407173 100644
 _TIF_SECCOMP | _TIF_SYSCALL_TRACEPOINT)
  
 diff --git a/arch/powerpc/include/asm/time.h b/arch/powerpc/include/asm/time.h
-index fe6f7c2..4ec3018 100644
+index bc3c745..7a52ec6 100644
 --- a/arch/powerpc/include/asm/time.h
 +++ b/arch/powerpc/include/asm/time.h
 @@ -28,6 +28,7 @@
@@ -2232,7 +2242,7 @@ index f8e971b..0757b6f 100644
/* Alignment Interrupt */
ALIGNMENT_EXCEPTION
 diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
-index 3564c49..d235b88 100644
+index 3564c49..d235b88a 100644
 --- a/arch/powerpc/kernel/head_64.S
 +++ b/arch/powerpc/kernel/head_64.S
 @@ -611,14 +611,20 @@ __secondary_start:
@@ -2448,10 +2458,10 @@ index ba31954..d0a9b16 100644
sync
 diff --git a/arch/powerpc/kernel/ipipe.c b/arch/powerpc/kernel/ipipe.c
 new file mode 100644
-index 000..7252c78
+index 000..8c5710c
 --- /dev/null
 +++ b/arch/powerpc/kernel/ipipe.c
-@@ -0,0 +1,710 @@
+@@ -0,0 +1,706 @@
 +/* -*- linux-c -*-
 + * linux/arch/powerpc/kernel/ipipe.c
 + *
@@ -2535,10 +2545,6 @@ index 000..7252c78
 +void __ipipe_register_ipi(unsigned int irq)
 +{
 +  __ipipe_ipi_irq = irq;
-+  mb();
-+#ifndef CONFIG_DEBUGGER
-+  irq_get_chip(irq)-irq_startup(irq_get_irq_data(irq));
-+#endif
 +}
 +
 +static void __ipipe_ipi_demux(int irq, struct pt_regs *regs)
@@ -3163,7 +3169,7 @@ index 000..7252c78
 +EXPORT_SYMBOL_GPL(atomic_clear_mask);
 +#endif/* !CONFIG_PPC64 */
 diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
-index d281fb6..bc355cb 100644
+index 4b1e82a..a19c336 100644
 --- a/arch/powerpc/kernel/irq.c
 +++ b/arch/powerpc/kernel/irq.c
 @@ -99,6 +99,8 @@ EXPORT_SYMBOL(irq_desc);
@@ -3175,7 +3181,7 @@ index d281fb6..bc355cb 100644
  static inline notrace unsigned long get_hard_enabled(void)
  {
unsigned long enabled;
-@@ -187,6 +189,9 @@ notrace void arch_local_irq_restore(unsigned long en)
+@@ -184,6 +186,9 @@ notrace void arch_local_irq_restore(unsigned long en)
__hard_irq_enable();
  }
  EXPORT_SYMBOL(arch_local_irq_restore);
@@ -3185,7 +3191,7 @@ index d281fb6..bc355cb 100644
  #endif /* CONFIG_PPC64 */
  
  int arch_show_interrupts(struct seq_file *p, int prec)
-@@ -283,7 +288,8 @@ void migrate_irqs(void)
+@@ -280,7 +285,8 @@ void migrate_irqs(void)
  }
  #endif
  
@@ -3195,7 +3201,7 @@ index d281fb6..bc355cb 100644
  {
struct thread_info *curtp, *irqtp;
unsigned long saved_sp_limit;
-@@ -326,8 +332,14 @@ static inline void handle_one_irq(unsigned int irq)
+@@ -323,8 +329,14 @@ static inline void handle_one_irq(unsigned int irq)
if (irqtp-flags)
set_bits(irqtp-flags, curtp-flags);
  }
@@ -3211,7 +3217,7 @@ index d281fb6..bc355cb 100644
  {
  #ifdef 

[Xenomai-git] Gilles Chanteperdrix : powerpc: adapt to refactored timers

2012-04-16 Thread GIT version control
Module: xenomai-gch
Branch: for-forge
Commit: eaf88c8cd464c3053fa241f4fc85169abc17b57d
URL:
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=eaf88c8cd464c3053fa241f4fc85169abc17b57d

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Tue Apr 17 00:15:58 2012 +0200

powerpc: adapt to refactored timers

---

 include/asm-powerpc/hal.h|8 
 kernel/cobalt/arch/powerpc/hal.c |   35 +++
 2 files changed, 39 insertions(+), 4 deletions(-)

diff --git a/include/asm-powerpc/hal.h b/include/asm-powerpc/hal.h
index 4b7fa03..721f455 100644
--- a/include/asm-powerpc/hal.h
+++ b/include/asm-powerpc/hal.h
@@ -32,7 +32,11 @@
 #include asm-generic/xenomai/hal.h   /* Read the generic bits. */
 
 #define RTHAL_ARCH_NAMEpowerpc
+#ifndef CONFIG_IPIPE_CORE
 #define RTHAL_TIMER_DEVICE decrementer
+#else /* CONFIG_IPIPE_CORE */
+#define RTHAL_TIMER_DEVICE (ipipe_timer_name())
+#endif /* CONFIG_IPIPE_CORE */
 #define RTHAL_CLOCK_DEVICE timebase
 
 typedef unsigned long long rthal_time_t;
@@ -76,6 +80,7 @@ static inline unsigned long long rthal_rdtsc(void)
 
 static inline void rthal_timer_program_shot(unsigned long delay)
 {
+#ifndef CONFIG_IPIPE_CORE
if (delay  3)
ipipe_post_irq_head(RTHAL_TIMER_IRQ);
else {
@@ -91,6 +96,9 @@ static inline void rthal_timer_program_shot(unsigned long 
delay)
set_dec((int)delay);
 #endif /* CONFIG_40x */
}
+#else /* !CONFIG_IPIPE_CORE */
+   ipipe_timer_set(delay);
+#endif /* !CONFIG_IPIPE_CORE */
 }
 
 /* Private interface -- Internal use only */
diff --git a/kernel/cobalt/arch/powerpc/hal.c b/kernel/cobalt/arch/powerpc/hal.c
index 05aa1e4..9aea41d 100644
--- a/kernel/cobalt/arch/powerpc/hal.c
+++ b/kernel/cobalt/arch/powerpc/hal.c
@@ -54,6 +54,8 @@ static volatile int sync_op;
 
 enum rthal_ktimer_mode rthal_ktimer_saved_mode;
 
+#ifndef CONFIG_IPIPE_CORE
+
 #define RTHAL_SET_ONESHOT_XENOMAI  1
 #define RTHAL_SET_ONESHOT_LINUX2
 #define RTHAL_SET_PERIODIC 3
@@ -134,6 +136,12 @@ static void rthal_timer_set_periodic(void)
rthal_disarm_decr(0);
ipipe_critical_exit(flags);
 }
+#else /* I-pipe core */
+#define rthal_setup_oneshot_dec() do { } while (0)
+#define rthal_setup_periodic_dec() do { } while (0)
+#define rthal_timer_set_oneshot(rt_mode) do { } while (0)
+#define rthal_timer_set_periodic() do { } while (0)
+#endif /* I-pipe core */
 
 static int cpu_timers_requested;
 
@@ -147,11 +155,12 @@ int rthal_timer_request(void (*tick_handler)(void),
unsigned long dummy, *tmfreq = dummy;
int tickval, ret, res;
 
-   if (rthal_timerfreq_arg == 0)
-   tmfreq = rthal_archdata.timer_freq;
-
+#ifndef CONFIG_IPIPE_CORE
res = ipipe_request_tickdev(decrementer, mode_emul, tick_emul, cpu,
tmfreq);
+#else /* CONFIG_IPIPE_CORE */
+   res = ipipe_timer_start(tick_handler, mode_emul, tick_emul, cpu);
+#endif /* CONFIG_IPIPE_CORE */
switch (res) {
case CLOCK_EVT_MODE_PERIODIC:
/* oneshot tick emulation callback won't be used, ask
@@ -185,13 +194,14 @@ int rthal_timer_request(void (*tick_handler)(void),
if (cpu_timers_requested++  0)
goto out;
 
+#ifndef CONFIG_IPIPE_CORE
ret = ipipe_request_irq(rthal_archdata.domain,
RTHAL_TIMER_IRQ,
(ipipe_irq_handler_t)tick_handler,
NULL, NULL);
if (ret)
return ret;
-
+#endif /* !I-ipipe core */
 #ifdef CONFIG_SMP
ret = ipipe_request_irq(rthal_archdata.domain,
RTHAL_TIMER_IPI,
@@ -208,7 +218,11 @@ out:
 
 void rthal_timer_release(int cpu)
 {
+#ifndef CONFIG_IPIPE_CORE
ipipe_release_tickdev(cpu);
+#else /* I-pipe core */
+   ipipe_timer_stop(cpu);
+#endif /* I-pipe core */
 
if (--cpu_timers_requested  0)
return;
@@ -216,7 +230,9 @@ void rthal_timer_release(int cpu)
 #ifdef CONFIG_SMP
ipipe_free_irq(rthal_archdata.domain, RTHAL_TIMER_IPI);
 #endif /* CONFIG_SMP */
+#ifndef CONFIG_IPIPE_CORE
ipipe_free_irq(rthal_archdata.domain, RTHAL_TIMER_IRQ);
+#endif /* !I-pipe core */
 
if (rthal_ktimer_saved_mode == KTIMER_MODE_PERIODIC)
rthal_timer_set_periodic();
@@ -244,6 +260,9 @@ unsigned long rthal_timer_calibrate(void)
 
 int rthal_arch_init(void)
 {
+#ifdef CONFIG_IPIPE_CORE
+   int rc;
+#endif /* I-pipe core */
 #ifdef CONFIG_ALTIVEC
if (!cpu_has_feature(CPU_FTR_ALTIVEC)) {
printk
@@ -252,6 +271,11 @@ int rthal_arch_init(void)
return -ENODEV;
}
 #endif /* CONFIG_ALTIVEC */
+#ifdef CONFIG_IPIPE_CORE
+   rc = ipipe_timers_request();
+   if (rc  0)
+   return rc;
+#endif /* I-pipe core */
 
if (rthal_timerfreq_arg == 0)
   

[Xenomai-git] Jan Kiszka : Append missing newline to rt_[f]puts output

2012-04-15 Thread GIT version control
Module: xenomai-2.6
Branch: master
Commit: 7e12401113a4f77b137f0861a2072233aea2ea76
URL:
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=7e12401113a4f77b137f0861a2072233aea2ea76

Author: Jan Kiszka jan.kis...@siemens.com
Date:   Tue Apr  3 20:55:42 2012 +0200

Append missing newline to rt_[f]puts output

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

---

 src/skins/common/rt_print.c |7 ++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/src/skins/common/rt_print.c b/src/skins/common/rt_print.c
index 272a4ba..8d0b9cd 100644
--- a/src/skins/common/rt_print.c
+++ b/src/skins/common/rt_print.c
@@ -274,7 +274,12 @@ int rt_printf(const char *format, ...)
 
 int rt_fputs(const char *s, FILE *stream)
 {
-   return print_to_buffer(stream, 0, RT_PRINT_MODE_FWRITE, strlen(s), s);
+   int res;
+
+   res = print_to_buffer(stream, 0, RT_PRINT_MODE_FWRITE, strlen(s), s);
+   if (res  0)
+   return res;
+   return print_to_buffer(stream, 0, RT_PRINT_MODE_FWRITE, 1, \n);
 }
 
 int rt_puts(const char *s)


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


[Xenomai-git] Jan Kiszka : Add regression test for mprotect on pinned memory

2012-04-15 Thread GIT version control
Module: xenomai-2.6
Branch: master
Commit: 84b8b04160fd87e8000402fd2038f291989ee0a0
URL:
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=84b8b04160fd87e8000402fd2038f291989ee0a0

Author: Jan Kiszka jan.kis...@siemens.com
Date:   Fri Mar 30 18:06:27 2012 +0200

Add regression test for mprotect on pinned memory

This tests both the original issue of mprotect reintroducing COW pages
to Xenomai processes as well as the recently fixed zero page corruption.

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

---

 src/testsuite/regression/posix/Makefile.am |2 +-
 src/testsuite/regression/posix/Makefile.in |   15 -
 src/testsuite/regression/posix/check.h |   10 +++
 src/testsuite/regression/posix/mprotect.c  |   97 
 4 files changed, 120 insertions(+), 4 deletions(-)

diff --git a/src/testsuite/regression/posix/Makefile.am 
b/src/testsuite/regression/posix/Makefile.am
index 26bc8f2..ad59bac 100644
--- a/src/testsuite/regression/posix/Makefile.am
+++ b/src/testsuite/regression/posix/Makefile.am
@@ -4,7 +4,7 @@ noinst_HEADERS = check.h
 
 CCLD = $(top_srcdir)/scripts/wrap-link.sh $(CC)
 
-tst_PROGRAMS = leaks shm
+tst_PROGRAMS = leaks shm mprotect
 
 CPPFLAGS = $(XENO_USER_CFLAGS) \
-I$(top_srcdir)/include/posix \
diff --git a/src/testsuite/regression/posix/Makefile.in 
b/src/testsuite/regression/posix/Makefile.in
index ff424e2..8ee1992 100644
--- a/src/testsuite/regression/posix/Makefile.in
+++ b/src/testsuite/regression/posix/Makefile.in
@@ -36,7 +36,7 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
-tst_PROGRAMS = leaks$(EXEEXT) shm$(EXEEXT)
+tst_PROGRAMS = leaks$(EXEEXT) shm$(EXEEXT) mprotect$(EXEEXT)
 subdir = src/testsuite/regression/posix
 DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in
@@ -62,6 +62,11 @@ leaks_OBJECTS = leaks.$(OBJEXT)
 leaks_LDADD = $(LDADD)
 leaks_DEPENDENCIES = ../../../skins/posix/libpthread_rt.la \
../../../skins/common/libxenomai.la
+mprotect_SOURCES = mprotect.c
+mprotect_OBJECTS = mprotect.$(OBJEXT)
+mprotect_LDADD = $(LDADD)
+mprotect_DEPENDENCIES = ../../../skins/posix/libpthread_rt.la \
+   ../../../skins/common/libxenomai.la
 shm_SOURCES = shm.c
 shm_OBJECTS = shm.$(OBJEXT)
 shm_LDADD = $(LDADD)
@@ -79,8 +84,8 @@ LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) 
$(LIBTOOLFLAGS) \
 LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
-SOURCES = leaks.c shm.c
-DIST_SOURCES = leaks.c shm.c
+SOURCES = leaks.c mprotect.c shm.c
+DIST_SOURCES = leaks.c mprotect.c shm.c
 HEADERS = $(noinst_HEADERS)
 ETAGS = etags
 CTAGS = ctags
@@ -330,6 +335,9 @@ clean-tstPROGRAMS:
 leaks$(EXEEXT): $(leaks_OBJECTS) $(leaks_DEPENDENCIES) 
@rm -f leaks$(EXEEXT)
$(LINK) $(leaks_OBJECTS) $(leaks_LDADD) $(LIBS)
+mprotect$(EXEEXT): $(mprotect_OBJECTS) $(mprotect_DEPENDENCIES) 
+   @rm -f mprotect$(EXEEXT)
+   $(LINK) $(mprotect_OBJECTS) $(mprotect_LDADD) $(LIBS)
 shm$(EXEEXT): $(shm_OBJECTS) $(shm_DEPENDENCIES) 
@rm -f shm$(EXEEXT)
$(LINK) $(shm_OBJECTS) $(shm_LDADD) $(LIBS)
@@ -341,6 +349,7 @@ distclean-compile:
-rm -f *.tab.c
 
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/leaks.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mprotect.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shm.Po@am__quote@
 
 .c.o:
diff --git a/src/testsuite/regression/posix/check.h 
b/src/testsuite/regression/posix/check.h
index 52f6ada..3d532cf 100644
--- a/src/testsuite/regression/posix/check.h
+++ b/src/testsuite/regression/posix/check.h
@@ -25,4 +25,14 @@
rc; \
})
 
+#define check_mmap(expr)   \
+   ({  \
+   void *rc = (expr);  \
+   if (rc == MAP_FAILED) { \
+   fprintf(stderr, %s:%d: #expr : %s\n, __FILE__, 
__LINE__, strerror(errno)); \
+   exit(EXIT_FAILURE); \
+   }   \
+   rc; \
+   })
+
 #endif /* POSIX_CHECK_H */
diff --git a/src/testsuite/regression/posix/mprotect.c 
b/src/testsuite/regression/posix/mprotect.c
new file mode 100644
index 000..99b619e
--- /dev/null
+++ b/src/testsuite/regression/posix/mprotect.c
@@ -0,0 +1,97 @@
+/*
+ * Test if implicit pinning of memory via mprotect works.
+ *
+ * Copyright (C) Jan Kiszka  jan.kis...@siemens.com
+ *
+ * Released under the terms of GPLv2.
+ */
+
+#include stdlib.h
+#include stdio.h
+#include signal.h
+#include sys/mman.h
+#include pthread.h
+
+#include 

[Xenomai-git] Jan Kiszka : testsuite: Only use rt_print services in leak test

2012-04-15 Thread GIT version control
Module: xenomai-2.6
Branch: master
Commit: 15083551e6cdf05413ce8dbb6e3bfaa1ab483c84
URL:
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=15083551e6cdf05413ce8dbb6e3bfaa1ab483c84

Author: Jan Kiszka jan.kis...@siemens.com
Date:   Tue Apr  3 20:54:47 2012 +0200

testsuite: Only use rt_print services in leak test

Avoids reordering of the output.

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

---

 src/testsuite/regression/native/leaks.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/testsuite/regression/native/leaks.c 
b/src/testsuite/regression/native/leaks.c
index a78acf5..e164267 100644
--- a/src/testsuite/regression/native/leaks.c
+++ b/src/testsuite/regression/native/leaks.c
@@ -40,7 +40,7 @@ unsigned long long get_used(void)
used += hd.used;
 
if (used == 0) {
-   fprintf(stderr, Error: could not get size of used memory\n);
+   rt_fprintf(stderr, Error: could not get size of used 
memory\n);
exit(EXIT_FAILURE);
}
 


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


[Xenomai-git] Gilles Chanteperdrix : hal/arm: support new type of tsc (spear tsc)

2012-04-15 Thread GIT version control
Module: xenomai-2.6
Branch: master
Commit: 4630d333a5b32d6e62a583857666eda45140d0b3
URL:
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=4630d333a5b32d6e62a583857666eda45140d0b3

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Sun Apr 15 18:45:55 2012 +0200

hal/arm: support new type of tsc (spear tsc)

---

 include/asm-arm/bits/bind.h   |   23 ---
 include/asm-arm/bits/shadow.h |   12 
 2 files changed, 24 insertions(+), 11 deletions(-)

diff --git a/include/asm-arm/bits/bind.h b/include/asm-arm/bits/bind.h
index 59c4534..bf9671a 100644
--- a/include/asm-arm/bits/bind.h
+++ b/include/asm-arm/bits/bind.h
@@ -45,11 +45,8 @@ static inline void xeno_arm_features_check(struct xnfeatinfo 
*finfo)
 
switch(__xn_tscinfo.kinfo.type) {
 #if CONFIG_XENO_ARM_TSC_TYPE == __XN_TSC_TYPE_KUSER
-   case __XN_TSC_TYPE_FREERUNNING:
-   case __XN_TSC_TYPE_FREERUNNING_COUNTDOWN:
-   case __XN_TSC_TYPE_FREERUNNING_FAST_WRAP:
-   case __XN_TSC_TYPE_DECREMENTER:
-   __xn_tscinfo.kuser_tsc_get = 
+   default:
+   __xn_tscinfo.kuser_tsc_get =
(rdtsc_t *)(0x1004 -
((*(unsigned *)(0x0ffc) + 3)  5));
goto domap;
@@ -69,22 +66,26 @@ static inline void xeno_arm_features_check(struct 
xnfeatinfo *finfo)
 #endif /* __XN_TSC_TYPE_FREERUNNING_FAST_WRAP */
goto domap;
 
+   default:
+   fprintf(stderr,
+   Xenomai: kernel/user tsc emulation mismatch.\n);
+   exit(EXIT_FAILURE);
+   break;
 #elif CONFIG_XENO_ARM_TSC_TYPE == __XN_TSC_TYPE_DECREMENTER
case __XN_TSC_TYPE_DECREMENTER:
goto domap;
 
+   default:
+   fprintf(stderr,
+   Xenomai: kernel/user tsc emulation mismatch.\n);
+   exit(EXIT_FAILURE);
+   break;
 #endif /* CONFIG_XENO_ARM_TSC_TYPE == __XN_TSC_TYPE_DECREMENTER */
case __XN_TSC_TYPE_NONE:
  error:
fprintf(stderr, Xenomai: Your board/configuration does not
 allow tsc emulation in user-space: %d\n, err);
exit(EXIT_FAILURE);
-   break;
-
-   default:
-   fprintf(stderr,
-   Xenomai: kernel/user tsc emulation mismatch.\n);
-   exit(EXIT_FAILURE);
}
 
   domap:
diff --git a/include/asm-arm/bits/shadow.h b/include/asm-arm/bits/shadow.h
index 9ea730c..86b6aaa 100644
--- a/include/asm-arm/bits/shadow.h
+++ b/include/asm-arm/bits/shadow.h
@@ -162,6 +162,18 @@ static inline int xnarch_local_syscall(struct pt_regs 
*regs)
info.tsc = RTHAL_TSC_INFO(ipipe_info).u.fr.tsc;
break;
 #endif /* IPIPE_TSC_TYPE_FREERUNNING_COUNTDOWN */
+#ifdef IPIPE_TSC_TYPE_FREERUNNING_TWICE
+   case IPIPE_TSC_TYPE_FREERUNNING_TWICE:
+   /*
+* Requires kuser, not backward compatible
+* with old xenomai versions
+*/
+   info.type = __XN_TSC_TYPE_KUSER,
+   info.counter = RTHAL_TSC_INFO(ipipe_info).u.fr.counter;
+   info.mask = RTHAL_TSC_INFO(ipipe_info).u.fr.mask;
+   info.tsc = RTHAL_TSC_INFO(ipipe_info).u.fr.tsc;
+   break;
+#endif /* IPIPE_TSC_TYPE_FREERUNNING_TWICE */
case IPIPE_TSC_TYPE_NONE:
return -ENOSYS;
 


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


[Xenomai-git] Gilles Chanteperdrix : rt_print: add support for fputc and putchar

2012-04-15 Thread GIT version control
Module: xenomai-2.6
Branch: master
Commit: 21f3f3c8cdc9088d604280d35066d5c1cb71f382
URL:
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=21f3f3c8cdc9088d604280d35066d5c1cb71f382

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Sun Apr 15 19:39:35 2012 +0200

rt_print: add support for fputc and putchar

---

 include/posix/stdio.h  |4 
 include/rtdk.h |2 ++
 src/skins/common/rt_print.c|   26 ++
 src/skins/posix/posix.wrappers |2 ++
 src/skins/posix/printf.c   |   30 +-
 src/skins/posix/wrappers.c |   12 
 6 files changed, 71 insertions(+), 5 deletions(-)

diff --git a/include/posix/stdio.h b/include/posix/stdio.h
index 6af0129..37d21cd 100644
--- a/include/posix/stdio.h
+++ b/include/posix/stdio.h
@@ -23,6 +23,10 @@ int __real_puts(const char *s);
 
 int __real_fputs(const char *s, FILE *stream);
 
+int __real_fputc(int c, FILE *stream);
+
+int __real_putchar(int c);
+
 size_t __real_fwrite(const void *ptr, size_t sz, size_t nmemb, FILE *stream);
 
 #ifdef __cplusplus
diff --git a/include/rtdk.h b/include/rtdk.h
index e1fc3b4..bf43716 100644
--- a/include/rtdk.h
+++ b/include/rtdk.h
@@ -54,6 +54,8 @@ 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);
diff --git a/src/skins/common/rt_print.c b/src/skins/common/rt_print.c
index 8d0b9cd..a9fce78 100644
--- a/src/skins/common/rt_print.c
+++ b/src/skins/common/rt_print.c
@@ -274,17 +274,35 @@ int rt_printf(const char *format, ...)
 
 int rt_fputs(const char *s, FILE *stream)
 {
+   return print_to_buffer(stream, 0, RT_PRINT_MODE_FWRITE, strlen(s), s);
+}
+
+int rt_puts(const char *s)
+{
int res;
 
-   res = print_to_buffer(stream, 0, RT_PRINT_MODE_FWRITE, strlen(s), s);
+   res = rt_fputs(s, stdout);
if (res  0)
return res;
-   return print_to_buffer(stream, 0, RT_PRINT_MODE_FWRITE, 1, \n);
+
+   return print_to_buffer(stdout, 0, RT_PRINT_MODE_FWRITE, 1, \n);
 }
 
-int rt_puts(const char *s)
+int rt_fputc(int c, FILE *stream)
+{
+   unsigned char uc = c;
+   int rc;
+
+   rc = print_to_buffer(stream, 0, RT_PRINT_MODE_FWRITE, 1, (char *)uc);
+   if (rc  0)
+   return EOF;
+
+   return (int)uc;
+}
+
+int rt_putchar(int c)
 {
-   return rt_fputs(s, stdout);
+   return rt_fputc(c, stdout);
 }
 
 size_t rt_fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream)
diff --git a/src/skins/posix/posix.wrappers b/src/skins/posix/posix.wrappers
index a7a6b50..9833077 100644
--- a/src/skins/posix/posix.wrappers
+++ b/src/skins/posix/posix.wrappers
@@ -95,6 +95,8 @@
 --wrap printf
 --wrap puts
 --wrap fputs
+--wrap fputc
+--wrap putchar
 --wrap fwrite
 --wrap syslog
 --wrap vsyslog
diff --git a/src/skins/posix/printf.c b/src/skins/posix/printf.c
index 99587d7..396a8e0 100644
--- a/src/skins/posix/printf.c
+++ b/src/skins/posix/printf.c
@@ -56,7 +56,35 @@ int __wrap_fputs(const char *s, FILE *stream)
 
 int __wrap_puts(const char *s)
 {
-   return __wrap_fputs(s, stdout);
+   if (unlikely(xeno_get_current() != XN_NO_HANDLE 
+!(xeno_get_current_mode()  XNRELAX)))
+   return rt_puts(s);
+   else {
+   rt_print_flush_buffers();
+   return __real_puts(s);
+   }
+}
+
+int __wrap_fputc(int c, FILE *stream)
+{
+   if (unlikely(xeno_get_current() != XN_NO_HANDLE 
+!(xeno_get_current_mode()  XNRELAX)))
+   return rt_fputc(c, stream);
+   else {
+   rt_print_flush_buffers();
+   return __real_fputc(c, stream);
+   }
+}
+
+int __wrap_putchar(int c)
+{
+   if (unlikely(xeno_get_current() != XN_NO_HANDLE 
+!(xeno_get_current_mode()  XNRELAX)))
+   return rt_putchar(c);
+   else {
+   rt_print_flush_buffers();
+   return __real_putchar(c);
+   }
 }
 
 size_t __wrap_fwrite(void *ptr, size_t size, size_t nmemb, FILE *stream)
diff --git a/src/skins/posix/wrappers.c b/src/skins/posix/wrappers.c
index bdedcb7..8d3fd7e 100644
--- a/src/skins/posix/wrappers.c
+++ b/src/skins/posix/wrappers.c
@@ -365,6 +365,18 @@ int __real_fputs(const char *s, FILE *stream)
 }
 
 __attribute__ ((weak))
+int __real_fputc(int c, FILE *stream)
+{
+   return fputc(c, stream);
+}
+
+__attribute__ ((weak))
+int __real_putchar(int c)
+{
+   return putchar(c);
+}
+
+__attribute__ ((weak))
 size_t __real_fwrite(const void *ptr, size_t sz, size_t nmemb, FILE *stream)
 {
return fwrite(ptr, 

[Xenomai-git] Gilles Chanteperdrix : rt_print: align with xenomai 2.6

2012-04-15 Thread GIT version control
Module: xenomai-gch
Branch: for-forge
Commit: 2aa3f448916bf67afacab7c16b4f760e73c58e30
URL:
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=2aa3f448916bf67afacab7c16b4f760e73c58e30

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Sun Apr 15 20:46:59 2012 +0200

rt_print: align with xenomai 2.6

---

 include/cobalt/stdio.h|8 -
 include/rtdk.h|2 +
 lib/cobalt/posix.wrappers |2 +
 lib/cobalt/printf.c   |   57 ++--
 lib/cobalt/wrappers.c |   12 +
 5 files changed, 76 insertions(+), 5 deletions(-)

diff --git a/include/cobalt/stdio.h b/include/cobalt/stdio.h
index 7d161da..cadde58 100644
--- a/include/cobalt/stdio.h
+++ b/include/cobalt/stdio.h
@@ -22,9 +22,13 @@ COBALT_DECL(int, printf(const char *fmt, ...));
 
 COBALT_DECL(int, puts(const char *s));
 
-int __real_fputs(const char *s, FILE *stream);
+COBALT_DECL(int, fputs(const char *s, FILE *stream));
 
-size_t __real_fwrite(const void *ptr, size_t sz, size_t nmemb, FILE *stream);
+COBALT_DECL(int, fputc(int c, FILE *stream));
+
+COBALT_DECL(int, putchar(int c));
+
+COBALT_DECL(size_t, fwrite(const void *ptr, size_t sz, size_t nmemb, FILE 
*stream));
 
 #ifdef __cplusplus
 }
diff --git a/include/rtdk.h b/include/rtdk.h
index 398b1c9..1b5f218 100644
--- a/include/rtdk.h
+++ b/include/rtdk.h
@@ -54,6 +54,8 @@ 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);
diff --git a/lib/cobalt/posix.wrappers b/lib/cobalt/posix.wrappers
index bb18827..c5a15fb 100644
--- a/lib/cobalt/posix.wrappers
+++ b/lib/cobalt/posix.wrappers
@@ -87,6 +87,8 @@
 --wrap printf
 --wrap puts
 --wrap fputs
+--wrap fputc
+--wrap putchar
 --wrap fwrite
 --wrap syslog
 --wrap vsyslog
diff --git a/lib/cobalt/printf.c b/lib/cobalt/printf.c
index aeddd22..6654a93 100644
--- a/lib/cobalt/printf.c
+++ b/lib/cobalt/printf.c
@@ -274,7 +274,30 @@ int rt_fputs(const char *s, FILE *stream)
 
 int rt_puts(const char *s)
 {
-   return rt_fputs(s, stdout);
+   int res;
+
+   res = rt_fputs(s, stdout);
+   if (res  0)
+   return res;
+
+   return print_to_buffer(stdout, 0, RT_PRINT_MODE_FWRITE, 1, \n);
+}
+
+int rt_fputc(int c, FILE *stream)
+{
+   unsigned char uc = c;
+   int rc;
+
+   rc = print_to_buffer(stream, 0, RT_PRINT_MODE_FWRITE, 1, (char *)uc);
+   if (rc  0)
+   return EOF;
+
+   return (int)uc;
+}
+
+int rt_putchar(int c)
+{
+   return rt_fputc(c, stdout);
 }
 
 size_t rt_fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream)
@@ -803,10 +826,38 @@ int __wrap_fputs(const char *s, FILE *stream)
 
 int __wrap_puts(const char *s)
 {
-   return __wrap_fputs(s, stdout);
+   if (unlikely(xeno_get_current() != XN_NO_HANDLE 
+!(xeno_get_current_mode()  XNRELAX)))
+   return rt_puts(s);
+   else {
+   rt_print_flush_buffers();
+   return __real_puts(s);
+   }
+}
+
+int __wrap_fputc(int c, FILE *stream)
+{
+   if (unlikely(xeno_get_current() != XN_NO_HANDLE 
+!(xeno_get_current_mode()  XNRELAX)))
+   return rt_fputc(c, stream);
+   else {
+   rt_print_flush_buffers();
+   return __real_fputc(c, stream);
+   }
+}
+
+int __wrap_putchar(int c)
+{
+   if (unlikely(xeno_get_current() != XN_NO_HANDLE 
+!(xeno_get_current_mode()  XNRELAX)))
+   return rt_putchar(c);
+   else {
+   rt_print_flush_buffers();
+   return __real_putchar(c);
+   }
 }
 
-size_t __wrap_fwrite(void *ptr, size_t size, size_t nmemb, FILE *stream)
+size_t __wrap_fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream)
 {
if (unlikely(xeno_get_current() != XN_NO_HANDLE 
 !(xeno_get_current_mode()  XNRELAX)))
diff --git a/lib/cobalt/wrappers.c b/lib/cobalt/wrappers.c
index 272cfb4..90e0029 100644
--- a/lib/cobalt/wrappers.c
+++ b/lib/cobalt/wrappers.c
@@ -319,6 +319,18 @@ int __real_fputs(const char *s, FILE *stream)
 }
 
 __attribute__ ((weak))
+int __real_fputc(int c, FILE *stream)
+{
+   return fputc(c, stream);
+}
+
+__attribute__ ((weak))
+int __real_putchar(int c)
+{
+   return putchar(c);
+}
+
+__attribute__ ((weak))
 size_t __real_fwrite(const void *ptr, size_t sz, size_t nmemb, FILE *stream)
 {
return fwrite(ptr, sz, nmemb, stream);


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


[Xenomai-git] Gilles Chanteperdrix : rt_print: align with xenomai 2.6

2012-04-15 Thread GIT version control
Module: xenomai-gch
Branch: for-forge
Commit: a75aac05b2c144b6ab9aba573fb7f921ffc38c49
URL:
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=a75aac05b2c144b6ab9aba573fb7f921ffc38c49

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Sun Apr 15 20:46:59 2012 +0200

rt_print: align with xenomai 2.6

fix puts, add fputc and putchar

---

 include/cobalt/stdio.h|8 -
 include/rtdk.h|2 +
 lib/cobalt/posix.wrappers |2 +
 lib/cobalt/printf.c   |   57 ++--
 lib/cobalt/wrappers.c |   12 +
 5 files changed, 76 insertions(+), 5 deletions(-)

diff --git a/include/cobalt/stdio.h b/include/cobalt/stdio.h
index 7d161da..cadde58 100644
--- a/include/cobalt/stdio.h
+++ b/include/cobalt/stdio.h
@@ -22,9 +22,13 @@ COBALT_DECL(int, printf(const char *fmt, ...));
 
 COBALT_DECL(int, puts(const char *s));
 
-int __real_fputs(const char *s, FILE *stream);
+COBALT_DECL(int, fputs(const char *s, FILE *stream));
 
-size_t __real_fwrite(const void *ptr, size_t sz, size_t nmemb, FILE *stream);
+COBALT_DECL(int, fputc(int c, FILE *stream));
+
+COBALT_DECL(int, putchar(int c));
+
+COBALT_DECL(size_t, fwrite(const void *ptr, size_t sz, size_t nmemb, FILE 
*stream));
 
 #ifdef __cplusplus
 }
diff --git a/include/rtdk.h b/include/rtdk.h
index 398b1c9..1b5f218 100644
--- a/include/rtdk.h
+++ b/include/rtdk.h
@@ -54,6 +54,8 @@ 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);
diff --git a/lib/cobalt/posix.wrappers b/lib/cobalt/posix.wrappers
index bb18827..c5a15fb 100644
--- a/lib/cobalt/posix.wrappers
+++ b/lib/cobalt/posix.wrappers
@@ -87,6 +87,8 @@
 --wrap printf
 --wrap puts
 --wrap fputs
+--wrap fputc
+--wrap putchar
 --wrap fwrite
 --wrap syslog
 --wrap vsyslog
diff --git a/lib/cobalt/printf.c b/lib/cobalt/printf.c
index aeddd22..6654a93 100644
--- a/lib/cobalt/printf.c
+++ b/lib/cobalt/printf.c
@@ -274,7 +274,30 @@ int rt_fputs(const char *s, FILE *stream)
 
 int rt_puts(const char *s)
 {
-   return rt_fputs(s, stdout);
+   int res;
+
+   res = rt_fputs(s, stdout);
+   if (res  0)
+   return res;
+
+   return print_to_buffer(stdout, 0, RT_PRINT_MODE_FWRITE, 1, \n);
+}
+
+int rt_fputc(int c, FILE *stream)
+{
+   unsigned char uc = c;
+   int rc;
+
+   rc = print_to_buffer(stream, 0, RT_PRINT_MODE_FWRITE, 1, (char *)uc);
+   if (rc  0)
+   return EOF;
+
+   return (int)uc;
+}
+
+int rt_putchar(int c)
+{
+   return rt_fputc(c, stdout);
 }
 
 size_t rt_fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream)
@@ -803,10 +826,38 @@ int __wrap_fputs(const char *s, FILE *stream)
 
 int __wrap_puts(const char *s)
 {
-   return __wrap_fputs(s, stdout);
+   if (unlikely(xeno_get_current() != XN_NO_HANDLE 
+!(xeno_get_current_mode()  XNRELAX)))
+   return rt_puts(s);
+   else {
+   rt_print_flush_buffers();
+   return __real_puts(s);
+   }
+}
+
+int __wrap_fputc(int c, FILE *stream)
+{
+   if (unlikely(xeno_get_current() != XN_NO_HANDLE 
+!(xeno_get_current_mode()  XNRELAX)))
+   return rt_fputc(c, stream);
+   else {
+   rt_print_flush_buffers();
+   return __real_fputc(c, stream);
+   }
+}
+
+int __wrap_putchar(int c)
+{
+   if (unlikely(xeno_get_current() != XN_NO_HANDLE 
+!(xeno_get_current_mode()  XNRELAX)))
+   return rt_putchar(c);
+   else {
+   rt_print_flush_buffers();
+   return __real_putchar(c);
+   }
 }
 
-size_t __wrap_fwrite(void *ptr, size_t size, size_t nmemb, FILE *stream)
+size_t __wrap_fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream)
 {
if (unlikely(xeno_get_current() != XN_NO_HANDLE 
 !(xeno_get_current_mode()  XNRELAX)))
diff --git a/lib/cobalt/wrappers.c b/lib/cobalt/wrappers.c
index 272cfb4..90e0029 100644
--- a/lib/cobalt/wrappers.c
+++ b/lib/cobalt/wrappers.c
@@ -319,6 +319,18 @@ int __real_fputs(const char *s, FILE *stream)
 }
 
 __attribute__ ((weak))
+int __real_fputc(int c, FILE *stream)
+{
+   return fputc(c, stream);
+}
+
+__attribute__ ((weak))
+int __real_putchar(int c)
+{
+   return putchar(c);
+}
+
+__attribute__ ((weak))
 size_t __real_fwrite(const void *ptr, size_t sz, size_t nmemb, FILE *stream)
 {
return fwrite(ptr, sz, nmemb, stream);


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


[Xenomai-git] Gilles Chanteperdrix : blackfin: adapt to refactored timers

2012-04-15 Thread GIT version control
Module: xenomai-gch
Branch: for-forge
Commit: ca4599f6ac4ccd6cfbc62b1e2d6eba9d28f3
URL:
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=ca4599f6ac4ccd6cfbc62b1e2d6eba9d28f3

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Sun Apr 15 23:25:25 2012 +0200

blackfin: adapt to refactored timers

---

 include/asm-blackfin/bits/timer.h |4 
 include/asm-blackfin/hal.h|   12 
 kernel/cobalt/arch/blackfin/hal.c |   29 +
 3 files changed, 45 insertions(+), 0 deletions(-)

diff --git a/include/asm-blackfin/bits/timer.h 
b/include/asm-blackfin/bits/timer.h
index 9c0f685..ca79b00 100644
--- a/include/asm-blackfin/bits/timer.h
+++ b/include/asm-blackfin/bits/timer.h
@@ -26,9 +26,13 @@
 
 static inline void xnarch_program_timer_shot(unsigned long delay)
 {
+#ifndef CONFIG_IPIPE_CORE
/* The core timer runs at the core clock rate -- therefore no
   conversion is needed between TSC and delay values. */
rthal_timer_program_shot(delay);
+#else /* !CONFIG_IPIPE_CORE */
+   ipipe_timer_set(delay);
+#endif /* !CONFIG_IPIPE_CORE */
 }
 
 static inline void xnarch_send_timer_ipi(xnarch_cpumask_t mask)
diff --git a/include/asm-blackfin/hal.h b/include/asm-blackfin/hal.h
index 1887497..35c7f01 100644
--- a/include/asm-blackfin/hal.h
+++ b/include/asm-blackfin/hal.h
@@ -30,7 +30,11 @@
 #include asm/div64.h
 
 #define RTHAL_ARCH_NAMEblackfin
+#ifndef CONFIG_IPIPE_CORE
 #define RTHAL_TIMER_DEVICE coretmr
+#else /* CONFIG_IPIPE_CORE */
+#define RTHAL_TIMER_DEVICE (ipipe_timer_name())
+#endif /* CONFIG_IPIPE_CORE */
 #define RTHAL_CLOCK_DEVICE cyclectr
 
 typedef unsigned long long rthal_time_t;
@@ -47,7 +51,11 @@ static inline __attribute_const__ unsigned long 
ffnz(unsigned long ul)
 #include asm/processor.h
 #include asm/xenomai/atomic.h
 
+#ifndef CONFIG_IPIPE_CORE
 #define RTHAL_TIMER_IRQIRQ_CORETMR
+#else /* CONFIG_IPIPE_CORE */
+#define RTHAL_TIMER_IRQ__ipipe_hrtimer_irq
+#endif /* CONFIG_IPIPE_CORE */
 #define RTHAL_HOST_TICK_IRQRTHAL_TIMER_IRQ
 
 /* The NMI watchdog timer is clocked by the system clock. */
@@ -65,6 +73,7 @@ static inline unsigned long long rthal_rdtsc(void)
 
 static inline void rthal_timer_program_shot(unsigned long delay)
 {
+#ifndef CONFIG_IPIPE_CORE
if (delay  2)
ipipe_post_irq_head(RTHAL_TIMER_IRQ);
else {
@@ -74,6 +83,9 @@ static inline void rthal_timer_program_shot(unsigned long 
delay)
CSYNC();
bfin_write_TCNTL(TMPWR | TMREN);
}
+#else /* !CONFIG_IPIPE_CORE */
+   ipipe_timer_set(delay);
+#endif /* !CONFIG_IPIPE_CORE */
 }
 
 /* Private interface -- Internal use only */
diff --git a/kernel/cobalt/arch/blackfin/hal.c 
b/kernel/cobalt/arch/blackfin/hal.c
index 808eb2d..8730095 100644
--- a/kernel/cobalt/arch/blackfin/hal.c
+++ b/kernel/cobalt/arch/blackfin/hal.c
@@ -40,6 +40,8 @@
 
 enum rthal_ktimer_mode rthal_ktimer_saved_mode;
 
+#ifndef CONFIG_IPIPE_CORE
+
 #define RTHAL_SET_ONESHOT_XENOMAI  1
 #define RTHAL_SET_ONESHOT_LINUX2
 #define RTHAL_SET_PERIODIC 3
@@ -93,6 +95,12 @@ static void rthal_timer_set_periodic(void)
rthal_setup_periodic_coretmr();
ipipe_critical_exit(flags);
 }
+#else /* I-pipe core */
+#define rthal_setup_oneshot_coretmr() do { } while (0)
+#define rthal_setup_periodic_coretmr() do { } while (0)
+#define rthal_timer_set_oneshot(rt_mode) do { } while (0)
+#define rthal_timer_set_periodic() do { } while (0)
+#endif /* I-pipe core */
 
 static int cpu_timers_requested;
 
@@ -109,8 +117,12 @@ int rthal_timer_request(void (*tick_handler)(void),
if (rthal_timerfreq_arg == 0)
tmfreq = rthal_archdata.timer_freq;
 
+#ifndef CONFIG_IPIPE_CORE
res = ipipe_request_tickdev(bfin_core_timer, mode_emul, tick_emul, 
cpu,
tmfreq);
+#else /* I-pipe timers */
+   res = ipipe_timer_start(tick_handler, mode_emul, tick_emul, cpu);
+#endif /* I-pipe timers */
switch (res) {
case CLOCK_EVT_MODE_PERIODIC:
/* Oneshot tick emulation callback won't be used, ask
@@ -151,12 +163,14 @@ int rthal_timer_request(void (*tick_handler)(void),
if (cpu_timers_requested++  0)
goto out;
 
+#ifndef CONFIG_IPIPE_CORE
ret = ipipe_request_irq(rthal_archdata.domain,
RTHAL_TIMER_IRQ,
(ipipe_irq_handler_t)tick_handler,
NULL, NULL);
if (ret)
return ret;
+#endif /* !I-pipe core */
 
rthal_timer_set_oneshot(1);
 
@@ -166,12 +180,18 @@ out:
 
 void rthal_timer_release(int cpu)
 {
+#ifndef CONFIG_IPIPE_CORE
ipipe_release_tickdev(cpu);
+#else /* I-pipe core */
+   ipipe_timer_stop(cpu);
+#endif /* I-pipe core */
 
if (--cpu_timers_requested  0)
 

[Xenomai-git] Gilles Chanteperdrix : blackfin: adapt to refactored timers

2012-04-15 Thread GIT version control
Module: xenomai-gch
Branch: for-forge
Commit: 891f1dfd73d792b80b9e36b1048885e12c5bccfa
URL:
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=891f1dfd73d792b80b9e36b1048885e12c5bccfa

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Sun Apr 15 23:25:25 2012 +0200

blackfin: adapt to refactored timers

---

 include/asm-blackfin/hal.h|   12 
 kernel/cobalt/arch/blackfin/hal.c |   29 +
 2 files changed, 41 insertions(+), 0 deletions(-)

diff --git a/include/asm-blackfin/hal.h b/include/asm-blackfin/hal.h
index 1887497..35c7f01 100644
--- a/include/asm-blackfin/hal.h
+++ b/include/asm-blackfin/hal.h
@@ -30,7 +30,11 @@
 #include asm/div64.h
 
 #define RTHAL_ARCH_NAMEblackfin
+#ifndef CONFIG_IPIPE_CORE
 #define RTHAL_TIMER_DEVICE coretmr
+#else /* CONFIG_IPIPE_CORE */
+#define RTHAL_TIMER_DEVICE (ipipe_timer_name())
+#endif /* CONFIG_IPIPE_CORE */
 #define RTHAL_CLOCK_DEVICE cyclectr
 
 typedef unsigned long long rthal_time_t;
@@ -47,7 +51,11 @@ static inline __attribute_const__ unsigned long 
ffnz(unsigned long ul)
 #include asm/processor.h
 #include asm/xenomai/atomic.h
 
+#ifndef CONFIG_IPIPE_CORE
 #define RTHAL_TIMER_IRQIRQ_CORETMR
+#else /* CONFIG_IPIPE_CORE */
+#define RTHAL_TIMER_IRQ__ipipe_hrtimer_irq
+#endif /* CONFIG_IPIPE_CORE */
 #define RTHAL_HOST_TICK_IRQRTHAL_TIMER_IRQ
 
 /* The NMI watchdog timer is clocked by the system clock. */
@@ -65,6 +73,7 @@ static inline unsigned long long rthal_rdtsc(void)
 
 static inline void rthal_timer_program_shot(unsigned long delay)
 {
+#ifndef CONFIG_IPIPE_CORE
if (delay  2)
ipipe_post_irq_head(RTHAL_TIMER_IRQ);
else {
@@ -74,6 +83,9 @@ static inline void rthal_timer_program_shot(unsigned long 
delay)
CSYNC();
bfin_write_TCNTL(TMPWR | TMREN);
}
+#else /* !CONFIG_IPIPE_CORE */
+   ipipe_timer_set(delay);
+#endif /* !CONFIG_IPIPE_CORE */
 }
 
 /* Private interface -- Internal use only */
diff --git a/kernel/cobalt/arch/blackfin/hal.c 
b/kernel/cobalt/arch/blackfin/hal.c
index 808eb2d..8730095 100644
--- a/kernel/cobalt/arch/blackfin/hal.c
+++ b/kernel/cobalt/arch/blackfin/hal.c
@@ -40,6 +40,8 @@
 
 enum rthal_ktimer_mode rthal_ktimer_saved_mode;
 
+#ifndef CONFIG_IPIPE_CORE
+
 #define RTHAL_SET_ONESHOT_XENOMAI  1
 #define RTHAL_SET_ONESHOT_LINUX2
 #define RTHAL_SET_PERIODIC 3
@@ -93,6 +95,12 @@ static void rthal_timer_set_periodic(void)
rthal_setup_periodic_coretmr();
ipipe_critical_exit(flags);
 }
+#else /* I-pipe core */
+#define rthal_setup_oneshot_coretmr() do { } while (0)
+#define rthal_setup_periodic_coretmr() do { } while (0)
+#define rthal_timer_set_oneshot(rt_mode) do { } while (0)
+#define rthal_timer_set_periodic() do { } while (0)
+#endif /* I-pipe core */
 
 static int cpu_timers_requested;
 
@@ -109,8 +117,12 @@ int rthal_timer_request(void (*tick_handler)(void),
if (rthal_timerfreq_arg == 0)
tmfreq = rthal_archdata.timer_freq;
 
+#ifndef CONFIG_IPIPE_CORE
res = ipipe_request_tickdev(bfin_core_timer, mode_emul, tick_emul, 
cpu,
tmfreq);
+#else /* I-pipe timers */
+   res = ipipe_timer_start(tick_handler, mode_emul, tick_emul, cpu);
+#endif /* I-pipe timers */
switch (res) {
case CLOCK_EVT_MODE_PERIODIC:
/* Oneshot tick emulation callback won't be used, ask
@@ -151,12 +163,14 @@ int rthal_timer_request(void (*tick_handler)(void),
if (cpu_timers_requested++  0)
goto out;
 
+#ifndef CONFIG_IPIPE_CORE
ret = ipipe_request_irq(rthal_archdata.domain,
RTHAL_TIMER_IRQ,
(ipipe_irq_handler_t)tick_handler,
NULL, NULL);
if (ret)
return ret;
+#endif /* !I-pipe core */
 
rthal_timer_set_oneshot(1);
 
@@ -166,12 +180,18 @@ out:
 
 void rthal_timer_release(int cpu)
 {
+#ifndef CONFIG_IPIPE_CORE
ipipe_release_tickdev(cpu);
+#else /* I-pipe core */
+   ipipe_timer_stop(cpu);
+#endif /* I-pipe core */
 
if (--cpu_timers_requested  0)
return;
 
+#ifndef CONFIG_IPIPE_CORE
ipipe_free_irq(rthal_archdata.domain, RTHAL_TIMER_IRQ);
+#endif /* !I-pipe core */
 
if (rthal_ktimer_saved_mode == KTIMER_MODE_PERIODIC)
rthal_timer_set_periodic();
@@ -203,6 +223,12 @@ void xnpod_schedule_deferred(void);
 
 int rthal_arch_init(void)
 {
+#ifdef CONFIG_IPIPE_CORE
+   int rc = ipipe_timers_request();
+   if (rc  0)
+   return rc;
+#endif /* CONFIG_IPIPE_CORE */
+
__ipipe_irq_tail_hook = (unsigned long)xnpod_schedule_deferred;
 
if (rthal_clockfreq_arg == 0)
@@ -218,6 +244,9 @@ int rthal_arch_init(void)
 
 void rthal_arch_cleanup(void)
 {
+#ifdef CONFIG_IPIPE_CORE

[Xenomai-git] Gilles Chanteperdrix : blackfin: adapt to refactored timers

2012-04-15 Thread GIT version control
Module: xenomai-gch
Branch: for-forge
Commit: 5e090f757621d3e9c8fe62c2c91ead1a6ec94e28
URL:
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=5e090f757621d3e9c8fe62c2c91ead1a6ec94e28

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Sun Apr 15 23:25:25 2012 +0200

blackfin: adapt to refactored timers

---

 include/asm-blackfin/hal.h|   12 +++
 kernel/cobalt/arch/blackfin/hal.c |   38 ++--
 2 files changed, 43 insertions(+), 7 deletions(-)

diff --git a/include/asm-blackfin/hal.h b/include/asm-blackfin/hal.h
index 1887497..35c7f01 100644
--- a/include/asm-blackfin/hal.h
+++ b/include/asm-blackfin/hal.h
@@ -30,7 +30,11 @@
 #include asm/div64.h
 
 #define RTHAL_ARCH_NAMEblackfin
+#ifndef CONFIG_IPIPE_CORE
 #define RTHAL_TIMER_DEVICE coretmr
+#else /* CONFIG_IPIPE_CORE */
+#define RTHAL_TIMER_DEVICE (ipipe_timer_name())
+#endif /* CONFIG_IPIPE_CORE */
 #define RTHAL_CLOCK_DEVICE cyclectr
 
 typedef unsigned long long rthal_time_t;
@@ -47,7 +51,11 @@ static inline __attribute_const__ unsigned long 
ffnz(unsigned long ul)
 #include asm/processor.h
 #include asm/xenomai/atomic.h
 
+#ifndef CONFIG_IPIPE_CORE
 #define RTHAL_TIMER_IRQIRQ_CORETMR
+#else /* CONFIG_IPIPE_CORE */
+#define RTHAL_TIMER_IRQ__ipipe_hrtimer_irq
+#endif /* CONFIG_IPIPE_CORE */
 #define RTHAL_HOST_TICK_IRQRTHAL_TIMER_IRQ
 
 /* The NMI watchdog timer is clocked by the system clock. */
@@ -65,6 +73,7 @@ static inline unsigned long long rthal_rdtsc(void)
 
 static inline void rthal_timer_program_shot(unsigned long delay)
 {
+#ifndef CONFIG_IPIPE_CORE
if (delay  2)
ipipe_post_irq_head(RTHAL_TIMER_IRQ);
else {
@@ -74,6 +83,9 @@ static inline void rthal_timer_program_shot(unsigned long 
delay)
CSYNC();
bfin_write_TCNTL(TMPWR | TMREN);
}
+#else /* !CONFIG_IPIPE_CORE */
+   ipipe_timer_set(delay);
+#endif /* !CONFIG_IPIPE_CORE */
 }
 
 /* Private interface -- Internal use only */
diff --git a/kernel/cobalt/arch/blackfin/hal.c 
b/kernel/cobalt/arch/blackfin/hal.c
index 808eb2d..57b4ae1 100644
--- a/kernel/cobalt/arch/blackfin/hal.c
+++ b/kernel/cobalt/arch/blackfin/hal.c
@@ -40,6 +40,8 @@
 
 enum rthal_ktimer_mode rthal_ktimer_saved_mode;
 
+#ifndef CONFIG_IPIPE_CORE
+
 #define RTHAL_SET_ONESHOT_XENOMAI  1
 #define RTHAL_SET_ONESHOT_LINUX2
 #define RTHAL_SET_PERIODIC 3
@@ -93,6 +95,12 @@ static void rthal_timer_set_periodic(void)
rthal_setup_periodic_coretmr();
ipipe_critical_exit(flags);
 }
+#else /* I-pipe core */
+#define rthal_setup_oneshot_coretmr() do { } while (0)
+#define rthal_setup_periodic_coretmr() do { } while (0)
+#define rthal_timer_set_oneshot(rt_mode) do { } while (0)
+#define rthal_timer_set_periodic() do { } while (0)
+#endif /* I-pipe core */
 
 static int cpu_timers_requested;
 
@@ -106,11 +114,12 @@ int rthal_timer_request(void (*tick_handler)(void),
unsigned long dummy, *tmfreq = dummy;
int tickval, ret, res;
 
-   if (rthal_timerfreq_arg == 0)
-   tmfreq = rthal_archdata.timer_freq;
-
+#ifndef CONFIG_IPIPE_CORE
res = ipipe_request_tickdev(bfin_core_timer, mode_emul, tick_emul, 
cpu,
tmfreq);
+#else /* I-pipe timers */
+   res = ipipe_timer_start(tick_handler, mode_emul, tick_emul, cpu);
+#endif /* I-pipe timers */
switch (res) {
case CLOCK_EVT_MODE_PERIODIC:
/* Oneshot tick emulation callback won't be used, ask
@@ -151,12 +160,14 @@ int rthal_timer_request(void (*tick_handler)(void),
if (cpu_timers_requested++  0)
goto out;
 
+#ifndef CONFIG_IPIPE_CORE
ret = ipipe_request_irq(rthal_archdata.domain,
RTHAL_TIMER_IRQ,
(ipipe_irq_handler_t)tick_handler,
NULL, NULL);
if (ret)
return ret;
+#endif /* !I-pipe core */
 
rthal_timer_set_oneshot(1);
 
@@ -166,12 +177,18 @@ out:
 
 void rthal_timer_release(int cpu)
 {
+#ifndef CONFIG_IPIPE_CORE
ipipe_release_tickdev(cpu);
+#else /* I-pipe core */
+   ipipe_timer_stop(cpu);
+#endif /* I-pipe core */
 
if (--cpu_timers_requested  0)
return;
 
+#ifndef CONFIG_IPIPE_CORE
ipipe_free_irq(rthal_archdata.domain, RTHAL_TIMER_IRQ);
+#endif /* !I-pipe core */
 
if (rthal_ktimer_saved_mode == KTIMER_MODE_PERIODIC)
rthal_timer_set_periodic();
@@ -203,21 +220,28 @@ void xnpod_schedule_deferred(void);
 
 int rthal_arch_init(void)
 {
+#ifdef CONFIG_IPIPE_CORE
+   int rc = ipipe_timers_request();
+   if (rc  0)
+   return rc;
+#endif /* CONFIG_IPIPE_CORE */
+
__ipipe_irq_tail_hook = (unsigned long)xnpod_schedule_deferred;
 
if (rthal_clockfreq_arg == 0)

[Xenomai-git] Gilles Chanteperdrix : arm: simplify tsc emulation

2012-04-14 Thread GIT version control
Module: xenomai-gch
Branch: for-forge
Commit: b00d6d1fc21f98406978632584b871d9bd1f
URL:
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=b00d6d1fc21f98406978632584b871d9bd1f

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Sat Apr 14 22:32:19 2012 +0200

arm: simplify tsc emulation

---

 include/asm-arm/bits/bind.h   |   34 +++---
 include/asm-arm/bits/shadow.h |   31 +++
 include/asm-arm/syscall.h |   14 --
 3 files changed, 14 insertions(+), 65 deletions(-)

diff --git a/include/asm-arm/bits/bind.h b/include/asm-arm/bits/bind.h
index ce37126..c72702c 100644
--- a/include/asm-arm/bits/bind.h
+++ b/include/asm-arm/bits/bind.h
@@ -13,9 +13,7 @@
 #include asm-generic/xenomai/bits/bind.h
 #include asm/xenomai/syscall.h
 
-__attribute__((weak)) struct __xn_tscinfo __xn_tscinfo = {
-  type: -1
-};
+__attribute__((weak)) struct __xn_tscinfo __xn_tscinfo;
 
 static inline void xeno_arm_features_check(struct xnfeatinfo *finfo)
 {
@@ -24,13 +22,16 @@ static inline void xeno_arm_features_check(struct 
xnfeatinfo *finfo)
int err, fd;
void *addr;
 
-   if (__xn_tscinfo.type != -1)
+   if (__xn_tscinfo.counter != NULL)
return;
 
err = XENOMAI_SYSCALL2(sc_nucleus_arch,
   XENOMAI_SYSARCH_TSCINFO, __xn_tscinfo);
-   if (err)
-   goto error;
+   if (err) {
+   fprintf(stderr, Xenomai init: error when retrieving ARM tsc
+emulation information.\n);
+   exit(EXIT_FAILURE);
+   }
 
fd = open(/dev/mem, O_RDONLY | O_SYNC);
if (fd == -1) {
@@ -40,27 +41,6 @@ static inline void xeno_arm_features_check(struct xnfeatinfo 
*finfo)
 
page_size = sysconf(_SC_PAGESIZE);
 
-   switch(__xn_tscinfo.type) {
-   case __XN_TSC_TYPE_FREERUNNING:
-   case __XN_TSC_TYPE_FREERUNNING_COUNTDOWN:
-   case __XN_TSC_TYPE_FREERUNNING_FAST_WRAP:
-   case __XN_TSC_TYPE_DECREMENTER:
-   goto domap;
-
-   case __XN_TSC_TYPE_NONE:
- error:
-   fprintf(stderr, Xenomai: Your board/configuration does not
-allow tsc emulation in user-space: %d\n, err);
-   exit(EXIT_FAILURE);
-   break;
-
-   default:
-   fprintf(stderr,
-   Xenomai: kernel/user tsc emulation mismatch.\n);
-   exit(EXIT_FAILURE);
-   }
-
-  domap:
phys_addr = (unsigned long) __xn_tscinfo.counter;
 
addr = mmap(NULL, page_size, PROT_READ, MAP_SHARED,
diff --git a/include/asm-arm/bits/shadow.h b/include/asm-arm/bits/shadow.h
index 25457b4..396 100644
--- a/include/asm-arm/bits/shadow.h
+++ b/include/asm-arm/bits/shadow.h
@@ -72,34 +72,9 @@ int xnarch_local_syscall(unsigned long a1, unsigned long a2,
if (error)
return error;
 
-   switch (RTHAL_TSC_INFO(ipipe_info).type) {
-   case IPIPE_TSC_TYPE_FREERUNNING:
-   info.type = __XN_TSC_TYPE_FREERUNNING,
-   info.counter = RTHAL_TSC_INFO(ipipe_info).u.fr.counter;
-   info.mask = RTHAL_TSC_INFO(ipipe_info).u.fr.mask;
-   info.tsc = RTHAL_TSC_INFO(ipipe_info).u.fr.tsc;
-   break;
-   case IPIPE_TSC_TYPE_DECREMENTER:
-   info.type = __XN_TSC_TYPE_DECREMENTER,
-   info.counter = 
RTHAL_TSC_INFO(ipipe_info).u.dec.counter;
-   info.mask = RTHAL_TSC_INFO(ipipe_info).u.dec.mask;
-   info.last_cnt = 
RTHAL_TSC_INFO(ipipe_info).u.dec.last_cnt;
-   info.tsc = RTHAL_TSC_INFO(ipipe_info).u.dec.tsc;
-   break;
-#ifdef IPIPE_TSC_TYPE_FREERUNNING_COUNTDOWN
-   case IPIPE_TSC_TYPE_FREERUNNING_COUNTDOWN:
-   info.type = __XN_TSC_TYPE_FREERUNNING_COUNTDOWN,
-   info.counter = RTHAL_TSC_INFO(ipipe_info).u.fr.counter;
-   info.mask = RTHAL_TSC_INFO(ipipe_info).u.fr.mask;
-   info.tsc = RTHAL_TSC_INFO(ipipe_info).u.fr.tsc;
-   break;
-#endif /* IPIPE_TSC_TYPE_FREERUNNING_COUNTDOWN */
-   case IPIPE_TSC_TYPE_NONE:
-   return -ENOSYS;
-
-   default:
-   return -EINVAL;
-   }
+   info.counter = RTHAL_TSC_INFO(ipipe_info).u.fr.counter;
+   info.tsc_get =
+   (__xn_rdtsc_t *)(((char *)__ipipe_tsc_get) + 4);
 
if (__xn_copy_to_user((void *)a2, info, sizeof(info)))
return -EFAULT;
diff --git a/include/asm-arm/syscall.h b/include/asm-arm/syscall.h
index 3f9c7e5..0977681 100644
--- a/include/asm-arm/syscall.h
+++ b/include/asm-arm/syscall.h
@@ -230,12 +230,11 @@ static 

[Xenomai-git] Jan Kiszka : Add regression test for mprotect on pinned memory

2012-04-04 Thread GIT version control
Module: xenomai-jki
Branch: for-upstream
Commit: 84b8b04160fd87e8000402fd2038f291989ee0a0
URL:
http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=84b8b04160fd87e8000402fd2038f291989ee0a0

Author: Jan Kiszka jan.kis...@siemens.com
Date:   Fri Mar 30 18:06:27 2012 +0200

Add regression test for mprotect on pinned memory

This tests both the original issue of mprotect reintroducing COW pages
to Xenomai processes as well as the recently fixed zero page corruption.

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

---

 src/testsuite/regression/posix/Makefile.am |2 +-
 src/testsuite/regression/posix/Makefile.in |   15 -
 src/testsuite/regression/posix/check.h |   10 +++
 src/testsuite/regression/posix/mprotect.c  |   97 
 4 files changed, 120 insertions(+), 4 deletions(-)

diff --git a/src/testsuite/regression/posix/Makefile.am 
b/src/testsuite/regression/posix/Makefile.am
index 26bc8f2..ad59bac 100644
--- a/src/testsuite/regression/posix/Makefile.am
+++ b/src/testsuite/regression/posix/Makefile.am
@@ -4,7 +4,7 @@ noinst_HEADERS = check.h
 
 CCLD = $(top_srcdir)/scripts/wrap-link.sh $(CC)
 
-tst_PROGRAMS = leaks shm
+tst_PROGRAMS = leaks shm mprotect
 
 CPPFLAGS = $(XENO_USER_CFLAGS) \
-I$(top_srcdir)/include/posix \
diff --git a/src/testsuite/regression/posix/Makefile.in 
b/src/testsuite/regression/posix/Makefile.in
index ff424e2..8ee1992 100644
--- a/src/testsuite/regression/posix/Makefile.in
+++ b/src/testsuite/regression/posix/Makefile.in
@@ -36,7 +36,7 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
-tst_PROGRAMS = leaks$(EXEEXT) shm$(EXEEXT)
+tst_PROGRAMS = leaks$(EXEEXT) shm$(EXEEXT) mprotect$(EXEEXT)
 subdir = src/testsuite/regression/posix
 DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in
@@ -62,6 +62,11 @@ leaks_OBJECTS = leaks.$(OBJEXT)
 leaks_LDADD = $(LDADD)
 leaks_DEPENDENCIES = ../../../skins/posix/libpthread_rt.la \
../../../skins/common/libxenomai.la
+mprotect_SOURCES = mprotect.c
+mprotect_OBJECTS = mprotect.$(OBJEXT)
+mprotect_LDADD = $(LDADD)
+mprotect_DEPENDENCIES = ../../../skins/posix/libpthread_rt.la \
+   ../../../skins/common/libxenomai.la
 shm_SOURCES = shm.c
 shm_OBJECTS = shm.$(OBJEXT)
 shm_LDADD = $(LDADD)
@@ -79,8 +84,8 @@ LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) 
$(LIBTOOLFLAGS) \
 LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
-SOURCES = leaks.c shm.c
-DIST_SOURCES = leaks.c shm.c
+SOURCES = leaks.c mprotect.c shm.c
+DIST_SOURCES = leaks.c mprotect.c shm.c
 HEADERS = $(noinst_HEADERS)
 ETAGS = etags
 CTAGS = ctags
@@ -330,6 +335,9 @@ clean-tstPROGRAMS:
 leaks$(EXEEXT): $(leaks_OBJECTS) $(leaks_DEPENDENCIES) 
@rm -f leaks$(EXEEXT)
$(LINK) $(leaks_OBJECTS) $(leaks_LDADD) $(LIBS)
+mprotect$(EXEEXT): $(mprotect_OBJECTS) $(mprotect_DEPENDENCIES) 
+   @rm -f mprotect$(EXEEXT)
+   $(LINK) $(mprotect_OBJECTS) $(mprotect_LDADD) $(LIBS)
 shm$(EXEEXT): $(shm_OBJECTS) $(shm_DEPENDENCIES) 
@rm -f shm$(EXEEXT)
$(LINK) $(shm_OBJECTS) $(shm_LDADD) $(LIBS)
@@ -341,6 +349,7 @@ distclean-compile:
-rm -f *.tab.c
 
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/leaks.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mprotect.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shm.Po@am__quote@
 
 .c.o:
diff --git a/src/testsuite/regression/posix/check.h 
b/src/testsuite/regression/posix/check.h
index 52f6ada..3d532cf 100644
--- a/src/testsuite/regression/posix/check.h
+++ b/src/testsuite/regression/posix/check.h
@@ -25,4 +25,14 @@
rc; \
})
 
+#define check_mmap(expr)   \
+   ({  \
+   void *rc = (expr);  \
+   if (rc == MAP_FAILED) { \
+   fprintf(stderr, %s:%d: #expr : %s\n, __FILE__, 
__LINE__, strerror(errno)); \
+   exit(EXIT_FAILURE); \
+   }   \
+   rc; \
+   })
+
 #endif /* POSIX_CHECK_H */
diff --git a/src/testsuite/regression/posix/mprotect.c 
b/src/testsuite/regression/posix/mprotect.c
new file mode 100644
index 000..99b619e
--- /dev/null
+++ b/src/testsuite/regression/posix/mprotect.c
@@ -0,0 +1,97 @@
+/*
+ * Test if implicit pinning of memory via mprotect works.
+ *
+ * Copyright (C) Jan Kiszka  jan.kis...@siemens.com
+ *
+ * Released under the terms of GPLv2.
+ */
+
+#include stdlib.h
+#include stdio.h
+#include signal.h
+#include sys/mman.h
+#include pthread.h
+
+#include 

[Xenomai-git] Jan Kiszka : testsuite: Only use rt_print services in leak test

2012-04-04 Thread GIT version control
Module: xenomai-jki
Branch: for-upstream
Commit: 15083551e6cdf05413ce8dbb6e3bfaa1ab483c84
URL:
http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=15083551e6cdf05413ce8dbb6e3bfaa1ab483c84

Author: Jan Kiszka jan.kis...@siemens.com
Date:   Tue Apr  3 20:54:47 2012 +0200

testsuite: Only use rt_print services in leak test

Avoids reordering of the output.

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

---

 src/testsuite/regression/native/leaks.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/testsuite/regression/native/leaks.c 
b/src/testsuite/regression/native/leaks.c
index a78acf5..e164267 100644
--- a/src/testsuite/regression/native/leaks.c
+++ b/src/testsuite/regression/native/leaks.c
@@ -40,7 +40,7 @@ unsigned long long get_used(void)
used += hd.used;
 
if (used == 0) {
-   fprintf(stderr, Error: could not get size of used memory\n);
+   rt_fprintf(stderr, Error: could not get size of used 
memory\n);
exit(EXIT_FAILURE);
}
 


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


[Xenomai-git] Jan Kiszka : testsuite: Add rt-print buffer flushes to native error paths

2012-04-03 Thread GIT version control
Module: xenomai-jki
Branch: for-upstream
Commit: 072b11fc9d6aa50312c5ffc2d86b08e2f07b407b
URL:
http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=072b11fc9d6aa50312c5ffc2d86b08e2f07b407b

Author: Jan Kiszka jan.kis...@siemens.com
Date:   Tue Apr  3 20:54:47 2012 +0200

testsuite: Add rt-print buffer flushes to native error paths

Avoids reordering of the output.

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

---

 src/testsuite/regression/native/check.h |2 ++
 src/testsuite/regression/native/leaks.c |1 +
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/testsuite/regression/native/check.h 
b/src/testsuite/regression/native/check.h
index 6add7cb..f014b1a 100644
--- a/src/testsuite/regression/native/check.h
+++ b/src/testsuite/regression/native/check.h
@@ -4,11 +4,13 @@
 #include stdio.h
 #include stdlib.h
 #include string.h
+#include rtdk.h
 
 #define check_native(expr) \
({  \
int rc = (expr);\
if (rc  0) {   \
+   rt_print_flush_buffers();   \
fprintf(stderr, %s:%d: #expr : %s\n, __FILE__, 
__LINE__, strerror(-rc)); \
exit(EXIT_FAILURE); \
}   \
diff --git a/src/testsuite/regression/native/leaks.c 
b/src/testsuite/regression/native/leaks.c
index a78acf5..67b0968 100644
--- a/src/testsuite/regression/native/leaks.c
+++ b/src/testsuite/regression/native/leaks.c
@@ -40,6 +40,7 @@ unsigned long long get_used(void)
used += hd.used;
 
if (used == 0) {
+   rt_print_flush_buffers();
fprintf(stderr, Error: could not get size of used memory\n);
exit(EXIT_FAILURE);
}


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


[Xenomai-git] Jan Kiszka : Append missing newline to rt_[f]puts output

2012-04-03 Thread GIT version control
Module: xenomai-jki
Branch: for-upstream
Commit: 8dd3192b6633845b6b913064918556d684149e44
URL:
http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=8dd3192b6633845b6b913064918556d684149e44

Author: Jan Kiszka jan.kis...@siemens.com
Date:   Tue Apr  3 20:55:42 2012 +0200

Append missing newline to rt_[f]puts output

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

---

 src/skins/common/rt_print.c |7 ++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/src/skins/common/rt_print.c b/src/skins/common/rt_print.c
index 272a4ba..8d0b9cd 100644
--- a/src/skins/common/rt_print.c
+++ b/src/skins/common/rt_print.c
@@ -274,7 +274,12 @@ int rt_printf(const char *format, ...)
 
 int rt_fputs(const char *s, FILE *stream)
 {
-   return print_to_buffer(stream, 0, RT_PRINT_MODE_FWRITE, strlen(s), s);
+   int res;
+
+   res = print_to_buffer(stream, 0, RT_PRINT_MODE_FWRITE, strlen(s), s);
+   if (res  0)
+   return res;
+   return print_to_buffer(stream, 0, RT_PRINT_MODE_FWRITE, 1, \n);
 }
 
 int rt_puts(const char *s)


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


[Xenomai-git] Jan Kiszka : Append missing newline to rt_[f]puts output

2012-04-03 Thread GIT version control
Module: xenomai-jki
Branch: for-upstream
Commit: 7e12401113a4f77b137f0861a2072233aea2ea76
URL:
http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=7e12401113a4f77b137f0861a2072233aea2ea76

Author: Jan Kiszka jan.kis...@siemens.com
Date:   Tue Apr  3 20:55:42 2012 +0200

Append missing newline to rt_[f]puts output

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

---

 src/skins/common/rt_print.c |7 ++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/src/skins/common/rt_print.c b/src/skins/common/rt_print.c
index 272a4ba..8d0b9cd 100644
--- a/src/skins/common/rt_print.c
+++ b/src/skins/common/rt_print.c
@@ -274,7 +274,12 @@ int rt_printf(const char *format, ...)
 
 int rt_fputs(const char *s, FILE *stream)
 {
-   return print_to_buffer(stream, 0, RT_PRINT_MODE_FWRITE, strlen(s), s);
+   int res;
+
+   res = print_to_buffer(stream, 0, RT_PRINT_MODE_FWRITE, strlen(s), s);
+   if (res  0)
+   return res;
+   return print_to_buffer(stream, 0, RT_PRINT_MODE_FWRITE, 1, \n);
 }
 
 int rt_puts(const char *s)


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


[Xenomai-git] Jan Kiszka : testsuite: Add rt-print buffer flushes to native error paths

2012-04-03 Thread GIT version control
Module: xenomai-jki
Branch: for-upstream
Commit: 99e9bcd8aba7f228ce2c56f9ea3628ddc164a17e
URL:
http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=99e9bcd8aba7f228ce2c56f9ea3628ddc164a17e

Author: Jan Kiszka jan.kis...@siemens.com
Date:   Tue Apr  3 20:54:47 2012 +0200

testsuite: Add rt-print buffer flushes to native error paths

Avoids reordering of the output.

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

---

 src/testsuite/regression/native/check.h |2 ++
 src/testsuite/regression/native/leaks.c |1 +
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/testsuite/regression/native/check.h 
b/src/testsuite/regression/native/check.h
index 6add7cb..f014b1a 100644
--- a/src/testsuite/regression/native/check.h
+++ b/src/testsuite/regression/native/check.h
@@ -4,11 +4,13 @@
 #include stdio.h
 #include stdlib.h
 #include string.h
+#include rtdk.h
 
 #define check_native(expr) \
({  \
int rc = (expr);\
if (rc  0) {   \
+   rt_print_flush_buffers();   \
fprintf(stderr, %s:%d: #expr : %s\n, __FILE__, 
__LINE__, strerror(-rc)); \
exit(EXIT_FAILURE); \
}   \
diff --git a/src/testsuite/regression/native/leaks.c 
b/src/testsuite/regression/native/leaks.c
index a78acf5..67b0968 100644
--- a/src/testsuite/regression/native/leaks.c
+++ b/src/testsuite/regression/native/leaks.c
@@ -40,6 +40,7 @@ unsigned long long get_used(void)
used += hd.used;
 
if (used == 0) {
+   rt_print_flush_buffers();
fprintf(stderr, Error: could not get size of used memory\n);
exit(EXIT_FAILURE);
}


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


[Xenomai-git] Jan Kiszka : Add regression test for mprotect on pinned memory

2012-04-03 Thread GIT version control
Module: xenomai-jki
Branch: for-upstream
Commit: 3174cf47a8b753996e23abfd2d85041e83666d9b
URL:
http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=3174cf47a8b753996e23abfd2d85041e83666d9b

Author: Jan Kiszka jan.kis...@siemens.com
Date:   Fri Mar 30 18:06:27 2012 +0200

Add regression test for mprotect on pinned memory

This tests both the original issue of mprotect reintroducing COW pages
to Xenomai processes as well as the recently fixed zero page corruption.

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

---

 src/testsuite/regression/posix/Makefile.am |2 +-
 src/testsuite/regression/posix/Makefile.in |   15 -
 src/testsuite/regression/posix/check.h |   10 +++
 src/testsuite/regression/posix/mprotect.c  |   97 
 4 files changed, 120 insertions(+), 4 deletions(-)

diff --git a/src/testsuite/regression/posix/Makefile.am 
b/src/testsuite/regression/posix/Makefile.am
index 26bc8f2..ad59bac 100644
--- a/src/testsuite/regression/posix/Makefile.am
+++ b/src/testsuite/regression/posix/Makefile.am
@@ -4,7 +4,7 @@ noinst_HEADERS = check.h
 
 CCLD = $(top_srcdir)/scripts/wrap-link.sh $(CC)
 
-tst_PROGRAMS = leaks shm
+tst_PROGRAMS = leaks shm mprotect
 
 CPPFLAGS = $(XENO_USER_CFLAGS) \
-I$(top_srcdir)/include/posix \
diff --git a/src/testsuite/regression/posix/Makefile.in 
b/src/testsuite/regression/posix/Makefile.in
index ff424e2..8ee1992 100644
--- a/src/testsuite/regression/posix/Makefile.in
+++ b/src/testsuite/regression/posix/Makefile.in
@@ -36,7 +36,7 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
-tst_PROGRAMS = leaks$(EXEEXT) shm$(EXEEXT)
+tst_PROGRAMS = leaks$(EXEEXT) shm$(EXEEXT) mprotect$(EXEEXT)
 subdir = src/testsuite/regression/posix
 DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in
@@ -62,6 +62,11 @@ leaks_OBJECTS = leaks.$(OBJEXT)
 leaks_LDADD = $(LDADD)
 leaks_DEPENDENCIES = ../../../skins/posix/libpthread_rt.la \
../../../skins/common/libxenomai.la
+mprotect_SOURCES = mprotect.c
+mprotect_OBJECTS = mprotect.$(OBJEXT)
+mprotect_LDADD = $(LDADD)
+mprotect_DEPENDENCIES = ../../../skins/posix/libpthread_rt.la \
+   ../../../skins/common/libxenomai.la
 shm_SOURCES = shm.c
 shm_OBJECTS = shm.$(OBJEXT)
 shm_LDADD = $(LDADD)
@@ -79,8 +84,8 @@ LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) 
$(LIBTOOLFLAGS) \
 LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
-SOURCES = leaks.c shm.c
-DIST_SOURCES = leaks.c shm.c
+SOURCES = leaks.c mprotect.c shm.c
+DIST_SOURCES = leaks.c mprotect.c shm.c
 HEADERS = $(noinst_HEADERS)
 ETAGS = etags
 CTAGS = ctags
@@ -330,6 +335,9 @@ clean-tstPROGRAMS:
 leaks$(EXEEXT): $(leaks_OBJECTS) $(leaks_DEPENDENCIES) 
@rm -f leaks$(EXEEXT)
$(LINK) $(leaks_OBJECTS) $(leaks_LDADD) $(LIBS)
+mprotect$(EXEEXT): $(mprotect_OBJECTS) $(mprotect_DEPENDENCIES) 
+   @rm -f mprotect$(EXEEXT)
+   $(LINK) $(mprotect_OBJECTS) $(mprotect_LDADD) $(LIBS)
 shm$(EXEEXT): $(shm_OBJECTS) $(shm_DEPENDENCIES) 
@rm -f shm$(EXEEXT)
$(LINK) $(shm_OBJECTS) $(shm_LDADD) $(LIBS)
@@ -341,6 +349,7 @@ distclean-compile:
-rm -f *.tab.c
 
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/leaks.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mprotect.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shm.Po@am__quote@
 
 .c.o:
diff --git a/src/testsuite/regression/posix/check.h 
b/src/testsuite/regression/posix/check.h
index 52f6ada..3d532cf 100644
--- a/src/testsuite/regression/posix/check.h
+++ b/src/testsuite/regression/posix/check.h
@@ -25,4 +25,14 @@
rc; \
})
 
+#define check_mmap(expr)   \
+   ({  \
+   void *rc = (expr);  \
+   if (rc == MAP_FAILED) { \
+   fprintf(stderr, %s:%d: #expr : %s\n, __FILE__, 
__LINE__, strerror(errno)); \
+   exit(EXIT_FAILURE); \
+   }   \
+   rc; \
+   })
+
 #endif /* POSIX_CHECK_H */
diff --git a/src/testsuite/regression/posix/mprotect.c 
b/src/testsuite/regression/posix/mprotect.c
new file mode 100644
index 000..99b619e
--- /dev/null
+++ b/src/testsuite/regression/posix/mprotect.c
@@ -0,0 +1,97 @@
+/*
+ * Test if implicit pinning of memory via mprotect works.
+ *
+ * Copyright (C) Jan Kiszka  jan.kis...@siemens.com
+ *
+ * Released under the terms of GPLv2.
+ */
+
+#include stdlib.h
+#include stdio.h
+#include signal.h
+#include sys/mman.h
+#include pthread.h
+
+#include 

[Xenomai-git] Jan Kiszka : Add regression test for mprotect on pinned memory

2012-04-02 Thread GIT version control
Module: xenomai-jki
Branch: for-upstream
Commit: 410e90d085d21dc913f8724efafe6ae75bd3c952
URL:
http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=410e90d085d21dc913f8724efafe6ae75bd3c952

Author: Jan Kiszka jan.kis...@siemens.com
Date:   Fri Mar 30 18:06:27 2012 +0200

Add regression test for mprotect on pinned memory

This tests both the original issue of mprotect reintroducing COW pages
to Xenomai processes as well as the recently fixed zero page corruption.

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

---

 src/testsuite/regression/native/Makefile.am |2 +-
 src/testsuite/regression/native/Makefile.in |   16 +++-
 src/testsuite/regression/native/mprotect.c  |  128 +++
 3 files changed, 142 insertions(+), 4 deletions(-)

diff --git a/src/testsuite/regression/native/Makefile.am 
b/src/testsuite/regression/native/Makefile.am
index ce53834..afd2f43 100644
--- a/src/testsuite/regression/native/Makefile.am
+++ b/src/testsuite/regression/native/Makefile.am
@@ -2,7 +2,7 @@ tstdir = @XENO_TEST_DIR@/regression/native
 
 noinst_HEADERS = check.h
 
-tst_PROGRAMS = leaks tsc heap sigdebug
+tst_PROGRAMS = leaks tsc heap sigdebug mprotect
 
 CPPFLAGS = $(XENO_USER_CFLAGS) \
-I$(top_srcdir)/include
diff --git a/src/testsuite/regression/native/Makefile.in 
b/src/testsuite/regression/native/Makefile.in
index 3d5a0ce..b2ae93a 100644
--- a/src/testsuite/regression/native/Makefile.in
+++ b/src/testsuite/regression/native/Makefile.in
@@ -37,7 +37,7 @@ build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
 tst_PROGRAMS = leaks$(EXEEXT) tsc$(EXEEXT) heap$(EXEEXT) \
-   sigdebug$(EXEEXT)
+   sigdebug$(EXEEXT) mprotect$(EXEEXT)
 subdir = src/testsuite/regression/native
 DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in
@@ -70,6 +70,12 @@ leaks_LDADD = $(LDADD)
 leaks_DEPENDENCIES = ../../../skins/native/libnative.la \
../../../skins/rtdm/librtdm.la \
../../../skins/common/libxenomai.la
+mprotect_SOURCES = mprotect.c
+mprotect_OBJECTS = mprotect.$(OBJEXT)
+mprotect_LDADD = $(LDADD)
+mprotect_DEPENDENCIES = ../../../skins/native/libnative.la \
+   ../../../skins/rtdm/librtdm.la \
+   ../../../skins/common/libxenomai.la
 sigdebug_SOURCES = sigdebug.c
 sigdebug_OBJECTS = sigdebug.$(OBJEXT)
 sigdebug_LDADD = $(LDADD)
@@ -95,8 +101,8 @@ CCLD = $(CC)
 LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
-SOURCES = heap.c leaks.c sigdebug.c tsc.c
-DIST_SOURCES = heap.c leaks.c sigdebug.c tsc.c
+SOURCES = heap.c leaks.c mprotect.c sigdebug.c tsc.c
+DIST_SOURCES = heap.c leaks.c mprotect.c sigdebug.c tsc.c
 HEADERS = $(noinst_HEADERS)
 ETAGS = etags
 CTAGS = ctags
@@ -348,6 +354,9 @@ heap$(EXEEXT): $(heap_OBJECTS) $(heap_DEPENDENCIES)
 leaks$(EXEEXT): $(leaks_OBJECTS) $(leaks_DEPENDENCIES) 
@rm -f leaks$(EXEEXT)
$(LINK) $(leaks_OBJECTS) $(leaks_LDADD) $(LIBS)
+mprotect$(EXEEXT): $(mprotect_OBJECTS) $(mprotect_DEPENDENCIES) 
+   @rm -f mprotect$(EXEEXT)
+   $(LINK) $(mprotect_OBJECTS) $(mprotect_LDADD) $(LIBS)
 sigdebug$(EXEEXT): $(sigdebug_OBJECTS) $(sigdebug_DEPENDENCIES) 
@rm -f sigdebug$(EXEEXT)
$(LINK) $(sigdebug_OBJECTS) $(sigdebug_LDADD) $(LIBS)
@@ -363,6 +372,7 @@ distclean-compile:
 
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/heap.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/leaks.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mprotect.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigdebug.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tsc.Po@am__quote@
 
diff --git a/src/testsuite/regression/native/mprotect.c 
b/src/testsuite/regression/native/mprotect.c
new file mode 100644
index 000..7d66e34
--- /dev/null
+++ b/src/testsuite/regression/native/mprotect.c
@@ -0,0 +1,128 @@
+/*
+ * Test if implicit pinning of memory via mprotect works.
+ *
+ * Copyright (C) Jan Kiszka  jan.kis...@siemens.com
+ *
+ * Released under the terms of GPLv2.
+ */
+
+#include stdlib.h
+#include stdio.h
+#include signal.h
+#include sys/mman.h
+#include rtdk.h
+#include native/task.h
+
+#define MEMSIZE 0x1
+
+static void check_inner(const char *fn, int line, const char *msg,
+   int status, int expected)
+{
+   if (status == expected)
+   return;
+
+   rt_task_set_mode(T_WARNSW, 0, NULL);
+   rt_print_flush_buffers();
+   fprintf(stderr, FAILURE %s:%d: %s returned %d instead of %d - %s\n,
+   fn, line, msg, status, expected, strerror(-status));
+   exit(EXIT_FAILURE);
+}
+
+#define check_no_error(msg, status) ({ \
+   int __status = status;  \
+   check_inner(__FUNCTION__, __LINE__, msg,\
+   __status  0 ? __status : 0, 

[Xenomai-git] Gilles Chanteperdrix : Kconfig: make dependency upon GENERIC_CLOCKEVENTS explicit

2012-04-02 Thread GIT version control
Module: xenomai-forge
Branch: master
Commit: 08bcf8e92dd329ce478cc77ec9e5a4ffd5ce09cb
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=08bcf8e92dd329ce478cc77ec9e5a4ffd5ce09cb

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Tue Mar 27 03:09:33 2012 +0200

Kconfig: make dependency upon GENERIC_CLOCKEVENTS explicit

---

 scripts/Kconfig.frag |   18 +++---
 1 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/scripts/Kconfig.frag b/scripts/Kconfig.frag
index bbc9cbe..0841598 100644
--- a/scripts/Kconfig.frag
+++ b/scripts/Kconfig.frag
@@ -1,14 +1,14 @@
-
 config XENOMAI
+   depends on GENERIC_CLOCKEVENTS
depends on (X86_TSC || !X86)  (!HPET_TIMER || !X86 || X86_LOCAL_APIC)
bool Xenomai
-select IPIPE
+   select IPIPE
default y
-help
-  Xenomai is a real-time extension to the Linux kernel. Note
-  that Xenomai relies on Adeos interrupt pipeline (CONFIG_IPIPE
-  option) to be enabled, so enabling this option selects the
-  CONFIG_IPIPE option.
+   help
+ Xenomai is a real-time extension to the Linux kernel. Note
+ that Xenomai relies on Adeos interrupt pipeline (CONFIG_IPIPE
+ option) to be enabled, so enabling this option selects the
+ CONFIG_IPIPE option.
 
 if XENOMAI
 source arch/@LINUX_ARCH@/xenomai/Kconfig
@@ -20,6 +20,10 @@ comment or Intel cpuidle option. These options are known to 
cause troubles
 comment with Xenomai, disable them.
 endif
 
+if !GENERIC_CLOCKEVENTS
+comment NOTE: Xenomai needs CONFIG_GENERIC_CLOCKEVENTS
+endif
+
 comment NOTE: Xenomai needs either X86_LOCAL_APIC enabled or HPET_TIMER 
disabled.
depends on !X86_LOCAL_APIC  X86  HPET_TIMER
 comment (menu Processor type and features)


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


[Xenomai-git] Wolfgang Grandegger : nucleus: fix poll EOF issue with xnpipe/rt_pipe

2012-04-02 Thread GIT version control
Module: xenomai-forge
Branch: master
Commit: d51cffac7318cdc5a05177e8477de39ae4b9f748
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=d51cffac7318cdc5a05177e8477de39ae4b9f748

Author: Wolfgang Grandegger w...@denx.de
Date:   Mon Mar 26 09:21:51 2012 +0200

nucleus: fix poll EOF issue with xnpipe/rt_pipe

So far, the EOF event is not handled in the Linux poll function of the
xnpipe/rt_pipe service when the pipe is closed (via rt_pipde_delete).
This patch fixes the issue by setting POLLUP in the Linux poll function
when the pipe is broken. The subsequent reads will then fail with errno
EPIPE.

Signed-off-by: Wolfgang Grandegger w...@denx.de

---

 kernel/cobalt/nucleus/pipe.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/kernel/cobalt/nucleus/pipe.c b/kernel/cobalt/nucleus/pipe.c
index 2252b55..8581cbf 100644
--- a/kernel/cobalt/nucleus/pipe.c
+++ b/kernel/cobalt/nucleus/pipe.c
@@ -1033,6 +1033,8 @@ static unsigned xnpipe_poll(struct file *file, poll_table 
*pt)
 
if (testbits(state-status, XNPIPE_KERN_CONN))
w_mask |= (POLLOUT | POLLWRNORM);
+   else
+   r_mask |= POLLHUP;
 
if (!emptyq_p(state-outq))
r_mask |= (POLLIN | POLLRDNORM);


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


[Xenomai-git] Gilles Chanteperdrix : x86: compile user-space with frame pointers

2012-04-02 Thread GIT version control
Module: xenomai-forge
Branch: master
Commit: 11f4e11d4fc24d9fac0f8b9ab504304201accc24
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=11f4e11d4fc24d9fac0f8b9ab504304201accc24

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Sun Apr  1 20:16:42 2012 +0200

x86: compile user-space with frame pointers

---

 configure.in |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/configure.in b/configure.in
index 0bdced8..f3126e9 100644
--- a/configure.in
+++ b/configure.in
@@ -529,6 +529,10 @@ if test x$use_assert = x; then
XENO_USER_CFLAGS=-DNDEBUG $XENO_USER_CFLAGS
 fi
 
+case $XENO_TARGET_ARCH in
+x86) XENO_USER_CFLAGS=$XENO_USER_CFLAGS -fno-omit-frame-pointer;;
+esac
+
 XENO_USER_CFLAGS=$XENO_USER_CFLAGS -D__XENO__ -D__IN_XENO__ 
-Wstrict-prototypes
 
 AC_MSG_CHECKING([whether ld supports @file])


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


[Xenomai-git] Gilles Chanteperdrix : arm: rename __ipipe_mach_hrtimer_irq - __ipipe_hrtimer_irq

2012-04-02 Thread GIT version control
Module: xenomai-forge
Branch: master
Commit: 6c47b3f81ead9a3d779799663e4bacdb438cbfb2
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=6c47b3f81ead9a3d779799663e4bacdb438cbfb2

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Tue Mar 27 23:58:42 2012 +0200

arm: rename __ipipe_mach_hrtimer_irq - __ipipe_hrtimer_irq

---

 include/asm-arm/hal.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/asm-arm/hal.h b/include/asm-arm/hal.h
index f053cf2..1553435 100644
--- a/include/asm-arm/hal.h
+++ b/include/asm-arm/hal.h
@@ -154,7 +154,7 @@ static inline __attribute_const__ unsigned long 
ffnz(unsigned long ul)
 /*
  * Default setting, unless pre-set in the machine-dependent section.
  */
-#define RTHAL_TIMER_IRQ__ipipe_mach_hrtimer_irq
+#define RTHAL_TIMER_IRQ__ipipe_hrtimer_irq
 #endif /* RTHAL_TIMER_IRQ */
 
 #ifndef RTHAL_TIMER_IPI


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


[Xenomai-git] Gilles Chanteperdrix : x86: adapt to refactored timers

2012-04-02 Thread GIT version control
Module: xenomai-forge
Branch: master
Commit: f4734a9238123f8ce4a017d96b0fc4a029b485b2
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=f4734a9238123f8ce4a017d96b0fc4a029b485b2

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Sun Apr  1 20:20:11 2012 +0200

x86: adapt to refactored timers

---

 include/asm-x86/bits/timer.h |5 ++
 include/asm-x86/hal_32.h |   14 
 include/asm-x86/hal_64.h |   14 
 kernel/cobalt/arch/x86/hal.c |  135 ++
 scripts/Kconfig.frag |7 +--
 5 files changed, 169 insertions(+), 6 deletions(-)

diff --git a/include/asm-x86/bits/timer.h b/include/asm-x86/bits/timer.h
index 428c069..ec32d65 100644
--- a/include/asm-x86/bits/timer.h
+++ b/include/asm-x86/bits/timer.h
@@ -39,8 +39,13 @@ static inline void xnarch_program_timer_shot(unsigned long 
delay)
 static inline void xnarch_send_timer_ipi(xnarch_cpumask_t mask)
 {
 #ifdef CONFIG_SMP
+#ifndef CONFIG_IPIPE_CORE
ipipe_send_ipi(RTHAL_APIC_TIMER_IPI, mask);
+#else /* CONFIG_IPIPE_CORE */
+   ipipe_send_ipi(RTHAL_TIMER_IPI, mask);
+#endif /* CONFIG_IPIPE_CORE */
 #endif /* CONFIG_SMP */
+
 }
 
 #endif /* !_XENO_ASM_X86_BITS_TIMER_H */
diff --git a/include/asm-x86/hal_32.h b/include/asm-x86/hal_32.h
index ee9a31d..1b00fcd 100644
--- a/include/asm-x86/hal_32.h
+++ b/include/asm-x86/hal_32.h
@@ -38,11 +38,15 @@
 #define _XENO_ASM_X86_HAL_32_H
 
 #define RTHAL_ARCH_NAMEi386
+#ifndef CONFIG_IPIPE_CORE
 #ifdef CONFIG_X86_LOCAL_APIC
 # define RTHAL_TIMER_DEVICElapic
 #else
 # define RTHAL_TIMER_DEVICEpit
 #endif
+#else
+# define RTHAL_TIMER_DEVICE(ipipe_timer_name())
+#endif
 # define RTHAL_CLOCK_DEVICEtsc
 
 #include asm/xenomai/wrappers.h
@@ -88,6 +92,7 @@ static inline __attribute_const__ unsigned long ffnz(unsigned 
long ul)
 #include asm/xenomai/atomic.h
 #include asm/xenomai/smi.h
 
+#ifndef CONFIG_IPIPE_CORE
 #ifdef CONFIG_X86_LOCAL_APIC
 #define RTHAL_APIC_TIMER_VECTORIPIPE_HRTIMER_VECTOR
 #define RTHAL_APIC_TIMER_IPI   IPIPE_HRTIMER_IPI
@@ -99,6 +104,11 @@ static inline __attribute_const__ unsigned long 
ffnz(unsigned long ul)
 #define RTHAL_TIMER_IRQ0   /* i8253 PIT interrupt. */
 #define RTHAL_HOST_TICK_IRQ0   /* Host tick is emulated by Xenomai. */
 #endif /* CONFIG_X86_LOCAL_APIC */
+#else /* CONFIG_IPIPE_CORE */
+#define RTHAL_TIMER_IRQ__ipipe_hrtimer_irq
+#define RTHAL_TIMER_IPIIPIPE_HRTIMER_IPI
+#define RTHAL_HOST_TICK_IRQRTHAL_TIMER_IRQ
+#endif /* CONFIG_IPIPE_CORE */
 
 static inline void rthal_grab_control(void)
 {
@@ -120,6 +130,7 @@ static inline unsigned long long rthal_rdtsc(void)
 
 static inline void rthal_timer_program_shot(unsigned long delay)
 {
+#ifndef CONFIG_IPIPE_CORE
 #ifdef CONFIG_X86_LOCAL_APIC
if (likely(delay))
apic_write(APIC_TMICT, delay);
@@ -132,6 +143,9 @@ static inline void rthal_timer_program_shot(unsigned long 
delay)
} else
ipipe_post_irq_head(RTHAL_TIMER_IRQ);
 #endif /* CONFIG_X86_LOCAL_APIC */
+#else /* I-pipe core */
+   ipipe_timer_set(delay);
+#endif /* I-pipe core */
 }
 
 static const char *const rthal_fault_labels[] = {
diff --git a/include/asm-x86/hal_64.h b/include/asm-x86/hal_64.h
index 1d19840..ad42c12 100644
--- a/include/asm-x86/hal_64.h
+++ b/include/asm-x86/hal_64.h
@@ -24,7 +24,11 @@
 #define _XENO_ASM_X86_HAL_64_H
 
 #define RTHAL_ARCH_NAMEx86_64
+#ifndef CONFIG_IPIPE_CORE
 #define RTHAL_TIMER_DEVICE lapic
+#else /* I-pipe core */
+#define RTHAL_TIMER_DEVICE (ipipe_timer_name())
+#endif /* I-pipe core */
 #define RTHAL_CLOCK_DEVICE tsc
 
 #include asm/xenomai/wrappers.h
@@ -49,12 +53,18 @@ static inline __attribute_const__ unsigned long 
ffnz(unsigned long ul)
 #include asm/xenomai/atomic.h
 #include asm/xenomai/smi.h
 
+#ifndef CONFIG_IPIPE_CORE
 #define RTHAL_APIC_TIMER_VECTORIPIPE_HRTIMER_VECTOR
 #define RTHAL_APIC_TIMER_IPI   IPIPE_HRTIMER_IPI
 #define RTHAL_APIC_ICOUNT  ((RTHAL_TIMER_FREQ + HZ/2)/HZ)
 #define RTHAL_TIMER_IRQRTHAL_APIC_TIMER_IPI
 #define RTHAL_HOST_TICK_IRQ
ipipe_apic_vector_irq(LOCAL_TIMER_VECTOR)
 #define RTHAL_BCAST_TICK_IRQ   0
+#else /* CONFIG_IPIPE_CORE */
+#define RTHAL_TIMER_IRQ__ipipe_hrtimer_irq
+#define RTHAL_TIMER_IPIIPIPE_HRTIMER_IPI
+#define RTHAL_HOST_TICK_IRQRTHAL_TIMER_IRQ
+#endif /* CONFIG_IPIPE_CORE */
 
 static inline void rthal_grab_control(void)
 {
@@ -76,11 +86,15 @@ static inline unsigned long long rthal_rdtsc(void)
 
 static inline void rthal_timer_program_shot(unsigned long delay)
 {
+#ifndef CONFIG_IPIPE_CORE
if (likely(delay))
apic_write(APIC_TMICT, delay);
else
/* Pend the timer 

[Xenomai-git] Gilles Chanteperdrix : arm: fix hal after ipipe_timer_start signature change

2012-04-02 Thread GIT version control
Module: xenomai-forge
Branch: master
Commit: ba440f89ab689e5d0cf9da4c34fc1b5911313a56
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=ba440f89ab689e5d0cf9da4c34fc1b5911313a56

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Sun Apr  1 20:19:51 2012 +0200

arm: fix hal after ipipe_timer_start signature change

---

 kernel/cobalt/arch/arm/hal.c |6 +-
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/kernel/cobalt/arch/arm/hal.c b/kernel/cobalt/arch/arm/hal.c
index 1609957..b0cd49a 100644
--- a/kernel/cobalt/arch/arm/hal.c
+++ b/kernel/cobalt/arch/arm/hal.c
@@ -220,14 +220,11 @@ int rthal_timer_request(
unsigned long dummy, *tmfreq = dummy;
int tickval, ret;
 
-   if (rthal_timerfreq_arg == 0)
-   tmfreq = rthal_archdata.timer_freq;
-
 #ifndef CONFIG_IPIPE_CORE
ret = ipipe_request_tickdev(RTHAL_TIMER_DEVICE, mode_emul, tick_emul, 
cpu,
tmfreq);
 #else /* I-ipipe timers */
-   ret = ipipe_timer_start(tick_handler, mode_emul, tick_emul, cpu, 
tmfreq);
+   ret = ipipe_timer_start(tick_handler, mode_emul, tick_emul, cpu);
 #endif /* I-ipipe timers */
switch (ret) {
case CLOCK_EVT_MODE_PERIODIC:
@@ -361,6 +358,5 @@ void rthal_arch_cleanup(void)
 #ifdef CONFIG_IPIPE_CORE
ipipe_timers_release();
 #endif /* CONFIG_IPIPE_CORE */
-   /* Nothing to cleanup so far. */
printk(KERN_INFO Xenomai: hal/arm stopped.\n);
 }


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


[Xenomai-git] Paul Janzen : Mask signals in rt_print:printer_loop()

2012-04-01 Thread GIT version control
Module: xenomai-2.6
Branch: master
Commit: 0ef2410a2c9cf7102dead861241bd2d9957e4433
URL:
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=0ef2410a2c9cf7102dead861241bd2d9957e4433

Author: Paul Janzen p...@xenomai.sez.to
Date:   Wed Mar 28 10:34:35 2012 -0700

Mask signals in rt_print:printer_loop()

common/rt_print: Use sigfillset to actually mask all signals for
logging thread.  Fixes commit a6dceeb9.

Signed-off-by: Paul Janzen p...@xenomai.sez.to

---

 src/skins/common/rt_print.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/skins/common/rt_print.c b/src/skins/common/rt_print.c
index e1c828a..272a4ba 100644
--- a/src/skins/common/rt_print.c
+++ b/src/skins/common/rt_print.c
@@ -615,7 +615,7 @@ static void *printer_loop(void *arg)
 {
sigset_t mask;
 
-   sigemptyset(mask);
+   sigfillset(mask);
pthread_sigmask(SIG_BLOCK, mask, NULL);
 
while (1) {


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


[Xenomai-git] Gilles Chanteperdrix : x86: compile user-space with frame pointers

2012-04-01 Thread GIT version control
Module: xenomai-gch
Branch: for-forge
Commit: 11f4e11d4fc24d9fac0f8b9ab504304201accc24
URL:
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=11f4e11d4fc24d9fac0f8b9ab504304201accc24

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Sun Apr  1 20:16:42 2012 +0200

x86: compile user-space with frame pointers

---

 configure.in |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/configure.in b/configure.in
index 0bdced8..f3126e9 100644
--- a/configure.in
+++ b/configure.in
@@ -529,6 +529,10 @@ if test x$use_assert = x; then
XENO_USER_CFLAGS=-DNDEBUG $XENO_USER_CFLAGS
 fi
 
+case $XENO_TARGET_ARCH in
+x86) XENO_USER_CFLAGS=$XENO_USER_CFLAGS -fno-omit-frame-pointer;;
+esac
+
 XENO_USER_CFLAGS=$XENO_USER_CFLAGS -D__XENO__ -D__IN_XENO__ 
-Wstrict-prototypes
 
 AC_MSG_CHECKING([whether ld supports @file])


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


[Xenomai-git] Gilles Chanteperdrix : arm: rename __ipipe_mach_hrtimer_irq - __ipipe_hrtimer_irq

2012-04-01 Thread GIT version control
Module: xenomai-gch
Branch: for-forge
Commit: 6c47b3f81ead9a3d779799663e4bacdb438cbfb2
URL:
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=6c47b3f81ead9a3d779799663e4bacdb438cbfb2

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Tue Mar 27 23:58:42 2012 +0200

arm: rename __ipipe_mach_hrtimer_irq - __ipipe_hrtimer_irq

---

 include/asm-arm/hal.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/asm-arm/hal.h b/include/asm-arm/hal.h
index f053cf2..1553435 100644
--- a/include/asm-arm/hal.h
+++ b/include/asm-arm/hal.h
@@ -154,7 +154,7 @@ static inline __attribute_const__ unsigned long 
ffnz(unsigned long ul)
 /*
  * Default setting, unless pre-set in the machine-dependent section.
  */
-#define RTHAL_TIMER_IRQ__ipipe_mach_hrtimer_irq
+#define RTHAL_TIMER_IRQ__ipipe_hrtimer_irq
 #endif /* RTHAL_TIMER_IRQ */
 
 #ifndef RTHAL_TIMER_IPI


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


[Xenomai-git] Gilles Chanteperdrix : nucleus: allow timer to use different irqs on different cpus

2012-04-01 Thread GIT version control
Module: xenomai-gch
Branch: for-forge
Commit: f1ec23ceefc9f92c262e0360c5aa162ed959fc0a
URL:
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=f1ec23ceefc9f92c262e0360c5aa162ed959fc0a

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Sun Apr  1 20:19:02 2012 +0200

nucleus: allow timer to use different irqs on different cpus

---

 include/asm-generic/hal.h|5 +
 include/asm-generic/system.h |1 +
 kernel/cobalt/nucleus/intr.c |   17 +++--
 3 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/include/asm-generic/hal.h b/include/asm-generic/hal.h
index 5a55444..7662d06 100644
--- a/include/asm-generic/hal.h
+++ b/include/asm-generic/hal.h
@@ -66,6 +66,11 @@ extern struct rthal_archdata rthal_archdata;
 
 #define RTHAL_TIMER_FREQ   (rthal_archdata.timer_freq)
 #define RTHAL_CLOCK_FREQ   (rthal_archdata.clock_freq)
+#ifdef CONFIG_IPIPE_CORE
+#define RTHAL_PERCPU_TIMER_IRQ(cpu) per_cpu(ipipe_percpu.hrtimer_irq, cpu)
+#else /* !CONFIG_IPIPE_CORE */
+#define RTHAL_PERCPU_TIMER_IRQ(cpu) RTHAL_TIMER_IRQ
+#endif /* !CONFIG_IPIPE_CORE */
 
 #include asm-generic/xenomai/ipipe/wrappers.h
 
diff --git a/include/asm-generic/system.h b/include/asm-generic/system.h
index b6ff6ca..4af9f39 100644
--- a/include/asm-generic/system.h
+++ b/include/asm-generic/system.h
@@ -165,6 +165,7 @@ static inline int xnlock_dbg_release(struct xnlock *lock)
 #define XNARCH_TIMER_IRQ   RTHAL_TIMER_IRQ
 #define XNARCH_TIMER_DEVICERTHAL_TIMER_DEVICE
 #define XNARCH_CLOCK_DEVICERTHAL_CLOCK_DEVICE
+#define XNARCH_PERCPU_TIMER_IRQ(cpu)   RTHAL_PERCPU_TIMER_IRQ(cpu)
 
 #define XNARCH_PROMPT Xenomai: 
 #define xnarch_loginfo(fmt, args...)   printk(KERN_INFO XNARCH_PROMPT fmt, 
##args)
diff --git a/kernel/cobalt/nucleus/intr.c b/kernel/cobalt/nucleus/intr.c
index aa02040..ffbd2a5 100644
--- a/kernel/cobalt/nucleus/intr.c
+++ b/kernel/cobalt/nucleus/intr.c
@@ -970,14 +970,19 @@ static inline int format_irq_proc(unsigned int irq,
 {
struct xnintr *intr;
spl_t s;
+   int cpu;
 
-   if (irq == XNARCH_TIMER_IRQ) {
-   xnvfile_puts(it,  [timer]);
-   return 0;
-   }
+   for_each_online_cpu(cpu)
+   if (irq == XNARCH_PERCPU_TIMER_IRQ(cpu)) {
+   xnvfile_printf(it,  [timer%d], cpu);
+   return 0;
+   }
 
switch (irq) {
 #ifdef CONFIG_SMP
+   case IPIPE_HRTIMER_IPI:
+   xnvfile_puts(it,  [timer-ipi]);
+   return 0;
case IPIPE_RESCHEDULE_IPI:
xnvfile_puts(it,  [reschedule]);
return 0;
@@ -1017,7 +1022,7 @@ static int irq_vfile_show(struct xnvfile_regular_iterator 
*it,
 
/* FIXME: We assume the entire output fits in a single page. */
 
-   xnvfile_puts(it, IRQ );
+   xnvfile_puts(it,   IRQ );
 
for_each_online_cpu(cpu)
xnvfile_printf(it, CPU%d, cpu);
@@ -1026,7 +1031,7 @@ static int irq_vfile_show(struct xnvfile_regular_iterator 
*it,
if (__ipipe_irq_handler(rthal_archdata.domain, irq) == NULL)
continue;
 
-   xnvfile_printf(it, \n%3d:, irq);
+   xnvfile_printf(it, \n%5d:, irq);
 
for_each_online_cpu(cpu) {
xnvfile_printf(it, %12lu,


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


[Xenomai-git] Gilles Chanteperdrix : arm: fix hal after ipipe_timer_start signature change

2012-04-01 Thread GIT version control
Module: xenomai-gch
Branch: for-forge
Commit: ba440f89ab689e5d0cf9da4c34fc1b5911313a56
URL:
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=ba440f89ab689e5d0cf9da4c34fc1b5911313a56

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Sun Apr  1 20:19:51 2012 +0200

arm: fix hal after ipipe_timer_start signature change

---

 kernel/cobalt/arch/arm/hal.c |6 +-
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/kernel/cobalt/arch/arm/hal.c b/kernel/cobalt/arch/arm/hal.c
index 1609957..b0cd49a 100644
--- a/kernel/cobalt/arch/arm/hal.c
+++ b/kernel/cobalt/arch/arm/hal.c
@@ -220,14 +220,11 @@ int rthal_timer_request(
unsigned long dummy, *tmfreq = dummy;
int tickval, ret;
 
-   if (rthal_timerfreq_arg == 0)
-   tmfreq = rthal_archdata.timer_freq;
-
 #ifndef CONFIG_IPIPE_CORE
ret = ipipe_request_tickdev(RTHAL_TIMER_DEVICE, mode_emul, tick_emul, 
cpu,
tmfreq);
 #else /* I-ipipe timers */
-   ret = ipipe_timer_start(tick_handler, mode_emul, tick_emul, cpu, 
tmfreq);
+   ret = ipipe_timer_start(tick_handler, mode_emul, tick_emul, cpu);
 #endif /* I-ipipe timers */
switch (ret) {
case CLOCK_EVT_MODE_PERIODIC:
@@ -361,6 +358,5 @@ void rthal_arch_cleanup(void)
 #ifdef CONFIG_IPIPE_CORE
ipipe_timers_release();
 #endif /* CONFIG_IPIPE_CORE */
-   /* Nothing to cleanup so far. */
printk(KERN_INFO Xenomai: hal/arm stopped.\n);
 }


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


[Xenomai-git] Gilles Chanteperdrix : x86: adapt to refactored timers

2012-04-01 Thread GIT version control
Module: xenomai-gch
Branch: for-forge
Commit: f4734a9238123f8ce4a017d96b0fc4a029b485b2
URL:
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=f4734a9238123f8ce4a017d96b0fc4a029b485b2

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Sun Apr  1 20:20:11 2012 +0200

x86: adapt to refactored timers

---

 include/asm-x86/bits/timer.h |5 ++
 include/asm-x86/hal_32.h |   14 
 include/asm-x86/hal_64.h |   14 
 kernel/cobalt/arch/x86/hal.c |  135 ++
 scripts/Kconfig.frag |7 +--
 5 files changed, 169 insertions(+), 6 deletions(-)

diff --git a/include/asm-x86/bits/timer.h b/include/asm-x86/bits/timer.h
index 428c069..ec32d65 100644
--- a/include/asm-x86/bits/timer.h
+++ b/include/asm-x86/bits/timer.h
@@ -39,8 +39,13 @@ static inline void xnarch_program_timer_shot(unsigned long 
delay)
 static inline void xnarch_send_timer_ipi(xnarch_cpumask_t mask)
 {
 #ifdef CONFIG_SMP
+#ifndef CONFIG_IPIPE_CORE
ipipe_send_ipi(RTHAL_APIC_TIMER_IPI, mask);
+#else /* CONFIG_IPIPE_CORE */
+   ipipe_send_ipi(RTHAL_TIMER_IPI, mask);
+#endif /* CONFIG_IPIPE_CORE */
 #endif /* CONFIG_SMP */
+
 }
 
 #endif /* !_XENO_ASM_X86_BITS_TIMER_H */
diff --git a/include/asm-x86/hal_32.h b/include/asm-x86/hal_32.h
index ee9a31d..1b00fcd 100644
--- a/include/asm-x86/hal_32.h
+++ b/include/asm-x86/hal_32.h
@@ -38,11 +38,15 @@
 #define _XENO_ASM_X86_HAL_32_H
 
 #define RTHAL_ARCH_NAMEi386
+#ifndef CONFIG_IPIPE_CORE
 #ifdef CONFIG_X86_LOCAL_APIC
 # define RTHAL_TIMER_DEVICElapic
 #else
 # define RTHAL_TIMER_DEVICEpit
 #endif
+#else
+# define RTHAL_TIMER_DEVICE(ipipe_timer_name())
+#endif
 # define RTHAL_CLOCK_DEVICEtsc
 
 #include asm/xenomai/wrappers.h
@@ -88,6 +92,7 @@ static inline __attribute_const__ unsigned long ffnz(unsigned 
long ul)
 #include asm/xenomai/atomic.h
 #include asm/xenomai/smi.h
 
+#ifndef CONFIG_IPIPE_CORE
 #ifdef CONFIG_X86_LOCAL_APIC
 #define RTHAL_APIC_TIMER_VECTORIPIPE_HRTIMER_VECTOR
 #define RTHAL_APIC_TIMER_IPI   IPIPE_HRTIMER_IPI
@@ -99,6 +104,11 @@ static inline __attribute_const__ unsigned long 
ffnz(unsigned long ul)
 #define RTHAL_TIMER_IRQ0   /* i8253 PIT interrupt. */
 #define RTHAL_HOST_TICK_IRQ0   /* Host tick is emulated by Xenomai. */
 #endif /* CONFIG_X86_LOCAL_APIC */
+#else /* CONFIG_IPIPE_CORE */
+#define RTHAL_TIMER_IRQ__ipipe_hrtimer_irq
+#define RTHAL_TIMER_IPIIPIPE_HRTIMER_IPI
+#define RTHAL_HOST_TICK_IRQRTHAL_TIMER_IRQ
+#endif /* CONFIG_IPIPE_CORE */
 
 static inline void rthal_grab_control(void)
 {
@@ -120,6 +130,7 @@ static inline unsigned long long rthal_rdtsc(void)
 
 static inline void rthal_timer_program_shot(unsigned long delay)
 {
+#ifndef CONFIG_IPIPE_CORE
 #ifdef CONFIG_X86_LOCAL_APIC
if (likely(delay))
apic_write(APIC_TMICT, delay);
@@ -132,6 +143,9 @@ static inline void rthal_timer_program_shot(unsigned long 
delay)
} else
ipipe_post_irq_head(RTHAL_TIMER_IRQ);
 #endif /* CONFIG_X86_LOCAL_APIC */
+#else /* I-pipe core */
+   ipipe_timer_set(delay);
+#endif /* I-pipe core */
 }
 
 static const char *const rthal_fault_labels[] = {
diff --git a/include/asm-x86/hal_64.h b/include/asm-x86/hal_64.h
index 1d19840..ad42c12 100644
--- a/include/asm-x86/hal_64.h
+++ b/include/asm-x86/hal_64.h
@@ -24,7 +24,11 @@
 #define _XENO_ASM_X86_HAL_64_H
 
 #define RTHAL_ARCH_NAMEx86_64
+#ifndef CONFIG_IPIPE_CORE
 #define RTHAL_TIMER_DEVICE lapic
+#else /* I-pipe core */
+#define RTHAL_TIMER_DEVICE (ipipe_timer_name())
+#endif /* I-pipe core */
 #define RTHAL_CLOCK_DEVICE tsc
 
 #include asm/xenomai/wrappers.h
@@ -49,12 +53,18 @@ static inline __attribute_const__ unsigned long 
ffnz(unsigned long ul)
 #include asm/xenomai/atomic.h
 #include asm/xenomai/smi.h
 
+#ifndef CONFIG_IPIPE_CORE
 #define RTHAL_APIC_TIMER_VECTORIPIPE_HRTIMER_VECTOR
 #define RTHAL_APIC_TIMER_IPI   IPIPE_HRTIMER_IPI
 #define RTHAL_APIC_ICOUNT  ((RTHAL_TIMER_FREQ + HZ/2)/HZ)
 #define RTHAL_TIMER_IRQRTHAL_APIC_TIMER_IPI
 #define RTHAL_HOST_TICK_IRQ
ipipe_apic_vector_irq(LOCAL_TIMER_VECTOR)
 #define RTHAL_BCAST_TICK_IRQ   0
+#else /* CONFIG_IPIPE_CORE */
+#define RTHAL_TIMER_IRQ__ipipe_hrtimer_irq
+#define RTHAL_TIMER_IPIIPIPE_HRTIMER_IPI
+#define RTHAL_HOST_TICK_IRQRTHAL_TIMER_IRQ
+#endif /* CONFIG_IPIPE_CORE */
 
 static inline void rthal_grab_control(void)
 {
@@ -76,11 +86,15 @@ static inline unsigned long long rthal_rdtsc(void)
 
 static inline void rthal_timer_program_shot(unsigned long delay)
 {
+#ifndef CONFIG_IPIPE_CORE
if (likely(delay))
apic_write(APIC_TMICT, delay);
else
/* Pend the timer 

[Xenomai-git] Gilles Chanteperdrix : scripts: fix extract-doc, git-clone no longer exists

2012-03-26 Thread GIT version control
Module: xenomai-2.6
Branch: master
Commit: a9a8d5cf800880e5c3227a2f32874eb9a8b99e9a
URL:
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=a9a8d5cf800880e5c3227a2f32874eb9a8b99e9a

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Sun Mar  4 18:16:08 2012 +0100

scripts: fix extract-doc, git-clone no longer exists

---

 scripts/maint/extract-doc |   21 ++---
 1 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/scripts/maint/extract-doc b/scripts/maint/extract-doc
index 271790f..dda1008 100755
--- a/scripts/maint/extract-doc
+++ b/scripts/maint/extract-doc
@@ -26,7 +26,7 @@ Options:
 
 
 ECHO=echo
-GIT_CLONE=git-clone
+GIT_CLONE=git clone
 RSYNC=rsync
 
 # Parse command line arguments.
@@ -34,24 +34,24 @@ while :; do
 case $1 in
 # Really verbose, output details
 -v|--verbose) SVN=svn
-RSYNC=rsync -v
-;;
-
+   RSYNC=rsync -v
+   ;;
+
 # Really silent, for cron jobs
 -q|--quiet) ECHO=:
-RSYNC=rsync -q
-   GIT_CLONE=git-clone -q
-;;
+   RSYNC=rsync -q
+   GIT_CLONE=git clone -q
+   ;;
 
 # Debugging
 -d|--debug) set -x
-;;
+   ;;
 
 -h|--help) cat EOF
 $USAGE
 EOF
-exit 0
-;;
+   exit 0
+   ;;
 
 *) break
;;
@@ -105,4 +105,3 @@ done
 
 cd ..
 rm -Rf $tmpdir
-


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


[Xenomai-git] Gilles Chanteperdrix : common/rt_print: mask all signals for logging thread

2012-03-26 Thread GIT version control
Module: xenomai-2.6
Branch: master
Commit: a6dceeb973099f59051760e59680e5a6f2621b71
URL:
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=a6dceeb973099f59051760e59680e5a6f2621b71

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Tue Feb 21 12:11:48 2012 +0100

common/rt_print: mask all signals for logging thread

---

 src/skins/common/rt_print.c |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/skins/common/rt_print.c b/src/skins/common/rt_print.c
index 5533e29..e1c828a 100644
--- a/src/skins/common/rt_print.c
+++ b/src/skins/common/rt_print.c
@@ -26,6 +26,7 @@
 #include string.h
 #include unistd.h
 #include syslog.h
+#include signal.h
 
 #include rtdk.h
 #include nucleus/types.h /* For BITS_PER_LONG */
@@ -612,6 +613,11 @@ static void unlock(void *cookie)
 
 static void *printer_loop(void *arg)
 {
+   sigset_t mask;
+
+   sigemptyset(mask);
+   pthread_sigmask(SIG_BLOCK, mask, NULL);
+
while (1) {
pthread_cleanup_push(unlock, buffer_lock);
pthread_mutex_lock(buffer_lock);


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


[Xenomai-git] Wolfgang Grandegger : nucleus: fix poll EOF issue with xnpipe/rt_pipe

2012-03-26 Thread GIT version control
Module: xenomai-2.6
Branch: master
Commit: d7ef5ebfa349b57e3537929c2ba0020bb107803e
URL:
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=d7ef5ebfa349b57e3537929c2ba0020bb107803e

Author: Wolfgang Grandegger w...@denx.de
Date:   Mon Mar 26 09:21:51 2012 +0200

nucleus: fix poll EOF issue with xnpipe/rt_pipe

So far, the EOF event is not handled in the Linux poll function of the
xnpipe/rt_pipe service when the pipe is closed (via rt_pipde_delete).
This patch fixes the issue by setting POLLUP in the Linux poll function
when the pipe is broken. The subsequent reads will then fail with errno
EPIPE.

Signed-off-by: Wolfgang Grandegger w...@denx.de

---

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

diff --git a/ksrc/nucleus/pipe.c b/ksrc/nucleus/pipe.c
index 1e6bcf2..1d5e39a 100644
--- a/ksrc/nucleus/pipe.c
+++ b/ksrc/nucleus/pipe.c
@@ -1033,6 +1033,8 @@ static unsigned xnpipe_poll(struct file *file, poll_table 
*pt)
 
if (testbits(state-status, XNPIPE_KERN_CONN))
w_mask |= (POLLOUT | POLLWRNORM);
+   else
+   r_mask |= POLLHUP;
 
if (!emptyq_p(state-outq))
r_mask |= (POLLIN | POLLRDNORM);


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


[Xenomai-git] Gilles Chanteperdrix : Kconfig: make dependency upon GENERIC_CLOCKEVENTS explicit

2012-03-26 Thread GIT version control
Module: xenomai-gch
Branch: for-forge
Commit: 08bcf8e92dd329ce478cc77ec9e5a4ffd5ce09cb
URL:
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=08bcf8e92dd329ce478cc77ec9e5a4ffd5ce09cb

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Tue Mar 27 03:09:33 2012 +0200

Kconfig: make dependency upon GENERIC_CLOCKEVENTS explicit

---

 scripts/Kconfig.frag |   18 +++---
 1 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/scripts/Kconfig.frag b/scripts/Kconfig.frag
index bbc9cbe..0841598 100644
--- a/scripts/Kconfig.frag
+++ b/scripts/Kconfig.frag
@@ -1,14 +1,14 @@
-
 config XENOMAI
+   depends on GENERIC_CLOCKEVENTS
depends on (X86_TSC || !X86)  (!HPET_TIMER || !X86 || X86_LOCAL_APIC)
bool Xenomai
-select IPIPE
+   select IPIPE
default y
-help
-  Xenomai is a real-time extension to the Linux kernel. Note
-  that Xenomai relies on Adeos interrupt pipeline (CONFIG_IPIPE
-  option) to be enabled, so enabling this option selects the
-  CONFIG_IPIPE option.
+   help
+ Xenomai is a real-time extension to the Linux kernel. Note
+ that Xenomai relies on Adeos interrupt pipeline (CONFIG_IPIPE
+ option) to be enabled, so enabling this option selects the
+ CONFIG_IPIPE option.
 
 if XENOMAI
 source arch/@LINUX_ARCH@/xenomai/Kconfig
@@ -20,6 +20,10 @@ comment or Intel cpuidle option. These options are known to 
cause troubles
 comment with Xenomai, disable them.
 endif
 
+if !GENERIC_CLOCKEVENTS
+comment NOTE: Xenomai needs CONFIG_GENERIC_CLOCKEVENTS
+endif
+
 comment NOTE: Xenomai needs either X86_LOCAL_APIC enabled or HPET_TIMER 
disabled.
depends on !X86_LOCAL_APIC  X86  HPET_TIMER
 comment (menu Processor type and features)


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


[Xenomai-git] Philippe Gerum : copperplate: synchronize threadobj_start() with target thread

2012-03-23 Thread GIT version control
Module: xenomai-forge
Branch: master
Commit: dcfd4d53baa1c55c37f994ec85ba25c625eb0002
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=dcfd4d53baa1c55c37f994ec85ba25c625eb0002

Author: Philippe Gerum r...@xenomai.org
Date:   Thu Mar 22 22:41:08 2012 +0100

copperplate: synchronize threadobj_start() with target thread

A thread started with high priority should enter the user code before
threadobj_start() returns to a low priority caller. IOW, we must avoid
priority inversions due to some resources not being immediately
available to the started thread when it executes the internal
prologue, causing such thread to block or be demoted priority-wise.

This is particularly required when running over the Cobalt core, when
the started thread has to migrate to secondary mode for running
portions of the prologue code, in which case its priority is
automatically demoted.

This patch introduces the required synchronization between the
starting thread and the threadobj_start() caller, only when the latter
has a strictly lower priority than the former. In all other cases, the
thread issuing threadobj_start() may keep running without
synchronizing.

NOTE: this mechanism makes most sense in uniprocessor configurations,
where assumptions could be made on the effect of the respective
priorities of both the started and starter thread. I.e. the starter
may assume the started thread has entered its processing routine
before threadobj_start() returns, for any relevant purpose. However,
we enable it for SMP configurations as well, to keep these assumptions
valid regardless.

---

 include/copperplate/threadobj.h |9 +++-
 lib/alchemy/task.c  |5 +-
 lib/copperplate/threadobj.c |  100 +++
 lib/psos/task.c |3 +-
 lib/vxworks/taskLib.c   |4 +-
 5 files changed, 83 insertions(+), 38 deletions(-)

diff --git a/include/copperplate/threadobj.h b/include/copperplate/threadobj.h
index d086dcb..56f8199 100644
--- a/include/copperplate/threadobj.h
+++ b/include/copperplate/threadobj.h
@@ -85,8 +85,9 @@ struct threadobj_stat {
 #define THREADOBJ_ROUNDROBIN   0x2 /* Undergoes round-robin. */
 #define THREADOBJ_STARTED  0x4 /* threadobj_start() called. */
 #define THREADOBJ_WARMUP   0x8 /* threadobj_prologue() not called yet. 
*/
-#define THREADOBJ_ABORTED  0x10/* cancelled before start. */
+#define THREADOBJ_ABORTED  0x10/* Cancelled before start. */
 #define THREADOBJ_LOCKED   0x20/* threadobj_lock() granted (debug 
only). */
+#define THREADOBJ_RUNNING  0x40/* Running user code. */
 #define THREADOBJ_DEBUG0x8000  /* Debug mode enabled. */
 
 #define THREADOBJ_IRQCONTEXT((struct threadobj *)-2UL)
@@ -242,10 +243,14 @@ void threadobj_init(struct threadobj *thobj,
 
 void threadobj_start(struct threadobj *thobj);
 
+void threadobj_shadow(struct threadobj *thobj);
+
 int threadobj_prologue(struct threadobj *thobj,
   const char *name);
 
-void threadobj_wait_start(struct threadobj *thobj);
+void threadobj_wait_start(void);
+
+void threadobj_notify_entry(void);
 
 int threadobj_cancel(struct threadobj *thobj);
 
diff --git a/lib/alchemy/task.c b/lib/alchemy/task.c
index d455ab0..f0b343a 100644
--- a/lib/alchemy/task.c
+++ b/lib/alchemy/task.c
@@ -173,7 +173,7 @@ static int task_prologue(struct alchemy_task *tcb)
 
COPPERPLATE_PROTECT(svc);
 
-   threadobj_wait_start(tcb-thobj);
+   threadobj_wait_start();
 
threadobj_lock(tcb-thobj);
 
@@ -198,6 +198,7 @@ static void *task_trampoline(void *arg)
goto out;
}
 
+   threadobj_notify_entry();
tcb-entry(tcb-arg);
 out:
threadobj_lock(tcb-thobj);
@@ -409,7 +410,7 @@ int rt_task_shadow(RT_TASK *task, const char *name, int 
prio, int mode)
goto out;
 
threadobj_lock(tcb-thobj);
-   threadobj_start(tcb-thobj); /* We won't wait in prologue. */
+   threadobj_shadow(tcb-thobj); /* We won't wait in prologue. */
threadobj_unlock(tcb-thobj);
ret = task_prologue(tcb);
if (ret) {
diff --git a/lib/copperplate/threadobj.c b/lib/copperplate/threadobj.c
index 5743798..70f4435 100644
--- a/lib/copperplate/threadobj.c
+++ b/lib/copperplate/threadobj.c
@@ -923,42 +923,31 @@ void threadobj_init(struct threadobj *thobj,
threadobj_init_corespec(thobj);
 }
 
-void threadobj_start(struct threadobj *thobj)  /* thobj-lock held. */
-{
-   __threadobj_check_locked(thobj);
-
-   if (thobj-status  THREADOBJ_STARTED)
-   return;
-
-   thobj-status |= THREADOBJ_STARTED;
-   __RT(pthread_cond_signal(thobj-barrier));
-}
+/*
+ * NOTE: to spare us the need for passing the equivalent of a
+ * syncstate argument to each thread locking operation, we hold the
+ * cancel state of the locker directly into the locked thread, prior
+ * to disabling cancellation for the calling thread.
+ *
+ * 

[Xenomai-git] Philippe Gerum : cobalt/nucleus: fix interrupt state of xnshadow_kick/ demote() callers

2012-03-23 Thread GIT version control
Module: xenomai-forge
Branch: master
Commit: f8a0385ad07f0472d7def3dc1a15b380da857bd8
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=f8a0385ad07f0472d7def3dc1a15b380da857bd8

Author: Philippe Gerum r...@xenomai.org
Date:   Thu Mar 22 18:37:48 2012 +0100

cobalt/nucleus: fix interrupt state of xnshadow_kick/demote() callers

---

 include/cobalt/nucleus/shadow.h |4 
 kernel/cobalt/nucleus/shadow.c  |   24 +---
 2 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/include/cobalt/nucleus/shadow.h b/include/cobalt/nucleus/shadow.h
index db44228..694f32d 100644
--- a/include/cobalt/nucleus/shadow.h
+++ b/include/cobalt/nucleus/shadow.h
@@ -111,8 +111,12 @@ void xnshadow_send_sig(struct xnthread *thread,
 
 void xnshadow_call_mayday(struct xnthread *thread, int sigtype);
 
+void __xnshadow_kick(struct xnthread *thread);
+
 void xnshadow_kick(struct xnthread *thread);
 
+void __xnshadow_demote(struct xnthread *thread);
+
 void xnshadow_demote(struct xnthread *thread);
 
 #endif /* !_XENO_NUCLEUS_SHADOW_H */
diff --git a/kernel/cobalt/nucleus/shadow.c b/kernel/cobalt/nucleus/shadow.c
index 0da8bc8..8ad8e17 100644
--- a/kernel/cobalt/nucleus/shadow.c
+++ b/kernel/cobalt/nucleus/shadow.c
@@ -745,7 +745,7 @@ int xnshadow_force_wakeup(struct xnthread *thread) /* 
nklock locked, irqs off */
return ret;
 }
 
-void xnshadow_kick(struct xnthread *thread) /* nklock locked, irqs off */
+void __xnshadow_kick(struct xnthread *thread) /* nklock locked, irqs off */
 {
struct task_struct *p = xnthread_archtcb(thread)-user_task;
 
@@ -786,16 +786,25 @@ void xnshadow_kick(struct xnthread *thread) /* nklock 
locked, irqs off */
if (thread != xnpod_current_thread())
xnarch_call_mayday(p);
 }
+
+void xnshadow_kick(struct xnthread *thread)
+{
+   spl_t s;
+
+   xnlock_get_irqsave(nklock, s);
+   __xnshadow_kick(thread);
+   xnlock_put_irqrestore(nklock, s);
+}
 EXPORT_SYMBOL_GPL(xnshadow_kick);
 
-void xnshadow_demote(struct xnthread *thread) /* nklock locked, irqs off */
+void __xnshadow_demote(struct xnthread *thread) /* nklock locked, irqs off */
 {
/*
 * First we kick the thread out of primary mode, and have it
 * resume execution immediately over the regular linux
 * context.
 */
-   xnshadow_kick(thread);
+   __xnshadow_kick(thread);
/*
 * Then we send it a renice action signal to demote it from
 * SCHED_FIFO to SCHED_OTHER. In effect, we turned that thread
@@ -806,6 +815,15 @@ void xnshadow_demote(struct xnthread *thread) /* nklock 
locked, irqs off */
xnshadow_send_sig(thread, SIGSHADOW,
  sigshadow_int(SIGSHADOW_ACTION_RENICE, 0));
 }
+
+void xnshadow_demote(struct xnthread *thread)
+{
+   spl_t s;
+
+   xnlock_get_irqsave(nklock, s);
+   __xnshadow_demote(thread);
+   xnlock_put_irqrestore(nklock, s);
+}
 EXPORT_SYMBOL_GPL(xnshadow_demote);
 
 void xnshadow_exit(void)


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


[Xenomai-git] Gilles Chanteperdrix : wrappers: fix build with legacy I-pipes supporting HOSTRT

2012-03-23 Thread GIT version control
Module: xenomai-forge
Branch: master
Commit: 87db05dceb1155d77a265d3b612113ea331d581d
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=87db05dceb1155d77a265d3b612113ea331d581d

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Tue Mar 20 12:29:43 2012 +0100

wrappers: fix build with legacy I-pipes supporting HOSTRT

---

 include/asm-generic/ipipe/wrappers.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/asm-generic/ipipe/wrappers.h 
b/include/asm-generic/ipipe/wrappers.h
index 536f1c4..9a7a444 100644
--- a/include/asm-generic/ipipe/wrappers.h
+++ b/include/asm-generic/ipipe/wrappers.h
@@ -41,7 +41,7 @@ struct ipipe_work_header {
void (*handler)(struct ipipe_work_header *work);
 };
 
-#ifndef CONFIG_XENO_OPT_HOSTRT
+#if !defined(CONFIG_XENO_OPT_HOSTRT)  !defined(CONFIG_HAVE_IPIPE_HOSTRT)
 #define IPIPE_EVENT_HOSTRT  -1 /* Never received */
 #endif
 #define IPIPE_KEVT_SCHEDULEIPIPE_EVENT_SCHEDULE


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


[Xenomai-git] Philippe Gerum : Merge remote-tracking branch 'gilles'

2012-03-23 Thread GIT version control
Module: xenomai-forge
Branch: master
Commit: c4e722abfb8a89e6e92d224725f126d1bc920aa4
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=c4e722abfb8a89e6e92d224725f126d1bc920aa4

Author: Philippe Gerum r...@xenomai.org
Date:   Fri Mar 23 15:24:45 2012 +0100

Merge remote-tracking branch 'gilles'

---




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


[Xenomai-git] Gilles Chanteperdrix : hal/arm: adapt to refactored ipipe core timers

2012-03-23 Thread GIT version control
Module: xenomai-forge
Branch: master
Commit: 33fca0d8c2be0dbf3047065cb36f874461fcc000
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=33fca0d8c2be0dbf3047065cb36f874461fcc000

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Sun Mar 18 22:42:24 2012 +0100

hal/arm: adapt to refactored ipipe core timers

---

 include/asm-arm/hal.h|   17 +
 include/asm-arm/wrappers.h   |4 +
 kernel/cobalt/arch/arm/hal.c |  141 +
 3 files changed, 107 insertions(+), 55 deletions(-)

diff --git a/include/asm-arm/hal.h b/include/asm-arm/hal.h
index f4fef47..f053cf2 100644
--- a/include/asm-arm/hal.h
+++ b/include/asm-arm/hal.h
@@ -38,6 +38,8 @@
 #include asm/vfp.h
 #endif /* CONFIG_VFP */
 
+#ifndef CONFIG_IPIPE_CORE
+
 #if defined(CONFIG_ARCH_AT91)
 #include linux/stringify.h
 #define RTHAL_TIMER_DEVICE at91_tc __stringify(CONFIG_IPIPE_AT91_TC)
@@ -90,6 +92,13 @@
 #error Unsupported ARM machine
 #endif /* CONFIG_ARCH_SA1100 */
 
+#else /* I-ipipe core */
+
+#define RTHAL_TIMER_DEVICE (ipipe_timer_name())
+#define RTHAL_CLOCK_DEVICE ipipe_tsc
+
+#endif /* I-ipipe core */
+
 #define RTHAL_HOST_TICK_IRQ RTHAL_TIMER_IRQ
 
 typedef unsigned long long rthal_time_t;
@@ -152,7 +161,11 @@ static inline __attribute_const__ unsigned long 
ffnz(unsigned long ul)
 #define RTHAL_TIMER_IPI IPIPE_HRTIMER_IPI
 #endif /* RTHAL_TIMER_IPI */
 
+#ifdef CONFIG_IPIPE_CORE
 #define RTHAL_TSC_INFO(p)  ((p)-arch.tsc)
+#else /* !CONFIG_IPIPE_CORE */
+#define RTHAL_TSC_INFO(p)  ((p)-arch_tsc)
+#endif  /* !CONFIG_IPIPE_CORE */
 
 #define RTHAL_SHARED_HEAP_FLAGS (cache_is_vivt() ? XNHEAP_GFP_NONCACHED : 0)
 
@@ -173,10 +186,14 @@ static inline struct task_struct 
*rthal_current_host_task(int cpuid)
 
 static inline void rthal_timer_program_shot(unsigned long delay)
 {
+#ifndef CONFIG_IPIPE_CORE
if (delay == 0)
ipipe_post_irq_head(RTHAL_TIMER_IRQ);
else
__ipipe_mach_set_dec(delay);
+#else /* I-pipe core */
+   ipipe_timer_set(delay);
+#endif /* I-pipe core */
 }
 
 /* Private interface -- Internal use only */
diff --git a/include/asm-arm/wrappers.h b/include/asm-arm/wrappers.h
index 8e5405f..0a89a03 100644
--- a/include/asm-arm/wrappers.h
+++ b/include/asm-arm/wrappers.h
@@ -33,6 +33,10 @@
 #define __put_user_inatomic __put_user
 #define __get_user_inatomic __get_user
 
+#if LINUX_VERSION_CODE  KERNEL_VERSION(3, 1, 0)
+#define vfp_current_hw_state last_VFP_context
+#endif /* Linux  3.1 */
+
 #ifdef CONFIG_XENO_LEGACY_IPIPE
 
 #if !defined(CONFIG_GENERIC_HARDIRQS) \
diff --git a/kernel/cobalt/arch/arm/hal.c b/kernel/cobalt/arch/arm/hal.c
index 8ed802c..1609957 100644
--- a/kernel/cobalt/arch/arm/hal.c
+++ b/kernel/cobalt/arch/arm/hal.c
@@ -52,6 +52,8 @@ rthal_u32frac_t rthal_tsc_to_timer;
 
 enum rthal_ktimer_mode rthal_ktimer_saved_mode;
 
+#ifndef CONFIG_IPIPE_CORE
+
 #define RTHAL_SET_ONESHOT_XENOMAI  1
 #define RTHAL_SET_ONESHOT_LINUX2
 #define RTHAL_SET_PERIODIC 3
@@ -87,61 +89,6 @@ static inline void restore_normal_hw_mode(void)
__ipipe_mach_release_timer();
 }
 
-unsigned long rthal_timer_calibrate(void)
-{
-   unsigned long long start, end, sum = 0, sum_sq = 0;
-   volatile unsigned const_delay = 0x;
-   unsigned long result, flags, tsc_lat;
-   unsigned int delay = const_delay;
-   long long diff;
-   int i, j;
-
-   flags = ipipe_critical_enter(NULL);
-
-   /*
-* Hw interrupts off, other CPUs quiesced, no migration
-* possible. We can now fiddle with the timer chip (per-cpu
-* local or global, rthal_timer_program_shot() will handle
-* this transparently via the I-pipe).
-*/
-   steal_timer(1);
-   force_oneshot_hw_mode();
-
-   ipipe_read_tsc(start);
-   barrier();
-   ipipe_read_tsc(end);
-   tsc_lat = end - start;
-   barrier();
-
-   for (i = 0; i  RTHAL_CALIBRATE_LOOPS; i++) {
-   flush_cache_all();
-   for (j = 0; j  RTHAL_CALIBRATE_LOOPS; j++) {
-   ipipe_read_tsc(start);
-   barrier();
-   rthal_timer_program_shot(
-   rthal_nodiv_imuldiv_ceil(delay, 
rthal_tsc_to_timer));
-   barrier();
-   ipipe_read_tsc(end);
-   diff = end - start - tsc_lat;
-   if (diff  0) {
-   sum += diff;
-   sum_sq += diff * diff;
-   }
-   }
-   }
-
-   restore_normal_hw_mode();
-
-   ipipe_critical_exit(flags);
-
-   /* Use average + standard deviation as timer programming latency. */
-   do_div(sum, RTHAL_CALIBRATE_LOOPS * RTHAL_CALIBRATE_LOOPS);
-   do_div(sum_sq, RTHAL_CALIBRATE_LOOPS * RTHAL_CALIBRATE_LOOPS);
-   result = sum + int_sqrt(sum_sq - sum * 

[Xenomai-git] Philippe Gerum : cobalt: introduce pre-faulting of shared areas

2012-03-21 Thread GIT version control
Module: xenomai-forge
Branch: master
Commit: 3df446aec0d520f9ba83193d3fa0c7f701d27c45
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=3df446aec0d520f9ba83193d3fa0c7f701d27c45

Author: Philippe Gerum r...@xenomai.org
Date:   Tue Mar 20 22:42:27 2012 +0100

cobalt: introduce pre-faulting of shared areas

---

 lib/cobalt/cond.c |   11 ---
 lib/cobalt/current.c  |9 +++--
 lib/cobalt/internal.c |   26 +-
 lib/cobalt/internal.h |4 
 lib/cobalt/mutex.c|   10 --
 5 files changed, 48 insertions(+), 12 deletions(-)

diff --git a/lib/cobalt/cond.c b/lib/cobalt/cond.c
index 9a6d2d6..0f9e050 100644
--- a/lib/cobalt/cond.c
+++ b/lib/cobalt/cond.c
@@ -89,13 +89,18 @@ int __wrap_pthread_cond_init(pthread_cond_t *cond,
 const pthread_condattr_t * attr)
 {
struct __shadow_cond *_cnd = ((union __xeno_cond *)cond)-shadow_cond;
+   unsigned long *pending_signalsp;
int err;
 
err = XENOMAI_SKINCALL2(__cobalt_muxid, sc_cobalt_cond_init, _cnd, 
attr);
if (!err  !_cnd-attr.pshared) {
-   _cnd-pending_signals = (unsigned long *)
+   pending_signalsp = (unsigned long *)
(xeno_sem_heap[0] + _cnd-pending_signals_offset);
-   }
+   _cnd-pending_signals = pending_signalsp;
+   } else
+   pending_signalsp = cond_get_signalsp(_cnd);
+
+   __cobalt_prefault(pending_signalsp);
 
return -err;
 }
@@ -243,7 +248,7 @@ int __wrap_pthread_cond_signal(pthread_cond_t *cond)
 
mutex_datp = cond_get_mutex_datp(_cnd);
if (mutex_datp) {
-   unsigned long flags = mutex_datp-flags ;
+   unsigned long flags = mutex_datp-flags;
 
if (unlikely(flags  COBALT_MUTEX_ERRORCHECK)) {
xnhandle_t cur = xeno_get_current();
diff --git a/lib/cobalt/current.c b/lib/cobalt/current.c
index 6ea49f4..dde38a3 100644
--- a/lib/cobalt/current.c
+++ b/lib/cobalt/current.c
@@ -8,6 +8,7 @@
 #include nucleus/vdso.h
 #include asm/xenomai/syscall.h
 #include asm-generic/bits/current.h
+#include internal.h
 
 extern unsigned long xeno_sem_heap[2];
 
@@ -30,6 +31,7 @@ void xeno_set_current_window(unsigned long offset)
 {
xeno_current_window = (struct xnthread_user_window *)
(xeno_sem_heap[0] + offset);
+   __cobalt_prefault(xeno_current_window);
 }
 #else /* !HAVE_TLS */
 
@@ -73,8 +75,11 @@ void xeno_init_current_keys(void)
 
 void xeno_set_current_window(unsigned long offset)
 {
-   pthread_setspecific(xeno_current_window_key,
-   (void *)(xeno_sem_heap[0] + offset));
+   struct xnthread_user_window *window;
+
+   window = (void *)(xeno_sem_heap[0] + offset);
+   pthread_setspecific(xeno_current_window_key, window);
+   __cobalt_prefault(window);
 }
 #endif /* !HAVE_TLS */
 
diff --git a/lib/cobalt/internal.c b/lib/cobalt/internal.c
index c20935e..12e31fb 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 unistd.h
 #include signal.h
 #include errno.h
 #include pthread.h
@@ -51,6 +52,18 @@ int __cobalt_thread_stat(pthread_t tid, struct 
cobalt_threadstat *stat)
 sc_cobalt_thread_getstat, tid, stat);
 }
 
+void ___cobalt_prefault(void *p, size_t len)
+{
+   volatile char *_p = (volatile char *)p, *end;
+   long pagesz = sysconf(_SC_PAGESIZE);
+
+   end = _p + len;
+   do {
+   *_p = *_p;
+   _p += pagesz;
+   } while (_p  end);
+}
+
 static inline
 struct cobalt_monitor_data *get_monitor_data(cobalt_monitor_t *mon)
 {
@@ -73,7 +86,10 @@ int cobalt_monitor_init(cobalt_monitor_t *mon, int flags)
if ((flags  COBALT_MONITOR_SHARED) == 0) {
datp = (void *)xeno_sem_heap[0] + mon-u.data_offset;
mon-u.data = datp;
-   }
+   } else
+   datp = get_monitor_data(mon);
+
+   __cobalt_prefault(datp);
 
return 0;
 }
@@ -130,7 +146,7 @@ int cobalt_monitor_exit(cobalt_monitor_t *mon)
unsigned long status;
xnhandle_t cur;
 
-   xnarch_memory_barrier();
+   __sync_synchronize();
 
datp = get_monitor_data(mon);
if ((datp-flags  COBALT_MONITOR_PENDED) 
@@ -347,10 +363,10 @@ int cobalt_event_init(cobalt_event_t *event, unsigned 
long value,
if ((flags  COBALT_EVENT_SHARED) == 0) {
datp = (void *)xeno_sem_heap[0] + event-u.data_offset;
event-u.data = datp;
-   }
+   } else
+   datp = get_event_data(event);
 
-   datp = get_event_data(event);
-   memset(datp, 0, sizeof(*datp));
+   __cobalt_prefault(datp);
 
return 0;
 }
diff --git a/lib/cobalt/internal.h b/lib/cobalt/internal.h
index da8586b..539f8e1 100644
--- a/lib/cobalt/internal.h
+++ b/lib/cobalt/internal.h

[Xenomai-git] Philippe Gerum : alchemy/event: rebase on eventobj

2012-03-21 Thread GIT version control
Module: xenomai-forge
Branch: master
Commit: 3139ad52fbcbde485f5e71a7a5be2f28e685c5fe
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=3139ad52fbcbde485f5e71a7a5be2f28e685c5fe

Author: Philippe Gerum r...@xenomai.org
Date:   Wed Mar 21 09:51:31 2012 +0100

alchemy/event: rebase on eventobj

---

 lib/alchemy/event.c |  128 ---
 lib/alchemy/event.h |   11 +---
 lib/alchemy/task.c  |2 -
 lib/alchemy/testsuite/event-1.c |2 +
 4 files changed, 44 insertions(+), 99 deletions(-)

diff --git a/lib/alchemy/event.c b/lib/alchemy/event.c
index 27b51fa..d41935c 100644
--- a/lib/alchemy/event.c
+++ b/lib/alchemy/event.c
@@ -32,12 +32,14 @@ static struct alchemy_namegen event_namegen = {
.length = sizeof ((struct alchemy_event *)0)-name,
 };
 
-DEFINE_SYNC_LOOKUP(event, RT_EVENT);
+DEFINE_LOOKUP_PRIVATE(event, RT_EVENT);
 
-static void event_finalize(struct syncobj *sobj)
+static void event_finalize(struct eventobj *evobj)
 {
-   struct alchemy_event *evcb;
-   evcb = container_of(sobj, struct alchemy_event, sobj);
+   struct alchemy_event *evcb = container_of(evobj, struct alchemy_event, 
evobj);
+   /* We should never fail here, so we backtrace. */
+   __bt(syncluster_delobj(alchemy_event_table, evcb-cobj));
+   evcb-magic = ~event_magic;
xnfree(evcb);
 }
 fnref_register(libalchemy, event_finalize);
@@ -45,7 +47,7 @@ fnref_register(libalchemy, event_finalize);
 int rt_event_create(RT_EVENT *event, const char *name,
unsigned long ivalue, int mode)
 {
-   int sobj_flags = 0, ret = 0;
+   int evobj_flags = 0, ret = 0;
struct alchemy_event *evcb;
struct service svc;
 
@@ -62,16 +64,18 @@ int rt_event_create(RT_EVENT *event, const char *name,
 
alchemy_build_name(evcb-name, name, event_namegen);
evcb-magic = event_magic;
-   evcb-value = ivalue;
-   evcb-mode = mode;
if (mode  EV_PRIO)
-   sobj_flags = SYNCOBJ_PRIO;
+   evobj_flags = EVOBJ_PRIO;
 
-   syncobj_init(evcb-sobj, sobj_flags,
-fnref_put(libalchemy, event_finalize));
+   ret = eventobj_init(evcb-evobj, ivalue, evobj_flags,
+   fnref_put(libalchemy, event_finalize));
+   if (ret) {
+   xnfree(evcb);
+   goto out;
+   }
 
if (syncluster_addobj(alchemy_event_table, evcb-name, evcb-cobj)) {
-   syncobj_uninit(evcb-sobj);
+   eventobj_destroy(evcb-evobj);
xnfree(evcb);
ret = -EEXIST;
} else
@@ -85,7 +89,6 @@ out:
 int rt_event_delete(RT_EVENT *event)
 {
struct alchemy_event *evcb;
-   struct syncstate syns;
struct service svc;
int ret = 0;
 
@@ -94,13 +97,19 @@ int rt_event_delete(RT_EVENT *event)
 
COPPERPLATE_PROTECT(svc);
 
-   evcb = get_alchemy_event(event, syns, ret);
+   evcb = find_alchemy_event(event, ret);
if (evcb == NULL)
goto out;
 
-   syncluster_delobj(alchemy_event_table, evcb-cobj);
-   evcb-magic = ~event_magic; /* Prevent further reference. */
-   syncobj_destroy(evcb-sobj, syns);
+   /*
+* XXX: we rely on copperplate's eventobj to check for event
+* existence, so we refrain from altering the object memory
+* until we know it was valid. So the only safe place to
+* negate the magic tag, deregister from the cluster and
+* release the memory is in the finalizer routine, which is
+* only called for valid objects.
+*/
+   ret = eventobj_destroy(evcb-evobj);
 out:
COPPERPLATE_UNPROTECT(svc);
 
@@ -111,55 +120,24 @@ int rt_event_wait_timed(RT_EVENT *event,
unsigned long mask, unsigned long *mask_r,
int mode, const struct timespec *abs_timeout)
 {
-   struct alchemy_event_wait *wait;
-   unsigned long bits, testval;
+   int evobj_mode = 0, ret = 0;
struct alchemy_event *evcb;
-   struct syncstate syns;
struct service svc;
-   int ret = 0;
 
if (!threadobj_current_p()  !alchemy_poll_mode(abs_timeout))
return -EPERM;
 
COPPERPLATE_PROTECT(svc);
 
-   evcb = get_alchemy_event(event, syns, ret);
+   evcb = find_alchemy_event(event, ret);
if (evcb == NULL)
goto out;
 
-   if (mask == 0) {
-   *mask_r = evcb-value;
-   goto done;
-   }
-
-   bits = evcb-value  mask;
-   testval = mode  EV_ANY ? bits : mask;
-   *mask_r = bits;
-
-   if (bits  bits == testval)
-   goto done;
-
-   if (alchemy_poll_mode(abs_timeout)) {
-   ret = -EWOULDBLOCK;
-   goto done;
-   }
-
-   wait = threadobj_prepare_wait(struct alchemy_event_wait);
-   wait-mask = mask;
-   wait-mode = mode;
+   if 

[Xenomai-git] Philippe Gerum : copperplate/debug: always enable bad pointer detection

2012-03-21 Thread GIT version control
Module: xenomai-forge
Branch: master
Commit: 1cdc0ab98560dd8170960c831e2244bb1b3c7310
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=1cdc0ab98560dd8170960c831e2244bb1b3c7310

Author: Philippe Gerum r...@xenomai.org
Date:   Wed Mar 21 10:51:34 2012 +0100

copperplate/debug: always enable bad pointer detection

---

 include/copperplate/debug.h |   19 ---
 1 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/include/copperplate/debug.h b/include/copperplate/debug.h
index 8ff4cd1..c2942b4 100644
--- a/include/copperplate/debug.h
+++ b/include/copperplate/debug.h
@@ -19,16 +19,13 @@
 #ifndef _COPPERPLATE_DEBUG_H
 #define _COPPERPLATE_DEBUG_H
 
+#include stdint.h
+#include stddef.h
+
 #ifdef __XENO_DEBUG__
 
-#include stdint.h
 #include pthread.h
 
-static inline int bad_pointer(const void *ptr)
-{
-   return ptr == NULL || ((intptr_t)ptr  (sizeof(intptr_t)-1)) != 0;
-}
-
 static inline int must_check(void)
 {
return 1;
@@ -101,11 +98,6 @@ int debug_pkg_init(void);
 
 #else /* !__XENO_DEBUG__ */
 
-static inline int bad_pointer(const void *ptr)
-{
-   return 0;
-}
-
 static inline int must_check(void)
 {
return 0;
@@ -146,4 +138,9 @@ struct backtrace_data {
 
 #endif /* !__XENO_DEBUG__ */
 
+static inline int bad_pointer(const void *ptr)
+{
+   return ptr == NULL || ((intptr_t)ptr  (sizeof(intptr_t)-1)) != 0;
+}
+
 #endif /* _COPPERPLATE_DEBUG_H */


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


[Xenomai-git] Gilles Chanteperdrix : arm: fix build with legacy I-pipes

2012-03-20 Thread GIT version control
Module: xenomai-gch
Branch: for-forge
Commit: 0eec09c428542755496aa9da7acb346cfe93dfd9
URL:
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=0eec09c428542755496aa9da7acb346cfe93dfd9

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Tue Mar 20 12:30:06 2012 +0100

arm: fix build with legacy I-pipes

---

 include/asm-arm/atomic.h |   16 
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/include/asm-arm/atomic.h b/include/asm-arm/atomic.h
index ce65989..232695e 100644
--- a/include/asm-arm/atomic.h
+++ b/include/asm-arm/atomic.h
@@ -47,14 +47,14 @@ static inline void atomic_set_mask(unsigned long mask, 
unsigned long *addr)
 : cc);
 }
 #else /* arm = armv5 */
-static inline void atomic_set_mask(unsigned long mask, unsigned long *addr)
-{
-   unsigned long flags;
-
-   flags = hard_local_irq_save();
-   *addr |= mask;
-   hard_local_irq_restore(flags);
-}
+#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__ */


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


[Xenomai-git] Gilles Chanteperdrix : wrappers: fix build with legacy I-pipes supporting HOSTRT

2012-03-20 Thread GIT version control
Module: xenomai-gch
Branch: for-forge
Commit: 87db05dceb1155d77a265d3b612113ea331d581d
URL:
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=87db05dceb1155d77a265d3b612113ea331d581d

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Tue Mar 20 12:29:43 2012 +0100

wrappers: fix build with legacy I-pipes supporting HOSTRT

---

 include/asm-generic/ipipe/wrappers.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/asm-generic/ipipe/wrappers.h 
b/include/asm-generic/ipipe/wrappers.h
index 536f1c4..9a7a444 100644
--- a/include/asm-generic/ipipe/wrappers.h
+++ b/include/asm-generic/ipipe/wrappers.h
@@ -41,7 +41,7 @@ struct ipipe_work_header {
void (*handler)(struct ipipe_work_header *work);
 };
 
-#ifndef CONFIG_XENO_OPT_HOSTRT
+#if !defined(CONFIG_XENO_OPT_HOSTRT)  !defined(CONFIG_HAVE_IPIPE_HOSTRT)
 #define IPIPE_EVENT_HOSTRT  -1 /* Never received */
 #endif
 #define IPIPE_KEVT_SCHEDULEIPIPE_EVENT_SCHEDULE


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


[Xenomai-git] Gilles Chanteperdrix : hal/arm: adapt to refactored ipipe core timers

2012-03-19 Thread GIT version control
Module: xenomai-gch
Branch: for-forge
Commit: 9456cf5b887749ea2819fb9c2c5010ad2a07d005
URL:
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=9456cf5b887749ea2819fb9c2c5010ad2a07d005

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Sun Mar 18 22:42:24 2012 +0100

hal/arm: adapt to refactored ipipe core timers

---

 include/asm-arm/hal.h|   17 +
 include/asm-arm/wrappers.h   |4 +
 kernel/cobalt/arch/arm/hal.c |  141 +
 3 files changed, 107 insertions(+), 55 deletions(-)

diff --git a/include/asm-arm/hal.h b/include/asm-arm/hal.h
index f4fef47..a47f368 100644
--- a/include/asm-arm/hal.h
+++ b/include/asm-arm/hal.h
@@ -38,6 +38,8 @@
 #include asm/vfp.h
 #endif /* CONFIG_VFP */
 
+#ifndef CONFIG_PIPE_TIMERS
+
 #if defined(CONFIG_ARCH_AT91)
 #include linux/stringify.h
 #define RTHAL_TIMER_DEVICE at91_tc __stringify(CONFIG_IPIPE_AT91_TC)
@@ -90,6 +92,13 @@
 #error Unsupported ARM machine
 #endif /* CONFIG_ARCH_SA1100 */
 
+#else /* I-ipipe timers */
+
+#define RTHAL_TIMER_DEVICE (ipipe_timer_name())
+#define RTHAL_CLOCK_DEVICE ipipe_tsc
+
+#endif /* I-ipipe timers */
+
 #define RTHAL_HOST_TICK_IRQ RTHAL_TIMER_IRQ
 
 typedef unsigned long long rthal_time_t;
@@ -152,7 +161,11 @@ static inline __attribute_const__ unsigned long 
ffnz(unsigned long ul)
 #define RTHAL_TIMER_IPI IPIPE_HRTIMER_IPI
 #endif /* RTHAL_TIMER_IPI */
 
+#ifdef CONFIG_IPIPE_CORE
 #define RTHAL_TSC_INFO(p)  ((p)-arch.tsc)
+#else /* !CONFIG_IPIPE_CORE */
+#define RTHAL_TSC_INFO(p)  ((p)-arch_tsc)
+#endif  /* !CONFIG_IPIPE_CORE */
 
 #define RTHAL_SHARED_HEAP_FLAGS (cache_is_vivt() ? XNHEAP_GFP_NONCACHED : 0)
 
@@ -173,10 +186,14 @@ static inline struct task_struct 
*rthal_current_host_task(int cpuid)
 
 static inline void rthal_timer_program_shot(unsigned long delay)
 {
+#ifndef CONFIG_IPIPE_TIMERS
if (delay == 0)
ipipe_post_irq_head(RTHAL_TIMER_IRQ);
else
__ipipe_mach_set_dec(delay);
+#else /* I-pipe timers */
+   ipipe_timer_set(delay);
+#endif /* I-pipe timers */
 }
 
 /* Private interface -- Internal use only */
diff --git a/include/asm-arm/wrappers.h b/include/asm-arm/wrappers.h
index 8e5405f..0a89a03 100644
--- a/include/asm-arm/wrappers.h
+++ b/include/asm-arm/wrappers.h
@@ -33,6 +33,10 @@
 #define __put_user_inatomic __put_user
 #define __get_user_inatomic __get_user
 
+#if LINUX_VERSION_CODE  KERNEL_VERSION(3, 1, 0)
+#define vfp_current_hw_state last_VFP_context
+#endif /* Linux  3.1 */
+
 #ifdef CONFIG_XENO_LEGACY_IPIPE
 
 #if !defined(CONFIG_GENERIC_HARDIRQS) \
diff --git a/kernel/cobalt/arch/arm/hal.c b/kernel/cobalt/arch/arm/hal.c
index 8ed802c..1609957 100644
--- a/kernel/cobalt/arch/arm/hal.c
+++ b/kernel/cobalt/arch/arm/hal.c
@@ -52,6 +52,8 @@ rthal_u32frac_t rthal_tsc_to_timer;
 
 enum rthal_ktimer_mode rthal_ktimer_saved_mode;
 
+#ifndef CONFIG_IPIPE_CORE
+
 #define RTHAL_SET_ONESHOT_XENOMAI  1
 #define RTHAL_SET_ONESHOT_LINUX2
 #define RTHAL_SET_PERIODIC 3
@@ -87,61 +89,6 @@ static inline void restore_normal_hw_mode(void)
__ipipe_mach_release_timer();
 }
 
-unsigned long rthal_timer_calibrate(void)
-{
-   unsigned long long start, end, sum = 0, sum_sq = 0;
-   volatile unsigned const_delay = 0x;
-   unsigned long result, flags, tsc_lat;
-   unsigned int delay = const_delay;
-   long long diff;
-   int i, j;
-
-   flags = ipipe_critical_enter(NULL);
-
-   /*
-* Hw interrupts off, other CPUs quiesced, no migration
-* possible. We can now fiddle with the timer chip (per-cpu
-* local or global, rthal_timer_program_shot() will handle
-* this transparently via the I-pipe).
-*/
-   steal_timer(1);
-   force_oneshot_hw_mode();
-
-   ipipe_read_tsc(start);
-   barrier();
-   ipipe_read_tsc(end);
-   tsc_lat = end - start;
-   barrier();
-
-   for (i = 0; i  RTHAL_CALIBRATE_LOOPS; i++) {
-   flush_cache_all();
-   for (j = 0; j  RTHAL_CALIBRATE_LOOPS; j++) {
-   ipipe_read_tsc(start);
-   barrier();
-   rthal_timer_program_shot(
-   rthal_nodiv_imuldiv_ceil(delay, 
rthal_tsc_to_timer));
-   barrier();
-   ipipe_read_tsc(end);
-   diff = end - start - tsc_lat;
-   if (diff  0) {
-   sum += diff;
-   sum_sq += diff * diff;
-   }
-   }
-   }
-
-   restore_normal_hw_mode();
-
-   ipipe_critical_exit(flags);
-
-   /* Use average + standard deviation as timer programming latency. */
-   do_div(sum, RTHAL_CALIBRATE_LOOPS * RTHAL_CALIBRATE_LOOPS);
-   do_div(sum_sq, RTHAL_CALIBRATE_LOOPS * RTHAL_CALIBRATE_LOOPS);
-   result = sum + 

[Xenomai-git] Gilles Chanteperdrix : hal/arm: adapt to refactored ipipe core timers

2012-03-19 Thread GIT version control
Module: xenomai-gch
Branch: for-forge
Commit: 33fca0d8c2be0dbf3047065cb36f874461fcc000
URL:
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=33fca0d8c2be0dbf3047065cb36f874461fcc000

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Sun Mar 18 22:42:24 2012 +0100

hal/arm: adapt to refactored ipipe core timers

---

 include/asm-arm/hal.h|   17 +
 include/asm-arm/wrappers.h   |4 +
 kernel/cobalt/arch/arm/hal.c |  141 +
 3 files changed, 107 insertions(+), 55 deletions(-)

diff --git a/include/asm-arm/hal.h b/include/asm-arm/hal.h
index f4fef47..f053cf2 100644
--- a/include/asm-arm/hal.h
+++ b/include/asm-arm/hal.h
@@ -38,6 +38,8 @@
 #include asm/vfp.h
 #endif /* CONFIG_VFP */
 
+#ifndef CONFIG_IPIPE_CORE
+
 #if defined(CONFIG_ARCH_AT91)
 #include linux/stringify.h
 #define RTHAL_TIMER_DEVICE at91_tc __stringify(CONFIG_IPIPE_AT91_TC)
@@ -90,6 +92,13 @@
 #error Unsupported ARM machine
 #endif /* CONFIG_ARCH_SA1100 */
 
+#else /* I-ipipe core */
+
+#define RTHAL_TIMER_DEVICE (ipipe_timer_name())
+#define RTHAL_CLOCK_DEVICE ipipe_tsc
+
+#endif /* I-ipipe core */
+
 #define RTHAL_HOST_TICK_IRQ RTHAL_TIMER_IRQ
 
 typedef unsigned long long rthal_time_t;
@@ -152,7 +161,11 @@ static inline __attribute_const__ unsigned long 
ffnz(unsigned long ul)
 #define RTHAL_TIMER_IPI IPIPE_HRTIMER_IPI
 #endif /* RTHAL_TIMER_IPI */
 
+#ifdef CONFIG_IPIPE_CORE
 #define RTHAL_TSC_INFO(p)  ((p)-arch.tsc)
+#else /* !CONFIG_IPIPE_CORE */
+#define RTHAL_TSC_INFO(p)  ((p)-arch_tsc)
+#endif  /* !CONFIG_IPIPE_CORE */
 
 #define RTHAL_SHARED_HEAP_FLAGS (cache_is_vivt() ? XNHEAP_GFP_NONCACHED : 0)
 
@@ -173,10 +186,14 @@ static inline struct task_struct 
*rthal_current_host_task(int cpuid)
 
 static inline void rthal_timer_program_shot(unsigned long delay)
 {
+#ifndef CONFIG_IPIPE_CORE
if (delay == 0)
ipipe_post_irq_head(RTHAL_TIMER_IRQ);
else
__ipipe_mach_set_dec(delay);
+#else /* I-pipe core */
+   ipipe_timer_set(delay);
+#endif /* I-pipe core */
 }
 
 /* Private interface -- Internal use only */
diff --git a/include/asm-arm/wrappers.h b/include/asm-arm/wrappers.h
index 8e5405f..0a89a03 100644
--- a/include/asm-arm/wrappers.h
+++ b/include/asm-arm/wrappers.h
@@ -33,6 +33,10 @@
 #define __put_user_inatomic __put_user
 #define __get_user_inatomic __get_user
 
+#if LINUX_VERSION_CODE  KERNEL_VERSION(3, 1, 0)
+#define vfp_current_hw_state last_VFP_context
+#endif /* Linux  3.1 */
+
 #ifdef CONFIG_XENO_LEGACY_IPIPE
 
 #if !defined(CONFIG_GENERIC_HARDIRQS) \
diff --git a/kernel/cobalt/arch/arm/hal.c b/kernel/cobalt/arch/arm/hal.c
index 8ed802c..1609957 100644
--- a/kernel/cobalt/arch/arm/hal.c
+++ b/kernel/cobalt/arch/arm/hal.c
@@ -52,6 +52,8 @@ rthal_u32frac_t rthal_tsc_to_timer;
 
 enum rthal_ktimer_mode rthal_ktimer_saved_mode;
 
+#ifndef CONFIG_IPIPE_CORE
+
 #define RTHAL_SET_ONESHOT_XENOMAI  1
 #define RTHAL_SET_ONESHOT_LINUX2
 #define RTHAL_SET_PERIODIC 3
@@ -87,61 +89,6 @@ static inline void restore_normal_hw_mode(void)
__ipipe_mach_release_timer();
 }
 
-unsigned long rthal_timer_calibrate(void)
-{
-   unsigned long long start, end, sum = 0, sum_sq = 0;
-   volatile unsigned const_delay = 0x;
-   unsigned long result, flags, tsc_lat;
-   unsigned int delay = const_delay;
-   long long diff;
-   int i, j;
-
-   flags = ipipe_critical_enter(NULL);
-
-   /*
-* Hw interrupts off, other CPUs quiesced, no migration
-* possible. We can now fiddle with the timer chip (per-cpu
-* local or global, rthal_timer_program_shot() will handle
-* this transparently via the I-pipe).
-*/
-   steal_timer(1);
-   force_oneshot_hw_mode();
-
-   ipipe_read_tsc(start);
-   barrier();
-   ipipe_read_tsc(end);
-   tsc_lat = end - start;
-   barrier();
-
-   for (i = 0; i  RTHAL_CALIBRATE_LOOPS; i++) {
-   flush_cache_all();
-   for (j = 0; j  RTHAL_CALIBRATE_LOOPS; j++) {
-   ipipe_read_tsc(start);
-   barrier();
-   rthal_timer_program_shot(
-   rthal_nodiv_imuldiv_ceil(delay, 
rthal_tsc_to_timer));
-   barrier();
-   ipipe_read_tsc(end);
-   diff = end - start - tsc_lat;
-   if (diff  0) {
-   sum += diff;
-   sum_sq += diff * diff;
-   }
-   }
-   }
-
-   restore_normal_hw_mode();
-
-   ipipe_critical_exit(flags);
-
-   /* Use average + standard deviation as timer programming latency. */
-   do_div(sum, RTHAL_CALIBRATE_LOOPS * RTHAL_CALIBRATE_LOOPS);
-   do_div(sum_sq, RTHAL_CALIBRATE_LOOPS * RTHAL_CALIBRATE_LOOPS);
-   result = sum + int_sqrt(sum_sq - sum * 

[Xenomai-git] Gilles Chanteperdrix : hal/arm: adapt to refactored ipipe core timers

2012-03-18 Thread GIT version control
Module: xenomai-gch
Branch: for-forge
Commit: 8ce5e13874be6bed03e577d81505bf4d829d3d76
URL:
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=8ce5e13874be6bed03e577d81505bf4d829d3d76

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Sun Mar 18 22:42:24 2012 +0100

hal/arm: adapt to refactored ipipe core timers

---

 include/asm-arm/hal.h|   13 
 kernel/cobalt/arch/arm/hal.c |  141 +
 2 files changed, 99 insertions(+), 55 deletions(-)

diff --git a/include/asm-arm/hal.h b/include/asm-arm/hal.h
index f4fef47..f91e4d1 100644
--- a/include/asm-arm/hal.h
+++ b/include/asm-arm/hal.h
@@ -38,6 +38,8 @@
 #include asm/vfp.h
 #endif /* CONFIG_VFP */
 
+#ifndef CONFIG_PIPE_TIMERS
+
 #if defined(CONFIG_ARCH_AT91)
 #include linux/stringify.h
 #define RTHAL_TIMER_DEVICE at91_tc __stringify(CONFIG_IPIPE_AT91_TC)
@@ -90,6 +92,13 @@
 #error Unsupported ARM machine
 #endif /* CONFIG_ARCH_SA1100 */
 
+#else /* I-ipipe timers */
+
+#define RTHAL_TIMER_DEVICE (ipipe_timer_name())
+#define RTHAL_CLOCK_DEVICE ipipe_tsc
+
+#endif /* I-ipipe timers */
+
 #define RTHAL_HOST_TICK_IRQ RTHAL_TIMER_IRQ
 
 typedef unsigned long long rthal_time_t;
@@ -173,10 +182,14 @@ static inline struct task_struct 
*rthal_current_host_task(int cpuid)
 
 static inline void rthal_timer_program_shot(unsigned long delay)
 {
+#ifndef CONFIG_IPIPE_TIMERS
if (delay == 0)
ipipe_post_irq_head(RTHAL_TIMER_IRQ);
else
__ipipe_mach_set_dec(delay);
+#else /* I-pipe timers */
+   ipipe_timer_set(delay);
+#endif /* I-pipe timers */
 }
 
 /* Private interface -- Internal use only */
diff --git a/kernel/cobalt/arch/arm/hal.c b/kernel/cobalt/arch/arm/hal.c
index 8ed802c..717df32 100644
--- a/kernel/cobalt/arch/arm/hal.c
+++ b/kernel/cobalt/arch/arm/hal.c
@@ -52,6 +52,8 @@ rthal_u32frac_t rthal_tsc_to_timer;
 
 enum rthal_ktimer_mode rthal_ktimer_saved_mode;
 
+#ifndef CONFIG_IPIPE_TIMERS
+
 #define RTHAL_SET_ONESHOT_XENOMAI  1
 #define RTHAL_SET_ONESHOT_LINUX2
 #define RTHAL_SET_PERIODIC 3
@@ -87,61 +89,6 @@ static inline void restore_normal_hw_mode(void)
__ipipe_mach_release_timer();
 }
 
-unsigned long rthal_timer_calibrate(void)
-{
-   unsigned long long start, end, sum = 0, sum_sq = 0;
-   volatile unsigned const_delay = 0x;
-   unsigned long result, flags, tsc_lat;
-   unsigned int delay = const_delay;
-   long long diff;
-   int i, j;
-
-   flags = ipipe_critical_enter(NULL);
-
-   /*
-* Hw interrupts off, other CPUs quiesced, no migration
-* possible. We can now fiddle with the timer chip (per-cpu
-* local or global, rthal_timer_program_shot() will handle
-* this transparently via the I-pipe).
-*/
-   steal_timer(1);
-   force_oneshot_hw_mode();
-
-   ipipe_read_tsc(start);
-   barrier();
-   ipipe_read_tsc(end);
-   tsc_lat = end - start;
-   barrier();
-
-   for (i = 0; i  RTHAL_CALIBRATE_LOOPS; i++) {
-   flush_cache_all();
-   for (j = 0; j  RTHAL_CALIBRATE_LOOPS; j++) {
-   ipipe_read_tsc(start);
-   barrier();
-   rthal_timer_program_shot(
-   rthal_nodiv_imuldiv_ceil(delay, 
rthal_tsc_to_timer));
-   barrier();
-   ipipe_read_tsc(end);
-   diff = end - start - tsc_lat;
-   if (diff  0) {
-   sum += diff;
-   sum_sq += diff * diff;
-   }
-   }
-   }
-
-   restore_normal_hw_mode();
-
-   ipipe_critical_exit(flags);
-
-   /* Use average + standard deviation as timer programming latency. */
-   do_div(sum, RTHAL_CALIBRATE_LOOPS * RTHAL_CALIBRATE_LOOPS);
-   do_div(sum_sq, RTHAL_CALIBRATE_LOOPS * RTHAL_CALIBRATE_LOOPS);
-   result = sum + int_sqrt(sum_sq - sum * sum) + 1;
-
-   return result;
-}
-
 #ifdef CONFIG_SMP
 static void critical_sync(void)
 {
@@ -197,8 +144,71 @@ static void rthal_timer_set_periodic(void)
ipipe_critical_exit(flags);
 }
 
+#else /* I-pipe timers */
+#define steal_timer(stolen) do { } while (0)
+#define force_oneshot_hw_mode() do { } while (0)
+#define restore_normal_hw_mode() do { } while (0)
+#define rthal_timer_set_oneshot(rt_mode) do { } while (0)
+#define rthal_timer_set_periodic() do { } while (0)
+#endif /* I-pipe timers */
+
 static int cpu_timers_requested;
 
+unsigned long rthal_timer_calibrate(void)
+{
+   unsigned long long start, end, sum = 0, sum_sq = 0;
+   volatile unsigned const_delay = 0x;
+   unsigned long result, flags, tsc_lat;
+   unsigned int delay = const_delay;
+   long long diff;
+   int i, j;
+
+   flags = ipipe_critical_enter(NULL);
+
+   /*
+* Hw interrupts off, 

[Xenomai-git] Gilles Chanteperdrix : arm: fix compilation with current ipipe-core

2012-03-17 Thread GIT version control
Module: xenomai-gch
Branch: for-forge
Commit: a327c05a82b51cd34cbfafe5979df74356d7d47b
URL:
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=a327c05a82b51cd34cbfafe5979df74356d7d47b

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Sun Mar 11 20:10:33 2012 +0100

arm: fix compilation with current ipipe-core

---

 configure   |2 +-
 include/asm-arm/bits/pod.h  |6 +++---
 include/asm-arm/hal.h   |   19 +--
 kernel/cobalt/arch/arm/hal.c|2 +-
 kernel/cobalt/arch/arm/switch.S |4 
 5 files changed, 22 insertions(+), 11 deletions(-)

diff --git a/configure b/configure
index d620643..b193c2b 100755
--- a/configure
+++ b/configure
@@ -13581,7 +13581,7 @@ LD_FILE_OPTION=$ac_cv_ld_file_option
 
 
 if test x$rtcore_type = xcobalt; then
-   XENO_USER_CFLAGS=-I$srcdir/include/cobalt $XENO_USER_CFLAGS
+   XENO_USER_CFLAGS=-I`cd $srcdir  pwd`/include/cobalt $XENO_USER_CFLAGS
if [ $ac_cv_ld_file_option = yes ]; then
XENO_POSIX_WRAPPERS=-Wl,@`cd $srcdir  pwd`/lib/cobalt/posix.wrappers
else
diff --git a/include/asm-arm/bits/pod.h b/include/asm-arm/bits/pod.h
index 7412586..9c62dd4 100644
--- a/include/asm-arm/bits/pod.h
+++ b/include/asm-arm/bits/pod.h
@@ -155,7 +155,7 @@ static inline void xnarch_enable_fpu(xnarchtcb_t *tcb)
   systems for still unknown reasons.
*/
rthal_save_fpu(tcb-fpup, fpexc);
-   last_VFP_context[ipipe_processor_id()] = NULL;
+   vfp_current_hw_state[ipipe_processor_id()] = NULL;
rthal_disable_fpu();
}
 #else /* !CONFIG_VFP */
@@ -211,12 +211,12 @@ static inline void xnarch_restore_fpu(xnarchtcb_t * tcb)
   the newly switched thread uses the FPU, to allow the kernel handler
   to pick the correct FPU context.
 
-  Further set last_VFP_context to NULL to avoid the Linux kernel to
+  Further set vfp_current_hw_state to NULL to avoid the Linux kernel to
   save, when the fault occur, the current FPU context, the one of an RT
   task, into the FPU area of the last non RT task which used the FPU
   before the preemption by Xenomai.
*/
-   last_VFP_context[ipipe_processor_id()] = NULL;
+   vfp_current_hw_state[ipipe_processor_id()] = NULL;
rthal_disable_fpu();
}
 #else /* !CONFIG_VFP */
diff --git a/include/asm-arm/hal.h b/include/asm-arm/hal.h
index 29b24ad..f4fef47 100644
--- a/include/asm-arm/hal.h
+++ b/include/asm-arm/hal.h
@@ -152,7 +152,7 @@ static inline __attribute_const__ unsigned long 
ffnz(unsigned long ul)
 #define RTHAL_TIMER_IPI IPIPE_HRTIMER_IPI
 #endif /* RTHAL_TIMER_IPI */
 
-#define RTHAL_TSC_INFO(p)  ((p)-arch_tsc)
+#define RTHAL_TSC_INFO(p)  ((p)-arch.tsc)
 
 #define RTHAL_SHARED_HEAP_FLAGS (cache_is_vivt() ? XNHEAP_GFP_NONCACHED : 0)
 
@@ -219,7 +219,7 @@ static inline void rthal_init_fpu(rthal_fpenv_t *fpuenv)
 #ifdef CONFIG_VFP
 asmlinkage void rthal_vfp_save(union vfp_state *vfp, unsigned fpexc);
 
-asmlinkage void rthal_vfp_load(union vfp_state *vfp);
+asmlinkage void rthal_vfp_load(union vfp_state *vfp, unsigned cpu);
 
 static inline void rthal_save_fpu(rthal_fpenv_t *fpuenv, unsigned fpexc)
 {
@@ -228,7 +228,7 @@ static inline void rthal_save_fpu(rthal_fpenv_t *fpuenv, 
unsigned fpexc)
 
 static inline void rthal_restore_fpu(rthal_fpenv_t *fpuenv)
 {
-   rthal_vfp_load(fpuenv-vfpstate);
+   rthal_vfp_load(fpuenv-vfpstate, ipipe_processor_id());
 }
 
 #define rthal_vfp_fmrx(_vfp_) ({   \
@@ -244,10 +244,12 @@ static inline void rthal_restore_fpu(rthal_fpenv_t 
*fpuenv)
 , cr0, 0 @ fmxr  #_vfp_ , %0:  \
 /* */ : r (_var_))
 
-extern union vfp_state *last_VFP_context[NR_CPUS];
+extern union vfp_state *vfp_current_hw_state[NR_CPUS];
+
 static inline rthal_fpenv_t *rthal_get_fpu_owner(void)
 {
union vfp_state *vfp_owner;
+   unsigned cpu;
 #ifdef CONFIG_SMP
unsigned fpexc;
 
@@ -256,10 +258,16 @@ static inline rthal_fpenv_t *rthal_get_fpu_owner(void)
return NULL;
 #endif
 
-   vfp_owner = last_VFP_context[ipipe_processor_id()];
+   cpu = ipipe_processor_id();
+   vfp_owner = vfp_current_hw_state[cpu];
if (!vfp_owner)
return NULL;
 
+#if LINUX_VERSION_CODE = KERNEL_VERSION(3, 2, 0)  defined(CONFIG_SMP)
+   if (vfp_owner-hard.cpu != cpu)
+   return NULL;
+#endif /* linux = 3.2.0 */
+
return container_of(vfp_owner, rthal_fpenv_t, vfpstate);
 }
 
@@ -324,4 +332,3 @@ static const char *const rthal_fault_labels[] = {
 #endif /* !_XENO_ASM_ARM_HAL_H */
 
 // vim: ts=4 et sw=4 sts=4
-indent-reg
diff --git a/kernel/cobalt/arch/arm/hal.c b/kernel/cobalt/arch/arm/hal.c
index 3b20f66..8ed802c 100644
--- a/kernel/cobalt/arch/arm/hal.c
+++ b/kernel/cobalt/arch/arm/hal.c
@@ -164,7 

[Xenomai-git] Jan Kiszka : build: fix for relative invocations of configure

2012-02-20 Thread GIT version control
Module: xenomai-forge
Branch: master
Commit: bce342470b2ed9aa3a713803318f8aa3d5f0290d
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=bce342470b2ed9aa3a713803318f8aa3d5f0290d

Author: Jan Kiszka jan.kis...@siemens.com
Date:   Tue Feb  7 16:43:38 2012 +0100

build: fix for relative invocations of configure

This fixes build setups like '../configure'.

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

---

 configure.in |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/configure.in b/configure.in
index c0a7d17..0bdced8 100644
--- a/configure.in
+++ b/configure.in
@@ -547,7 +547,7 @@ LD_FILE_OPTION=$ac_cv_ld_file_option
 AC_SUBST(LD_FILE_OPTION)
 
 if test x$rtcore_type = xcobalt; then
-   XENO_USER_CFLAGS=-I$srcdir/include/cobalt $XENO_USER_CFLAGS
+   XENO_USER_CFLAGS=-I`cd $srcdir  pwd`/include/cobalt $XENO_USER_CFLAGS
if [[ $ac_cv_ld_file_option = yes ]]; then
XENO_POSIX_WRAPPERS=-Wl,@`cd $srcdir  pwd`/lib/cobalt/posix.wrappers
else


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


[Xenomai-git] Philippe Gerum : doc: add basic css and pictures for stylesheet

2012-02-20 Thread GIT version control
Module: xenomai-forge
Branch: master
Commit: 3365d2bfe27dad0402d82d81708c8d3102ab91eb
URL:
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=3365d2bfe27dad0402d82d81708c8d3102ab91eb

Author: Philippe Gerum r...@xenomai.org
Date:   Mon Feb 20 19:07:20 2012 +0100

doc: add basic css and pictures for stylesheet

---

 doc/generated/html/css/xenomai.css |  200 
 doc/generated/html/pictures/1.png  |  Bin 0 - 329 bytes
 doc/generated/html/pictures/2.png  |  Bin 0 - 353 bytes
 doc/generated/html/pictures/3.png  |  Bin 0 - 350 bytes
 doc/generated/html/pictures/4.png  |  Bin 0 - 345 bytes
 doc/generated/html/pictures/5.png  |  Bin 0 - 348 bytes
 doc/generated/html/pictures/6.png  |  Bin 0 - 355 bytes
 doc/generated/html/pictures/7.png  |  Bin 0 - 344 bytes
 doc/generated/html/pictures/8.png  |  Bin 0 - 357 bytes
 doc/generated/html/pictures/home.gif   |  Bin 0 - 890 bytes
 doc/generated/html/pictures/next.gif   |  Bin 0 - 881 bytes
 doc/generated/html/pictures/note.png   |  Bin 0 - 3475 bytes
 doc/generated/html/pictures/prev.gif   |  Bin 0 - 861 bytes
 doc/generated/html/pictures/up.gif |  Bin 0 - 3476 bytes
 doc/generated/html/pictures/w3_css2.png|  Bin 0 - 389 bytes
 doc/generated/html/pictures/w3_xhtml11.png |  Bin 0 - 396 bytes
 16 files changed, 200 insertions(+), 0 deletions(-)

diff --git a/doc/generated/html/css/xenomai.css 
b/doc/generated/html/css/xenomai.css
new file mode 100644
index 000..aedf9b4
--- /dev/null
+++ b/doc/generated/html/css/xenomai.css
@@ -0,0 +1,200 @@
+pre.programlisting {
+   background-color: #F4F4F4;
+   padding: 6px;
+}
+
+p.releaseinfo { 
+color: black;
+font-style: oblique;
+text-align: center;
+}
+
+p { 
+text-align: justify;
+}
+
+table {
+   border: 1px;
+}
+table pre.programlisting {
+   background-color: #FF;
+}
+
+div.article div.titlepage {
+   border-top: 3px solid #7F9DD1;
+   border-left: 3px solid #A4B7D5;
+   border-right: 3px solid #A4B7D5;
+   border-bottom: 3px solid #A4B7D5;
+   background-color: #EBF2FA;
+color: #1E438D;
+   padding-left: 12px;
+   padding-right: 12px;
+text-align: justify;
+}
+
+div.article div.sect1 div.titlepage {
+   border-top: none;
+   border-left: 3px solid white;
+   border-right: 3px solid white;
+   border-bottom: none;
+   font-family: Tahoma, Arial, Helvetica, sans-serif;
+   font-weight: bold;
+   padding-left: 12px;
+padding-right: 12px;
+color: white;
+background-color: #0B307B;
+}
+
+div.article div.abstract {
+   color: #0B152B;
+}
+
+table.copyright {
+   font-style: italic;
+   font-size: 11;
+   padding-top: 8px;
+   padding-left: 8px;
+   padding-right: 8px;
+   padding-bottom: 8px;
+   background-color: #EBF2FA;
+}
+
+.navheader {
+   font-family: Tahoma, Arial, Helvetica, sans-serif;
+   background-color: #EBF2FA;
+   font-size: 12;
+}
+
+.navfooter {
+   font-family: Tahoma, Ariel, Helvetica, sans-serif;
+   font-size: 12;
+}
+
+div.toc span.part {
+   font-family: Tahoma, Ariel, Helvetica, sans-serif;
+   font-weight: bold;
+   font-size: 20;
+   margin-top: 1in;
+}
+div.toc span.glossary {
+   font-weight: bold;
+}
+div.toc span.index {
+   font-weight: bold;
+}
+div.toc span.preface {
+   font-weight: bold;
+}
+div.toc span.appendix {
+   font-weight: bold;
+}
+div.toc span.chapter {
+   font-weight: bold;
+}
+
+
+h1, h4 {
+   font-family: Tahoma, Ariel, Helvetica, sans-serif;
+   font-weight: bold;
+}
+
+h2 {
+   font-family: Tahoma, Ariel, Helvetica, sans-serif;
+   font-weight: bold;
+margin-top: 3px;
+margin-bottom: 3px;
+}
+
+div.article div.sect2 div.titlepage {
+   font-family: Tahoma, Ariel, Helvetica, sans-serif;
+   font-weight: bold;
+color: #003366;
+   border-top: none;
+padding-left: 0px;
+padding-bottom: 0px;
+   background-color: white;
+}
+
+div.article div.sect2 div.titlepage h3 {
+border-bottom-style: solid;
+padding-bottom: 0px;
+}
+
+
+div.article div.titlepage h1.title {
+   font-family: Tahoma, Ariel, Helvetica, sans-serif;
+   font-weight: bold;
+font-size: 36;
+text-align: center;
+}
+
+div.article div.titlepage h3.author {
+   font-family: Tahoma, Ariel, Helvetica, sans-serif;
+   font-weight: bold;
+   font-size: 24;
+text-align: center;
+color: #5A9BC1;
+}
+
+div.article div.titlepage h3.corpauthor {
+   font-family: Tahoma, Ariel, Helvetica, sans-serif;
+   font-weight: bold;
+   font-size: 18;
+text-align: center;
+color: #1E438D;
+}
+
+
+div.article div.titlepage p.edition {
+   font-family: Tahoma, Ariel, Helvetica, sans-serif;
+   color: 

[Xenomai-git] Gilles Chanteperdrix : arm: add suppport for spear6xx

2012-02-18 Thread GIT version control
Module: xenomai-2.6
Branch: master
Commit: 305aaf9095704be6c3ab03c8467f80cd112471bb
URL:
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=305aaf9095704be6c3ab03c8467f80cd112471bb

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Sat Feb 18 15:06:34 2012 +0100

arm: add suppport for spear6xx

---

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

diff --git a/include/asm-arm/hal.h b/include/asm-arm/hal.h
index a8950b4..1d33079 100644
--- a/include/asm-arm/hal.h
+++ b/include/asm-arm/hal.h
@@ -87,6 +87,9 @@
 #elif defined(CONFIG_SMP)  defined(CONFIG_HAVE_ARM_TWD)
 #define RTHAL_TIMER_DEVICE local_timer
 #define RTHAL_CLOCK_DEVICE global_timer
+#elif defined(CONFIG_PLAT_SPEAR)
+#define RTHAL_TIMER_DEVICE  tmr0
+#define RTHAL_CLOCK_DEVICE tmr1
 #else
 #error Unsupported ARM machine
 #endif /* CONFIG_ARCH_SA1100 */


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


[Xenomai-git] Gilles Chanteperdrix : arm: forcibly select unlocked context switches when SMP is enabled

2012-02-14 Thread GIT version control
Module: xenomai-2.6
Branch: master
Commit: 0ea6d386ac43cc98a6f3f7851ff5e59ca574613b
URL:
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=0ea6d386ac43cc98a6f3f7851ff5e59ca574613b

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Tue Feb 14 21:56:29 2012 +0100

arm: forcibly select unlocked context switches when SMP is enabled

---

 ksrc/arch/arm/Kconfig |   13 +
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/ksrc/arch/arm/Kconfig b/ksrc/arch/arm/Kconfig
index deee854..25ee469 100644
--- a/ksrc/arch/arm/Kconfig
+++ b/ksrc/arch/arm/Kconfig
@@ -18,8 +18,13 @@ depends on XENO_OPT_NUCLEUS
 
 config IPIPE_WANT_PREEMPTIBLE_SWITCH
bool
-   default y if (XENO_HW_UNLOCKED_SWITCH || SMP)
-   default n if !XENO_HW_UNLOCKED_SWITCH  !SMP
+   default y if XENO_HW_UNLOCKED_SWITCH
+   default n if !XENO_HW_UNLOCKED_SWITCH
+
+config SELECT_HW_UNLOCKED_SWITCH_ON_SMP
+   bool
+   select XENO_HW_UNLOCKED_SWITCH
+   default y if SMP
 
 config XENO_HW_FPU
bool Enable FPU support
@@ -42,8 +47,8 @@ config XENO_HW_UNLOCKED_SWITCH
and/or local interrupts may execute concurrently.
 
This option reduces interrupt latency when costly cache and
-   TLB flushes are required to switch context, and may improve
-   concurrency on some SMP/multi-core systems as well.
+   TLB flushes are required to switch context, and is mandatory
+   on SMP/multi-core systems.
 
You definitely want to enable that option on embedded ARM
platforms.


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


[Xenomai-git] Jan Kiszka : Re-apply 2dc4288baba1bb701aeb61c44f12a2115b0aef77

2012-02-14 Thread GIT version control
Module: xenomai-2.6
Branch: master
Commit: 1af5e87eccd0a406c876031780f840e14e993998
URL:
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=1af5e87eccd0a406c876031780f840e14e993998

Author: Jan Kiszka jan.kis...@siemens.com
Date:   Fri Feb  3 15:50:42 2012 +0100

Re-apply 2dc4288baba1bb701aeb61c44f12a2115b0aef77

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

---

 configure.in |   12 ++--
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/configure.in b/configure.in
index b2563ee..2185925 100644
--- a/configure.in
+++ b/configure.in
@@ -448,13 +448,13 @@ else
 fi
 AC_MSG_RESULT([done])
 
-dnl Common CFLAGS and LDFLAGS
-XENO_USER_CFLAGS=-D_GNU_SOURCE -D_REENTRANT -Wall 
-Werror-implicit-function-declaration -pipe
-XENO_USER_LDFLAGS=
+dnl Exported CFLAGS and LDFLAGS, shared with internal flags
+XENO_USER_APP_CFLAGS=-D_GNU_SOURCE -D_REENTRANT
+XENO_USER_APP_LDFLAGS=
 
-dnl Exported CFLAGS and LDFLAGS, may be enhanced per-arch below
-XENO_USER_APP_CFLAGS=$XENO_USER_CFLAGS
-XENO_USER_APP_LDFLAGS=$XENO_USER_LDFLAGS
+dnl Internal CFLAGS and LDFLAGS, may be enhanced per-arch below
+XENO_USER_CFLAGS=$XENO_USER_CFLAGS -Wall 
-Werror-implicit-function-declaration -pipe
+XENO_USER_LDFLAGS=$XENO_USER_APP_LDFLAGS
 
 case $XENO_TARGET_ARCH in
  x86)


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


[Xenomai-git] Gilles Chanteperdrix : arm: adapt to ipipe core 3.2

2012-02-14 Thread GIT version control
Module: xenomai-2.6
Branch: master
Commit: f24bd1596380fac1421290e538debbb55eb0b3c3
URL:
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=f24bd1596380fac1421290e538debbb55eb0b3c3

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Tue Feb 14 21:55:09 2012 +0100

arm: adapt to ipipe core 3.2

---

 include/asm-arm/atomic.h   |1 +
 include/asm-arm/bits/pod.h |   10 +++---
 include/asm-arm/hal.h  |   32 
 include/asm-arm/wrappers.h |6 +-
 ksrc/arch/arm/hal.c|2 +-
 ksrc/arch/arm/switch.S |4 
 6 files changed, 38 insertions(+), 17 deletions(-)

diff --git a/include/asm-arm/atomic.h b/include/asm-arm/atomic.h
index 0345b09..5d55ae8 100644
--- a/include/asm-arm/atomic.h
+++ b/include/asm-arm/atomic.h
@@ -244,6 +244,7 @@ static inline int 
xnarch_atomic_dec_and_test(xnarch_atomic_t *v)
 #include linux/bitops.h
 #include asm/atomic.h
 #include asm/system.h
+#include asm/xenomai/hal.h
 
 static inline void
 xnarch_atomic_set_mask(unsigned long *addr, unsigned long mask)
diff --git a/include/asm-arm/bits/pod.h b/include/asm-arm/bits/pod.h
index bd7ff46..0fd9aba 100644
--- a/include/asm-arm/bits/pod.h
+++ b/include/asm-arm/bits/pod.h
@@ -146,6 +146,7 @@ static inline void xnarch_enable_fpu(xnarchtcb_t *tcb)
*/
} else if (tcb-fpup  tcb-fpup == rthal_task_fpenv(tcb-user_task)) {
unsigned fpexc = rthal_enable_fpu();
+   unsigned cpu;
 #ifndef CONFIG_SMP
if (likely(!(fpexc  RTHAL_VFP_ANY_EXC)
!(rthal_vfp_fmrx(FPSCR)  FPSCR_IXE)))
@@ -165,7 +166,9 @@ static inline void xnarch_enable_fpu(xnarchtcb_t *tcb)
   systems for still unknown reasons.
*/
rthal_save_fpu(tcb-fpup, fpexc);
-   last_VFP_context[rthal_processor_id()] = NULL;
+
+   cpu = rthal_processor_id();
+   vfp_current_hw_state[cpu] = NULL;
rthal_disable_fpu();
}
 #else /* !CONFIG_VFP */
@@ -221,12 +224,13 @@ static inline void xnarch_restore_fpu(xnarchtcb_t * tcb)
   the newly switched thread uses the FPU, to allow the kernel handler
   to pick the correct FPU context.
 
-  Further set last_VFP_context to NULL to avoid the Linux kernel to
+  Further set vfp_current_hw_state to NULL to avoid the Linux kernel to
   save, when the fault occur, the current FPU context, the one of an RT
   task, into the FPU area of the last non RT task which used the FPU
   before the preemption by Xenomai.
*/
-   last_VFP_context[rthal_processor_id()] = NULL;
+   unsigned cpu = rthal_processor_id();
+   vfp_current_hw_state[cpu] = NULL;
rthal_disable_fpu();
}
 #else /* !CONFIG_VFP */
diff --git a/include/asm-arm/hal.h b/include/asm-arm/hal.h
index a7dbd1b..a8950b4 100644
--- a/include/asm-arm/hal.h
+++ b/include/asm-arm/hal.h
@@ -155,7 +155,9 @@ static inline __attribute_const__ unsigned long ffnz 
(unsigned long ul)
 #define RTHAL_TIMER_IPI RTHAL_HRTIMER_IPI
 #endif /* RTHAL_TIMER_IPI */
 
-#ifdef __IPIPE_FEATURE_SYSINFO_V2
+#ifdef CONFIG_IPIPE_CORE
+#define RTHAL_TSC_INFO(p)  ((p)-arch.tsc)
+#elif defined(__IPIPE_FEATURE_SYSINFO_V2)
 #define RTHAL_TSC_INFO(p)  ((p)-arch_tsc)
 #else
 #define RTHAL_TSC_INFO(p)  ((p)-archdep.tsc)
@@ -192,15 +194,13 @@ static inline void rthal_timer_program_shot (unsigned 
long delay)
 
 static inline struct mm_struct *rthal_get_active_mm(void)
 {
-#ifdef TIF_MMSWITCH_INT
-#ifdef CONFIG_IPIPE_CORE
+#if !defined(TIF_MMSWITCH_INT) || !defined(CONFIG_XENO_HW_UNLOCKED_SWITCH)
+   return current-active_mm;
+#elif defined(CONFIG_IPIPE_CORE)
return __this_cpu_read(ipipe_percpu.active_mm);
-#else
+#else /* !CONFIG_IPIPE_CORE */
return per_cpu(ipipe_active_mm, smp_processor_id());
-#endif
-#else /* !TIF_MMSWITCH_INT */
-   return current-active_mm;
-#endif /* !TIF_MMSWITCH_INT */
+#endif /* !CONFIG_IPIPE_CORE */
 }
 
 /* Private interface -- Internal use only */
@@ -249,7 +249,7 @@ static inline void rthal_init_fpu(rthal_fpenv_t *fpuenv)
 #ifdef CONFIG_VFP
 asmlinkage void rthal_vfp_save(union vfp_state *vfp, unsigned fpexc);
 
-asmlinkage void rthal_vfp_load(union vfp_state *vfp);
+asmlinkage void rthal_vfp_load(union vfp_state *vfp, unsigned cpu);
 
 static inline void rthal_save_fpu(rthal_fpenv_t *fpuenv, unsigned fpexc)
 {
@@ -258,7 +258,7 @@ static inline void rthal_save_fpu(rthal_fpenv_t *fpuenv, 
unsigned fpexc)
 
 static inline void rthal_restore_fpu(rthal_fpenv_t *fpuenv)
 {
-rthal_vfp_load(fpuenv-vfpstate);
+rthal_vfp_load(fpuenv-vfpstate, rthal_processor_id());
 }
 
 #define rthal_vfp_fmrx(_vfp_) ({   \
@@ -274,10 +274,12 @@ static inline void rthal_restore_fpu(rthal_fpenv_t 
*fpuenv)
 , cr0, 0 @ fmxr  #_vfp_ , %0:  \
 /* */ : r 

[Xenomai-git] Gilles Chanteperdrix : arm: optimize tsc emulation

2012-02-14 Thread GIT version control
Module: xenomai-2.6
Branch: master
Commit: 0e502a44172c8729514db3c6b0ec575a73d885bd
URL:
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=0e502a44172c8729514db3c6b0ec575a73d885bd

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Tue Feb 14 21:59:33 2012 +0100

arm: optimize tsc emulation

---

 include/asm-arm/bits/bind.h   |   19 ---
 include/asm-arm/syscall.h |   16 +---
 src/testsuite/regression/native/tsc.c |2 +-
 3 files changed, 22 insertions(+), 15 deletions(-)

diff --git a/include/asm-arm/bits/bind.h b/include/asm-arm/bits/bind.h
index 78f0f68..59c4534 100644
--- a/include/asm-arm/bits/bind.h
+++ b/include/asm-arm/bits/bind.h
@@ -13,8 +13,10 @@
 #include asm-generic/xenomai/bits/bind.h
 #include asm/xenomai/syscall.h
 
-__attribute__((weak)) struct __xn_tscinfo __xn_tscinfo = {
-  type: -1
+struct __xn_full_tscinfo __xn_tscinfo = {
+   .kinfo = {
+   .type = -1,
+   },
 };
 
 static inline void xeno_arm_features_check(struct xnfeatinfo *finfo)
@@ -25,7 +27,7 @@ static inline void xeno_arm_features_check(struct xnfeatinfo 
*finfo)
int err, fd;
void *addr;
 
-   if (__xn_tscinfo.type != -1)
+   if (__xn_tscinfo.kinfo.type != -1)
return;
 
err = XENOMAI_SYSCALL2(__xn_sys_arch,
@@ -41,12 +43,15 @@ static inline void xeno_arm_features_check(struct 
xnfeatinfo *finfo)
 
page_size = sysconf(_SC_PAGESIZE);
 
-   switch(__xn_tscinfo.type) {
+   switch(__xn_tscinfo.kinfo.type) {
 #if CONFIG_XENO_ARM_TSC_TYPE == __XN_TSC_TYPE_KUSER
case __XN_TSC_TYPE_FREERUNNING:
case __XN_TSC_TYPE_FREERUNNING_COUNTDOWN:
case __XN_TSC_TYPE_FREERUNNING_FAST_WRAP:
case __XN_TSC_TYPE_DECREMENTER:
+   __xn_tscinfo.kuser_tsc_get = 
+   (rdtsc_t *)(0x1004 -
+   ((*(unsigned *)(0x0ffc) + 3)  5));
goto domap;
 
 #elif CONFIG_XENO_ARM_TSC_TYPE == __XN_TSC_TYPE_FREERUNNING\
@@ -55,7 +60,7 @@ static inline void xeno_arm_features_check(struct xnfeatinfo 
*finfo)
case __XN_TSC_TYPE_FREERUNNING:
case __XN_TSC_TYPE_FREERUNNING_COUNTDOWN:
 #if CONFIG_XENO_ARM_TSC_TYPE == __XN_TSC_TYPE_FREERUNNING_FAST_WRAP
-   if (__xn_tscinfo.mask = ((1  28) - 1)) {
+   if (__xn_tscinfo.kinfo.mask = ((1  28) - 1)) {
fprintf(stderr, Hardware tsc is not a fast wrapping
 one, select the correct platform, or fix\n
configure.in\n);
@@ -83,7 +88,7 @@ static inline void xeno_arm_features_check(struct xnfeatinfo 
*finfo)
}
 
   domap:
-   phys_addr = (unsigned long) __xn_tscinfo.counter;
+   phys_addr = (unsigned long) __xn_tscinfo.kinfo.counter;
 
addr = mmap(NULL, page_size, PROT_READ, MAP_SHARED,
fd, phys_addr  ~(page_size - 1));
@@ -92,7 +97,7 @@ static inline void xeno_arm_features_check(struct xnfeatinfo 
*finfo)
exit(EXIT_FAILURE);
}
 
-   __xn_tscinfo.counter =
+   __xn_tscinfo.kinfo.counter =
((volatile unsigned *)
 ((char *) addr + (phys_addr  (page_size - 1;
 
diff --git a/include/asm-arm/syscall.h b/include/asm-arm/syscall.h
index 2f45dda..5ca1bf0 100644
--- a/include/asm-arm/syscall.h
+++ b/include/asm-arm/syscall.h
@@ -241,18 +241,20 @@ struct __xn_tscinfo {
 };
 
 #ifndef __KERNEL__
-extern struct __xn_tscinfo __xn_tscinfo;
+/* Putting kuser_tsc_get and kinfo.counter in the same struct results
+   in less operations in PIC code, thus optimizes */
+typedef unsigned long long rdtsc_t(volatile unsigned *vaddr);
+struct __xn_full_tscinfo {
+   struct __xn_tscinfo kinfo;
+   rdtsc_t *kuser_tsc_get;
+};
+extern struct __xn_full_tscinfo __xn_tscinfo;
 
 #ifdef CONFIG_XENO_ARM_TSC_TYPE
 static inline unsigned long long __xn_rdtsc(void)
 {
 #if CONFIG_XENO_ARM_TSC_TYPE == __XN_TSC_TYPE_KUSER
-   typedef unsigned long long rdtsc_t(volatile unsigned *vaddr);
-   rdtsc_t *const kuser_tsc_get =
-   (rdtsc_t *)(0x1004 -
-   ((*(unsigned *)(0x0ffc) + 3)  5));
-
-   return kuser_tsc_get(__xn_tscinfo.counter);
+   return __xn_tscinfo.kuser_tsc_get(__xn_tscinfo.kinfo.counter);
 
 #elif CONFIG_XENO_ARM_TSC_TYPE == __XN_TSC_TYPE_FREERUNNING
volatile unsigned long long *const tscp = __xn_tscinfo.tsc;
diff --git a/src/testsuite/regression/native/tsc.c 
b/src/testsuite/regression/native/tsc.c
index cf6c357..225bce7 100644
--- a/src/testsuite/regression/native/tsc.c
+++ b/src/testsuite/regression/native/tsc.c
@@ -29,7 +29,7 @@ int main(int argc, const char *argv[])
 
 #ifdef __ARMEL__
if (argc == 2  !strcmp(argv[1], -w)) {
-   secs = (rt_timer_tsc2ns(__xn_tscinfo.mask + 1ULL) + 9) 
/ 10;
+   secs = 

[Xenomai-git] Jan Kiszka : Only export required CFLAGS via xeno-config

2012-02-07 Thread GIT version control
Module: xenomai-2.6
Branch: master
Commit: 2dc4288baba1bb701aeb61c44f12a2115b0aef77
URL:
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=2dc4288baba1bb701aeb61c44f12a2115b0aef77

Author: Jan Kiszka jan.kis...@siemens.com
Date:   Fri Feb  3 15:41:52 2012 +0100

Only export required CFLAGS via xeno-config

-Werror-implicit-function-declaration is not compatible with C++, and
also decisions about -Wall and -pipe should be left to the application.

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

---

 configure.in |   12 ++--
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/configure.in b/configure.in
index b2563ee..2185925 100644
--- a/configure.in
+++ b/configure.in
@@ -448,13 +448,13 @@ else
 fi
 AC_MSG_RESULT([done])
 
-dnl Common CFLAGS and LDFLAGS
-XENO_USER_CFLAGS=-D_GNU_SOURCE -D_REENTRANT -Wall 
-Werror-implicit-function-declaration -pipe
-XENO_USER_LDFLAGS=
+dnl Exported CFLAGS and LDFLAGS, shared with internal flags
+XENO_USER_APP_CFLAGS=-D_GNU_SOURCE -D_REENTRANT
+XENO_USER_APP_LDFLAGS=
 
-dnl Exported CFLAGS and LDFLAGS, may be enhanced per-arch below
-XENO_USER_APP_CFLAGS=$XENO_USER_CFLAGS
-XENO_USER_APP_LDFLAGS=$XENO_USER_LDFLAGS
+dnl Internal CFLAGS and LDFLAGS, may be enhanced per-arch below
+XENO_USER_CFLAGS=$XENO_USER_CFLAGS -Wall 
-Werror-implicit-function-declaration -pipe
+XENO_USER_LDFLAGS=$XENO_USER_APP_LDFLAGS
 
 case $XENO_TARGET_ARCH in
  x86)


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


[Xenomai-git] Gilles Chanteperdrix : testsuite: fix mq_select in the auto-shadowing case

2012-02-07 Thread GIT version control
Module: xenomai-2.6
Branch: master
Commit: 0d2e48a6fd11d251de1ae787ba6e3ddaf3345c97
URL:
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=0d2e48a6fd11d251de1ae787ba6e3ddaf3345c97

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Tue Feb  7 17:16:00 2012 +0100

testsuite: fix mq_select in the auto-shadowing case

shadowing the main thread in that case will fail, do not fail the test when
it happens.

---

 src/testsuite/regression/native+posix/mq_select.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/testsuite/regression/native+posix/mq_select.c 
b/src/testsuite/regression/native+posix/mq_select.c
index aabf77d..ee1806b 100644
--- a/src/testsuite/regression/native+posix/mq_select.c
+++ b/src/testsuite/regression/native+posix/mq_select.c
@@ -72,7 +72,7 @@ int main(void)
 
fprintf(stderr, Checking select service with posix message queues\n);
 
-   check_native(rt_task_shadow(main_tcb, NULL, 0, 0));
+   rt_task_shadow(main_tcb, NULL, 0, 0);
 
mq = mq_open(/select_test_mq, O_RDWR | O_CREAT | O_NONBLOCK, 0, NULL);
check_unix(mq == -1 ? -1 : 0);


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


[Xenomai-git] Gilles Chanteperdrix : Revert 2dc4288baba1bb701aeb61c44f12a2115b0aef77

2012-02-07 Thread GIT version control
Module: xenomai-2.6
Branch: master
Commit: 9a4eb2d1075f466b753838292a3181a763e2f37e
URL:
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=9a4eb2d1075f466b753838292a3181a763e2f37e

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Tue Feb  7 17:10:58 2012 +0100

Revert 2dc4288baba1bb701aeb61c44f12a2115b0aef77

It causes a build failure when cross-compiling (for ARM).

---

 configure|8 
 configure.in |   12 ++--
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/configure b/configure
index 8085c98..b38e32c 100755
--- a/configure
+++ b/configure
@@ -12444,11 +12444,11 @@ fi
 { $as_echo $as_me:${as_lineno-$LINENO}: result: done 5
 $as_echo done 6; }
 
-XENO_USER_APP_CFLAGS=-D_GNU_SOURCE -D_REENTRANT
-XENO_USER_APP_LDFLAGS=
+XENO_USER_CFLAGS=-D_GNU_SOURCE -D_REENTRANT -Wall 
-Werror-implicit-function-declaration -pipe
+XENO_USER_LDFLAGS=
 
-XENO_USER_CFLAGS=$XENO_USER_CFLAGS -Wall 
-Werror-implicit-function-declaration -pipe
-XENO_USER_LDFLAGS=$XENO_USER_APP_LDFLAGS
+XENO_USER_APP_CFLAGS=$XENO_USER_CFLAGS
+XENO_USER_APP_LDFLAGS=$XENO_USER_LDFLAGS
 
 case $XENO_TARGET_ARCH in
  x86)
diff --git a/configure.in b/configure.in
index 2185925..b2563ee 100644
--- a/configure.in
+++ b/configure.in
@@ -448,13 +448,13 @@ else
 fi
 AC_MSG_RESULT([done])
 
-dnl Exported CFLAGS and LDFLAGS, shared with internal flags
-XENO_USER_APP_CFLAGS=-D_GNU_SOURCE -D_REENTRANT
-XENO_USER_APP_LDFLAGS=
+dnl Common CFLAGS and LDFLAGS
+XENO_USER_CFLAGS=-D_GNU_SOURCE -D_REENTRANT -Wall 
-Werror-implicit-function-declaration -pipe
+XENO_USER_LDFLAGS=
 
-dnl Internal CFLAGS and LDFLAGS, may be enhanced per-arch below
-XENO_USER_CFLAGS=$XENO_USER_CFLAGS -Wall 
-Werror-implicit-function-declaration -pipe
-XENO_USER_LDFLAGS=$XENO_USER_APP_LDFLAGS
+dnl Exported CFLAGS and LDFLAGS, may be enhanced per-arch below
+XENO_USER_APP_CFLAGS=$XENO_USER_CFLAGS
+XENO_USER_APP_LDFLAGS=$XENO_USER_LDFLAGS
 
 case $XENO_TARGET_ARCH in
  x86)


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


[Xenomai-git] Gilles Chanteperdrix : Revert 7c601b91f218d05bf6c243469cc21c97ae2d237c

2012-02-07 Thread GIT version control
Module: xenomai-2.6
Branch: master
Commit: 66b0b726d239920c85c93f286242df345ce6e529
URL:
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=66b0b726d239920c85c93f286242df345ce6e529

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Tue Feb  7 17:06:51 2012 +0100

Revert 7c601b91f218d05bf6c243469cc21c97ae2d237c

It causes build failure when cross-compiling.

---

 configure |8 
 src/skins/native/Makefile.am  |3 ---
 src/skins/native/Makefile.in  |5 +
 src/skins/posix/Makefile.am   |3 ---
 src/skins/posix/Makefile.in   |5 +
 src/skins/psos+/Makefile.am   |3 ---
 src/skins/psos+/Makefile.in   |5 +
 src/skins/rtdm/Makefile.am|3 ---
 src/skins/rtdm/Makefile.in|5 +
 src/skins/uitron/Makefile.am  |3 ---
 src/skins/uitron/Makefile.in  |5 +
 src/skins/vrtx/Makefile.am|3 ---
 src/skins/vrtx/Makefile.in|5 +
 src/skins/vxworks/Makefile.am |3 ---
 src/skins/vxworks/Makefile.in |5 +
 15 files changed, 11 insertions(+), 53 deletions(-)

diff --git a/configure b/configure
index b38e32c..8085c98 100755
--- a/configure
+++ b/configure
@@ -12444,11 +12444,11 @@ fi
 { $as_echo $as_me:${as_lineno-$LINENO}: result: done 5
 $as_echo done 6; }
 
-XENO_USER_CFLAGS=-D_GNU_SOURCE -D_REENTRANT -Wall 
-Werror-implicit-function-declaration -pipe
-XENO_USER_LDFLAGS=
+XENO_USER_APP_CFLAGS=-D_GNU_SOURCE -D_REENTRANT
+XENO_USER_APP_LDFLAGS=
 
-XENO_USER_APP_CFLAGS=$XENO_USER_CFLAGS
-XENO_USER_APP_LDFLAGS=$XENO_USER_LDFLAGS
+XENO_USER_CFLAGS=$XENO_USER_CFLAGS -Wall 
-Werror-implicit-function-declaration -pipe
+XENO_USER_LDFLAGS=$XENO_USER_APP_LDFLAGS
 
 case $XENO_TARGET_ARCH in
  x86)
diff --git a/src/skins/native/Makefile.am b/src/skins/native/Makefile.am
index 4cc8859..39eaaed 100644
--- a/src/skins/native/Makefile.am
+++ b/src/skins/native/Makefile.am
@@ -22,9 +22,6 @@ libnative_la_SOURCES = \
wrappers.c \
wrappers.h
 
-libnative_la_LIBADD = \
-   ../common/libxenomai.la
-
 libnative_la_CPPFLAGS = \
@XENO_USER_CFLAGS@ \
-I$(top_srcdir)/include
diff --git a/src/skins/native/Makefile.in b/src/skins/native/Makefile.in
index e276edb..8779477 100644
--- a/src/skins/native/Makefile.in
+++ b/src/skins/native/Makefile.in
@@ -77,7 +77,7 @@ am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
 am__installdirs = $(DESTDIR)$(libdir) $(DESTDIR)$(pkgconfigdir)
 LTLIBRARIES = $(lib_LTLIBRARIES)
-libnative_la_DEPENDENCIES = ../common/libxenomai.la
+libnative_la_LIBADD =
 am_libnative_la_OBJECTS = libnative_la-alarm.lo libnative_la-buffer.lo \
libnative_la-cond.lo libnative_la-event.lo \
libnative_la-heap.lo libnative_la-init.lo libnative_la-intr.lo \
@@ -284,9 +284,6 @@ libnative_la_SOURCES = \
wrappers.c \
wrappers.h
 
-libnative_la_LIBADD = \
-   ../common/libxenomai.la
-
 libnative_la_CPPFLAGS = \
@XENO_USER_CFLAGS@ \
-I$(top_srcdir)/include
diff --git a/src/skins/posix/Makefile.am b/src/skins/posix/Makefile.am
index c22841b..6cbab00 100644
--- a/src/skins/posix/Makefile.am
+++ b/src/skins/posix/Makefile.am
@@ -27,9 +27,6 @@ libpthread_rt_la_SOURCES = \
printf.c \
wrappers.c
 
-libpthread_rt_la_LIBADD = \
-   ../common/libxenomai.la
-
 libpthread_rt_la_CPPFLAGS = \
@XENO_USER_CFLAGS@ \
-I$(top_srcdir)/include \
diff --git a/src/skins/posix/Makefile.in b/src/skins/posix/Makefile.in
index fb2ad3b..6427e62 100644
--- a/src/skins/posix/Makefile.in
+++ b/src/skins/posix/Makefile.in
@@ -77,7 +77,7 @@ am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
 am__installdirs = $(DESTDIR)$(libdir) $(DESTDIR)$(pkgconfigdir)
 LTLIBRARIES = $(lib_LTLIBRARIES)
-libpthread_rt_la_DEPENDENCIES = ../common/libxenomai.la
+libpthread_rt_la_LIBADD =
 am_libpthread_rt_la_OBJECTS = libpthread_rt_la-init.lo \
libpthread_rt_la-thread.lo libpthread_rt_la-timer.lo \
libpthread_rt_la-semaphore.lo libpthread_rt_la-clock.lo \
@@ -283,9 +283,6 @@ libpthread_rt_la_SOURCES = \
printf.c \
wrappers.c
 
-libpthread_rt_la_LIBADD = \
-   ../common/libxenomai.la
-
 libpthread_rt_la_CPPFLAGS = \
@XENO_USER_CFLAGS@ \
-I$(top_srcdir)/include \
diff --git a/src/skins/psos+/Makefile.am b/src/skins/psos+/Makefile.am
index ddd5c15..4d876a1 100644
--- a/src/skins/psos+/Makefile.am
+++ b/src/skins/psos+/Makefile.am
@@ -13,9 +13,6 @@ libpsos_la_SOURCES = \
task.c \
tm.c
 
-libpsos_la_LIBADD = \
-   ../common/libxenomai.la
-
 libpsos_la_CPPFLAGS = \
@XENO_USER_CFLAGS@ \
-I$(top_srcdir)/include
diff --git a/src/skins/psos+/Makefile.in b/src/skins/psos+/Makefile.in
index 09643b7..9f2bf58 100644
--- a/src/skins/psos+/Makefile.in
+++ b/src/skins/psos+/Makefile.in
@@ -77,7 +77,7 @@ am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
 am__installdirs = $(DESTDIR)$(libdir) $(DESTDIR)$(pkgconfigdir)
 LTLIBRARIES = $(lib_LTLIBRARIES)

[Xenomai-git] Jan Kiszka : Only export required CFLAGS via xeno-config

2012-02-03 Thread GIT version control
Module: xenomai-jki
Branch: for-upstream
Commit: 2dc4288baba1bb701aeb61c44f12a2115b0aef77
URL:
http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=2dc4288baba1bb701aeb61c44f12a2115b0aef77

Author: Jan Kiszka jan.kis...@siemens.com
Date:   Fri Feb  3 15:41:52 2012 +0100

Only export required CFLAGS via xeno-config

-Werror-implicit-function-declaration is not compatible with C++, and
also decisions about -Wall and -pipe should be left to the application.

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

---

 configure.in |   12 ++--
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/configure.in b/configure.in
index b2563ee..2185925 100644
--- a/configure.in
+++ b/configure.in
@@ -448,13 +448,13 @@ else
 fi
 AC_MSG_RESULT([done])
 
-dnl Common CFLAGS and LDFLAGS
-XENO_USER_CFLAGS=-D_GNU_SOURCE -D_REENTRANT -Wall 
-Werror-implicit-function-declaration -pipe
-XENO_USER_LDFLAGS=
+dnl Exported CFLAGS and LDFLAGS, shared with internal flags
+XENO_USER_APP_CFLAGS=-D_GNU_SOURCE -D_REENTRANT
+XENO_USER_APP_LDFLAGS=
 
-dnl Exported CFLAGS and LDFLAGS, may be enhanced per-arch below
-XENO_USER_APP_CFLAGS=$XENO_USER_CFLAGS
-XENO_USER_APP_LDFLAGS=$XENO_USER_LDFLAGS
+dnl Internal CFLAGS and LDFLAGS, may be enhanced per-arch below
+XENO_USER_CFLAGS=$XENO_USER_CFLAGS -Wall 
-Werror-implicit-function-declaration -pipe
+XENO_USER_LDFLAGS=$XENO_USER_APP_LDFLAGS
 
 case $XENO_TARGET_ARCH in
  x86)


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


[Xenomai-git] Jan Kiszka : mq_select: Fix for --enable-dlopen-skins

2012-02-03 Thread GIT version control
Module: xenomai-jki
Branch: for-upstream
Commit: b966dd735f2f2d8d5918426d96529d0b24dc0590
URL:
http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=b966dd735f2f2d8d5918426d96529d0b24dc0590

Author: Jan Kiszka jan.kis...@siemens.com
Date:   Fri Feb  3 16:40:52 2012 +0100

mq_select: Fix for --enable-dlopen-skins

If --enable-dlopen-skins is set, we won't be automatically shadowed.

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

---

 src/testsuite/regression/native+posix/mq_select.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/testsuite/regression/native+posix/mq_select.c 
b/src/testsuite/regression/native+posix/mq_select.c
index c4403bb..aabf77d 100644
--- a/src/testsuite/regression/native+posix/mq_select.c
+++ b/src/testsuite/regression/native+posix/mq_select.c
@@ -63,6 +63,7 @@ void task(void *cookie)
 
 int main(void)
 {
+   RT_TASK main_tcb;
RT_TASK tcb;
mqd_t mq;
int i;
@@ -71,6 +72,8 @@ int main(void)
 
fprintf(stderr, Checking select service with posix message queues\n);
 
+   check_native(rt_task_shadow(main_tcb, NULL, 0, 0));
+
mq = mq_open(/select_test_mq, O_RDWR | O_CREAT | O_NONBLOCK, 0, NULL);
check_unix(mq == -1 ? -1 : 0);
 


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


[Xenomai-git] Jan Kiszka : Add dependency of skin libraries on libxenomai

2012-02-01 Thread GIT version control
Module: xenomai-jki
Branch: for-upstream
Commit: a9017d966fb42be4dd467affcf0225d0b1c471cb
URL:
http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=a9017d966fb42be4dd467affcf0225d0b1c471cb

Author: Jan Kiszka jan.kis...@siemens.com
Date:   Wed Feb  1 17:07:45 2012 +0100

Add dependency of skin libraries on libxenomai

This will make sure that loading a skin library will automatically pull
in the mandatory libxenomai core library. However, we keep the output of
xeno-config untouched to enable static linking.

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

---

 src/skins/native/Makefile.am  |3 +++
 src/skins/posix/Makefile.am   |3 +++
 src/skins/psos+/Makefile.am   |3 +++
 src/skins/rtdm/Makefile.am|3 +++
 src/skins/uitron/Makefile.am  |3 +++
 src/skins/vrtx/Makefile.am|3 +++
 src/skins/vxworks/Makefile.am |3 +++
 7 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/src/skins/native/Makefile.am b/src/skins/native/Makefile.am
index 39eaaed..4cc8859 100644
--- a/src/skins/native/Makefile.am
+++ b/src/skins/native/Makefile.am
@@ -22,6 +22,9 @@ libnative_la_SOURCES = \
wrappers.c \
wrappers.h
 
+libnative_la_LIBADD = \
+   ../common/libxenomai.la
+
 libnative_la_CPPFLAGS = \
@XENO_USER_CFLAGS@ \
-I$(top_srcdir)/include
diff --git a/src/skins/posix/Makefile.am b/src/skins/posix/Makefile.am
index 6cbab00..c22841b 100644
--- a/src/skins/posix/Makefile.am
+++ b/src/skins/posix/Makefile.am
@@ -27,6 +27,9 @@ libpthread_rt_la_SOURCES = \
printf.c \
wrappers.c
 
+libpthread_rt_la_LIBADD = \
+   ../common/libxenomai.la
+
 libpthread_rt_la_CPPFLAGS = \
@XENO_USER_CFLAGS@ \
-I$(top_srcdir)/include \
diff --git a/src/skins/psos+/Makefile.am b/src/skins/psos+/Makefile.am
index 4d876a1..ddd5c15 100644
--- a/src/skins/psos+/Makefile.am
+++ b/src/skins/psos+/Makefile.am
@@ -13,6 +13,9 @@ libpsos_la_SOURCES = \
task.c \
tm.c
 
+libpsos_la_LIBADD = \
+   ../common/libxenomai.la
+
 libpsos_la_CPPFLAGS = \
@XENO_USER_CFLAGS@ \
-I$(top_srcdir)/include
diff --git a/src/skins/rtdm/Makefile.am b/src/skins/rtdm/Makefile.am
index 8ad74be..2dc0a90 100644
--- a/src/skins/rtdm/Makefile.am
+++ b/src/skins/rtdm/Makefile.am
@@ -8,6 +8,9 @@ librtdm_la_SOURCES = \
core.c \
init.c
 
+librtdm_la_LIBADD = \
+   ../common/libxenomai.la
+
 librtdm_la_CPPFLAGS = \
@XENO_USER_CFLAGS@ \
-I$(top_srcdir)/include
diff --git a/src/skins/uitron/Makefile.am b/src/skins/uitron/Makefile.am
index 52f5896..a66b51b 100644
--- a/src/skins/uitron/Makefile.am
+++ b/src/skins/uitron/Makefile.am
@@ -11,6 +11,9 @@ libuitron_la_SOURCES = \
sem.c \
task.c
 
+libuitron_la_LIBADD = \
+   ../common/libxenomai.la
+
 libuitron_la_CPPFLAGS = \
@XENO_USER_CFLAGS@ \
-I$(top_srcdir)/include
diff --git a/src/skins/vrtx/Makefile.am b/src/skins/vrtx/Makefile.am
index 9533cdf..0d6c2d8 100644
--- a/src/skins/vrtx/Makefile.am
+++ b/src/skins/vrtx/Makefile.am
@@ -18,6 +18,9 @@ libvrtx_la_SOURCES = \
wrappers.c \
wrappers.h
 
+libvrtx_la_LIBADD = \
+   ../common/libxenomai.la
+
 libvrtx_la_CPPFLAGS = \
@XENO_USER_CFLAGS@ \
-I$(top_srcdir)/include
diff --git a/src/skins/vxworks/Makefile.am b/src/skins/vxworks/Makefile.am
index 9ecef03..766bf6f 100644
--- a/src/skins/vxworks/Makefile.am
+++ b/src/skins/vxworks/Makefile.am
@@ -19,6 +19,9 @@ libvxworks_la_SOURCES = \
wrappers.c \
wrappers.h
 
+libvxworks_la_LIBADD = \
+   ../common/libxenomai.la
+
 libvxworks_la_CPPFLAGS = \
@XENO_USER_CFLAGS@ \
-I$(top_srcdir)/include


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


[Xenomai-git] Gilles Chanteperdrix : posix: use wrap-link.sh to link posix tests

2012-02-01 Thread GIT version control
Module: xenomai-2.6
Branch: master
Commit: ae2cb7b33434359c0b0991963b41f397abd19e17
URL:
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=ae2cb7b33434359c0b0991963b41f397abd19e17

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Wed Feb  1 21:00:45 2012 +0100

posix: use wrap-link.sh to link posix tests

Fixes the build of testsuite with static libraries.

---

 src/testsuite/regression/native+posix/Makefile.am |2 ++
 src/testsuite/regression/native+posix/Makefile.in |2 +-
 src/testsuite/regression/posix/Makefile.am|2 ++
 src/testsuite/regression/posix/Makefile.in|2 +-
 4 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/testsuite/regression/native+posix/Makefile.am 
b/src/testsuite/regression/native+posix/Makefile.am
index 385bb7d..3048db9 100644
--- a/src/testsuite/regression/native+posix/Makefile.am
+++ b/src/testsuite/regression/native+posix/Makefile.am
@@ -1,5 +1,7 @@
 tstdir = @XENO_TEST_DIR@/regression/native+posix
 
+CCLD = $(top_srcdir)/scripts/wrap-link.sh $(CC)
+
 tst_PROGRAMS = mq_select
 
 INCLUDES = -I$(srcdir)/..
diff --git a/src/testsuite/regression/native+posix/Makefile.in 
b/src/testsuite/regression/native+posix/Makefile.in
index 1fa8794..b63bffe 100644
--- a/src/testsuite/regression/native+posix/Makefile.in
+++ b/src/testsuite/regression/native+posix/Makefile.in
@@ -71,7 +71,6 @@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) 
$(AM_CPPFLAGS) \
 LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
 LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
@@ -238,6 +237,7 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 tstdir = @XENO_TEST_DIR@/regression/native+posix
+CCLD = $(top_srcdir)/scripts/wrap-link.sh $(CC)
 INCLUDES = -I$(srcdir)/..
 LDADD = \
../../../skins/native/libnative.la \
diff --git a/src/testsuite/regression/posix/Makefile.am 
b/src/testsuite/regression/posix/Makefile.am
index c397afd..26bc8f2 100644
--- a/src/testsuite/regression/posix/Makefile.am
+++ b/src/testsuite/regression/posix/Makefile.am
@@ -2,6 +2,8 @@ tstdir = @XENO_TEST_DIR@/regression/posix
 
 noinst_HEADERS = check.h
 
+CCLD = $(top_srcdir)/scripts/wrap-link.sh $(CC)
+
 tst_PROGRAMS = leaks shm
 
 CPPFLAGS = $(XENO_USER_CFLAGS) \
diff --git a/src/testsuite/regression/posix/Makefile.in 
b/src/testsuite/regression/posix/Makefile.in
index 747a0a3..ff424e2 100644
--- a/src/testsuite/regression/posix/Makefile.in
+++ b/src/testsuite/regression/posix/Makefile.in
@@ -76,7 +76,6 @@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) 
$(AM_CPPFLAGS) \
 LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
 LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
@@ -245,6 +244,7 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 tstdir = @XENO_TEST_DIR@/regression/posix
 noinst_HEADERS = check.h
+CCLD = $(top_srcdir)/scripts/wrap-link.sh $(CC)
 LDADD = \
../../../skins/posix/libpthread_rt.la \
../../../skins/common/libxenomai.la \


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


[Xenomai-git] Gilles Chanteperdrix : bootstrap

2012-02-01 Thread GIT version control
Module: xenomai-2.6
Branch: master
Commit: 3798c7d397adcfee26ad7e9d792227dedb765e14
URL:
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=3798c7d397adcfee26ad7e9d792227dedb765e14

Author: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Date:   Wed Feb  1 21:16:28 2012 +0100

bootstrap

---

 src/skins/native/Makefile.in  |5 -
 src/skins/posix/Makefile.in   |5 -
 src/skins/psos+/Makefile.in   |5 -
 src/skins/rtdm/Makefile.in|5 -
 src/skins/uitron/Makefile.in  |5 -
 src/skins/vrtx/Makefile.in|5 -
 src/skins/vxworks/Makefile.in |5 -
 7 files changed, 28 insertions(+), 7 deletions(-)

diff --git a/src/skins/native/Makefile.in b/src/skins/native/Makefile.in
index 8779477..e276edb 100644
--- a/src/skins/native/Makefile.in
+++ b/src/skins/native/Makefile.in
@@ -77,7 +77,7 @@ am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
 am__installdirs = $(DESTDIR)$(libdir) $(DESTDIR)$(pkgconfigdir)
 LTLIBRARIES = $(lib_LTLIBRARIES)
-libnative_la_LIBADD =
+libnative_la_DEPENDENCIES = ../common/libxenomai.la
 am_libnative_la_OBJECTS = libnative_la-alarm.lo libnative_la-buffer.lo \
libnative_la-cond.lo libnative_la-event.lo \
libnative_la-heap.lo libnative_la-init.lo libnative_la-intr.lo \
@@ -284,6 +284,9 @@ libnative_la_SOURCES = \
wrappers.c \
wrappers.h
 
+libnative_la_LIBADD = \
+   ../common/libxenomai.la
+
 libnative_la_CPPFLAGS = \
@XENO_USER_CFLAGS@ \
-I$(top_srcdir)/include
diff --git a/src/skins/posix/Makefile.in b/src/skins/posix/Makefile.in
index 6427e62..fb2ad3b 100644
--- a/src/skins/posix/Makefile.in
+++ b/src/skins/posix/Makefile.in
@@ -77,7 +77,7 @@ am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
 am__installdirs = $(DESTDIR)$(libdir) $(DESTDIR)$(pkgconfigdir)
 LTLIBRARIES = $(lib_LTLIBRARIES)
-libpthread_rt_la_LIBADD =
+libpthread_rt_la_DEPENDENCIES = ../common/libxenomai.la
 am_libpthread_rt_la_OBJECTS = libpthread_rt_la-init.lo \
libpthread_rt_la-thread.lo libpthread_rt_la-timer.lo \
libpthread_rt_la-semaphore.lo libpthread_rt_la-clock.lo \
@@ -283,6 +283,9 @@ libpthread_rt_la_SOURCES = \
printf.c \
wrappers.c
 
+libpthread_rt_la_LIBADD = \
+   ../common/libxenomai.la
+
 libpthread_rt_la_CPPFLAGS = \
@XENO_USER_CFLAGS@ \
-I$(top_srcdir)/include \
diff --git a/src/skins/psos+/Makefile.in b/src/skins/psos+/Makefile.in
index 9f2bf58..09643b7 100644
--- a/src/skins/psos+/Makefile.in
+++ b/src/skins/psos+/Makefile.in
@@ -77,7 +77,7 @@ am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
 am__installdirs = $(DESTDIR)$(libdir) $(DESTDIR)$(pkgconfigdir)
 LTLIBRARIES = $(lib_LTLIBRARIES)
-libpsos_la_LIBADD =
+libpsos_la_DEPENDENCIES = ../common/libxenomai.la
 am_libpsos_la_OBJECTS = libpsos_la-asr.lo libpsos_la-init.lo \
libpsos_la-queue.lo libpsos_la-rn.lo libpsos_la-sem.lo \
libpsos_la-task.lo libpsos_la-tm.lo
@@ -271,6 +271,9 @@ libpsos_la_SOURCES = \
task.c \
tm.c
 
+libpsos_la_LIBADD = \
+   ../common/libxenomai.la
+
 libpsos_la_CPPFLAGS = \
@XENO_USER_CFLAGS@ \
-I$(top_srcdir)/include
diff --git a/src/skins/rtdm/Makefile.in b/src/skins/rtdm/Makefile.in
index 80c52b2..e649b68 100644
--- a/src/skins/rtdm/Makefile.in
+++ b/src/skins/rtdm/Makefile.in
@@ -77,7 +77,7 @@ am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
 am__installdirs = $(DESTDIR)$(libdir) $(DESTDIR)$(pkgconfigdir)
 LTLIBRARIES = $(lib_LTLIBRARIES)
-librtdm_la_LIBADD =
+librtdm_la_DEPENDENCIES = ../common/libxenomai.la
 am_librtdm_la_OBJECTS = librtdm_la-core.lo librtdm_la-init.lo
 librtdm_la_OBJECTS = $(am_librtdm_la_OBJECTS)
 librtdm_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
@@ -264,6 +264,9 @@ librtdm_la_SOURCES = \
core.c \
init.c
 
+librtdm_la_LIBADD = \
+   ../common/libxenomai.la
+
 librtdm_la_CPPFLAGS = \
@XENO_USER_CFLAGS@ \
-I$(top_srcdir)/include
diff --git a/src/skins/uitron/Makefile.in b/src/skins/uitron/Makefile.in
index 00b8aae..2e45dbd 100644
--- a/src/skins/uitron/Makefile.in
+++ b/src/skins/uitron/Makefile.in
@@ -77,7 +77,7 @@ am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
 am__installdirs = $(DESTDIR)$(libdir) $(DESTDIR)$(pkgconfigdir)
 LTLIBRARIES = $(lib_LTLIBRARIES)
-libuitron_la_LIBADD =
+libuitron_la_DEPENDENCIES = ../common/libxenomai.la
 am_libuitron_la_OBJECTS = libuitron_la-flag.lo libuitron_la-init.lo \
libuitron_la-mbx.lo libuitron_la-sem.lo libuitron_la-task.lo
 libuitron_la_OBJECTS = $(am_libuitron_la_OBJECTS)
@@ -268,6 +268,9 @@ libuitron_la_SOURCES = \
sem.c \
task.c
 
+libuitron_la_LIBADD = \
+   ../common/libxenomai.la
+
 libuitron_la_CPPFLAGS = \
@XENO_USER_CFLAGS@ \
-I$(top_srcdir)/include
diff --git a/src/skins/vrtx/Makefile.in b/src/skins/vrtx/Makefile.in
index 85d3cae..95b8d14 100644
--- a/src/skins/vrtx/Makefile.in
+++ b/src/skins/vrtx/Makefile.in
@@ -77,7 

  1   2   3   4   5   6   7   8   9   10   >