summaryrefslogtreecommitdiffstats
path: root/sys/compat
diff options
context:
space:
mode:
authorhselasky <hselasky@FreeBSD.org>2016-01-26 14:21:30 +0000
committerhselasky <hselasky@FreeBSD.org>2016-01-26 14:21:30 +0000
commit71eec1d7860827138472dcd016ebfcf8e78dabd1 (patch)
tree05e9143565d82150a7fc56a7fd30f2988658e0f3 /sys/compat
parent553c3e5b93b8f8eb3af0e9dacbc97ebd2c332b62 (diff)
downloadFreeBSD-src-71eec1d7860827138472dcd016ebfcf8e78dabd1.zip
FreeBSD-src-71eec1d7860827138472dcd016ebfcf8e78dabd1.tar.gz
Define __get_user() and __put_user() for the LinuxKPI.
MFC after: 1 week Sponsored by: Mellanox Technologies
Diffstat (limited to 'sys/compat')
-rw-r--r--sys/compat/linuxkpi/common/include/linux/uaccess.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/sys/compat/linuxkpi/common/include/linux/uaccess.h b/sys/compat/linuxkpi/common/include/linux/uaccess.h
index 87d1bab..e44024e 100644
--- a/sys/compat/linuxkpi/common/include/linux/uaccess.h
+++ b/sys/compat/linuxkpi/common/include/linux/uaccess.h
@@ -2,7 +2,7 @@
* Copyright (c) 2010 Isilon Systems, Inc.
* Copyright (c) 2010 iX Systems, Inc.
* Copyright (c) 2010 Panasas, Inc.
- * Copyright (c) 2013-2015 Mellanox Technologies, Ltd.
+ * Copyright (c) 2013-2016 Mellanox Technologies, Ltd.
* Copyright (c) 2015 François Tigeot
* All rights reserved.
*
@@ -34,6 +34,17 @@
#include <linux/compiler.h>
+#define __get_user(_x, _p) ({ \
+ int __err; \
+ __typeof(*(_p)) __x; \
+ __err = -copyin((_p), &(__x), sizeof(*(_p))); \
+ (_x) = __x; \
+ __err; \
+})
+#define __put_user(_x, _p) ({ \
+ __typeof(*(_p)) __x = (_x); \
+ -copyout(&(__x), (_p), sizeof(*(_p))); \
+})
#define get_user(_x, _p) -copyin((_p), &(_x), sizeof(*(_p)))
#define put_user(_x, _p) -copyout(&(_x), (_p), sizeof(*(_p)))
OpenPOWER on IntegriCloud