Index: generic/src/proc/task.c
===================================================================
--- generic/src/proc/task.c	(revision 37e7d2b98befb3ce009212e46405509cbc621888)
+++ generic/src/proc/task.c	(revision 37c57f29513b54c8a95f330fce386b8a26dffa7e)
@@ -39,4 +39,5 @@
 #include <ipc/ipc.h>
 #include <memstr.h>
+#include <print.h>
 
 #include <elf.h>
@@ -132,2 +133,32 @@
 	return task;
 }
+
+/** Print task list */
+void task_print_list(void)
+{
+	link_t *cur;
+	task_t *t;
+	ipl_t ipl;
+	int i;
+	
+	/* Messing with thread structures, avoid deadlock */
+	ipl = interrupts_disable();
+	spinlock_lock(&tasks_lock);
+
+	for (cur=tasks_head.next; cur!=&tasks_head; cur=cur->next) {
+		t = list_get_instance(cur, task_t, tasks_link);
+		spinlock_lock(&t->lock);
+		printf("Task: %Q ActiveCalls: %d", t->taskid, 
+		       atomic_get(&t->active_calls));
+		for (i=0; i < IPC_MAX_PHONES; i++) {
+			if (t->phones[i].callee)
+				printf(" Ph(%d): %P ", i,t->phones[i].callee);
+		}
+		printf("\n");
+		spinlock_unlock(&t->lock);
+	}
+
+	spinlock_unlock(&tasks_lock);
+	interrupts_restore(ipl);
+	
+}
Index: generic/src/proc/thread.c
===================================================================
--- generic/src/proc/thread.c	(revision 37e7d2b98befb3ce009212e46405509cbc621888)
+++ generic/src/proc/thread.c	(revision 37c57f29513b54c8a95f330fce386b8a26dffa7e)
@@ -413,9 +413,8 @@
 		if (t->cpu)
 			printf("cpu%d ", t->cpu->id);
-		
 		printf("\n");
 	}
 
 	spinlock_unlock(&threads_lock);
-	interrupts_enable();
-}
+	interrupts_restore(ipl);
+}
