Index: kernel/generic/include/ddi/irq.h
===================================================================
--- kernel/generic/include/ddi/irq.h	(revision 7dcf22a389ae4373e29fc2686bf9bae2ac3a8d39)
+++ kernel/generic/include/ddi/irq.h	(revision 63530c623718a69d8b980518b5dec7e17f4d991d)
@@ -38,4 +38,8 @@
 #include <arch/types.h>
 #include <adt/list.h>
+#include <ipc/ipc.h>
+#include <ipc/irq.h>
+#include <atomic.h>
+#include <synch/spinlock.h>
 
 typedef enum {
@@ -63,4 +67,11 @@
 	link_t link;
 
+	/** Lock protecting everything in this structure
+	 *  except the link member. When both the IRQ
+	 *  hash table lock and this lock are to be acquired,
+	 *  this lock must not be taken first.
+	 */
+	SPINLOCK_DECLARE(lock);
+
 	/** Unique device number. -1 if not yet assigned. */
 	devno_t devno;
@@ -68,6 +79,4 @@
 	/** Actual IRQ number. -1 if not yet assigned. */
 	inr_t inr;
-	/** Task ID of the task to be notified about the IRQ or 0. */
-	task_id_t notif;
 	/** Trigger level of the IRQ.*/
 	irq_trigger_t trigger;
@@ -78,4 +87,12 @@
 	/** Argument for the handler. */
 	void *arg;
+
+	/** Answerbox of the task that wanted to be notified. */
+	answerbox_t *notif_answerbox;
+	/** Pseudo-code to be performed by the top-half
+	 *  before a notification is sent. */
+	irq_code_t *code;
+	/** Counter of IRQ notifications. */
+	atomic_t counter;
 };
 
Index: kernel/generic/src/ddi/irq.c
===================================================================
--- kernel/generic/src/ddi/irq.c	(revision 7dcf22a389ae4373e29fc2686bf9bae2ac3a8d39)
+++ kernel/generic/src/ddi/irq.c	(revision 63530c623718a69d8b980518b5dec7e17f4d991d)
@@ -64,4 +64,5 @@
 #include <typedefs.h>
 #include <synch/spinlock.h>
+#include <atomic.h>
 #include <arch.h>
 
@@ -128,11 +129,14 @@
 {
 	link_initialize(&irq->link);
+	spinlock_initialize(&irq->lock, "irq.lock");
 	irq->inr = -1;
 	irq->devno = -1;
-	irq->notif = 0;
 	irq->trigger = 0;
 	irq->claim = NULL;
 	irq->handler = NULL;
 	irq->arg = NULL;
+	irq->notif_answerbox = NULL;
+	irq->code = NULL;
+	atomic_set(&irq->counter, 0);
 }
 
@@ -221,6 +225,11 @@
 	irq_t *irq = hash_table_get_instance(item, irq_t, link);
 	inr_t *inr = (inr_t *) key;
-	
-	return ((irq->inr == *inr) && (irq->claim() == IRQ_ACCEPT));
+	bool rv;
+	
+	spinlock_lock(&irq->lock);
+	rv = ((irq->inr == *inr) && (irq->claim() == IRQ_ACCEPT));
+	spinlock_unlock(&irq->lock);
+
+	return rv;
 }
 
@@ -260,6 +269,11 @@
 {
 	irq_t *irq = list_get_instance(item, irq_t, link);
-	
-	return (irq->claim() == IRQ_ACCEPT);
+	bool rv;
+	
+	spinlock_lock(&irq->lock);
+	rv = (irq->claim() == IRQ_ACCEPT);
+	spinlock_unlock(&irq->lock);
+	
+	return rv;
 }
 
