Date: Wed, 20 Jun 2018 06:57:14 +0000 (UTC) From: Hans Petter Selasky <hselasky@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r335432 - stable/11/sys/compat/linuxkpi/common/include/asm Message-ID: <201806200657.w5K6vE9G031968@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hselasky Date: Wed Jun 20 06:57:14 2018 New Revision: 335432 URL: https://svnweb.freebsd.org/changeset/base/335432 Log: MFC r334953: Implement the user_access_begin(), user_access_end(), usafe_get_user() and unsafe_put_user() function macros in the LinuxKPI. Submitted by: Johannes Lundberg <johalun0@gmail.com> Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: stable/11/sys/compat/linuxkpi/common/include/asm/uaccess.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/asm/uaccess.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/asm/uaccess.h Wed Jun 20 06:56:18 2018 (r335431) +++ stable/11/sys/compat/linuxkpi/common/include/asm/uaccess.h Wed Jun 20 06:57:14 2018 (r335432) @@ -52,4 +52,17 @@ copy_from_user(void *to, const void *from, unsigned lo #define __copy_from_user(...) copy_from_user(__VA_ARGS__) #define __copy_in_user(...) copy_from_user(__VA_ARGS__) +#define user_access_begin() do { } while (0) +#define user_access_end() do { } while (0) + +#define unsafe_get_user(x, ptr, err) do { \ + if (unlikely(__get_user(x, ptr))) \ + goto err; \ +} while (0) + +#define unsafe_put_user(x, ptr, err) do { \ + if (unlikely(__put_user(x, ptr))) \ + goto err; \ +} while (0) + #endif /* _ASM_UACCESS_H_ */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201806200657.w5K6vE9G031968>