From: Eric Anholt Date: Mon, 14 Feb 2005 03:28:01 +0000 (+0000) Subject: Use fuword32 for DRM_GET_USER_UNCHECKED when available. May help on 64-bit X-Git-Tag: submit/1.0/20121108.012404~1794 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3e8792e7051090b442d29444fa2e5dfe46847c34;p=profile%2Fivi%2Flibdrm.git 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 --- diff --git a/bsd-core/drmP.h b/bsd-core/drmP.h index 30e6be6..fbe1266 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)