summaryrefslogtreecommitdiff
path: root/sys/dev/pci/drm
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2019-05-08 23:35:24 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2019-05-08 23:35:24 +0000
commit53c9b5bb2c2370e92da7cba4a8dc092d78e05c8e (patch)
tree559925b7b3691f0d3a43af25bb453b1b7503a533 /sys/dev/pci/drm
parent1e0157fca10ae29c8630cf7a4ab98e1800c0da16 (diff)
Add wait_event_killable(). In linux TASK_KILLABLE only gets fatal
signals, as we don't have an equivalent use PCATCH and check for all signals before and after msleep. Discussed with kettenis@.
Diffstat (limited to 'sys/dev/pci/drm')
-rw-r--r--sys/dev/pci/drm/include/linux/wait.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/dev/pci/drm/include/linux/wait.h b/sys/dev/pci/drm/include/linux/wait.h
index f69a1c91a10..5860e906a5c 100644
--- a/sys/dev/pci/drm/include/linux/wait.h
+++ b/sys/dev/pci/drm/include/linux/wait.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: wait.h,v 1.3 2019/05/01 07:22:24 jsg Exp $ */
+/* $OpenBSD: wait.h,v 1.4 2019/05/08 23:35:23 jsg Exp $ */
/*
* Copyright (c) 2013, 2014, 2015 Mark Kettenis
* Copyright (c) 2017 Martin Pieuchot
@@ -146,6 +146,12 @@ do { \
__wait_event_intr_timeout(wq, condition, 0, 0); \
} while (0)
+#define wait_event_killable(wq, condition) \
+do { \
+ if (!(condition)) \
+ __wait_event_intr_timeout(wq, condition, 0, PCATCH); \
+} while (0)
+
#define wait_event_interruptible(wq, condition) \
({ \
int __ret = 0; \