diff options
author | anholt <anholt@FreeBSD.org> | 2002-09-01 17:45:04 +0000 |
---|---|---|
committer | anholt <anholt@FreeBSD.org> | 2002-09-01 17:45:04 +0000 |
commit | d284cb7b2dfe362518bfe2df31ff39e2de0165d0 (patch) | |
tree | 0682915dfe24d5fae2b66e520fb6dbb2973e1bc5 /sys/dev/drm/drm_os_freebsd.h | |
parent | 9c25e3c24e9d5d443522478861808d382b8d9a1f (diff) | |
download | FreeBSD-src-d284cb7b2dfe362518bfe2df31ff39e2de0165d0.zip FreeBSD-src-d284cb7b2dfe362518bfe2df31ff39e2de0165d0.tar.gz |
Remove drm_linux.h, move the two useful defines into drm_drv.h. Use fd locking
on -current. Actually copy in data from userspace to kernel in the
linux-compat ioctl path. Make sure ioctl sizes are as expected in the handler
functions.
Reviewed by: rwatson
Diffstat (limited to 'sys/dev/drm/drm_os_freebsd.h')
-rw-r--r-- | sys/dev/drm/drm_os_freebsd.h | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/sys/dev/drm/drm_os_freebsd.h b/sys/dev/drm/drm_os_freebsd.h index 5cd7056..e7c5901 100644 --- a/sys/dev/drm/drm_os_freebsd.h +++ b/sys/dev/drm/drm_os_freebsd.h @@ -106,14 +106,18 @@ do { \ #define DRM_OS_ERR(v) v -#define DRM_OS_KRNTOUSR(arg1, arg2, arg3) \ - *arg1 = arg2 -#define DRM_OS_KRNFROMUSR(arg1, arg2, arg3) \ - arg1 = *arg2 -#define DRM_OS_COPYTOUSR(arg1, arg2, arg3) \ - copyout(arg2, arg1, arg3) -#define DRM_OS_COPYFROMUSR(arg1, arg2, arg3) \ - copyin(arg2, arg1, arg3) +#define DRM_OS_KRNTOUSR( user, kern, size) \ + if ( IOCPARM_LEN(cmd) != size) \ + return EINVAL; \ + *user = kern; +#define DRM_OS_KRNFROMUSR(kern, user, size) \ + if ( IOCPARM_LEN(cmd) != size) \ + return EINVAL; \ + kern = *user; +#define DRM_OS_COPYTOUSR(user, kern, size) \ + copyout(kern, user, size) +#define DRM_OS_COPYFROMUSR(kern, user, size) \ + copyin(user, kern, size) #define DRM_OS_READMEMORYBARRIER \ { \ |