diff options
author | Keith Whitwell <keith@tungstengraphics.com> | 2003-09-09 07:43:47 +0000 |
---|---|---|
committer | Keith Whitwell <keith@tungstengraphics.com> | 2003-09-09 07:43:47 +0000 |
commit | 67a5fc3d1f61a411bd4901127d51382075473c11 (patch) | |
tree | 89c4b2c97b453b9537359cb98d630a63fe0babf5 | |
parent | a9c56532346b9e8f5372bfd3ee6bbc775ab1c47b (diff) |
Use spldrm/splx around tsleep() in DRM_WAIT_ON
-rw-r--r-- | bsd-core/drm_os_freebsd.h | 10 | ||||
-rw-r--r-- | bsd/drm_os_freebsd.h | 10 |
2 files changed, 14 insertions, 6 deletions
diff --git a/bsd-core/drm_os_freebsd.h b/bsd-core/drm_os_freebsd.h index c1ed0f70..6097219a 100644 --- a/bsd-core/drm_os_freebsd.h +++ b/bsd-core/drm_os_freebsd.h @@ -174,9 +174,13 @@ do { \ #define DRM_HZ hz -#define DRM_WAIT_ON( ret, queue, timeout, condition ) \ -for ( ret = 0 ; !(condition) && !ret ; ) { \ - ret = tsleep( &(queue), PZERO | PCATCH, "drmwtq", (timeout) ); \ +#define DRM_WAIT_ON( ret, queue, timeout, condition ) \ +for ( ret = 0 ; !ret && !(condition) ; ) { \ + int s = spldrm(); \ + if (!(condition)) \ + ret = tsleep( &(queue), PZERO | PCATCH, \ + "drmwtq", (timeout) ); \ + splx(s); \ } #define DRM_WAKEUP( queue ) wakeup( queue ) diff --git a/bsd/drm_os_freebsd.h b/bsd/drm_os_freebsd.h index c1ed0f70..6097219a 100644 --- a/bsd/drm_os_freebsd.h +++ b/bsd/drm_os_freebsd.h @@ -174,9 +174,13 @@ do { \ #define DRM_HZ hz -#define DRM_WAIT_ON( ret, queue, timeout, condition ) \ -for ( ret = 0 ; !(condition) && !ret ; ) { \ - ret = tsleep( &(queue), PZERO | PCATCH, "drmwtq", (timeout) ); \ +#define DRM_WAIT_ON( ret, queue, timeout, condition ) \ +for ( ret = 0 ; !ret && !(condition) ; ) { \ + int s = spldrm(); \ + if (!(condition)) \ + ret = tsleep( &(queue), PZERO | PCATCH, \ + "drmwtq", (timeout) ); \ + splx(s); \ } #define DRM_WAKEUP( queue ) wakeup( queue ) |