aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bsd-core/drm_os_freebsd.h12
-rw-r--r--bsd/drm_os_freebsd.h12
2 files changed, 14 insertions, 10 deletions
diff --git a/bsd-core/drm_os_freebsd.h b/bsd-core/drm_os_freebsd.h
index 2addf2f4..a5049f54 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 2addf2f4..a5049f54 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 )