Module: xenomai-jki
Branch: for-forge
Commit: 0d010425a450c181a3d92b300f99968b3aaa86de

Author: Jan Kiszka <>
Date:   Fri Jun 19 15:59:15 2015 +0200

cobalt/kernel: Fix mode of mayday syscall

The oneway mode meant norestart, thus return -EINTR instead of retrying
the syscall after signal processing. But this caused damaged to the
register state of the mayday-interrupted thread, most visible on x86-64
where RAX is holding the RIP.

Fix this by restarting the syscall on signals. The syscall is supposed
to deliver the same result then, including a correct register state.

Signed-off-by: Jan Kiszka <>


 kernel/cobalt/posix/syscall.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/kernel/cobalt/posix/syscall.c b/kernel/cobalt/posix/syscall.c
index cf93f07..7e2d434 100644
--- a/kernel/cobalt/posix/syscall.c
+++ b/kernel/cobalt/posix/syscall.c
@@ -71,8 +71,6 @@
 #define __xn_exec_nonrestartable (__xn_exec_primary|__xn_exec_norestart)
 /* Shorthand for domain probing syscall */
 #define __xn_exec_probing   (__xn_exec_conforming|__xn_exec_adaptive)
-/* Shorthand for oneway trap - does not return to call site. */
-#define __xn_exec_oneway    __xn_exec_norestart
 typedef long (*cobalt_syshand)(unsigned long arg1, unsigned long arg2,
                               unsigned long arg3, unsigned long arg4,
@@ -246,7 +244,7 @@ static COBALT_SYSCALL(serialdbg, current,
        return 0;
-static COBALT_SYSCALL(mayday, oneway, (void))
+static COBALT_SYSCALL(mayday, current, (void))
        struct pt_regs *regs = task_pt_regs(current);
        struct xnthread *cur;
@@ -792,7 +790,7 @@ static const int cobalt_sysmodes[] = {
        __COBALT_MODE(extend, lostage),
        __COBALT_MODE(trace, current),
        __COBALT_MODE(get_current, current),
-       __COBALT_MODE(mayday, oneway),
+       __COBALT_MODE(mayday, current),
        __COBALT_MODE(backtrace, current),
        __COBALT_MODE(serialdbg, current),
        __COBALT_MODE(corectl, probing),

Xenomai-git mailing list

Reply via email to