Module: xenomai-jki
Branch: for-forge
Commit: 3bde99bb7a84f819f06e3ee2bad219e1b9b1ab55
URL:    
http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=3bde99bb7a84f819f06e3ee2bad219e1b9b1ab55

Author: Jan Kiszka <jan.kis...@siemens.com>
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 <jan.kis...@siemens.com>

---

 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 e60cea8..c636c0f 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,
@@ -251,7 +249,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;
@@ -797,7 +795,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
Xenomai-git@xenomai.org
http://xenomai.org/mailman/listinfo/xenomai-git

Reply via email to