Module Name: src Committed By: riastradh Date: Sun Sep 8 15:35:36 UTC 2013
Modified Files: src/sys/external/bsd/drm2/include/asm [riastradh-drm2]: uaccess.h Log Message: Add some copy_to/from_user variants to Linux <asm/uaccess.h>. To generate a diff of this commit: cvs rdiff -u -r1.1.2.4 -r1.1.2.5 \ src/sys/external/bsd/drm2/include/asm/uaccess.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/external/bsd/drm2/include/asm/uaccess.h diff -u src/sys/external/bsd/drm2/include/asm/uaccess.h:1.1.2.4 src/sys/external/bsd/drm2/include/asm/uaccess.h:1.1.2.5 --- src/sys/external/bsd/drm2/include/asm/uaccess.h:1.1.2.4 Wed Jul 24 02:12:14 2013 +++ src/sys/external/bsd/drm2/include/asm/uaccess.h Sun Sep 8 15:35:36 2013 @@ -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 @@ copy_to_user(void *user_addr, const void #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_ */