]> xenbits.xensource.com Git - people/julieng/freebsd.git/commitdiff
Merge LinuxKPI changes from DragonflyBSD:
authorhselasky <hselasky@FreeBSD.org>
Mon, 19 Oct 2015 10:56:32 +0000 (10:56 +0000)
committerhselasky <hselasky@FreeBSD.org>
Mon, 19 Oct 2015 10:56:32 +0000 (10:56 +0000)
- Implement pagefault_disable() and pagefault_enable().

Sponsored by: Mellanox Technologies

sys/ofed/include/linux/uaccess.h

index 6ba34f7025b03a98e0283532041bb5037769c2e0..bab848c6ea091c509dea34a2bfbe989ed3f466ff 100644 (file)
@@ -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
 #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_ */