Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/riastradh-drm2]: src/sys/external/bsd/drm2/include/asm Add some copy_to/...



details:   https://anonhg.NetBSD.org/src/rev/1c21247b9c35
branches:  riastradh-drm2
changeset: 788509:1c21247b9c35
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Sep 08 15:35:36 2013 +0000

description:
Add some copy_to/from_user variants to Linux <asm/uaccess.h>.

diffstat:

 sys/external/bsd/drm2/include/asm/uaccess.h |  44 ++++++++++++++++++++++++++++-
 1 files changed, 43 insertions(+), 1 deletions(-)

diffs (63 lines):

diff -r b5ac58003961 -r 1c21247b9c35 sys/external/bsd/drm2/include/asm/uaccess.h
--- a/sys/external/bsd/drm2/include/asm/uaccess.h       Sun Sep 08 15:35:06 2013 +0000
+++ b/sys/external/bsd/drm2/include/asm/uaccess.h       Sun Sep 08 15:35:36 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uaccess.h,v 1.1.2.4 2013/07/24 02:12:14 riastradh Exp $        */
+/*     $NetBSD: uaccess.h,v 1.1.2.5 2013/09/08 15:35:36 riastradh Exp $        */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -35,6 +35,19 @@
 #include <sys/types.h>
 #include <sys/systm.h>
 
+/* XXX This is a cop-out.  */
+#define        VERIFY_READ     0
+#define        VERIFY_WRITE    1
+static inline bool
+access_ok(int verify_op __unused, const void *uaddr __unused,
+    size_t nbytes __unused)
+{
+       return true;
+}
+
+#define        __copy_from_user        copy_from_user
+#define        __copy_to_user          copy_to_user
+
 static inline int
 copy_from_user(void *kernel_addr, const void *user_addr, size_t len)
 {
@@ -55,4 +68,33 @@
 #define        put_user(KERNEL_LOC, USER_ADDR)                                 \
        copy_to_user((USER_ADDR), &(KERNEL_LOC), sizeof(KERNEL_LOC))
 
+#if 0
+/*
+ * XXX These `inatomic' versions are a cop out, but they should do for
+ * now -- they are used only in fast paths which can't fault but which
+ * can fall back to slower paths that arrange things so faulting is OK.
+ */
+
+static inline int
+__copy_from_user_inatomic(void *kernel_addr __unused,
+    const void *user_addr __unused, size_t len __unused)
+{
+       return -EFAULT;
+}
+
+static inline int
+__copy_to_user_inatomic(void *user_addr __unused,
+    const void *kernel_addr __unused, size_t len __unused)
+{
+       return -EFAULT;
+}
+#endif /* 0 */
+
+static inline int
+__copy_from_user_inatomic_nocache(void *kernel_addr __unused,
+    const void *user_addr __unused, size_t len __unused)
+{
+       return -EFAULT;
+}
+
 #endif  /* _ASM_UACCESS_H_ */



Home | Main Index | Thread Index | Old Index