diff options
author | Eric Anholt <anholt@freebsd.org> | 2003-03-29 03:38:47 +0000 |
---|---|---|
committer | Eric Anholt <anholt@freebsd.org> | 2003-03-29 03:38:47 +0000 |
commit | 6ef79263b68402687ccc2b7447dd908c00e35057 (patch) | |
tree | 896bc499ce2a2eef74a07302e27661220458f38e /bsd-core/drm_lock.c | |
parent | e27d2f8c7cacf1e9994e9030c7ebb15dc4f4efff (diff) |
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.
Diffstat (limited to 'bsd-core/drm_lock.c')
-rw-r--r-- | bsd-core/drm_lock.c | 11 |
1 files changed, 4 insertions, 7 deletions
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); |