Index: kernel/generic/src/ipc/ipcrsc.c
===================================================================
--- kernel/generic/src/ipc/ipcrsc.c	(revision 2c0e5d283ee11b7c67867a881703b5bdff9fae9a)
+++ kernel/generic/src/ipc/ipcrsc.c	(revision da1bafb8cf9a3b3be8ef21bc114daaa476a85190)
@@ -45,5 +45,5 @@
  * - hangup phone (the caller has hung up)
  * - hangup phone (the answerbox is exiting)
- * 
+ *
  * Locking strategy
  *
@@ -85,5 +85,5 @@
  *
  * Phone hangup
- * 
+ *
  * *** The caller hangs up (sys_ipc_hangup) ***
  * - The phone is disconnected (no more messages can be sent over this phone),
@@ -99,5 +99,5 @@
  *
  * Call forwarding
- * 
+ *
  * The call can be forwarded, so that the answer to call is passed directly
  * to the original sender. However, this poses special problems regarding 
@@ -114,5 +114,5 @@
  *
  * Cleanup strategy
- * 
+ *
  * 1) Disconnect all our phones ('ipc_phone_hangup').
  *
@@ -123,5 +123,5 @@
  *
  * 4) Wait for all async answers to arrive and dispose of them.
- * 
+ *
  */
 
@@ -137,19 +137,20 @@
  * @todo Some speedup (hash table?)
  *
- * @param callid	Userspace hash of the call. Currently it is the call
- *			structure kernel address.
- *
- * @return		NULL on not found, otherwise pointer to the call
- *			structure.
+ * @param callid Userspace hash of the call. Currently it is the call
+ *               structure kernel address.
+ *
+ * @return NULL on not found, otherwise pointer to the call
+ *         structure.
+ *
  */
 call_t *get_call(unative_t callid)
 {
 	link_t *lst;
-	call_t *call, *result = NULL;
-
-	spinlock_lock(&TASK->answerbox.lock);
+	call_t *result = NULL;
+	
+	irq_spinlock_lock(&TASK->answerbox.lock, true);
 	for (lst = TASK->answerbox.dispatched_calls.next;
 	    lst != &TASK->answerbox.dispatched_calls; lst = lst->next) {
-		call = list_get_instance(lst, call_t, link);
+		call_t *call = list_get_instance(lst, call_t, link);
 		if ((unative_t) call == callid) {
 			result = call;
@@ -157,5 +158,6 @@
 		}
 	}
-	spinlock_unlock(&TASK->answerbox.lock);
+	
+	irq_spinlock_unlock(&TASK->answerbox.lock, true);
 	return result;
 }
@@ -163,29 +165,31 @@
 /** Allocate new phone slot in the specified task.
  *
- * @param t		Task for which to allocate a new phone.
- *
- * @return		New phone handle or -1 if the phone handle limit is
- *			exceeded.
- */
-int phone_alloc(task_t *t)
-{
-	int i;
-
-	spinlock_lock(&t->lock);
+ * @param task Task for which to allocate a new phone.
+ *
+ * @return New phone handle or -1 if the phone handle limit is
+ *         exceeded.
+ *
+ */
+int phone_alloc(task_t *task)
+{
+	irq_spinlock_lock(&task->lock, true);
+	
+	size_t i;
 	for (i = 0; i < IPC_MAX_PHONES; i++) {
-		if (t->phones[i].state == IPC_PHONE_HUNGUP &&
-		    atomic_get(&t->phones[i].active_calls) == 0)
-			t->phones[i].state = IPC_PHONE_FREE;
-
-		if (t->phones[i].state == IPC_PHONE_FREE) {
-			t->phones[i].state = IPC_PHONE_CONNECTING;
+		if ((task->phones[i].state == IPC_PHONE_HUNGUP) &&
+		    (atomic_get(&task->phones[i].active_calls) == 0))
+			task->phones[i].state = IPC_PHONE_FREE;
+		
+		if (task->phones[i].state == IPC_PHONE_FREE) {
+			task->phones[i].state = IPC_PHONE_CONNECTING;
 			break;
 		}
 	}
-	spinlock_unlock(&t->lock);
-
+	
+	irq_spinlock_unlock(&task->lock, true);
+	
 	if (i == IPC_MAX_PHONES)
 		return -1;
-
+	
 	return i;
 }
@@ -193,5 +197,6 @@
 /** Mark a phone structure free.
  *
- * @param phone		Phone structure to be marked free.
+ * @param phone Phone structure to be marked free.
+ *
  */
 static void phone_deallocp(phone_t *phone)
@@ -199,5 +204,5 @@
 	ASSERT(phone->state == IPC_PHONE_CONNECTING);
 	
-	/* atomic operation */
+	/* Atomic operation */
 	phone->state = IPC_PHONE_FREE;
 }
@@ -207,5 +212,6 @@
  * All already sent messages will be correctly processed.
  *
- * @param phoneid	Phone handle of the phone to be freed.
+ * @param phoneid Phone handle of the phone to be freed.
+ *
  */
 void phone_dealloc(int phoneid)
@@ -216,10 +222,11 @@
 /** Connect phone to a given answerbox.
  *
- * @param phoneid 	Phone handle to be connected.
- * @param box		Answerbox to which to connect the phone handle.
+ * @param phoneid Phone handle to be connected.
+ * @param box     Answerbox to which to connect the phone handle.
  *
  * The procedure _enforces_ that the user first marks the phone
  * busy (e.g. via phone_alloc) and then connects the phone, otherwise
  * race condition may appear.
+ *
  */
 void phone_connect(int phoneid, answerbox_t *box)
