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

Jan Kiszka jan.kiszka at siemens.com
Tue Mar 5 19:05:17 CET 2019


On 05.03.19 15:45, roman.stratiienko--- via Xenomai wrote:
> 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
> 

Also nitpicking: I would refer to access_ok in the subject line as well. This is 
already a single-topic patch, so that works out nicely.

Jan

> 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),	\
> 

-- 
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux



More information about the Xenomai mailing list