All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cobalt: x86: Use ipipe_root_nr_syscalls
@ 2019-01-31 17:09 Jan Kiszka
  2019-02-14 15:12 ` Richard Weinberger
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Kiszka @ 2019-01-31 17:09 UTC (permalink / raw)
  To: Xenomai

From: Jan Kiszka <jan.kiszka@siemens.com>

Required to handle compat syscalls correctly.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---

This is against next. The stable patch needs to touch kernel/cobalt
/posix/syscall.c instead.

Testing all these would be very appreciated!

 kernel/cobalt/arch/x86/include/asm/xenomai/syscall.h | 2 +-
 kernel/cobalt/include/linux/xenomai/wrappers.h       | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/kernel/cobalt/arch/x86/include/asm/xenomai/syscall.h b/kernel/cobalt/arch/x86/include/asm/xenomai/syscall.h
index 992f1cd9c4..ea0e6fcb16 100644
--- a/kernel/cobalt/arch/x86/include/asm/xenomai/syscall.h
+++ b/kernel/cobalt/arch/x86/include/asm/xenomai/syscall.h
@@ -62,7 +62,7 @@
 #define __xn_rootcall_p(__regs, __code)			\
 	({						\
 		*(__code) = __xn_reg_sys(__regs);	\
-		*(__code) < NR_syscalls;		\
+		*(__code) < ipipe_root_nr_syscalls(current_thread_info()); \
 	})
 
 static inline void __xn_error_return(struct pt_regs *regs, int v)
diff --git a/kernel/cobalt/include/linux/xenomai/wrappers.h b/kernel/cobalt/include/linux/xenomai/wrappers.h
index 1d16db4218..7d00aa9d40 100644
--- a/kernel/cobalt/include/linux/xenomai/wrappers.h
+++ b/kernel/cobalt/include/linux/xenomai/wrappers.h
@@ -43,4 +43,10 @@
 		smp_store_mb((tsk)->state, (state_value))
 #endif
 
+#include <linux/ipipe.h>
+
+#ifndef ipipe_root_nr_syscalls
+#define ipipe_root_nr_syscalls(ti)	NR_syscalls
+#endif
+
 #endif /* !_COBALT_LINUX_WRAPPERS_H */
-- 
2.16.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-02-15 14:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-31 17:09 [PATCH] cobalt: x86: Use ipipe_root_nr_syscalls Jan Kiszka
2019-02-14 15:12 ` Richard Weinberger
2019-02-15 14:21   ` Jan Kiszka
2019-02-15 14:38     ` Philippe Gerum

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.