[PATCH 5/7] kernel: cobalt: support building against v5.0

roman.stratiienko at globallogic.com roman.stratiienko at globallogic.com
Tue Mar 5 15:45:19 CET 2019


From: Roman Stratiienko <roman.stratiienko at globallogic.com>

Since kernel v5.0 upstream commit 96d4f267e40f
("Remove 'type' argument from access_ok() function")
 access_ok() funcion takes only 2 parameters

Change access_rok and access_wok wrappers for kernels
 starting from v5.0, and preserve them for earlier versions

Signed-off-by: Roman Stratiienko <roman.stratiienko at globallogic.com>
---
 kernel/cobalt/include/asm-generic/xenomai/syscall.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/kernel/cobalt/include/asm-generic/xenomai/syscall.h b/kernel/cobalt/include/asm-generic/xenomai/syscall.h
index e14a9d1e3..0d50d4107 100644
--- a/kernel/cobalt/include/asm-generic/xenomai/syscall.h
+++ b/kernel/cobalt/include/asm-generic/xenomai/syscall.h
@@ -27,8 +27,13 @@
 #include <asm/xenomai/machine.h>
 #include <cobalt/uapi/asm-generic/syscall.h>
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0)
+#define access_rok(addr, size)	access_ok((addr), (size))
+#define access_wok(addr, size)	access_ok((addr), (size))
+#else
 #define access_rok(addr, size)	access_ok(VERIFY_READ, (addr), (size))
 #define access_wok(addr, size)	access_ok(VERIFY_WRITE, (addr), (size))
+#endif
 
 #define __xn_reg_arglist(regs)	\
 	__xn_reg_arg1(regs),	\
-- 
2.17.1




More information about the Xenomai mailing list