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 <johal...@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_ */
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to