Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107176195
D36113.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D36113.diff
View Options
diff --git a/sys/compat/linuxkpi/common/include/linux/uaccess.h b/sys/compat/linuxkpi/common/include/linux/uaccess.h
--- a/sys/compat/linuxkpi/common/include/linux/uaccess.h
+++ b/sys/compat/linuxkpi/common/include/linux/uaccess.h
@@ -89,4 +89,29 @@
return ((curthread->td_pflags & TDP_NOFAULTING) != 0);
}
+static inline int
+__copy_to_user_inatomic(void __user *to, const void *from, unsigned n)
+{
+
+ return (copyout_nofault(from, to, n) != 0 ? n : 0);
+}
+#define __copy_to_user_inatomic_nocache(to, from, n) \
+ __copy_to_user_inatomic((to), (from), (n))
+
+static inline unsigned long
+__copy_from_user_inatomic(void *to, const void __user *from,
+ unsigned long n)
+{
+ /*
+ * XXXKIB. Equivalent Linux function is implemented using
+ * MOVNTI for aligned moves. For unaligned head and tail,
+ * normal move is performed. As such, it is not incorrect, if
+ * only somewhat slower, to use normal copyin. All uses
+ * except shmem_pwrite_fast() have the destination mapped WC.
+ */
+ return ((copyin_nofault(__DECONST(void *, from), to, n) != 0 ? n : 0));
+}
+#define __copy_from_user_inatomic_nocache(to, from, n) \
+ __copy_from_user_inatomic((to), (from), (n))
+
#endif /* _LINUXKPI_LINUX_UACCESS_H_ */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Jan 12, 6:50 AM (20 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15763042
Default Alt Text
D36113.diff (1 KB)
Attached To
Mode
D36113: linuxkpi: Add __copy_to_user_inatomic and __copy_from_user_inatomic
Attached
Detach File
Event Timeline
Log In to Comment