[Xenomai-git] Philippe Gerum : cobalt/arm64: add README for I-pipe support

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

Author: Philippe Gerum 
Date:   Sun Nov  1 17:22:33 2015 +0100

cobalt/arm64: add README for I-pipe support

---

 kernel/cobalt/arch/arm64/patches/README |   16 
 1 file changed, 16 insertions(+)

diff --git a/kernel/cobalt/arch/arm64/patches/README 
b/kernel/cobalt/arch/arm64/patches/README
new file mode 100644
index 000..fd85e06
--- /dev/null
+++ b/kernel/cobalt/arch/arm64/patches/README
@@ -0,0 +1,16 @@
+-- arch/arm64/patches
+
+Xenomai needs special kernel support to deliver fast and deterministic
+response time to external interrupts, and also to provide real-time
+services highly integrated with the standard Linux kernel.
+
+This support is provided by the interrupt pipeline (aka I-pipe) in the
+form of a kernel patch you have to apply against a vanilla kernel
+tree, before you attempt to compile the Xenomai codebase against the
+latter kernel.
+
+The Xenomai arm64 port is work in progress. The I-pipe support for
+this architecture is exclusively available from this development tree
+at the moment:
+
+git://git.xenomai.org/ipipe.git, branch devel/ipipe-3.18-linaro-arm64.


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


[Xenomai-git] Don Mahurin : lib/cobalt/arm64: implement syscall for armv8/aarch64

2015-11-01 Thread git repository hosting
Module: xenomai-3
Branch: next
Commit: 6da69ecdc2b6e9f18cfbc59261ff01a58fd77c9f
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=6da69ecdc2b6e9f18cfbc59261ff01a58fd77c9f

Author: Don Mahurin 
Date:   Fri May  8 10:39:32 2015 -0700

lib/cobalt/arm64: implement syscall for armv8/aarch64

---

 lib/cobalt/arch/arm64/include/asm/xenomai/syscall.h |8 
 1 file changed, 8 insertions(+)

diff --git a/lib/cobalt/arch/arm64/include/asm/xenomai/syscall.h 
b/lib/cobalt/arch/arm64/include/asm/xenomai/syscall.h
index 8f48eb1..1d5806c 100644
--- a/lib/cobalt/arch/arm64/include/asm/xenomai/syscall.h
+++ b/lib/cobalt/arch/arm64/include/asm/xenomai/syscall.h
@@ -88,6 +88,7 @@
 #define __sys2(x)  #x
 #define __sys1(x)  __sys2(x)
 
+#ifndef __aarch64__
 #ifdef __ARM_EABI__
 #define __SYS_REG , "r7"
 #define __SYS_REG_DECL register unsigned long __r7 __asm__ ("r7")
@@ -102,6 +103,13 @@
 #define __NR_OABI_SYSCALL_BASE 0x90
 #define __SYS_CALLOP "swi\t" __sys1(__NR_OABI_SYSCALL_BASE + XENO_ARM_SYSCALL) 
""
 #endif
+#else
+#define __SYS_REG , "r8"
+#define __SYS_REG_DECL register unsigned long __r8 __asm__ ("r8")
+#define __SYS_REG_SET __r8 = XENO_ARM_SYSCALL
+#define __SYS_REG_INPUT ,"r" (__r8)
+#define __SYS_CALLOP "svc\t0"
+#endif
 
 #define XENOMAI_DO_SYSCALL(nr, op, args...)\
({  \


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


[Xenomai-git] Philippe Gerum : cobalt/arm64: switch to regular system call convention

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

Author: Philippe Gerum 
Date:   Mon Oct 19 15:54:55 2015 +0200

cobalt/arm64: switch to regular system call convention

---

 .../arch/arm64/include/asm/xenomai/syscall.h   |   29 +---
 .../arch/arm64/include/asm/xenomai/uapi/syscall.h  |8 +-
 lib/cobalt/arch/arm64/features.c   |8 -
 .../arch/arm64/include/asm/xenomai/syscall.h   |  180 
 lib/cobalt/arch/arm64/include/asm/xenomai/tsc.h|   19 +--
 5 files changed, 78 insertions(+), 166 deletions(-)

diff --git a/kernel/cobalt/arch/arm64/include/asm/xenomai/syscall.h 
b/kernel/cobalt/arch/arm64/include/asm/xenomai/syscall.h
index 949f287..9fc6522 100644
--- a/kernel/cobalt/arch/arm64/include/asm/xenomai/syscall.h
+++ b/kernel/cobalt/arch/arm64/include/asm/xenomai/syscall.h
@@ -28,31 +28,16 @@
 #include 
 #include 
 
-#ifndef __NR_SYSCALL_BASE
-#define __NR_SYSCALL_BASE 0
-#endif
-
-#ifndef __ARM_NR_ipipe
-/* Legacy pipelines do not define this. */
-#define __ARM_NR_ipipe (__NR_SYSCALL_BASE + XENO_ARM_SYSCALL)
-#endif
-
-#define __xn_reg_sys(__regs)   ((__regs)->orig_x0)
-/* In OABI_COMPAT mode, handle both OABI and EABI userspace syscalls */
-#ifdef CONFIG_OABI_COMPAT
-#define __xn_syscall_p(__regs) (((__regs)->regs[8] == __NR_OABI_SYSCALL_BASE + 
XENO_ARM_SYSCALL) || \
-((__regs)->regs[8] == __ARM_NR_ipipe))
-#else /* !CONFIG_OABI_COMPAT */
-#define __xn_syscall_p(__regs) ((__regs)->regs[8] == __ARM_NR_ipipe)
-#endif /* !CONFIG_OABI_COMPAT */
+#define __xn_reg_sys(__regs)   ((unsigned long)(__regs)->syscallno)
+#define __xn_syscall_p(regs)   ((__xn_reg_sys(regs) & __COBALT_SYSCALL_BIT) != 
0)
 #define __xn_syscall(__regs)   ((unsigned long)(__xn_reg_sys(__regs) & 
~__COBALT_SYSCALL_BIT))
 
 #define __xn_reg_rval(__regs)  ((__regs)->regs[0])
-#define __xn_reg_arg1(__regs)  ((__regs)->regs[1])
-#define __xn_reg_arg2(__regs)  ((__regs)->regs[2])
-#define __xn_reg_arg3(__regs)  ((__regs)->regs[3])
-#define __xn_reg_arg4(__regs)  ((__regs)->regs[4])
-#define __xn_reg_arg5(__regs)  ((__regs)->regs[5])
+#define __xn_reg_arg1(__regs)  ((__regs)->regs[0])
+#define __xn_reg_arg2(__regs)  ((__regs)->regs[1])
+#define __xn_reg_arg3(__regs)  ((__regs)->regs[2])
+#define __xn_reg_arg4(__regs)  ((__regs)->regs[3])
+#define __xn_reg_arg5(__regs)  ((__regs)->regs[4])
 #define __xn_reg_pc(__regs)((__regs)->pc)
 #define __xn_reg_sp(__regs)((__regs)->sp)
 
diff --git a/kernel/cobalt/arch/arm64/include/asm/xenomai/uapi/syscall.h 
b/kernel/cobalt/arch/arm64/include/asm/xenomai/uapi/syscall.h
index 60dabd5..5b319d6 100644
--- a/kernel/cobalt/arch/arm64/include/asm/xenomai/uapi/syscall.h
+++ b/kernel/cobalt/arch/arm64/include/asm/xenomai/uapi/syscall.h
@@ -23,12 +23,6 @@
 
 #define __xn_syscode(__nr) (__COBALT_SYSCALL_BIT | (__nr))
 
-#define XENO_ARM_SYSCALL0x000F0042 /* carefully chosen... */
-
-#define XENOMAI_SYSARCH_ATOMIC_ADD_RETURN  0
-#define XENOMAI_SYSARCH_ATOMIC_SET_MASK1
-#define XENOMAI_SYSARCH_ATOMIC_CLEAR_MASK  2
-#define XENOMAI_SYSARCH_XCHG   3
-#define XENOMAI_SYSARCH_TSCINFO 4
+#define XENOMAI_SYSARCH_TSCINFO0
 
 #endif /* !_COBALT_ARM64_ASM_UAPI_SYSCALL_H */
diff --git a/lib/cobalt/arch/arm64/features.c b/lib/cobalt/arch/arm64/features.c
index f5253a6..254c8ae 100644
--- a/lib/cobalt/arch/arm64/features.c
+++ b/lib/cobalt/arch/arm64/features.c
@@ -59,14 +59,6 @@ void cobalt_check_features(struct cobalt_featinfo *finfo)
 
page_size = sysconf(_SC_PAGESIZE);
 
-#ifndef __aarch64__
-   __xn_tscinfo.kuser_tsc_get =
-   (__xn_rdtsc_t *)(0x1004 -
-   ((*(unsigned *)(0x0ffc) + 3) << 5));
-#else
-   __xn_tscinfo.kuser_tsc_get = 0;
-#endif
-
phys_addr = (unsigned long)__xn_tscinfo.kinfo.counter;
 
