From: Keith Whitwell Date: Tue, 9 Sep 2003 07:45:12 +0000 (+0000) Subject: Use spldrm/splx around tsleep() in DRM_WAIT_ON X-Git-Tag: submit/1.0/20121108.012404~2232 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6fc41e25e5acbbfae4d2e93a0d9e6f980f8ae477;p=profile%2Fivi%2Flibdrm.git Use spldrm/splx around tsleep() in DRM_WAIT_ON --- diff --git a/bsd-core/drm_os_freebsd.h b/bsd-core/drm_os_freebsd.h index 2addf2f..a5049f5 100644 --- a/bsd-core/drm_os_freebsd.h +++ b/bsd-core/drm_os_freebsd.h @@ -204,11 +204,13 @@ do { \ #define DRM_HZ hz -#define DRM_WAIT_ON( ret, queue, timeout, condition ) \ -while (!condition) { \ - ret = tsleep( &(queue), PZERO | PCATCH, "drmwtq", (timeout) ); \ - if ( ret ) \ - return ret; \ +#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 2addf2f..a5049f5 100644 --- a/bsd/drm_os_freebsd.h +++ b/bsd/drm_os_freebsd.h @@ -204,11 +204,13 @@ do { \ #define DRM_HZ hz -#define DRM_WAIT_ON( ret, queue, timeout, condition ) \ -while (!condition) { \ - ret = tsleep( &(queue), PZERO | PCATCH, "drmwtq", (timeout) ); \ - if ( ret ) \ - return ret; \ +#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 )