diff options
author | Johannes Lundberg <johalun@FreeBSD.org> | 2019-05-16 17:44:17 +0000 |
---|---|---|
committer | Johannes Lundberg <johalun@FreeBSD.org> | 2019-05-16 17:44:17 +0000 |
commit | 47e2723ad727c1952492dc018246ab39a6f0f5fe (patch) | |
tree | a43397956889f99a97cf907a9c573f4b2d94c3b6 /sys/compat/linuxkpi/common/include/linux | |
parent | b961c0f2442979d7a611964adb729188c90e5203 (diff) | |
download | src-47e2723ad727c1952492dc018246ab39a6f0f5fe.tar.gz src-47e2723ad727c1952492dc018246ab39a6f0f5fe.zip |
LinuxKPI: Update access_ok macro for v5.0.
Check LINUXKPI_VERSION macro for backwards compatibility.
It's recommended to update any drivers that depend on the older KPI
so we can deprecate < 5.0 code as we update to newer Linux version.
This patch is part of D19565
Reviewed by: hps
Approved by: imp (mentor), hps
MFC after: 1 week
Notes
Notes:
svn path=/head/; revision=347837
Diffstat (limited to 'sys/compat/linuxkpi/common/include/linux')
-rw-r--r-- | sys/compat/linuxkpi/common/include/linux/uaccess.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/compat/linuxkpi/common/include/linux/uaccess.h b/sys/compat/linuxkpi/common/include/linux/uaccess.h index a69e9cc1e8c8..c09c363a98a7 100644 --- a/sys/compat/linuxkpi/common/include/linux/uaccess.h +++ b/sys/compat/linuxkpi/common/include/linux/uaccess.h @@ -60,12 +60,17 @@ #define get_user(_x, _p) linux_copyin((_p), &(_x), sizeof(*(_p))) #define put_user(_x, _p) __put_user(_x, _p) #define clear_user(...) linux_clear_user(__VA_ARGS__) -#define access_ok(...) linux_access_ok(__VA_ARGS__) + +#if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >= 50000 +#define access_ok(a,b) linux_access_ok(a,b) +#else +#define access_ok(a,b,c) linux_access_ok(b,c) +#endif extern int linux_copyin(const void *uaddr, void *kaddr, size_t len); extern int linux_copyout(const void *kaddr, void *uaddr, size_t len); extern size_t linux_clear_user(void *uaddr, size_t len); -extern int linux_access_ok(int rw, const void *uaddr, size_t len); +extern int linux_access_ok(const void *uaddr, size_t len); /* * NOTE: Each pagefault_disable() call must have a corresponding |