addr = __STD(mmap(NULL, page_size, PROT_READ, MAP_SHARED,
diff --git a/lib/cobalt/arch/arm64/include/asm/xenomai/syscall.h 
b/lib/cobalt/arch/arm64/include/asm/xenomai/syscall.h
index 8e7ad61..d2dfda6 100644
--- a/lib/cobalt/arch/arm64/include/asm/xenomai/syscall.h
+++ b/lib/cobalt/arch/arm64/include/asm/xenomai/syscall.h
@@ -1,8 +1,5 @@
 /*
- * Copyright (C) 2001,2002,2003,2004 Philippe Gerum .
- *
- * ARM port
- *   Copyright (C) 2005 Stelian Pop
+ * Copyright (C) 2015 Philippe Gerum .
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -25,119 +22,76 @@
 #include 
 #include 
 
-/*
- * Some of the following macros have been adapted from Linux's
- * implementation of the syscall mechanism in :
- */
-
-#define LOADARGS_0(syscode, dummy...)  \
-   __a0 = (unsigned long) (syscode)
-#define 

[Xenomai-git] Don Mahurin : cobalt/arm64: fix warning: expects argument of type ' long unsigned int', but argument has type 'u64'

2015-11-01 Thread git repository hosting
Module: xenomai-3
Branch: next
Commit: 10b6f353a4858b8c0d8db10219ceb75789aef2e7
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=10b6f353a4858b8c0d8db10219ceb75789aef2e7

Author: Don Mahurin 
Date:   Thu May 14 17:34:53 2015 -0700

cobalt/arm64: fix warning: expects argument of type 'long unsigned int', but 
argument has type 'u64'

---

 kernel/cobalt/posix/syscall.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/cobalt/posix/syscall.c b/kernel/cobalt/posix/syscall.c
index 7f2e1c6..03cae7d 100644
--- a/kernel/cobalt/posix/syscall.c
+++ b/kernel/cobalt/posix/syscall.c
@@ -814,7 +814,7 @@ linux_syscall:
return KEVENT_PROPAGATE;
 
 bad_syscall:
-   printk(XENO_WARNING "bad syscall <%#lx>\n", __xn_syscall(regs));
+   printk(XENO_WARNING "bad syscall <%#llx>\n", __xn_syscall(regs));
 
__xn_error_return(regs, -ENOSYS);
 


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


[Xenomai-git] Dmitriy Cherkasov : cobalt/arm64: fix fpu exception names

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

Author: Dmitriy Cherkasov 
Date:   Mon Sep 28 16:13:45 2015 -0700

cobalt/arm64: fix fpu exception names

---

 kernel/cobalt/arch/arm64/machine.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/cobalt/arch/arm64/machine.c 
b/kernel/cobalt/arch/arm64/machine.c
index f48d4a8..ddf65a8 100644
--- a/kernel/cobalt/arch/arm64/machine.c
+++ b/kernel/cobalt/arch/arm64/machine.c
@@ -99,8 +99,8 @@ static const char *const fault_labels[] = {
[IPIPE_TRAP_DABT] = "Generic data abort",
[IPIPE_TRAP_UNKNOWN] = "Unknown exception",
[IPIPE_TRAP_BREAK] = "Instruction breakpoint",
-   [IPIPE_TRAP_FPU] = "Floating point exception",
-   [IPIPE_TRAP_VFP] = "VFP Floating point exception",
+   [IPIPE_TRAP_FPU_ACC] = "Floating point access",
+   [IPIPE_TRAP_FPU_EXC] = "Floating point exception",
[IPIPE_TRAP_UNDEFINSTR] = "Undefined instruction",
 #ifdef IPIPE_TRAP_ALIGNMENT
[IPIPE_TRAP_ALIGNMENT] = "Unaligned access exception",


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


[Xenomai-git] Don Mahurin : cobalt/arm64: Use empty mayday implementation for arm64.

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

Author: Don Mahurin 
Date:   Mon Sep 14 12:52:27 2015 -0700

cobalt/arm64: Use empty mayday implementation for arm64.

The arm mayday implementation was not correct for arm64. Replace with empty 
implementation.
Handle mayday in the linux domain, using xnthread_relax. This change is 
essentially the same as the general change proposed in the 'Mayday issues 
again' discussion (Jan Kiszka, Jun 21), though only applied to arch/arm64.

---

 kernel/cobalt/arch/arm64/mayday.c |   86 +
 1 file changed, 1 insertion(+), 85 deletions(-)

diff --git a/kernel/cobalt/arch/arm64/mayday.c 
b/kernel/cobalt/arch/arm64/mayday.c
index bc51ad6..ca1151c 100644
--- a/kernel/cobalt/arch/arm64/mayday.c
+++ b/kernel/cobalt/arch/arm64/mayday.c
@@ -28,72 +28,6 @@ static void *mayday;
 
 static inline void setup_mayday(void *page)
 {
-   /*
-* We want this code to appear at the top of the MAYDAY page:
-*
-* ifdef ARM_EABI
-*
-* e59f000c ldr r0, [pc, #12]
-* e59f700c ldr r7, [pc, #12]
-* ef00 svc 0x
-* e3a0 mov r0, #0
-* e580 str r0, [r0]; 
-* 105e .word   0x105e  ; sc_cobalt_mayday | 
__COBALT_SYSCALL_BIT
-* 000f0042 .word   0x000f0042
-*
-* elif ARM_OABI
-*
-* e59f0008 ldr r0, [pc, #8]
-* ef9f0042 swi 0x009f0042
-* e3a0 mov r0, #0
-* e580 str r0, [r0]; 
-* 105e .word   0x105e  ; sc_cobalt_mayday | 
__COBALT_SYSCALL_BIT
-*
-* endif
-*
-* 32bit instruction words will be laid out by the compiler as
-* the target endianness requires.
-*
-* We don't mess with CPSR here, so no need to save/restore it
-* in handle/fixup code.
-*/
-#ifdef __ARM_EABI__
-   static const struct {
-   u32 ldr_r0;
-   u32 ldr_r7;
-   u32 swi_0;
-   u32 mov_r0;
-   u32 str_r0;
-   u32 cst_r0;
-   u32 cst_r7;
-   } code = {
-   .ldr_r0 = 0xe59f000c,
-   .ldr_r7 = 0xe59f700c,
-   .swi_0 = 0xef00,
-   .mov_r0 = 0xe3a0,
-   .str_r0 = 0xe580,
-   .cst_r0 =  __xn_syscode(sc_cobalt_mayday),
-   .cst_r7 = 0x000f0042,
-   };
-#else /* OABI */
-   static const struct {
-   u32 ldr_r0;
-   u32 swi_syscall;
-   u32 mov_r0;
-   u32 str_r0;
-   u32 cst_r0;
-   } code = {
-   .ldr_r0 = 0xe59f0008,
-   .swi_syscall = 0xef9f0042,
-   .mov_r0 = 0xe3a0,
-   .str_r0 = 0xe580,
-   .cst_r0 =  __xn_syscode(sc_cobalt_mayday),
-   };
-#endif /* OABI */
-
-   memcpy(page, , sizeof(code));
-
-   flush_dcache_page(vmalloc_to_page(page));
 }
 
 int xnarch_init_mayday(void)
@@ -120,27 +54,9 @@ void *xnarch_get_mayday_page(void)
 void xnarch_handle_mayday(struct xnarchtcb *tcb, struct pt_regs *regs,
  unsigned long tramp)
 {
-   tcb->mayday.pc = regs->pc;
-   tcb->mayday.r0 = regs->regs[0];
-#ifdef __ARM_EABI__
-   tcb->mayday.r7 = regs->regs[7];
-#endif
-#ifdef CONFIG_ARM_THUMB
-   /* The code on the mayday page must be run in ARM mode */
-   tcb->mayday.psr = regs->cpsr;
-   regs->cpsr &= ~PSR_T_BIT;
-#endif
-   regs->pc = tramp;
+   xnthread_relax(0, 0);
 }
 
 void xnarch_fixup_mayday(struct xnarchtcb *tcb, struct pt_regs *regs)
 {
-   regs->pc = tcb->mayday.pc;
-   regs->regs[0] = tcb->mayday.r0;
-#ifdef __ARM_EABI__
-   regs->regs[7] = tcb->mayday.r7;
-#endif
-#ifdef CONFIG_ARM_THUMB
-   regs->cpsr = tcb->mayday.psr;
-#endif
 }


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


[Xenomai-git] Dmitriy Cherkasov : cobalt/arm64: features.h: disable XNARCH_HAVE_LLMULSHFT, XNARCH_HAVE_NODIV_LLIMD for armv8/aarch64, as arm64 does not have these

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

Author: Dmitriy Cherkasov 
Date:   Thu May  7 16:40:07 2015 -0700

cobalt/arm64: features.h: disable XNARCH_HAVE_LLMULSHFT, 
XNARCH_HAVE_NODIV_LLIMD for armv8/aarch64, as arm64 does not have these

---

 kernel/cobalt/arch/arm64/include/asm/xenomai/uapi/features.h |2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/cobalt/arch/arm64/include/asm/xenomai/uapi/features.h 
b/kernel/cobalt/arch/arm64/include/asm/xenomai/uapi/features.h
index fe50182..85faa59 100644
--- a/kernel/cobalt/arch/arm64/include/asm/xenomai/uapi/features.h
+++ b/kernel/cobalt/arch/arm64/include/asm/xenomai/uapi/features.h
@@ -28,8 +28,10 @@
 
 #define XENOMAI_FEAT_MAN (__xn_feat_generic_man_mask)
 
+#ifndef __aarch64__
 #define XNARCH_HAVE_LLMULSHFT1
 #define XNARCH_HAVE_NODIV_LLIMD  1
+#endif
 
 struct cobalt_featinfo_archdep { /* no arch-specific feature */ };
 


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


[Xenomai-git] Don Mahurin : cobalt/arm64: fix build for mismatched printf type (%lx, u64) on arm64.

2015-11-01 Thread git repository hosting
Module: xenomai-3
Branch: next
Commit: 80451e3d9dec5aec76799f9eb7c3e5679f27bde5
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=80451e3d9dec5aec76799f9eb7c3e5679f27bde5

Author: Don Mahurin 
Date:   Wed Sep  2 13:48:36 2015 -0700

cobalt/arm64: fix build for mismatched printf type (%lx,u64) on arm64.

pc and orig_r0 are u64 on arm64 and 'unsigned long' or arm and other platforms. 
printf referencing these are using %lx. On arm64, long and long long (and u64) 
are 64 bits. Rather than changing printf format, chnage arm64 macros to cast to 
unsigned long.

---

 kernel/cobalt/arch/arm64/include/asm/xenomai/syscall.h |2 +-
 kernel/cobalt/arch/arm64/include/asm/xenomai/thread.h  |2 +-
 kernel/cobalt/posix/syscall.c  |2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/cobalt/arch/arm64/include/asm/xenomai/syscall.h 
b/kernel/cobalt/arch/arm64/include/asm/xenomai/syscall.h
index 7bf95fb..77c1716 100644
--- a/kernel/cobalt/arch/arm64/include/asm/xenomai/syscall.h
+++ b/kernel/cobalt/arch/arm64/include/asm/xenomai/syscall.h
@@ -45,7 +45,7 @@
 #else /* !CONFIG_OABI_COMPAT */
 #define __xn_syscall_p(__regs) ((__regs)->regs[8] == __ARM_NR_ipipe)
 #endif /* !CONFIG_OABI_COMPAT */
-#define __xn_syscall(__regs)   (__xn_reg_sys(__regs) & ~__COBALT_SYSCALL_BIT)
+#define __xn_syscall(__regs)   ((unsigned long)(__xn_reg_sys(__regs) & 
~__COBALT_SYSCALL_BIT))
 
 #define __xn_reg_rval(__regs)  ((__regs)->regs[0])
 #define __xn_reg_arg1(__regs)  ((__regs)->regs[1])
diff --git a/kernel/cobalt/arch/arm64/include/asm/xenomai/thread.h 
b/kernel/cobalt/arch/arm64/include/asm/xenomai/thread.h
index 958f340..a8d7ed4 100644
--- a/kernel/cobalt/arch/arm64/include/asm/xenomai/thread.h
+++ b/kernel/cobalt/arch/arm64/include/asm/xenomai/thread.h
@@ -52,7 +52,7 @@ struct xnarchtcb {
 #define xnarch_fault_regs(d)   ((d)->regs)
 #define xnarch_fault_trap(d)   ((d)->exception)
 #define xnarch_fault_code(d)   (0)
-#define xnarch_fault_pc(d) ((d)->regs->pc - 4) /* XXX ? */
+#define xnarch_fault_pc(d) ((unsigned long)((d)->regs->pc - 4)) /* XXX ? */
 
 #define xnarch_fault_pf_p(d)   ((d)->exception == IPIPE_TRAP_ACCESS)
 #define xnarch_fault_bp_p(d)   ((current->ptrace & PT_PTRACED) &&  \
diff --git a/kernel/cobalt/posix/syscall.c b/kernel/cobalt/posix/syscall.c
index 03cae7d..7f2e1c6 100644
--- a/kernel/cobalt/posix/syscall.c
+++ b/kernel/cobalt/posix/syscall.c
@@ -814,7 +814,7 @@ linux_syscall:
return KEVENT_PROPAGATE;
 
 bad_syscall:
-   printk(XENO_WARNING "bad syscall <%#llx>\n", __xn_syscall(regs));
+   printk(XENO_WARNING "bad syscall <%#lx>\n", __xn_syscall(regs));
 
__xn_error_return(regs, -ENOSYS);
 


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


[Xenomai-git] Dmitriy Cherkasov : cobalt/arm64: add basic FPU support

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

Author: Dmitriy Cherkasov 
Date:   Fri Sep 11 17:58:54 2015 -0700

cobalt/arm64: add basic FPU support

---

 kernel/cobalt/arch/arm64/Kconfig   |2 +-
 .../cobalt/arch/arm64/include/asm/xenomai/fptest.h |   11 +-
 .../cobalt/arch/arm64/include/asm/xenomai/thread.h |   17 +-
 .../arch/arm64/include/asm/xenomai/uapi/fptest.h   |   83 +++--
 kernel/cobalt/arch/arm64/thread.c  |  329 +---
 lib/cobalt/arch/arm64/features.c   |4 +-
 6 files changed, 153 insertions(+), 293 deletions(-)

diff --git a/kernel/cobalt/arch/arm64/Kconfig b/kernel/cobalt/arch/arm64/Kconfig
index dd5a8c6..27b5026 100644
--- a/kernel/cobalt/arch/arm64/Kconfig
+++ b/kernel/cobalt/arch/arm64/Kconfig
@@ -8,7 +8,7 @@ config XENO_ARCH_WANT_TIP
def_bool y
 
 config XENO_ARCH_FPU
-   def_bool VFP
+   def_bool y
 
 config XENO_ARCH_SYS3264
 def_bool n
diff --git a/kernel/cobalt/arch/arm64/include/asm/xenomai/fptest.h 
b/kernel/cobalt/arch/arm64/include/asm/xenomai/fptest.h
index a76f1e6..743d758 100644
--- a/kernel/cobalt/arch/arm64/include/asm/xenomai/fptest.h
+++ b/kernel/cobalt/arch/arm64/include/asm/xenomai/fptest.h
@@ -20,15 +20,10 @@
 #define _COBALT_ARM_ASM_FPTEST_H
 
 #include 
+#include 
 #include 
 
-#ifdef CONFIG_VFP
-#define have_vfp (elf_hwcap & HWCAP_VFP)
-#else /* !CONFIG_VFP */
-#define have_vfp 0
-#endif /* !CONFIG_VFP */
-
-#include 
+#define have_fp (elf_hwcap & HWCAP_FP)
 
 static inline int fp_kernel_supported(void)
 {
@@ -46,7 +41,7 @@ static inline void fp_linux_end(void)
 
 static inline int fp_detect(void)
 {
-   return have_vfp ? __COBALT_HAVE_VFP : 0;
+   return have_fp ? __COBALT_HAVE_FPU : 0;
 }
 
 #endif /* _COBALT_ARM_ASM_FPTEST_H */
diff --git a/kernel/cobalt/arch/arm64/include/asm/xenomai/thread.h 
b/kernel/cobalt/arch/arm64/include/asm/xenomai/thread.h
index a8d7ed4..bfcceb4 100644
--- a/kernel/cobalt/arch/arm64/include/asm/xenomai/thread.h
+++ b/kernel/cobalt/arch/arm64/include/asm/xenomai/thread.h
@@ -21,21 +21,12 @@
 
 #include 
 
-#ifdef CONFIG_XENO_ARCH_FPU
-#ifdef CONFIG_VFP
-#include 
-#endif /* CONFIG_VFP */
-#endif /* !CONFIG_XENO_ARCH_FPU */
 
 struct xnarchtcb {
struct xntcb core;
 #ifdef CONFIG_XENO_ARCH_FPU
-#ifdef CONFIG_VFP
-   union vfp_state *fpup;
+   struct fpsimd_state *fpup;
 #define xnarch_fpu_ptr(tcb) ((tcb)->fpup)
-#else
-#define xnarch_fpu_ptr(tcb) NULL
-#endif
 #endif
struct {
unsigned long pc;
@@ -67,7 +58,7 @@ static inline void xnarch_enter_root(struct xnthread *root) { 
}
 
 int xnarch_escalate(void);
 
-#if defined(CONFIG_XENO_ARCH_FPU) && defined(CONFIG_VFP)
+#if defined(CONFIG_XENO_ARCH_FPU)
 
 static inline void xnarch_init_root_tcb(struct xnthread *thread)
 {
@@ -88,7 +79,7 @@ void xnarch_switch_fpu(struct xnthread *from, struct xnthread 
*thread);
 int xnarch_handle_fpu_fault(struct xnthread *from, 
struct xnthread *to, struct ipipe_trap_data *d);
 
-#else /* !CONFIG_XENO_ARCH_FPU || !CONFIG_VFP */
+#else /* !CONFIG_XENO_ARCH_FPU */
 
 static inline void xnarch_init_root_tcb(struct xnthread *thread) { }
 static inline void xnarch_init_shadow_tcb(struct xnthread *thread) { }
@@ -114,7 +105,7 @@ static inline int xnarch_handle_fpu_fault(struct xnthread 
*from,
 {
return 0;
 }
-#endif /*  !CONFIG_XENO_ARCH_FPU || !CONFIG_VFP */
+#endif /*  !CONFIG_XENO_ARCH_FPU */
 
 static inline void xnarch_enable_kfpu(void) { }
 
diff --git a/kernel/cobalt/arch/arm64/include/asm/xenomai/uapi/fptest.h 
b/kernel/cobalt/arch/arm64/include/asm/xenomai/uapi/fptest.h
index 65a3e31..25bc976 100644
--- a/kernel/cobalt/arch/arm64/include/asm/xenomai/uapi/fptest.h
+++ b/kernel/cobalt/arch/arm64/include/asm/xenomai/uapi/fptest.h
@@ -18,53 +18,86 @@
 #ifndef _COBALT_ARM_ASM_UAPI_FPTEST_H
 #define _COBALT_ARM_ASM_UAPI_FPTEST_H
 
-#ifdef __aarch64__
-/* CP10 and CP11, used for the FP/NEON operations, are already excluded from
-the list of valid operands for the generic coprocessor instructions */
-#define __COBALT_HAVE_VFP  0
-#else
-#define __COBALT_HAVE_VFP  0x1
-#endif
+#define __COBALT_HAVE_FPU  0x1
 
 static inline void fp_regs_set(int features, unsigned int val)
 {
-#if __COBALT_HAVE_VFP != 0
-   unsigned long long e[16];
+
+   unsigned long long e[32];
unsigned int i;
 
-   if (features & __COBALT_HAVE_VFP) {
-   for (i = 0; i < 16; i++)
+   if (features & __COBALT_HAVE_FPU) {
+
+   for (i = 0; i < 32; i++)
e[i] = val;
 
-   /* vldm %0!, {d0-d15},
-  AKA fldmiax %0!, {d0-d15} */
-   __asm__ __volatile__("ldc p11, cr0, [%0],#32*4":
-"=r"(i): "0"([0]): "memory");
+

[Xenomai-git] Don Mahurin : lib/cobalt/arm64: add __LINUX_ARM_ARCH__ form armv8/aarch64

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

Author: Don Mahurin 
Date:   Fri May  8 10:39:01 2015 -0700

lib/cobalt/arm64: add __LINUX_ARM_ARCH__ form armv8/aarch64

---

 lib/cobalt/arch/arm64/include/asm/xenomai/features.h |4 
 1 file changed, 4 insertions(+)

diff --git a/lib/cobalt/arch/arm64/include/asm/xenomai/features.h 
b/lib/cobalt/arch/arm64/include/asm/xenomai/features.h
index 10bd0c7..0d6702b 100644
--- a/lib/cobalt/arch/arm64/include/asm/xenomai/features.h
+++ b/lib/cobalt/arch/arm64/include/asm/xenomai/features.h
@@ -47,6 +47,10 @@
 #define __LINUX_ARM_ARCH__ 7
 #endif /* armv7 */
 
+#if defined(__aarch64__)
+#define __LINUX_ARM_ARCH__ 8
+#endif /* armv8 */
+
 #ifndef __LINUX_ARM_ARCH__
 #error "Could not find current ARM architecture"
 #endif


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


[Xenomai-git] Philippe Gerum : testsuite/smokey: add basic FPU stress test

2015-11-01 Thread git repository hosting
Module: xenomai-3
Branch: next
Commit: 7c555a563b42477602bb7fb193eacb3673170db8
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=7c555a563b42477602bb7fb193eacb3673170db8

Author: Philippe Gerum 
Date:   Sat Oct 24 15:52:48 2015 +0200

testsuite/smokey: add basic FPU stress test

---

 configure.ac |1 +
 testsuite/smokey/Makefile.am |1 +
 testsuite/smokey/fpu-stress/Makefile.am  |8 +++
 testsuite/smokey/fpu-stress/fpu-stress.c |   84 ++
 4 files changed, 94 insertions(+)

diff --git a/configure.ac b/configure.ac
index c805186..89c2911 100644
--- a/configure.ac
+++ b/configure.ac
@@ -899,6 +899,7 @@ AC_CONFIG_FILES([ \
testsuite/smokey/timerfd/Makefile \
testsuite/smokey/tsc/Makefile \
testsuite/smokey/leaks/Makefile \
+   testsuite/smokey/fpu-stress/Makefile \
testsuite/clocktest/Makefile \
testsuite/xeno-test/Makefile \
utils/Makefile \
diff --git a/testsuite/smokey/Makefile.am b/testsuite/smokey/Makefile.am
index 87e0555..e0361df 100644
--- a/testsuite/smokey/Makefile.am
+++ b/testsuite/smokey/Makefile.am
@@ -10,6 +10,7 @@ wrappers = $(XENO_POSIX_WRAPPERS)
 SUBDIRS =  \
arith   \
bufp\
+   fpu-stress  \
iddp\
leaks   \
posix-clock \
diff --git a/testsuite/smokey/fpu-stress/Makefile.am 
b/testsuite/smokey/fpu-stress/Makefile.am
new file mode 100644
index 000..c90d0dd
--- /dev/null
+++ b/testsuite/smokey/fpu-stress/Makefile.am
@@ -0,0 +1,8 @@
+
+noinst_LIBRARIES = libfpu-stress.a
+
+libfpu_stress_a_SOURCES = fpu-stress.c
+
+libfpu_stress_a_CPPFLAGS = \
+   @XENO_USER_CFLAGS@  \
+   -I$(top_srcdir)/include
diff --git a/testsuite/smokey/fpu-stress/fpu-stress.c 
b/testsuite/smokey/fpu-stress/fpu-stress.c
new file mode 100644
index 000..1846bf6
--- /dev/null
+++ b/testsuite/smokey/fpu-stress/fpu-stress.c
@@ -0,0 +1,84 @@
+#include 
+#include 
+#include 
+#include 
+#include 
+
+smokey_test_plugin(fpu_stress,
+  SMOKEY_ARGLIST(
+  SMOKEY_INT(duration),
+  ),
+  "Check FPU context sanity during real-time stress\n"
+  "\tduration=\thow long to run the stress loop 
(0=indefinitely)"
+);
+
+static int fp_features;
+
+static void *stress_loop(void *arg)
+{
+   struct timespec rqt = {
+   .tv_sec = 0,
+   .tv_nsec = CONFIG_XENO_DEFAULT_PERIOD
+   };
+   
+   for (;;) {
+   fp_regs_set(fp_features, 0xf1f5f1f5);
+   clock_nanosleep(CLOCK_MONOTONIC, 0, , NULL);
+   }
+
+   return NULL;
+}
+
+static int run_fpu_stress(struct smokey_test *t,
+ int argc, char *const argv[])
+{
+   unsigned sleep_ms, n, rounds, duration = 3;
+   struct sched_param param;
+   pthread_attr_t attr;
+   struct timespec rqt;
+   pthread_t tid;
+   int ret;
+
+   fp_features = cobalt_fp_detect();
+   if (fp_features == 0)
+   return -ENOSYS;
+
+   smokey_parse_args(t, argc, argv);
+   
+   if (SMOKEY_ARG_ISSET(fpu_stress, duration))
+   duration = SMOKEY_ARG_INT(fpu_stress, duration);
+   
+   rqt.tv_sec = 0;
+   rqt.tv_nsec = CONFIG_XENO_DEFAULT_PERIOD;
+   sleep_ms = 100UL / rqt.tv_nsec; /* wake up each ms */
+   rounds = duration * 1000UL / sleep_ms;
+
+   pthread_attr_init();
+   pthread_attr_setdetachstate(, PTHREAD_CREATE_JOINABLE);
+   pthread_attr_setinheritsched(, PTHREAD_EXPLICIT_SCHED);
+   pthread_attr_setschedpolicy(, SCHED_FIFO);
+   param.sched_priority = 10;
+   pthread_attr_setschedparam(, );
+   ret = pthread_create(, , stress_loop, NULL);
+   if (ret)
+   return -ret;
+
+   if (rounds)
+   smokey_trace("running for %d seconds", duration);
+   else
+   smokey_trace("running indefinitely...");
+
+   for (n = 0; rounds == 0 || n < rounds; n++) {
+   fp_regs_set(fp_features, n);
+   __STD(clock_nanosleep(CLOCK_MONOTONIC, 0, , NULL));
+   if (fp_regs_check(fp_features, n, smokey_trace) != n) {
+   ret = -EINVAL;
+   break;
+   }
+   }
+
+   pthread_cancel(tid);
+   pthread_join(tid, NULL);
+
+   return ret;
+}


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


[Xenomai-git] Philippe Gerum : cobalt/arm64: leave mm tracking to the pipeline

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

Author: Philippe Gerum 
Date:   Thu Sep 17 15:08:34 2015 +0200

cobalt/arm64: leave mm tracking to the pipeline

---

 kernel/cobalt/arch/arm64/Kconfig |3 ---
 1 file changed, 3 deletions(-)

diff --git a/kernel/cobalt/arch/arm64/Kconfig b/kernel/cobalt/arch/arm64/Kconfig
index 927c647..dd5a8c6 100644
--- a/kernel/cobalt/arch/arm64/Kconfig
+++ b/kernel/cobalt/arch/arm64/Kconfig
@@ -4,9 +4,6 @@ source "drivers/xenomai/Kconfig"
 config XENO_ARCH_UNLOCKED_SWITCH
def_bool IPIPE_WANT_PREEMPTIBLE_SWITCH
 
-config IPIPE_WANT_ACTIVE_MM
-   def_bool y
-
 config XENO_ARCH_WANT_TIP
def_bool y
 


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


[Xenomai-git] Don Mahurin : lib/cobalt/arm64: disable kuser tsc get setting for armv8/ aarch64

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

Author: Don Mahurin 
Date:   Fri May  8 10:37:36 2015 -0700

lib/cobalt/arm64: disable kuser tsc get setting for armv8/aarch64

---

 lib/cobalt/arch/arm64/features.c |4 
 1 file changed, 4 insertions(+)

diff --git a/lib/cobalt/arch/arm64/features.c b/lib/cobalt/arch/arm64/features.c
index edabcf2..7c7e76a 100644
--- a/lib/cobalt/arch/arm64/features.c
+++ b/lib/cobalt/arch/arm64/features.c
@@ -59,9 +59,13 @@ void cobalt_check_features(struct cobalt_featinfo *finfo)
 
page_size = sysconf(_SC_PAGESIZE);
 
+#ifndef __aarch64__
__xn_tscinfo.kuser_tsc_get =
(__xn_rdtsc_t *)(0x1004 -
((*(unsigned *)(0x0ffc) + 3) << 5));
+#else
+   __xn_tscinfo.kuser_tsc_get = 0;
+#endif
 
phys_addr = (unsigned long)__xn_tscinfo.kinfo.counter;
 


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


[Xenomai-git] Dmitriy Cherkasov : cobalt/arm64: update register struct usage for arm64

2015-11-01 Thread git repository hosting
Module: xenomai-3
Branch: next
Commit: 0c39dd28c1daec0c42b91af3acf39f7d70fd995b
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=0c39dd28c1daec0c42b91af3acf39f7d70fd995b

Author: Dmitriy Cherkasov 
Date:   Thu May  7 13:58:14 2015 -0700

cobalt/arm64: update register struct usage for arm64

---

 .../arch/arm64/include/asm/xenomai/syscall.h   |   22 ++--
 kernel/cobalt/arch/arm64/mayday.c  |   20 +-
 2 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/kernel/cobalt/arch/arm64/include/asm/xenomai/syscall.h 
b/kernel/cobalt/arch/arm64/include/asm/xenomai/syscall.h
index d80df77..f0a1090 100644
--- a/kernel/cobalt/arch/arm64/include/asm/xenomai/syscall.h
+++ b/kernel/cobalt/arch/arm64/include/asm/xenomai/syscall.h
@@ -36,21 +36,21 @@
 #define __xn_reg_sys(__regs)   ((__regs)->ARM_ORIG_r0)
 /* In OABI_COMPAT mode, handle both OABI and EABI userspace syscalls */
 #ifdef CONFIG_OABI_COMPAT
-#define __xn_syscall_p(__regs) (((__regs)->ARM_r7 == __NR_OABI_SYSCALL_BASE + 
XENO_ARM_SYSCALL) || \
-((__regs)->ARM_r7 == __ARM_NR_ipipe))
+#define __xn_syscall_p(__regs) (((__regs)->regs[7] == __NR_OABI_SYSCALL_BASE + 
XENO_ARM_SYSCALL) || \
+((__regs)->regs[7] == __ARM_NR_ipipe))
 #else /* !CONFIG_OABI_COMPAT */
-#define __xn_syscall_p(__regs) ((__regs)->ARM_r7 == __ARM_NR_ipipe)
+#define __xn_syscall_p(__regs) ((__regs)->regs[7] == __ARM_NR_ipipe)
 #endif /* !CONFIG_OABI_COMPAT */
 #define __xn_syscall(__regs)   (__xn_reg_sys(__regs) & ~__COBALT_SYSCALL_BIT)
 
-#define __xn_reg_rval(__regs)  ((__regs)->ARM_r0)
-#define __xn_reg_arg1(__regs)  ((__regs)->ARM_r1)
-#define __xn_reg_arg2(__regs)  ((__regs)->ARM_r2)
-#define __xn_reg_arg3(__regs)  ((__regs)->ARM_r3)
-#define __xn_reg_arg4(__regs)  ((__regs)->ARM_r4)
-#define __xn_reg_arg5(__regs)  ((__regs)->ARM_r5)
-#define __xn_reg_pc(__regs)((__regs)->ARM_ip)
-#define __xn_reg_sp(__regs)((__regs)->ARM_sp)
+#define __xn_reg_rval(__regs)  ((__regs)->regs[0])
+#define __xn_reg_arg1(__regs)  ((__regs)->regs[1])
+#define __xn_reg_arg2(__regs)  ((__regs)->regs[2])
+#define __xn_reg_arg3(__regs)  ((__regs)->regs[3])
+#define __xn_reg_arg4(__regs)  ((__regs)->regs[4])
+#define __xn_reg_arg5(__regs)  ((__regs)->regs[5])
+#define __xn_reg_pc(__regs)((__regs)->ip)
+#define __xn_reg_sp(__regs)((__regs)->sp)
 
 static inline void __xn_error_return(struct pt_regs *regs, int v)
 {
diff --git a/kernel/cobalt/arch/arm64/mayday.c 
b/kernel/cobalt/arch/arm64/mayday.c
index 20e4559..bc51ad6 100644
--- a/kernel/cobalt/arch/arm64/mayday.c
+++ b/kernel/cobalt/arch/arm64/mayday.c
@@ -120,27 +120,27 @@ void *xnarch_get_mayday_page(void)
 void xnarch_handle_mayday(struct xnarchtcb *tcb, struct pt_regs *regs,
  unsigned long tramp)
 {
-   tcb->mayday.pc = regs->ARM_pc;
-   tcb->mayday.r0 = regs->ARM_r0;
+   tcb->mayday.pc = regs->pc;
+   tcb->mayday.r0 = regs->regs[0];
 #ifdef __ARM_EABI__
-   tcb->mayday.r7 = regs->ARM_r7;
+   tcb->mayday.r7 = regs->regs[7];
 #endif
 #ifdef CONFIG_ARM_THUMB
/* The code on the mayday page must be run in ARM mode */
-   tcb->mayday.psr = regs->ARM_cpsr;
-   regs->ARM_cpsr &= ~PSR_T_BIT;
+   tcb->mayday.psr = regs->cpsr;
+   regs->cpsr &= ~PSR_T_BIT;
 #endif
-   regs->ARM_pc = tramp;
+   regs->pc = tramp;
 }
 
 void xnarch_fixup_mayday(struct xnarchtcb *tcb, struct pt_regs *regs)
 {
-   regs->ARM_pc = tcb->mayday.pc;
-   regs->ARM_r0 = tcb->mayday.r0;
+   regs->pc = tcb->mayday.pc;
+   regs->regs[0] = tcb->mayday.r0;
 #ifdef __ARM_EABI__
-   regs->ARM_r7 = tcb->mayday.r7;
+   regs->regs[7] = tcb->mayday.r7;
 #endif
 #ifdef CONFIG_ARM_THUMB
-   regs->ARM_cpsr = tcb->mayday.psr;
+   regs->cpsr = tcb->mayday.psr;
 #endif
 }


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


[Xenomai-git] Philippe Gerum : cobalt/arm64: use regular context switching code

2015-11-01 Thread git repository hosting
Module: xenomai-3
Branch: next
Commit: 1b674296b5ee9fdad5eebfe9a47bbf2d8e83c0b1
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=1b674296b5ee9fdad5eebfe9a47bbf2d8e83c0b1

Author: Philippe Gerum 
Date:   Sat Oct 17 18:07:59 2015 +0200

cobalt/arm64: use regular context switching code

Instead of open coding a copy of the regular context switching code,
use __switch_to() directly, assuming the pipeline properly serializes
switches from all domains.

---

 kernel/cobalt/arch/arm64/thread.c |   66 +++--
 1 file changed, 5 insertions(+), 61 deletions(-)

diff --git a/kernel/cobalt/arch/arm64/thread.c 
b/kernel/cobalt/arch/arm64/thread.c
index 35dbd72..5282b0c 100644
--- a/kernel/cobalt/arch/arm64/thread.c
+++ b/kernel/cobalt/arch/arm64/thread.c
@@ -34,7 +34,7 @@
 #include 
 #include 
 
-#if defined(CONFIG_XENO_ARCH_FPU)
+#ifdef CONFIG_XENO_ARCH_FPU
 
 #define FPSIMD_EN (0x3 << 20)
 
@@ -60,13 +60,6 @@ static void enable_fpsimd(void)
set_cpacr(cpacr);
 }
 
-static void disable_fpsimd(void)
-{
-   unsigned long cpacr = get_cpacr();
-   cpacr &= ~FPSIMD_EN;
-   set_cpacr(cpacr);
-}
-
 int xnarch_fault_fpu_p(struct ipipe_trap_data *d)
 {
return (d->exception == IPIPE_TRAP_FPU_ACC);
@@ -130,55 +123,17 @@ void xnarch_init_shadow_tcb(struct xnthread *thread)
tcb->fpup = &(tcb->core.host_task->thread.fpsimd_state);
xnthread_clear_state(thread, XNFPU);
 }
-#endif /* CONFIG_XENO_ARCH_FPU */
 
-/* Switch support functions */
-static void xnarch_tls_thread_switch(struct task_struct *next)
-{
-   unsigned long tpidr, tpidrro;
-
-   if (!is_compat_task()) {
-   asm("mrs %0, tpidr_el0" : "=r" (tpidr));
-   current->thread.tp_value = tpidr;
-   }
-
-   if (is_compat_thread(task_thread_info(next))) {
-   tpidr = 0;
-   tpidrro = next->thread.tp_value;
-   } else {
-   tpidr = next->thread.tp_value;
-   tpidrro = 0;
-   }
-
-   asm(
-   "   msr tpidr_el0, %0\n"
-   "   msr tpidrro_el0, %1"
-   : : "r" (tpidr), "r" (tpidrro));
-}
-
-#ifdef CONFIG_PID_IN_CONTEXTIDR
-static inline void xnarch_contextidr_thread_switch(struct task_struct *next)
-{
-   asm(
-   "   msr contextidr_el1, %0\n"
-   "   isb"
-   :
-   : "r" (task_pid_nr(next)));
-}
-#else
-static inline void xnarch_contextidr_thread_switch(struct task_struct *next)
-{
-}
-#endif
-/* End switch support functions */
+#endif /* CONFIG_XENO_ARCH_FPU */
 
 void xnarch_switch_to(struct xnthread *out, struct xnthread *in)
 {
struct xnarchtcb *out_tcb = >tcb, *in_tcb = >tcb;
struct mm_struct *prev_mm, *next_mm;
-   struct task_struct *next;
+   struct task_struct *prev, *next;
 
next = in_tcb->core.host_task;
+   prev = out_tcb->core.host_task;
prev_mm = out_tcb->core.active_mm;
 
next_mm = in_tcb->core.mm;
@@ -198,18 +153,7 @@ void xnarch_switch_to(struct xnthread *out, struct 
xnthread *in)
enter_lazy_tlb(prev_mm, next);
}
 
-   xnarch_tls_thread_switch(in_tcb->core.tip->task);
-   xnarch_contextidr_thread_switch(in_tcb->core.tip->task);
-
-   /*
-* Complete any pending TLB or cache maintenance on this CPU in case
-* the thread migrates to a different CPU.
-*/
-   dsb(ish);
-
-   disable_fpsimd();
-
-   cpu_switch_to(out_tcb->core.tip->task, in_tcb->core.tip->task);
+   __switch_to(prev, next);
 }
 
 int xnarch_escalate(void)


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


[Xenomai-git] Dmitriy Cherkasov : cobalt/arm64: thread.h & syscall.h: fix register references for arm64

2015-11-01 Thread git repository hosting
Module: xenomai-3
Branch: next
Commit: 0967e0a24636f24cf0c6b8cf74e8d3e4f8c6f2ee
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=0967e0a24636f24cf0c6b8cf74e8d3e4f8c6f2ee

Author: Dmitriy Cherkasov 
Date:   Thu May  7 16:41:09 2015 -0700

cobalt/arm64: thread.h & syscall.h: fix register references for arm64

---

 kernel/cobalt/arch/arm64/include/asm/xenomai/syscall.h |8 ++--
 kernel/cobalt/arch/arm64/include/asm/xenomai/thread.h  |2 +-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/kernel/cobalt/arch/arm64/include/asm/xenomai/syscall.h 
b/kernel/cobalt/arch/arm64/include/asm/xenomai/syscall.h
index f0a1090..2fdd890 100644
--- a/kernel/cobalt/arch/arm64/include/asm/xenomai/syscall.h
+++ b/kernel/cobalt/arch/arm64/include/asm/xenomai/syscall.h
@@ -28,12 +28,16 @@
 #include 
 #include 
 
+#ifndef __NR_SYSCALL_BASE
+#define __NR_SYSCALL_BASE 0
+#endif
+
 #ifndef __ARM_NR_ipipe
 /* Legacy pipelines do not define this. */
 #define __ARM_NR_ipipe (__NR_SYSCALL_BASE + XENO_ARM_SYSCALL)
 #endif
 
-#define __xn_reg_sys(__regs)   ((__regs)->ARM_ORIG_r0)
+#define __xn_reg_sys(__regs)   ((__regs)->orig_x0)
 /* In OABI_COMPAT mode, handle both OABI and EABI userspace syscalls */
 #ifdef CONFIG_OABI_COMPAT
 #define __xn_syscall_p(__regs) (((__regs)->regs[7] == __NR_OABI_SYSCALL_BASE + 
XENO_ARM_SYSCALL) || \
@@ -49,7 +53,7 @@
 #define __xn_reg_arg3(__regs)  ((__regs)->regs[3])
 #define __xn_reg_arg4(__regs)  ((__regs)->regs[4])
 #define __xn_reg_arg5(__regs)  ((__regs)->regs[5])
-#define __xn_reg_pc(__regs)((__regs)->ip)
+#define __xn_reg_pc(__regs)((__regs)->pc)
 #define __xn_reg_sp(__regs)((__regs)->sp)
 
 static inline void __xn_error_return(struct pt_regs *regs, int v)
diff --git a/kernel/cobalt/arch/arm64/include/asm/xenomai/thread.h 
b/kernel/cobalt/arch/arm64/include/asm/xenomai/thread.h
index 11439a3..958f340 100644
--- a/kernel/cobalt/arch/arm64/include/asm/xenomai/thread.h
+++ b/kernel/cobalt/arch/arm64/include/asm/xenomai/thread.h
@@ -52,7 +52,7 @@ struct xnarchtcb {
 #define xnarch_fault_regs(d)   ((d)->regs)
 #define xnarch_fault_trap(d)   ((d)->exception)
 #define xnarch_fault_code(d)   (0)
-#define xnarch_fault_pc(d) ((d)->regs->ARM_pc - (thumb_mode((d)->regs) ? 2 
: 4)) /* XXX ? */
+#define xnarch_fault_pc(d) ((d)->regs->pc - 4) /* XXX ? */
 
 #define xnarch_fault_pf_p(d)   ((d)->exception == IPIPE_TRAP_ACCESS)
 #define xnarch_fault_bp_p(d)   ((current->ptrace & PT_PTRACED) &&  \


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


[Xenomai-git] Philippe Gerum : cobalt/arm64: add README for I-pipe support

2015-11-01 Thread git repository hosting
Module: xenomai-3
Branch: next
Commit: 7bddbcbe43597311bce4203342ff2d90270328ff
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=7bddbcbe43597311bce4203342ff2d90270328ff

Author: Philippe Gerum 
Date:   Sun Nov  1 17:22:33 2015 +0100

cobalt/arm64: add README for I-pipe support

---

 kernel/cobalt/arch/arm64/patches/README |   16 
 1 file changed, 16 insertions(+)

diff --git a/kernel/cobalt/arch/arm64/patches/README 
b/kernel/cobalt/arch/arm64/patches/README
new file mode 100644
index 000..fd85e06
--- /dev/null
+++ b/kernel/cobalt/arch/arm64/patches/README
@@ -0,0 +1,16 @@
+-- arch/arm64/patches
+
+Xenomai needs special kernel support to deliver fast and deterministic
+response time to external interrupts, and also to provide real-time
+services highly integrated with the standard Linux kernel.
+
+This support is provided by the interrupt pipeline (aka I-pipe) in the
+form of a kernel patch you have to apply against a vanilla kernel
+tree, before you attempt to compile the Xenomai codebase against the
+latter kernel.
+
+The Xenomai arm64 port is work in progress. The I-pipe support for
+this architecture is exclusively available from this development tree
+at the moment:
+
+git://git.xenomai.org/ipipe.git, branch devel/ipipe-3.18-linaro-arm64.


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


[Xenomai-git] Philippe Gerum : cobalt/arm64: drop aarch32 bits from feature set

2015-11-01 Thread git repository hosting
Module: xenomai-3
Branch: next
Commit: 5475d8fa2163e74595018227dea56ea19d9218a3
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=5475d8fa2163e74595018227dea56ea19d9218a3

Author: Philippe Gerum 
Date:   Thu Sep 17 02:16:10 2015 +0200

cobalt/arm64: drop aarch32 bits from feature set

---

 .../arch/arm64/include/asm/xenomai/features.h  |   44 ++--
 1 file changed, 4 insertions(+), 40 deletions(-)

diff --git a/lib/cobalt/arch/arm64/include/asm/xenomai/features.h 
b/lib/cobalt/arch/arm64/include/asm/xenomai/features.h
index 0d6702b..6dfe64c 100644
--- a/lib/cobalt/arch/arm64/include/asm/xenomai/features.h
+++ b/lib/cobalt/arch/arm64/include/asm/xenomai/features.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2005 Philippe Gerum .
+ * Copyright (C) 2015 Philippe Gerum .
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -15,52 +15,16 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
  */
-#ifndef _LIB_COBALT_ARM_FEATURES_H
-#define _LIB_COBALT_ARM_FEATURES_H
+#ifndef _LIB_COBALT_ARM64_FEATURES_H
+#define _LIB_COBALT_ARM64_FEATURES_H
 
 #include_next 
 #include 
 
-#if defined(__ARM_ARCH_2__)
-#define __LINUX_ARM_ARCH__ 2
-#endif /* armv2 */
-
-#if defined(__ARM_ARCH_3__)
-#define __LINUX_ARM_ARCH__ 3
-#endif /* armv3 */
-
-#if defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__)
-#define __LINUX_ARM_ARCH__ 4
-#endif /* armv4 */
-
-#if defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5T__) \
-   || defined(__ARM_ARCH_5E__) || defined(__ARM_ARCH_5TE__)
-#define __LINUX_ARM_ARCH__ 5
-#endif /* armv5 */
-
-#if defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6K__) \
-   || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__)
-#define __LINUX_ARM_ARCH__ 6
-#endif /* armv6 */
-
-#if defined(__ARM_ARCH_7A__)
-#define __LINUX_ARM_ARCH__ 7
-#endif /* armv7 */
-
-#if defined(__aarch64__)
 #define __LINUX_ARM_ARCH__ 8
-#endif /* armv8 */
-
-#ifndef __LINUX_ARM_ARCH__
-#error "Could not find current ARM architecture"
-#endif
-
-#if __LINUX_ARM_ARCH__ < 6 && defined(CONFIG_SMP)
-#error "SMP not supported below armv6, compile with -march=armv6 or above"
-#endif
 
 #include 
 
 int cobalt_fp_detect(void);
 
-#endif /* !_LIB_COBALT_ARM_FEATURES_H */
+#endif /* !_LIB_COBALT_ARM64_FEATURES_H */


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


[Xenomai-git] Gilles Chanteperdrix : testsuite/switchtest: fix mode switches

2015-11-01 Thread git repository hosting
Module: xenomai-3
Branch: next
Commit: 36bc091eef222e5c228f2dc3c39b90dff0a8e263
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=36bc091eef222e5c228f2dc3c39b90dff0a8e263

Author: Gilles Chanteperdrix 
Date:   Thu Oct 29 22:57:48 2015 +0100

testsuite/switchtest: fix mode switches

Since the changes in pthread_setmode_np() API, switchtest threads all
ran in primary mode, fix this by using the cobalt_thread_relax() service
to switch to secondary mode instead of pthread_setmode_np().

---

 testsuite/switchtest/switchtest.c |   50 -
 1 file changed, 22 insertions(+), 28 deletions(-)

diff --git a/testsuite/switchtest/switchtest.c 
b/testsuite/switchtest/switchtest.c
index 8f54a94..5c102a2 100644
--- a/testsuite/switchtest/switchtest.c
+++ b/testsuite/switchtest/switchtest.c
@@ -38,6 +38,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #if CONFIG_SMP
 #define smp_sched_setaffinity(pid,len,mask) sched_setaffinity(pid,len,mask)
@@ -89,6 +90,7 @@ static pthread_mutex_t headers_lock;
 static unsigned long data_lines = 21;
 static unsigned freeze_on_error;
 static int fp_features;
+static pthread_t main_tid;
 
 static inline unsigned stack_size(unsigned size)
 {
@@ -98,7 +100,7 @@ static inline unsigned stack_size(unsigned size)
 static inline void clean_exit(int retval)
 {
status = retval;
-   kill(getpid(), SIGTERM);
+   __STD(pthread_kill(main_tid, SIGTERM));
for (;;)
/* Wait for cancellation. */
__STD(sem_wait(_start));
@@ -427,6 +429,18 @@ static void *fpu_stress(void *cookie)
return NULL;
 }
 
+static void set_mode(const char *prefix, int fd, unsigned mode)
+{
+   switch (mode) {
+   case 1:
+   cobalt_thread_harden();
+   return;
+
+   case 2:
+   cobalt_thread_relax();
+   }
+}
+
 static void *rtup(void *cookie)
 {
struct task_params *param = (struct task_params *) cookie;
@@ -450,12 +464,7 @@ static void *rtup(void *cookie)
   allowed when suspended in ioctl. */
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
 
-   if ((err = pthread_setmode_np(0, PTHREAD_CONFORMING, NULL))) {
-   fprintf(stderr,
-   "rtup: pthread_setmode_np: %s\n",
-   strerror(err));
-   clean_exit(EXIT_FAILURE);
-   }
+   set_mode("rtup", fd, 1);
 
do {
err = ioctl(fd, RTTST_RTIOC_SWTEST_PEND, >swt);
@@ -536,12 +545,7 @@ static void *rtus(void *cookie)
   allowed when suspended in ioctl. */
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
 
-   if ((err = pthread_setmode_np(PTHREAD_CONFORMING, 0, NULL))) {
-   fprintf(stderr,
-   "rtus: pthread_setmode_np: %s\n",
-   strerror(err));
-   clean_exit(EXIT_FAILURE);
-   }
+   set_mode("rtus", fd, 2);
 
do {
err = ioctl(fd, RTTST_RTIOC_SWTEST_PEND, >swt);
@@ -622,12 +626,8 @@ static void *rtuo(void *cookie)
   allowed when suspended in ioctl. */
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
 
-   if ((err = pthread_setmode_np(0, PTHREAD_CONFORMING, NULL))) {
-   fprintf(stderr,
-   "rtup: pthread_setmode_np: %s\n",
-   strerror(err));
-   clean_exit(EXIT_FAILURE);
-   }
+   mode = 1;
+   set_mode("rtuo", fd, mode);
do {
err = ioctl(fd, RTTST_RTIOC_SWTEST_PEND, >swt);
} while (err == -1 && errno == EINTR);
@@ -635,7 +635,6 @@ static void *rtuo(void *cookie)
if (err == -1)
return NULL;
 
-   mode = PTHREAD_CONFORMING;
for (;;) {
unsigned expected, fp_val;
 
@@ -680,14 +679,8 @@ static void *rtuo(void *cookie)
 
/* Switch mode. */
if (i % 3 == 2) {
-   mode = PTHREAD_CONFORMING - mode;
-   if ((err = pthread_setmode_np
-(PTHREAD_CONFORMING - mode, mode, NULL))) {
-   fprintf(stderr,
-   "rtuo: pthread_setmode_np: %s\n",
-   strerror(err));
-   clean_exit(EXIT_FAILURE);
-   }
+   mode = 3 - mode;
+   set_mode("rtuo", fd, mode);
}
 
if(++i == 400)
@@ -1133,6 +1126,7 @@ int main(int argc, const char *argv[])
int sig;
 
status = EXIT_SUCCESS;
+   main_tid = pthread_self();
 
/* Initializations. */
if (__STD(sem_init(_start, 0, 0))) {


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


[Xenomai-git] Dmitriy Cherkasov : cobalt/arm64: add lazy FPU switching

2015-11-01 Thread git repository hosting
Module: xenomai-3
Branch: next
Commit: 34d5c0478261bec5c5bdf139943e27dc02ac810a
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=34d5c0478261bec5c5bdf139943e27dc02ac810a

Author: Dmitriy Cherkasov 
Date:   Thu Oct  1 15:47:41 2015 -0700

cobalt/arm64: add lazy FPU switching

---

 kernel/cobalt/arch/arm64/thread.c |   83 +++--
 1 file changed, 62 insertions(+), 21 deletions(-)

diff --git a/kernel/cobalt/arch/arm64/thread.c 
b/kernel/cobalt/arch/arm64/thread.c
index 316525f6..db369be 100644
--- a/kernel/cobalt/arch/arm64/thread.c
+++ b/kernel/cobalt/arch/arm64/thread.c
@@ -32,16 +32,31 @@
 #include 
 #include 
 #include 
-
+#include 
 
 #if defined(CONFIG_XENO_ARCH_FPU)
 
-static DEFINE_MUTEX(vfp_check_lock);
+static void enable_fpsimd(void) {
+   __asm__ __volatile__("mrs x1, cpacr_el1\n\
+   orr x1, x1, #(0x3 << 20)\n\
+   msr cpacr_el1, x1\n\
+   isb" : : : "x1", "memory", "cc");
+}
 
+static void disable_fpsimd(void) {
+   __asm__ __volatile__("mrs x1, cpacr_el1\n\
+   and x1, x1, #~(0x3 << 20)\n\
+   msr cpacr_el1, x1\n\
+   isb" : : : "x1", "memory", "cc");
+}
 
 int xnarch_fault_fpu_p(struct ipipe_trap_data *d)
 {
-   /* FPU never trapped, this will be a fault */
+   /* check if this is an FPU access trap to be handled by Xenomai */
+   if(d->exception == IPIPE_TRAP_FPU_ACC){
+   return 1;
+   }
+   /* FPU already enabled, propagate fault to kernel */
return 0;
 }
 
@@ -53,6 +68,7 @@ void xnarch_leave_root(struct xnthread *root)
 {
struct xnarchtcb *rootcb = xnthread_archtcb(root);
rootcb->fpup = get_fpu_owner(rootcb);
+   disable_fpsimd();
 }
 
 void xnarch_save_fpu(struct xnthread *thread)
@@ -65,45 +81,67 @@ void xnarch_save_fpu(struct xnthread *thread)
 void xnarch_switch_fpu(struct xnthread *from, struct xnthread *to)
 {
struct fpsimd_state *const from_fpup = from ? from->tcb.fpup : NULL;
-
-   /* always switch, no lazy switching */
-
struct fpsimd_state *const to_fpup = to->tcb.fpup;
 
-   if (from_fpup == to_fpup)
-   return;
+   /*
+* This only gets called if XNFPU flag is set, or if migrating to Linux.
+* In both cases, this means turn on FPU and switch.
+*/
+   enable_fpsimd();
+
+   if (xnthread_test_state(to, XNROOT) == 0) {
+   if (from_fpup == to_fpup)
+   return;
 
-   if (from_fpup)
-   fpsimd_save_state(from_fpup);
+   if (from_fpup)
+   fpsimd_save_state(from_fpup);
 
-   fpsimd_load_state(to_fpup);
+   fpsimd_load_state(to_fpup);
+   }
+   else {
+   /* Going to Linux. */
+   if (from_fpup)
+   fpsimd_save_state(from_fpup);
 
-   /* always set FPU enabled */
-   xnthread_set_state(to, XNFPU);
+   fpsimd_load_state(to_fpup);
+   }
 
 }
 
 int xnarch_handle_fpu_fault(struct xnthread *from, 
struct xnthread *to, struct ipipe_trap_data *d)
 {
-   /* FPU always enabled, faults force exit to Linux */
-   return 0;
+   spl_t s;
+
+   if (xnthread_test_state(to, XNFPU))
+   /* FPU is already enabled, probably an exception */
+  return 0;
+
+   xnlock_get_irqsave(, s);
+   xnthread_set_state(to, XNFPU);
+   xnlock_put_irqrestore(, s);
+
+   xnarch_switch_fpu(from, to);
+
+   return 1;
+
 }
 
 void xnarch_init_shadow_tcb(struct xnthread *thread)
 {
+   spl_t s;
struct xnarchtcb *tcb = xnthread_archtcb(thread);
 
tcb->fpup = &(tcb->core.host_task->thread.fpsimd_state);
 
-   /* XNFPU is always set, no lazy switching */
-   xnthread_set_state(thread, XNFPU);
+   xnlock_get_irqsave(, s);
+   xnthread_clear_state(thread, XNFPU);
+   xnlock_put_irqrestore(, s);
+
 }
 #endif /* CONFIG_XENO_ARCH_FPU */
 
-
 /* Switch support functions */
-
 static void xnarch_tls_thread_switch(struct task_struct *next)
 {
unsigned long tpidr, tpidrro;
@@ -141,8 +179,7 @@ static inline void xnarch_contextidr_thread_switch(struct 
task_struct *next)
 {
 }
 #endif
-
-/*/Switch support functions */
+/* End switch support functions */
 
 void xnarch_switch_to(struct xnthread *out, struct xnthread *in)
 {
@@ -173,6 +210,10 @@ void xnarch_switch_to(struct xnthread *out, struct 
xnthread *in)
xnarch_tls_thread_switch(in_tcb->core.tip->task);
xnarch_contextidr_thread_switch(in_tcb->core.tip->task);
 
+   /* check if we need to switch FPU on return to Linux */
+   if (xnthread_test_state(in, XNROOT) == 1)
+   xnarch_switch_fpu(out, in);
+
/*
 * Complete any pending TLB or cache maintenance on this CPU in case
 * the thread 

[Xenomai-git] Philippe Gerum : cobalt/arm64: drop useless test on target architecture

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

Author: Philippe Gerum 
Date:   Sat Oct 17 14:43:25 2015 +0200

cobalt/arm64: drop useless test on target architecture

---

 kernel/cobalt/arch/arm64/include/asm/xenomai/uapi/features.h |7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/kernel/cobalt/arch/arm64/include/asm/xenomai/uapi/features.h 
b/kernel/cobalt/arch/arm64/include/asm/xenomai/uapi/features.h
index 57d0f14..01a12d9 100644
--- a/kernel/cobalt/arch/arm64/include/asm/xenomai/uapi/features.h
+++ b/kernel/cobalt/arch/arm64/include/asm/xenomai/uapi/features.h
@@ -28,10 +28,9 @@
 
 #define XENOMAI_FEAT_MAN (__xn_feat_generic_man_mask)
 
-#ifndef __aarch64__
-#define XNARCH_HAVE_LLMULSHFT1
-#define XNARCH_HAVE_NODIV_LLIMD  1
-#endif
+#undef XNARCH_HAVE_LLMULSHFT
+
+#undef XNARCH_HAVE_NODIV_LLIMD
 
 struct cobalt_featinfo_archdep { /* no arch-specific feature */ };
 


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


[Xenomai-git] Dmitriy Cherkasov : cobalt/arm64: machine.h: use slightly faster ffnz implementation

2015-11-01 Thread git repository hosting
Module: xenomai-3
Branch: next
Commit: 904047c9fd8de11381b5cf92ac7c066a11cad3e4
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=904047c9fd8de11381b5cf92ac7c066a11cad3e4

Author: Dmitriy Cherkasov 
Date:   Wed Jun 17 16:09:20 2015 -0700

cobalt/arm64: machine.h: use slightly faster ffnz implementation

---

 kernel/cobalt/arch/arm64/include/asm/xenomai/machine.h |   12 +++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/kernel/cobalt/arch/arm64/include/asm/xenomai/machine.h 
b/kernel/cobalt/arch/arm64/include/asm/xenomai/machine.h
index 417a7b0..b8290bf 100644
--- a/kernel/cobalt/arch/arm64/include/asm/xenomai/machine.h
+++ b/kernel/cobalt/arch/arm64/include/asm/xenomai/machine.h
@@ -37,13 +37,23 @@
 #include 
 #include 
 #include 
+#include 
 
 /* D-side always behaves as PIPT on AArch64 (see 
arch/arm64/include/asm/cachetype.h) */
 #define xnarch_cache_aliasing() 0
 
 static inline __attribute_const__ unsigned long ffnz(unsigned long ul)
 {
-   return __builtin_ffsl(ul) - 1;
+   int __r;
+
+   /* zero input is not valid */
+   XENO_WARN_ON(COBALT, ul == 0);
+
+   __asm__ ("rbit\t%0, %1\n"
+"clz\t%0, %0\n"
+   : "=r" (__r) : "r"(ul) : "cc");
+
+   return __r;
 }
 
 #include 


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


[Xenomai-git] Dmitriy Cherkasov : cobalt/arm64: thread: use kernel switch_to

2015-11-01 Thread git repository hosting
Module: xenomai-3
Branch: next
Commit: 334b8fb944e9c726916bf484df0edf828ac3b0b7
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=334b8fb944e9c726916bf484df0edf828ac3b0b7

Author: Dmitriy Cherkasov 
Date:   Fri May 15 23:26:18 2015 -0700

cobalt/arm64: thread: use kernel switch_to

---

 kernel/cobalt/arch/arm64/Makefile |2 +-
 kernel/cobalt/arch/arm64/switch.S |  167 -
 kernel/cobalt/arch/arm64/thread.c |5 +-
 3 files changed, 2 insertions(+), 172 deletions(-)

diff --git a/kernel/cobalt/arch/arm64/Makefile 
b/kernel/cobalt/arch/arm64/Makefile
index a135f99..af0a0e8 100644
--- a/kernel/cobalt/arch/arm64/Makefile
+++ b/kernel/cobalt/arch/arm64/Makefile
@@ -1,5 +1,5 @@
 obj-$(CONFIG_XENOMAI) += xenomai.o
 
-xenomai-y := machine.o mayday.o thread.o switch.o syscall.o
+xenomai-y := machine.o mayday.o thread.o syscall.o
 
 ccflags-y := -Iarch/arm64/xenomai/include -Iinclude/xenomai
diff --git a/kernel/cobalt/arch/arm64/switch.S 
b/kernel/cobalt/arch/arm64/switch.S
deleted file mode 100644
index 505fd5a..000
--- a/kernel/cobalt/arch/arm64/switch.S
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * Copyright (C) 2005 Stelian Pop.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139,
- * USA; either version 2 of the License, or (at your option) any later
- * version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#ifdef CONFIG_VFP
-#include 
-#endif
-
-   .macro fpu_switch tmp
-#ifdef CONFIG_VFP
-#if __LINUX_ARM_ARCH__ <= 6
-#ifdef CONFIG_JUMP_LABEL
-9998:  nop
-   .pushsection __jump_table, "aw"
-   .word   9998b, f, __xeno_vfp_key
-   .popsection
-#else
-   ldr \tmp, =elf_hwcap
-   ldr \tmp, [\tmp]
-   tst \tmp, #HWCAP_VFP
-   beq f
-#endif
-#endif
-   @ Always disable VFP so we can lazily save/restore the old
-   @ state. This occurs in the context of the previous thread.
-   VFPFMRX \tmp, FPEXC
-   bic \tmp, \tmp, #FPEXC_EN
-   VFPFMXR FPEXC, \tmp
-#if __LINUX_ARM_ARCH__ <= 6
-:
-#endif
-#endif
-   .endm
-
-   .text
-
-#if defined(CONFIG_VFP) && defined(CONFIG_XENO_ARCH_FPU)
-/* Copied from vfp_save_state in arch/arm/vfp/vfphw.S
- * r0 = pointer to union vfp_state, r1 = fpexc
- */
-ENTRY(__asm_vfp_save)
-   VFPFSTMIA   r0, r2  @ save the working registers
-   VFPFMRX r2, FPSCR   @ current status
-   tst r1, #FPEXC_EX   @ is there additional state to save?
-   beq 1f
-   VFPFMRX r3, FPINST  @ FPINST (only if FPEXC.EX is set)
-   tst r1, #FPEXC_FP2V @ is there an FPINST2 to read?
-   beq 1f
-   VFPFMRX r12, FPINST2@ FPINST2 if needed (and present)
-1:
-   stmia   r0, {r1, r2, r3, r12}   @ save FPEXC, FPSCR, FPINST, 
FPINST2
-   mov pc, lr
-ENDPROC(__asm_vfp_save)
-
-/* Copied from no_old_VFP_process in arch/arm/vfp/vfphw.S
- * r0 = pointer to union vfp_state
- * r1 = current cpu
- */
-ENTRY(__asm_vfp_load)
-#ifdef CONFIG_SMP
-   str r1, [r0, #VFP_CPU]
-#endif
-   VFPFLDMIA   r0, r2  @ reload the working registers while
-   @ FPEXC is in a safe state
-   ldmia   r0, {r1, r2, r3, r12}   @ load FPEXC, FPSCR, FPINST, 
FPINST2
-   tst r1, #FPEXC_EX   @ is there additional state to restore?
-   beq 1f
-   VFPFMXR FPINST, r3  @ restore FPINST (only if FPEXC.EX is 
set)
-   tst r1, #FPEXC_FP2V @ is there an FPINST2 to write?
-   beq 1f
-   VFPFMXR FPINST2, r12@ FPINST2 if needed (and present)
-1:
-   VFPFMXR FPSCR, r2   @ restore status
-   mov pc, lr
-ENDPROC(__asm_vfp_load)
-#endif
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 11, 0)
-   .macro load_tls base, tp, tpuser
-   ldr \tp, [\base, #TI_TP_VALUE]
-   .endm
-
-   .macro switch_tls base, tp, tpuser, tmp1, tmp2
-   set_tls \tp, \tmp1, \tmp2
-   .endm
-#else
-   .macro load_tls base, tp, tpuser
-   ldr \tp, [\base, #TI_TP_VALUE]
-   ldr \tpuser, [\base, #TI_TP_VALUE + 4]
-   .endm
-#endif
-
-/*
-/*
- * Switch context routine.
- *
- * Registers 

[Xenomai-git] Don Mahurin : lib/cobalt/arm64: replace tsc counter

2015-11-01 Thread git repository hosting
Module: xenomai-3
Branch: next
Commit: 53799d68262e2452794417a468d375ed51e79803
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=53799d68262e2452794417a468d375ed51e79803

Author: Don Mahurin 
Date:   Wed May 13 09:36:25 2015 -0700

lib/cobalt/arm64: replace tsc counter

---

 lib/cobalt/arch/arm64/include/asm/xenomai/tsc.h |   19 +++
 1 file changed, 19 insertions(+)

diff --git a/lib/cobalt/arch/arm64/include/asm/xenomai/tsc.h 
b/lib/cobalt/arch/arm64/include/asm/xenomai/tsc.h
index 594c4ad..a055427 100644
--- a/lib/cobalt/arch/arm64/include/asm/xenomai/tsc.h
+++ b/lib/cobalt/arch/arm64/include/asm/xenomai/tsc.h
@@ -27,6 +27,8 @@
 
 #include 
 #include 
+#include 
+#include 
 
 /*
  * Putting kuser_tsc_get and kinfo.counter in the same struct results
@@ -39,10 +41,27 @@ struct __xn_full_tscinfo {
 };
 extern struct __xn_full_tscinfo __xn_tscinfo;
 
+static inline uint64_t get_counter(void)
+{
+uint64_t cval;
+
+#ifdef __aarch64__
+   asm volatile("isb; mrs %0, cntvct_el0; isb; " : "=r" (cval) :: 
"memory");
+#else
+   asm volatile("isb; mrrc p15, 1, %Q0, %R0, c14; isb" : "=r" (cval) :: 
"memory");
+#endif
+
+   return cval;
+}
+
 static inline __attribute__((always_inline))
 unsigned long long cobalt_read_tsc(void)
 {
+#ifndef __aarch64__
return __xn_tscinfo.kuser_tsc_get(__xn_tscinfo.kinfo.counter);
+#else
+   return get_counter();
+#endif
 }
 
 #endif /* !_LIB_COBALT_ARM_TSC_H */


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


[Xenomai-git] Gilles Chanteperdrix : arm64: attempt at fixing fpu switch

2015-11-01 Thread git repository hosting
Module: xenomai-3
Branch: next
Commit: 1fdcc44131031c06ebc0d33c76c68f4ebee3f118
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=1fdcc44131031c06ebc0d33c76c68f4ebee3f118

Author: Gilles Chanteperdrix 
Date:   Fri Oct 30 17:14:00 2015 +0100

arm64: attempt at fixing fpu switch

Return to eager switching, since user-space applications use FPU
registers even when not using the FPU, but use an auxiliary backup area
when the "TIF_FOREIGN_FPSTATE" bit is set, in order to avoid clobbering
the saved FPU state.

---

 .../cobalt/arch/arm64/include/asm/xenomai/thread.h |   14 +++--
 kernel/cobalt/arch/arm64/thread.c  |   54 +---
 2 files changed, 25 insertions(+), 43 deletions(-)

diff --git a/kernel/cobalt/arch/arm64/include/asm/xenomai/thread.h 
b/kernel/cobalt/arch/arm64/include/asm/xenomai/thread.h
index 9055e58..4b247ac 100644
--- a/kernel/cobalt/arch/arm64/include/asm/xenomai/thread.h
+++ b/kernel/cobalt/arch/arm64/include/asm/xenomai/thread.h
@@ -24,6 +24,7 @@
 struct xnarchtcb {
struct xntcb core;
 #ifdef CONFIG_XENO_ARCH_FPU
+   struct fpsimd_state xnfpsimd_state;
struct fpsimd_state *fpup;
 #define xnarch_fpu_ptr(tcb) ((tcb)->fpup)
 #endif
@@ -67,7 +68,10 @@ static inline void xnarch_init_root_tcb(struct xnthread 
*thread)
 
 void xnarch_init_shadow_tcb(struct xnthread *thread);
 
-int xnarch_fault_fpu_p(struct ipipe_trap_data *d);
+static inline int xnarch_fault_fpu_p(struct ipipe_trap_data *d)
+{
+   return xnarch_fault_trap(d) == IPIPE_TRAP_FPU_ACC;
+}
 
 void xnarch_leave_root(struct xnthread *root);
 
@@ -75,8 +79,12 @@ void xnarch_save_fpu(struct xnthread *thread);
 
 void xnarch_switch_fpu(struct xnthread *from, struct xnthread *thread);
 
-int xnarch_handle_fpu_fault(struct xnthread *from, 
-   struct xnthread *to, struct ipipe_trap_data *d);
+static inline int
+xnarch_handle_fpu_fault(struct xnthread *from,
+   struct xnthread *to, struct ipipe_trap_data *d)
+{
+   return 0;
+}
 
 #else /* !CONFIG_XENO_ARCH_FPU */
 
diff --git a/kernel/cobalt/arch/arm64/thread.c 
b/kernel/cobalt/arch/arm64/thread.c
index 2238751..b987e09 100644
--- a/kernel/cobalt/arch/arm64/thread.c
+++ b/kernel/cobalt/arch/arm64/thread.c
@@ -6,6 +6,7 @@
  * 
  * ARM64 port
  *   Copyright (C) 2015 Dmitriy Cherkasov 
+ *   Copyright (C) 2015 Gilles Chanteperdrix 
  *
  * Xenomai is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by
@@ -41,7 +42,7 @@
 static inline unsigned long get_cpacr(void)
 {
unsigned long result;
-   __asm__ __volatile__("mrs %0, cpacr_el1": "=r"(result));
+   __asm__ ("mrs %0, cpacr_el1": "=r"(result));
return result;
 }
 
@@ -53,21 +54,20 @@ static inline void set_cpacr(long val)
: /* */ : "r"(val));
 }
 
-static void enable_fpsimd(void)
+static inline void enable_fpsimd(void)
 {
-   unsigned long cpacr = get_cpacr();
-   cpacr |= FPSIMD_EN;
-   set_cpacr(cpacr);
+   set_cpacr(get_cpacr() | FPSIMD_EN);
 }
 
-int xnarch_fault_fpu_p(struct ipipe_trap_data *d)
+static inline struct fpsimd_state *get_fpu_owner(struct xnarchtcb *rootcb)
 {
-   return (d->exception == IPIPE_TRAP_FPU_ACC);
-}
+   struct task_struct *curr = rootcb->core.host_task;
 
-static inline struct fpsimd_state *get_fpu_owner(struct xnarchtcb *tcb)
-{
-   return &(tcb->core.tsp->fpsimd_state);
+   if (test_ti_thread_flag(task_thread_info(curr), TIF_FOREIGN_FPSTATE))
+   /* Foreign fpu state, use auxiliary backup area */
+   return >xnfpsimd_state;
+
+   return >thread.fpsimd_state;
 }
 
 void xnarch_leave_root(struct xnthread *root)
@@ -76,13 +76,6 @@ void xnarch_leave_root(struct xnthread *root)
rootcb->fpup = get_fpu_owner(rootcb);
 }
 
-void xnarch_save_fpu(struct xnthread *thread)
-{
-   struct xnarchtcb *tcb = &(thread->tcb);
-   if (xnarch_fpu_ptr(tcb))
-   fpsimd_save_state(tcb->fpup);
-}
-
 void xnarch_switch_fpu(struct xnthread *from, struct xnthread *to)
 {
struct fpsimd_state *const from_fpup = from ? from->tcb.fpup : NULL;
@@ -93,35 +86,16 @@ void xnarch_switch_fpu(struct xnthread *from, struct 
xnthread *to)
if (from_fpup == to_fpup)
return;
 
-   if (from_fpup)
-   fpsimd_save_state(from_fpup);
+   fpsimd_save_state(from_fpup);
 
fpsimd_load_state(to_fpup);
-}
-
-int xnarch_handle_fpu_fault(struct xnthread *from, 
-   struct xnthread *to, struct ipipe_trap_data *d)
-{
-   spl_t s;
-
-   /* FPU should already be enabled for XNFPU tasks. */
-   if (xnthread_test_state(to, XNFPU))
-   BUG();
-
-   xnlock_get_irqsave(, s);
-   xnthread_set_state(to, XNFPU);
-   xnlock_put_irqrestore(, s);
-
-   xnarch_switch_fpu(from, to);
-
-  

[Xenomai-git] Gilles Chanteperdrix : lib/smokey: fix argument parsing

2015-11-01 Thread git repository hosting
Module: xenomai-3
Branch: master
Commit: 5f6b32f9b82428ea798e0f2d7718ea4752e96ab1
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=5f6b32f9b82428ea798e0f2d7718ea4752e96ab1

Author: Gilles Chanteperdrix 
Date:   Sat Oct 31 20:57:40 2015 +0100

lib/smokey: fix argument parsing

---

 lib/smokey/helpers.c |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/smokey/helpers.c b/lib/smokey/helpers.c
index 6c7d3d7..7e95558 100644
--- a/lib/smokey/helpers.c
+++ b/lib/smokey/helpers.c
@@ -84,12 +84,12 @@ int smokey_string(const char *s, struct smokey_arg *arg)
 int smokey_parse_args(struct smokey_test *t,
  int argc, char *const argv[])
 {
-   int matched = 0, n = 0, ac;
+   int matched = 0, n, ac;
struct smokey_arg *arg;
 
-   while (++n < argc) {
-   for (arg = t->args, ac = 0;
-arg->name && ac < t->nargs; arg++, ac++) {
+   for (arg = t->args, ac = 0;
+arg->name && ac < t->nargs; arg++, ac++) {
+   for (n = 1; n < argc; n++) {
arg->matched = !!arg->parser(argv[n], arg);
if (arg->matched) {
matched++;


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


[Xenomai-git] Philippe Gerum : cobalt/thread: allow for changing the clock of the periodic timer

2015-11-01 Thread git repository hosting
Module: xenomai-3
Branch: master
Commit: 6d8ab1b70f224255497ecb8e5dc3bc643d6b8a8c
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=6d8ab1b70f224255497ecb8e5dc3bc643d6b8a8c

Author: Philippe Gerum 
Date:   Sat Oct 24 11:29:50 2015 +0200

cobalt/thread: allow for changing the clock of the periodic timer

---

 include/cobalt/kernel/thread.h |9 +++--
 kernel/cobalt/thread.c |   10 ++
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/include/cobalt/kernel/thread.h b/include/cobalt/kernel/thread.h
index 2a06fd2..df6297f 100644
--- a/include/cobalt/kernel/thread.h
+++ b/include/cobalt/kernel/thread.h
@@ -432,9 +432,14 @@ void xnthread_init_root_tcb(struct xnthread *thread);
 
 void xnthread_deregister(struct xnthread *thread);
 
-char *xnthread_format_status(unsigned long status, char *buf, int size);
+char *xnthread_format_status(unsigned long status,
+char *buf, int size);
 
-xnticks_t xnthread_get_timeout(struct xnthread *thread, xnticks_t ns);
+void xnthread_set_clock(struct xnthread *thread,
+   struct xnclock *newclock);
+
+xnticks_t xnthread_get_timeout(struct xnthread *thread,
+  xnticks_t ns);
 
 xnticks_t xnthread_get_period(struct xnthread *thread);
 
diff --git a/kernel/cobalt/thread.c b/kernel/cobalt/thread.c
index 508ed69..ab9867c 100644
--- a/kernel/cobalt/thread.c
+++ b/kernel/cobalt/thread.c
@@ -326,6 +326,16 @@ char *xnthread_format_status(unsigned long status, char 
*buf, int size)
return buf;
 }
 
+void xnthread_set_clock(struct xnthread *thread, struct xnclock *newclock)
+{
+   spl_t s;
+
+   /* Change the clock the thread's periodic timer is paced by. */
+   xnlock_get_irqsave(, s);
+   xntimer_set_clock(>ptimer, newclock);
+   xnlock_put_irqrestore(, s);
+}
+
 xnticks_t xnthread_get_timeout(struct xnthread *thread, xnticks_t ns)
 {
struct xntimer *timer;


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


[Xenomai-git] Gilles Chanteperdrix : cobalt/sched: bypass scheduler lock in irq

2015-11-01 Thread git repository hosting
Module: xenomai-3
Branch: master
Commit: 9a8be3bd8fdaca6654a7db16c886af7d508f5477
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=9a8be3bd8fdaca6654a7db16c886af7d508f5477

Author: Gilles Chanteperdrix 
Date:   Sun Oct 11 19:10:23 2015 +0200

cobalt/sched: bypass scheduler lock in irq

When preempting a relaxed thread, in case the thread is in the middle of
a call to xnthread_relax().

---

 kernel/cobalt/sched.c |   22 +++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/kernel/cobalt/sched.c b/kernel/cobalt/sched.c
index 56014e0..792bb80 100644
--- a/kernel/cobalt/sched.c
+++ b/kernel/cobalt/sched.c
@@ -322,7 +322,8 @@ struct xnsched *xnsched_finish_unlocked_switch(struct 
xnsched *sched)
 
 void xnsched_lock(void)
 {
-   struct xnthread *curr = xnthread_current();
+   struct xnsched *sched = xnsched_current();
+   struct xnthread *curr = sched->curr;
 
/*
 * CAUTION: The fast xnthread_current() accessor carries the
@@ -333,8 +334,16 @@ void xnsched_lock(void)
 * Either way, we don't need to grab the super lock.
 */
if (unlikely(curr == NULL || xnthread_test_state(curr, XNRELAX))) {
+   /*
+* In IRQ: scheduler already locked, and we may have
+* interrupted xnthread_relax() where the BUG_ON condition is
+* temporarily false.
+*/
+   if (sched->lflags & XNINIRQ)
+   return;
+
irqoff_only();
-   curr = _current()->rootcb;
+   curr = >rootcb;
XENO_BUG_ON(COBALT, xnsched_current()->curr != curr);
}
 
@@ -344,9 +353,16 @@ EXPORT_SYMBOL_GPL(xnsched_lock);
 
 void xnsched_unlock(void)
 {
-   struct xnthread *curr = xnthread_current();
+   struct xnsched *sched = xnsched_current();
+   struct xnthread *curr = sched->curr;
 
if (unlikely(curr == NULL || xnthread_test_state(curr, XNRELAX))) {
+   /*
+* In IRQ
+*/
+   if (sched->lflags & XNINIRQ)
+   return;
+
irqoff_only();
curr = _current()->rootcb;
}


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


[Xenomai-git] Philippe Gerum : lib/cobalt: explain -ENOSYS upon binding error

2015-11-01 Thread git repository hosting
Module: xenomai-3
Branch: master
Commit: f428008a8afec24abcc001980d255ed0f299a782
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=f428008a8afec24abcc001980d255ed0f299a782

Author: Philippe Gerum 
Date:   Fri Oct 16 15:06:40 2015 +0200

lib/cobalt: explain -ENOSYS upon binding error

---

 lib/cobalt/init.c |2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/cobalt/init.c b/lib/cobalt/init.c
index 3e88d06..ea8609c 100644
--- a/lib/cobalt/init.c
+++ b/lib/cobalt/init.c
@@ -112,6 +112,8 @@ static void low_init(void)
case -ENOEXEC:
early_panic("ABI mismatch: required r%lu, provided r%lu",
XENOMAI_ABI_REV, f->feat_abirev);
+   case -ENOSYS:
+   early_panic("Cobalt core not enabled in kernel");
default:
early_panic("binding failed: %s", strerror(-ret));
}


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


[Xenomai-git] Philippe Gerum : alchemy/heap: allow zero size for SBA binding

2015-11-01 Thread git repository hosting
Module: xenomai-3
Branch: master
Commit: b4a4fdba401f004d55f49ba6ed89755e86da208f
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=b4a4fdba401f004d55f49ba6ed89755e86da208f

Author: Philippe Gerum 
Date:   Wed Oct 14 14:45:30 2015 +0200

alchemy/heap: allow zero size for SBA binding

---

 lib/alchemy/heap.c |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/alchemy/heap.c b/lib/alchemy/heap.c
index 20531e3..146bfa1 100644
--- a/lib/alchemy/heap.c
+++ b/lib/alchemy/heap.c
@@ -442,7 +442,9 @@ int rt_heap_alloc_timed(RT_HEAP *heap,
p = __mptr(hcb->sba);
if (p)
goto done;
-   if (size > 0 && size != hcb->size) {
+   if (size == 0)
+   size = heapobj_size(>hobj);
+   else if (size != hcb->size) {
ret = -EINVAL;
goto done;
}


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


[Xenomai-git] Philippe Gerum : cobalt/timer: allow for changing the underlying clock source

2015-11-01 Thread git repository hosting
Module: xenomai-3
Branch: master
Commit: 5aabd25240c6dbb9e147210acdc3c3b2ae141388
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=5aabd25240c6dbb9e147210acdc3c3b2ae141388

Author: Philippe Gerum 
Date:   Fri Oct 23 18:49:36 2015 +0200

cobalt/timer: allow for changing the underlying clock source

---

 include/cobalt/kernel/timer.h |   10 +
 kernel/cobalt/timer.c |   50 -
 2 files changed, 54 insertions(+), 6 deletions(-)

diff --git a/include/cobalt/kernel/timer.h b/include/cobalt/kernel/timer.h
index de35380..00aa411 100644
--- a/include/cobalt/kernel/timer.h
+++ b/include/cobalt/kernel/timer.h
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -257,6 +258,9 @@ static inline struct xnclock *xntimer_clock(struct xntimer 
*timer)
return timer->clock;
 }
 
+void xntimer_set_clock(struct xntimer *timer,
+  struct xnclock *newclock);
+
 #else /* !CONFIG_XENO_OPT_EXTCLOCK */
 
 static inline struct xnclock *xntimer_clock(struct xntimer *timer)
@@ -264,6 +268,12 @@ static inline struct xnclock *xntimer_clock(struct xntimer 
*timer)
return 
 }
 
+static inline void xntimer_set_clock(struct xntimer *timer,
+struct xnclock *newclock)
+{
+   XENO_BUG_ON(COBALT, newclock != );
+}
+
 #endif /* !CONFIG_XENO_OPT_EXTCLOCK */
 
 #ifdef CONFIG_SMP
diff --git a/kernel/cobalt/timer.c b/kernel/cobalt/timer.c
index 9149730..bd986b6 100644
--- a/kernel/cobalt/timer.c
+++ b/kernel/cobalt/timer.c
@@ -391,15 +391,15 @@ void xntimer_set_gravity(struct xntimer *timer, int 
gravity)
 }
 EXPORT_SYMBOL_GPL(xntimer_set_gravity);
 
-#if defined(CONFIG_XENO_OPT_EXTCLOCK) && defined(CONFIG_XENO_OPT_STATS)
+#ifdef CONFIG_XENO_OPT_EXTCLOCK
 
-void xntimer_switch_tracking(struct xntimer *timer,
-struct xnclock *newclock)
+#ifdef CONFIG_XENO_OPT_STATS
+
+static void __xntimer_switch_tracking(struct xntimer *timer,
+ struct xnclock *newclock)
 {
struct xnclock *oldclock = timer->tracker;
-   spl_t s;
 
-   xnlock_get_irqsave(, s);
list_del(>next_stat);
oldclock->nrtimers--;
xnvfile_touch(>timer_vfile);
@@ -407,11 +407,49 @@ void xntimer_switch_tracking(struct xntimer *timer,
newclock->nrtimers++;
xnvfile_touch(>timer_vfile);
timer->tracker = newclock;
+}
+
+void xntimer_switch_tracking(struct xntimer *timer,
+struct xnclock *newclock)
+{
+   spl_t s;
+
+   xnlock_get_irqsave(, s);
+   __xntimer_switch_tracking(timer, newclock);
xnlock_put_irqrestore(, s);
 }
 EXPORT_SYMBOL_GPL(xntimer_switch_tracking);
 
-#endif /* CONFIG_XENO_OPT_EXTCLOCK && CONFIG_XENO_OPT_STATS */
+#else
+
+static inline
+void __xntimer_switch_tracking(struct xntimer *timer,
+  struct xnclock *newclock)
+{ }
+
+#endif /* CONFIG_XENO_OPT_STATS */
+
+/**
+ * @brief Set the reference clock of a timer.
+ *
+ * This service changes the reference clock pacing a timer. If the
+ * clock timers are tracked, the tracking information is updated too.
+ *
+ * @param timer The address of a valid timer descriptor.
+ *
+ * @param newclock The address of a valid clock descriptor.
+ *
+ * @coretags{unrestricted, atomic-entry}
+ */
+void xntimer_set_clock(struct xntimer *timer,
+  struct xnclock *newclock)
+{
+   xntimer_stop(timer);
+   timer->clock = newclock;
+   __xntimer_switch_tracking(timer, newclock);
+}
+
+#endif /* CONFIG_XENO_OPT_EXTCLOCK */
 
 /**
  * @fn void xntimer_destroy(struct xntimer *timer)


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


[Xenomai-git] Gilles Chanteperdrix : rtnet/udp: fix sendmsg error path

2015-11-01 Thread git repository hosting
Module: xenomai-3
Branch: master
Commit: c829dc9fcd83e139487227c1487ea220f833ab30
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=c829dc9fcd83e139487227c1487ea220f833ab30

Author: Gilles Chanteperdrix 
Date:   Sun Oct 11 16:04:00 2015 +0200

rtnet/udp: fix sendmsg error path

---

 kernel/drivers/net/stack/ipv4/udp/udp.c |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/kernel/drivers/net/stack/ipv4/udp/udp.c 
b/kernel/drivers/net/stack/ipv4/udp/udp.c
index 1e6d5d7..e2923d6 100644
--- a/kernel/drivers/net/stack/ipv4/udp/udp.c
+++ b/kernel/drivers/net/stack/ipv4/udp/udp.c
@@ -564,8 +564,10 @@ ssize_t rt_udp_sendmsg(struct rtdm_fd *fd, const struct 
msghdr *msg, int msg_fla
 } else {
 rtdm_lock_get_irqsave(_socket_base_lock, context);
 
-if (sock->prot.inet.state != TCP_ESTABLISHED)
+if (sock->prot.inet.state != TCP_ESTABLISHED) {
+   rtdm_lock_put_irqrestore(_socket_base_lock, context);
 return -ENOTCONN;
+   }
 
 daddr = sock->prot.inet.daddr;
 dport = sock->prot.inet.dport;


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


[Xenomai-git] Jan Kiszka : lib/cobalt: Introduce cobalt_thread_probe

2015-11-01 Thread git repository hosting
Module: xenomai-3
Branch: master
Commit: e4389c53222c455a73a9e5059669b77a375674ea
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=e4389c53222c455a73a9e5059669b77a375674ea

Author: Jan Kiszka 
Date:   Fri Oct 16 18:16:32 2015 +0200

lib/cobalt: Introduce cobalt_thread_probe

This will be used by copperplate for probing a RT thread without
risking to be switched to secondary mode.

Signed-off-by: Jan Kiszka 

---

 lib/cobalt/internal.c |5 +
 lib/cobalt/internal.h |2 ++
 2 files changed, 7 insertions(+)

diff --git a/lib/cobalt/internal.c b/lib/cobalt/internal.c
index 210d259..9220237 100644
--- a/lib/cobalt/internal.c
+++ b/lib/cobalt/internal.c
@@ -117,6 +117,11 @@ int cobalt_thread_join(pthread_t thread)
return ret;
 }
 
+int cobalt_thread_probe(pid_t pid)
+{
+   return XENOMAI_SYSCALL2(sc_cobalt_kill, pid, 0);
+}
+
 void __cobalt_commit_memory(void *p, size_t len)
 {
volatile char *_p = (volatile char *)p, *end;
diff --git a/lib/cobalt/internal.h b/lib/cobalt/internal.h
index 4f03cf0..69ec7d1 100644
--- a/lib/cobalt/internal.h
+++ b/lib/cobalt/internal.h
@@ -45,6 +45,8 @@ static inline atomic_t *mutex_get_ownerp(struct 
cobalt_mutex_shadow *shadow)
 
 void cobalt_thread_init(void);
 
+int cobalt_thread_probe(pid_t pid);
+
 void cobalt_print_init(void);
 
 void cobalt_print_init_atfork(void);


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


[Xenomai-git] Gilles Chanteperdrix : cobalt/sched: avoid leaking the reschedule bit

2015-11-01 Thread git repository hosting
Module: xenomai-3
Branch: master
Commit: 587fc2649724f0ff519a4f75244148898ae85da7
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=587fc2649724f0ff519a4f75244148898ae85da7

Author: Gilles Chanteperdrix 
Date:   Fri Oct 16 11:27:39 2015 +0200

cobalt/sched: avoid leaking the reschedule bit

handle_setaffinity_event ends up calling migrate_thread() which sets
the rescheduling bit. However, since this happens for a passive
migration, xnsched_run() is not called, and the reschedule bit
remains. This causes remote notifications to not send an IPI, and
delay them until the system calls xnsched_run() for another reason.

Fix this by setting the reschedule bit in xnsched_migrate_passive() only
if the thread blockbits are not set.

---

 kernel/cobalt/sched.c |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/kernel/cobalt/sched.c b/kernel/cobalt/sched.c
index 792bb80..fab0d7c 100644
--- a/kernel/cobalt/sched.c
+++ b/kernel/cobalt/sched.c
@@ -481,7 +481,6 @@ static void migrate_thread(struct xnthread *thread, struct 
xnsched *sched)
 * WARNING: the scheduling class may have just changed as a
 * result of calling the per-class migration hook.
 */
-   xnsched_set_resched(thread->sched);
thread->sched = sched;
 }
 
@@ -491,6 +490,7 @@ static void migrate_thread(struct xnthread *thread, struct 
xnsched *sched)
  */
 void xnsched_migrate(struct xnthread *thread, struct xnsched *sched)
 {
+   xnsched_set_resched(thread->sched);
migrate_thread(thread, sched);
 
 #ifdef CONFIG_XENO_ARCH_UNLOCKED_SWITCH
@@ -511,11 +511,14 @@ void xnsched_migrate(struct xnthread *thread, struct 
xnsched *sched)
  */
 void xnsched_migrate_passive(struct xnthread *thread, struct xnsched *sched)
 {
+   struct xnsched *last_sched = thread->sched;
+
migrate_thread(thread, sched);
 
if (!xnthread_test_state(thread, XNTHREAD_BLOCK_BITS)) {
xnsched_requeue(thread);
xnthread_set_state(thread, XNREADY);
+   xnsched_set_resched(last_sched);
}
 }
 


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


[Xenomai-git] Gilles Chanteperdrix : testsuite/smokey: tsc: add tsc test

2015-11-01 Thread git repository hosting
Module: xenomai-3
Branch: master
Commit: 0f3f73fdeb08e1e9e71fe4dd359d8722182b6253
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=0f3f73fdeb08e1e9e71fe4dd359d8722182b6253

Author: Gilles Chanteperdrix 
Date:   Fri Oct 16 21:02:13 2015 +0200

testsuite/smokey: tsc: add tsc test

---

 configure.ac |1 +
 testsuite/smokey/Makefile.am |2 +
 testsuite/smokey/tsc/Makefile.am |8 ++
 testsuite/smokey/tsc/tsc.c   |  186 ++
 4 files changed, 197 insertions(+)

diff --git a/configure.ac b/configure.ac
index 8027b7d..36d7fb7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -889,6 +889,7 @@ AC_CONFIG_FILES([ \
testsuite/smokey/bufp/Makefile \
testsuite/smokey/sigdebug/Makefile \
testsuite/smokey/timerfd/Makefile \
+   testsuite/smokey/tsc/Makefile \
testsuite/smokey/leaks/Makefile \
testsuite/clocktest/Makefile \
testsuite/xeno-test/Makefile \
diff --git a/testsuite/smokey/Makefile.am b/testsuite/smokey/Makefile.am
index 8e82464..87e0555 100644
--- a/testsuite/smokey/Makefile.am
+++ b/testsuite/smokey/Makefile.am
@@ -22,6 +22,7 @@ SUBDIRS = \
sched-tp\
sigdebug\
timerfd \
+   tsc \
vdso-access \
xddp
 else
@@ -65,5 +66,6 @@ DIST_SUBDIRS =\
sched-tp\
sigdebug\
timerfd \
+   tsc \
vdso-access \
xddp
diff --git a/testsuite/smokey/tsc/Makefile.am b/testsuite/smokey/tsc/Makefile.am
new file mode 100644
index 000..dbe4528
--- /dev/null
+++ b/testsuite/smokey/tsc/Makefile.am
@@ -0,0 +1,8 @@
+
+noinst_LIBRARIES = libtsc.a
+
+libtsc_a_SOURCES = tsc.c
+
+libtsc_a_CPPFLAGS =\
+   @XENO_USER_CFLAGS@  \
+   -I$(top_srcdir)/include
diff --git a/testsuite/smokey/tsc/tsc.c b/testsuite/smokey/tsc/tsc.c
new file mode 100644
index 000..3d6de72
--- /dev/null
+++ b/testsuite/smokey/tsc/tsc.c
@@ -0,0 +1,186 @@
+/*
+ * Copyright (C) 2011-2012,2015 Gilles Chanteperdrix 
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+
+#define DURATION 1000
+
+#if CONFIG_SMP
+#define smp_sched_setaffinity(pid,len,mask) sched_setaffinity(pid,len,mask)
+#define smp_sched_getaffinity(pid,len,mask) sched_getaffinity(pid,len,mask)
+#else /* !CONFIG_SMP */
+#define smp_sched_setaffinity(pid,len,mask) 0
+#define smp_sched_getaffinity(pid,len,mask) 0
+#endif /* !CONFIG_SMP */
+
+smokey_test_plugin(tsc,
+   SMOKEY_ARGLIST(
+   SMOKEY_INT(duration),
+   ),
+   "Check that emulated tsc is monotonic"
+);
+
+
+static inline unsigned long long timer_get_tsc(void)
+{
+   /*
+* The additional function call clockobj_get_tsc() makes a big
+* difference on low end
+*/
+   return cobalt_read_tsc();
+}
+
+static inline unsigned long long timer_tsc2ns(unsigned long long tsc)
+{
+   return clockobj_tsc_to_ns(tsc);
+}
+
+static inline unsigned long long timer_ns2tsc(unsigned long long ns)
+{
+   return clockobj_ns_to_tsc(ns);
+}
+
+static int run_tsc(struct smokey_test *t, int argc, char *const argv[])
+{
+   unsigned long long runtime, start, jump, tsc1, tsc2;
+   unsigned long long one_sec_tsc;
+   unsigned long long sum, g_sum;
+   unsigned long long loops, g_loops;
+   unsigned dt, min, max, g_min, g_max;
+   unsigned long long secs;
+   unsigned i, margin;
+
+#if CONFIG_SMP
+   /* Pin the test to the CPU it is currently running on */
+   cpu_set_t mask;
+
+   if (smp_sched_getaffinity(0, sizeof(mask), ) == 0)
+   for (i = 0; i < sysconf(_SC_NPROCESSORS_ONLN); i++)
+   if 

[Xenomai-git] Philippe Gerum : boilerplate/version: fix version suffix for non-devel release

2015-11-01 Thread git repository hosting
Module: xenomai-3
Branch: master
Commit: fa9133cea6916ae1ebebccdd84592b06002d5caa
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=fa9133cea6916ae1ebebccdd84592b06002d5caa

Author: Philippe Gerum 
Date:   Fri Oct 16 19:06:44 2015 +0200

boilerplate/version: fix version suffix for non-devel release

---

 lib/boilerplate/version.c |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/boilerplate/version.c b/lib/boilerplate/version.c
index 271349d..d28c496 100644
--- a/lib/boilerplate/version.c
+++ b/lib/boilerplate/version.c
@@ -19,7 +19,9 @@
 #include "git-stamp.h"
 
 #ifndef GIT_STAMP
-#define GIT_STAMP  ""
+#define devel_suffix  ""
+#else
+#define devel_suffix  " -- " GIT_STAMP
 #endif
 
 #ifdef CONFIG_XENO_COBALT
@@ -29,7 +31,7 @@
 #endif
 
 const char *xenomai_version_string = PACKAGE_NAME \
-   core_suffix PACKAGE_VERSION " -- " GIT_STAMP;
+   core_suffix PACKAGE_VERSION devel_suffix;
 
 #ifdef __PROGRAM__
 


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


[Xenomai-git] Gilles Chanteperdrix : cobalt/process: avoid crash at fork

2015-11-01 Thread git repository hosting
Module: xenomai-3
Branch: master
Commit: e30f30df631fff143233732cf21756fe2f29c7dc
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=e30f30df631fff143233732cf21756fe2f29c7dc

Author: Gilles Chanteperdrix 
Date:   Sun Oct 11 23:29:47 2015 +0200

cobalt/process: avoid crash at fork

When handle_cleanup_event() is called because a thread is calling exec
after a fork from a Xenomai process, handle_taskexit_event() is called
before remove_process(). However, handle_taskexit_event() calls
clear_threadinfo(), so that later calls to cobalt_current_process()
return NULL, causing crashes in cleanup functions relying on
cobalt_current_process() or cobalt_ppd_get(), such as
cobalt_mutex_reclaim().

---

 kernel/cobalt/posix/process.c |   23 ++-
 1 file changed, 18 insertions(+), 5 deletions(-)

diff --git a/kernel/cobalt/posix/process.c b/kernel/cobalt/posix/process.c
index e7f8a93..c5a3297 100644
--- a/kernel/cobalt/posix/process.c
+++ b/kernel/cobalt/posix/process.c
@@ -200,7 +200,8 @@ static void remove_process(struct cobalt_process *process)
 * upon return from detach_process() for the Cobalt
 * personality, so don't dereference it afterwards.
 */
-   process->priv[xid] = NULL;
+   if (xid)
+   process->priv[xid] = NULL;
__clear_bit(personality->xid, >permap);
personality->ops.detach_process(priv);
atomic_dec(>refcnt);
@@ -1006,7 +1007,7 @@ static void unregister_debugged_thread(struct xnthread 
*thread)
xnlock_put_irqrestore(, s);
 }
 
-static int handle_taskexit_event(struct task_struct *p) /* p == current */
+static void __handle_taskexit_event(struct task_struct *p)
 {
struct cobalt_ppd *sys_ppd;
struct xnthread *thread;
@@ -1036,13 +1037,18 @@ static int handle_taskexit_event(struct task_struct *p) 
/* p == current */
if (atomic_dec_and_test(_ppd->refcnt))
remove_process(cobalt_current_process());
}
+}
+
+static int handle_taskexit_event(struct task_struct *p) /* p == current */
+{
+   __handle_taskexit_event(p);
 
/*
 * __xnthread_cleanup() -> ... -> finalize_thread
 * handler. From that point, the TCB is dropped. Be careful of
 * not treading on stale memory within @thread.
 */
-   __xnthread_cleanup(thread);
+   __xnthread_cleanup(xnthread_current());
 
clear_threadinfo();
 
@@ -1198,6 +1204,8 @@ static int handle_cleanup_event(struct mm_struct *mm)
old = cobalt_set_process(process);
sys_ppd = cobalt_ppd_get(0);
if (sys_ppd != _kernel_ppd) {
+   bool running_exec;
+
/*
 * Detect a userland shadow running exec(), i.e. still
 * attached to the current linux task (no prior
@@ -1208,12 +1216,17 @@ static int handle_cleanup_event(struct mm_struct *mm)
 * notifier manually for it.
 */
thread = xnthread_current();
-   if (thread && (current->flags & PF_EXITING) == 0) {
-   handle_taskexit_event(current);
+   running_exec = thread && (current->flags & PF_EXITING) == 0;
+   if (running_exec) {
+   __handle_taskexit_event(current);
ipipe_disable_notifier(current);
}
if (atomic_dec_and_test(_ppd->refcnt))
remove_process(process);
+   if (running_exec) {
+   __xnthread_cleanup(thread);
+   clear_threadinfo();
+   }
}
 
/*


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


[Xenomai-git] Gilles Chanteperdrix : testsuite/dohell: sync after dd to disk

2015-11-01 Thread git repository hosting
Module: xenomai-3
Branch: master
Commit: 1a15ac6113a0fe930582e7225ba4074db2dc386e
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=1a15ac6113a0fe930582e7225ba4074db2dc386e

Author: Gilles Chanteperdrix 
Date:   Tue Oct 13 21:11:53 2015 +0200

testsuite/dohell: sync after dd to disk

in order to actually write file on disk, on machine with RAM larger than
file size.

---

 testsuite/xeno-test/dohell |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testsuite/xeno-test/dohell b/testsuite/xeno-test/dohell
index 918da8a..68c5a5f 100644
--- a/testsuite/xeno-test/dohell
+++ b/testsuite/xeno-test/dohell
@@ -59,7 +59,7 @@ if [ -n "$server" ]; then
 fi
 
 if [ -n "$mntpoint" ]; then
-while :; do dd if=/dev/zero of=$mntpoint/bigfile bs=1024000 count=100; 
done &
+while :; do dd if=/dev/zero of=$mntpoint/bigfile bs=1024000 count=100; 
sync; done &
 pids="$pids $!"
 fi
 


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


[Xenomai-git] Philippe Gerum : cobalt/thread: allow NULL thread spec for xnthread_set_clock()

2015-11-01 Thread git repository hosting
Module: xenomai-3
Branch: master
Commit: 0c0d32f5d1ae9971acc5fbd4ff48cf724a09e6f4
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=0c0d32f5d1ae9971acc5fbd4ff48cf724a09e6f4

Author: Philippe Gerum 
Date:   Thu Oct 29 14:49:59 2015 +0100

cobalt/thread: allow NULL thread spec for xnthread_set_clock()

---

 include/cobalt/kernel/thread.h |4 ++--
 kernel/cobalt/thread.c |   11 ++-
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/include/cobalt/kernel/thread.h b/include/cobalt/kernel/thread.h
index df6297f..59d6027 100644
--- a/include/cobalt/kernel/thread.h
+++ b/include/cobalt/kernel/thread.h
@@ -435,8 +435,8 @@ void xnthread_deregister(struct xnthread *thread);
 char *xnthread_format_status(unsigned long status,
 char *buf, int size);
 
-void xnthread_set_clock(struct xnthread *thread,
-   struct xnclock *newclock);
+int xnthread_set_clock(struct xnthread *thread,
+  struct xnclock *newclock);
 
 xnticks_t xnthread_get_timeout(struct xnthread *thread,
   xnticks_t ns);
diff --git a/kernel/cobalt/thread.c b/kernel/cobalt/thread.c
index ab9867c..5fdf919 100644
--- a/kernel/cobalt/thread.c
+++ b/kernel/cobalt/thread.c
@@ -326,15 +326,24 @@ char *xnthread_format_status(unsigned long status, char 
*buf, int size)
return buf;
 }
 
-void xnthread_set_clock(struct xnthread *thread, struct xnclock *newclock)
+int xnthread_set_clock(struct xnthread *thread, struct xnclock *newclock)
 {
spl_t s;
 
+   if (thread == NULL) {
+   thread = xnthread_current();
+   if (thread == NULL)
+   return -EPERM;
+   }
+   
/* Change the clock the thread's periodic timer is paced by. */
xnlock_get_irqsave(, s);
xntimer_set_clock(>ptimer, newclock);
xnlock_put_irqrestore(, s);
+
+   return 0;
 }
+EXPORT_SYMBOL_GPL(xnthread_set_clock);
 
 xnticks_t xnthread_get_timeout(struct xnthread *thread, xnticks_t ns)
 {


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


[Xenomai-git] Gilles Chanteperdrix : cobalt/rtdm: use distinct minor for each protocol device

2015-11-01 Thread git repository hosting
Module: xenomai-3
Branch: master
Commit: 59a31bc44ae8416ccd6d8bfc73fbc9a300458ce9
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=59a31bc44ae8416ccd6d8bfc73fbc9a300458ce9

Author: Gilles Chanteperdrix 
Date:   Fri Oct 16 19:29:56 2015 +0200

cobalt/rtdm: use distinct minor for each protocol device

device_destroy() selects the device to destroy based on major and
minor numbers, we can't use a single fixed null minor for all protocol
devices.

---

 kernel/cobalt/rtdm/device.c |   19 ---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/kernel/cobalt/rtdm/device.c b/kernel/cobalt/rtdm/device.c
index 4943be4..0fdfa2d 100644
--- a/kernel/cobalt/rtdm/device.c
+++ b/kernel/cobalt/rtdm/device.c
@@ -52,6 +52,7 @@
 static struct rb_root protocol_devices;
 
 static DEFINE_MUTEX(register_lock);
+static DECLARE_BITMAP(protocol_devices_minor_map, RTDM_MAX_MINOR);
 
 static struct class *rtdm_class;
 
@@ -424,14 +425,21 @@ int rtdm_dev_register(struct rtdm_device *dev)
}
__set_bit(minor, drv->minor_map);
} else {
-   dev->minor = -1;
+   minor = find_first_zero_bit(protocol_devices_minor_map,
+   RTDM_MAX_MINOR);
+   if (minor >= RTDM_MAX_MINOR) {
+   ret = -ENXIO;
+   goto fail;
+   }
+   dev->minor = minor;
+
dev->name = kstrdup(dev->label, GFP_KERNEL);
if (dev->name == NULL) {
ret = -ENOMEM;
goto fail;
}
 
-   rdev = MKDEV(0, 0);
+   rdev = MKDEV(0, minor);
kdev = device_create(rtdm_class, NULL, rdev,
 dev, dev->name);
if (IS_ERR(kdev)) {
@@ -443,6 +451,7 @@ int rtdm_dev_register(struct rtdm_device *dev)
ret = xnid_enter(_devices, >proto.id, id);
if (ret < 0)
goto fail;
+   __set_bit(minor, protocol_devices_minor_map);
}
 
dev->rdev = rdev;
@@ -500,8 +509,10 @@ void rtdm_dev_unregister(struct rtdm_device *dev)
if (drv->device_flags & RTDM_NAMED_DEVICE) {
xnregistry_remove(dev->named.handle);
__clear_bit(dev->minor, drv->minor_map);
-   } else
+   } else {
xnid_remove(_devices, >proto.id);
+   __clear_bit(dev->minor, protocol_devices_minor_map);
+   }
 
device_destroy(rtdm_class, dev->rdev);
 
@@ -527,6 +538,8 @@ int __init rtdm_init(void)
rtdm_class->dev_groups = rtdm_groups;
rtdm_class->devnode = rtdm_devnode;
 
+   bitmap_zero(protocol_devices_minor_map, RTDM_MAX_MINOR);
+
return 0;
 }
 


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


[Xenomai-git] Philippe Gerum : doc: prebuild

2015-11-01 Thread git repository hosting
Module: xenomai-3
Branch: refs/tags/v3.0.1
Commit: ce604a92b249e84d888f58327b34239330b063e5
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=ce604a92b249e84d888f58327b34239330b063e5

Author: Philippe Gerum 
Date:   Sun Nov  1 18:42:42 2015 +0100

doc: prebuild

---

 doc/asciidoc/MIGRATION.adoc|   11 +-
 doc/asciidoc/TROUBLESHOOTING.COBALT.adoc   |   12 +
 doc/asciidoc/TROUBLESHOOTING.MERCURY.adoc  |9 +
 doc/prebuilt/html/MIGRATION/index.html |   26 +-
 doc/prebuilt/html/README.APPLICATIONS/index.html   |2 +-
 doc/prebuilt/html/README.INSTALL/index.html|2 +-
 .../html/TROUBLESHOOTING.COBALT/index.html |   52 +-
 .../html/TROUBLESHOOTING.MERCURY/index.html|   14 +-
 .../html/xeno3prm/16550A__io_8h_source.html|2 +-
 .../html/xeno3prm/16550A__pci_8h_source.html   |2 +-
 .../html/xeno3prm/16550A__pnp_8h_source.html   |2 +-
 doc/prebuilt/html/xeno3prm/8255_8h_source.html |2 +-
 doc/prebuilt/html/xeno3prm/af__inet_8h_source.html |2 +-
 .../html/xeno3prm/alchemy_2compat_8h_source.html   |2 +-
 doc/prebuilt/html/xeno3prm/analogy_2driver_8h.html |2 +-
 .../html/xeno3prm/analogy_2driver_8h_source.html   |2 +-
 doc/prebuilt/html/xeno3prm/analogy_8h.html |2 +-
 doc/prebuilt/html/xeno3prm/analogy_8h_source.html  |2 +-
 doc/prebuilt/html/xeno3prm/annotated.html  |2 +-
 doc/prebuilt/html/xeno3prm/apc_8h_source.html  |2 +-
 doc/prebuilt/html/xeno3prm/api-tags.html   |2 +-
 ..._2include_2asm_2xenomai_2machine_8h_source.html |2 +-
 ...include_2asm_2xenomai_2syscall32_8h_source.html |2 +-
 ..._2include_2asm_2xenomai_2machine_8h_source.html |2 +-
 ...include_2asm_2xenomai_2syscall32_8h_source.html |2 +-
 ..._2include_2asm_2xenomai_2machine_8h_source.html |2 +-
 ...include_2asm_2xenomai_2syscall32_8h_source.html |2 +-
 ..._2include_2asm_2xenomai_2machine_8h_source.html |2 +-
 ...include_2asm_2xenomai_2syscall32_8h_source.html |2 +-
 ...m_2include_2asm_2xenomai_2fptest_8h_source.html |2 +-
 ...lude_2asm_2xenomai_2uapi_2fptest_8h_source.html |2 +-
 doc/prebuilt/html/xeno3prm/arp_8h_source.html  |2 +-
 doc/prebuilt/html/xeno3prm/assert_8h_source.html   |2 +-
 doc/prebuilt/html/xeno3prm/async_8c.html   |2 +-
 doc/prebuilt/html/xeno3prm/atomic_8h_source.html   |2 +-
 doc/prebuilt/html/xeno3prm/bheap_8h_source.html|2 +-
 ...n_2include_2asm_2xenomai_2fptest_8h_source.html |2 +-
 ...lude_2asm_2xenomai_2uapi_2fptest_8h_source.html |2 +-
 .../boilerplate_2ancillaries_8h_source.html|2 +-
 .../html/xeno3prm/boilerplate_2list_8h_source.html |2 +-
 .../html/xeno3prm/boilerplate_2lock_8h_source.html |2 +-
 .../html/xeno3prm/boilerplate_2time_8h_source.html |2 +-
 .../xeno3prm/boilerplate_2tunables_8h_source.html  |2 +-
 doc/prebuilt/html/xeno3prm/bufd_8h_source.html |2 +-
 .../html/xeno3prm/bufp-label_8c-example.html   |2 +-
 .../html/xeno3prm/bufp-readwrite_8c-example.html   |2 +-
 doc/prebuilt/html/xeno3prm/c1e_8h_source.html  |2 +-
 doc/prebuilt/html/xeno3prm/calibration_8c.html |2 +-
 doc/prebuilt/html/xeno3prm/can-rtt_8c-example.html |2 +-
 doc/prebuilt/html/xeno3prm/channel__range_8h.html  |2 +-
 .../html/xeno3prm/channel__range_8h_source.html|2 +-
 doc/prebuilt/html/xeno3prm/classes.html|2 +-
 doc/prebuilt/html/xeno3prm/clockobj_8h_source.html |2 +-
 doc/prebuilt/html/xeno3prm/cluster_8h_source.html  |2 +-
 .../html/xeno3prm/cobalt-core_8h_source.html   |2 +-
 .../html/xeno3prm/cobalt-posix_8h_source.html  |2 +-
 .../html/xeno3prm/cobalt-rtdm_8h_source.html   |2 +-
 .../cobalt_2boilerplate_2limits_8h_source.html |2 +-
 .../cobalt_2boilerplate_2trace_8h_source.html  |2 +-
 .../cobalt_2kernel_2ancillaries_8h_source.html |2 +-
 .../xeno3prm/cobalt_2kernel_2compat_8h_source.html |2 +-
 .../xeno3prm/cobalt_2kernel_2init_8h_source.html   |2 +-
 .../xeno3prm/cobalt_2kernel_2list_8h_source.html   |2 +-
 .../xeno3prm/cobalt_2kernel_2lock_8h_source.html   |2 +-
 .../cobalt_2kernel_2registry_8h_source.html|2 +-
 .../cobalt_2kernel_2rtdm_2autotune_8h_source.html  |2 +-
 .../cobalt_2kernel_2rtdm_2can_8h_source.html   |2 +-
 .../cobalt_2kernel_2rtdm_2compat_8h_source.html|2 +-
 .../cobalt_2kernel_2rtdm_2ipc_8h_source.html   |2 +-
 .../cobalt_2kernel_2rtdm_2rtdm_8h_source.html  |2 +-
 .../cobalt_2kernel_2rtdm_2serial_8h_source.html|2 +-
 .../cobalt_2kernel_2rtdm_2testing_8h_source.html   |2 +-
 .../xeno3prm/cobalt_2kernel_2rtdm_2udd_8h.html |4 +-
 .../cobalt_2kernel_2rtdm_2udd_8h__incl.map |   68 +-
 .../cobalt_2kernel_2rtdm_2udd_8h__incl.md5 |2 +-
 .../cobalt_2kernel_2rtdm_2udd_8h__incl.png |  

[Xenomai-git] Dmitriy Cherkasov : cobalt/arm64: remove code for unrelated arm architecture

2015-11-01 Thread git repository hosting
Module: xenomai-3
Branch: next
Commit: 6c0bf90cc29ae6f1b24b1ab21a8027c40160b397
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=6c0bf90cc29ae6f1b24b1ab21a8027c40160b397

Author: Dmitriy Cherkasov 
Date:   Thu May  7 13:56:22 2015 -0700

cobalt/arm64: remove code for unrelated arm architecture

---

 .../arch/arm64/include/asm/xenomai/machine.h   |   33 
 .../arch/arm64/include/asm/xenomai/uapi/arith.h|4 +--
 2 files changed, 2 insertions(+), 35 deletions(-)

diff --git a/kernel/cobalt/arch/arm64/include/asm/xenomai/machine.h 
b/kernel/cobalt/arch/arm64/include/asm/xenomai/machine.h
index d6e965f..cf07a3f 100644
--- a/kernel/cobalt/arch/arm64/include/asm/xenomai/machine.h
+++ b/kernel/cobalt/arch/arm64/include/asm/xenomai/machine.h
@@ -32,53 +32,20 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #define xnarch_cache_aliasing() cache_is_vivt()
 
-#if __LINUX_ARM_ARCH__ < 5
-static inline __attribute_const__ unsigned long ffnz(unsigned long x)
-{
-   int r = 0;
-
-   if (!x)
-   return 0;
-   if (!(x & 0x)) {
-   x >>= 16;
-   r += 16;
-   }
-   if (!(x & 0xff)) {
-   x >>= 8;
-   r += 8;
-   }
-   if (!(x & 0xf)) {
-   x >>= 4;
-   r += 4;
-   }
-   if (!(x & 3)) {
-   x >>= 2;
-   r += 2;
-   }
-   if (!(x & 1)) {
-   x >>= 1;
-   r += 1;
-   }
-   return r;
-}
-#else
 static inline __attribute_const__ unsigned long ffnz(unsigned long ul)
 {
int __r;
__asm__("clz\t%0, %1" : "=r" (__r) : "r"(ul & (-ul)) : "cc");
return 31 - __r;
 }
-#endif
 
 #include 
 
diff --git a/kernel/cobalt/arch/arm64/include/asm/xenomai/uapi/arith.h 
b/kernel/cobalt/arch/arm64/include/asm/xenomai/uapi/arith.h
index cf897b4..165cd9d 100644
--- a/kernel/cobalt/arch/arm64/include/asm/xenomai/uapi/arith.h
+++ b/kernel/cobalt/arch/arm64/include/asm/xenomai/uapi/arith.h
@@ -20,7 +20,7 @@
 
 #include 
 
-#if __LINUX_ARM_ARCH__ >= 4 && (!defined(CONFIG_THUMB2_KERNEL) || 
!defined(CONFIG_FTRACE))
+#if !defined(CONFIG_FTRACE)
 static inline __attribute__((__const__)) unsigned long long
 mach_arm_nodiv_ullimd(const unsigned long long op,
   const unsigned long long frac,
@@ -49,7 +49,7 @@ mach_arm_nodiv_llimd(const long long op,
 
 #include 
 
-#if __LINUX_ARM_ARCH__ >= 4 && (!defined(CONFIG_THUMB2_KERNEL) || 
!defined(CONFIG_FTRACE))
+#if !defined(CONFIG_FTRACE)
 #define mach_arm_nodiv_ullimd_str  \
"umull %[tl], %[rl], %[opl], %[fracl]\n\t"  \
"umull %[rm], %[rh], %[oph], %[frach]\n\t"  \


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


[Xenomai-git] Dmitriy Cherkasov : cobalt/arm64: Makefile: fix arch path

2015-11-01 Thread git repository hosting
Module: xenomai-3
Branch: next
Commit: 592660dd7a6990300a686e554c58dfe6993b1293
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=592660dd7a6990300a686e554c58dfe6993b1293

Author: Dmitriy Cherkasov 
Date:   Thu May  7 13:54:32 2015 -0700

cobalt/arm64: Makefile: fix arch path

---

 kernel/cobalt/arch/arm64/Makefile |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/cobalt/arch/arm64/Makefile 
b/kernel/cobalt/arch/arm64/Makefile
index f2e4e20..a135f99 100644
--- a/kernel/cobalt/arch/arm64/Makefile
+++ b/kernel/cobalt/arch/arm64/Makefile
@@ -2,4 +2,4 @@ obj-$(CONFIG_XENOMAI) += xenomai.o
 
 xenomai-y := machine.o mayday.o thread.o switch.o syscall.o
 
-ccflags-y := -Iarch/arm/xenomai/include -Iinclude/xenomai
+ccflags-y := -Iarch/arm64/xenomai/include -Iinclude/xenomai


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


[Xenomai-git] Dmitriy Cherkasov : cobalt/arm64: populate arch/arm64 with a copy of arch/ arm.

2015-11-01 Thread git repository hosting
Module: xenomai-3
Branch: next
Commit: 9861db191e3d8d1045d7f437bcaedf1ef2248f9b
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=9861db191e3d8d1045d7f437bcaedf1ef2248f9b

Author: Dmitriy Cherkasov 
Date:   Wed May  6 15:27:23 2015 -0700

cobalt/arm64: populate arch/arm64 with a copy of arch/arm.

kernel/cobalt/arch/arm -> kernel/cobalt/arch/arm64
lib/cobalt/arch/arm -> lib/cobalt/arch/arm64

---

 configure.ac   |8 +
 kernel/cobalt/arch/arm64/Kconfig   |   40 +++
 kernel/cobalt/arch/arm64/Makefile  |5 +
 .../arch/arm64/include/asm/xenomai/calibration.h   |   59 
 .../arch/arm64/include/asm/xenomai/features.h  |   30 ++
 .../cobalt/arch/arm64/include/asm/xenomai/fptest.h |   52 +++
 .../arch/arm64/include/asm/xenomai/machine.h   |   85 +
 .../arch/arm64/include/asm/xenomai/syscall.h   |   74 
 .../arch/arm64/include/asm/xenomai/syscall32.h |   24 ++
 .../cobalt/arch/arm64/include/asm/xenomai/thread.h |  123 +++
 .../arch/arm64/include/asm/xenomai/uapi/arith.h|  142 
 .../arch/arm64/include/asm/xenomai/uapi/features.h |   43 +++
 .../arch/arm64/include/asm/xenomai/uapi/fptest.h   |   61 
 .../arch/arm64/include/asm/xenomai/uapi/syscall.h  |   34 ++
 .../arch/arm64/include/asm/xenomai/uapi/tsc.h  |   25 ++
 .../arch/arm64/include/asm/xenomai/wrappers.h  |   27 ++
 kernel/cobalt/arch/arm64/machine.c |  119 +++
 kernel/cobalt/arch/arm64/mayday.c  |  146 
 kernel/cobalt/arch/arm64/switch.S  |  167 +
 kernel/cobalt/arch/arm64/syscall.c |   53 +++
 kernel/cobalt/arch/arm64/thread.c  |  355 
 lib/cobalt/arch/Makefile.am|2 +-
 lib/cobalt/arch/arm64/Makefile.am  |   13 +
 lib/cobalt/arch/arm64/features.c   |  102 ++
 lib/cobalt/arch/arm64/include/Makefile.am  |2 +
 lib/cobalt/arch/arm64/include/asm/Makefile.am  |2 +
 .../arch/arm64/include/asm/xenomai/Makefile.am |5 +
 .../arch/arm64/include/asm/xenomai/features.h  |   62 
 .../arch/arm64/include/asm/xenomai/syscall.h   |  138 
 lib/cobalt/arch/arm64/include/asm/xenomai/tsc.h|   48 +++
 30 files changed, 2045 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 36d7fb7..c805186 100644
--- a/configure.ac
+++ b/configure.ac
@@ -139,6 +139,10 @@ case "$build_for" in
XENO_TARGET_ARCH=arm
CONFIG_XENO_DEFAULT_PERIOD=100
;;
+ aarch64-*)
+   XENO_TARGET_ARCH=arm64
+   CONFIG_XENO_DEFAULT_PERIOD=100
+   ;;
  x86_64-*|amd64-*)
use_tls=yes
XENO_TARGET_ARCH=x86
@@ -849,6 +853,10 @@ AC_CONFIG_FILES([ \
lib/cobalt/arch/arm/include/Makefile \
lib/cobalt/arch/arm/include/asm/Makefile \
lib/cobalt/arch/arm/include/asm/xenomai/Makefile \
+   lib/cobalt/arch/arm64/Makefile \
+   lib/cobalt/arch/arm64/include/Makefile \
+   lib/cobalt/arch/arm64/include/asm/Makefile \
+   lib/cobalt/arch/arm64/include/asm/xenomai/Makefile \
lib/cobalt/arch/powerpc/Makefile \
lib/cobalt/arch/powerpc/include/Makefile \
lib/cobalt/arch/powerpc/include/asm/Makefile \
diff --git a/kernel/cobalt/arch/arm64/Kconfig b/kernel/cobalt/arch/arm64/Kconfig
new file mode 100644
index 000..dc6485d
--- /dev/null
+++ b/kernel/cobalt/arch/arm64/Kconfig
@@ -0,0 +1,40 @@
+source "kernel/xenomai/Kconfig"
+source "drivers/xenomai/Kconfig"
+
+menu "Machine/platform-specific options"
+
+config XENO_ARCH_UNLOCKED_SWITCH
+   bool "Unlocked context switch"
+   default y
+   help
+   The Cobalt core may allow non-atomic execution of the
+   machine-dependent context switching code, so that other CPUs
+   and/or local interrupts may execute concurrently.
+
+   This option reduces interrupt latency when costly cache and
+   TLB flushes are required to switch context.
+
+   You definitely want to enable that option on low-end ARM
+   platforms.
+endmenu
+
+config IPIPE_WANT_PREEMPTIBLE_SWITCH
+   bool
+   default y if XENO_ARCH_UNLOCKED_SWITCH
+   default n if !XENO_ARCH_UNLOCKED_SWITCH
+
+config IPIPE_WANT_ACTIVE_MM
+   def_bool y
+
+config XENO_ARCH_WANT_TIP
+   def_bool y
+
+config XENO_ARCH_FPU
+   def_bool VFP
+
+config XENO_ARCH_SYS3264
+def_bool n
+
+config XENO_ARCH_OUTOFLINE_XNLOCK
+   bool
+   default y
diff --git a/kernel/cobalt/arch/arm64/Makefile 
b/kernel/cobalt/arch/arm64/Makefile
new file mode 100644
index 000..f2e4e20
--- /dev/null
+++ b/kernel/cobalt/arch/arm64/Makefile
@@ -0,0 +1,5 @@
+obj-$(CONFIG_XENOMAI) += xenomai.o
+
+xenomai-y := machine.o mayday.o thread.o switch.o syscall.o
+
+ccflags-y := -Iarch/arm/xenomai/include -Iinclude/xenomai
diff --git 

[Xenomai-git] Dmitriy Cherkasov : cobalt/arm64: set cache aliasing and disable floating point coprocessor instructions form aarch64 /arm64

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

Author: Dmitriy Cherkasov 
Date:   Thu May  7 16:41:45 2015 -0700

cobalt/arm64: set cache aliasing and disable floating point coprocessor 
instructions form aarch64/arm64

---

 kernel/cobalt/arch/arm64/include/asm/xenomai/machine.h|3 ++-
 .../cobalt/arch/arm64/include/asm/xenomai/uapi/fptest.h   |   13 -
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/kernel/cobalt/arch/arm64/include/asm/xenomai/machine.h 
b/kernel/cobalt/arch/arm64/include/asm/xenomai/machine.h
index cf07a3f..e078564 100644
--- a/kernel/cobalt/arch/arm64/include/asm/xenomai/machine.h
+++ b/kernel/cobalt/arch/arm64/include/asm/xenomai/machine.h
@@ -38,7 +38,8 @@
 #include 
 #include 
 
-#define xnarch_cache_aliasing() cache_is_vivt()
+/* D-side always behaves as PIPT on AArch64 (see 
arch/arm64/include/asm/cachetype.h) */
+#define xnarch_cache_aliasing() 0
 
 static inline __attribute_const__ unsigned long ffnz(unsigned long ul)
 {
diff --git a/kernel/cobalt/arch/arm64/include/asm/xenomai/uapi/fptest.h 
b/kernel/cobalt/arch/arm64/include/asm/xenomai/uapi/fptest.h
index b81d109..65a3e31 100644
--- a/kernel/cobalt/arch/arm64/include/asm/xenomai/uapi/fptest.h
+++ b/kernel/cobalt/arch/arm64/include/asm/xenomai/uapi/fptest.h
@@ -18,10 +18,17 @@
 #ifndef _COBALT_ARM_ASM_UAPI_FPTEST_H
 #define _COBALT_ARM_ASM_UAPI_FPTEST_H
 
+#ifdef __aarch64__
+/* CP10 and CP11, used for the FP/NEON operations, are already excluded from
+the list of valid operands for the generic coprocessor instructions */
+#define __COBALT_HAVE_VFP  0
+#else
 #define __COBALT_HAVE_VFP  0x1
+#endif
 
 static inline void fp_regs_set(int features, unsigned int val)
 {
+#if __COBALT_HAVE_VFP != 0
unsigned long long e[16];
unsigned int i;
 
@@ -34,12 +41,15 @@ static inline void fp_regs_set(int features, unsigned int 
val)
__asm__ __volatile__("ldc p11, cr0, [%0],#32*4":
 "=r"(i): "0"([0]): "memory");
}
+#endif
 }
 
 static inline unsigned int fp_regs_check(int features, unsigned int val,
 int (*report)(const char *fmt, ...))
 {
-   unsigned int result = val, i;
+   unsigned int result = val;
+#if __COBALT_HAVE_VFP != 0
+   unsigned int i;
unsigned long long e[16];
 
if (features & __COBALT_HAVE_VFP) {
@@ -54,6 +64,7 @@ static inline unsigned int fp_regs_check(int features, 
unsigned int val,
result = e[i];
}
}
+#endif
 
return result;
 }


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


[Xenomai-git] Philippe Gerum : cobalt/arm64: use lazy fpsimd switch mode

2015-11-01 Thread git repository hosting
Module: xenomai-3
Branch: next
Commit: 8ec5ab48fd62f5b723a417585534091a551a1027
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=8ec5ab48fd62f5b723a417585534091a551a1027

Author: Philippe Gerum 
Date:   Mon Oct 19 10:38:21 2015 +0200

cobalt/arm64: use lazy fpsimd switch mode

---

 kernel/cobalt/arch/arm64/thread.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/cobalt/arch/arm64/thread.c 
b/kernel/cobalt/arch/arm64/thread.c
index 5282b0c..2238751 100644
--- a/kernel/cobalt/arch/arm64/thread.c
+++ b/kernel/cobalt/arch/arm64/thread.c
@@ -153,7 +153,7 @@ void xnarch_switch_to(struct xnthread *out, struct xnthread 
*in)
enter_lazy_tlb(prev_mm, next);
}
 
-   __switch_to(prev, next);
+   ipipe_switch_to(prev, next);
 }
 
 int xnarch_escalate(void)


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


[Xenomai-git] Philippe Gerum : cobalt/arm64: sanitize calibration file

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

Author: Philippe Gerum 
Date:   Thu Sep 17 04:01:49 2015 +0200

cobalt/arm64: sanitize calibration file

---

 .../arch/arm64/include/asm/xenomai/calibration.h   |   44 +---
 1 file changed, 11 insertions(+), 33 deletions(-)

diff --git a/kernel/cobalt/arch/arm64/include/asm/xenomai/calibration.h 
b/kernel/cobalt/arch/arm64/include/asm/xenomai/calibration.h
index e303a04..e85521e 100644
--- a/kernel/cobalt/arch/arm64/include/asm/xenomai/calibration.h
+++ b/kernel/cobalt/arch/arm64/include/asm/xenomai/calibration.h
@@ -1,13 +1,10 @@
 /*
- * Copyright (C) 2001,2002,2003,2004,2005 Philippe Gerum .
+ * Copyright (C) 2015 Philippe Gerum .
  *
- * ARM port
- *   Copyright (C) 2005 Stelian Pop
- *
- * Xenomai is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * Xenomai is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published
+ * by the Free Software Foundation; either version 2 of the License,
+ * or (at your option) any later version.
  *
  * Xenomai is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -19,41 +16,22 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  * 02111-1307, USA.
  */
-#ifndef _COBALT_ARM_ASM_CALIBRATION_H
-#define _COBALT_ARM_ASM_CALIBRATION_H
-
-unsigned int omap_rev(void);
-#define cpu_is_omap44xx() ((omap_rev() & 0xff) == 0x44)
+#ifndef _COBALT_ARM64_ASM_CALIBRATION_H
+#define _COBALT_ARM64_ASM_CALIBRATION_H
 
 static inline void xnarch_get_latencies(struct xnclock_gravity *p)
 {
unsigned int ulat;
 #if CONFIG_XENO_OPT_TIMING_SCHEDLAT != 0
ulat = CONFIG_XENO_OPT_TIMING_SCHEDLAT;
-#elif defined(CONFIG_ARCH_AT91RM9200)
-   ulat = 8500;
-#elif defined(CONFIG_ARCH_AT91SAM9263)
-   ulat = 11000;
-#elif defined(CONFIG_SOC_IMX6Q)
-   ulat = 6000;
-#elif defined(CONFIG_ARCH_MX51)
-   ulat = 5000;
-#elif defined(CONFIG_ARCH_MX53)
-   ulat = 5000;
-#elif defined(CONFIG_ARCH_MX6)
-   ulat = 2000;
-#elif defined(CONFIG_SOC_IMX7)
-   ulat = 2000;
-#elif defined(CONFIG_SOC_LS1021A)
-   ulat = 2800;
-#elif defined(CONFIG_ARCH_OMAP)
-   ulat = cpu_is_omap44xx() ? 2500 : 5000;
+#elif defined(CONFIG_ARCH_HISI)
+   ulat = 4000;
 #else
-   ulat = 9500;/* XXX sane? */
+   ulat = 4000;
 #endif
p->user = xnclock_ns_to_ticks(, ulat);
p->kernel = xnclock_ns_to_ticks(, 
CONFIG_XENO_OPT_TIMING_KSCHEDLAT);
p->irq = xnclock_ns_to_ticks(, CONFIG_XENO_OPT_TIMING_IRQLAT);
 }
 
-#endif /* !_COBALT_ARM_ASM_CALIBRATION_H */
+#endif /* !_COBALT_ARM64_ASM_CALIBRATION_H */


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


[Xenomai-git] Philippe Gerum : cobalt/arm64: fix inclusion guards

2015-11-01 Thread git repository hosting
Module: xenomai-3
Branch: next
Commit: 5e0e4c350097808341f749326ace30907c0e6316
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=5e0e4c350097808341f749326ace30907c0e6316

Author: Philippe Gerum 
Date:   Sat Oct 17 14:40:53 2015 +0200

cobalt/arm64: fix inclusion guards

---

 kernel/cobalt/arch/arm64/include/asm/xenomai/features.h  |8 
 kernel/cobalt/arch/arm64/include/asm/xenomai/fptest.h|6 +++---
 kernel/cobalt/arch/arm64/include/asm/xenomai/machine.h   |6 +++---
 kernel/cobalt/arch/arm64/include/asm/xenomai/syscall.h   |6 +++---
 kernel/cobalt/arch/arm64/include/asm/xenomai/syscall32.h |6 +++---
 kernel/cobalt/arch/arm64/include/asm/xenomai/thread.h|7 +++
 kernel/cobalt/arch/arm64/include/asm/xenomai/uapi/arith.h|6 +++---
 kernel/cobalt/arch/arm64/include/asm/xenomai/uapi/features.h |6 +++---
 kernel/cobalt/arch/arm64/include/asm/xenomai/uapi/fptest.h   |6 +++---
 kernel/cobalt/arch/arm64/include/asm/xenomai/uapi/syscall.h  |6 +++---
 kernel/cobalt/arch/arm64/include/asm/xenomai/uapi/tsc.h  |6 +++---
 kernel/cobalt/arch/arm64/include/asm/xenomai/wrappers.h  |6 +++---
 12 files changed, 37 insertions(+), 38 deletions(-)

diff --git a/kernel/cobalt/arch/arm64/include/asm/xenomai/features.h 
b/kernel/cobalt/arch/arm64/include/asm/xenomai/features.h
index d485286..112408f 100644
--- a/kernel/cobalt/arch/arm64/include/asm/xenomai/features.h
+++ b/kernel/cobalt/arch/arm64/include/asm/xenomai/features.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2005 Philippe Gerum .
+ * Copyright (C) 2015 Philippe Gerum .
  *
  * ARM port
  *   Copyright (C) 2005 Stelian Pop
@@ -19,12 +19,12 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  * 02111-1307, USA.
  */
-#ifndef _COBALT_ARM_ASM_FEATURES_H
-#define _COBALT_ARM_ASM_FEATURES_H
+#ifndef _COBALT_ARM64_ASM_FEATURES_H
+#define _COBALT_ARM64_ASM_FEATURES_H
 
 struct cobalt_featinfo;
 static inline void collect_arch_features(struct cobalt_featinfo *p) { }
 
 #include 
 
-#endif /* !_COBALT_ARM_ASM_FEATURES_H */
+#endif /* !_COBALT_ARM64_ASM_FEATURES_H */
diff --git a/kernel/cobalt/arch/arm64/include/asm/xenomai/fptest.h 
b/kernel/cobalt/arch/arm64/include/asm/xenomai/fptest.h
index 743d758..cfdf0b3 100644
--- a/kernel/cobalt/arch/arm64/include/asm/xenomai/fptest.h
+++ b/kernel/cobalt/arch/arm64/include/asm/xenomai/fptest.h
@@ -16,8 +16,8 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  * 02111-1307, USA.
  */
-#ifndef _COBALT_ARM_ASM_FPTEST_H
-#define _COBALT_ARM_ASM_FPTEST_H
+#ifndef _COBALT_ARM64_ASM_FPTEST_H
+#define _COBALT_ARM64_ASM_FPTEST_H
 
 #include 
 #include 
@@ -44,4 +44,4 @@ static inline int fp_detect(void)
return have_fp ? __COBALT_HAVE_FPU : 0;
 }
 
-#endif /* _COBALT_ARM_ASM_FPTEST_H */
+#endif /* _COBALT_ARM64_ASM_FPTEST_H */
diff --git a/kernel/cobalt/arch/arm64/include/asm/xenomai/machine.h 
b/kernel/cobalt/arch/arm64/include/asm/xenomai/machine.h
index b8290bf..7444cc8 100644
--- a/kernel/cobalt/arch/arm64/include/asm/xenomai/machine.h
+++ b/kernel/cobalt/arch/arm64/include/asm/xenomai/machine.h
@@ -20,8 +20,8 @@
  *   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  *   02111-1307, USA.
  */
-#ifndef _COBALT_ARM_ASM_MACHINE_H
-#define _COBALT_ARM_ASM_MACHINE_H
+#ifndef _COBALT_ARM64_ASM_MACHINE_H
+#define _COBALT_ARM64_ASM_MACHINE_H
 
 #include 
 #include 
@@ -58,4 +58,4 @@ static inline __attribute_const__ unsigned long ffnz(unsigned 
long ul)
 
 #include 
 
-#endif /* !_COBALT_ARM_ASM_MACHINE_H */
+#endif /* !_COBALT_ARM64_ASM_MACHINE_H */
diff --git a/kernel/cobalt/arch/arm64/include/asm/xenomai/syscall.h 
b/kernel/cobalt/arch/arm64/include/asm/xenomai/syscall.h
index 77c1716..949f287 100644
--- a/kernel/cobalt/arch/arm64/include/asm/xenomai/syscall.h
+++ b/kernel/cobalt/arch/arm64/include/asm/xenomai/syscall.h
@@ -19,8 +19,8 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  * 02111-1307, USA.
  */
-#ifndef _COBALT_ARM_ASM_SYSCALL_H
-#define _COBALT_ARM_ASM_SYSCALL_H
+#ifndef _COBALT_ARM64_ASM_SYSCALL_H
+#define _COBALT_ARM64_ASM_SYSCALL_H
 
 #include 
 #include 
@@ -75,4 +75,4 @@ int xnarch_local_syscall(unsigned long a1, unsigned long a2,
 unsigned long a3, unsigned long a4,
 unsigned long a5);
 
-#endif /* !_COBALT_ARM_ASM_SYSCALL_H */
+#endif /* !_COBALT_ARM64_ASM_SYSCALL_H */
diff --git a/kernel/cobalt/arch/arm64/include/asm/xenomai/syscall32.h 
b/kernel/cobalt/arch/arm64/include/asm/xenomai/syscall32.h
index 95c5a11..a66ddd6 100644
--- a/kernel/cobalt/arch/arm64/include/asm/xenomai/syscall32.h
+++ b/kernel/cobalt/arch/arm64/include/asm/xenomai/syscall32.h
@@ -16,9 +16,9 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  * 02111-1307, USA.
  */
-#ifndef _COBALT_ARM_ASM_SYSCALL32_H
-#define _COBALT_ARM_ASM_SYSCALL32_H
+#ifndef 

[Xenomai-git] Philippe Gerum : cobalt: bump ABI revision level

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

Author: Philippe Gerum 
Date:   Thu Jul 30 14:20:45 2015 +0200

cobalt: bump ABI revision level

---

 kernel/cobalt/arch/arm64/include/asm/xenomai/uapi/features.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/cobalt/arch/arm64/include/asm/xenomai/uapi/features.h 
b/kernel/cobalt/arch/arm64/include/asm/xenomai/uapi/features.h
index 85faa59..3bea0ef 100644
--- a/kernel/cobalt/arch/arm64/include/asm/xenomai/uapi/features.h
+++ b/kernel/cobalt/arch/arm64/include/asm/xenomai/uapi/features.h
@@ -22,7 +22,7 @@
 #define _COBALT_ARM_ASM_UAPI_FEATURES_H
 
 /* The ABI revision level we use on this arch. */
-#define XENOMAI_ABI_REV   15UL
+#define XENOMAI_ABI_REV   16UL
 
 #define XENOMAI_FEAT_DEP (__xn_feat_generic_mask)
 


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


[Xenomai-git] Dmitriy Cherkasov : cobalt/arm64: prepare-kernel: add arm64 arch

2015-11-01 Thread git repository hosting
Module: xenomai-3
Branch: next
Commit: 2711f85d2da44a71091cd2b7dd020479c97af9ce
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=2711f85d2da44a71091cd2b7dd020479c97af9ce

Author: Dmitriy Cherkasov 
Date:   Wed May  6 15:27:10 2015 -0700

cobalt/arm64: prepare-kernel: add arm64 arch

---

 scripts/prepare-kernel.sh |3 +++
 1 file changed, 3 insertions(+)

diff --git a/scripts/prepare-kernel.sh b/scripts/prepare-kernel.sh
index 333d11c..6bb9f06 100755
--- a/scripts/prepare-kernel.sh
+++ b/scripts/prepare-kernel.sh
@@ -284,6 +284,9 @@ while : ; do
arm)
   linux_arch=arm
   ;;
+   arm64)
+  linux_arch=arm64
+  ;;
sh|sh4)
   linux_arch=sh
   ;;


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


[Xenomai-git] Dmitriy Cherkasov : cobalt/arm64: xenomai/syscall.h: update syscall register

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

Author: Dmitriy Cherkasov 
Date:   Fri May  8 15:54:18 2015 -0700

cobalt/arm64: xenomai/syscall.h: update syscall register

---

 kernel/cobalt/arch/arm64/include/asm/xenomai/syscall.h |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/cobalt/arch/arm64/include/asm/xenomai/syscall.h 
b/kernel/cobalt/arch/arm64/include/asm/xenomai/syscall.h
index 2fdd890..7bf95fb 100644
--- a/kernel/cobalt/arch/arm64/include/asm/xenomai/syscall.h
+++ b/kernel/cobalt/arch/arm64/include/asm/xenomai/syscall.h
@@ -40,10 +40,10 @@
 #define __xn_reg_sys(__regs)   ((__regs)->orig_x0)
 /* In OABI_COMPAT mode, handle both OABI and EABI userspace syscalls */
 #ifdef CONFIG_OABI_COMPAT
-#define __xn_syscall_p(__regs) (((__regs)->regs[7] == __NR_OABI_SYSCALL_BASE + 
XENO_ARM_SYSCALL) || \
-((__regs)->regs[7] == __ARM_NR_ipipe))
+#define __xn_syscall_p(__regs) (((__regs)->regs[8] == __NR_OABI_SYSCALL_BASE + 
XENO_ARM_SYSCALL) || \
+((__regs)->regs[8] == __ARM_NR_ipipe))
 #else /* !CONFIG_OABI_COMPAT */
-#define __xn_syscall_p(__regs) ((__regs)->regs[7] == __ARM_NR_ipipe)
+#define __xn_syscall_p(__regs) ((__regs)->regs[8] == __ARM_NR_ipipe)
 #endif /* !CONFIG_OABI_COMPAT */
 #define __xn_syscall(__regs)   (__xn_reg_sys(__regs) & ~__COBALT_SYSCALL_BIT)
 


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


[Xenomai-git] Gilles Chanteperdrix : lib/smokey: fix argument parsing

2015-11-01 Thread git repository hosting
Module: xenomai-3
Branch: stable-3.0.x
Commit: 5f6b32f9b82428ea798e0f2d7718ea4752e96ab1
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=5f6b32f9b82428ea798e0f2d7718ea4752e96ab1

Author: Gilles Chanteperdrix 
Date:   Sat Oct 31 20:57:40 2015 +0100

lib/smokey: fix argument parsing

---

 lib/smokey/helpers.c |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/smokey/helpers.c b/lib/smokey/helpers.c
index 6c7d3d7..7e95558 100644
--- a/lib/smokey/helpers.c
+++ b/lib/smokey/helpers.c
@@ -84,12 +84,12 @@ int smokey_string(const char *s, struct smokey_arg *arg)
 int smokey_parse_args(struct smokey_test *t,
  int argc, char *const argv[])
 {
-   int matched = 0, n = 0, ac;
+   int matched = 0, n, ac;
struct smokey_arg *arg;
 
-   while (++n < argc) {
-   for (arg = t->args, ac = 0;
-arg->name && ac < t->nargs; arg++, ac++) {
+   for (arg = t->args, ac = 0;
+arg->name && ac < t->nargs; arg++, ac++) {
+   for (n = 1; n < argc; n++) {
arg->matched = !!arg->parser(argv[n], arg);
if (arg->matched) {
matched++;


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


[Xenomai-git] Gilles Chanteperdrix : rtnet: add option to enable debug asserts

2015-11-01 Thread git repository hosting
Module: xenomai-3
Branch: master
Commit: b27d15bb77bdf9163d1eb60aa5c9d7741e609f75
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=b27d15bb77bdf9163d1eb60aa5c9d7741e609f75

Author: Gilles Chanteperdrix 
Date:   Sun Oct 11 19:11:18 2015 +0200

rtnet: add option to enable debug asserts

---

 kernel/drivers/net/Kconfig |   15 ---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/kernel/drivers/net/Kconfig b/kernel/drivers/net/Kconfig
index 6e63437..caffc1f 100644
--- a/kernel/drivers/net/Kconfig
+++ b/kernel/drivers/net/Kconfig
@@ -1,9 +1,18 @@
 menu "RTnet"
 
 config XENO_DRIVERS_NET
-   depends on m
-   select NET
-   tristate "RTnet, TCP/IP socket interface"
+depends on m
+select NET
+tristate "RTnet, TCP/IP socket interface"
+
+config XENO_DRIVERS_RTNET_CHECKED
+bool "Internal Bug Checks"
+default n
+---help---
+Switch on if you face crashes when RTnet is running or if you suspect
+any other RTnet-related issues. This feature will add a few sanity
+checks at critical points that will produce warnings on the kernel
+console in case certain internal bugs are detected.
 
 source "drivers/xenomai/net/stack/Kconfig"
 source "drivers/xenomai/net/drivers/Kconfig"


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


[Xenomai-git] Philippe Gerum : copperplate/regd: do not involve Cobalt before binding is done

2015-11-01 Thread git repository hosting
Module: xenomai-3
Branch: master
Commit: e44620495d0b8f0d029250b44dfeef4a47dcd155
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=e44620495d0b8f0d029250b44dfeef4a47dcd155

Author: Philippe Gerum 
Date:   Thu Oct 15 09:59:21 2015 +0200

copperplate/regd: do not involve Cobalt before binding is done

Some early code in sysregd wants to set the regular scheduling policy
of the main thread prior to binding to the Cobalt core manually. Make
sure to force a libc call for this, instead of going through a Cobalt
syscall first.

Functionally speaking, the effect will be the same since
pthread_setschedparam() mirrors the request to the regular C library,
which is what we'll need eventually. However we won't receive the
scary warning about a syscall being denied for an unbound process from
the Cobalt core when debug mode is enabled, e.g.:

[Xenomai] syscall <7> denied to sysregd[22217]

---

 lib/copperplate/regd/regd.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/copperplate/regd/regd.c b/lib/copperplate/regd/regd.c
index 25bd7a5..5d69d83 100644
--- a/lib/copperplate/regd/regd.c
+++ b/lib/copperplate/regd/regd.c
@@ -538,7 +538,7 @@ int main(int argc, char *const *argv)
 
/* Force SCHED_OTHER. */
schedp.sched_priority = 0;
-   pthread_setschedparam(pthread_self(), SCHED_OTHER, );
+   __STD(pthread_setschedparam(pthread_self(), SCHED_OTHER, ));
 
memset(, 0, sizeof(sa));
sa.sa_handler = SIG_IGN;


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


[Xenomai-git] Gilles Chanteperdrix : cobalt/rtdm: schedule_work: avoid ipipe_work_post_root

2015-11-01 Thread git repository hosting
Module: xenomai-3
Branch: master
Commit: 2fecd644899cadcbe9f79ab036733211479bf52f
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=2fecd644899cadcbe9f79ab036733211479bf52f

Author: Gilles Chanteperdrix 
Date:   Tue Oct 13 21:05:53 2015 +0200

cobalt/rtdm: schedule_work: avoid ipipe_work_post_root

if called from root domain.

---

 kernel/cobalt/rtdm/drvlib.c |   10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/kernel/cobalt/rtdm/drvlib.c b/kernel/cobalt/rtdm/drvlib.c
index 0ea344d..481ad83 100644
--- a/kernel/cobalt/rtdm/drvlib.c
+++ b/kernel/cobalt/rtdm/drvlib.c
@@ -1518,14 +1518,18 @@ static void lostage_schedule_work(struct 
ipipe_work_header *work)
  */
 void rtdm_schedule_nrt_work(struct work_struct *lostage_work)
 {
-   struct lostage_schedule_work macb_work = {
+   struct lostage_schedule_work ipipe_work = {
.work = {
-   .size = sizeof(macb_work),
+   .size = sizeof(ipipe_work),
.handler = lostage_schedule_work,
},
.lostage_work = lostage_work,
};
-   ipipe_post_work_root(_work, work);
+
+   if (ipipe_root_p)
+   schedule_work(lostage_work);
+   else
+   ipipe_post_work_root(_work, work);
 }
 EXPORT_SYMBOL_GPL(rtdm_schedule_nrt_work);
 


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