Module: xenomai-3 Branch: master Commit: 9b68cbe2a7d3bbeb537184b8050dbd71365983be URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=9b68cbe2a7d3bbeb537184b8050dbd71365983be
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 759e423..61f3008 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; @@ -800,7 +798,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