From 6ef79263b68402687ccc2b7447dd908c00e35057 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Sat, 29 Mar 2003 03:38:47 +0000 Subject: Add DRMFILE definitions and supply filp for BSD in the post-drm-filp-0-1-branch world. The filp is a void * cast from the current pid. This is a temporary solution which maintains the status quo until a proper solution is implemented. What is really needed is a unique pointer per open, hopefully with a device private area. This can be done in FreeBSD for all entry points except mmap, but is difficult (sys/dev/streams/streams.c is an example). I have partially completed code for this but have not had time to debug, so this is a temporary fix. --- bsd-core/drm_lock.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'bsd-core/drm_lock.c') diff --git a/bsd-core/drm_lock.c b/bsd-core/drm_lock.c index 6dd4f3c4..3bab78ef 100644 --- a/bsd-core/drm_lock.c +++ b/bsd-core/drm_lock.c @@ -78,7 +78,7 @@ int DRM(lock_transfer)(drm_device_t *dev, { unsigned int old, new; - dev->lock.pid = 0; + dev->lock.filp = NULL; do { old = *lock; new = context | _DRM_LOCK_HELD; @@ -91,19 +91,16 @@ int DRM(lock_free)(drm_device_t *dev, __volatile__ unsigned int *lock, unsigned int context) { unsigned int old, new; - pid_t pid = dev->lock.pid; - dev->lock.pid = 0; + dev->lock.filp = NULL; do { old = *lock; new = 0; } while (!atomic_cmpset_int(lock, old, new)); if (_DRM_LOCK_IS_HELD(old) && _DRM_LOCKING_CONTEXT(old) != context) { - DRM_ERROR("%d freed heavyweight lock held by %d (pid %d)\n", - context, - _DRM_LOCKING_CONTEXT(old), - pid); + DRM_ERROR("%d freed heavyweight lock held by %d\n", + context, _DRM_LOCKING_CONTEXT(old)); return 1; } DRM_WAKEUP_INT((void *)&dev->lock.lock_queue); -- cgit v1.2.3