summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <anholt@freebsd.org>2005-02-14 03:28:01 +0000
committerEric Anholt <anholt@freebsd.org>2005-02-14 03:28:01 +0000
commit3e8792e7051090b442d29444fa2e5dfe46847c34 (patch)
treefdbf8043a9816404403eadd319feb90f399b1691
parented082798f481b43d9745aaae15306e94a9acb169 (diff)
Use fuword32 for DRM_GET_USER_UNCHECKED when available. May help on 64-bit
platforms. Submitted by: Jung-uk Kim, jkim at niksun dot com
-rw-r--r--bsd-core/drmP.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/bsd-core/drmP.h b/bsd-core/drmP.h
index 30e6be67..fbe1266c 100644
--- a/bsd-core/drmP.h
+++ b/bsd-core/drmP.h
@@ -331,8 +331,13 @@ typedef vaddr_t vm_offset_t;
copyin(arg2, arg1, arg3)
#define DRM_COPY_TO_USER_UNCHECKED(arg1, arg2, arg3) \
copyout(arg2, arg1, arg3)
-#define DRM_GET_USER_UNCHECKED(val, uaddr) \
+#if __FreeBSD_version > 500000
+#define DRM_GET_USER_UNCHECKED(val, uaddr) \
+ ((val) = fuword32(uaddr), 0)
+#else
+#define DRM_GET_USER_UNCHECKED(val, uaddr) \
((val) = fuword(uaddr), 0)
+#endif
#define cpu_to_le32(x) htole32(x)
#define le32_to_cpu(x) le32toh(x)