summaryrefslogtreecommitdiffstats
path: root/sys/ofed
diff options
context:
space:
mode:
authorhselasky <hselasky@FreeBSD.org>2015-10-19 10:56:32 +0000
committerhselasky <hselasky@FreeBSD.org>2015-10-19 10:56:32 +0000
commit676076548047bc0a4249b444ca2ac6ef9763ddfe (patch)
tree1b3b4d55a893b6ace25eb3cb7f97df8e9f4ab9b0 /sys/ofed
parent74fb822e8a392e1828b818713e4a1df3006c25d4 (diff)
downloadFreeBSD-src-676076548047bc0a4249b444ca2ac6ef9763ddfe.zip
FreeBSD-src-676076548047bc0a4249b444ca2ac6ef9763ddfe.tar.gz
Merge LinuxKPI changes from DragonflyBSD:
- Implement pagefault_disable() and pagefault_enable(). Sponsored by: Mellanox Technologies
Diffstat (limited to 'sys/ofed')
-rw-r--r--sys/ofed/include/linux/uaccess.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/sys/ofed/include/linux/uaccess.h b/sys/ofed/include/linux/uaccess.h
index 6ba34f7..bab848c 100644
--- a/sys/ofed/include/linux/uaccess.h
+++ b/sys/ofed/include/linux/uaccess.h
@@ -2,7 +2,8 @@
* Copyright (c) 2010 Isilon Systems, Inc.
* Copyright (c) 2010 iX Systems, Inc.
* Copyright (c) 2010 Panasas, Inc.
- * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd.
+ * Copyright (c) 2013-2015 Mellanox Technologies, Ltd.
+ * Copyright (c) 2015 François Tigeot
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -32,4 +33,14 @@
#define get_user(_x, _p) -copyin((_p), &(_x), sizeof(*(_p)))
#define put_user(_x, _p) -copyout(&(_x), (_p), sizeof(*(_p)))
+static inline void pagefault_disable(void)
+{
+ curthread_pflags_set(TDP_NOFAULTING | TDP_RESETSPUR);
+}
+
+static inline void pagefault_enable(void)
+{
+ curthread_pflags_restore(~(TDP_NOFAULTING | TDP_RESETSPUR));
+}
+
#endif /* _LINUX_UACCESS_H_ */
OpenPOWER on IntegriCloud