From db6c8e65f1ecd4543d39623944623c3e7bd78b3f Mon Sep 17 00:00:00 2001 From: jsg Date: Fri, 7 Oct 2022 03:09:26 +0000 Subject: [PATCH] add msleep_interruptible() --- sys/dev/pci/drm/include/linux/delay.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sys/dev/pci/drm/include/linux/delay.h b/sys/dev/pci/drm/include/linux/delay.h index 13433ea8fa3..3a48c04f89d 100644 --- a/sys/dev/pci/drm/include/linux/delay.h +++ b/sys/dev/pci/drm/include/linux/delay.h @@ -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 -- 2.20.1