add msleep_interruptible()
authorjsg <jsg@openbsd.org>
Fri, 7 Oct 2022 03:09:26 +0000 (03:09 +0000)
committerjsg <jsg@openbsd.org>
Fri, 7 Oct 2022 03:09:26 +0000 (03:09 +0000)
sys/dev/pci/drm/include/linux/delay.h

index 13433ea..3a48c04 100644 (file)
@@ -34,4 +34,14 @@ mdelay(unsigned long msecs)
 
 #define drm_msleep(x)          mdelay(x)
 
+static inline unsigned int
+msleep_interruptible(unsigned int msecs)
+{
+       int r = tsleep_nsec(&nowake, PWAIT|PCATCH, "msleepi",
+           MSEC_TO_NSEC(msecs));
+       if (r == EINTR)
+               return 1;
+       return 0;
+}
+
 #endif