@@ -332,6 +332,31 @@ do {
            \
    __ret;                              \
 })
+/**
+ * wait_interruptible_timeout - sleep until a waitqueue is woken up
+ * @wq: the waitqueue to wait on
+ * @timeout: timeout, in jiffies
+ *
+ * The process is put to sleep (TASK_INTERRUPTIBLE) until the waitqueue
+ * @wq is woken up. It can be done manually with wake_up or will happen
+ * if timeout elapses.
+ *
+ * The function returns 0 if the @timeout elapsed, remaining jiffies
+ * if workqueue was waken up earlier.
+ */
+#define wait_interruptible_timeout(wq, timeout)
     \
+({ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â \
+ Â Â Â long __ret = timeout; Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â \
+ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â \
+ Â Â Â DEFINE_WAIT(__wait); Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â \
+ Â Â Â prepare_to_wait(&wq, &__wait, TASK_INTERRUPTIBLE); Â Â Â Â Â Â Â \
+ Â Â Â if (!signal_pending(current)) Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â \
+ Â Â Â Â Â Â Â __ret = schedule_timeout(__ret); Â Â Â Â Â Â Â Â Â Â Â Â \
+ Â Â Â finish_wait(&wq, &__wait); Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â \
+ Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â \
+ Â Â Â __ret; Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â \
+})
+
 #define __wait_event_interruptible_exclusive(wq, condition, ret)    \