Index: kernel/generic/include/ddi/irq.h
===================================================================
--- kernel/generic/include/ddi/irq.h	(revision cf5ddf618974e3d854b08c9d0db88f2ad90fee8c)
+++ kernel/generic/include/ddi/irq.h	(revision 557394294b6545575e0e9b328455da8ae4cf8a51)
@@ -84,6 +84,4 @@
 typedef void (* irq_handler_t)(struct irq *irq, void *arg, ...);
 
-
-
 /** IPC notification config structure.
  *
Index: kernel/generic/include/proc/thread.h
===================================================================
--- kernel/generic/include/proc/thread.h	(revision cf5ddf618974e3d854b08c9d0db88f2ad90fee8c)
+++ kernel/generic/include/proc/thread.h	(revision 557394294b6545575e0e9b328455da8ae4cf8a51)
@@ -244,5 +244,4 @@
 extern void thread_update_accounting(void);
 extern bool thread_exists(thread_t *t);
-extern void thread_interrupt_sleep(thread_t *t);
 
 /** Fpu context slab cache. */
Index: kernel/generic/include/synch/waitq.h
===================================================================
--- kernel/generic/include/synch/waitq.h	(revision cf5ddf618974e3d854b08c9d0db88f2ad90fee8c)
+++ kernel/generic/include/synch/waitq.h	(revision 557394294b6545575e0e9b328455da8ae4cf8a51)
@@ -64,4 +64,6 @@
 	waitq_sleep_timeout((wq), SYNCH_NO_TIMEOUT, SYNCH_FLAGS_NONE)
 
+struct thread;
+
 extern void waitq_initialize(waitq_t *wq);
 extern int waitq_sleep_timeout(waitq_t *wq, uint32_t usec, int flags);
@@ -71,4 +73,5 @@
 extern void waitq_wakeup(waitq_t *wq, bool all);
 extern void _waitq_wakeup_unsafe(waitq_t *wq, bool all);
+extern void waitq_interrupt_sleep(struct thread *t);
 
 #endif
Index: kernel/generic/src/proc/task.c
===================================================================
--- kernel/generic/src/proc/task.c	(revision cf5ddf618974e3d854b08c9d0db88f2ad90fee8c)
+++ kernel/generic/src/proc/task.c	(revision 557394294b6545575e0e9b328455da8ae4cf8a51)
@@ -43,4 +43,5 @@
 #include <mm/slab.h>
 #include <synch/spinlock.h>
+#include <synch/waitq.h>
 #include <arch.h>
 #include <panic.h>
@@ -364,5 +365,5 @@
 		
 		if (sleeping)
-			thread_interrupt_sleep(thr);
+			waitq_interrupt_sleep(thr);
 	}
 	
Index: kernel/generic/src/proc/thread.c
===================================================================
--- kernel/generic/src/proc/thread.c	(revision cf5ddf618974e3d854b08c9d0db88f2ad90fee8c)
+++ kernel/generic/src/proc/thread.c	(revision 557394294b6545575e0e9b328455da8ae4cf8a51)
@@ -679,57 +679,4 @@
 }
 
-/** Interrupt sleeping thread.
- *
- * This routine attempts to interrupt a thread from its sleep in a waitqueue.
- * If the thread is not found sleeping, no action is taken.
- *
- * @param t Thread to be interrupted.
- */
-void thread_interrupt_sleep(thread_t *t)
-{
-	waitq_t *wq;
-	bool do_wakeup = false;
-	ipl_t ipl;
-
-	ipl = interrupts_disable();
-	spinlock_lock(&threads_lock);
-	if (!thread_exists(t))
-		goto out;
-
-grab_locks:
-	spinlock_lock(&t->lock);
-	if ((wq = t->sleep_queue)) {		/* assignment */
-		if (!(t->sleep_interruptible)) {
-			/*
-			 * The sleep cannot be interrupted.
-			 */
-			spinlock_unlock(&t->lock);
-			goto out;
-		}
-			
-		if (!spinlock_trylock(&wq->lock)) {
-			spinlock_unlock(&t->lock);
-			goto grab_locks;	/* avoid deadlock */
-		}
-
-		if (t->timeout_pending && timeout_unregister(&t->sleep_timeout))
-			t->timeout_pending = false;
-
-		list_remove(&t->wq_link);
-		t->saved_context = t->sleep_interruption_context;
-		do_wakeup = true;
-		t->sleep_queue = NULL;
-		spinlock_unlock(&wq->lock);
-	}
-	spinlock_unlock(&t->lock);
-
-	if (do_wakeup)
-		thread_ready(t);
-
-out:
-	spinlock_unlock(&threads_lock);
-	interrupts_restore(ipl);
-}
-
 /** @}
  */
Index: kernel/generic/src/synch/waitq.c
===================================================================
--- kernel/generic/src/synch/waitq.c	(revision cf5ddf618974e3d854b08c9d0db88f2ad90fee8c)
+++ kernel/generic/src/synch/waitq.c	(revision 557394294b6545575e0e9b328455da8ae4cf8a51)
@@ -117,4 +117,56 @@
 }
 
+/** Interrupt sleeping thread.
+ *
+ * This routine attempts to interrupt a thread from its sleep in a waitqueue.
+ * If the thread is not found sleeping, no action is taken.
+ *
+ * @param t Thread to be interrupted.
+ */
+void waitq_interrupt_sleep(thread_t *t)
+{
+	waitq_t *wq;
+	bool do_wakeup = false;
+	ipl_t ipl;
+
+	ipl = interrupts_disable();
+	spinlock_lock(&threads_lock);
+	if (!thread_exists(t))
+		goto out;
+
+grab_locks:
+	spinlock_lock(&t->lock);
+	if ((wq = t->sleep_queue)) {		/* assignment */
+		if (!(t->sleep_interruptible)) {
+			/*
+			 * The sleep cannot be interrupted.
+			 */
+			spinlock_unlock(&t->lock);
+			goto out;
+		}
+			
+		if (!spinlock_trylock(&wq->lock)) {
+			spinlock_unlock(&t->lock);
+			goto grab_locks;	/* avoid deadlock */
+		}
+
+		if (t->timeout_pending && timeout_unregister(&t->sleep_timeout))
+			t->timeout_pending = false;
+
+		list_remove(&t->wq_link);
+		t->saved_context = t->sleep_interruption_context;
+		do_wakeup = true;
+		t->sleep_queue = NULL;
+		spinlock_unlock(&wq->lock);
+	}
+	spinlock_unlock(&t->lock);
+
+	if (do_wakeup)
+		thread_ready(t);
+
+out:
+	spinlock_unlock(&threads_lock);
+	interrupts_restore(ipl);
+}
 
 /** Sleep until either wakeup, timeout or interruption occurs
