Index: contrib/arch/kernel/kernel.adl
===================================================================
--- contrib/arch/kernel/kernel.adl	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ contrib/arch/kernel/kernel.adl	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -203,8 +203,8 @@
 		
 		/* Connect an IRQ handler to the current task */
-		sysarg_t sys_ipc_register_irq(inr_t inr, devno_t devno, sysarg_t method, irq_code_t *ucode);
+		sysarg_t sys_register_irq(inr_t inr, devno_t devno, sysarg_t method, irq_code_t *ucode);
 		
 		/* Disconnect an IRQ handler from the current task */
-		sysarg_t sys_ipc_unregister_irq(inr_t inr, devno_t devno);
+		sysarg_t sys_unregister_irq(inr_t inr, devno_t devno);
 	protocol:
 		(
@@ -213,6 +213,6 @@
 			?sys_device_assign_devno +
 			?sys_preempt_control +
-			?sys_ipc_register_irq +
-			?sys_ipc_unregister_irq
+			?sys_register_irq +
+			?sys_unregister_irq
 		)*
 };
Index: contrib/arch/uspace/lib/libc/protocol
===================================================================
--- contrib/arch/uspace/lib/libc/protocol	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ contrib/arch/uspace/lib/libc/protocol	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -34,6 +34,6 @@
 	!sys_ddi.sys_device_assign_devno +
 	!sys_ddi.sys_preempt_control +
-	!sys_ddi.sys_ipc_register_irq +
-	!sys_ddi.sys_ipc_unregister_irq +
+	!sys_ddi.sys_register_irq +
+	!sys_ddi.sys_unregister_irq +
 	!sys_sysinfo.sys_sysinfo_valid +
 	!sys_sysinfo.sys_sysinfo_value +
Index: kernel/arch/arm32/src/mach/gta02/gta02.c
===================================================================
--- kernel/arch/arm32/src/mach/gta02/gta02.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ kernel/arch/arm32/src/mach/gta02/gta02.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -174,4 +174,5 @@
 		fb_parea.pbase = GTA02_FB_BASE;
 		fb_parea.frames = 150;
+		fb_parea.unpriv = false;
 		ddi_parea_register(&fb_parea);
 	}
Index: kernel/arch/arm32/src/mach/integratorcp/integratorcp.c
===================================================================
--- kernel/arch/arm32/src/mach/integratorcp/integratorcp.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ kernel/arch/arm32/src/mach/integratorcp/integratorcp.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -300,4 +300,5 @@
 		fb_parea.pbase = ICP_FB;
 		fb_parea.frames = 300;
+		fb_parea.unpriv = false;
 		ddi_parea_register(&fb_parea);
 	}
Index: kernel/arch/sparc64/src/drivers/niagara.c
===================================================================
--- kernel/arch/sparc64/src/drivers/niagara.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ kernel/arch/sparc64/src/drivers/niagara.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -216,4 +216,5 @@
 	outbuf_parea.pbase = (uintptr_t) (KA2PA(&output_buffer));
 	outbuf_parea.frames = 1;
+	outbuf_parea.unpriv = false;
 	ddi_parea_register(&outbuf_parea);
 
@@ -221,4 +222,5 @@
 	inbuf_parea.pbase = (uintptr_t) (KA2PA(&input_buffer));
 	inbuf_parea.frames = 1;
+	inbuf_parea.unpriv = false;
 	ddi_parea_register(&inbuf_parea);
 
Index: kernel/generic/include/ddi/ddi.h
===================================================================
--- kernel/generic/include/ddi/ddi.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ kernel/generic/include/ddi/ddi.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -43,8 +43,9 @@
 /** Structure representing contiguous physical memory area. */
 typedef struct {
-	uintptr_t pbase;    /**< Physical base of the area. */
-	pfn_t frames;       /**< Number of frames in the area. */
+	link_t link;      /**< Linked list link */
 	
-	link_t link;        /**< Linked list link */
+	uintptr_t pbase;  /**< Physical base of the area. */
+	pfn_t frames;     /**< Number of frames in the area. */
+	bool unpriv;      /**< Allow mapping by unprivileged tasks. */
 } parea_t;
 
@@ -60,5 +61,4 @@
 extern int ddi_iospace_enable_arch(task_t *, uintptr_t, size_t);
 
-
 #endif
 
Index: kernel/generic/include/ipc/event_types.h
===================================================================
--- kernel/generic/include/ipc/event_types.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ kernel/generic/include/ipc/event_types.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -41,5 +41,5 @@
 	/** Returning from kernel console to userspace */
 	EVENT_KCONSOLE,
-	/** A thread has faulted and will be terminated */
+	/** A task/thread has faulted and will be terminated */
 	EVENT_FAULT,
 	EVENT_END
Index: kernel/generic/include/ipc/sysipc.h
===================================================================
--- kernel/generic/include/ipc/sysipc.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ kernel/generic/include/ipc/sysipc.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -56,6 +56,6 @@
     unsigned int);
 extern sysarg_t sys_ipc_hangup(sysarg_t);
-extern sysarg_t sys_ipc_register_irq(inr_t, devno_t, sysarg_t, irq_code_t *);
-extern sysarg_t sys_ipc_unregister_irq(inr_t, devno_t);
+extern sysarg_t sys_register_irq(inr_t, devno_t, sysarg_t, irq_code_t *);
+extern sysarg_t sys_unregister_irq(inr_t, devno_t);
 
 #ifdef __32_BITS__
Index: kernel/generic/include/proc/task.h
===================================================================
--- kernel/generic/include/proc/task.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ kernel/generic/include/proc/task.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -131,4 +131,5 @@
 extern task_t *task_find_by_id(task_id_t);
 extern int task_kill(task_id_t);
+extern void task_kill_self(bool) __attribute__((noreturn));
 extern void task_get_accounting(task_t *, uint64_t *, uint64_t *);
 extern void task_print_list(bool);
@@ -155,4 +156,5 @@
 extern sysarg_t sys_task_set_name(const char *, size_t);
 extern sysarg_t sys_task_kill(task_id_t *);
+extern sysarg_t sys_task_exit(sysarg_t);
 
 #endif
Index: kernel/generic/include/syscall/syscall.h
===================================================================
--- kernel/generic/include/syscall/syscall.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ kernel/generic/include/syscall/syscall.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -48,4 +48,5 @@
 	SYS_TASK_SET_NAME,
 	SYS_TASK_KILL,
+	SYS_TASK_EXIT,
 	SYS_PROGRAM_SPAWN_LOADER,
 	
@@ -70,6 +71,4 @@
 	SYS_IPC_POKE,
 	SYS_IPC_HANGUP,
-	SYS_IPC_REGISTER_IRQ,
-	SYS_IPC_UNREGISTER_IRQ,
 	SYS_IPC_CONNECT_KBOX,
 	
@@ -82,4 +81,6 @@
 	SYS_PHYSMEM_MAP,
 	SYS_IOSPACE_ENABLE,
+	SYS_REGISTER_IRQ,
+	SYS_UNREGISTER_IRQ,
 	
 	SYS_SYSINFO_GET_TAG,
Index: kernel/generic/include/udebug/udebug.h
===================================================================
--- kernel/generic/include/udebug/udebug.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ kernel/generic/include/udebug/udebug.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -36,144 +36,150 @@
 #define KERN_UDEBUG_H_
 
+#define UDEBUG_EVMASK(event)  (1 << ((event) - 1))
+
+typedef enum { /* udebug_method_t */
+	
+	/** Start debugging the recipient.
+	 *
+	 * Causes all threads in the receiving task to stop. When they
+	 * are all stoped, an answer with retval 0 is generated.
+	 *
+	 */
+	UDEBUG_M_BEGIN = 1,
+	
+	/** Finish debugging the recipient.
+	 *
+	 * Answers all pending GO and GUARD messages.
+	 *
+	 */
+	UDEBUG_M_END,
+	
+	/** Set which events should be captured. */
+	UDEBUG_M_SET_EVMASK,
+	
+	/** Make sure the debugged task is still there.
+	 *
+	 * This message is answered when the debugged task dies
+	 * or the debugging session ends.
+	 *
+	 */
+	UDEBUG_M_GUARD,
+	
+	/** Run a thread until a debugging event occurs.
+	 *
+	 * This message is answered when the thread stops
+	 * in a debugging event.
+	 *
+	 * - ARG2 - id of the thread to run
+	 *
+	 */
+	UDEBUG_M_GO,
+	
+	/** Stop a thread being debugged.
+	 *
+	 * Creates a special STOP event in the thread, causing
+	 * it to answer a pending GO message (if any).
+	 *
+	 */
+	UDEBUG_M_STOP,
+	
+	/** Read arguments of a syscall.
+	 *
+	 * - ARG2 - thread identification
+	 * - ARG3 - destination address in the caller's address space
+	 *
+	 */
+	UDEBUG_M_ARGS_READ,
+	
+	/** Read thread's userspace register state (istate_t).
+	 *
+	 * - ARG2 - thread identification
+	 * - ARG3 - destination address in the caller's address space
+	 *
+	 * or, on error, retval will be
+	 * - ENOENT - thread does not exist
+	 * - EBUSY - register state not available
+	 */
+	UDEBUG_M_REGS_READ,
+	
+	/** Read the list of the debugged tasks's threads.
+	 *
+	 * - ARG2 - destination address in the caller's address space
+	 * - ARG3 - size of receiving buffer in bytes
+	 *
+	 * The kernel fills the buffer with a series of sysarg_t values
+	 * (thread ids). On answer, the kernel will set:
+	 *
+	 * - ARG2 - number of bytes that were actually copied
+	 * - ARG3 - number of bytes of the complete data
+	 *
+	 */
+	UDEBUG_M_THREAD_READ,
+	
+	/** Read the name of the debugged task.
+	 *
+	 * - ARG2 - destination address in the caller's address space
+	 * - ARG3 - size of receiving buffer in bytes
+	 *
+	 * The kernel fills the buffer with a non-terminated string.
+	 *
+	 * - ARG2 - number of bytes that were actually copied
+	 * - ARG3 - number of bytes of the complete data
+	 *
+	 */
+	UDEBUG_M_NAME_READ,
+	
+	/** Read the list of the debugged task's address space areas.
+	 *
+	 * - ARG2 - destination address in the caller's address space
+	 * - ARG3 - size of receiving buffer in bytes
+	 *
+	 * The kernel fills the buffer with a series of as_area_info_t structures.
+	 * Upon answer, the kernel will set:
+	 *
+	 * - ARG2 - number of bytes that were actually copied
+	 * - ARG3 - number of bytes of the complete data
+	 *
+	 */
+	UDEBUG_M_AREAS_READ,
+	
+	/** Read the debugged tasks's memory.
+	 *
+	 * - ARG2 - destination address in the caller's address space
+	 * - ARG3 - source address in the recipient's address space
+	 * - ARG4 - size of receiving buffer in bytes
+	 *
+	 */
+	UDEBUG_M_MEM_READ
+} udebug_method_t;
+
+typedef enum {
+	UDEBUG_EVENT_FINISHED = 1,  /**< Debuging session has finished */
+	UDEBUG_EVENT_STOP,          /**< Stopped on DEBUG_STOP request */
+	UDEBUG_EVENT_SYSCALL_B,     /**< Before beginning syscall execution */
+	UDEBUG_EVENT_SYSCALL_E,     /**< After finishing syscall execution */
+	UDEBUG_EVENT_THREAD_B,      /**< The task created a new thread */
+	UDEBUG_EVENT_THREAD_E       /**< A thread exited */
+} udebug_event_t;
+
+typedef enum {
+	UDEBUG_EM_FINISHED = UDEBUG_EVMASK(UDEBUG_EVENT_FINISHED),
+	UDEBUG_EM_STOP = UDEBUG_EVMASK(UDEBUG_EVENT_STOP),
+	UDEBUG_EM_SYSCALL_B = UDEBUG_EVMASK(UDEBUG_EVENT_SYSCALL_B),
+	UDEBUG_EM_SYSCALL_E = UDEBUG_EVMASK(UDEBUG_EVENT_SYSCALL_E),
+	UDEBUG_EM_THREAD_B = UDEBUG_EVMASK(UDEBUG_EVENT_THREAD_B),
+	UDEBUG_EM_THREAD_E = UDEBUG_EVMASK(UDEBUG_EVENT_THREAD_E),
+	UDEBUG_EM_ALL =
+	    (UDEBUG_EVMASK(UDEBUG_EVENT_FINISHED) |
+	    UDEBUG_EVMASK(UDEBUG_EVENT_STOP) |
+	    UDEBUG_EVMASK(UDEBUG_EVENT_SYSCALL_B) |
+	    UDEBUG_EVMASK(UDEBUG_EVENT_SYSCALL_E) |
+	    UDEBUG_EVMASK(UDEBUG_EVENT_THREAD_B) |
+	    UDEBUG_EVMASK(UDEBUG_EVENT_THREAD_E))
+} udebug_evmask_t;
+
+#ifdef KERNEL
+
 #include <ipc/ipc.h>
-
-typedef enum { /* udebug_method_t */
-
-/** Start debugging the recipient.
- * Causes all threads in the receiving task to stop. When they
- * are all stoped, an answer with retval 0 is generated.
- */
-UDEBUG_M_BEGIN = 1,
-
-/** Finish debugging the recipient.
- * Answers all pending GO and GUARD messages.
- */
-UDEBUG_M_END,
-
-/** Set which events should be captured.
- */
-UDEBUG_M_SET_EVMASK,
-
-/** Make sure the debugged task is still there.
- * This message is answered when the debugged task dies
- * or the debugging session ends.
- */
-UDEBUG_M_GUARD,
-
-/** Run a thread until a debugging event occurs.
- * This message is answered when the thread stops
- * in a debugging event.
- *
- * - ARG2 - id of the thread to run
- */
-UDEBUG_M_GO,
-
-/** Stop a thread being debugged.
- * Creates a special STOP event in the thread, causing
- * it to answer a pending GO message (if any).
- */
-UDEBUG_M_STOP,
-
-/** Read arguments of a syscall.
- *
- * - ARG2 - thread identification
- * - ARG3 - destination address in the caller's address space
- *
- */
-UDEBUG_M_ARGS_READ,
-
-/** Read thread's userspace register state (istate_t).
- *
- * - ARG2 - thread identification
- * - ARG3 - destination address in the caller's address space
- *
- * or, on error, retval will be
- * - ENOENT - thread does not exist
- * - EBUSY - register state not available
- */
-UDEBUG_M_REGS_READ,
-
-/** Read the list of the debugged tasks's threads.
- *
- * - ARG2 - destination address in the caller's address space
- * - ARG3 - size of receiving buffer in bytes
- *
- * The kernel fills the buffer with a series of sysarg_t values
- * (thread ids). On answer, the kernel will set:
- *
- * - ARG2 - number of bytes that were actually copied
- * - ARG3 - number of bytes of the complete data
- *
- */
-UDEBUG_M_THREAD_READ,
-
-/** Read the name of the debugged task.
- *
- * - ARG2 - destination address in the caller's address space
- * - ARG3 - size of receiving buffer in bytes
- *
- * The kernel fills the buffer with a non-terminated string.
- *
- * - ARG2 - number of bytes that were actually copied
- * - ARG3 - number of bytes of the complete data
- *
- */
-UDEBUG_M_NAME_READ,
-
-/** Read the list of the debugged task's address space areas.
- *
- * - ARG2 - destination address in the caller's address space
- * - ARG3 - size of receiving buffer in bytes
- *
- * The kernel fills the buffer with a series of as_area_info_t structures.
- * Upon answer, the kernel will set:
- *
- * - ARG2 - number of bytes that were actually copied
- * - ARG3 - number of bytes of the complete data
- *
- */
-UDEBUG_M_AREAS_READ,
-
-/** Read the debugged tasks's memory.
- *
- * - ARG2 - destination address in the caller's address space
- * - ARG3 - source address in the recipient's address space
- * - ARG4 - size of receiving buffer in bytes
- *
- */
-UDEBUG_M_MEM_READ,
-
-} udebug_method_t;
-
-
-typedef enum {
-	UDEBUG_EVENT_FINISHED = 1,	/**< Debuging session has finished */
-	UDEBUG_EVENT_STOP,		/**< Stopped on DEBUG_STOP request */
-	UDEBUG_EVENT_SYSCALL_B,		/**< Before beginning syscall execution */
-	UDEBUG_EVENT_SYSCALL_E,		/**< After finishing syscall execution */
-	UDEBUG_EVENT_THREAD_B,		/**< The task created a new thread */
-	UDEBUG_EVENT_THREAD_E		/**< A thread exited */
-} udebug_event_t;
-
-#define UDEBUG_EVMASK(event) (1 << ((event) - 1))
-
-typedef enum {
-	UDEBUG_EM_FINISHED	= UDEBUG_EVMASK(UDEBUG_EVENT_FINISHED),
-	UDEBUG_EM_STOP		= UDEBUG_EVMASK(UDEBUG_EVENT_STOP),
-	UDEBUG_EM_SYSCALL_B	= UDEBUG_EVMASK(UDEBUG_EVENT_SYSCALL_B),
-	UDEBUG_EM_SYSCALL_E	= UDEBUG_EVMASK(UDEBUG_EVENT_SYSCALL_E),
-	UDEBUG_EM_THREAD_B	= UDEBUG_EVMASK(UDEBUG_EVENT_THREAD_B),
-	UDEBUG_EM_THREAD_E	= UDEBUG_EVMASK(UDEBUG_EVENT_THREAD_E),
-	UDEBUG_EM_ALL		=
-		UDEBUG_EVMASK(UDEBUG_EVENT_FINISHED) |
-		UDEBUG_EVMASK(UDEBUG_EVENT_STOP) |
-		UDEBUG_EVMASK(UDEBUG_EVENT_SYSCALL_B) |
-		UDEBUG_EVMASK(UDEBUG_EVENT_SYSCALL_E) |
-		UDEBUG_EVMASK(UDEBUG_EVENT_THREAD_B) |
-		UDEBUG_EVMASK(UDEBUG_EVENT_THREAD_E)
-} udebug_evmask_t;
-
-#ifdef KERNEL
-
 #include <synch/mutex.h>
 #include <synch/condvar.h>
@@ -196,5 +202,5 @@
 	mutex_t lock;
 	char *lock_owner;
-
+	
 	udebug_task_state_t dt_state;
 	call_t *begin_call;
@@ -209,15 +215,15 @@
 	/** Synchronize debug ops on this thread / access to this structure. */
 	mutex_t lock;
-
+	
 	waitq_t go_wq;
 	call_t *go_call;
 	sysarg_t syscall_args[6];
 	istate_t *uspace_state;
-
+	
 	/** What type of event are we stopped in or 0 if none. */
 	udebug_event_t cur_event;
-	bool go;		/**< thread is GO */
-	bool stoppable;		/**< thread is stoppable */
-	bool active;		/**< thread is in a debugging session */
+	bool go;         /**< Thread is GO */
+	bool stoppable;  /**< Thread is stoppable */
+	bool active;     /**< Thread is in a debugging session */
 	condvar_t active_cv;
 } udebug_thread_t;
@@ -226,12 +232,11 @@
 struct thread;
 
-void udebug_task_init(udebug_task_t *ut);
-void udebug_thread_initialize(udebug_thread_t *ut);
-
-void udebug_syscall_event(sysarg_t a1, sysarg_t a2, sysarg_t a3,
-    sysarg_t a4, sysarg_t a5, sysarg_t a6, sysarg_t id, sysarg_t rc,
-    bool end_variant);
-
-void udebug_thread_b_event_attach(struct thread *t, struct task *ta);
+void udebug_task_init(udebug_task_t *);
+void udebug_thread_initialize(udebug_thread_t *);
+
+void udebug_syscall_event(sysarg_t, sysarg_t, sysarg_t, sysarg_t, sysarg_t,
+    sysarg_t, sysarg_t, sysarg_t, bool);
+
+void udebug_thread_b_event_attach(struct thread *, struct task *);
 void udebug_thread_e_event(void);
 
@@ -241,5 +246,5 @@
 void udebug_before_thread_runs(void);
 
-int udebug_task_cleanup(struct task *ta);
+int udebug_task_cleanup(struct task *);
 void udebug_thread_fault(void);
 
Index: kernel/generic/src/console/cmd.c
===================================================================
--- kernel/generic/src/console/cmd.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ kernel/generic/src/console/cmd.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -553,6 +553,11 @@
 	for (i = 0; basic_commands[i]; i++) {
 		cmd_initialize(basic_commands[i]);
-		if (!cmd_register(basic_commands[i]))
-			printf("Cannot register command %s\n", basic_commands[i]->name);
+	}
+
+	for (i = 0; basic_commands[i]; i++) {
+		if (!cmd_register(basic_commands[i])) {
+			printf("Cannot register command %s\n",
+			    basic_commands[i]->name);
+		}
 	}
 }
Index: kernel/generic/src/console/console.c
===================================================================
--- kernel/generic/src/console/console.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ kernel/generic/src/console/console.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -160,4 +160,5 @@
 	klog_parea.pbase = (uintptr_t) faddr;
 	klog_parea.frames = SIZE2FRAMES(sizeof(klog));
+	klog_parea.unpriv = false;
 	ddi_parea_register(&klog_parea);
 	
Index: kernel/generic/src/ddi/ddi.c
===================================================================
--- kernel/generic/src/ddi/ddi.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ kernel/generic/src/ddi/ddi.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -104,13 +104,17 @@
 {
 	ASSERT(TASK);
-	ASSERT((pf % FRAME_SIZE) == 0);
-	ASSERT((vp % PAGE_SIZE) == 0);
-	
-	/*
-	 * Make sure the caller is authorised to make this syscall.
-	 */
-	cap_t caps = cap_get(TASK);
-	if (!(caps & CAP_MEM_MANAGER))
-		return EPERM;
+	
+	if ((pf % FRAME_SIZE) != 0)
+		return EBADMEM;
+	
+	if ((vp % PAGE_SIZE) != 0)
+		return EBADMEM;
+	
+	/*
+	 * Unprivileged tasks are only allowed to map pareas
+	 * which are explicitly marked as such.
+	 */
+	bool priv =
+	    ((cap_get(TASK) & CAP_MEM_MANAGER) == CAP_MEM_MANAGER);
 	
 	mem_backend_data_t backend_data;
@@ -123,14 +127,27 @@
 	
 	if (znum == (size_t) -1) {
-		/* Frames not found in any zones
-		 * -> assume it is hardware device and allow mapping
+		/*
+		 * Frames not found in any zone
+		 * -> assume it is a hardware device and allow mapping
+		 *    for privileged tasks.
 		 */
 		irq_spinlock_unlock(&zones.lock, true);
+		
+		if (!priv)
+			return EPERM;
+		
 		goto map;
 	}
 	
 	if (zones.info[znum].flags & ZONE_FIRMWARE) {
-		/* Frames are part of firmware */
+		/*
+		 * Frames are part of firmware
+		 * -> allow mapping for privileged tasks.
+		 */
 		irq_spinlock_unlock(&zones.lock, true);
+		
+		if (!priv)
+			return EPERM;
+		
 		goto map;
 	}
@@ -138,6 +155,6 @@
 	if (zone_flags_available(zones.info[znum].flags)) {
 		/*
-		 * Frames are part of physical memory, check if the memory
-		 * region is enabled for mapping.
+		 * Frames are part of physical memory, check
+		 * if the memory region is enabled for mapping.
 		 */
 		irq_spinlock_unlock(&zones.lock, true);
@@ -150,5 +167,12 @@
 		if ((!parea) || (parea->frames < pages)) {
 			mutex_unlock(&parea_lock);
-			goto err;
+			return ENOENT;
+		}
+		
+		if (!priv) {
+			if (!parea->unpriv) {
+				mutex_unlock(&parea_lock);
+				return EPERM;
+			}
 		}
 		
@@ -158,6 +182,4 @@
 	
 	irq_spinlock_unlock(&zones.lock, true);
-	
-err:
 	return ENOENT;
 	
Index: kernel/generic/src/interrupt/interrupt.c
===================================================================
--- kernel/generic/src/interrupt/interrupt.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ kernel/generic/src/interrupt/interrupt.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -45,5 +45,4 @@
 #include <console/console.h>
 #include <console/cmd.h>
-#include <ipc/event.h>
 #include <synch/mutex.h>
 #include <time/delay.h>
@@ -188,23 +187,5 @@
 	printf("\n");
 	
-	/*
-	 * Userspace can subscribe for FAULT events to take action
-	 * whenever a thread faults. (E.g. take a dump, run a debugger).
-	 * The notification is always available, but unless Udebug is enabled,
-	 * that's all you get.
-	 */
-	if (event_is_subscribed(EVENT_FAULT)) {
-		/* Notify the subscriber that a fault occurred. */
-		event_notify_3(EVENT_FAULT, LOWER32(TASK->taskid),
-		    UPPER32(TASK->taskid), (sysarg_t) THREAD);
-		
-#ifdef CONFIG_UDEBUG
-		/* Wait for a debugging session. */
-		udebug_thread_fault();
-#endif
-	}
-	
-	task_kill(TASK->taskid);
-	thread_exit();
+	task_kill_self(true);
 }
 
Index: kernel/generic/src/ipc/ipc.c
===================================================================
--- kernel/generic/src/ipc/ipc.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ kernel/generic/src/ipc/ipc.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -787,5 +787,5 @@
 	}
 	
-	printf(" --- outgoing answers ---\n");
+	printf(" --- incoming answers ---\n");
 	for (cur = task->answerbox.answers.next;
 	    cur != &task->answerbox.answers;
Index: kernel/generic/src/ipc/irq.c
===================================================================
--- kernel/generic/src/ipc/irq.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ kernel/generic/src/ipc/irq.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -42,5 +42,5 @@
  *
  * The structure of a notification message is as follows:
- * - IMETHOD: interface and method as registered by the SYS_IPC_REGISTER_IRQ
+ * - IMETHOD: interface and method as registered by the SYS_REGISTER_IRQ
  *            syscall
  * - ARG1: payload modified by a 'top-half' handler
Index: kernel/generic/src/ipc/sysipc.c
===================================================================
--- kernel/generic/src/ipc/sysipc.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ kernel/generic/src/ipc/sysipc.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -1105,5 +1105,5 @@
  *
  */
-sysarg_t sys_ipc_register_irq(inr_t inr, devno_t devno, sysarg_t imethod,
+sysarg_t sys_register_irq(inr_t inr, devno_t devno, sysarg_t imethod,
     irq_code_t *ucode)
 {
@@ -1122,5 +1122,5 @@
  *
  */
-sysarg_t sys_ipc_unregister_irq(inr_t inr, devno_t devno)
+sysarg_t sys_unregister_irq(inr_t inr, devno_t devno)
 {
 	if (!(cap_get(TASK) & CAP_IRQ_REG))
Index: kernel/generic/src/lib/rd.c
===================================================================
--- kernel/generic/src/lib/rd.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ kernel/generic/src/lib/rd.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -90,4 +90,5 @@
 	    FRAME_SIZE);
 	rd_parea.frames = SIZE2FRAMES(dsize);
+	rd_parea.unpriv = false;
 	ddi_parea_register(&rd_parea);
 
Index: kernel/generic/src/proc/task.c
===================================================================
--- kernel/generic/src/proc/task.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ kernel/generic/src/proc/task.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -384,10 +384,8 @@
 {
 	task_id_t taskid;
-	int rc;
-
-	rc = copy_from_uspace(&taskid, uspace_taskid, sizeof(taskid));
+	int rc = copy_from_uspace(&taskid, uspace_taskid, sizeof(taskid));
 	if (rc != 0)
 		return (sysarg_t) rc;
-
+	
 	return (sysarg_t) task_kill(taskid);
 }
@@ -520,4 +518,52 @@
 }
 
+/** Kill the currently running task.
+ *
+ * @param notify Send out fault notifications.
+ *
+ * @return Zero on success or an error code from errno.h.
+ *
+ */
+void task_kill_self(bool notify)
+{
+	/*
+	 * User space can subscribe for FAULT events to take action
+	 * whenever a task faults (to take a dump, run a debugger, etc.).
+	 * The notification is always available, but unless udebug is enabled,
+	 * that's all you get.
+	*/
+	if (notify) {
+		if (event_is_subscribed(EVENT_FAULT)) {
+			/* Notify the subscriber that a fault occurred. */
+			event_notify_3(EVENT_FAULT, LOWER32(TASK->taskid),
+			    UPPER32(TASK->taskid), (sysarg_t) THREAD);
+		
+#ifdef CONFIG_UDEBUG
+			/* Wait for a debugging session. */
+			udebug_thread_fault();
+#endif
+		}
+	}
+	
+	irq_spinlock_lock(&tasks_lock, true);
+	task_kill_internal(TASK);
+	irq_spinlock_unlock(&tasks_lock, true);
+	
+	thread_exit();
+}
+
+/** Process syscall to terminate the current task.
+ *
+ * @param notify Send out fault notifications.
+ *
+ */
+sysarg_t sys_task_exit(sysarg_t notify)
+{
+	task_kill_self(notify);
+	
+	/* Unreachable */
+	return EOK;
+}
+
 static bool task_print_walker(avltree_node_t *node, void *arg)
 {
Index: kernel/generic/src/syscall/syscall.c
===================================================================
--- kernel/generic/src/syscall/syscall.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ kernel/generic/src/syscall/syscall.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -86,6 +86,5 @@
 	} else {
 		printf("Task %" PRIu64": Unknown syscall %#" PRIxn, TASK->taskid, id);
-		task_kill(TASK->taskid);
-		thread_exit();
+		task_kill_self(true);
 	}
 	
@@ -131,4 +130,5 @@
 	(syshandler_t) sys_task_set_name,
 	(syshandler_t) sys_task_kill,
+	(syshandler_t) sys_task_exit,
 	(syshandler_t) sys_program_spawn_loader,
 	
@@ -156,6 +156,4 @@
 	(syshandler_t) sys_ipc_poke,
 	(syshandler_t) sys_ipc_hangup,
-	(syshandler_t) sys_ipc_register_irq,
-	(syshandler_t) sys_ipc_unregister_irq,
 	(syshandler_t) sys_ipc_connect_kbox,
 	
@@ -171,4 +169,6 @@
 	(syshandler_t) sys_physmem_map,
 	(syshandler_t) sys_iospace_enable,
+	(syshandler_t) sys_register_irq,
+	(syshandler_t) sys_unregister_irq,
 	
 	/* Sysinfo syscalls */
Index: kernel/generic/src/time/clock.c
===================================================================
--- kernel/generic/src/time/clock.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ kernel/generic/src/time/clock.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -93,4 +93,5 @@
 	clock_parea.pbase = (uintptr_t) faddr;
 	clock_parea.frames = 1;
+	clock_parea.unpriv = true;
 	ddi_parea_register(&clock_parea);
 	
@@ -100,5 +101,4 @@
 	 *
 	 */
-	sysinfo_set_item_val("clock.cacheable", NULL, (sysarg_t) true);
 	sysinfo_set_item_val("clock.faddr", NULL, (sysarg_t) faddr);
 }
Index: uspace/app/init/init.c
===================================================================
--- uspace/app/init/init.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/app/init/init.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -37,5 +37,4 @@
 #include <stdio.h>
 #include <unistd.h>
-#include <ipc/ipc.h>
 #include <vfs/vfs.h>
 #include <bool.h>
Index: uspace/app/klog/klog.c
===================================================================
--- uspace/app/klog/klog.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/app/klog/klog.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -36,13 +36,12 @@
 
 #include <stdio.h>
-#include <ipc/ipc.h>
 #include <async.h>
-#include <ipc/services.h>
 #include <as.h>
-#include <sysinfo.h>
+#include <ddi.h>
 #include <event.h>
 #include <errno.h>
 #include <str_error.h>
 #include <io/klog.h>
+#include <sysinfo.h>
 
 #define NAME       "klog"
@@ -79,29 +78,42 @@
 int main(int argc, char *argv[])
 {
-	size_t klog_pages;
-	if (sysinfo_get_value("klog.pages", &klog_pages) != EOK) {
-		printf("%s: Error getting klog address\n", NAME);
-		return -1;
+	size_t pages;
+	int rc = sysinfo_get_value("klog.pages", &pages);
+	if (rc != EOK) {
+		fprintf(stderr, "%s: Unable to get number of klog pages\n",
+		    NAME);
+		return rc;
 	}
 	
-	size_t klog_size = klog_pages * PAGE_SIZE;
-	klog_length = klog_size / sizeof(wchar_t);
-	
-	klog = (wchar_t *) as_get_mappable_page(klog_size);
-	if (klog == NULL) {
-		printf("%s: Error allocating memory area\n", NAME);
-		return -1;
+	uintptr_t faddr;
+	rc = sysinfo_get_value("klog.faddr", &faddr);
+	if (rc != EOK) {
+		fprintf(stderr, "%s: Unable to get klog physical address\n",
+		    NAME);
+		return rc;
 	}
 	
-	int res = async_share_in_start_1_0(PHONE_NS, (void *) klog,
-	    klog_size, SERVICE_MEM_KLOG);
-	if (res != EOK) {
-		printf("%s: Error initializing memory area\n", NAME);
-		return -1;
+	size_t size = pages * PAGE_SIZE;
+	klog_length = size / sizeof(wchar_t);
+	
+	klog = (wchar_t *) as_get_mappable_page(size);
+	if (klog == NULL) {
+		fprintf(stderr, "%s: Unable to allocate virtual memory area\n",
+		    NAME);
+		return ENOMEM;
 	}
 	
-	if (event_subscribe(EVENT_KLOG, 0) != EOK) {
-		printf("%s: Error registering klog notifications\n", NAME);
-		return -1;
+	rc = physmem_map((void *) faddr, (void *) klog, pages,
+	    AS_AREA_READ | AS_AREA_CACHEABLE);
+	if (rc != EOK) {
+		fprintf(stderr, "%s: Unable to map klog\n", NAME);
+		return rc;
+	}
+	
+	rc = event_subscribe(EVENT_KLOG, 0);
+	if (rc != EOK) {
+		fprintf(stderr, "%s: Unable to register klog notifications\n",
+		    NAME);
+		return rc;
 	}
 	
@@ -109,5 +121,4 @@
 	 * Mode "a" would be definitively much better here, but it is
 	 * not well supported by the FAT driver.
-	 *
 	 */
 	log = fopen(LOG_FNAME, "w");
Index: uspace/app/ping/ping.c
===================================================================
--- uspace/app/ping/ping.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/app/ping/ping.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -35,9 +35,9 @@
  */
 
+#include <async.h>
 #include <stdio.h>
 #include <str.h>
 #include <task.h>
 #include <time.h>
-#include <ipc/ipc.h>
 #include <ipc/services.h>
 #include <str_error.h>
@@ -355,5 +355,5 @@
 			    str_error(ret));
 			
-			ipc_hangup(icmp_phone);
+			async_hangup(icmp_phone);
 			return ret;
 		}
@@ -370,5 +370,5 @@
 			    str_error(ret));
 			
-			ipc_hangup(icmp_phone);
+			async_hangup(icmp_phone);
 			return ret;
 		}
@@ -390,5 +390,5 @@
 	}
 	
-	ipc_hangup(icmp_phone);
+	async_hangup(icmp_phone);
 	
 	return 0;
Index: uspace/app/taskdump/taskdump.c
===================================================================
--- uspace/app/taskdump/taskdump.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/app/taskdump/taskdump.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -33,8 +33,8 @@
  */
 
+#include <async.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <ipc/ipc.h>
 #include <errno.h>
 #include <udebug.h>
@@ -105,5 +105,5 @@
 
 	udebug_end(phoneid);
-	ipc_hangup(phoneid);
+	async_hangup(phoneid);
 
 	return 0;
@@ -114,5 +114,5 @@
 	int rc;
 
-	rc = ipc_connect_kbox(task_id);
+	rc = async_connect_kbox(task_id);
 
 	if (rc == ENOTSUP) {
@@ -126,5 +126,5 @@
 	if (rc < 0) {
 		printf("Error connecting\n");
-		printf("ipc_connect_task(%" PRIu64 ") -> %d ", task_id, rc);
+		printf("async_connect_kbox(%" PRIu64 ") -> %d ", task_id, rc);
 		return rc;
 	}
Index: uspace/app/tester/hw/misc/virtchar1.c
===================================================================
--- uspace/app/tester/hw/misc/virtchar1.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/app/tester/hw/misc/virtchar1.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -89,5 +89,5 @@
 	/* Clean-up. */
 	TPRINTF(" Closing phones and file descriptors\n");
-	ipc_hangup(phone);
+	async_hangup(phone);
 	close(fd);
 	
Index: uspace/app/tester/hw/serial/serial1.c
===================================================================
--- uspace/app/tester/hw/serial/serial1.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/app/tester/hw/serial/serial1.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -39,5 +39,4 @@
 #include <stdlib.h>
 #include <stdio.h>
-#include <ipc/ipc.h>
 #include <sys/types.h>
 #include <async.h>
@@ -88,5 +87,5 @@
 	char *buf = (char *) malloc(cnt + 1);
 	if (buf == NULL) {
-		ipc_hangup(phone);
+		async_hangup(phone);
 		devman_hangup_phone(DEVMAN_CLIENT);
 		return "Failed to allocate input buffer";
@@ -98,18 +97,18 @@
 	sysarg_t old_word_size;
 	
-	res = ipc_call_sync_0_4(phone, SERIAL_GET_COM_PROPS, &old_baud,
+	res = async_req_0_4(phone, SERIAL_GET_COM_PROPS, &old_baud,
 	    &old_par, &old_word_size, &old_stop);
 	if (res != EOK) {
 		free(buf);
-		ipc_hangup(phone);
+		async_hangup(phone);
 		devman_hangup_phone(DEVMAN_CLIENT);
 		return "Failed to get old serial communication parameters";
 	}
 	
-	res = ipc_call_sync_4_0(phone, SERIAL_SET_COM_PROPS, 1200,
+	res = async_req_4_0(phone, SERIAL_SET_COM_PROPS, 1200,
 	    SERIAL_NO_PARITY, 8, 1);
 	if (EOK != res) {
 		free(buf);
-		ipc_hangup(phone);
+		async_hangup(phone);
 		devman_hangup_phone(DEVMAN_CLIENT);
 		return "Failed to set serial communication parameters";
@@ -124,8 +123,8 @@
 		
 		if (read < 0) {
-			ipc_call_sync_4_0(phone, SERIAL_SET_COM_PROPS, old_baud,
+			async_req_4_0(phone, SERIAL_SET_COM_PROPS, old_baud,
 			    old_par, old_word_size, old_stop);
 			free(buf);
-			ipc_hangup(phone);
+			async_hangup(phone);
 			devman_hangup_phone(DEVMAN_CLIENT);
 			return "Failed read from serial device";
@@ -133,8 +132,8 @@
 		
 		if ((size_t) read > cnt - total) {
-			ipc_call_sync_4_0(phone, SERIAL_SET_COM_PROPS, old_baud,
+			async_req_4_0(phone, SERIAL_SET_COM_PROPS, old_baud,
 			    old_par, old_word_size, old_stop);
 			free(buf);
-			ipc_hangup(phone);
+			async_hangup(phone);
 			devman_hangup_phone(DEVMAN_CLIENT);
 			return "Read more data than expected";
@@ -155,8 +154,8 @@
 			
 			if (written < 0) {
-				ipc_call_sync_4_0(phone, SERIAL_SET_COM_PROPS, old_baud,
+				async_req_4_0(phone, SERIAL_SET_COM_PROPS, old_baud,
 				    old_par, old_word_size, old_stop);
 				free(buf);
-				ipc_hangup(phone);
+				async_hangup(phone);
 				devman_hangup_phone(DEVMAN_CLIENT);
 				return "Failed write to serial device";
@@ -164,8 +163,8 @@
 			
 			if (written != read) {
-				ipc_call_sync_4_0(phone, SERIAL_SET_COM_PROPS, old_baud,
+				async_req_4_0(phone, SERIAL_SET_COM_PROPS, old_baud,
 				    old_par, old_word_size, old_stop);
 				free(buf);
-				ipc_hangup(phone);
+				async_hangup(phone);
 				devman_hangup_phone(DEVMAN_CLIENT);
 				return "Written less data than read from serial device";
@@ -183,8 +182,8 @@
 	ssize_t written = char_dev_write(phone, (void *) EOT, eot_size);
 	
-	ipc_call_sync_4_0(phone, SERIAL_SET_COM_PROPS, old_baud,
+	async_req_4_0(phone, SERIAL_SET_COM_PROPS, old_baud,
 	    old_par, old_word_size, old_stop);
 	free(buf);
-	ipc_hangup(phone);
+	async_hangup(phone);
 	devman_hangup_phone(DEVMAN_CLIENT);
 	
Index: uspace/app/tester/tester.h
===================================================================
--- uspace/app/tester/tester.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/app/tester/tester.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -38,5 +38,4 @@
 #include <sys/types.h>
 #include <bool.h>
-#include <ipc/ipc.h>
 
 #define IPC_TEST_SERVICE  10240
Index: uspace/app/tetris/screen.h
===================================================================
--- uspace/app/tetris/screen.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/app/tetris/screen.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -48,5 +48,4 @@
 
 #include <sys/types.h>
-#include <ipc/ipc.h>
 #include <async.h>
 #include <bool.h>
Index: uspace/app/top/screen.c
===================================================================
--- uspace/app/top/screen.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/app/top/screen.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -37,5 +37,4 @@
 
 #include <stdio.h>
-#include <ipc/ipc.h>
 #include <io/console.h>
 #include <io/style.h>
Index: uspace/app/trace/ipc_desc.c
===================================================================
--- uspace/app/trace/ipc_desc.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/app/trace/ipc_desc.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -33,6 +33,6 @@
  */
 
+#include <ipc/common.h>
 #include <stdlib.h>
-#include <ipc/ipc.h>
 #include "ipc_desc.h"
 
Index: uspace/app/trace/ipcp.h
===================================================================
--- uspace/app/trace/ipcp.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/app/trace/ipcp.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -36,5 +36,4 @@
 #define IPCP_H_
 
-#include <ipc/ipc.h>
 #include "proto.h"
 
Index: uspace/app/trace/proto.c
===================================================================
--- uspace/app/trace/proto.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/app/trace/proto.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -35,5 +35,4 @@
 #include <stdio.h>
 #include <stdlib.h>
-#include <ipc/ipc.h>
 #include <adt/hash_table.h>
 
Index: uspace/app/trace/proto.h
===================================================================
--- uspace/app/trace/proto.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/app/trace/proto.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -36,6 +36,6 @@
 #define PROTO_H_
 
+#include <ipc/common.h>
 #include <adt/hash_table.h>
-#include <ipc/ipc.h>
 #include "trace.h"
 
Index: uspace/app/trace/syscalls.c
===================================================================
--- uspace/app/trace/syscalls.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/app/trace/syscalls.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -64,6 +64,4 @@
     [SYS_IPC_POKE] = { "ipc_poke",			0,	V_ERRNO },
     [SYS_IPC_HANGUP] = { "ipc_hangup",			1,	V_ERRNO },
-    [SYS_IPC_REGISTER_IRQ] = { "ipc_register_irq",	4,	V_ERRNO },
-    [SYS_IPC_UNREGISTER_IRQ] = { "ipc_unregister_irq",	2,	V_ERRNO },
 
     [SYS_EVENT_SUBSCRIBE] = { "event_subscribe",	2,	V_ERRNO },
@@ -73,4 +71,6 @@
     [SYS_PHYSMEM_MAP] = { "physmem_map",		4,	V_ERRNO },
     [SYS_IOSPACE_ENABLE] = { "iospace_enable",		1,	V_ERRNO },
+    [SYS_REGISTER_IRQ] = { "register_irq",	4,	V_ERRNO },
+    [SYS_UNREGISTER_IRQ] = { "unregister_irq",	2,	V_ERRNO },
 
     [SYS_SYSINFO_GET_TAG] = { "sysinfo_get_tag",		2,	V_INTEGER },
Index: uspace/app/trace/trace.c
===================================================================
--- uspace/app/trace/trace.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/app/trace/trace.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -36,5 +36,4 @@
 #include <stdlib.h>
 #include <unistd.h>
-#include <ipc/ipc.h>
 #include <fibril.h>
 #include <errno.h>
@@ -149,5 +148,5 @@
 	int rc;
 
-	rc = ipc_connect_kbox(task_id);
+	rc = async_connect_kbox(task_id);
 
 	if (rc == ENOTSUP) {
@@ -745,5 +744,5 @@
 	abort_trace = true;
 	udebug_end(phoneid);
-	ipc_hangup(phoneid);
+	async_hangup(phoneid);
 
 	ipcp_cleanup();
Index: uspace/drv/ns8250/ns8250.c
===================================================================
--- uspace/drv/ns8250/ns8250.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/drv/ns8250/ns8250.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -256,5 +256,5 @@
 	
 	if (dev->parent_phone > 0) {
-		ipc_hangup(dev->parent_phone);
+		async_hangup(dev->parent_phone);
 		dev->parent_phone = 0;
 	}
@@ -888,5 +888,5 @@
 		ns8250_get_props(dev, &baud_rate, &parity, &word_length,
 		    &stop_bits);
-		ipc_answer_4(callid, EOK, baud_rate, parity, word_length,
+		async_answer_4(callid, EOK, baud_rate, parity, word_length,
 		    stop_bits);
 		break;
@@ -899,9 +899,9 @@
 		ret = ns8250_set_props(dev, baud_rate, parity, word_length,
 		    stop_bits);
-		ipc_answer_0(callid, ret);
+		async_answer_0(callid, ret);
 		break;
 		
 	default:
-		ipc_answer_0(callid, ENOTSUP);
+		async_answer_0(callid, ENOTSUP);
 	}
 }
Index: uspace/drv/pciintel/pci.c
===================================================================
--- uspace/drv/pciintel/pci.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/drv/pciintel/pci.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -478,5 +478,5 @@
 		    "the device.\n");
 		delete_pci_bus_data(bus_data);
-		ipc_hangup(dev->parent_phone);
+		async_hangup(dev->parent_phone);
 		return rc;
 	}	
@@ -496,5 +496,5 @@
 		printf(NAME ": failed to enable configuration ports.\n");
 		delete_pci_bus_data(bus_data);
-		ipc_hangup(dev->parent_phone);
+		async_hangup(dev->parent_phone);
 		hw_res_clean_resource_list(&hw_resources);
 		return EADDRNOTAVAIL;
Index: uspace/lib/block/libblock.c
===================================================================
--- uspace/lib/block/libblock.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/block/libblock.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -44,5 +44,4 @@
 #include <sys/mman.h>
 #include <async.h>
-#include <ipc/ipc.h>
 #include <as.h>
 #include <assert.h>
@@ -177,5 +176,5 @@
 	if (rc != EOK) {
 	    	munmap(comm_area, comm_size);
-		ipc_hangup(dev_phone);
+		async_hangup(dev_phone);
 		return rc;
 	}
@@ -183,5 +182,5 @@
 	if (get_block_size(dev_phone, &bsize) != EOK) {
 		munmap(comm_area, comm_size);
-		ipc_hangup(dev_phone);
+		async_hangup(dev_phone);
 		return rc;
 	}
@@ -190,5 +189,5 @@
 	if (rc != EOK) {
 		munmap(comm_area, comm_size);
-		ipc_hangup(dev_phone);
+		async_hangup(dev_phone);
 		return rc;
 	}
@@ -211,5 +210,5 @@
 
 	munmap(devcon->comm_area, devcon->comm_size);
-	ipc_hangup(devcon->dev_phone);
+	async_hangup(devcon->dev_phone);
 
 	free(devcon);	
Index: uspace/lib/c/Makefile
===================================================================
--- uspace/lib/c/Makefile	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/Makefile	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -83,4 +83,5 @@
 	generic/io/console.c \
 	generic/io/screenbuffer.c \
+	generic/ipc/ns.c \
 	generic/malloc.c \
 	generic/sysinfo.c \
@@ -96,5 +97,4 @@
 	generic/adt/char_map.c \
 	generic/time.c \
-	generic/err.c \
 	generic/stdlib.c \
 	generic/mman.c \
Index: uspace/lib/c/arch/abs32le/src/entry.c
===================================================================
--- uspace/lib/c/arch/abs32le/src/entry.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/arch/abs32le/src/entry.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -30,12 +30,11 @@
  */
 
-#include <libc.h>
 #include <unistd.h>
 #include <libarch/entry.h>
+#include "../../../generic/private/libc.h"
 
 void __entry(void)
 {
 	__main(NULL);
-	__exit();
 }
 
Index: uspace/lib/c/arch/abs32le/src/thread_entry.c
===================================================================
--- uspace/lib/c/arch/abs32le/src/thread_entry.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/arch/abs32le/src/thread_entry.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -31,5 +31,5 @@
 
 #include <unistd.h>
-#include <thread.h>
+#include "../../../generic/private/thread.h"
 
 void __thread_entry(void)
Index: uspace/lib/c/arch/amd64/src/entry.s
===================================================================
--- uspace/lib/c/arch/amd64/src/entry.s	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/arch/amd64/src/entry.s	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -47,4 +47,2 @@
 	# Pass PCB pointer to __main (no operation)
 	call __main
-
-	call __exit
Index: uspace/lib/c/arch/arm32/src/entry.s
===================================================================
--- uspace/lib/c/arch/arm32/src/entry.s	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/arch/arm32/src/entry.s	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -42,5 +42,5 @@
 	ldr r0, =ras_page
 	str r2, [r0]
-
+	
 	#
 	# Create the first stack frame.
@@ -50,10 +50,8 @@
 	push {fp, ip, lr, pc}
 	sub fp, ip, #4
-
+	
 	# Pass pcb_ptr to __main as the first argument (in r0)
 	mov r0, r1
 	bl __main
-
-	bl __exit
 
 .data
@@ -62,3 +60,2 @@
 ras_page:
 	.long 0
-
Index: uspace/lib/c/arch/ia32/src/entry.s
===================================================================
--- uspace/lib/c/arch/ia32/src/entry.s	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/arch/ia32/src/entry.s	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -46,5 +46,5 @@
 	mov %ax, %fs
 	# Do not set %gs, it contains descriptor that can see TLS
-
+	
 	# Detect the mechanism used for making syscalls
 	movl $(INTEL_CPUID_STANDARD), %eax
@@ -58,10 +58,8 @@
 	# Create the first stack frame.
 	#
-	pushl $0 
+	pushl $0
 	movl %esp, %ebp
-
+	
 	# Pass the PCB pointer to __main as the first argument
 	pushl %edi
 	call __main
-
-	call __exit
Index: uspace/lib/c/arch/ia64/src/entry.s
===================================================================
--- uspace/lib/c/arch/ia64/src/entry.s	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/arch/ia64/src/entry.s	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -40,8 +40,6 @@
 	alloc loc0 = ar.pfs, 0, 1, 2, 0
 	movl gp = _gp
-
+	
 	# Pass PCB pointer as the first argument to __main
 	mov out0 = r2
 	br.call.sptk.many b0 = __main
-0:
-	br.call.sptk.many b0 = __exit
Index: uspace/lib/c/arch/mips32/src/entry.s
===================================================================
--- uspace/lib/c/arch/mips32/src/entry.s	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/arch/mips32/src/entry.s	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -56,7 +56,4 @@
 	jal __main
 	nop
-	
-	jal __exit
-	nop
 .end
 
Index: uspace/lib/c/arch/ppc32/src/entry.s
===================================================================
--- uspace/lib/c/arch/ppc32/src/entry.s	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/arch/ppc32/src/entry.s	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -44,9 +44,7 @@
 	stw %r3, 0(%r1)
 	stwu %r1, -16(%r1)
-
+	
 	# Pass the PCB pointer to __main() as the first argument.
 	# The first argument is passed in r3.
 	mr %r3, %r6
 	bl __main
-
-	bl __exit
Index: uspace/lib/c/arch/sparc64/src/entry.s
===================================================================
--- uspace/lib/c/arch/sparc64/src/entry.s	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/arch/sparc64/src/entry.s	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -45,5 +45,5 @@
 	flushw
 	add %g0, -0x7ff, %fp
-
+	
 	# Pass pcb_ptr as the first argument to __main()
 	mov %i1, %o0
@@ -51,5 +51,2 @@
 	call __main
 	or %l7, %lo(_gp), %l7
-
-	call __exit
-	nop
Index: uspace/lib/c/generic/async.c
===================================================================
--- uspace/lib/c/generic/async.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/generic/async.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -43,9 +43,4 @@
  * framework will automatically take care of most synchronization problems.
  *
- * Default semantics:
- * - async_send_*(): Send asynchronously. If the kernel refuses to send
- *                   more messages, [ try to get responses from kernel, if
- *                   nothing found, might try synchronous ]
- *
  * Example of use (pseudo C):
  *
@@ -58,5 +53,5 @@
  *   int fibril1(void *arg)
  *   {
- *     conn = ipc_connect_me_to();
+ *     conn = async_connect_me_to();
  *     c1 = async_send(conn);
  *     c2 = async_send(conn);
@@ -77,12 +72,12 @@
  *   {
  *     if (want_refuse) {
- *       ipc_answer_0(icallid, ELIMIT);
+ *       async_answer_0(icallid, ELIMIT);
  *       return;
  *     }
- *     ipc_answer_0(icallid, EOK);
+ *     async_answer_0(icallid, EOK);
  *
  *     callid = async_get_call(&call);
  *     somehow_handle_the_call(callid, call);
- *     ipc_answer_2(callid, 1, 2, 3);
+ *     async_answer_2(callid, 1, 2, 3);
  *
  *     callid = async_get_call(&call);
@@ -92,12 +87,14 @@
  */
 
+#define LIBC_ASYNC_C_
+#include <ipc/ipc.h>
+#include <async.h>
+#undef LIBC_ASYNC_C_
+
 #include <futex.h>
-#include <async.h>
-#include <async_priv.h>
 #include <fibril.h>
 #include <stdio.h>
 #include <adt/hash_table.h>
 #include <adt/list.h>
-#include <ipc/ipc.h>
 #include <assert.h>
 #include <errno.h>
@@ -105,4 +102,5 @@
 #include <arch/barrier.h>
 #include <bool.h>
+#include "private/async.h"
 
 atomic_t async_futex = FUTEX_INITIALIZER;
@@ -124,6 +122,6 @@
 
 /**
- * Structures of this type are used to group information about a call and a
- * message queue link.
+ * Structures of this type are used to group information about
+ * a call and about a message queue link.
  */
 typedef struct {
@@ -153,5 +151,5 @@
 	/** Link to the client tracking structure. */
 	client_t *client;
-
+	
 	/** Messages that should be delivered to this fibril. */
 	link_t msg_queue;
@@ -170,5 +168,5 @@
 
 /** Identifier of the incoming connection handled by the current fibril. */
-fibril_local connection_t *FIBRIL_connection;
+static fibril_local connection_t *FIBRIL_connection;
 
 static void *default_client_data_constructor(void)
@@ -199,10 +197,19 @@
 {
 	assert(FIBRIL_connection);
-
 	return FIBRIL_connection->client->data;
 }
 
-static void default_client_connection(ipc_callid_t callid, ipc_call_t *call);
-static void default_interrupt_received(ipc_callid_t callid, ipc_call_t *call);
+/** Default fibril function that gets called to handle new connection.
+ *
+ * This function is defined as a weak symbol - to be redefined in user code.
+ *
+ * @param callid Hash of the incoming call.
+ * @param call   Data of the incoming call.
+ *
+ */
+static void default_client_connection(ipc_callid_t callid, ipc_call_t *call)
+{
+	ipc_answer_0(callid, ENOENT);
+}
 
 /**
@@ -210,4 +217,16 @@
  */
 static async_client_conn_t client_connection = default_client_connection;
+
+/** Default fibril function that gets called to handle interrupt notifications.
+ *
+ * This function is defined as a weak symbol - to be redefined in user code.
+ *
+ * @param callid Hash of the incoming call.
+ * @param call   Data of the incoming call.
+ *
+ */
+static void default_interrupt_received(ipc_callid_t callid, ipc_call_t *call)
+{
+}
 
 /**
@@ -221,17 +240,17 @@
 static LIST_INITIALIZE(timeout_list);
 
-#define CLIENT_HASH_TABLE_BUCKETS	32
-#define CONN_HASH_TABLE_BUCKETS		32
-
-static hash_index_t client_hash(unsigned long *key)
+#define CLIENT_HASH_TABLE_BUCKETS  32
+#define CONN_HASH_TABLE_BUCKETS    32
+
+static hash_index_t client_hash(unsigned long key[])
 {
 	assert(key);
-	return (((*key) >> 4) % CLIENT_HASH_TABLE_BUCKETS); 
+	return (((key[0]) >> 4) % CLIENT_HASH_TABLE_BUCKETS);
 }
 
 static int client_compare(unsigned long key[], hash_count_t keys, link_t *item)
 {
-	client_t *cl = hash_table_get_instance(item, client_t, link);
-	return (key[0] == cl->in_task_hash);
+	client_t *client = hash_table_get_instance(item, client_t, link);
+	return (key[0] == client->in_task_hash);
 }
 
@@ -254,8 +273,8 @@
  *
  */
-static hash_index_t conn_hash(unsigned long *key)
+static hash_index_t conn_hash(unsigned long key[])
 {
 	assert(key);
-	return (((*key) >> 4) % CONN_HASH_TABLE_BUCKETS);
+	return (((key[0]) >> 4) % CONN_HASH_TABLE_BUCKETS);
 }
 
@@ -271,6 +290,6 @@
 static int conn_compare(unsigned long key[], hash_count_t keys, link_t *item)
 {
-	connection_t *hs = hash_table_get_instance(item, connection_t, link);
-	return (key[0] == hs->in_phone_hash);
+	connection_t *conn = hash_table_get_instance(item, connection_t, link);
+	return (key[0] == conn->in_phone_hash);
 }
 
@@ -287,5 +306,4 @@
 	free(hash_table_get_instance(item, connection_t, link));
 }
-
 
 /** Operations for the connection hash table. */
@@ -308,9 +326,10 @@
 	link_t *tmp = timeout_list.next;
 	while (tmp != &timeout_list) {
-		awaiter_t *cur;
-		
-		cur = list_get_instance(tmp, awaiter_t, to_event.link);
+		awaiter_t *cur
+		    = list_get_instance(tmp, awaiter_t, to_event.link);
+		
 		if (tv_gteq(&cur->to_event.expires, &wd->to_event.expires))
 			break;
+		
 		tmp = tmp->next;
 	}
@@ -329,5 +348,5 @@
  *
  * @return False if the call doesn't match any connection.
- *         True if the call was passed to the respective connection fibril.
+ * @return True if the call was passed to the respective connection fibril.
  *
  */
@@ -466,5 +485,5 @@
 			 * the first IPC_M_PHONE_HUNGUP call and continues to
 			 * call async_get_call_timeout(). Repeat
-			 * IPC_M_PHONE_HUNGUP until the caller notices. 
+			 * IPC_M_PHONE_HUNGUP until the caller notices.
 			 */
 			memset(call, 0, sizeof(ipc_call_t));
@@ -473,5 +492,5 @@
 			return conn->close_callid;
 		}
-
+		
 		if (usecs)
 			async_insert_timeout(&conn->wdata);
@@ -511,29 +530,4 @@
 }
 
-/** Default fibril function that gets called to handle new connection.
- *
- * This function is defined as a weak symbol - to be redefined in user code.
- *
- * @param callid Hash of the incoming call.
- * @param call   Data of the incoming call.
- *
- */
-static void default_client_connection(ipc_callid_t callid, ipc_call_t *call)
-{
-	ipc_answer_0(callid, ENOENT);
-}
-
-/** Default fibril function that gets called to handle interrupt notifications.
- *
- * This function is defined as a weak symbol - to be redefined in user code.
- *
- * @param callid Hash of the incoming call.
- * @param call   Data of the incoming call.
- *
- */
-static void default_interrupt_received(ipc_callid_t callid, ipc_call_t *call)
-{
-}
-
 /** Wrapper for client connection fibril.
  *
@@ -548,14 +542,11 @@
 static int connection_fibril(void *arg)
 {
-	unsigned long key;
-	client_t *cl;
-	link_t *lnk;
-	bool destroy = false;
-
 	/*
 	 * Setup fibril-local connection pointer.
 	 */
 	FIBRIL_connection = (connection_t *) arg;
-
+	
+	futex_down(&async_futex);
+	
 	/*
 	 * Add our reference for the current connection in the client task
@@ -563,28 +554,35 @@
 	 * hash in a new tracking structure.
 	 */
-	futex_down(&async_futex);
-	key = FIBRIL_connection->in_task_hash;
-	lnk = hash_table_find(&client_hash_table, &key);
+	
+	unsigned long key = FIBRIL_connection->in_task_hash;
+	link_t *lnk = hash_table_find(&client_hash_table, &key);
+	
+	client_t *client;
+	
 	if (lnk) {
-		cl = hash_table_get_instance(lnk, client_t, link);
-		cl->refcnt++;
+		client = hash_table_get_instance(lnk, client_t, link);
+		client->refcnt++;
 	} else {
-		cl = malloc(sizeof(client_t));
-		if (!cl) {
+		client = malloc(sizeof(client_t));
+		if (!client) {
 			ipc_answer_0(FIBRIL_connection->callid, ENOMEM);
 			futex_up(&async_futex);
 			return 0;
 		}
-		cl->in_task_hash = FIBRIL_connection->in_task_hash;
+		
+		client->in_task_hash = FIBRIL_connection->in_task_hash;
+		
 		async_serialize_start();
-		cl->data = async_client_data_create();
+		client->data = async_client_data_create();
 		async_serialize_end();
-		cl->refcnt = 1;
-		hash_table_insert(&client_hash_table, &key, &cl->link);
-	}
+		
+		client->refcnt = 1;
+		hash_table_insert(&client_hash_table, &key, &client->link);
+	}
+	
 	futex_up(&async_futex);
-
-	FIBRIL_connection->client = cl;
-
+	
+	FIBRIL_connection->client = client;
+	
 	/*
 	 * Call the connection handler function.
@@ -596,17 +594,23 @@
 	 * Remove the reference for this client task connection.
 	 */
+	bool destroy;
+	
 	futex_down(&async_futex);
-	if (--cl->refcnt == 0) {
+	
+	if (--client->refcnt == 0) {
 		hash_table_remove(&client_hash_table, &key, 1);
 		destroy = true;
-	}
+	} else
+		destroy = false;
+	
 	futex_up(&async_futex);
-
+	
 	if (destroy) {
-		if (cl->data)
-			async_client_data_destroy(cl->data);
-		free(cl);
-	}
-
+		if (client->data)
+			async_client_data_destroy(client->data);
+		
+		free(client);
+	}
+	
 	/*
 	 * Remove myself from the connection hash table.
@@ -621,8 +625,8 @@
 	 */
 	while (!list_empty(&FIBRIL_connection->msg_queue)) {
-		msg_t *msg;
-		
-		msg = list_get_instance(FIBRIL_connection->msg_queue.next,
-		    msg_t, link);
+		msg_t *msg =
+		    list_get_instance(FIBRIL_connection->msg_queue.next, msg_t,
+		    link);
+		
 		list_remove(&msg->link);
 		ipc_answer_0(msg->callid, EHANGUP);
@@ -667,4 +671,5 @@
 		if (callid)
 			ipc_answer_0(callid, ENOMEM);
+		
 		return (uintptr_t) NULL;
 	}
@@ -714,8 +719,8 @@
 static void handle_call(ipc_callid_t callid, ipc_call_t *call)
 {
-	/* Unrouted call - do some default behaviour */
+	/* Unrouted call - take some default action */
 	if ((callid & IPC_CALLID_NOTIFICATION)) {
 		process_notification(callid, call);
-		goto out;
+		return;
 	}
 	
@@ -723,20 +728,16 @@
 	case IPC_M_CONNECT_ME:
 	case IPC_M_CONNECT_ME_TO:
-		/* Open new connection with fibril etc. */
+		/* Open new connection with fibril, etc. */
 		async_new_connection(call->in_task_hash, IPC_GET_ARG5(*call),
 		    callid, call, client_connection);
-		goto out;
+		return;
 	}
 	
 	/* Try to route the call through the connection hash table */
 	if (route_call(callid, call))
-		goto out;
+		return;
 	
 	/* Unknown call from unknown phone - hang it up */
 	ipc_answer_0(callid, EHANGUP);
-	return;
-	
-out:
-	;
 }
 
@@ -751,12 +752,12 @@
 	link_t *cur = timeout_list.next;
 	while (cur != &timeout_list) {
-		awaiter_t *waiter;
-		
-		waiter = list_get_instance(cur, awaiter_t, to_event.link);
+		awaiter_t *waiter =
+		    list_get_instance(cur, awaiter_t, to_event.link);
+		
 		if (tv_gt(&waiter->to_event.expires, &tv))
 			break;
-
+		
 		cur = cur->next;
-
+		
 		list_remove(&waiter->to_event.link);
 		waiter->to_event.inlist = false;
@@ -785,5 +786,5 @@
 	while (true) {
 		if (fibril_switch(FIBRIL_FROM_MANAGER)) {
-			futex_up(&async_futex); 
+			futex_up(&async_futex);
 			/*
 			 * async_futex is always held when entering a manager
@@ -808,11 +809,10 @@
 				continue;
 			} else
-				timeout = tv_sub(&waiter->to_event.expires,
-				    &tv);
+				timeout = tv_sub(&waiter->to_event.expires, &tv);
 		} else
 			timeout = SYNCH_NO_TIMEOUT;
 		
 		futex_up(&async_futex);
-
+		
 		atomic_inc(&threads_in_ipc_wait);
 		
@@ -822,5 +822,5 @@
 		
 		atomic_dec(&threads_in_ipc_wait);
-
+		
 		if (!callid) {
 			handle_expired_timeouts();
@@ -872,17 +872,14 @@
 /** Initialize the async framework.
  *
- * @return Zero on success or an error code.
- */
-int __async_init(void)
+ */
+void __async_init(void)
 {
 	if (!hash_table_create(&client_hash_table, CLIENT_HASH_TABLE_BUCKETS, 1,
-	    &client_hash_table_ops) || !hash_table_create(&conn_hash_table,
-	    CONN_HASH_TABLE_BUCKETS, 1, &conn_hash_table_ops)) {
-		return ENOMEM;
-	}
-
-	_async_sess_init();
-	
-	return 0;
+	    &client_hash_table_ops))
+		abort();
+	
+	if (!hash_table_create(&conn_hash_table, CONN_HASH_TABLE_BUCKETS, 1,
+	    &conn_hash_table_ops))
+		abort();
 }
 
@@ -897,4 +894,5 @@
  * @param retval Value returned in the answer.
  * @param data   Call data of the answer.
+ *
  */
 static void reply_received(void *arg, int retval, ipc_call_t *data)
@@ -944,5 +942,5 @@
     sysarg_t arg2, sysarg_t arg3, sysarg_t arg4, ipc_call_t *dataptr)
 {
-	amsg_t *msg = malloc(sizeof(*msg));
+	amsg_t *msg = malloc(sizeof(amsg_t));
 	
 	if (!msg)
@@ -953,5 +951,9 @@
 	
 	msg->wdata.to_event.inlist = false;
-	/* We may sleep in the next method, but it will use its own mechanism */
+	
+	/*
+	 * We may sleep in the next method,
+	 * but it will use its own means
+	 */
 	msg->wdata.active = true;
 	
@@ -984,5 +986,5 @@
     ipc_call_t *dataptr)
 {
-	amsg_t *msg = malloc(sizeof(*msg));
+	amsg_t *msg = malloc(sizeof(amsg_t));
 	
 	if (!msg)
@@ -993,5 +995,9 @@
 	
 	msg->wdata.to_event.inlist = false;
-	/* We may sleep in next method, but it will use its own mechanism */
+	
+	/*
+	 * We may sleep in the next method,
+	 * but it will use its own means
+	 */
 	msg->wdata.active = true;
 	
@@ -1092,5 +1098,5 @@
 void async_usleep(suseconds_t timeout)
 {
-	amsg_t *msg = malloc(sizeof(*msg));
+	amsg_t *msg = malloc(sizeof(amsg_t));
 	
 	if (!msg)
@@ -1235,78 +1241,215 @@
 }
 
+void async_msg_0(int phone, sysarg_t imethod)
+{
+	ipc_call_async_0(phone, imethod, NULL, NULL, true);
+}
+
+void async_msg_1(int phone, sysarg_t imethod, sysarg_t arg1)
+{
+	ipc_call_async_1(phone, imethod, arg1, NULL, NULL, true);
+}
+
+void async_msg_2(int phone, sysarg_t imethod, sysarg_t arg1, sysarg_t arg2)
+{
+	ipc_call_async_2(phone, imethod, arg1, arg2, NULL, NULL, true);
+}
+
+void async_msg_3(int phone, sysarg_t imethod, sysarg_t arg1, sysarg_t arg2,
+    sysarg_t arg3)
+{
+	ipc_call_async_3(phone, imethod, arg1, arg2, arg3, NULL, NULL, true);
+}
+
+void async_msg_4(int phone, sysarg_t imethod, sysarg_t arg1, sysarg_t arg2,
+    sysarg_t arg3, sysarg_t arg4)
+{
+	ipc_call_async_4(phone, imethod, arg1, arg2, arg3, arg4, NULL, NULL,
+	    true);
+}
+
+void async_msg_5(int phone, sysarg_t imethod, sysarg_t arg1, sysarg_t arg2,
+    sysarg_t arg3, sysarg_t arg4, sysarg_t arg5)
+{
+	ipc_call_async_5(phone, imethod, arg1, arg2, arg3, arg4, arg5, NULL,
+	    NULL, true);
+}
+
+sysarg_t async_answer_0(ipc_callid_t callid, sysarg_t retval)
+{
+	return ipc_answer_0(callid, retval);
+}
+
+sysarg_t async_answer_1(ipc_callid_t callid, sysarg_t retval, sysarg_t arg1)
+{
+	return ipc_answer_1(callid, retval, arg1);
+}
+
+sysarg_t async_answer_2(ipc_callid_t callid, sysarg_t retval, sysarg_t arg1,
+    sysarg_t arg2)
+{
+	return ipc_answer_2(callid, retval, arg1, arg2);
+}
+
+sysarg_t async_answer_3(ipc_callid_t callid, sysarg_t retval, sysarg_t arg1,
+    sysarg_t arg2, sysarg_t arg3)
+{
+	return ipc_answer_3(callid, retval, arg1, arg2, arg3);
+}
+
+sysarg_t async_answer_4(ipc_callid_t callid, sysarg_t retval, sysarg_t arg1,
+    sysarg_t arg2, sysarg_t arg3, sysarg_t arg4)
+{
+	return ipc_answer_4(callid, retval, arg1, arg2, arg3, arg4);
+}
+
+sysarg_t async_answer_5(ipc_callid_t callid, sysarg_t retval, sysarg_t arg1,
+    sysarg_t arg2, sysarg_t arg3, sysarg_t arg4, sysarg_t arg5)
+{
+	return ipc_answer_5(callid, retval, arg1, arg2, arg3, arg4, arg5);
+}
+
+int async_forward_fast(ipc_callid_t callid, int phoneid, sysarg_t imethod,
+    sysarg_t arg1, sysarg_t arg2, unsigned int mode)
+{
+	return ipc_forward_fast(callid, phoneid, imethod, arg1, arg2, mode);
+}
+
+int async_forward_slow(ipc_callid_t callid, int phoneid, sysarg_t imethod,
+    sysarg_t arg1, sysarg_t arg2, sysarg_t arg3, sysarg_t arg4, sysarg_t arg5,
+    unsigned int mode)
+{
+	return ipc_forward_slow(callid, phoneid, imethod, arg1, arg2, arg3, arg4,
+	    arg5, mode);
+}
+
+/** Wrapper for making IPC_M_CONNECT_TO_ME calls using the async framework.
+ *
+ * Ask through phone for a new connection to some service.
+ *
+ * @param phone           Phone handle used for contacting the other side.
+ * @param arg1            User defined argument.
+ * @param arg2            User defined argument.
+ * @param arg3            User defined argument.
+ * @param client_receiver Connection handing routine.
+ *
+ * @return New phone handle on success or a negative error code.
+ *
+ */
+int async_connect_to_me(int phone, sysarg_t arg1, sysarg_t arg2,
+    sysarg_t arg3, async_client_conn_t client_receiver)
+{
+	sysarg_t task_hash;
+	sysarg_t phone_hash;
+	int rc = async_req_3_5(phone, IPC_M_CONNECT_TO_ME, arg1, arg2, arg3,
+	    NULL, NULL, NULL, &task_hash, &phone_hash);
+	if (rc != EOK)
+		return rc;
+	
+	if (client_receiver != NULL)
+		async_new_connection(task_hash, phone_hash, 0, NULL,
+		    client_receiver);
+	
+	return EOK;
+}
+
 /** Wrapper for making IPC_M_CONNECT_ME_TO calls using the async framework.
- * 
+ *
  * Ask through phone for a new connection to some service.
  *
- * @param phoneid	Phone handle used for contacting the other side.
- * @param arg1		User defined argument.
- * @param arg2		User defined argument.
- * @param arg3		User defined argument.
- *
- * @return		New phone handle on success or a negative error code.
- */
-int
-async_connect_me_to(int phoneid, sysarg_t arg1, sysarg_t arg2, sysarg_t arg3)
-{
-	int rc;
+ * @param phone Phone handle used for contacting the other side.
+ * @param arg1  User defined argument.
+ * @param arg2  User defined argument.
+ * @param arg3  User defined argument.
+ *
+ * @return New phone handle on success or a negative error code.
+ *
+ */
+int async_connect_me_to(int phone, sysarg_t arg1, sysarg_t arg2,
+    sysarg_t arg3)
+{
 	sysarg_t newphid;
-
-	rc = async_req_3_5(phoneid, IPC_M_CONNECT_ME_TO, arg1, arg2, arg3, NULL,
-	    NULL, NULL, NULL, &newphid);
-	
-	if (rc != EOK)	
+	int rc = async_req_3_5(phone, IPC_M_CONNECT_ME_TO, arg1, arg2, arg3,
+	    NULL, NULL, NULL, NULL, &newphid);
+	
+	if (rc != EOK)
 		return rc;
-
+	
 	return newphid;
 }
 
 /** Wrapper for making IPC_M_CONNECT_ME_TO calls using the async framework.
- * 
+ *
  * Ask through phone for a new connection to some service and block until
  * success.
  *
- * @param phoneid	Phone handle used for contacting the other side.
- * @param arg1		User defined argument.
- * @param arg2		User defined argument.
- * @param arg3		User defined argument.
- *
- * @return		New phone handle on success or a negative error code.
- */
-int
-async_connect_me_to_blocking(int phoneid, sysarg_t arg1, sysarg_t arg2,
+ * @param phoneid Phone handle used for contacting the other side.
+ * @param arg1    User defined argument.
+ * @param arg2    User defined argument.
+ * @param arg3    User defined argument.
+ *
+ * @return New phone handle on success or a negative error code.
+ *
+ */
+int async_connect_me_to_blocking(int phoneid, sysarg_t arg1, sysarg_t arg2,
     sysarg_t arg3)
 {
-	int rc;
 	sysarg_t newphid;
-
-	rc = async_req_4_5(phoneid, IPC_M_CONNECT_ME_TO, arg1, arg2, arg3,
+	int rc = async_req_4_5(phoneid, IPC_M_CONNECT_ME_TO, arg1, arg2, arg3,
 	    IPC_FLAG_BLOCKING, NULL, NULL, NULL, NULL, &newphid);
 	
-	if (rc != EOK)	
+	if (rc != EOK)
 		return rc;
-
+	
 	return newphid;
 }
 
-/** Wrapper for making IPC_M_SHARE_IN calls using the async framework.
- *
- * @param phoneid	Phone that will be used to contact the receiving side.
- * @param dst		Destination address space area base.
- * @param size		Size of the destination address space area.
- * @param arg		User defined argument.
- * @param flags		Storage where the received flags will be stored. Can be
- *			NULL.
- *
- * @return		Zero on success or a negative error code from errno.h.
+/** Connect to a task specified by id.
+ *
+ */
+int async_connect_kbox(task_id_t id)
+{
+	return ipc_connect_kbox(id);
+}
+
+/** Wrapper for ipc_hangup.
+ *
+ * @param phone Phone handle to hung up.
+ *
+ * @return Zero on success or a negative error code.
+ *
+ */
+int async_hangup(int phone)
+{
+	return ipc_hangup(phone);
+}
+
+/** Interrupt one thread of this task from waiting for IPC. */
+void async_poke(void)
+{
+	ipc_poke();
+}
+
+/** Wrapper for IPC_M_SHARE_IN calls using the async framework.
+ *
+ * @param phoneid Phone that will be used to contact the receiving side.
+ * @param dst     Destination address space area base.
+ * @param size    Size of the destination address space area.
+ * @param arg     User defined argument.
+ * @param flags   Storage for the received flags. Can be NULL.
+ *
+ * @return Zero on success or a negative error code from errno.h.
+ *
  */
 int async_share_in_start(int phoneid, void *dst, size_t size, sysarg_t arg,
-    int *flags)
-{
-	int res;
+    unsigned int *flags)
+{
 	sysarg_t tmp_flags;
-	res = async_req_3_2(phoneid, IPC_M_SHARE_IN, (sysarg_t) dst,
+	int res = async_req_3_2(phoneid, IPC_M_SHARE_IN, (sysarg_t) dst,
 	    (sysarg_t) size, arg, NULL, &tmp_flags);
+	
 	if (flags)
-		*flags = tmp_flags;
+		*flags = (unsigned int) tmp_flags;
+	
 	return res;
 }
@@ -1314,54 +1457,59 @@
 /** Wrapper for receiving the IPC_M_SHARE_IN calls using the async framework.
  *
- * This wrapper only makes it more comfortable to receive IPC_M_SHARE_IN calls
- * so that the user doesn't have to remember the meaning of each IPC argument.
+ * This wrapper only makes it more comfortable to receive IPC_M_SHARE_IN
+ * calls so that the user doesn't have to remember the meaning of each IPC
+ * argument.
  *
  * So far, this wrapper is to be used from within a connection fibril.
  *
- * @param callid	Storage where the hash of the IPC_M_SHARE_IN call will
- * 			be stored.
- * @param size		Destination address space area size.	
- *
- * @return		Non-zero on success, zero on failure.
- */
-int async_share_in_receive(ipc_callid_t *callid, size_t *size)
-{
-	ipc_call_t data;
-	
+ * @param callid Storage for the hash of the IPC_M_SHARE_IN call.
+ * @param size   Destination address space area size.
+ *
+ * @return True on success, false on failure.
+ *
+ */
+bool async_share_in_receive(ipc_callid_t *callid, size_t *size)
+{
 	assert(callid);
 	assert(size);
-
+	
+	ipc_call_t data;
 	*callid = async_get_call(&data);
+	
 	if (IPC_GET_IMETHOD(data) != IPC_M_SHARE_IN)
-		return 0;
+		return false;
+	
 	*size = (size_t) IPC_GET_ARG2(data);
-	return 1;
+	return true;
 }
 
 /** Wrapper for answering the IPC_M_SHARE_IN calls using the async framework.
  *
- * This wrapper only makes it more comfortable to answer IPC_M_DATA_READ calls
- * so that the user doesn't have to remember the meaning of each IPC argument.
- *
- * @param callid	Hash of the IPC_M_DATA_READ call to answer.
- * @param src		Source address space base.
- * @param flags		Flags to be used for sharing. Bits can be only cleared.
- *
- * @return		Zero on success or a value from @ref errno.h on failure.
- */
-int async_share_in_finalize(ipc_callid_t callid, void *src, int flags)
+ * This wrapper only makes it more comfortable to answer IPC_M_DATA_READ
+ * calls so that the user doesn't have to remember the meaning of each IPC
+ * argument.
+ *
+ * @param callid Hash of the IPC_M_DATA_READ call to answer.
+ * @param src    Source address space base.
+ * @param flags  Flags to be used for sharing. Bits can be only cleared.
+ *
+ * @return Zero on success or a value from @ref errno.h on failure.
+ *
+ */
+int async_share_in_finalize(ipc_callid_t callid, void *src, unsigned int flags)
 {
 	return ipc_share_in_finalize(callid, src, flags);
 }
 
-/** Wrapper for making IPC_M_SHARE_OUT calls using the async framework.
- *
- * @param phoneid	Phone that will be used to contact the receiving side.
- * @param src		Source address space area base address.
- * @param flags		Flags to be used for sharing. Bits can be only cleared.
- *
- * @return		Zero on success or a negative error code from errno.h.
- */
-int async_share_out_start(int phoneid, void *src, int flags)
+/** Wrapper for IPC_M_SHARE_OUT calls using the async framework.
+ *
+ * @param phoneid Phone that will be used to contact the receiving side.
+ * @param src     Source address space area base address.
+ * @param flags   Flags to be used for sharing. Bits can be only cleared.
+ *
+ * @return Zero on success or a negative error code from errno.h.
+ *
+ */
+int async_share_out_start(int phoneid, void *src, unsigned int flags)
 {
 	return async_req_3_0(phoneid, IPC_M_SHARE_OUT, (sysarg_t) src, 0,
@@ -1371,42 +1519,45 @@
 /** Wrapper for receiving the IPC_M_SHARE_OUT calls using the async framework.
  *
- * This wrapper only makes it more comfortable to receive IPC_M_SHARE_OUT calls
- * so that the user doesn't have to remember the meaning of each IPC argument.
+ * This wrapper only makes it more comfortable to receive IPC_M_SHARE_OUT
+ * calls so that the user doesn't have to remember the meaning of each IPC
+ * argument.
  *
  * So far, this wrapper is to be used from within a connection fibril.
  *
- * @param callid	Storage where the hash of the IPC_M_SHARE_OUT call will
- * 			be stored.
- * @param size		Storage where the source address space area size will be
- *			stored.
- * @param flags		Storage where the sharing flags will be stored.
- *
- * @return		Non-zero on success, zero on failure.
- */
-int async_share_out_receive(ipc_callid_t *callid, size_t *size, int *flags)
-{
-	ipc_call_t data;
-	
+ * @param callid Storage for the hash of the IPC_M_SHARE_OUT call.
+ * @param size   Storage for the source address space area size.
+ * @param flags  Storage for the sharing flags.
+ *
+ * @return True on success, false on failure.
+ *
+ */
+bool async_share_out_receive(ipc_callid_t *callid, size_t *size, unsigned int *flags)
+{
 	assert(callid);
 	assert(size);
 	assert(flags);
-
+	
+	ipc_call_t data;
 	*callid = async_get_call(&data);
+	
 	if (IPC_GET_IMETHOD(data) != IPC_M_SHARE_OUT)
-		return 0;
+		return false;
+	
 	*size = (size_t) IPC_GET_ARG2(data);
-	*flags = (int) IPC_GET_ARG3(data);
-	return 1;
+	*flags = (unsigned int) IPC_GET_ARG3(data);
+	return true;
 }
 
 /** Wrapper for answering the IPC_M_SHARE_OUT calls using the async framework.
  *
- * This wrapper only makes it more comfortable to answer IPC_M_SHARE_OUT calls
- * so that the user doesn't have to remember the meaning of each IPC argument.
- *
- * @param callid	Hash of the IPC_M_DATA_WRITE call to answer.
- * @param dst		Destination address space area base address.	
- *
- * @return		Zero on success or a value from @ref errno.h on failure.
+ * This wrapper only makes it more comfortable to answer IPC_M_SHARE_OUT
+ * calls so that the user doesn't have to remember the meaning of each IPC
+ * argument.
+ *
+ * @param callid Hash of the IPC_M_DATA_WRITE call to answer.
+ * @param dst    Destination address space area base address.
+ *
+ * @return Zero on success or a value from @ref errno.h on failure.
+ *
  */
 int async_share_out_finalize(ipc_callid_t callid, void *dst)
@@ -1415,12 +1566,12 @@
 }
 
-
-/** Wrapper for making IPC_M_DATA_READ calls using the async framework.
- *
- * @param phoneid	Phone that will be used to contact the receiving side.
- * @param dst		Address of the beginning of the destination buffer.
- * @param size		Size of the destination buffer.
- *
- * @return		Zero on success or a negative error code from errno.h.
+/** Wrapper for IPC_M_DATA_READ calls using the async framework.
+ *
+ * @param phoneid Phone that will be used to contact the receiving side.
+ * @param dst     Address of the beginning of the destination buffer.
+ * @param size    Size of the destination buffer.
+ *
+ * @return Zero on success or a negative error code from errno.h.
+ *
  */
 int async_data_read_start(int phoneid, void *dst, size_t size)
@@ -1432,41 +1583,45 @@
 /** Wrapper for receiving the IPC_M_DATA_READ calls using the async framework.
  *
- * This wrapper only makes it more comfortable to receive IPC_M_DATA_READ calls
- * so that the user doesn't have to remember the meaning of each IPC argument.
+ * This wrapper only makes it more comfortable to receive IPC_M_DATA_READ
+ * calls so that the user doesn't have to remember the meaning of each IPC
+ * argument.
  *
  * So far, this wrapper is to be used from within a connection fibril.
  *
- * @param callid	Storage where the hash of the IPC_M_DATA_READ call will
- * 			be stored.
- * @param size		Storage where the maximum size will be stored. Can be
- *			NULL.
- *
- * @return		Non-zero on success, zero on failure.
- */
-int async_data_read_receive(ipc_callid_t *callid, size_t *size)
-{
+ * @param callid Storage for the hash of the IPC_M_DATA_READ.
+ * @param size   Storage for the maximum size. Can be NULL.
+ *
+ * @return True on success, false on failure.
+ *
+ */
+bool async_data_read_receive(ipc_callid_t *callid, size_t *size)
+{
+	assert(callid);
+	
 	ipc_call_t data;
-	
-	assert(callid);
-
 	*callid = async_get_call(&data);
+	
 	if (IPC_GET_IMETHOD(data) != IPC_M_DATA_READ)
-		return 0;
+		return false;
+	
 	if (size)
 		*size = (size_t) IPC_GET_ARG2(data);
-	return 1;
+	
+	return true;
 }
 
 /** Wrapper for answering the IPC_M_DATA_READ calls using the async framework.
  *
- * This wrapper only makes it more comfortable to answer IPC_M_DATA_READ calls
- * so that the user doesn't have to remember the meaning of each IPC argument.
- *
- * @param callid	Hash of the IPC_M_DATA_READ call to answer.
- * @param src		Source address for the IPC_M_DATA_READ call.
- * @param size		Size for the IPC_M_DATA_READ call. Can be smaller than
- *			the maximum size announced by the sender.
- *
- * @return		Zero on success or a value from @ref errno.h on failure.
+ * This wrapper only makes it more comfortable to answer IPC_M_DATA_READ
+ * calls so that the user doesn't have to remember the meaning of each IPC
+ * argument.
+ *
+ * @param callid Hash of the IPC_M_DATA_READ call to answer.
+ * @param src    Source address for the IPC_M_DATA_READ call.
+ * @param size   Size for the IPC_M_DATA_READ call. Can be smaller than
+ *               the maximum size announced by the sender.
+ *
+ * @return Zero on success or a value from @ref errno.h on failure.
+ *
  */
 int async_data_read_finalize(ipc_callid_t callid, const void *src, size_t size)
@@ -1476,5 +1631,4 @@
 
 /** Wrapper for forwarding any read request
- *
  *
  */
@@ -1509,5 +1663,5 @@
 }
 
-/** Wrapper for making IPC_M_DATA_WRITE calls using the async framework.
+/** Wrapper for IPC_M_DATA_WRITE calls using the async framework.
  *
  * @param phoneid Phone that will be used to contact the receiving side.
@@ -1526,37 +1680,37 @@
 /** Wrapper for receiving the IPC_M_DATA_WRITE calls using the async framework.
  *
- * This wrapper only makes it more comfortable to receive IPC_M_DATA_WRITE calls
- * so that the user doesn't have to remember the meaning of each IPC argument.
+ * This wrapper only makes it more comfortable to receive IPC_M_DATA_WRITE
+ * calls so that the user doesn't have to remember the meaning of each IPC
+ * argument.
  *
  * So far, this wrapper is to be used from within a connection fibril.
  *
- * @param callid Storage where the hash of the IPC_M_DATA_WRITE call will
- *               be stored.
- * @param size   Storage where the suggested size will be stored. May be
- *               NULL
- *
- * @return Non-zero on success, zero on failure.
- *
- */
-int async_data_write_receive(ipc_callid_t *callid, size_t *size)
-{
+ * @param callid Storage for the hash of the IPC_M_DATA_WRITE.
+ * @param size   Storage for the suggested size. May be NULL.
+ *
+ * @return True on success, false on failure.
+ *
+ */
+bool async_data_write_receive(ipc_callid_t *callid, size_t *size)
+{
+	assert(callid);
+	
 	ipc_call_t data;
-	
-	assert(callid);
-	
 	*callid = async_get_call(&data);
+	
 	if (IPC_GET_IMETHOD(data) != IPC_M_DATA_WRITE)
-		return 0;
+		return false;
 	
 	if (size)
 		*size = (size_t) IPC_GET_ARG2(data);
 	
-	return 1;
+	return true;
 }
 
 /** Wrapper for answering the IPC_M_DATA_WRITE calls using the async framework.
  *
- * This wrapper only makes it more comfortable to answer IPC_M_DATA_WRITE calls
- * so that the user doesn't have to remember the meaning of each IPC argument.
+ * This wrapper only makes it more comfortable to answer IPC_M_DATA_WRITE
+ * calls so that the user doesn't have to remember the meaning of each IPC
+ * argument.
  *
  * @param callid Hash of the IPC_M_DATA_WRITE call to answer.
@@ -1654,5 +1808,5 @@
  *
  */
-void async_data_write_void(const int retval)
+void async_data_write_void(sysarg_t retval)
 {
 	ipc_callid_t callid;
@@ -1662,5 +1816,4 @@
 
 /** Wrapper for forwarding any data that is about to be received
- *
  *
  */
Index: uspace/lib/c/generic/async_sess.c
===================================================================
--- uspace/lib/c/generic/async_sess.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/generic/async_sess.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -99,5 +99,4 @@
 
 #include <async_sess.h>
-#include <ipc/ipc.h>
 #include <fibril_synch.h>
 #include <adt/list.h>
@@ -106,4 +105,5 @@
 #include <errno.h>
 #include <assert.h>
+#include "private/async_sess.h"
 
 /** An inactive open connection. */
@@ -138,6 +138,7 @@
  *
  * Needs to be called prior to any other interface in this file.
- */
-void _async_sess_init(void)
+ *
+ */
+void __async_sess_init(void)
 {
 	fibril_mutex_initialize(&async_sess_mutex);
@@ -200,5 +201,5 @@
 		list_remove(&conn->global_link);
 		
-		ipc_hangup(conn->data_phone);
+		async_hangup(conn->data_phone);
 		free(conn);
 	}
@@ -260,5 +261,5 @@
 			data_phone = conn->data_phone;
 			free(conn);
-			ipc_hangup(data_phone);
+			async_hangup(data_phone);
 			goto retry;
 		} else {
@@ -292,5 +293,5 @@
 		 * means that we simply hang up.
 		 */
-		ipc_hangup(data_phone);
+		async_hangup(data_phone);
 		fibril_mutex_unlock(&async_sess_mutex);
 		return;
Index: uspace/lib/c/generic/clipboard.c
===================================================================
--- uspace/lib/c/generic/clipboard.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/generic/clipboard.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -39,4 +39,5 @@
 
 #include <clipboard.h>
+#include <ipc/ns.h>
 #include <ipc/services.h>
 #include <ipc/clipboard.h>
@@ -54,5 +55,5 @@
 {
 	while (clip_phone < 0)
-		clip_phone = ipc_connect_me_to_blocking(PHONE_NS, SERVICE_CLIPBOARD, 0, 0);
+		clip_phone = service_connect_blocking(SERVICE_CLIPBOARD, 0, 0);
 }
 
Index: uspace/lib/c/generic/ddi.c
===================================================================
--- uspace/lib/c/generic/ddi.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/generic/ddi.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -127,4 +127,33 @@
 }
 
+/** Register IRQ notification.
+ *
+ * @param inr    IRQ number.
+ * @param devno  Device number of the device generating inr.
+ * @param method Use this method for notifying me.
+ * @param ucode  Top-half pseudocode handler.
+ *
+ * @return Value returned by the kernel.
+ *
+ */
+int register_irq(int inr, int devno, int method, irq_code_t *ucode)
+{
+	return __SYSCALL4(SYS_REGISTER_IRQ, inr, devno, method,
+	    (sysarg_t) ucode);
+}
+
+/** Unregister IRQ notification.
+ *
+ * @param inr   IRQ number.
+ * @param devno Device number of the device generating inr.
+ *
+ * @return Value returned by the kernel.
+ *
+ */
+int unregister_irq(int inr, int devno)
+{
+	return __SYSCALL2(SYS_UNREGISTER_IRQ, inr, devno);
+}
+
 /** @}
  */
Index: uspace/lib/c/generic/devman.c
===================================================================
--- uspace/lib/c/generic/devman.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/generic/devman.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -28,6 +28,6 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
- 
- /** @addtogroup libc
+
+/** @addtogroup libc
  * @{
  */
@@ -37,5 +37,4 @@
 #include <str.h>
 #include <stdio.h>
-#include <ipc/ipc.h>
 #include <ipc/services.h>
 #include <ipc/devman.h>
@@ -116,5 +115,5 @@
 	async_set_client_connection(conn);
 	
-	ipc_connect_to_me(phone, 0, 0, 0, NULL, NULL);
+	async_connect_to_me(phone, 0, 0, 0, NULL);
 	async_wait_for(req, &retval);
 	
@@ -221,5 +220,5 @@
 	case DEVMAN_DRIVER:
 		if (devman_phone_driver >= 0) {
-			ipc_hangup(devman_phone_driver);
+			async_hangup(devman_phone_driver);
 			devman_phone_driver = -1;
 		}
@@ -227,5 +226,5 @@
 	case DEVMAN_CLIENT:
 		if (devman_phone_client >= 0) {
-			ipc_hangup(devman_phone_client);
+			async_hangup(devman_phone_client);
 			devman_phone_client = -1;
 		}
Index: uspace/lib/c/generic/devmap.c
===================================================================
--- uspace/lib/c/generic/devmap.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/generic/devmap.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -29,6 +29,6 @@
 
 #include <str.h>
-#include <ipc/ipc.h>
 #include <ipc/services.h>
+#include <ipc/ns.h>
 #include <ipc/devmap.h>
 #include <devmap.h>
@@ -50,9 +50,9 @@
 		
 		if (flags & IPC_FLAG_BLOCKING)
-			devmap_phone_driver = ipc_connect_me_to_blocking(PHONE_NS,
-			    SERVICE_DEVMAP, DEVMAP_DRIVER, 0);
+			devmap_phone_driver = service_connect_blocking(SERVICE_DEVMAP,
+			    DEVMAP_DRIVER, 0);
 		else
-			devmap_phone_driver = ipc_connect_me_to(PHONE_NS,
-			    SERVICE_DEVMAP, DEVMAP_DRIVER, 0);
+			devmap_phone_driver = service_connect(SERVICE_DEVMAP,
+			    DEVMAP_DRIVER, 0);
 		
 		return devmap_phone_driver;
@@ -62,9 +62,9 @@
 		
 		if (flags & IPC_FLAG_BLOCKING)
-			devmap_phone_client = ipc_connect_me_to_blocking(PHONE_NS,
-			    SERVICE_DEVMAP, DEVMAP_CLIENT, 0);
+			devmap_phone_client = service_connect_blocking(SERVICE_DEVMAP,
+			    DEVMAP_CLIENT, 0);
 		else
-			devmap_phone_client = ipc_connect_me_to(PHONE_NS,
-			    SERVICE_DEVMAP, DEVMAP_CLIENT, 0);
+			devmap_phone_client = service_connect(SERVICE_DEVMAP,
+			    DEVMAP_CLIENT, 0);
 		
 		return devmap_phone_client;
@@ -79,5 +79,5 @@
 	case DEVMAP_DRIVER:
 		if (devmap_phone_driver >= 0) {
-			ipc_hangup(devmap_phone_driver);
+			async_hangup(devmap_phone_driver);
 			devmap_phone_driver = -1;
 		}
@@ -85,5 +85,5 @@
 	case DEVMAP_CLIENT:
 		if (devmap_phone_client >= 0) {
-			ipc_hangup(devmap_phone_client);
+			async_hangup(devmap_phone_client);
 			devmap_phone_client = -1;
 		}
@@ -116,5 +116,5 @@
 	async_set_client_connection(conn);
 	
-	ipc_connect_to_me(phone, 0, 0, 0, NULL, NULL);
+	async_connect_to_me(phone, 0, 0, 0, NULL);
 	async_wait_for(req, &retval);
 	
Index: pace/lib/c/generic/err.c
===================================================================
--- uspace/lib/c/generic/err.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ 	(revision )
@@ -1,46 +1,0 @@
-/*
- * Copyright (c) 2006 Ondrej Palkovsky
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libc
- * @{
- */
-/** @file
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-/* TODO
-void errx(int __status, __const char *__format, ...)
-{
-	_exit(0);
-}
-*/
-
-/** @}
- */
Index: uspace/lib/c/generic/event.c
===================================================================
--- uspace/lib/c/generic/event.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/generic/event.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -35,10 +35,9 @@
  */
 /** @file
- */ 
+ */
 
 #include <libc.h>
 #include <event.h>
 #include <kernel/ipc/event_types.h>
-#include <ipc/ipc.h>
 
 /** Subscribe for event notifications.
Index: uspace/lib/c/generic/fibril_synch.c
===================================================================
--- uspace/lib/c/generic/fibril_synch.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/generic/fibril_synch.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -36,5 +36,4 @@
 #include <fibril.h>
 #include <async.h>
-#include <async_priv.h>
 #include <adt/list.h>
 #include <futex.h>
@@ -44,4 +43,5 @@
 #include <stacktrace.h>
 #include <stdlib.h>
+#include "private/async.h"
 
 static void optimize_execution_power(void)
@@ -55,5 +55,5 @@
 	 */
 	if (atomic_get(&threads_in_ipc_wait) > 0)
-		ipc_poke();
+		async_poke();
 }
 
@@ -105,5 +105,5 @@
 
 	if (fibril_get_sercount() != 0)
-		core();
+		abort();
 
 	futex_down(&async_futex);
@@ -198,5 +198,5 @@
 	
 	if (fibril_get_sercount() != 0)
-		core();
+		abort();
 
 	futex_down(&async_futex);
@@ -226,5 +226,5 @@
 	
 	if (fibril_get_sercount() != 0)
-		core();
+		abort();
 
 	futex_down(&async_futex);
Index: uspace/lib/c/generic/io/io.c
===================================================================
--- uspace/lib/c/generic/io/io.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/generic/io/io.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -41,8 +41,10 @@
 #include <bool.h>
 #include <malloc.h>
+#include <async.h>
 #include <io/klog.h>
 #include <vfs/vfs.h>
 #include <ipc/devmap.h>
 #include <adt/list.h>
+#include "../private/io.h"
 
 static void _ffillbuf(FILE *stream);
@@ -322,5 +324,5 @@
 	
 	if (stream->phone >= 0)
-		ipc_hangup(stream->phone);
+		async_hangup(stream->phone);
 	
 	if (stream->fd >= 0)
Index: uspace/lib/c/generic/ipc.c
===================================================================
--- uspace/lib/c/generic/ipc.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/generic/ipc.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -45,21 +45,17 @@
 #include <errno.h>
 #include <adt/list.h>
-#include <stdio.h>
-#include <unistd.h>
 #include <futex.h>
-#include <kernel/synch/synch.h>
-#include <async.h>
 #include <fibril.h>
-#include <assert.h>
 
 /**
- * Structures of this type are used for keeping track of sent asynchronous calls
- * and queing unsent calls.
+ * Structures of this type are used for keeping track
+ * of sent asynchronous calls and queing unsent calls.
  */
 typedef struct {
 	link_t list;
-
+	
 	ipc_async_callback_t callback;
 	void *private;
+	
 	union {
 		ipc_callid_t callid;
@@ -69,5 +65,7 @@
 		} msg;
 	} u;
-	fid_t fid;	/**< Fibril waiting for sending this call. */
+	
+	/** Fibril waiting for sending this call. */
+	fid_t fid;
 } async_call_t;
 
@@ -76,6 +74,7 @@
 /** List of asynchronous calls that were not accepted by kernel.
  *
- * It is protected by async_futex, because if the call cannot be sent into the
- * kernel, the async framework is used automatically.
+ * Protected by async_futex, because if the call is not accepted
+ * by the kernel, the async framework is used automatically.
+ *
  */
 LIST_INITIALIZE(queued_calls);
@@ -83,36 +82,35 @@
 static atomic_t ipc_futex = FUTEX_INITIALIZER;
 
-/** Make a fast synchronous call.
- *
- * Only three payload arguments can be passed using this function. However, this
- * function is faster than the generic ipc_call_sync_slow() because the payload
- * is passed directly in registers.
- *
- * @param phoneid	Phone handle for the call.
- * @param method	Requested method.
- * @param arg1		Service-defined payload argument.
- * @param arg2		Service-defined payload argument.
- * @param arg3		Service-defined payload argument.
- * @param result1	If non-NULL, the return ARG1 will be stored there.
- * @param result2	If non-NULL, the return ARG2 will be stored there.
- * @param result3	If non-NULL, the return ARG3 will be stored there.
- * @param result4	If non-NULL, the return ARG4 will be stored there.
- * @param result5	If non-NULL, the return ARG5 will be stored there.
- *
- * @return		Negative values represent errors returned by IPC.
- *			Otherwise the RETVAL of the answer is returned.
- */
-int
-ipc_call_sync_fast(int phoneid, sysarg_t method, sysarg_t arg1, sysarg_t arg2,
-    sysarg_t arg3, sysarg_t *result1, sysarg_t *result2, sysarg_t *result3,
-    sysarg_t *result4, sysarg_t *result5)
+/** Fast synchronous call.
+ *
+ * Only three payload arguments can be passed using this function. However,
+ * this function is faster than the generic ipc_call_sync_slow() because
+ * the payload is passed directly in registers.
+ *
+ * @param phoneid Phone handle for the call.
+ * @param method  Requested method.
+ * @param arg1    Service-defined payload argument.
+ * @param arg2    Service-defined payload argument.
+ * @param arg3    Service-defined payload argument.
+ * @param result1 If non-NULL, the return ARG1 will be stored there.
+ * @param result2 If non-NULL, the return ARG2 will be stored there.
+ * @param result3 If non-NULL, the return ARG3 will be stored there.
+ * @param result4 If non-NULL, the return ARG4 will be stored there.
+ * @param result5 If non-NULL, the return ARG5 will be stored there.
+ *
+ * @return Negative values representing IPC errors.
+ * @return Otherwise the RETVAL of the answer.
+ *
+ */
+int ipc_call_sync_fast(int phoneid, sysarg_t method, sysarg_t arg1,
+    sysarg_t arg2, sysarg_t arg3, sysarg_t *result1, sysarg_t *result2,
+    sysarg_t *result3, sysarg_t *result4, sysarg_t *result5)
 {
 	ipc_call_t resdata;
-	int callres;
-	
-	callres = __SYSCALL6(SYS_IPC_CALL_SYNC_FAST, phoneid, method, arg1,
+	int callres = __SYSCALL6(SYS_IPC_CALL_SYNC_FAST, phoneid, method, arg1,
 	    arg2, arg3, (sysarg_t) &resdata);
 	if (callres)
 		return callres;
+	
 	if (result1)
 		*result1 = IPC_GET_ARG1(resdata);
@@ -125,9 +123,9 @@
 	if (result5)
 		*result5 = IPC_GET_ARG5(resdata);
-
+	
 	return IPC_GET_RETVAL(resdata);
 }
 
-/** Make a synchronous call transmitting 5 arguments of payload.
+/** Synchronous call transmitting 5 arguments of payload.
  *
  * @param phoneid Phone handle for the call.
@@ -144,12 +142,12 @@
  * @param result5 If non-NULL, storage for the fifth return argument.
  *
- * @return Negative value means IPC error.
- *         Otherwise the RETVAL of the answer.
- *
- */
-int
-ipc_call_sync_slow(int phoneid, sysarg_t imethod, sysarg_t arg1, sysarg_t arg2,
-    sysarg_t arg3, sysarg_t arg4, sysarg_t arg5, sysarg_t *result1,
-    sysarg_t *result2, sysarg_t *result3, sysarg_t *result4, sysarg_t *result5)
+ * @return Negative values representing IPC errors.
+ * @return Otherwise the RETVAL of the answer.
+ *
+ */
+int ipc_call_sync_slow(int phoneid, sysarg_t imethod, sysarg_t arg1,
+    sysarg_t arg2, sysarg_t arg3, sysarg_t arg4, sysarg_t arg5,
+    sysarg_t *result1, sysarg_t *result2, sysarg_t *result3, sysarg_t *result4,
+    sysarg_t *result5)
 {
 	ipc_call_t data;
@@ -181,5 +179,5 @@
 }
 
-/** Syscall to send asynchronous message.
+/** Send asynchronous message via syscall.
  *
  * @param phoneid Phone handle for the call.
@@ -189,66 +187,72 @@
  *
  */
-static ipc_callid_t _ipc_call_async(int phoneid, ipc_call_t *data)
+static ipc_callid_t ipc_call_async_internal(int phoneid, ipc_call_t *data)
 {
 	return __SYSCALL2(SYS_IPC_CALL_ASYNC_SLOW, phoneid, (sysarg_t) data);
 }
 
-/** Prolog to ipc_call_async_*() functions.
- *
- * @param private	Argument for the answer/error callback.
- * @param callback	Answer/error callback.
- *
- * @return		New, partially initialized async_call structure or NULL.
+/** Prolog for ipc_call_async_*() functions.
+ *
+ * @param private  Argument for the answer/error callback.
+ * @param callback Answer/error callback.
+ *
+ * @return New, partially initialized async_call structure or NULL.
+ *
  */
 static inline async_call_t *ipc_prepare_async(void *private,
     ipc_async_callback_t callback)
 {
-	async_call_t *call;
-
-	call = malloc(sizeof(*call));
+	async_call_t *call =
+	    (async_call_t *) malloc(sizeof(async_call_t));
 	if (!call) {
 		if (callback)
 			callback(private, ENOMEM, NULL);
+		
 		return NULL;
 	}
+	
 	call->callback = callback;
 	call->private = private;
-
+	
 	return call;
 }
 
-/** Epilogue of ipc_call_async_*() functions.
- *
- * @param callid	Value returned by the SYS_IPC_CALL_ASYNC_* syscall.
- * @param phoneid	Phone handle through which the call was made.
- * @param call		async_call structure returned by ipc_prepare_async().
- * @param can_preempt	If non-zero, the current fibril can be preempted in this
- *			call.
+/** Epilog for ipc_call_async_*() functions.
+ *
+ * @param callid      Value returned by the SYS_IPC_CALL_ASYNC_* syscall.
+ * @param phoneid     Phone handle through which the call was made.
+ * @param call        Structure returned by ipc_prepare_async().
+ * @param can_preempt If true, the current fibril can be preempted
+ *                    in this call.
+ *
  */
 static inline void ipc_finish_async(ipc_callid_t callid, int phoneid,
-    async_call_t *call, int can_preempt)
-{
-	if (!call) { /* Nothing to do regardless if failed or not */
+    async_call_t *call, bool can_preempt)
+{
+	if (!call) {
+		/* Nothing to do regardless if failed or not */
 		futex_up(&ipc_futex);
 		return;
 	}
-
+	
 	if (callid == (ipc_callid_t) IPC_CALLRET_FATAL) {
 		futex_up(&ipc_futex);
+		
 		/* Call asynchronous handler with error code */
 		if (call->callback)
 			call->callback(call->private, ENOENT, NULL);
+		
 		free(call);
 		return;
 	}
-
+	
 	if (callid == (ipc_callid_t) IPC_CALLRET_TEMPORARY) {
 		futex_up(&ipc_futex);
-
+		
 		call->u.msg.phoneid = phoneid;
 		
 		futex_down(&async_futex);
 		list_append(&call->list, &queued_calls);
-
+		
 		if (can_preempt) {
 			call->fid = fibril_get_id();
@@ -259,14 +263,16 @@
 			futex_up(&async_futex);
 		}
+		
 		return;
 	}
+	
 	call->u.callid = callid;
+	
 	/* Add call to the list of dispatched calls */
 	list_append(&call->list, &dispatched_calls);
 	futex_up(&ipc_futex);
-	
-}
-
-/** Make a fast asynchronous call.
+}
+
+/** Fast asynchronous call.
  *
  * This function can only handle four arguments of payload. It is, however,
@@ -274,7 +280,8 @@
  *
  * Note that this function is a void function.
- * During normal opertation, answering this call will trigger the callback.
- * In case of fatal error, call the callback handler with the proper error code.
- * If the call cannot be temporarily made, queue it.
+ *
+ * During normal operation, answering this call will trigger the callback.
+ * In case of fatal error, the callback handler is called with the proper
+ * error code. If the call cannot be temporarily made, it is queued.
  *
  * @param phoneid     Phone handle for the call.
@@ -286,5 +293,5 @@
  * @param private     Argument to be passed to the answer/error callback.
  * @param callback    Answer or error callback.
- * @param can_preempt If non-zero, the current fibril will be preempted in
+ * @param can_preempt If true, the current fibril will be preempted in
  *                    case the kernel temporarily refuses to accept more
  *                    asynchronous calls.
@@ -293,5 +300,5 @@
 void ipc_call_async_fast(int phoneid, sysarg_t imethod, sysarg_t arg1,
     sysarg_t arg2, sysarg_t arg3, sysarg_t arg4, void *private,
-    ipc_async_callback_t callback, int can_preempt)
+    ipc_async_callback_t callback, bool can_preempt)
 {
 	async_call_t *call = NULL;
@@ -304,7 +311,8 @@
 	
 	/*
-	 * We need to make sure that we get callid before another thread
-	 * accesses the queue again.
+	 * We need to make sure that we get callid
+	 * before another thread accesses the queue again.
 	 */
+	
 	futex_down(&ipc_futex);
 	ipc_callid_t callid = __SYSCALL6(SYS_IPC_CALL_ASYNC_FAST, phoneid,
@@ -317,4 +325,5 @@
 				return;
 		}
+		
 		IPC_SET_IMETHOD(call->u.msg.data, imethod);
 		IPC_SET_ARG1(call->u.msg.data, arg1);
@@ -322,19 +331,23 @@
 		IPC_SET_ARG3(call->u.msg.data, arg3);
 		IPC_SET_ARG4(call->u.msg.data, arg4);
+		
 		/*
 		 * To achieve deterministic behavior, we always zero out the
 		 * arguments that are beyond the limits of the fast version.
 		 */
+		
 		IPC_SET_ARG5(call->u.msg.data, 0);
 	}
+	
 	ipc_finish_async(callid, phoneid, call, can_preempt);
 }
 
-/** Make an asynchronous call transmitting the entire payload.
+/** Asynchronous call transmitting the entire payload.
  *
  * Note that this function is a void function.
- * During normal opertation, answering this call will trigger the callback.
- * In case of fatal error, call the callback handler with the proper error code.
- * If the call cannot be temporarily made, queue it.
+ *
+ * During normal operation, answering this call will trigger the callback.
+ * In case of fatal error, the callback handler is called with the proper
+ * error code. If the call cannot be temporarily made, it is queued.
  *
  * @param phoneid     Phone handle for the call.
@@ -347,5 +360,5 @@
  * @param private     Argument to be passed to the answer/error callback.
  * @param callback    Answer or error callback.
- * @param can_preempt If non-zero, the current fibril will be preempted in
+ * @param can_preempt If true, the current fibril will be preempted in
  *                    case the kernel temporarily refuses to accept more
  *                    asynchronous calls.
@@ -354,13 +367,10 @@
 void ipc_call_async_slow(int phoneid, sysarg_t imethod, sysarg_t arg1,
     sysarg_t arg2, sysarg_t arg3, sysarg_t arg4, sysarg_t arg5, void *private,
-    ipc_async_callback_t callback, int can_preempt)
-{
-	async_call_t *call;
-	ipc_callid_t callid;
-
-	call = ipc_prepare_async(private, callback);
+    ipc_async_callback_t callback, bool can_preempt)
+{
+	async_call_t *call = ipc_prepare_async(private, callback);
 	if (!call)
 		return;
-
+	
 	IPC_SET_IMETHOD(call->u.msg.data, imethod);
 	IPC_SET_ARG1(call->u.msg.data, arg1);
@@ -369,28 +379,32 @@
 	IPC_SET_ARG4(call->u.msg.data, arg4);
 	IPC_SET_ARG5(call->u.msg.data, arg5);
+	
 	/*
-	 * We need to make sure that we get callid before another thread
-	 * accesses the queue again.
+	 * We need to make sure that we get callid
+	 * before another threadaccesses the queue again.
 	 */
+	
 	futex_down(&ipc_futex);
-	callid = _ipc_call_async(phoneid, &call->u.msg.data);
-
+	ipc_callid_t callid =
+	    ipc_call_async_internal(phoneid, &call->u.msg.data);
+	
 	ipc_finish_async(callid, phoneid, call, can_preempt);
 }
 
-
-/** Answer a received call - fast version.
+/** Answer received call (fast version).
  *
  * The fast answer makes use of passing retval and first four arguments in
  * registers. If you need to return more, use the ipc_answer_slow() instead.
  *
- * @param callid	Hash of the call being answered.
- * @param retval	Return value.
- * @param arg1		First return argument.
- * @param arg2		Second return argument.
- * @param arg3		Third return argument.
- * @param arg4		Fourth return argument.
- *
- * @return		Zero on success or a value from @ref errno.h on failure.
+ * @param callid Hash of the call being answered.
+ * @param retval Return value.
+ * @param arg1   First return argument.
+ * @param arg2   Second return argument.
+ * @param arg3   Third return argument.
+ * @param arg4   Fourth return argument.
+ *
+ * @return Zero on success.
+ * @return Value from @ref errno.h on failure.
+ *
  */
 sysarg_t ipc_answer_fast(ipc_callid_t callid, sysarg_t retval, sysarg_t arg1,
@@ -401,15 +415,17 @@
 }
 
-/** Answer a received call - slow full version.
- *
- * @param callid	Hash of the call being answered.
- * @param retval	Return value.
- * @param arg1		First return argument.
- * @param arg2		Second return argument.
- * @param arg3		Third return argument.
- * @param arg4		Fourth return argument.
- * @param arg5		Fifth return argument.
- *
- * @return		Zero on success or a value from @ref errno.h on failure.
+/** Answer received call (entire payload).
+ *
+ * @param callid Hash of the call being answered.
+ * @param retval Return value.
+ * @param arg1   First return argument.
+ * @param arg2   Second return argument.
+ * @param arg3   Third return argument.
+ * @param arg4   Fourth return argument.
+ * @param arg5   Fifth return argument.
+ *
+ * @return Zero on success.
+ * @return Value from @ref errno.h on failure.
+ *
  */
 sysarg_t ipc_answer_slow(ipc_callid_t callid, sysarg_t retval, sysarg_t arg1,
@@ -417,5 +433,5 @@
 {
 	ipc_call_t data;
-
+	
 	IPC_SET_RETVAL(data, retval);
 	IPC_SET_ARG1(data, arg1);
@@ -424,30 +440,33 @@
 	IPC_SET_ARG4(data, arg4);
 	IPC_SET_ARG5(data, arg5);
-
+	
 	return __SYSCALL2(SYS_IPC_ANSWER_SLOW, callid, (sysarg_t) &data);
 }
 
-
-/** Try to dispatch queued calls from the async queue. */
-static void try_dispatch_queued_calls(void)
-{
-	async_call_t *call;
-	ipc_callid_t callid;
-
+/** Try to dispatch queued calls from the async queue.
+ *
+ */
+static void dispatch_queued_calls(void)
+{
 	/** @todo
-	 * Integrate intelligently ipc_futex, so that it is locked during
-	 * ipc_call_async_*(), until it is added to dispatched_calls.
+	 * Integrate intelligently ipc_futex so that it is locked during
+	 * ipc_call_async_*() until it is added to dispatched_calls.
 	 */
+	
 	futex_down(&async_futex);
+	
 	while (!list_empty(&queued_calls)) {
-		call = list_get_instance(queued_calls.next, async_call_t, list);
-		callid = _ipc_call_async(call->u.msg.phoneid,
-		    &call->u.msg.data);
-		if (callid == (ipc_callid_t) IPC_CALLRET_TEMPORARY) {
+		async_call_t *call =
+		    list_get_instance(queued_calls.next, async_call_t, list);
+		ipc_callid_t callid =
+		    ipc_call_async_internal(call->u.msg.phoneid, &call->u.msg.data);
+		
+		if (callid == (ipc_callid_t) IPC_CALLRET_TEMPORARY)
 			break;
-		}
+		
 		list_remove(&call->list);
-
+		
 		futex_up(&async_futex);
+		
 		if (call->fid)
 			fibril_add_ready(call->fid);
@@ -456,94 +475,114 @@
 			if (call->callback)
 				call->callback(call->private, ENOENT, NULL);
+			
 			free(call);
 		} else {
 			call->u.callid = callid;
+			
 			futex_down(&ipc_futex);
 			list_append(&call->list, &dispatched_calls);
 			futex_up(&ipc_futex);
 		}
+		
 		futex_down(&async_futex);
 	}
+	
 	futex_up(&async_futex);
 }
 
-/** Handle a received answer.
+/** Handle received answer.
  *
  * Find the hash of the answer and call the answer callback.
  *
- * @todo Make it use hash table.
- *
- * @param callid	Hash of the received answer.
- *			The answer has the same hash as the request OR'ed with
- *			the IPC_CALLID_ANSWERED bit.
- * @param data		Call data of the answer.
+ * The answer has the same hash as the request OR'ed with
+ * the IPC_CALLID_ANSWERED bit.
+ *
+ * @todo Use hash table.
+ *
+ * @param callid Hash of the received answer.
+ * @param data   Call data of the answer.
+ *
  */
 static void handle_answer(ipc_callid_t callid, ipc_call_t *data)
 {
+	callid &= ~IPC_CALLID_ANSWERED;
+	
+	futex_down(&ipc_futex);
+	
 	link_t *item;
-	async_call_t *call;
-
-	callid &= ~IPC_CALLID_ANSWERED;
-	
-	futex_down(&ipc_futex);
 	for (item = dispatched_calls.next; item != &dispatched_calls;
 	    item = item->next) {
-		call = list_get_instance(item, async_call_t, list);
+		async_call_t *call =
+		    list_get_instance(item, async_call_t, list);
+		
 		if (call->u.callid == callid) {
 			list_remove(&call->list);
+			
 			futex_up(&ipc_futex);
+			
 			if (call->callback)
-				call->callback(call->private, 
+				call->callback(call->private,
 				    IPC_GET_RETVAL(*data), data);
+			
 			free(call);
 			return;
 		}
 	}
+	
 	futex_up(&ipc_futex);
 }
 
-
-/** Wait for a first call to come.
- *
- * @param call		Storage where the incoming call data will be stored.
- * @param usec		Timeout in microseconds
- * @param flags		Flags passed to SYS_IPC_WAIT (blocking, nonblocking).
- *
- * @return		Hash of the call. Note that certain bits have special
- *			meaning. IPC_CALLID_ANSWERED will be set in an answer
- *			and IPC_CALLID_NOTIFICATION is used for notifications.
- *			
- */
-ipc_callid_t ipc_wait_cycle(ipc_call_t *call, uint32_t usec, int flags)
-{
-	ipc_callid_t callid;
-
-	callid = __SYSCALL3(SYS_IPC_WAIT, (sysarg_t) call, usec, flags);
+/** Wait for first IPC call to come.
+ *
+ * @param call  Incoming call storage.
+ * @param usec  Timeout in microseconds
+ * @param flags Flags passed to SYS_IPC_WAIT (blocking, nonblocking).
+ *
+ * @return Hash of the call. Note that certain bits have special
+ *         meaning: IPC_CALLID_ANSWERED is set in an answer
+ *         and IPC_CALLID_NOTIFICATION is used for notifications.
+ *
+ */
+ipc_callid_t ipc_wait_cycle(ipc_call_t *call, sysarg_t usec,
+    unsigned int flags)
+{
+	ipc_callid_t callid =
+	    __SYSCALL3(SYS_IPC_WAIT, (sysarg_t) call, usec, flags);
+	
 	/* Handle received answers */
 	if (callid & IPC_CALLID_ANSWERED) {
 		handle_answer(callid, call);
-		try_dispatch_queued_calls();
+		dispatch_queued_calls();
 	}
-
+	
 	return callid;
 }
 
-/** Wait some time for an IPC call.
- *
- * The call will return after an answer is received.
- *
- * @param call		Storage where the incoming call data will be stored.
- * @param usec		Timeout in microseconds.
- *
- * @return		Hash of the answer.
- */
-ipc_callid_t ipc_wait_for_call_timeout(ipc_call_t *call, uint32_t usec)
+/** Interrupt one thread of this task from waiting for IPC.
+ *
+ */
+void ipc_poke(void)
+{
+	__SYSCALL0(SYS_IPC_POKE);
+}
+
+/** Wait for first IPC call to come.
+ *
+ * Only requests are returned, answers are processed internally.
+ *
+ * @param call Incoming call storage.
+ * @param usec Timeout in microseconds
+ *
+ * @return Hash of the call.
+ *
+ */
+ipc_callid_t ipc_wait_for_call_timeout(ipc_call_t *call, sysarg_t usec)
 {
 	ipc_callid_t callid;
-
+	
 	do {
 		callid = ipc_wait_cycle(call, usec, SYNCH_FLAGS_NONE);
 	} while (callid & IPC_CALLID_ANSWERED);
-
+	
 	return callid;
 }
@@ -551,41 +590,40 @@
 /** Check if there is an IPC call waiting to be picked up.
  *
- * @param call		Storage where the incoming call will be stored.
- * @return		Hash of the answer.
+ * Only requests are returned, answers are processed internally.
+ *
+ * @param call Incoming call storage.
+ *
+ * @return Hash of the call.
+ *
  */
 ipc_callid_t ipc_trywait_for_call(ipc_call_t *call)
 {
 	ipc_callid_t callid;
-
+	
 	do {
 		callid = ipc_wait_cycle(call, SYNCH_NO_TIMEOUT,
 		    SYNCH_FLAGS_NON_BLOCKING);
 	} while (callid & IPC_CALLID_ANSWERED);
-
+	
 	return callid;
 }
 
-/** Interrupt one thread of this task from waiting for IPC. */
-void ipc_poke(void)
-{
-	__SYSCALL0(SYS_IPC_POKE);
-}
-
-/** Ask destination to do a callback connection.
- *
- * @param phoneid	Phone handle used for contacting the other side.
- * @param arg1		Service-defined argument.
- * @param arg2		Service-defined argument.
- * @param arg3		Service-defined argument.
- * @param taskhash	Storage where the kernel will store an opaque
- *			identifier of the client task.
- * @param phonehash	Storage where the kernel will store an opaque
- *			identifier of the phone that will be used for incoming
- *			calls. This identifier can be used for connection
- *			tracking.
- *
- * @return		Zero on success or a negative error code.
- */
-int ipc_connect_to_me(int phoneid, int arg1, int arg2, int arg3, 
+/** Request callback connection.
+ *
+ * The @a taskhash and @a phonehash identifiers returned
+ * by the kernel can be used for connection tracking.
+ *
+ * @param phoneid   Phone handle used for contacting the other side.
+ * @param arg1      User defined argument.
+ * @param arg2      User defined argument.
+ * @param arg3      User defined argument.
+ * @param taskhash  Opaque identifier of the client task.
+ * @param phonehash Opaque identifier of the phone that will
+ *                  be used for incoming calls.
+ *
+ * @return Zero on success or a negative error code.
+ *
+ */
+int ipc_connect_to_me(int phoneid, sysarg_t arg1, sysarg_t arg2, sysarg_t arg3,
     sysarg_t *taskhash, sysarg_t *phonehash)
 {
@@ -594,46 +632,48 @@
 }
 
-/** Ask through phone for a new connection to some service.
- *
- * @param phoneid	Phone handle used for contacting the other side.
- * @param arg1		User defined argument.
- * @param arg2		User defined argument.
- * @param arg3		User defined argument.
- *
- * @return		New phone handle on success or a negative error code.
- */
-int ipc_connect_me_to(int phoneid, int arg1, int arg2, int arg3)
+/** Request new connection.
+ *
+ * @param phoneid Phone handle used for contacting the other side.
+ * @param arg1    User defined argument.
+ * @param arg2    User defined argument.
+ * @param arg3    User defined argument.
+ *
+ * @return New phone handle on success or a negative error code.
+ *
+ */
+int ipc_connect_me_to(int phoneid, sysarg_t arg1, sysarg_t arg2, sysarg_t arg3)
 {
 	sysarg_t newphid;
-	int res;
-
-	res = ipc_call_sync_3_5(phoneid, IPC_M_CONNECT_ME_TO, arg1, arg2, arg3,
+	int res = ipc_call_sync_3_5(phoneid, IPC_M_CONNECT_ME_TO, arg1, arg2, arg3,
 	    NULL, NULL, NULL, NULL, &newphid);
 	if (res)
 		return res;
+	
 	return newphid;
 }
 
-/** Ask through phone for a new connection to some service.
+/** Request new connection (blocking)
  *
  * If the connection is not available at the moment, the
- * call will block.
- *
- * @param phoneid	Phone handle used for contacting the other side.
- * @param arg1		User defined argument.
- * @param arg2		User defined argument.
- * @param arg3		User defined argument.
- *
- * @return		New phone handle on success or a negative error code.
- */
-int ipc_connect_me_to_blocking(int phoneid, int arg1, int arg2, int arg3)
+ * call should block. This has to be, however, implemented
+ * on the server side.
+ *
+ * @param phoneid Phone handle used for contacting the other side.
+ * @param arg1    User defined argument.
+ * @param arg2    User defined argument.
+ * @param arg3    User defined argument.
+ *
+ * @return New phone handle on success or a negative error code.
+ *
+ */
+int ipc_connect_me_to_blocking(int phoneid, sysarg_t arg1, sysarg_t arg2,
+    sysarg_t arg3)
 {
 	sysarg_t newphid;
-	int res;
-
-	res = ipc_call_sync_4_5(phoneid, IPC_M_CONNECT_ME_TO, arg1, arg2, arg3,
+	int res = ipc_call_sync_4_5(phoneid, IPC_M_CONNECT_ME_TO, arg1, arg2, arg3,
 	    IPC_FLAG_BLOCKING, NULL, NULL, NULL, NULL, &newphid);
 	if (res)
 		return res;
+	
 	return newphid;
 }
@@ -641,7 +681,8 @@
 /** Hang up a phone.
  *
- * @param phoneid	Handle of the phone to be hung up.
- *
- * @return		Zero on success or a negative error code.
+ * @param phoneid Handle of the phone to be hung up.
+ *
+ * @return Zero on success or a negative error code.
+ *
  */
 int ipc_hangup(int phoneid)
@@ -650,32 +691,10 @@
 }
 
-/** Register IRQ notification.
- *
- * @param inr		IRQ number.
- * @param devno		Device number of the device generating inr.
- * @param method	Use this method for notifying me.
- * @param ucode		Top-half pseudocode handler.
- *
- * @return		Value returned by the kernel.
- */
-int ipc_register_irq(int inr, int devno, int method, irq_code_t *ucode)
-{
-	return __SYSCALL4(SYS_IPC_REGISTER_IRQ, inr, devno, method,
-	    (sysarg_t) ucode);
-}
-
-/** Unregister IRQ notification.
- *
- * @param inr		IRQ number.
- * @param devno		Device number of the device generating inr.
- *
- * @return		Value returned by the kernel.
- */
-int ipc_unregister_irq(int inr, int devno)
-{
-	return __SYSCALL2(SYS_IPC_UNREGISTER_IRQ, inr, devno);
-}
-
 /** Forward a received call to another destination.
+ *
+ * For non-system methods, the old method, arg1 and arg2 are rewritten
+ * by the new values. For system methods, the new method, arg1 and arg2
+ * are written to the old arg1, arg2 and arg3, respectivelly. Calls with
+ * immutable methods are forwarded verbatim.
  *
  * @param callid  Hash of the call to forward.
@@ -688,11 +707,7 @@
  * @return Zero on success or an error code.
  *
- * For non-system methods, the old method, arg1 and arg2 are rewritten by the
- * new values. For system methods, the new method, arg1 and arg2 are written 
- * to the old arg1, arg2 and arg3, respectivelly. Calls with immutable 
- * methods are forwarded verbatim.
- */
-int ipc_forward_fast(ipc_callid_t callid, int phoneid, int imethod,
-    sysarg_t arg1, sysarg_t arg2, int mode)
+ */
+int ipc_forward_fast(ipc_callid_t callid, int phoneid, sysarg_t imethod,
+    sysarg_t arg1, sysarg_t arg2, unsigned int mode)
 {
 	return __SYSCALL6(SYS_IPC_FORWARD_FAST, callid, phoneid, imethod, arg1,
@@ -700,8 +715,7 @@
 }
 
-
-int ipc_forward_slow(ipc_callid_t callid, int phoneid, int imethod,
+int ipc_forward_slow(ipc_callid_t callid, int phoneid, sysarg_t imethod,
     sysarg_t arg1, sysarg_t arg2, sysarg_t arg3, sysarg_t arg4, sysarg_t arg5,
-    int mode)
+    unsigned int mode)
 {
 	ipc_call_t data;
@@ -714,20 +728,21 @@
 	IPC_SET_ARG5(data, arg5);
 	
-	return __SYSCALL4(SYS_IPC_FORWARD_SLOW, callid, phoneid, (sysarg_t) &data, mode);
-}
-
-/** Wrapper for making IPC_M_SHARE_IN calls.
- *
- * @param phoneid	Phone that will be used to contact the receiving side.
- * @param dst		Destination address space area base.
- * @param size		Size of the destination address space area.
- * @param arg		User defined argument.
- * @param flags		Storage where the received flags will be stored. Can be
- *			NULL.
- *
- * @return		Zero on success or a negative error code from errno.h.
+	return __SYSCALL4(SYS_IPC_FORWARD_SLOW, callid, phoneid, (sysarg_t) &data,
+	    mode);
+}
+
+/** Wrapper for IPC_M_SHARE_IN calls.
+ *
+ * @param phoneid Phone that will be used to contact the receiving side.
+ * @param dst     Destination address space area base.
+ * @param size    Size of the destination address space area.
+ * @param arg     User defined argument.
+ * @param flags   Storage for received flags. Can be NULL.
+ *
+ * @return Zero on success or a negative error code from errno.h.
+ *
  */
 int ipc_share_in_start(int phoneid, void *dst, size_t size, sysarg_t arg,
-    int *flags)
+    unsigned int *flags)
 {
 	sysarg_t tmp_flags = 0;
@@ -736,5 +751,5 @@
 	
 	if (flags)
-		*flags = tmp_flags;
+		*flags = (unsigned int) tmp_flags;
 	
 	return res;
@@ -743,27 +758,30 @@
 /** Wrapper for answering the IPC_M_SHARE_IN calls.
  *
- * This wrapper only makes it more comfortable to answer IPC_M_DATA_READ calls
- * so that the user doesn't have to remember the meaning of each IPC argument.
- *
- * @param callid	Hash of the IPC_M_DATA_READ call to answer.
- * @param src		Source address space base.
- * @param flags		Flags to be used for sharing. Bits can be only cleared.
- *
- * @return		Zero on success or a value from @ref errno.h on failure.
- */
-int ipc_share_in_finalize(ipc_callid_t callid, void *src, int flags)
+ * This wrapper only makes it more comfortable to answer IPC_M_DATA_READ
+ * calls so that the user doesn't have to remember the meaning of each
+ * IPC argument.
+ *
+ * @param callid Hash of the IPC_M_DATA_READ call to answer.
+ * @param src    Source address space base.
+ * @param flags Flags to be used for sharing. Bits can be only cleared.
+ *
+ * @return Zero on success or a value from @ref errno.h on failure.
+ *
+ */
+int ipc_share_in_finalize(ipc_callid_t callid, void *src, unsigned int flags)
 {
 	return ipc_answer_2(callid, EOK, (sysarg_t) src, (sysarg_t) flags);
 }
 
-/** Wrapper for making IPC_M_SHARE_OUT calls.
- *
- * @param phoneid	Phone that will be used to contact the receiving side.
- * @param src		Source address space area base address.
- * @param flags		Flags to be used for sharing. Bits can be only cleared.
- *
- * @return		Zero on success or a negative error code from errno.h.
- */
-int ipc_share_out_start(int phoneid, void *src, int flags)
+/** Wrapper for IPC_M_SHARE_OUT calls.
+ *
+ * @param phoneid Phone that will be used to contact the receiving side.
+ * @param src     Source address space area base address.
+ * @param flags   Flags to be used for sharing. Bits can be only cleared.
+ *
+ * @return Zero on success or a negative error code from errno.h.
+ *
+ */
+int ipc_share_out_start(int phoneid, void *src, unsigned int flags)
 {
 	return ipc_call_sync_3_0(phoneid, IPC_M_SHARE_OUT, (sysarg_t) src, 0,
@@ -773,11 +791,13 @@
 /** Wrapper for answering the IPC_M_SHARE_OUT calls.
  *
- * This wrapper only makes it more comfortable to answer IPC_M_SHARE_OUT calls
- * so that the user doesn't have to remember the meaning of each IPC argument.
- *
- * @param callid	Hash of the IPC_M_DATA_WRITE call to answer.
- * @param dst		Destination address space area base address.	
- *
- * @return		Zero on success or a value from @ref errno.h on failure.
+ * This wrapper only makes it more comfortable to answer IPC_M_SHARE_OUT
+ * calls so that the user doesn't have to remember the meaning of each
+ * IPC argument.
+ *
+ * @param callid Hash of the IPC_M_DATA_WRITE call to answer.
+ * @param dst    Destination address space area base address.
+ *
+ * @return Zero on success or a value from @ref errno.h on failure.
+ *
  */
 int ipc_share_out_finalize(ipc_callid_t callid, void *dst)
@@ -786,12 +806,12 @@
 }
 
-
-/** Wrapper for making IPC_M_DATA_READ calls.
- *
- * @param phoneid	Phone that will be used to contact the receiving side.
- * @param dst		Address of the beginning of the destination buffer.
- * @param size		Size of the destination buffer.
- *
- * @return		Zero on success or a negative error code from errno.h.
+/** Wrapper for IPC_M_DATA_READ calls.
+ *
+ * @param phoneid Phone that will be used to contact the receiving side.
+ * @param dst     Address of the beginning of the destination buffer.
+ * @param size    Size of the destination buffer.
+ *
+ * @return Zero on success or a negative error code from errno.h.
+ *
  */
 int ipc_data_read_start(int phoneid, void *dst, size_t size)
@@ -803,13 +823,15 @@
 /** Wrapper for answering the IPC_M_DATA_READ calls.
  *
- * This wrapper only makes it more comfortable to answer IPC_M_DATA_READ calls
- * so that the user doesn't have to remember the meaning of each IPC argument.
- *
- * @param callid	Hash of the IPC_M_DATA_READ call to answer.
- * @param src		Source address for the IPC_M_DATA_READ call.
- * @param size		Size for the IPC_M_DATA_READ call. Can be smaller than
- *			the maximum size announced by the sender.
- *
- * @return		Zero on success or a value from @ref errno.h on failure.
+ * This wrapper only makes it more comfortable to answer IPC_M_DATA_READ
+ * calls so that the user doesn't have to remember the meaning of each
+ * IPC argument.
+ *
+ * @param callid Hash of the IPC_M_DATA_READ call to answer.
+ * @param src    Source address for the IPC_M_DATA_READ call.
+ * @param size   Size for the IPC_M_DATA_READ call. Can be smaller than
+ *               the maximum size announced by the sender.
+ *
+ * @return Zero on success or a value from @ref errno.h on failure.
+ *
  */
 int ipc_data_read_finalize(ipc_callid_t callid, const void *src, size_t size)
@@ -818,11 +840,12 @@
 }
 
-/** Wrapper for making IPC_M_DATA_WRITE calls.
- *
- * @param phoneid	Phone that will be used to contact the receiving side.
- * @param src		Address of the beginning of the source buffer.
- * @param size		Size of the source buffer.
- *
- * @return		Zero on success or a negative error code from errno.h.
+/** Wrapper for IPC_M_DATA_WRITE calls.
+ *
+ * @param phoneid Phone that will be used to contact the receiving side.
+ * @param src     Address of the beginning of the source buffer.
+ * @param size    Size of the source buffer.
+ *
+ * @return Zero on success or a negative error code from errno.h.
+ *
  */
 int ipc_data_write_start(int phoneid, const void *src, size_t size)
@@ -834,12 +857,14 @@
 /** Wrapper for answering the IPC_M_DATA_WRITE calls.
  *
- * This wrapper only makes it more comfortable to answer IPC_M_DATA_WRITE calls
- * so that the user doesn't have to remember the meaning of each IPC argument.
- *
- * @param callid	Hash of the IPC_M_DATA_WRITE call to answer.
- * @param dst		Final destination address for the IPC_M_DATA_WRITE call.
- * @param size		Final size for the IPC_M_DATA_WRITE call.
- *
- * @return		Zero on success or a value from @ref errno.h on failure.
+ * This wrapper only makes it more comfortable to answer IPC_M_DATA_WRITE
+ * calls so that the user doesn't have to remember the meaning of each
+ * IPC argument.
+ *
+ * @param callid Hash of the IPC_M_DATA_WRITE call to answer.
+ * @param dst    Final destination address for the IPC_M_DATA_WRITE call.
+ * @param size   Final size for the IPC_M_DATA_WRITE call.
+ *
+ * @return Zero on success or a value from @ref errno.h on failure.
+ *
  */
 int ipc_data_write_finalize(ipc_callid_t callid, void *dst, size_t size)
Index: uspace/lib/c/generic/ipc/ns.c
===================================================================
--- uspace/lib/c/generic/ipc/ns.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
+++ uspace/lib/c/generic/ipc/ns.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2011 Martin Decky
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libc
+ * @{
+ */
+/** @file
+ */
+
+#include <async.h>
+#include <ipc/ns.h>
+
+int service_register(sysarg_t service)
+{
+	return async_connect_to_me(PHONE_NS, service, 0, 0, NULL);
+}
+
+int service_connect(sysarg_t service, sysarg_t arg2, sysarg_t arg3)
+{
+	return async_connect_me_to(PHONE_NS, service, arg2, arg3);
+}
+
+int service_connect_blocking(sysarg_t service, sysarg_t arg2, sysarg_t arg3)
+{
+	return async_connect_me_to_blocking(PHONE_NS, service, arg2, arg3);
+}
+
+/** @}
+ */
Index: uspace/lib/c/generic/libc.c
===================================================================
--- uspace/lib/c/generic/libc.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/generic/libc.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -42,28 +42,28 @@
 
 #include <libc.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <malloc.h>
+#include <stdlib.h>
 #include <tls.h>
-#include <thread.h>
 #include <fibril.h>
-#include <ipc/ipc.h>
-#include <async.h>
-#include <as.h>
+#include <task.h>
 #include <loader/pcb.h>
+#include "private/libc.h"
+#include "private/async.h"
+#include "private/async_sess.h"
+#include "private/malloc.h"
+#include "private/io.h"
 
-extern int main(int argc, char *argv[]);
-
-void _exit(int status)
-{
-	thread_exit(status);
-}
+static bool env_setup = false;
 
 void __main(void *pcb_ptr)
 {
 	/* Initialize user task run-time environment */
-	__heap_init();
+	__malloc_init();
 	__async_init();
+	__async_sess_init();
+	
 	fibril_t *fibril = fibril_setup();
+	if (fibril == NULL)
+		abort();
+	
 	__tcb_set(fibril->tcb);
 	
@@ -71,9 +71,14 @@
 	__pcb = (pcb_t *) pcb_ptr;
 	
+	/* The basic run-time environment is setup */
+	env_setup = true;
+	
 	int argc;
 	char **argv;
 	
-	/* Get command line arguments and initialize
-	   standard input and output */
+	/*
+	 * Get command line arguments and initialize
+	 * standard input and output
+	 */
 	if (__pcb == NULL) {
 		argc = 0;
@@ -87,14 +92,32 @@
 	}
 	
-	/* Run main() and set task return value
-	   according the result */
-	(void) task_retval(main(argc, argv));
+	/*
+	 * Run main() and set task return value
+	 * according the result
+	 */
+	int retval = main(argc, argv);
+	exit(retval);
 }
 
-void __exit(void)
+void exit(int status)
 {
-	__stdio_done();
-	fibril_teardown(__tcb_get()->fibril_data);
-	_exit(0);
+	if (env_setup) {
+		__stdio_done();
+		task_retval(status);
+		fibril_teardown(__tcb_get()->fibril_data);
+	}
+	
+	__SYSCALL1(SYS_TASK_EXIT, false);
+	
+	/* Unreachable */
+	while (1);
+}
+
+void abort(void)
+{
+	__SYSCALL1(SYS_TASK_EXIT, true);
+	
+	/* Unreachable */
+	while (1);
 }
 
Index: uspace/lib/c/generic/loader.c
===================================================================
--- uspace/lib/c/generic/loader.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/generic/loader.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -33,7 +33,7 @@
  */
 
-#include <ipc/ipc.h>
 #include <ipc/loader.h>
 #include <ipc/services.h>
+#include <ipc/ns.h>
 #include <libc.h>
 #include <task.h>
@@ -63,5 +63,5 @@
 loader_t *loader_connect(void)
 {
-	int phone_id = ipc_connect_me_to_blocking(PHONE_NS, SERVICE_LOAD, 0, 0);
+	int phone_id = service_connect_blocking(SERVICE_LOAD, 0, 0);
 	if (phone_id < 0)
 		return NULL;
@@ -319,5 +319,5 @@
 		return rc;
 	
-	ipc_hangup(ldr->phone_id);
+	async_hangup(ldr->phone_id);
 	ldr->phone_id = 0;
 	return EOK;
@@ -337,5 +337,5 @@
 void loader_abort(loader_t *ldr)
 {
-	ipc_hangup(ldr->phone_id);
+	async_hangup(ldr->phone_id);
 	ldr->phone_id = 0;
 }
Index: uspace/lib/c/generic/malloc.c
===================================================================
--- uspace/lib/c/generic/malloc.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/generic/malloc.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -45,4 +45,5 @@
 #include <futex.h>
 #include <adt/gcdlcm.h>
+#include "private/malloc.h"
 
 /* Magic used in heap headers. */
@@ -215,25 +216,22 @@
 /** Initialize the heap allocator
  *
- * Find how much physical memory we have and create
- * the heap management structures that mark the whole
- * physical memory as a single free block.
- *
- */
-void __heap_init(void)
-{
-	futex_down(&malloc_futex);
-	
-	if (as_area_create((void *) &_heap, PAGE_SIZE,
-	    AS_AREA_WRITE | AS_AREA_READ)) {
-		heap_pages = 1;
-		heap_start = (void *) ALIGN_UP((uintptr_t) &_heap, BASE_ALIGN);
-		heap_end =
-		    (void *) ALIGN_DOWN(((uintptr_t) &_heap) + PAGE_SIZE, BASE_ALIGN);
-		
-		/* Make the entire area one large block. */
-		block_init(heap_start, heap_end - heap_start, true);
-	}
-	
-	futex_up(&malloc_futex);
+ * Create initial heap memory area. This routine is
+ * only called from libc initialization, thus we do not
+ * take any locks.
+ *
+ */
+void __malloc_init(void)
+{
+	if (!as_area_create((void *) &_heap, PAGE_SIZE,
+	    AS_AREA_WRITE | AS_AREA_READ))
+		abort();
+	
+	heap_pages = 1;
+	heap_start = (void *) ALIGN_UP((uintptr_t) &_heap, BASE_ALIGN);
+	heap_end =
+	    (void *) ALIGN_DOWN(((uintptr_t) &_heap) + PAGE_SIZE, BASE_ALIGN);
+	
+	/* Make the entire area one large block. */
+	block_init(heap_start, heap_end - heap_start, true);
 }
 
Index: uspace/lib/c/generic/net/icmp_api.c
===================================================================
--- uspace/lib/c/generic/net/icmp_api.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/generic/net/icmp_api.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -41,11 +41,8 @@
 #include <net/modules.h>
 #include <net/ip_codes.h>
-
 #include <async.h>
 #include <sys/types.h>
 #include <sys/time.h>
 #include <errno.h>
-
-#include <ipc/ipc.h>
 #include <ipc/services.h>
 #include <ipc/icmp.h>
Index: uspace/lib/c/generic/net/modules.c
===================================================================
--- uspace/lib/c/generic/net/modules.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/generic/net/modules.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -43,8 +43,5 @@
 #include <errno.h>
 #include <sys/time.h>
-
-#include <ipc/ipc.h>
 #include <ipc/services.h>
-
 #include <net/modules.h>
 
@@ -67,21 +64,21 @@
 		switch (count) {
 		case 0:
-			ipc_answer_0(callid, (sysarg_t) result);
+			async_answer_0(callid, (sysarg_t) result);
 			break;
 		case 1:
-			ipc_answer_1(callid, (sysarg_t) result,
+			async_answer_1(callid, (sysarg_t) result,
 			    IPC_GET_ARG1(*answer));
 			break;
 		case 2:
-			ipc_answer_2(callid, (sysarg_t) result,
+			async_answer_2(callid, (sysarg_t) result,
 			    IPC_GET_ARG1(*answer), IPC_GET_ARG2(*answer));
 			break;
 		case 3:
-			ipc_answer_3(callid, (sysarg_t) result,
+			async_answer_3(callid, (sysarg_t) result,
 			    IPC_GET_ARG1(*answer), IPC_GET_ARG2(*answer),
 			    IPC_GET_ARG3(*answer));
 			break;
 		case 4:
-			ipc_answer_4(callid, (sysarg_t) result,
+			async_answer_4(callid, (sysarg_t) result,
 			    IPC_GET_ARG1(*answer), IPC_GET_ARG2(*answer),
 			    IPC_GET_ARG3(*answer), IPC_GET_ARG4(*answer));
@@ -89,5 +86,5 @@
 		case 5:
 		default:
-			ipc_answer_5(callid, (sysarg_t) result,
+			async_answer_5(callid, (sysarg_t) result,
 			    IPC_GET_ARG1(*answer), IPC_GET_ARG2(*answer),
 			    IPC_GET_ARG3(*answer), IPC_GET_ARG4(*answer),
@@ -137,21 +134,13 @@
     sysarg_t arg3, async_client_conn_t client_receiver, suseconds_t timeout)
 {
-	int rc;
-	
 	/* Connect to the needed service */
 	int phone = connect_to_service_timeout(need, timeout);
 	if (phone >= 0) {
 		/* Request the bidirectional connection */
-		sysarg_t taskhash;
-		sysarg_t phonehash;
-		
-		rc = ipc_connect_to_me(phone, arg1, arg2, arg3, &taskhash,
-		    &phonehash);
+		int rc = async_connect_to_me(phone, arg1, arg2, arg3, client_receiver);
 		if (rc != EOK) {
-			ipc_hangup(phone);
+			async_hangup(phone);
 			return rc;
 		}
-		async_new_connection(taskhash, phonehash, 0, NULL,
-		    client_receiver);
 	}
 	
Index: uspace/lib/c/generic/net/socket_client.c
===================================================================
--- uspace/lib/c/generic/net/socket_client.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/generic/net/socket_client.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -43,8 +43,7 @@
 #include <stdlib.h>
 #include <errno.h>
-
+#include <task.h>
 #include <ipc/services.h>
 #include <ipc/socket.h>
-
 #include <net/modules.h>
 #include <net/in.h>
@@ -278,5 +277,5 @@
 	}
 
-	ipc_answer_0(callid, (sysarg_t) rc);
+	async_answer_0(callid, (sysarg_t) rc);
 	goto loop;
 }
@@ -687,5 +686,5 @@
 
 	/* Read address */
-	ipc_data_read_start(socket->phone, cliaddr, *addrlen);
+	async_data_read_start(socket->phone, cliaddr, *addrlen);
 	fibril_rwlock_write_unlock(&socket_globals.lock);
 	async_wait_for(message_id, &ipc_result);
Index: uspace/lib/c/generic/private/async.h
===================================================================
--- uspace/lib/c/generic/private/async.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
+++ uspace/lib/c/generic/private/async.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2006 Ondrej Palkovsky
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libc
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBC_PRIVATE_ASYNC_H_
+#define LIBC_PRIVATE_ASYNC_H_
+
+#include <adt/list.h>
+#include <fibril.h>
+#include <sys/time.h>
+#include <bool.h>
+
+/** Structures of this type are used to track the timeout events. */
+typedef struct {
+	/** If true, this struct is in the timeout list. */
+	bool inlist;
+	
+	/** Timeout list link. */
+	link_t link;
+	
+	/** If true, we have timed out. */
+	bool occurred;
+	
+	/** Expiration time. */
+	struct timeval expires;
+} to_event_t;
+
+/** Structures of this type are used to track the wakeup events. */
+typedef struct {
+	/** If true, this struct is in a synchronization object wait queue. */
+	bool inlist;
+	
+	/** Wait queue linkage. */
+	link_t link;
+} wu_event_t;
+
+/** Structures of this type represent a waiting fibril. */
+typedef struct {
+	/** Identification of and link to the waiting fibril. */
+	fid_t fid;
+	
+	/** If true, this fibril is currently active. */
+	bool active;
+	
+	/** Timeout wait data. */
+	to_event_t to_event;
+	/** Wakeup wait data. */
+	wu_event_t wu_event;
+} awaiter_t;
+
+extern void __async_init(void);
+extern void async_insert_timeout(awaiter_t *);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/generic/private/async_sess.h
===================================================================
--- uspace/lib/c/generic/private/async_sess.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
+++ uspace/lib/c/generic/private/async_sess.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2011 Martin Decky
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libc
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBC_PRIVATE_ASYNC_SESS_H_
+#define LIBC_PRIVATE_ASYNC_SESS_H_
+
+extern void __async_sess_init(void);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/generic/private/io.h
===================================================================
--- uspace/lib/c/generic/private/io.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
+++ uspace/lib/c/generic/private/io.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2011 Martin Decky
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libc
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBC_PRIVATE_IO_H_
+#define LIBC_PRIVATE_IO_H_
+
+#include <vfs/vfs.h>
+
+extern void __stdio_init(int filc, fdi_node_t *filv[]);
+extern void __stdio_done(void);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/generic/private/libc.h
===================================================================
--- uspace/lib/c/generic/private/libc.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
+++ uspace/lib/c/generic/private/libc.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2011 Martin Decky
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libc
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBC_PRIVATE_LIBC_H_
+#define LIBC_PRIVATE_LIBC_H_
+
+extern int main(int, char *[]);
+extern void __main(void *) __attribute__((noreturn));
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/generic/private/malloc.h
===================================================================
--- uspace/lib/c/generic/private/malloc.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
+++ uspace/lib/c/generic/private/malloc.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2011 Martin Decky
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libc
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBC_PRIVATE_MALLOC_H_
+#define LIBC_PRIVATE_MALLOC_H_
+
+extern void __malloc_init(void);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/generic/private/thread.h
===================================================================
--- uspace/lib/c/generic/private/thread.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
+++ uspace/lib/c/generic/private/thread.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2011 Martin Decky
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libc
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBC_PRIVATE_THREAD_H_
+#define LIBC_PRIVATE_THREAD_H_
+
+#include <kernel/proc/uarg.h>
+
+extern void __thread_entry(void);
+extern void __thread_main(uspace_arg_t *);
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/generic/thread.c
===================================================================
--- uspace/lib/c/generic/thread.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/generic/thread.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -31,5 +31,5 @@
  */
 /** @file
- */ 
+ */
 
 #include <thread.h>
@@ -41,4 +41,5 @@
 #include <str.h>
 #include <async.h>
+#include "private/thread.h"
 
 #ifndef THREAD_INITIAL_STACK_PAGES_NO
@@ -50,25 +51,27 @@
  * This function is called from __thread_entry() and is used
  * to call the thread's implementing function and perform cleanup
- * and exit when thread returns back. Do not call this function
- * directly.
+ * and exit when thread returns back.
  *
  * @param uarg Pointer to userspace argument structure.
+ *
  */
 void __thread_main(uspace_arg_t *uarg)
 {
-	fibril_t *f;
-
-	f = fibril_setup();
-	__tcb_set(f->tcb);
-
+	fibril_t *fibril = fibril_setup();
+	if (fibril == NULL)
+		thread_exit(0);
+	
+	__tcb_set(fibril->tcb);
+	
 	uarg->uspace_thread_function(uarg->uspace_thread_arg);
-	/* XXX: we cannot free the userspace stack while running on it */
-//	free(uarg->uspace_stack);
-//	free(uarg);
-
+	/* XXX: we cannot free the userspace stack while running on it
+		free(uarg->uspace_stack);
+		free(uarg);
+	*/
+	
 	/* If there is a manager, destroy it */
 	async_destroy_manager();
-	fibril_teardown(f);
-
+	fibril_teardown(fibril);
+	
 	thread_exit(0);
 }
@@ -127,10 +130,12 @@
  *
  * @param status Exit status. Currently not used.
+ *
  */
 void thread_exit(int status)
 {
 	__SYSCALL1(SYS_THREAD_EXIT, (sysarg_t) status);
-	for (;;)
-		;
+	
+	/* Unreachable */
+	while (1);
 }
 
Index: uspace/lib/c/generic/time.c
===================================================================
--- uspace/lib/c/generic/time.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/generic/time.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -34,21 +34,15 @@
 
 #include <sys/time.h>
-#include <unistd.h>
-#include <ipc/ipc.h>
-#include <stdio.h>
+#include <time.h>
+#include <bool.h>
 #include <arch/barrier.h>
-#include <unistd.h>
-#include <atomic.h>
-#include <sysinfo.h>
-#include <ipc/services.h>
-#include <libc.h>
-
+#include <macros.h>
+#include <errno.h>
 #include <sysinfo.h>
 #include <as.h>
 #include <ddi.h>
-
-#include <time.h>
-
-/* Pointers to public variables with time */
+#include <libc.h>
+
+/** Pointer to kernel shared variables with time */
 struct {
 	volatile sysarg_t seconds1;
@@ -59,6 +53,7 @@
 /** Add microseconds to given timeval.
  *
- * @param tv		Destination timeval.
- * @param usecs		Number of microseconds to add.
+ * @param tv    Destination timeval.
+ * @param usecs Number of microseconds to add.
+ *
  */
 void tv_add(struct timeval *tv, suseconds_t usecs)
@@ -66,4 +61,5 @@
 	tv->tv_sec += usecs / 1000000;
 	tv->tv_usec += usecs % 1000000;
+	
 	if (tv->tv_usec > 1000000) {
 		tv->tv_sec++;
@@ -74,104 +70,117 @@
 /** Subtract two timevals.
  *
- * @param tv1		First timeval.
- * @param tv2		Second timeval.
- *
- * @return		Return difference between tv1 and tv2 (tv1 - tv2) in
- * 			microseconds.
+ * @param tv1 First timeval.
+ * @param tv2 Second timeval.
+ *
+ * @return Difference between tv1 and tv2 (tv1 - tv2) in
+ *         microseconds.
+ *
  */
 suseconds_t tv_sub(struct timeval *tv1, struct timeval *tv2)
 {
-	suseconds_t result;
-
-	result = tv1->tv_usec - tv2->tv_usec;
-	result += (tv1->tv_sec - tv2->tv_sec) * 1000000;
-
-	return result;
+	return (tv1->tv_usec - tv2->tv_usec) +
+	    ((tv1->tv_sec - tv2->tv_sec) * 1000000);
 }
 
 /** Decide if one timeval is greater than the other.
  *
- * @param t1		First timeval.
- * @param t2		Second timeval.
- *
- * @return		Return true tv1 is greater than tv2. Otherwise return
- * 			false.
+ * @param t1 First timeval.
+ * @param t2 Second timeval.
+ *
+ * @return True if tv1 is greater than tv2.
+ * @return False otherwise.
+ *
  */
 int tv_gt(struct timeval *tv1, struct timeval *tv2)
 {
 	if (tv1->tv_sec > tv2->tv_sec)
-		return 1;
-	if (tv1->tv_sec == tv2->tv_sec && tv1->tv_usec > tv2->tv_usec)
-		return 1;
-	return 0;
+		return true;
+	
+	if ((tv1->tv_sec == tv2->tv_sec) && (tv1->tv_usec > tv2->tv_usec))
+		return true;
+	
+	return false;
 }
 
 /** Decide if one timeval is greater than or equal to the other.
  *
- * @param tv1		First timeval.
- * @param tv2		Second timeval.
- *
- * @return		Return true if tv1 is greater than or equal to tv2.
- * 			Otherwise return false.
+ * @param tv1 First timeval.
+ * @param tv2 Second timeval.
+ *
+ * @return True if tv1 is greater than or equal to tv2.
+ * @return False otherwise.
+ *
  */
 int tv_gteq(struct timeval *tv1, struct timeval *tv2)
 {
 	if (tv1->tv_sec > tv2->tv_sec)
-		return 1;
-	if (tv1->tv_sec == tv2->tv_sec && tv1->tv_usec >= tv2->tv_usec)
-		return 1;
-	return 0;
-}
-
-
-/** POSIX gettimeofday
- *
- * The time variables are memory mapped(RO) from kernel, which updates
- * them periodically. As it is impossible to read 2 values atomically, we
- * use a trick: First read a seconds, then read microseconds, then
- * read seconds again. If a second elapsed in the meantime, set it to zero. 
- * This provides assurance, that at least the
- * sequence of subsequent gettimeofday calls is ordered.
+		return true;
+	
+	if ((tv1->tv_sec == tv2->tv_sec) && (tv1->tv_usec >= tv2->tv_usec))
+		return true;
+	
+	return false;
+}
+
+/** Get time of day
+ *
+ * The time variables are memory mapped (read-only) from kernel which
+ * updates them periodically.
+ *
+ * As it is impossible to read 2 values atomically, we use a trick:
+ * First we read the seconds, then we read the microseconds, then we
+ * read the seconds again. If a second elapsed in the meantime, set
+ * the microseconds to zero.
+ *
+ * This assures that the values returned by two subsequent calls
+ * to gettimeofday() are monotonous.
+ *
  */
 int gettimeofday(struct timeval *tv, struct timezone *tz)
 {
-	void *mapping;
-	sysarg_t s1, s2;
-	int rights;
-	int res;
-
-	if (!ktime) {
-		mapping = as_get_mappable_page(PAGE_SIZE);
-		/* Get the mapping of kernel clock */
-		res = ipc_share_in_start_1_1(PHONE_NS, mapping, PAGE_SIZE,
-		    SERVICE_MEM_REALTIME, &rights);
-		if (res) {
-			printf("Failed to initialize timeofday memarea\n");
-			_exit(1);
+	if (ktime == NULL) {
+		uintptr_t faddr;
+		int rc = sysinfo_get_value("clock.faddr", &faddr);
+		if (rc != EOK) {
+			errno = rc;
+			return -1;
 		}
-		if (!(rights & AS_AREA_READ)) {
-			printf("Received bad rights on time area: %X\n",
-			    rights);
-			as_area_destroy(mapping);
-			_exit(1);
+		
+		void *addr = as_get_mappable_page(PAGE_SIZE);
+		if (addr == NULL) {
+			errno = ENOMEM;
+			return -1;
 		}
-		ktime = mapping;
-	}
+		
+		rc = physmem_map((void *) faddr, addr, 1,
+		    AS_AREA_READ | AS_AREA_CACHEABLE);
+		if (rc != EOK) {
+			as_area_destroy(addr);
+			errno = rc;
+			return -1;
+		}
+		
+		ktime = addr;
+	}
+	
 	if (tz) {
 		tz->tz_minuteswest = 0;
 		tz->tz_dsttime = DST_NONE;
 	}
-
-	s2 = ktime->seconds2;
+	
+	sysarg_t s2 = ktime->seconds2;
+	
 	read_barrier();
 	tv->tv_usec = ktime->useconds;
+	
 	read_barrier();
-	s1 = ktime->seconds1;
+	sysarg_t s1 = ktime->seconds1;
+	
 	if (s1 != s2) {
+		tv->tv_sec = max(s1, s2);
 		tv->tv_usec = 0;
-		tv->tv_sec = s1 > s2 ? s1 : s2;
 	} else
 		tv->tv_sec = s1;
-
+	
 	return 0;
 }
@@ -180,13 +189,16 @@
 {
 	struct timeval tv;
-
 	if (gettimeofday(&tv, NULL))
 		return (time_t) -1;
+	
 	if (tloc)
 		*tloc = tv.tv_sec;
+	
 	return tv.tv_sec;
 }
 
-/** Wait unconditionally for specified number of microseconds */
+/** Wait unconditionally for specified number of microseconds
+ *
+ */
 int usleep(useconds_t usec)
 {
@@ -195,15 +207,21 @@
 }
 
-/** Wait unconditionally for specified number of seconds */
+/** Wait unconditionally for specified number of seconds
+ *
+ */
 unsigned int sleep(unsigned int sec)
 {
-	/* Sleep in 1000 second steps to support
-	   full argument range */
+	/*
+	 * Sleep in 1000 second steps to support
+	 * full argument range
+	 */
+	
 	while (sec > 0) {
 		unsigned int period = (sec > 1000) ? 1000 : sec;
-	
+		
 		usleep(period * 1000000);
 		sec -= period;
 	}
+	
 	return 0;
 }
Index: uspace/lib/c/generic/udebug.c
===================================================================
--- uspace/lib/c/generic/udebug.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/generic/udebug.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -31,9 +31,8 @@
  */
 /** @file
- */ 
+ */
 
 #include <udebug.h>
 #include <sys/types.h>
-#include <ipc/ipc.h>
 #include <async.h>
 
Index: uspace/lib/c/generic/vfs/vfs.c
===================================================================
--- uspace/lib/c/generic/vfs/vfs.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/generic/vfs/vfs.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2008 Jakub Jermar 
+ * Copyright (c) 2008 Jakub Jermar
  * All rights reserved.
  *
@@ -43,6 +43,6 @@
 #include <sys/stat.h>
 #include <sys/types.h>
-#include <ipc/ipc.h>
 #include <ipc/services.h>
+#include <ipc/ns.h>
 #include <async.h>
 #include <fibril_synch.h>
@@ -118,8 +118,6 @@
 static void vfs_connect(void)
 {
-	while (vfs_phone < 0) {
-		vfs_phone = async_connect_me_to_blocking(PHONE_NS, SERVICE_VFS,
-		    0, 0);
-	}
+	while (vfs_phone < 0)
+		vfs_phone = service_connect_blocking(SERVICE_VFS, 0, 0);
 	
 	async_session_create(&vfs_session, vfs_phone, 0);
Index: uspace/lib/c/include/async.h
===================================================================
--- uspace/lib/c/include/async.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/include/async.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -33,8 +33,12 @@
  */
 
+#if ((defined(LIBC_IPC_H_)) && (!defined(LIBC_ASYNC_C_)))
+	#error Do not intermix low-level IPC interface and async framework
+#endif
+
 #ifndef LIBC_ASYNC_H_
 #define LIBC_ASYNC_H_
 
-#include <ipc/ipc.h>
+#include <ipc/common.h>
 #include <async_sess.h>
 #include <fibril.h>
@@ -42,4 +46,5 @@
 #include <atomic.h>
 #include <bool.h>
+#include <task.h>
 
 typedef ipc_callid_t aid_t;
@@ -50,20 +55,13 @@
 typedef void (*async_client_conn_t)(ipc_callid_t, ipc_call_t *);
 
-extern atomic_t async_futex;
-
 extern atomic_t threads_in_ipc_wait;
 
-extern int __async_init(void);
+#define async_manager() \
+	fibril_switch(FIBRIL_TO_MANAGER)
+
+#define async_get_call(data) \
+	async_get_call_timeout(data, 0)
+
 extern ipc_callid_t async_get_call_timeout(ipc_call_t *, suseconds_t);
-
-static inline ipc_callid_t async_get_call(ipc_call_t *data)
-{
-	return async_get_call_timeout(data, 0);
-}
-
-static inline void async_manager(void)
-{
-	fibril_switch(FIBRIL_TO_MANAGER);
-}
 
 /*
@@ -110,22 +108,38 @@
 extern void async_set_interrupt_received(async_client_conn_t);
 
-/* Wrappers for simple communication */
-#define async_msg_0(phone, method) \
-	ipc_call_async_0((phone), (method), NULL, NULL, true)
-#define async_msg_1(phone, method, arg1) \
-	ipc_call_async_1((phone), (method), (arg1), NULL, NULL, \
-	    true)
-#define async_msg_2(phone, method, arg1, arg2) \
-	ipc_call_async_2((phone), (method), (arg1), (arg2), NULL, NULL, \
-	    true)
-#define async_msg_3(phone, method, arg1, arg2, arg3) \
-	ipc_call_async_3((phone), (method), (arg1), (arg2), (arg3), NULL, NULL, \
-	    true)
-#define async_msg_4(phone, method, arg1, arg2, arg3, arg4) \
-	ipc_call_async_4((phone), (method), (arg1), (arg2), (arg3), (arg4), NULL, \
-	    NULL, true)
-#define async_msg_5(phone, method, arg1, arg2, arg3, arg4, arg5) \
-	ipc_call_async_5((phone), (method), (arg1), (arg2), (arg3), (arg4), \
-	    (arg5), NULL, NULL, true)
+/*
+ * Wrappers for simple communication.
+ */
+
+extern void async_msg_0(int, sysarg_t);
+extern void async_msg_1(int, sysarg_t, sysarg_t);
+extern void async_msg_2(int, sysarg_t, sysarg_t, sysarg_t);
+extern void async_msg_3(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t);
+extern void async_msg_4(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t, sysarg_t);
+extern void async_msg_5(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t, sysarg_t,
+    sysarg_t);
+
+/*
+ * Wrappers for answer routines.
+ */
+
+extern sysarg_t async_answer_0(ipc_callid_t, sysarg_t);
+extern sysarg_t async_answer_1(ipc_callid_t, sysarg_t, sysarg_t);
+extern sysarg_t async_answer_2(ipc_callid_t, sysarg_t, sysarg_t, sysarg_t);
+extern sysarg_t async_answer_3(ipc_callid_t, sysarg_t, sysarg_t, sysarg_t,
+    sysarg_t);
+extern sysarg_t async_answer_4(ipc_callid_t, sysarg_t, sysarg_t, sysarg_t,
+    sysarg_t, sysarg_t);
+extern sysarg_t async_answer_5(ipc_callid_t, sysarg_t, sysarg_t, sysarg_t,
+    sysarg_t, sysarg_t, sysarg_t);
+
+/*
+ * Wrappers for forwarding routines.
+ */
+
+extern int async_forward_fast(ipc_callid_t, int, sysarg_t, sysarg_t, sysarg_t,
+    unsigned int);
+extern int async_forward_slow(ipc_callid_t, int, sysarg_t, sysarg_t, sysarg_t,
+    sysarg_t, sysarg_t, sysarg_t, unsigned int);
 
 /*
@@ -135,4 +149,5 @@
  * and slow verion based on m.
  */
+
 #define async_req_0_0(phoneid, method) \
 	async_req_fast((phoneid), (method), 0, 0, 0, 0, NULL, NULL, NULL, NULL, \
@@ -266,10 +281,16 @@
 }
 
+extern int async_connect_to_me(int, sysarg_t, sysarg_t, sysarg_t,
+    async_client_conn_t);
 extern int async_connect_me_to(int, sysarg_t, sysarg_t, sysarg_t);
 extern int async_connect_me_to_blocking(int, sysarg_t, sysarg_t, sysarg_t);
+extern int async_connect_kbox(task_id_t);
+extern int async_hangup(int);
+extern void async_poke(void);
 
 /*
  * User-friendly wrappers for async_share_in_start().
  */
+
 #define async_share_in_start_0_0(phoneid, dst, size) \
 	async_share_in_start((phoneid), (dst), (size), 0, NULL)
@@ -281,9 +302,10 @@
 	async_share_in_start((phoneid), (dst), (size), (arg), (flags))
 
-extern int async_share_in_start(int, void *, size_t, sysarg_t, int *);
-extern int async_share_in_receive(ipc_callid_t *, size_t *);
-extern int async_share_in_finalize(ipc_callid_t, void *, int );
-extern int async_share_out_start(int, void *, int);
-extern int async_share_out_receive(ipc_callid_t *, size_t *, int *);
+extern int async_share_in_start(int, void *, size_t, sysarg_t, unsigned int *);
+extern bool async_share_in_receive(ipc_callid_t *, size_t *);
+extern int async_share_in_finalize(ipc_callid_t, void *, unsigned int);
+
+extern int async_share_out_start(int, void *, unsigned int);
+extern bool async_share_out_receive(ipc_callid_t *, size_t *, unsigned int *);
 extern int async_share_out_finalize(ipc_callid_t, void *);
 
@@ -291,4 +313,5 @@
  * User-friendly wrappers for async_data_read_forward_fast().
  */
+
 #define async_data_read_forward_0_0(phoneid, method, answer) \
 	async_data_read_forward_fast((phoneid), (method), 0, 0, 0, 0, NULL)
@@ -318,5 +341,5 @@
 
 extern int async_data_read_start(int, void *, size_t);
-extern int async_data_read_receive(ipc_callid_t *, size_t *);
+extern bool async_data_read_receive(ipc_callid_t *, size_t *);
 extern int async_data_read_finalize(ipc_callid_t, const void *, size_t);
 
@@ -327,4 +350,5 @@
  * User-friendly wrappers for async_data_write_forward_fast().
  */
+
 #define async_data_write_forward_0_0(phoneid, method, answer) \
 	async_data_write_forward_fast((phoneid), (method), 0, 0, 0, 0, NULL)
@@ -356,10 +380,10 @@
 
 extern int async_data_write_start(int, const void *, size_t);
-extern int async_data_write_receive(ipc_callid_t *, size_t *);
+extern bool async_data_write_receive(ipc_callid_t *, size_t *);
 extern int async_data_write_finalize(ipc_callid_t, void *, size_t);
 
 extern int async_data_write_accept(void **, const bool, const size_t,
     const size_t, const size_t, size_t *);
-extern void async_data_write_void(const int);
+extern void async_data_write_void(sysarg_t);
 
 extern int async_data_write_forward_fast(int, sysarg_t, sysarg_t, sysarg_t,
Index: pace/lib/c/include/async_priv.h
===================================================================
--- uspace/lib/c/include/async_priv.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ 	(revision )
@@ -1,87 +1,0 @@
-/*
- * Copyright (c) 2006 Ondrej Palkovsky
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup libc
- * @{
- */
-/** @file
- */
-
-#ifndef LIBC_ASYNC_PRIV_H_
-#define LIBC_ASYNC_PRIV_H_
-
-#include <adt/list.h>
-#include <fibril.h>
-#include <sys/time.h>
-#include <bool.h>
-
-/** Structures of this type are used to track the timeout events. */
-typedef struct {
-	/** If true, this struct is in the timeout list. */
-	bool inlist;
-	
-	/** Timeout list link. */
-	link_t link;
-	
-	/** If true, we have timed out. */
-	bool occurred;
-
-	/** Expiration time. */
-	struct timeval expires;
-} to_event_t;
-
-/** Structures of this type are used to track the wakeup events. */
-typedef struct {
-	/** If true, this struct is in a synchronization object wait queue. */
-	bool inlist;
-	
-	/** Wait queue linkage. */
-	link_t link;
-} wu_event_t;
-
-
-/** Structures of this type represent a waiting fibril. */
-typedef struct {
-	/** Identification of and link to the waiting fibril. */
-	fid_t fid;
-	
-	/** If true, this fibril is currently active. */
-	bool active;
-
-	/** Timeout wait data. */
-	to_event_t to_event;
-	/** Wakeup wait data. */
-	wu_event_t wu_event;
-} awaiter_t;
-
-extern void async_insert_timeout(awaiter_t *wd);
-
-#endif
-
-/** @}
- */
Index: uspace/lib/c/include/async_sess.h
===================================================================
--- uspace/lib/c/include/async_sess.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/include/async_sess.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -45,5 +45,4 @@
 } async_sess_t;
 
-extern void _async_sess_init(void);
 extern void async_session_create(async_sess_t *, int, sysarg_t);
 extern void async_session_destroy(async_sess_t *);
Index: uspace/lib/c/include/byteorder.h
===================================================================
--- uspace/lib/c/include/byteorder.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/include/byteorder.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -80,8 +80,8 @@
 #endif
 
-#define htons(n)	host2uint16_t_be((n))
-#define htonl(n)	host2uint32_t_be((n))
-#define ntohs(n)	uint16_t_be2host((n))
-#define ntohl(n)	uint32_t_be2host((n))
+#define htons(n)  host2uint16_t_be((n))
+#define htonl(n)  host2uint32_t_be((n))
+#define ntohs(n)  uint16_t_be2host((n))
+#define ntohl(n)  uint32_t_be2host((n))
 
 static inline uint64_t uint64_t_byteorder_swap(uint64_t n)
Index: uspace/lib/c/include/ddi.h
===================================================================
--- uspace/lib/c/include/ddi.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/include/ddi.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -36,4 +36,6 @@
 #define LIBC_DDI_H_
 
+#include <sys/types.h>
+#include <kernel/ddi/irq.h>
 #include <task.h>
 
@@ -42,4 +44,6 @@
 extern int iospace_enable(task_id_t, void *, unsigned long);
 extern int pio_enable(void *, size_t, void **);
+extern int register_irq(int, int, int, irq_code_t *);
+extern int unregister_irq(int, int);
 
 #endif
Index: uspace/lib/c/include/devman.h
===================================================================
--- uspace/lib/c/include/devman.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/include/devman.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -41,5 +41,4 @@
 #include <bool.h>
 
-
 extern int devman_get_phone(devman_interface_t, unsigned int);
 extern void devman_hangup_phone(devman_interface_t);
Index: uspace/lib/c/include/err.h
===================================================================
--- uspace/lib/c/include/err.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/include/err.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -39,8 +39,8 @@
 
 #define errx(status, fmt, ...) \
-	{ \
+	do { \
 		printf((fmt), ##__VA_ARGS__); \
-		_exit(status); \
-	}
+		exit(status); \
+	} while (0)
 
 #endif
Index: uspace/lib/c/include/errno.h
===================================================================
--- uspace/lib/c/include/errno.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/include/errno.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -39,7 +39,7 @@
 #include <fibril.h>
 
+#define errno _errno
+
 extern int _errno;
-
-#define errno _errno
 
 #define EMFILE        (-18)
@@ -57,36 +57,35 @@
 
 /** An API function is called while another blocking function is in progress. */
-#define EINPROGRESS	(-10036)
+#define EINPROGRESS  (-10036)
 
 /** The socket identifier is not valid. */
-#define ENOTSOCK	(-10038)
+#define ENOTSOCK  (-10038)
 
 /** The destination address required. */
-#define EDESTADDRREQ	(-10039)
+#define EDESTADDRREQ  (-10039)
 
 /** Protocol is not supported.  */
-#define EPROTONOSUPPORT	(-10043)
+#define EPROTONOSUPPORT  (-10043)
 
 /** Socket type is not supported. */
-#define ESOCKTNOSUPPORT	(-10044)
+#define ESOCKTNOSUPPORT  (-10044)
 
 /** Protocol family is not supported. */
-#define EPFNOSUPPORT	(-10046)
+#define EPFNOSUPPORT  (-10046)
 
 /** Address family is not supported. */
-#define EAFNOSUPPORT	(-10047)
+#define EAFNOSUPPORT  (-10047)
 
 /** Address is already in use. */
-#define EADDRINUSE	(-10048)
+#define EADDRINUSE  (-10048)
 
 /** The socket is not connected or bound. */
-#define ENOTCONN	(-10057)
+#define ENOTCONN  (-10057)
 
 /** The requested operation was not performed. Try again later. */
-#define EAGAIN		(-11002)
+#define EAGAIN  (-11002)
 
-/** No data.
- */
-#define NO_DATA		(-11004)
+/** No data. */
+#define NO_DATA (-11004)
 
 #endif
Index: uspace/lib/c/include/event.h
===================================================================
--- uspace/lib/c/include/event.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/include/event.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -37,5 +37,4 @@
 
 #include <kernel/ipc/event_types.h>
-#include <ipc/ipc.h>
 
 extern int event_subscribe(event_type_t, sysarg_t);
Index: uspace/lib/c/include/io/console.h
===================================================================
--- uspace/lib/c/include/io/console.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/include/io/console.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -36,5 +36,4 @@
 #define LIBC_IO_CONSOLE_H_
 
-#include <ipc/ipc.h>
 #include <bool.h>
 
Index: uspace/lib/c/include/io/screenbuffer.h
===================================================================
--- uspace/lib/c/include/io/screenbuffer.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/include/io/screenbuffer.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -38,5 +38,4 @@
 #include <stdint.h>
 #include <sys/types.h>
-#include <ipc/ipc.h>
 #include <bool.h>
 
Index: uspace/lib/c/include/ipc/adb.h
===================================================================
--- uspace/lib/c/include/ipc/adb.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/include/ipc/adb.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -32,15 +32,14 @@
 /** @file
  * @brief ADB device interface.
- */ 
+ */
 
 #ifndef LIBC_IPC_ADB_H_
 #define LIBC_IPC_ADB_H_
 
-#include <ipc/ipc.h>
+#include <ipc/common.h>
 
 typedef enum {
 	ADB_REG_WRITE = IPC_FIRST_USER_METHOD
 } adb_request_t;
-
 
 typedef enum {
Index: uspace/lib/c/include/ipc/arp.h
===================================================================
--- uspace/lib/c/include/ipc/arp.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/include/ipc/arp.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -39,5 +39,4 @@
 #define LIBC_ARP_MESSAGES_
 
-#include <ipc/ipc.h>
 #include <ipc/net.h>
 
Index: uspace/lib/c/include/ipc/bd.h
===================================================================
--- uspace/lib/c/include/ipc/bd.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/include/ipc/bd.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -31,10 +31,10 @@
  */
 /** @file
- */ 
+ */
 
 #ifndef LIBC_IPC_BD_H_
 #define LIBC_IPC_BD_H_
 
-#include <ipc/ipc.h>
+#include <ipc/common.h>
 
 typedef enum {
Index: uspace/lib/c/include/ipc/char.h
===================================================================
--- uspace/lib/c/include/ipc/char.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/include/ipc/char.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -32,15 +32,14 @@
 /** @file
  * @brief Character device interface.
- */ 
+ */
 
 #ifndef LIBC_IPC_CHAR_H_
 #define LIBC_IPC_CHAR_H_
 
-#include <ipc/ipc.h>
+#include <ipc/common.h>
 
 typedef enum {
 	CHAR_WRITE_BYTE = IPC_FIRST_USER_METHOD
 } char_request_t;
-
 
 typedef enum {
Index: uspace/lib/c/include/ipc/clipboard.h
===================================================================
--- uspace/lib/c/include/ipc/clipboard.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/include/ipc/clipboard.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -36,6 +36,4 @@
 #define LIBC_IPC_CLIPBOARD_H_
 
-#include <ipc/ipc.h>
-
 typedef enum {
 	CLIPBOARD_PUT_DATA = IPC_FIRST_USER_METHOD,
Index: uspace/lib/c/include/ipc/common.h
===================================================================
--- uspace/lib/c/include/ipc/common.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
+++ uspace/lib/c/include/ipc/common.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2011 Martin Decky
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libcipc
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBC_IPC_COMMON_H_
+#define LIBC_IPC_COMMON_H_
+
+#include <sys/types.h>
+#include <atomic.h>
+#include <kernel/ipc/ipc.h>
+
+#define IPC_FLAG_BLOCKING  0x01
+
+typedef struct {
+	sysarg_t args[IPC_CALL_LEN];
+	sysarg_t in_task_hash;
+	sysarg_t in_phone_hash;
+} ipc_call_t;
+
+typedef sysarg_t ipc_callid_t;
+
+extern atomic_t async_futex;
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/c/include/ipc/console.h
===================================================================
--- uspace/lib/c/include/ipc/console.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/include/ipc/console.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -36,5 +36,4 @@
 #define LIBC_IPC_CONSOLE_H_
 
-#include <ipc/ipc.h>
 #include <ipc/vfs.h>
 
Index: uspace/lib/c/include/ipc/dev_iface.h
===================================================================
--- uspace/lib/c/include/ipc/dev_iface.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/include/ipc/dev_iface.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -30,5 +30,4 @@
 #define LIBC_IPC_DEV_IFACE_H_
 
-#include <ipc/ipc.h>
 #include <malloc.h>
 #include <unistd.h>
Index: uspace/lib/c/include/ipc/devman.h
===================================================================
--- uspace/lib/c/include/ipc/devman.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/include/ipc/devman.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -30,15 +30,14 @@
  * @{
  */
- 
+
 #ifndef LIBC_IPC_DEVMAN_H_
 #define LIBC_IPC_DEVMAN_H_
 
+#include <ipc/common.h>
 #include <adt/list.h>
-#include <ipc/ipc.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <str.h>
+#include <malloc.h>
+#include <mem.h>
 
-#define DEVMAN_NAME_MAXLEN 256
+#define DEVMAN_NAME_MAXLEN  256
 
 typedef sysarg_t devman_handle_t;
@@ -67,6 +66,5 @@
 } match_id_list_t;
 
-
-static inline match_id_t * create_match_id()
+static inline match_id_t *create_match_id(void)
 {
 	match_id_t *id = malloc(sizeof(match_id_t));
@@ -85,8 +83,8 @@
 }
 
-static inline void add_match_id(match_id_list_t *ids, match_id_t *id) 
+static inline void add_match_id(match_id_list_t *ids, match_id_t *id)
 {
 	match_id_t *mid = NULL;
-	link_t *link = ids->ids.next;	
+	link_t *link = ids->ids.next;
 	
 	while (link != &ids->ids) {
@@ -98,5 +96,5 @@
 	}
 	
-	list_insert_before(&id->link, link);	
+	list_insert_before(&id->link, link);
 }
 
Index: uspace/lib/c/include/ipc/devmap.h
===================================================================
--- uspace/lib/c/include/ipc/devmap.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/include/ipc/devmap.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -34,7 +34,5 @@
 #define DEVMAP_DEVMAP_H_
 
-#include <atomic.h>
-#include <ipc/ipc.h>
-#include <adt/list.h>
+#include <ipc/common.h>
 
 #define DEVMAP_NAME_MAXLEN  255
Index: uspace/lib/c/include/ipc/fb.h
===================================================================
--- uspace/lib/c/include/ipc/fb.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/include/ipc/fb.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -31,10 +31,10 @@
  */
 /** @file
- */ 
+ */
 
 #ifndef LIBC_FB_H_
 #define LIBC_FB_H_
 
-#include <ipc/ipc.h>
+#include <ipc/common.h>
 
 typedef enum {
Index: uspace/lib/c/include/ipc/icmp.h
===================================================================
--- uspace/lib/c/include/ipc/icmp.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/include/ipc/icmp.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -39,9 +39,7 @@
 #define LIBC_ICMP_MESSAGES_
 
-#include <ipc/ipc.h>
 #include <ipc/net.h>
 #include <sys/types.h>
 #include <sys/time.h>
-
 #include <net/icmp_codes.h>
 
Index: uspace/lib/c/include/ipc/il.h
===================================================================
--- uspace/lib/c/include/ipc/il.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/include/ipc/il.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -40,5 +40,4 @@
 #define LIBC_IL_MESSAGES_H_
 
-#include <ipc/ipc.h>
 #include <ipc/net.h>
 
Index: uspace/lib/c/include/ipc/ip.h
===================================================================
--- uspace/lib/c/include/ipc/ip.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/include/ipc/ip.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -39,7 +39,5 @@
 #define LIBC_IP_MESSAGES_H_
 
-#include <ipc/ipc.h>
 #include <ipc/net.h>
-
 #include <net/in.h>
 #include <net/ip_codes.h>
Index: uspace/lib/c/include/ipc/ipc.h
===================================================================
--- uspace/lib/c/include/ipc/ipc.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/include/ipc/ipc.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -33,24 +33,17 @@
  */
 
-#ifndef LIBIPC_IPC_H_
-#define LIBIPC_IPC_H_
-
+#if ((defined(LIBC_ASYNC_H_)) && (!defined(LIBC_ASYNC_C_)))
+	#error Do not intermix low-level IPC interface and async framework
+#endif
+
+#ifndef LIBC_IPC_H_
+#define LIBC_IPC_H_
+
+#include <sys/types.h>
+#include <ipc/common.h>
+#include <kernel/synch/synch.h>
 #include <task.h>
-#include <kernel/ipc/ipc.h>
-#include <kernel/ddi/irq.h>
-#include <sys/types.h>
-#include <kernel/synch/synch.h>
-
-#define IPC_FLAG_BLOCKING  0x01
-
-typedef struct {
-	sysarg_t args[IPC_CALL_LEN];
-	sysarg_t in_task_hash;
-	sysarg_t in_phone_hash;
-} ipc_call_t;
-
-typedef sysarg_t ipc_callid_t;
-
-typedef void (* ipc_async_callback_t)(void *, int, ipc_call_t *);
+
+typedef void (*ipc_async_callback_t)(void *, int, ipc_call_t *);
 
 /*
@@ -60,4 +53,5 @@
  * possible, the fast version is used.
  */
+
 #define ipc_call_sync_0_0(phoneid, method) \
 	ipc_call_sync_fast((phoneid), (method), 0, 0, 0, 0, 0, 0, 0, 0)
@@ -189,13 +183,11 @@
     sysarg_t *);
 
-extern ipc_callid_t ipc_wait_cycle(ipc_call_t *, uint32_t, int);
-extern ipc_callid_t ipc_wait_for_call_timeout(ipc_call_t *, uint32_t);
+extern ipc_callid_t ipc_wait_cycle(ipc_call_t *, sysarg_t, unsigned int);
 extern void ipc_poke(void);
 
-static inline ipc_callid_t ipc_wait_for_call(ipc_call_t *data)
-{
-	return ipc_wait_for_call_timeout(data, SYNCH_NO_TIMEOUT);
-}
-
+#define ipc_wait_for_call(data) \
+	ipc_wait_for_call_timeout(data, SYNCH_NO_TIMEOUT);
+
+extern ipc_callid_t ipc_wait_for_call_timeout(ipc_call_t *, sysarg_t);
 extern ipc_callid_t ipc_trywait_for_call(ipc_call_t *);
 
@@ -206,4 +198,5 @@
  * to m.
  */
+
 #define ipc_answer_0(callid, retval) \
 	ipc_answer_fast((callid), (retval), 0, 0, 0, 0)
@@ -230,4 +223,5 @@
  * to m.
  */
+
 #define ipc_call_async_0(phoneid, method, private, callback, can_preempt) \
 	ipc_call_async_fast((phoneid), (method), 0, 0, 0, 0, (private), \
@@ -255,21 +249,24 @@
 
 extern void ipc_call_async_fast(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t,
-    sysarg_t, void *, ipc_async_callback_t, int);
+    sysarg_t, void *, ipc_async_callback_t, bool);
 extern void ipc_call_async_slow(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t,
-    sysarg_t, sysarg_t, void *, ipc_async_callback_t, int);
-
-extern int ipc_connect_to_me(int, int, int, int, sysarg_t *, sysarg_t *);
-extern int ipc_connect_me_to(int, int, int, int);
-extern int ipc_connect_me_to_blocking(int, int, int, int);
+    sysarg_t, sysarg_t, void *, ipc_async_callback_t, bool);
+
+extern int ipc_connect_to_me(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t *,
+    sysarg_t *);
+extern int ipc_connect_me_to(int, sysarg_t, sysarg_t, sysarg_t);
+extern int ipc_connect_me_to_blocking(int, sysarg_t, sysarg_t, sysarg_t);
+
 extern int ipc_hangup(int);
-extern int ipc_register_irq(int, int, int, irq_code_t *);
-extern int ipc_unregister_irq(int, int);
-extern int ipc_forward_fast(ipc_callid_t, int, int, sysarg_t, sysarg_t, int);
-extern int ipc_forward_slow(ipc_callid_t, int, int, sysarg_t, sysarg_t,
-    sysarg_t, sysarg_t, sysarg_t, int);
+
+extern int ipc_forward_fast(ipc_callid_t, int, sysarg_t, sysarg_t, sysarg_t,
+    unsigned int);
+extern int ipc_forward_slow(ipc_callid_t, int, sysarg_t, sysarg_t, sysarg_t,
+    sysarg_t, sysarg_t, sysarg_t, unsigned int);
 
 /*
  * User-friendly wrappers for ipc_share_in_start().
  */
+
 #define ipc_share_in_start_0_0(phoneid, dst, size) \
 	ipc_share_in_start((phoneid), (dst), (size), 0, NULL)
@@ -281,7 +278,7 @@
 	ipc_share_in_start((phoneid), (dst), (size), (arg), (flags))
 
-extern int ipc_share_in_start(int, void *, size_t, sysarg_t, int *);
-extern int ipc_share_in_finalize(ipc_callid_t, void *, int );
-extern int ipc_share_out_start(int, void *, int);
+extern int ipc_share_in_start(int, void *, size_t, sysarg_t, unsigned int *);
+extern int ipc_share_in_finalize(ipc_callid_t, void *, unsigned int);
+extern int ipc_share_out_start(int, void *, unsigned int);
 extern int ipc_share_out_finalize(ipc_callid_t, void *);
 extern int ipc_data_read_start(int, void *, size_t);
Index: uspace/lib/c/include/ipc/irc.h
===================================================================
--- uspace/lib/c/include/ipc/irc.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/include/ipc/irc.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -36,5 +36,5 @@
 #define LIBC_IRC_H_
 
-#include <ipc/ipc.h>
+#include <ipc/common.h>
 
 typedef enum {
Index: uspace/lib/c/include/ipc/kbd.h
===================================================================
--- uspace/lib/c/include/ipc/kbd.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/include/ipc/kbd.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -38,5 +38,5 @@
 #define LIBC_IPC_KBD_H_
 
-#include <ipc/ipc.h>
+#include <ipc/common.h>
 
 typedef enum {
Index: uspace/lib/c/include/ipc/loader.h
===================================================================
--- uspace/lib/c/include/ipc/loader.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/include/ipc/loader.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -31,10 +31,10 @@
  */
 /** @file
- */ 
+ */
 
 #ifndef LIBC_IPC_LOADER_H_
 #define LIBC_IPC_LOADER_H_
 
-#include <ipc/ipc.h>
+#include <ipc/common.h>
 
 typedef enum {
Index: uspace/lib/c/include/ipc/mouse.h
===================================================================
--- uspace/lib/c/include/ipc/mouse.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/include/ipc/mouse.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -37,5 +37,5 @@
 #define LIBC_IPC_MOUSE_H_
 
-#include <ipc/ipc.h>
+#include <ipc/common.h>
 
 typedef enum {
Index: uspace/lib/c/include/ipc/net.h
===================================================================
--- uspace/lib/c/include/ipc/net.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/include/ipc/net.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -38,7 +38,5 @@
 #define LIBC_NET_MESSAGES_H_
 
-#include <ipc/ipc.h>
 #include <ipc/services.h>
-
 #include <net/device.h>
 #include <net/packet.h>
Index: uspace/lib/c/include/ipc/net_net.h
===================================================================
--- uspace/lib/c/include/ipc/net_net.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/include/ipc/net_net.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -39,5 +39,4 @@
 #define LIBC_NET_NET_MESSAGES_H_
 
-#include <ipc/ipc.h>
 #include <ipc/net.h>
 
Index: uspace/lib/c/include/ipc/netif.h
===================================================================
--- uspace/lib/c/include/ipc/netif.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/include/ipc/netif.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -38,5 +38,4 @@
 #define LIBC_NETIF_MESSAGES_H_
 
-#include <ipc/ipc.h>
 #include <ipc/net.h>
 
Index: uspace/lib/c/include/ipc/nil.h
===================================================================
--- uspace/lib/c/include/ipc/nil.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/include/ipc/nil.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -38,5 +38,4 @@
 #define LIBC_NIL_MESSAGES_H_
 
-#include <ipc/ipc.h>
 #include <ipc/net.h>
 
Index: uspace/lib/c/include/ipc/ns.h
===================================================================
--- uspace/lib/c/include/ipc/ns.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/include/ipc/ns.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -33,8 +33,9 @@
  */
 
-#ifndef LIBIPC_NS_H_
-#define LIBIPC_NS_H_
+#ifndef LIBC_NS_H_
+#define LIBC_NS_H_
 
-#include <ipc/ipc.h>
+#include <sys/types.h>
+#include <ipc/common.h>
 
 typedef enum {
@@ -45,4 +46,8 @@
 } ns_request_t;
 
+extern int service_register(sysarg_t);
+extern int service_connect(sysarg_t, sysarg_t, sysarg_t);
+extern int service_connect_blocking(sysarg_t, sysarg_t, sysarg_t);
+
 #endif
 
Index: uspace/lib/c/include/ipc/packet.h
===================================================================
--- uspace/lib/c/include/ipc/packet.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/include/ipc/packet.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -38,5 +38,4 @@
 #define LIBC_PACKET_MESSAGES_
 
-#include <ipc/ipc.h>
 #include <ipc/net.h>
 
Index: uspace/lib/c/include/ipc/services.h
===================================================================
--- uspace/lib/c/include/ipc/services.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/include/ipc/services.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -35,6 +35,6 @@
  */
 
-#ifndef LIBIPC_SERVICES_H_
-#define LIBIPC_SERVICES_H_
+#ifndef LIBC_SERVICES_H_
+#define LIBC_SERVICES_H_
 
 typedef enum {
@@ -66,8 +66,4 @@
 } services_t;
 
-/* Memory area to be received from NS */
-#define SERVICE_MEM_REALTIME    1
-#define SERVICE_MEM_KLOG        2
-
 #endif
 
Index: uspace/lib/c/include/ipc/socket.h
===================================================================
--- uspace/lib/c/include/ipc/socket.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/include/ipc/socket.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -38,5 +38,4 @@
 #define LIBC_SOCKET_MESSAGES_H_
 
-#include <ipc/ipc.h>
 #include <ipc/net.h>
 
Index: uspace/lib/c/include/ipc/tl.h
===================================================================
--- uspace/lib/c/include/ipc/tl.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/include/ipc/tl.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -39,5 +39,4 @@
 #define LIBC_TL_MESSAGES_H_
 
-#include <ipc/ipc.h>
 #include <ipc/net.h>
 
Index: uspace/lib/c/include/ipc/vfs.h
===================================================================
--- uspace/lib/c/include/ipc/vfs.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/include/ipc/vfs.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -36,5 +36,5 @@
 #define LIBC_IPC_VFS_H_
 
-#include <ipc/ipc.h>
+#include <ipc/common.h>
 #include <sys/types.h>
 #include <bool.h>
Index: uspace/lib/c/include/libc.h
===================================================================
--- uspace/lib/c/include/libc.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/include/libc.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -62,7 +62,4 @@
 	__syscall6(p1, p2, p3, p4, p5, p6, id)
 
-extern void __main(void *pcb_ptr);
-extern void __exit(void);
-
 #endif
 
Index: uspace/lib/c/include/loader/pcb.h
===================================================================
--- uspace/lib/c/include/loader/pcb.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/include/loader/pcb.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -52,5 +52,5 @@
 	/** Program entry point. */
 	entry_point_t entry;
-
+	
 	/** Current working directory. */
 	char *cwd;
Index: uspace/lib/c/include/malloc.h
===================================================================
--- uspace/lib/c/include/malloc.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/include/malloc.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -38,5 +38,4 @@
 #include <sys/types.h>
 
-extern void __heap_init(void);
 extern uintptr_t get_max_heap_addr(void);
 
Index: uspace/lib/c/include/net/modules.h
===================================================================
--- uspace/lib/c/include/net/modules.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/include/net/modules.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -43,8 +43,5 @@
 
 #include <async.h>
-
-#include <ipc/ipc.h>
 #include <ipc/services.h>
-
 #include <sys/time.h>
 
Index: uspace/lib/c/include/setjmp.h
===================================================================
--- uspace/lib/c/include/setjmp.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/include/setjmp.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -41,5 +41,5 @@
 
 extern int setjmp(jmp_buf env);
-extern void longjmp(jmp_buf env,int val) __attribute__((__noreturn__));
+extern void longjmp(jmp_buf env, int val) __attribute__((noreturn));
 
 #endif
Index: uspace/lib/c/include/stdlib.h
===================================================================
--- uspace/lib/c/include/stdlib.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/include/stdlib.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -40,29 +40,13 @@
 #include <stacktrace.h>
 
-#define abort() \
-	do { \
-		stacktrace_print(); \
-		_exit(1); \
-	} while (0)
+#define RAND_MAX  714025
 
-#define core() \
-	*((int *) 0) = 0xbadbad;
-
-#define exit(status)  _exit((status))
-
-#define RAND_MAX  714025
+#define rand()       random()
+#define srand(seed)  srandom(seed)
 
 extern long int random(void);
 extern void srandom(unsigned int seed);
 
-static inline int rand(void)
-{
-	return random();
-}
-
-static inline void srand(unsigned int seed)
-{
-	srandom(seed);
-}
+extern void abort(void) __attribute__((noreturn));
 
 #endif
Index: uspace/lib/c/include/syscall.h
===================================================================
--- uspace/lib/c/include/syscall.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/include/syscall.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -32,7 +32,7 @@
 /**
  * @file
- * @brief	Syscall function declaration for architectures that don't
- *		inline syscalls or architectures that handle syscalls
- *		according to the number of arguments.
+ * @brief Syscall function declaration for architectures that don't
+ *        inline syscalls or architectures that handle syscalls
+ *        according to the number of arguments.
  */
 
@@ -40,6 +40,6 @@
 #define LIBC_SYSCALL_H_
 
-#ifndef	LIBARCH_SYSCALL_GENERIC
-#error "You can't include this file directly."
+#ifndef LIBARCH_SYSCALL_GENERIC
+	#error You cannot include this file directly
 #endif
 
@@ -47,11 +47,11 @@
 #include <kernel/syscall/syscall.h>
 
-#define __syscall0	__syscall
-#define __syscall1	__syscall
-#define __syscall2	__syscall
-#define __syscall3	__syscall
-#define __syscall4	__syscall
-#define __syscall5	__syscall
-#define __syscall6	__syscall
+#define __syscall0  __syscall
+#define __syscall1  __syscall
+#define __syscall2  __syscall
+#define __syscall3  __syscall
+#define __syscall4  __syscall
+#define __syscall5  __syscall
+#define __syscall6  __syscall
 
 extern sysarg_t __syscall(const sysarg_t p1, const sysarg_t p2,
Index: uspace/lib/c/include/thread.h
===================================================================
--- uspace/lib/c/include/thread.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/include/thread.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -36,5 +36,4 @@
 #define LIBC_THREAD_H_
 
-#include <kernel/proc/uarg.h>
 #include <libarch/thread.h>
 #include <sys/types.h>
@@ -42,9 +41,6 @@
 typedef uint64_t thread_id_t;
 
-extern void __thread_entry(void);
-extern void __thread_main(uspace_arg_t *);
-
 extern int thread_create(void (*)(void *), void *, const char *, thread_id_t *);
-extern void thread_exit(int) __attribute__ ((noreturn));
+extern void thread_exit(int) __attribute__((noreturn));
 extern void thread_detach(thread_id_t);
 extern int thread_join(thread_id_t);
Index: uspace/lib/c/include/tls.h
===================================================================
--- uspace/lib/c/include/tls.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/include/tls.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -57,4 +57,5 @@
 extern void tls_free_variant_1(tcb_t *, size_t);
 #endif
+
 #ifdef CONFIG_TLS_VARIANT_2
 extern tcb_t *tls_alloc_variant_2(void **, size_t);
Index: uspace/lib/c/include/udebug.h
===================================================================
--- uspace/lib/c/include/udebug.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/include/udebug.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -38,23 +38,18 @@
 #include <kernel/udebug/udebug.h>
 #include <sys/types.h>
-#include <libarch/types.h>
 
 typedef sysarg_t thash_t;
 
-int udebug_begin(int phoneid);
-int udebug_end(int phoneid);
-int udebug_set_evmask(int phoneid, udebug_evmask_t mask);
-int udebug_thread_read(int phoneid, void *buffer, size_t n,
-	size_t *copied, size_t *needed);
-int udebug_name_read(int phoneid, void *buffer, size_t n,
-	size_t *copied, size_t *needed);
-int udebug_areas_read(int phoneid, void *buffer, size_t n,
-	size_t *copied, size_t *needed);
-int udebug_mem_read(int phoneid, void *buffer, uintptr_t addr, size_t n);
-int udebug_args_read(int phoneid, thash_t tid, sysarg_t *buffer);
-int udebug_regs_read(int phoneid, thash_t tid, void *buffer);
-int udebug_go(int phoneid, thash_t tid, udebug_event_t *ev_type,
-	sysarg_t *val0, sysarg_t *val1);
-int udebug_stop(int phoneid, thash_t tid);
+int udebug_begin(int);
+int udebug_end(int);
+int udebug_set_evmask(int, udebug_evmask_t);
+int udebug_thread_read(int, void *, size_t , size_t *, size_t *);
+int udebug_name_read(int, void *, size_t, size_t *, size_t *);
+int udebug_areas_read(int, void *, size_t, size_t *, size_t *);
+int udebug_mem_read(int, void *, uintptr_t, size_t);
+int udebug_args_read(int, thash_t, sysarg_t *);
+int udebug_regs_read(int, thash_t, void *);
+int udebug_go(int, thash_t, udebug_event_t *, sysarg_t *, sysarg_t *);
+int udebug_stop(int, thash_t);
 
 #endif
Index: uspace/lib/c/include/unistd.h
===================================================================
--- uspace/lib/c/include/unistd.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/include/unistd.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -41,5 +41,5 @@
 
 #ifndef NULL
-	#define NULL	((void *) 0)
+	#define NULL  ((void *) 0)
 #endif
 
@@ -74,5 +74,5 @@
 extern int chdir(const char *);
 
-extern void _exit(int) __attribute__((noreturn));
+extern void exit(int) __attribute__((noreturn));
 extern int usleep(useconds_t);
 extern unsigned int sleep(unsigned int);
Index: uspace/lib/c/include/vfs/vfs.h
===================================================================
--- uspace/lib/c/include/vfs/vfs.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/c/include/vfs/vfs.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -57,7 +57,4 @@
 extern int unmount(const char *);
 
-extern void __stdio_init(int filc, fdi_node_t *filv[]);
-extern void __stdio_done(void);
-
 extern int open_node(fdi_node_t *, int);
 extern int fd_phone(int);
Index: uspace/lib/clui/tinput.h
===================================================================
--- uspace/lib/clui/tinput.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/clui/tinput.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -36,6 +36,4 @@
 #ifndef LIBCLUI_TINPUT_H_
 #define LIBCLUI_TINPUT_H_
-
-#include <ipc/ipc.h>
 
 #define HISTORY_LEN     10
Index: uspace/lib/drv/generic/driver.c
===================================================================
--- uspace/lib/drv/generic/driver.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/drv/generic/driver.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -186,5 +186,5 @@
 		pseudocode = &default_pseudocode;
 	
-	int res = ipc_register_irq(irq, dev->handle, ctx->id, pseudocode);
+	int res = register_irq(irq, dev->handle, ctx->id, pseudocode);
 	if (res != EOK) {
 		remove_interrupt_context(&interrupt_contexts, ctx);
@@ -199,5 +199,5 @@
 	interrupt_context_t *ctx = find_interrupt_context(&interrupt_contexts,
 	    dev, irq);
-	int res = ipc_unregister_irq(irq, dev->handle);
+	int res = unregister_irq(irq, dev->handle);
 	
 	if (ctx != NULL) {
@@ -272,5 +272,5 @@
 	}
 	
-	ipc_answer_0(iid, res);
+	async_answer_0(iid, res);
 }
 
@@ -278,5 +278,5 @@
 {
 	/* Accept connection */
-	ipc_answer_0(iid, EOK);
+	async_answer_0(iid, EOK);
 	
 	bool cont = true;
@@ -293,5 +293,5 @@
 			break;
 		default:
-			ipc_answer_0(callid, ENOENT);
+			async_answer_0(callid, ENOENT);
 		}
 	}
@@ -316,5 +316,5 @@
 		printf("%s: driver_connection_gen error - no device with handle"
 		    " %" PRIun " was found.\n", driver->name, handle);
-		ipc_answer_0(iid, ENOENT);
+		async_answer_0(iid, ENOENT);
 		return;
 	}
@@ -331,5 +331,5 @@
 		ret = (*dev->ops->open)(dev);
 	
-	ipc_answer_0(iid, ret);
+	async_answer_0(iid, ret);
 	if (ret != EOK)
 		return;
@@ -347,5 +347,5 @@
 			if (dev->ops != NULL && dev->ops->close != NULL)
 				(*dev->ops->close)(dev);
-			ipc_answer_0(callid, EOK);
+			async_answer_0(callid, EOK);
 			return;
 		default:
@@ -368,5 +368,5 @@
 				    "invalid interface id %d.",
 				    driver->name, iface_idx);
-				ipc_answer_0(callid, ENOTSUP);
+				async_answer_0(callid, ENOTSUP);
 				break;
 			}
@@ -381,5 +381,5 @@
 				printf("device with handle %" PRIun " has no interface "
 				    "with id %d.\n", handle, iface_idx);
-				ipc_answer_0(callid, ENOTSUP);
+				async_answer_0(callid, ENOTSUP);
 				break;
 			}
@@ -400,5 +400,5 @@
 				printf("%s: driver_connection_gen error - "
 				    "invalid interface method.", driver->name);
-				ipc_answer_0(callid, ENOTSUP);
+				async_answer_0(callid, ENOTSUP);
 				break;
 			}
@@ -446,5 +446,5 @@
 	default:
 		/* No such interface */
-		ipc_answer_0(iid, ENOENT);
+		async_answer_0(iid, ENOENT);
 	}
 }
Index: uspace/lib/drv/generic/remote_char_dev.c
===================================================================
--- uspace/lib/drv/generic/remote_char_dev.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/drv/generic/remote_char_dev.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -33,5 +33,4 @@
  */
 
-#include <ipc/ipc.h>
 #include <async.h>
 #include <errno.h>
@@ -81,5 +80,5 @@
 	if (!async_data_read_receive(&cid, &len)) {
 		/* TODO handle protocol error. */
-		ipc_answer_0(callid, EINVAL);
+		async_answer_0(callid, EINVAL);
 		return;
 	}
@@ -87,5 +86,5 @@
 	if (!char_dev_ops->read) {
 		async_data_read_finalize(cid, NULL, 0);
-		ipc_answer_0(callid, ENOTSUP);
+		async_answer_0(callid, ENOTSUP);
 		return;
 	}
@@ -100,5 +99,5 @@
 		/* Some error occured. */
 		async_data_read_finalize(cid, buf, 0);
-		ipc_answer_0(callid, ret);
+		async_answer_0(callid, ret);
 		return;
 	}
@@ -106,5 +105,5 @@
 	/* The operation was successful, return the number of data read. */
 	async_data_read_finalize(cid, buf, ret);
-	ipc_answer_1(callid, EOK, ret);
+	async_answer_1(callid, EOK, ret);
 }
 
@@ -128,5 +127,5 @@
 	if (!async_data_write_receive(&cid, &len)) {
 		/* TODO handle protocol error. */
-		ipc_answer_0(callid, EINVAL);
+		async_answer_0(callid, EINVAL);
 		return;
 	}
@@ -134,5 +133,5 @@
 	if (!char_dev_ops->write) {
 		async_data_write_finalize(cid, NULL, 0);
-		ipc_answer_0(callid, ENOTSUP);
+		async_answer_0(callid, ENOTSUP);
 		return;
 	}
@@ -148,5 +147,5 @@
 	if (ret < 0) {
 		/* Some error occured. */
-		ipc_answer_0(callid, ret);
+		async_answer_0(callid, ret);
 	} else {
 		/*
@@ -154,5 +153,5 @@
 		 * written.
 		 */
-		ipc_answer_1(callid, EOK, ret);
+		async_answer_1(callid, EOK, ret);
 	}
 }
Index: uspace/lib/drv/generic/remote_hw_res.c
===================================================================
--- uspace/lib/drv/generic/remote_hw_res.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/drv/generic/remote_hw_res.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -33,5 +33,4 @@
  */
 
-#include <ipc/ipc.h>
 #include <async.h>
 #include <errno.h>
@@ -62,9 +61,9 @@
 	
 	if (hw_res_ops->enable_interrupt == NULL)
-		ipc_answer_0(callid, ENOTSUP);
+		async_answer_0(callid, ENOTSUP);
 	else if (hw_res_ops->enable_interrupt(dev))
-		ipc_answer_0(callid, EOK);
+		async_answer_0(callid, EOK);
 	else
-		ipc_answer_0(callid, EREFUSED);
+		async_answer_0(callid, EREFUSED);
 }
 
@@ -75,5 +74,5 @@
 
 	if (hw_res_ops->get_resource_list == NULL) {
-		ipc_answer_0(callid, ENOTSUP);
+		async_answer_0(callid, ENOTSUP);
 		return;
 	}
@@ -81,9 +80,9 @@
 	hw_resource_list_t *hw_resources = hw_res_ops->get_resource_list(dev);
 	if (hw_resources == NULL){
-		ipc_answer_0(callid, ENOENT);
+		async_answer_0(callid, ENOENT);
 		return;
 	}
 	
-	ipc_answer_1(callid, EOK, hw_resources->count);
+	async_answer_1(callid, EOK, hw_resources->count);
 
 	size_t len;
Index: uspace/lib/drv/include/dev_iface.h
===================================================================
--- uspace/lib/drv/include/dev_iface.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/drv/include/dev_iface.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -36,4 +36,5 @@
 #define LIBDRV_DEV_IFACE_H_
 
+#include <ipc/common.h>
 #include <ipc/dev_iface.h>
 
Index: uspace/lib/drv/include/driver.h
===================================================================
--- uspace/lib/drv/include/driver.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/drv/include/driver.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -36,6 +36,6 @@
 #define LIBDRV_DRIVER_H_
 
+#include <kernel/ddi/irq.h>
 #include <adt/list.h>
-#include <ipc/ipc.h>
 #include <devman.h>
 #include <ipc/devman.h>
Index: uspace/lib/fs/libfs.c
===================================================================
--- uspace/lib/fs/libfs.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/fs/libfs.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -40,5 +40,4 @@
 #include <errno.h>
 #include <async.h>
-#include <ipc/ipc.h>
 #include <as.h>
 #include <assert.h>
@@ -58,5 +57,5 @@
 #define answer_and_return(rid, rc) \
 	do { \
-		ipc_answer_0((rid), (rc)); \
+		async_answer_0((rid), (rc)); \
 		return; \
 	} while (0)
@@ -102,6 +101,5 @@
 	 * Ask VFS for callback connection.
 	 */
-	sysarg_t taskhash;
-	ipc_connect_to_me(vfs_phone, 0, 0, 0, &taskhash, &reg->vfs_phonehash);
+	async_connect_to_me(vfs_phone, 0, 0, 0, conn);
 	
 	/*
@@ -128,9 +126,4 @@
 	async_wait_for(req, NULL);
 	reg->fs_handle = (int) IPC_GET_ARG1(answer);
-	
-	/*
-	 * Create a connection fibril to handle the callback connection.
-	 */
-	async_new_connection(taskhash, reg->vfs_phonehash, 0, NULL, conn);
 	
 	/*
@@ -166,26 +159,26 @@
 	if ((IPC_GET_IMETHOD(call) != IPC_M_CONNECTION_CLONE) ||
 	    (mountee_phone < 0)) {
-		ipc_answer_0(callid, EINVAL);
-		ipc_answer_0(rid, EINVAL);
+		async_answer_0(callid, EINVAL);
+		async_answer_0(rid, EINVAL);
 		return;
 	}
 	
 	/* Acknowledge the mountee_phone */
-	ipc_answer_0(callid, EOK);
+	async_answer_0(callid, EOK);
 	
 	fs_node_t *fn;
 	res = ops->node_get(&fn, mp_devmap_handle, mp_fs_index);
 	if ((res != EOK) || (!fn)) {
-		ipc_hangup(mountee_phone);
+		async_hangup(mountee_phone);
 		async_data_write_void(combine_rc(res, ENOENT));
-		ipc_answer_0(rid, combine_rc(res, ENOENT));
+		async_answer_0(rid, combine_rc(res, ENOENT));
 		return;
 	}
 	
 	if (fn->mp_data.mp_active) {
-		ipc_hangup(mountee_phone);
+		async_hangup(mountee_phone);
 		(void) ops->node_put(fn);
 		async_data_write_void(EBUSY);
-		ipc_answer_0(rid, EBUSY);
+		async_answer_0(rid, EBUSY);
 		return;
 	}
@@ -193,8 +186,8 @@
 	rc = async_req_0_0(mountee_phone, IPC_M_CONNECT_ME);
 	if (rc != EOK) {
-		ipc_hangup(mountee_phone);
+		async_hangup(mountee_phone);
 		(void) ops->node_put(fn);
 		async_data_write_void(rc);
-		ipc_answer_0(rid, rc);
+		async_answer_0(rid, rc);
 		return;
 	}
@@ -214,5 +207,5 @@
 	 * Do not release the FS node so that it stays in memory.
 	 */
-	ipc_answer_3(rid, rc, IPC_GET_ARG1(answer), IPC_GET_ARG2(answer),
+	async_answer_3(rid, rc, IPC_GET_ARG1(answer), IPC_GET_ARG2(answer),
 	    IPC_GET_ARG3(answer));
 }
@@ -227,5 +220,5 @@
 	res = ops->node_get(&fn, mp_devmap_handle, mp_fs_index);
 	if ((res != EOK) || (!fn)) {
-		ipc_answer_0(rid, combine_rc(res, ENOENT));
+		async_answer_0(rid, combine_rc(res, ENOENT));
 		return;
 	}
@@ -236,5 +229,5 @@
 	if (!fn->mp_data.mp_active) {
 		(void) ops->node_put(fn);
-		ipc_answer_0(rid, EINVAL);
+		async_answer_0(rid, EINVAL);
 		return;
 	}
@@ -250,5 +243,5 @@
 	 */
 	if (res == EOK) {
-		ipc_hangup(fn->mp_data.phone);
+		async_hangup(fn->mp_data.phone);
 		fn->mp_data.mp_active = false;
 		fn->mp_data.fs_handle = 0;
@@ -260,5 +253,5 @@
 
 	(void) ops->node_put(fn);
-	ipc_answer_0(rid, res);
+	async_answer_0(rid, res);
 }
 
@@ -300,5 +293,5 @@
 	
 	if (cur->mp_data.mp_active) {
-		ipc_forward_slow(rid, cur->mp_data.phone, VFS_OUT_LOOKUP,
+		async_forward_slow(rid, cur->mp_data.phone, VFS_OUT_LOOKUP,
 		    next, last, cur->mp_data.devmap_handle, lflag, index,
 		    IPC_FF_ROUTE_FROM_ME);
@@ -324,5 +317,5 @@
 			if (len + 1 == NAME_MAX) {
 				/* Component length overflow */
-				ipc_answer_0(rid, ENAMETOOLONG);
+				async_answer_0(rid, ENAMETOOLONG);
 				goto out;
 			}
@@ -358,5 +351,5 @@
 				next--;
 			
-			ipc_forward_slow(rid, tmp->mp_data.phone,
+			async_forward_slow(rid, tmp->mp_data.phone,
 			    VFS_OUT_LOOKUP, next, last, tmp->mp_data.devmap_handle,
 			    lflag, index, IPC_FF_ROUTE_FROM_ME);
@@ -372,5 +365,5 @@
 			if (next <= last) {
 				/* There are unprocessed components */
-				ipc_answer_0(rid, ENOENT);
+				async_answer_0(rid, ENOENT);
 				goto out;
 			}
@@ -380,5 +373,5 @@
 				/* Request to create a new link */
 				if (!ops->is_directory(cur)) {
-					ipc_answer_0(rid, ENOTDIR);
+					async_answer_0(rid, ENOTDIR);
 					goto out;
 				}
@@ -398,8 +391,8 @@
 						if (lflag & L_CREATE)
 							(void) ops->destroy(fn);
-						ipc_answer_0(rid, rc);
+						async_answer_0(rid, rc);
 					} else {
 						aoff64_t size = ops->size_get(fn);
-						ipc_answer_5(rid, fs_handle,
+						async_answer_5(rid, fs_handle,
 						    devmap_handle,
 						    ops->index_get(fn),
@@ -410,10 +403,10 @@
 					}
 				} else
-					ipc_answer_0(rid, ENOSPC);
+					async_answer_0(rid, ENOSPC);
 				
 				goto out;
 			}
 			
-			ipc_answer_0(rid, ENOENT);
+			async_answer_0(rid, ENOENT);
 			goto out;
 		}
@@ -441,5 +434,5 @@
 		if (lflag & (L_CREATE | L_LINK)) {
 			if (!ops->is_directory(cur)) {
-				ipc_answer_0(rid, ENOTDIR);
+				async_answer_0(rid, ENOTDIR);
 				goto out;
 			}
@@ -450,5 +443,5 @@
 				if (ops->plb_get_char(next) == '/') {
 					/* More than one component */
-					ipc_answer_0(rid, ENOENT);
+					async_answer_0(rid, ENOENT);
 					goto out;
 				}
@@ -456,5 +449,5 @@
 				if (len + 1 == NAME_MAX) {
 					/* Component length overflow */
-					ipc_answer_0(rid, ENAMETOOLONG);
+					async_answer_0(rid, ENAMETOOLONG);
 					goto out;
 				}
@@ -480,8 +473,8 @@
 					if (lflag & L_CREATE)
 						(void) ops->destroy(fn);
-					ipc_answer_0(rid, rc);
+					async_answer_0(rid, rc);
 				} else {
 					aoff64_t size = ops->size_get(fn);
-					ipc_answer_5(rid, fs_handle,
+					async_answer_5(rid, fs_handle,
 					    devmap_handle,
 					    ops->index_get(fn),
@@ -492,10 +485,10 @@
 				}
 			} else
-				ipc_answer_0(rid, ENOSPC);
+				async_answer_0(rid, ENOSPC);
 			
 			goto out;
 		}
 		
-		ipc_answer_0(rid, ENOENT);
+		async_answer_0(rid, ENOENT);
 		goto out;
 	}
@@ -510,9 +503,9 @@
 		if (rc == EOK) {
 			aoff64_t size = ops->size_get(cur);
-			ipc_answer_5(rid, fs_handle, devmap_handle,
+			async_answer_5(rid, fs_handle, devmap_handle,
 			    ops->index_get(cur), LOWER32(size), UPPER32(size),
 			    old_lnkcnt);
 		} else
-			ipc_answer_0(rid, rc);
+			async_answer_0(rid, rc);
 		
 		goto out;
@@ -521,20 +514,20 @@
 	if (((lflag & (L_CREATE | L_EXCLUSIVE)) == (L_CREATE | L_EXCLUSIVE)) ||
 	    (lflag & L_LINK)) {
-		ipc_answer_0(rid, EEXIST);
+		async_answer_0(rid, EEXIST);
 		goto out;
 	}
 	
 	if ((lflag & L_FILE) && (ops->is_directory(cur))) {
-		ipc_answer_0(rid, EISDIR);
+		async_answer_0(rid, EISDIR);
 		goto out;
 	}
 	
 	if ((lflag & L_DIRECTORY) && (ops->is_file(cur))) {
-		ipc_answer_0(rid, ENOTDIR);
+		async_answer_0(rid, ENOTDIR);
 		goto out;
 	}
 
 	if ((lflag & L_ROOT) && par) {
-		ipc_answer_0(rid, EINVAL);
+		async_answer_0(rid, EINVAL);
 		goto out;
 	}
@@ -548,12 +541,12 @@
 		if (rc == EOK) {
 			aoff64_t size = ops->size_get(cur);
-			ipc_answer_5(rid, fs_handle, devmap_handle,
+			async_answer_5(rid, fs_handle, devmap_handle,
 			    ops->index_get(cur), LOWER32(size), UPPER32(size),
 			    ops->lnkcnt_get(cur));
 		} else
-			ipc_answer_0(rid, rc);
+			async_answer_0(rid, rc);
 		
 	} else
-		ipc_answer_0(rid, rc);
+		async_answer_0(rid, rc);
 	
 out:
@@ -584,6 +577,6 @@
 	    (size != sizeof(struct stat))) {
 		ops->node_put(fn);
-		ipc_answer_0(callid, EINVAL);
-		ipc_answer_0(rid, EINVAL);
+		async_answer_0(callid, EINVAL);
+		async_answer_0(rid, EINVAL);
 		return;
 	}
@@ -604,5 +597,5 @@
 	
 	async_data_read_finalize(callid, &stat, sizeof(struct stat));
-	ipc_answer_0(rid, EOK);
+	async_answer_0(rid, EOK);
 }
 
@@ -626,5 +619,5 @@
 	
 	if (fn == NULL) {
-		ipc_answer_0(rid, ENOENT);
+		async_answer_0(rid, ENOENT);
 		return;
 	}
@@ -632,5 +625,5 @@
 	rc = ops->node_open(fn);
 	aoff64_t size = ops->size_get(fn);
-	ipc_answer_4(rid, rc, LOWER32(size), UPPER32(size), ops->lnkcnt_get(fn),
+	async_answer_4(rid, rc, LOWER32(size), UPPER32(size), ops->lnkcnt_get(fn),
 	    (ops->is_file(fn) ? L_FILE : 0) | (ops->is_directory(fn) ? L_DIRECTORY : 0));
 	
Index: uspace/lib/fs/libfs.h
===================================================================
--- uspace/lib/fs/libfs.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/fs/libfs.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -39,5 +39,4 @@
 #include <ipc/vfs.h>
 #include <stdint.h>
-#include <ipc/ipc.h>
 #include <async.h>
 #include <devmap.h>
@@ -86,5 +85,4 @@
 typedef struct {
 	int fs_handle;           /**< File system handle. */
-	sysarg_t vfs_phonehash;  /**< Initial VFS phonehash. */
 	uint8_t *plb_ro;         /**< Read-only PLB view. */
 } fs_reg_t;
Index: uspace/lib/net/generic/generic.c
===================================================================
--- uspace/lib/net/generic/generic.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/net/generic/generic.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -36,9 +36,6 @@
 
 #include <generic.h>
-
 #include <async.h>
-#include <ipc/ipc.h>
 #include <ipc/services.h>
-
 #include <net/device.h>
 #include <adt/measured_strings.h>
Index: uspace/lib/net/generic/packet_remote.c
===================================================================
--- uspace/lib/net/generic/packet_remote.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/net/generic/packet_remote.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -38,5 +38,4 @@
 #include <async.h>
 #include <errno.h>
-#include <ipc/ipc.h>
 #include <ipc/packet.h>
 #include <sys/mman.h>
Index: uspace/lib/net/il/arp_remote.c
===================================================================
--- uspace/lib/net/il/arp_remote.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/net/il/arp_remote.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -41,5 +41,4 @@
 #include <async.h>
 #include <errno.h>
-#include <ipc/ipc.h>
 #include <ipc/services.h>
 #include <ipc/arp.h>
Index: uspace/lib/net/il/il_skel.c
===================================================================
--- uspace/lib/net/il/il_skel.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/net/il/il_skel.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -54,5 +54,5 @@
 	 * the initial IPC_M_CONNECT_ME_TO call.
 	 */
-	ipc_answer_0(iid, EOK);
+	async_answer_0(iid, EOK);
 	
 	while (true) {
@@ -115,5 +115,5 @@
 		goto out;
 	
-	rc = ipc_connect_to_me(PHONE_NS, service, 0, 0, NULL, NULL);
+	rc = async_connect_to_me(PHONE_NS, service, 0, 0, NULL);
 	if (rc != EOK)
 		goto out;
Index: uspace/lib/net/include/generic.h
===================================================================
--- uspace/lib/net/include/generic.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/net/include/generic.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -39,5 +39,4 @@
 
 #include <async.h>
-#include <ipc/ipc.h>
 #include <ipc/services.h>
 
Index: uspace/lib/net/include/il_skel.h
===================================================================
--- uspace/lib/net/include/il_skel.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/net/include/il_skel.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -41,5 +41,4 @@
 #include <async.h>
 #include <fibril_synch.h>
-#include <ipc/ipc.h>
 #include <ipc/services.h>
 
Index: uspace/lib/net/include/netif_skel.h
===================================================================
--- uspace/lib/net/include/netif_skel.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/net/include/netif_skel.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -41,5 +41,4 @@
 #include <async.h>
 #include <fibril_synch.h>
-#include <ipc/ipc.h>
 #include <ipc/services.h>
 
Index: uspace/lib/net/include/nil_skel.h
===================================================================
--- uspace/lib/net/include/nil_skel.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/net/include/nil_skel.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -41,5 +41,4 @@
 #include <async.h>
 #include <fibril_synch.h>
-#include <ipc/ipc.h>
 #include <ipc/services.h>
 
Index: uspace/lib/net/include/tl_skel.h
===================================================================
--- uspace/lib/net/include/tl_skel.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/net/include/tl_skel.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -41,5 +41,4 @@
 #include <async.h>
 #include <fibril_synch.h>
-#include <ipc/ipc.h>
 #include <ipc/services.h>
 
Index: uspace/lib/net/netif/netif_skel.c
===================================================================
--- uspace/lib/net/netif/netif_skel.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/net/netif/netif_skel.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -40,5 +40,4 @@
 #include <fibril_synch.h>
 #include <stdio.h>
-#include <ipc/ipc.h>
 #include <ipc/services.h>
 #include <ipc/netif.h>
@@ -369,5 +368,5 @@
 	 * the initial IPC_M_CONNECT_ME_TO call.
 	 */
-	ipc_answer_0(iid, EOK);
+	async_answer_0(iid, EOK);
 	
 	while (true) {
Index: uspace/lib/net/nil/nil_skel.c
===================================================================
--- uspace/lib/net/nil/nil_skel.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/net/nil/nil_skel.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -54,5 +54,5 @@
 	 * the initial IPC_M_CONNECT_ME_TO call.
 	 */
-	ipc_answer_0(iid, EOK);
+	async_answer_0(iid, EOK);
 	
 	while (true) {
@@ -115,5 +115,5 @@
 		goto out;
 	
-	rc = ipc_connect_to_me(PHONE_NS, service, 0, 0, NULL, NULL);
+	rc = async_connect_to_me(PHONE_NS, service, 0, 0, NULL);
 	if (rc != EOK)
 		goto out;
Index: uspace/lib/net/tl/icmp_remote.c
===================================================================
--- uspace/lib/net/tl/icmp_remote.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/net/tl/icmp_remote.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -42,5 +42,4 @@
 #include <async.h>
 #include <errno.h>
-#include <ipc/ipc.h>
 #include <ipc/services.h>
 #include <ipc/icmp.h>
Index: uspace/lib/net/tl/tl_skel.c
===================================================================
--- uspace/lib/net/tl/tl_skel.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/net/tl/tl_skel.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -54,5 +54,5 @@
 	 * the initial IPC_M_CONNECT_ME_TO call.
 	 */
-	ipc_answer_0(iid, EOK);
+	async_answer_0(iid, EOK);
 	
 	/* Per-connection initialization */
@@ -117,5 +117,5 @@
 		goto out;
 	
-	rc = ipc_connect_to_me(PHONE_NS, service, 0, 0, NULL, NULL);
+	rc = async_connect_to_me(PHONE_NS, service, 0, 0, NULL);
 	if (rc != EOK)
 		goto out;
Index: uspace/lib/packet/generic/packet_server.c
===================================================================
--- uspace/lib/packet/generic/packet_server.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/packet/generic/packet_server.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -44,9 +44,6 @@
 #include <unistd.h>
 #include <sys/mman.h>
-
-#include <ipc/ipc.h>
 #include <ipc/packet.h>
 #include <ipc/net.h>
-
 #include <net/packet.h>
 #include <net/packet_header.h>
@@ -292,10 +289,10 @@
 
 	if (!async_share_in_receive(&callid, &size)) {
-		ipc_answer_0(callid, EINVAL);
+		async_answer_0(callid, EINVAL);
 		return EINVAL;
 	}
 
 	if (size != packet->length) {
-		ipc_answer_0(callid, ENOMEM);
+		async_answer_0(callid, ENOMEM);
 		return ENOMEM;
 	}
Index: uspace/lib/packet/include/packet_server.h
===================================================================
--- uspace/lib/packet/include/packet_server.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/lib/packet/include/packet_server.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -45,5 +45,5 @@
 #define LIBPACKET_PACKET_SERVER_H_
 
-#include <ipc/ipc.h>
+#include <ipc/common.h>
 
 extern int packet_server_message(ipc_callid_t, ipc_call_t *, ipc_call_t *,
Index: uspace/srv/bd/ata_bd/ata_bd.c
===================================================================
--- uspace/srv/bd/ata_bd/ata_bd.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/bd/ata_bd/ata_bd.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -51,5 +51,4 @@
 #include <libarch/ddi.h>
 #include <ddi.h>
-#include <ipc/ipc.h>
 #include <ipc/bd.h>
 #include <async.h>
@@ -282,5 +281,5 @@
 	sysarg_t method;
 	devmap_handle_t dh;
-	int flags;
+	unsigned int flags;
 	int retval;
 	uint64_t ba;
@@ -298,13 +297,13 @@
 
 	if (disk_id < 0 || disk[disk_id].present == false) {
-		ipc_answer_0(iid, EINVAL);
+		async_answer_0(iid, EINVAL);
 		return;
 	}
 
 	/* Answer the IPC_M_CONNECT_ME_TO call. */
-	ipc_answer_0(iid, EOK);
+	async_answer_0(iid, EOK);
 
 	if (!async_share_out_receive(&callid, &comm_size, &flags)) {
-		ipc_answer_0(callid, EHANGUP);
+		async_answer_0(callid, EHANGUP);
 		return;
 	}
@@ -312,5 +311,5 @@
 	fs_va = as_get_mappable_page(comm_size);
 	if (fs_va == NULL) {
-		ipc_answer_0(callid, EHANGUP);
+		async_answer_0(callid, EHANGUP);
 		return;
 	}
@@ -324,5 +323,5 @@
 		case IPC_M_PHONE_HUNGUP:
 			/* The other side has hung up. */
-			ipc_answer_0(callid, EOK);
+			async_answer_0(callid, EOK);
 			return;
 		case BD_READ_BLOCKS:
@@ -347,8 +346,8 @@
 			break;
 		case BD_GET_BLOCK_SIZE:
-			ipc_answer_1(callid, EOK, disk[disk_id].block_size);
+			async_answer_1(callid, EOK, disk[disk_id].block_size);
 			continue;
 		case BD_GET_NUM_BLOCKS:
-			ipc_answer_2(callid, EOK, LOWER32(disk[disk_id].blocks),
+			async_answer_2(callid, EOK, LOWER32(disk[disk_id].blocks),
 			    UPPER32(disk[disk_id].blocks));
 			continue;
@@ -357,5 +356,5 @@
 			break;
 		}
-		ipc_answer_0(callid, retval);
+		async_answer_0(callid, retval);
 	}
 }
Index: uspace/srv/bd/file_bd/file_bd.c
===================================================================
--- uspace/srv/bd/file_bd/file_bd.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/bd/file_bd/file_bd.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -41,5 +41,4 @@
 #include <stdio.h>
 #include <unistd.h>
-#include <ipc/ipc.h>
 #include <ipc/bd.h>
 #include <async.h>
@@ -178,5 +177,5 @@
 	sysarg_t method;
 	size_t comm_size;
-	int flags;
+	unsigned int flags;
 	int retval;
 	uint64_t ba;
@@ -184,8 +183,8 @@
 
 	/* Answer the IPC_M_CONNECT_ME_TO call. */
-	ipc_answer_0(iid, EOK);
+	async_answer_0(iid, EOK);
 
 	if (!async_share_out_receive(&callid, &comm_size, &flags)) {
-		ipc_answer_0(callid, EHANGUP);
+		async_answer_0(callid, EHANGUP);
 		return;
 	}
@@ -193,5 +192,5 @@
 	fs_va = as_get_mappable_page(comm_size);
 	if (fs_va == NULL) {
-		ipc_answer_0(callid, EHANGUP);
+		async_answer_0(callid, EHANGUP);
 		return;
 	}
@@ -205,5 +204,5 @@
 		case IPC_M_PHONE_HUNGUP:
 			/* The other side has hung up. */
-			ipc_answer_0(callid, EOK);
+			async_answer_0(callid, EOK);
 			return;
 		case BD_READ_BLOCKS:
@@ -228,8 +227,8 @@
 			break;
 		case BD_GET_BLOCK_SIZE:
-			ipc_answer_1(callid, EOK, block_size);
+			async_answer_1(callid, EOK, block_size);
 			continue;
 		case BD_GET_NUM_BLOCKS:
-			ipc_answer_2(callid, EOK, LOWER32(num_blocks),
+			async_answer_2(callid, EOK, LOWER32(num_blocks),
 			    UPPER32(num_blocks));
 			continue;
@@ -238,5 +237,5 @@
 			break;
 		}
-		ipc_answer_0(callid, retval);
+		async_answer_0(callid, retval);
 	}
 }
Index: uspace/srv/bd/gxe_bd/gxe_bd.c
===================================================================
--- uspace/srv/bd/gxe_bd/gxe_bd.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/bd/gxe_bd/gxe_bd.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -39,5 +39,4 @@
 #include <libarch/ddi.h>
 #include <ddi.h>
-#include <ipc/ipc.h>
 #include <ipc/bd.h>
 #include <async.h>
@@ -161,5 +160,5 @@
 	sysarg_t method;
 	devmap_handle_t dh;
-	int flags;
+	unsigned int flags;
 	int retval;
 	uint64_t ba;
@@ -177,18 +176,18 @@
 
 	if (disk_id < 0) {
-		ipc_answer_0(iid, EINVAL);
+		async_answer_0(iid, EINVAL);
 		return;
 	}
 
 	/* Answer the IPC_M_CONNECT_ME_TO call. */
-	ipc_answer_0(iid, EOK);
+	async_answer_0(iid, EOK);
 
 	if (!async_share_out_receive(&callid, &comm_size, &flags)) {
-		ipc_answer_0(callid, EHANGUP);
+		async_answer_0(callid, EHANGUP);
 		return;
 	}
 
 	if (comm_size < block_size) {
-		ipc_answer_0(callid, EHANGUP);
+		async_answer_0(callid, EHANGUP);
 		return;
 	}
@@ -196,5 +195,5 @@
 	fs_va = as_get_mappable_page(comm_size);
 	if (fs_va == NULL) {
-		ipc_answer_0(callid, EHANGUP);
+		async_answer_0(callid, EHANGUP);
 		return;
 	}
@@ -208,5 +207,5 @@
 		case IPC_M_PHONE_HUNGUP:
 			/* The other side has hung up. */
-			ipc_answer_0(callid, EOK);
+			async_answer_0(callid, EOK);
 			return;
 		case BD_READ_BLOCKS:
@@ -231,5 +230,5 @@
 			break;
 		case BD_GET_BLOCK_SIZE:
-			ipc_answer_1(callid, EOK, block_size);
+			async_answer_1(callid, EOK, block_size);
 			continue;
 		case BD_GET_NUM_BLOCKS:
@@ -240,5 +239,5 @@
 			break;
 		}
-		ipc_answer_0(callid, retval);
+		async_answer_0(callid, retval);
 	}
 }
Index: uspace/srv/bd/part/guid_part/guid_part.c
===================================================================
--- uspace/srv/bd/part/guid_part/guid_part.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/bd/part/guid_part/guid_part.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -47,5 +47,4 @@
 #include <stdlib.h>
 #include <unistd.h>
-#include <ipc/ipc.h>
 #include <ipc/bd.h>
 #include <async.h>
@@ -316,5 +315,5 @@
 	sysarg_t method;
 	devmap_handle_t dh;
-	int flags;
+	unsigned int flags;
 	int retval;
 	aoff64_t ba;
@@ -335,5 +334,5 @@
 
 	if (part == NULL) {
-		ipc_answer_0(iid, EINVAL);
+		async_answer_0(iid, EINVAL);
 		return;
 	}
@@ -342,8 +341,8 @@
 
 	/* Answer the IPC_M_CONNECT_ME_TO call. */
-	ipc_answer_0(iid, EOK);
+	async_answer_0(iid, EOK);
 
 	if (!async_share_out_receive(&callid, &comm_size, &flags)) {
-		ipc_answer_0(callid, EHANGUP);
+		async_answer_0(callid, EHANGUP);
 		return;
 	}
@@ -351,5 +350,5 @@
 	fs_va = as_get_mappable_page(comm_size);
 	if (fs_va == NULL) {
-		ipc_answer_0(callid, EHANGUP);
+		async_answer_0(callid, EHANGUP);
 		return;
 	}
@@ -363,5 +362,5 @@
 		case IPC_M_PHONE_HUNGUP:
 			/* The other side has hung up. */
-			ipc_answer_0(callid, EOK);
+			async_answer_0(callid, EOK);
 			return;
 		case BD_READ_BLOCKS:
@@ -386,8 +385,8 @@
 			break;
 		case BD_GET_BLOCK_SIZE:
-			ipc_answer_1(callid, EOK, block_size);
+			async_answer_1(callid, EOK, block_size);
 			continue;
 		case BD_GET_NUM_BLOCKS:
-			ipc_answer_2(callid, EOK, LOWER32(part->length),
+			async_answer_2(callid, EOK, LOWER32(part->length),
 			    UPPER32(part->length));
 			continue;
@@ -396,5 +395,5 @@
 			break;
 		}
-		ipc_answer_0(callid, retval);
+		async_answer_0(callid, retval);
 	}
 }
Index: uspace/srv/bd/part/mbr_part/mbr_part.c
===================================================================
--- uspace/srv/bd/part/mbr_part/mbr_part.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/bd/part/mbr_part/mbr_part.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -57,5 +57,4 @@
 #include <stdlib.h>
 #include <unistd.h>
-#include <ipc/ipc.h>
 #include <ipc/bd.h>
 #include <async.h>
@@ -394,5 +393,5 @@
 	sysarg_t method;
 	devmap_handle_t dh;
-	int flags;
+	unsigned int flags;
 	int retval;
 	uint64_t ba;
@@ -413,5 +412,5 @@
 
 	if (part == NULL) {
-		ipc_answer_0(iid, EINVAL);
+		async_answer_0(iid, EINVAL);
 		return;
 	}
@@ -420,8 +419,8 @@
 
 	/* Answer the IPC_M_CONNECT_ME_TO call. */
-	ipc_answer_0(iid, EOK);
+	async_answer_0(iid, EOK);
 
 	if (!async_share_out_receive(&callid, &comm_size, &flags)) {
-		ipc_answer_0(callid, EHANGUP);
+		async_answer_0(callid, EHANGUP);
 		return;
 	}
@@ -429,5 +428,5 @@
 	fs_va = as_get_mappable_page(comm_size);
 	if (fs_va == NULL) {
-		ipc_answer_0(callid, EHANGUP);
+		async_answer_0(callid, EHANGUP);
 		return;
 	}
@@ -441,5 +440,5 @@
 		case IPC_M_PHONE_HUNGUP:
 			/* The other side has hung up. */
-			ipc_answer_0(callid, EOK);
+			async_answer_0(callid, EOK);
 			return;
 		case BD_READ_BLOCKS:
@@ -464,8 +463,8 @@
 			break;
 		case BD_GET_BLOCK_SIZE:
-			ipc_answer_1(callid, EOK, block_size);
+			async_answer_1(callid, EOK, block_size);
 			continue;
 		case BD_GET_NUM_BLOCKS:
-			ipc_answer_2(callid, EOK, LOWER32(part->length),
+			async_answer_2(callid, EOK, LOWER32(part->length),
 			    UPPER32(part->length));
 			continue;
@@ -474,5 +473,5 @@
 			break;
 		}
-		ipc_answer_0(callid, retval);
+		async_answer_0(callid, retval);
 	}
 }
Index: uspace/srv/bd/rd/rd.c
===================================================================
--- uspace/srv/bd/rd/rd.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/bd/rd/rd.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -39,5 +39,4 @@
  */
 
-#include <ipc/ipc.h>
 #include <ipc/services.h>
 #include <ipc/ns.h>
@@ -98,10 +97,10 @@
 	 * Answer the first IPC_M_CONNECT_ME_TO call.
 	 */
-	ipc_answer_0(iid, EOK);
+	async_answer_0(iid, EOK);
 	
 	/*
 	 * Now we wait for the client to send us its communication as_area.
 	 */
-	int flags;
+	unsigned int flags;
 	if (async_share_out_receive(&callid, &comm_size, &flags)) {
 		fs_va = as_get_mappable_page(comm_size);
@@ -109,5 +108,5 @@
 			(void) async_share_out_finalize(callid, fs_va);
 		} else {
-			ipc_answer_0(callid, EHANGUP);
+			async_answer_0(callid, EHANGUP);
 			return;
 		}
@@ -118,5 +117,5 @@
 		 * Close the connection.
 		 */
-		ipc_answer_0(callid, EHANGUP);
+		async_answer_0(callid, EHANGUP);
 		return;
 	}
@@ -130,5 +129,5 @@
 			 * Answer the message and exit the fibril.
 			 */
-			ipc_answer_0(callid, EOK);
+			async_answer_0(callid, EOK);
 			return;
 		case BD_READ_BLOCKS:
@@ -153,8 +152,8 @@
 			break;
 		case BD_GET_BLOCK_SIZE:
-			ipc_answer_1(callid, EOK, block_size);
+			async_answer_1(callid, EOK, block_size);
 			continue;
 		case BD_GET_NUM_BLOCKS:
-			ipc_answer_2(callid, EOK, LOWER32(rd_size / block_size),
+			async_answer_2(callid, EOK, LOWER32(rd_size / block_size),
 			    UPPER32(rd_size / block_size));
 			continue;
@@ -169,5 +168,5 @@
 			break;
 		}
-		ipc_answer_0(callid, retval);
+		async_answer_0(callid, retval);
 	}
 }
Index: uspace/srv/clip/clip.c
===================================================================
--- uspace/srv/clip/clip.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/clip/clip.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -29,6 +29,6 @@
 #include <stdio.h>
 #include <bool.h>
-#include <ipc/ipc.h>
 #include <async.h>
+#include <ipc/ns.h>
 #include <ipc/services.h>
 #include <ipc/clipboard.h>
@@ -62,10 +62,10 @@
 		
 		fibril_mutex_unlock(&clip_mtx);
-		ipc_answer_0(rid, EOK);
+		async_answer_0(rid, EOK);
 		break;
 	case CLIPBOARD_TAG_DATA:
 		rc = async_data_write_accept((void **) &data, false, 0, 0, 0, &size);
 		if (rc != EOK) {
-			ipc_answer_0(rid, rc);
+			async_answer_0(rid, rc);
 			break;
 		}
@@ -81,8 +81,8 @@
 		
 		fibril_mutex_unlock(&clip_mtx);
-		ipc_answer_0(rid, EOK);
+		async_answer_0(rid, EOK);
 		break;
 	default:
-		ipc_answer_0(rid, EINVAL);
+		async_answer_0(rid, EINVAL);
 	}
 }
@@ -99,6 +99,6 @@
 	case CLIPBOARD_TAG_DATA:
 		if (!async_data_read_receive(&callid, &size)) {
-			ipc_answer_0(callid, EINVAL);
-			ipc_answer_0(rid, EINVAL);
+			async_answer_0(callid, EINVAL);
+			async_answer_0(rid, EINVAL);
 			break;
 		}
@@ -106,6 +106,6 @@
 		if (clip_tag != CLIPBOARD_TAG_DATA) {
 			/* So far we only understand binary data */
-			ipc_answer_0(callid, EOVERFLOW);
-			ipc_answer_0(rid, EOVERFLOW);
+			async_answer_0(callid, EOVERFLOW);
+			async_answer_0(rid, EOVERFLOW);
 			break;
 		}
@@ -113,6 +113,6 @@
 		if (clip_size != size) {
 			/* The client expects different size of data */
-			ipc_answer_0(callid, EOVERFLOW);
-			ipc_answer_0(rid, EOVERFLOW);
+			async_answer_0(callid, EOVERFLOW);
+			async_answer_0(rid, EOVERFLOW);
 			break;
 		}
@@ -120,9 +120,9 @@
 		sysarg_t retval = async_data_read_finalize(callid, clip_data, size);
 		if (retval != EOK) {
-			ipc_answer_0(rid, retval);
+			async_answer_0(rid, retval);
 			break;
 		}
 		
-		ipc_answer_0(rid, EOK);
+		async_answer_0(rid, EOK);
 	default:
 		/*
@@ -130,5 +130,5 @@
 		 * data from the clipbard
 		 */
-		ipc_answer_0(rid, EINVAL);
+		async_answer_0(rid, EINVAL);
 		break;
 	}
@@ -145,5 +145,5 @@
 	
 	fibril_mutex_unlock(&clip_mtx);
-	ipc_answer_2(rid, EOK, (sysarg_t) size, (sysarg_t) tag);
+	async_answer_2(rid, EOK, (sysarg_t) size, (sysarg_t) tag);
 }
 
@@ -151,5 +151,5 @@
 {
 	/* Accept connection */
-	ipc_answer_0(iid, EOK);
+	async_answer_0(iid, EOK);
 	
 	bool cont = true;
@@ -172,5 +172,5 @@
 			break;
 		default:
-			ipc_answer_0(callid, ENOENT);
+			async_answer_0(callid, ENOENT);
 		}
 	}
@@ -183,5 +183,5 @@
 	async_set_client_connection(clip_connection);
 	
-	if (ipc_connect_to_me(PHONE_NS, SERVICE_CLIPBOARD, 0, 0, NULL, NULL)) 
+	if (service_register(SERVICE_CLIPBOARD) != EOK)
 		return -1;
 	
Index: uspace/srv/devman/devman.c
===================================================================
--- uspace/srv/devman/devman.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/devman/devman.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -590,5 +590,5 @@
 	}
 
-	ipc_hangup(phone);
+	async_hangup(phone);
 
 	/*
@@ -787,5 +787,5 @@
 		if (phone >= 0) {
 			add_device(phone, drv, node, tree);
-			ipc_hangup(phone);
+			async_hangup(phone);
 		}
 	}
Index: uspace/srv/devman/devman.h
===================================================================
--- uspace/srv/devman/devman.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/devman/devman.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -40,5 +40,4 @@
 #include <adt/list.h>
 #include <adt/hash_table.h>
-#include <ipc/ipc.h>
 #include <ipc/devman.h>
 #include <ipc/devmap.h>
Index: uspace/srv/devman/main.c
===================================================================
--- uspace/srv/devman/main.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/devman/main.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -75,5 +75,5 @@
 	iid = async_get_call(&icall);
 	if (IPC_GET_IMETHOD(icall) != DEVMAN_DRIVER_REGISTER) {
-		ipc_answer_0(iid, EREFUSED);
+		async_answer_0(iid, EREFUSED);
 		return NULL;
 	}
@@ -84,5 +84,5 @@
 	int rc = async_data_write_accept((void **) &drv_name, true, 0, 0, 0, 0);
 	if (rc != EOK) {
-		ipc_answer_0(iid, rc);
+		async_answer_0(iid, rc);
 		return NULL;
 	}
@@ -98,5 +98,5 @@
 		free(drv_name);
 		drv_name = NULL;
-		ipc_answer_0(iid, ENOENT);
+		async_answer_0(iid, ENOENT);
 		return NULL;
 	}
@@ -110,6 +110,6 @@
 	ipc_callid_t callid = async_get_call(&call);
 	if (IPC_GET_IMETHOD(call) != IPC_M_CONNECT_TO_ME) {
-		ipc_answer_0(callid, ENOTSUP);
-		ipc_answer_0(iid, ENOTSUP);
+		async_answer_0(callid, ENOTSUP);
+		async_answer_0(iid, ENOTSUP);
 		return NULL;
 	}
@@ -121,6 +121,6 @@
 	    driver->name);
 	
-	ipc_answer_0(callid, EOK);
-	ipc_answer_0(iid, EOK);
+	async_answer_0(callid, EOK);
+	async_answer_0(iid, EOK);
 	
 	return driver;
@@ -144,5 +144,5 @@
 		printf(NAME ": ERROR: devman_receive_match_id - invalid "
 		    "protocol.\n");
-		ipc_answer_0(callid, EINVAL); 
+		async_answer_0(callid, EINVAL); 
 		delete_match_id(match_id);
 		return EINVAL;
@@ -152,9 +152,9 @@
 		printf(NAME ": ERROR: devman_receive_match_id - failed to "
 		    "allocate match id.\n");
-		ipc_answer_0(callid, ENOMEM);
+		async_answer_0(callid, ENOMEM);
 		return ENOMEM;
 	}
 	
-	ipc_answer_0(callid, EOK);
+	async_answer_0(callid, EOK);
 	
 	match_id->score = IPC_GET_ARG1(call);
@@ -219,5 +219,5 @@
 	if (parent == NULL) {
 		fibril_rwlock_write_unlock(&tree->rwlock);
-		ipc_answer_0(callid, ENOENT);
+		async_answer_0(callid, ENOENT);
 		return;
 	}
@@ -227,5 +227,5 @@
 	if (rc != EOK) {
 		fibril_rwlock_write_unlock(&tree->rwlock);
-		ipc_answer_0(callid, rc);
+		async_answer_0(callid, rc);
 		return;
 	}
@@ -235,5 +235,5 @@
 		fibril_rwlock_write_unlock(&tree->rwlock);
 		delete_dev_node(node);
-		ipc_answer_0(callid, ENOMEM);
+		async_answer_0(callid, ENOMEM);
 		return;
 	}
@@ -264,5 +264,5 @@
 
 	/* Return device handle to parent's driver. */
-	ipc_answer_1(callid, EOK, node->handle);
+	async_answer_1(callid, EOK, node->handle);
 }
 
@@ -302,5 +302,5 @@
 	    0, 0, 0, 0);
 	if (rc != EOK) {
-		ipc_answer_0(callid, rc);
+		async_answer_0(callid, rc);
 		return;
 	}	
@@ -308,5 +308,5 @@
 	node_t *dev = find_dev_node(&device_tree, handle);
 	if (dev == NULL) {
-		ipc_answer_0(callid, ENOENT);
+		async_answer_0(callid, ENOENT);
 		return;
 	}
@@ -321,5 +321,5 @@
 	    "asigned to it\n", dev->pathname, class_name, class_info->dev_name);
 
-	ipc_answer_0(callid, EOK);
+	async_answer_0(callid, EOK);
 }
 
@@ -343,5 +343,5 @@
 {
 	/* Accept the connection. */
-	ipc_answer_0(iid, EOK);
+	async_answer_0(iid, EOK);
 	
 	driver_t *driver = devman_driver_register();
@@ -379,5 +379,5 @@
 			break;
 		default:
-			ipc_answer_0(callid, EINVAL); 
+			async_answer_0(callid, EINVAL); 
 			break;
 		}
@@ -393,5 +393,5 @@
 	int rc = async_data_write_accept((void **) &pathname, true, 0, 0, 0, 0);
 	if (rc != EOK) {
-		ipc_answer_0(iid, rc);
+		async_answer_0(iid, rc);
 		return;
 	}
@@ -402,9 +402,9 @@
 
 	if (dev == NULL) {
-		ipc_answer_0(iid, ENOENT);
-		return;
-	}
-	
-	ipc_answer_1(iid, EOK, dev->handle);
+		async_answer_0(iid, ENOENT);
+		return;
+	}
+	
+	async_answer_1(iid, EOK, dev->handle);
 }
 
@@ -414,5 +414,5 @@
 {
 	/* Accept connection. */
-	ipc_answer_0(iid, EOK);
+	async_answer_0(iid, EOK);
 	
 	bool cont = true;
@@ -429,5 +429,5 @@
 			break;
 		default:
-			ipc_answer_0(callid, ENOENT);
+			async_answer_0(callid, ENOENT);
 		}
 	}
@@ -443,5 +443,5 @@
 		printf(NAME ": devman_forward error - no device with handle %" PRIun
 		    " was found.\n", handle);
-		ipc_answer_0(iid, ENOENT);
+		async_answer_0(iid, ENOENT);
 		return;
 	}
@@ -460,5 +460,5 @@
 		printf(NAME ": devman_forward error - the device is not in %" PRIun
 		    " usable state.\n", handle);
-		ipc_answer_0(iid, ENOENT);
+		async_answer_0(iid, ENOENT);
 		return;
 	}
@@ -474,5 +474,5 @@
 		    driver->name);
 		printf("the driver's phone is %" PRIun ").\n", driver->phone);
-		ipc_answer_0(iid, EINVAL);
+		async_answer_0(iid, EINVAL);
 		return;
 	}
@@ -480,5 +480,5 @@
 	printf(NAME ": devman_forward: forward connection to device %s to "
 	    "driver %s.\n", dev->pathname, driver->name);
-	ipc_forward_fast(iid, driver->phone, method, dev->handle, 0, IPC_FF_NONE);
+	async_forward_fast(iid, driver->phone, method, dev->handle, 0, IPC_FF_NONE);
 }
 
@@ -495,14 +495,14 @@
 	
 	if (dev == NULL || dev->drv == NULL) {
-		ipc_answer_0(iid, ENOENT);
+		async_answer_0(iid, ENOENT);
 		return;
 	}
 	
 	if (dev->state != DEVICE_USABLE || dev->drv->phone <= 0) {
-		ipc_answer_0(iid, EINVAL);
-		return;
-	}
-	
-	ipc_forward_fast(iid, dev->drv->phone, DRIVER_CLIENT, dev->handle, 0,
+		async_answer_0(iid, EINVAL);
+		return;
+	}
+	
+	async_forward_fast(iid, dev->drv->phone, DRIVER_CLIENT, dev->handle, 0,
 	    IPC_FF_NONE);
 	printf(NAME ": devman_connection_devmapper: forwarded connection to "
@@ -535,5 +535,5 @@
 	default:
 		/* No such interface */
-		ipc_answer_0(iid, ENOENT);
+		async_answer_0(iid, ENOENT);
 	}
 }
@@ -586,5 +586,5 @@
 
 	/* Register device manager at naming service. */
-	if (ipc_connect_to_me(PHONE_NS, SERVICE_DEVMAN, 0, 0, NULL, NULL) != 0)
+	if (service_register(SERVICE_DEVMAN) != EOK)
 		return -1;
 
Index: uspace/srv/devmap/devmap.c
===================================================================
--- uspace/srv/devmap/devmap.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/devmap/devmap.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -374,5 +374,5 @@
 	
 	if (IPC_GET_IMETHOD(icall) != DEVMAP_DRIVER_REGISTER) {
-		ipc_answer_0(iid, EREFUSED);
+		async_answer_0(iid, EREFUSED);
 		return NULL;
 	}
@@ -381,5 +381,5 @@
 	    (devmap_driver_t *) malloc(sizeof(devmap_driver_t));
 	if (driver == NULL) {
-		ipc_answer_0(iid, ENOMEM);
+		async_answer_0(iid, ENOMEM);
 		return NULL;
 	}
@@ -392,5 +392,5 @@
 	if (rc != EOK) {
 		free(driver);
-		ipc_answer_0(iid, rc);
+		async_answer_0(iid, rc);
 		return NULL;
 	}
@@ -405,11 +405,11 @@
 		free(driver->name);
 		free(driver);
-		ipc_answer_0(callid, ENOTSUP);
-		ipc_answer_0(iid, ENOTSUP);
+		async_answer_0(callid, ENOTSUP);
+		async_answer_0(iid, ENOTSUP);
 		return NULL;
 	}
 	
 	driver->phone = IPC_GET_ARG5(call);
-	ipc_answer_0(callid, EOK);
+	async_answer_0(callid, EOK);
 	
 	/*
@@ -438,5 +438,5 @@
 	fibril_mutex_unlock(&drivers_list_mutex);
 	
-	ipc_answer_0(iid, EOK);
+	async_answer_0(iid, EOK);
 	
 	return driver;
@@ -456,5 +456,5 @@
 	
 	if (driver->phone != 0)
-		ipc_hangup(driver->phone);
+		async_hangup(driver->phone);
 	
 	/* Remove it from list of drivers */
@@ -491,5 +491,5 @@
 {
 	if (driver == NULL) {
-		ipc_answer_0(iid, EREFUSED);
+		async_answer_0(iid, EREFUSED);
 		return;
 	}
@@ -499,5 +499,5 @@
 	    (devmap_device_t *) malloc(sizeof(devmap_device_t));
 	if (device == NULL) {
-		ipc_answer_0(iid, ENOMEM);
+		async_answer_0(iid, ENOMEM);
 		return;
 	}
@@ -512,5 +512,5 @@
 	if (rc != EOK) {
 		free(device);
-		ipc_answer_0(iid, rc);
+		async_answer_0(iid, rc);
 		return;
 	}
@@ -520,5 +520,5 @@
 		free(fqdn);
 		free(device);
-		ipc_answer_0(iid, EINVAL);
+		async_answer_0(iid, EINVAL);
 		return;
 	}
@@ -534,5 +534,5 @@
 		free(device->name);
 		free(device);
-		ipc_answer_0(iid, ENOMEM);
+		async_answer_0(iid, ENOMEM);
 		return;
 	}
@@ -549,5 +549,5 @@
 		free(device->name);
 		free(device);
-		ipc_answer_0(iid, EEXISTS);
+		async_answer_0(iid, EEXISTS);
 		return;
 	}
@@ -571,5 +571,5 @@
 	fibril_mutex_unlock(&devices_list_mutex);
 	
-	ipc_answer_1(iid, EOK, device->handle);
+	async_answer_1(iid, EOK, device->handle);
 }
 
@@ -602,14 +602,14 @@
 	if ((dev == NULL) || (dev->driver == NULL) || (dev->driver->phone == 0)) {
 		fibril_mutex_unlock(&devices_list_mutex);
-		ipc_answer_0(callid, ENOENT);
+		async_answer_0(callid, ENOENT);
 		return;
 	}
 	
 	if (dev->forward_interface == 0) {
-		ipc_forward_fast(callid, dev->driver->phone,
+		async_forward_fast(callid, dev->driver->phone,
 		    dev->handle, 0, 0,
 		    IPC_FF_NONE);
 	} else {
-		ipc_forward_fast(callid, dev->driver->phone,
+		async_forward_fast(callid, dev->driver->phone,
 		    dev->forward_interface, dev->handle, 0,
 		    IPC_FF_NONE);
@@ -633,5 +633,5 @@
 	    DEVMAP_NAME_MAXLEN, 0, NULL);
 	if (rc != EOK) {
-		ipc_answer_0(iid, rc);
+		async_answer_0(iid, rc);
 		return;
 	}
@@ -641,5 +641,5 @@
 	if (!devmap_fqdn_split(fqdn, &ns_name, &name)) {
 		free(fqdn);
-		ipc_answer_0(iid, EINVAL);
+		async_answer_0(iid, EINVAL);
 		return;
 	}
@@ -668,5 +668,5 @@
 		}
 		
-		ipc_answer_0(iid, ENOENT);
+		async_answer_0(iid, ENOENT);
 		free(ns_name);
 		free(name);
@@ -675,5 +675,5 @@
 	}
 	
-	ipc_answer_1(iid, EOK, dev->handle);
+	async_answer_1(iid, EOK, dev->handle);
 	
 	fibril_mutex_unlock(&devices_list_mutex);
@@ -696,5 +696,5 @@
 	    DEVMAP_NAME_MAXLEN, 0, NULL);
 	if (rc != EOK) {
-		ipc_answer_0(iid, rc);
+		async_answer_0(iid, rc);
 		return;
 	}
@@ -721,5 +721,5 @@
 		}
 		
-		ipc_answer_0(iid, ENOENT);
+		async_answer_0(iid, ENOENT);
 		free(name);
 		fibril_mutex_unlock(&devices_list_mutex);
@@ -727,5 +727,5 @@
 	}
 	
-	ipc_answer_1(iid, EOK, namespace->handle);
+	async_answer_1(iid, EOK, namespace->handle);
 	
 	fibril_mutex_unlock(&devices_list_mutex);
@@ -743,9 +743,9 @@
 		    devmap_device_find_handle(IPC_GET_ARG1(*icall));
 		if (dev == NULL)
-			ipc_answer_1(iid, EOK, DEV_HANDLE_NONE);
+			async_answer_1(iid, EOK, DEV_HANDLE_NONE);
 		else
-			ipc_answer_1(iid, EOK, DEV_HANDLE_DEVICE);
+			async_answer_1(iid, EOK, DEV_HANDLE_DEVICE);
 	} else
-		ipc_answer_1(iid, EOK, DEV_HANDLE_NAMESPACE);
+		async_answer_1(iid, EOK, DEV_HANDLE_NAMESPACE);
 	
 	fibril_mutex_unlock(&devices_list_mutex);
@@ -755,5 +755,5 @@
 {
 	fibril_mutex_lock(&devices_list_mutex);
-	ipc_answer_1(iid, EOK, list_count(&namespaces_list));
+	async_answer_1(iid, EOK, list_count(&namespaces_list));
 	fibril_mutex_unlock(&devices_list_mutex);
 }
@@ -766,7 +766,7 @@
 	    devmap_namespace_find_handle(IPC_GET_ARG1(*icall));
 	if (namespace == NULL)
-		ipc_answer_0(iid, EEXISTS);
+		async_answer_0(iid, EEXISTS);
 	else
-		ipc_answer_1(iid, EOK, namespace->refcnt);
+		async_answer_1(iid, EOK, namespace->refcnt);
 	
 	fibril_mutex_unlock(&devices_list_mutex);
@@ -778,12 +778,12 @@
 	size_t size;
 	if (!async_data_read_receive(&callid, &size)) {
-		ipc_answer_0(callid, EREFUSED);
-		ipc_answer_0(iid, EREFUSED);
+		async_answer_0(callid, EREFUSED);
+		async_answer_0(iid, EREFUSED);
 		return;
 	}
 	
 	if ((size % sizeof(dev_desc_t)) != 0) {
-		ipc_answer_0(callid, EINVAL);
-		ipc_answer_0(iid, EINVAL);
+		async_answer_0(callid, EINVAL);
+		async_answer_0(iid, EINVAL);
 		return;
 	}
@@ -794,6 +794,6 @@
 	if (count != list_count(&namespaces_list)) {
 		fibril_mutex_unlock(&devices_list_mutex);
-		ipc_answer_0(callid, EOVERFLOW);
-		ipc_answer_0(iid, EOVERFLOW);
+		async_answer_0(callid, EOVERFLOW);
+		async_answer_0(iid, EOVERFLOW);
 		return;
 	}
@@ -802,6 +802,6 @@
 	if (desc == NULL) {
 		fibril_mutex_unlock(&devices_list_mutex);
-		ipc_answer_0(callid, ENOMEM);
-		ipc_answer_0(iid, ENOMEM);
+		async_answer_0(callid, ENOMEM);
+		async_answer_0(iid, ENOMEM);
 		return;
 	}
@@ -824,5 +824,5 @@
 	fibril_mutex_unlock(&devices_list_mutex);
 	
-	ipc_answer_0(iid, retval);
+	async_answer_0(iid, retval);
 }
 
@@ -835,12 +835,12 @@
 	size_t size;
 	if (!async_data_read_receive(&callid, &size)) {
-		ipc_answer_0(callid, EREFUSED);
-		ipc_answer_0(iid, EREFUSED);
+		async_answer_0(callid, EREFUSED);
+		async_answer_0(iid, EREFUSED);
 		return;
 	}
 	
 	if ((size % sizeof(dev_desc_t)) != 0) {
-		ipc_answer_0(callid, EINVAL);
-		ipc_answer_0(iid, EINVAL);
+		async_answer_0(callid, EINVAL);
+		async_answer_0(iid, EINVAL);
 		return;
 	}
@@ -852,6 +852,6 @@
 	if (namespace == NULL) {
 		fibril_mutex_unlock(&devices_list_mutex);
-		ipc_answer_0(callid, ENOENT);
-		ipc_answer_0(iid, ENOENT);
+		async_answer_0(callid, ENOENT);
+		async_answer_0(iid, ENOENT);
 		return;
 	}
@@ -860,6 +860,6 @@
 	if (count != namespace->refcnt) {
 		fibril_mutex_unlock(&devices_list_mutex);
-		ipc_answer_0(callid, EOVERFLOW);
-		ipc_answer_0(iid, EOVERFLOW);
+		async_answer_0(callid, EOVERFLOW);
+		async_answer_0(iid, EOVERFLOW);
 		return;
 	}
@@ -868,6 +868,6 @@
 	if (desc == NULL) {
 		fibril_mutex_unlock(&devices_list_mutex);
-		ipc_answer_0(callid, ENOMEM);
-		ipc_answer_0(iid, EREFUSED);
+		async_answer_0(callid, ENOMEM);
+		async_answer_0(iid, EREFUSED);
 		return;
 	}
@@ -891,5 +891,5 @@
 	fibril_mutex_unlock(&devices_list_mutex);
 	
-	ipc_answer_0(iid, retval);
+	async_answer_0(iid, retval);
 }
 
@@ -910,5 +910,5 @@
 	if (!fnd) {
 		fibril_mutex_unlock(&null_devices_mutex);
-		ipc_answer_0(iid, ENOMEM);
+		async_answer_0(iid, ENOMEM);
 		return;
 	}
@@ -920,5 +920,5 @@
 	if (dev_name == NULL) {
 		fibril_mutex_unlock(&null_devices_mutex);
-		ipc_answer_0(iid, ENOMEM);
+		async_answer_0(iid, ENOMEM);
 		return;
 	}
@@ -928,5 +928,5 @@
 	if (device == NULL) {
 		fibril_mutex_unlock(&null_devices_mutex);
-		ipc_answer_0(iid, ENOMEM);
+		async_answer_0(iid, ENOMEM);
 		return;
 	}
@@ -938,5 +938,5 @@
 		fibril_mutex_lock(&devices_list_mutex);
 		fibril_mutex_unlock(&null_devices_mutex);
-		ipc_answer_0(iid, ENOMEM);
+		async_answer_0(iid, ENOMEM);
 		return;
 	}
@@ -960,5 +960,5 @@
 	fibril_mutex_unlock(&null_devices_mutex);
 	
-	ipc_answer_1(iid, EOK, (sysarg_t) i);
+	async_answer_1(iid, EOK, (sysarg_t) i);
 }
 
@@ -967,5 +967,5 @@
 	sysarg_t i = IPC_GET_ARG1(*icall);
 	if (i >= NULL_DEVICES) {
-		ipc_answer_0(iid, ELIMIT);
+		async_answer_0(iid, ELIMIT);
 		return;
 	}
@@ -975,5 +975,5 @@
 	if (null_devices[i] == NULL) {
 		fibril_mutex_unlock(&null_devices_mutex);
-		ipc_answer_0(iid, ENOENT);
+		async_answer_0(iid, ENOENT);
 		return;
 	}
@@ -986,5 +986,5 @@
 	
 	fibril_mutex_unlock(&null_devices_mutex);
-	ipc_answer_0(iid, EOK);
+	async_answer_0(iid, EOK);
 }
 
@@ -1012,5 +1012,5 @@
 {
 	/* Accept connection */
-	ipc_answer_0(iid, EOK);
+	async_answer_0(iid, EOK);
 	
 	devmap_driver_t *driver = devmap_driver_register();
@@ -1029,7 +1029,7 @@
 		case DEVMAP_DRIVER_UNREGISTER:
 			if (NULL == driver)
-				ipc_answer_0(callid, ENOENT);
+				async_answer_0(callid, ENOENT);
 			else
-				ipc_answer_0(callid, EOK);
+				async_answer_0(callid, EOK);
 			break;
 		case DEVMAP_DEVICE_REGISTER:
@@ -1048,5 +1048,5 @@
 			break;
 		default:
-			ipc_answer_0(callid, ENOENT);
+			async_answer_0(callid, ENOENT);
 		}
 	}
@@ -1067,5 +1067,5 @@
 {
 	/* Accept connection */
-	ipc_answer_0(iid, EOK);
+	async_answer_0(iid, EOK);
 	
 	bool cont = true;
@@ -1106,5 +1106,5 @@
 			break;
 		default:
-			ipc_answer_0(callid, ENOENT);
+			async_answer_0(callid, ENOENT);
 		}
 	}
@@ -1130,5 +1130,5 @@
 	default:
 		/* No such interface */
-		ipc_answer_0(iid, ENOENT);
+		async_answer_0(iid, ENOENT);
 	}
 }
@@ -1150,5 +1150,5 @@
 	
 	/* Register device mapper at naming service */
-	if (ipc_connect_to_me(PHONE_NS, SERVICE_DEVMAP, 0, 0, NULL, NULL) != 0)
+	if (service_register(SERVICE_DEVMAP) != EOK)
 		return -1;
 	
Index: uspace/srv/fs/devfs/devfs.c
===================================================================
--- uspace/srv/fs/devfs/devfs.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/fs/devfs/devfs.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -40,6 +40,6 @@
 
 #include <stdio.h>
-#include <ipc/ipc.h>
 #include <ipc/services.h>
+#include <ipc/ns.h>
 #include <async.h>
 #include <errno.h>
@@ -62,5 +62,5 @@
 {
 	if (iid)
-		ipc_answer_0(iid, EOK);
+		async_answer_0(iid, EOK);
 	
 	while (true) {
@@ -111,5 +111,5 @@
 			break;
 		default:
-			ipc_answer_0(callid, ENOTSUP);
+			async_answer_0(callid, ENOTSUP);
 			break;
 		}
@@ -126,5 +126,5 @@
 	}
 	
-	int vfs_phone = ipc_connect_me_to_blocking(PHONE_NS, SERVICE_VFS, 0, 0);
+	int vfs_phone = service_connect_blocking(SERVICE_VFS, 0, 0);
 	if (vfs_phone < EOK) {
 		printf(NAME ": Unable to connect to VFS\n");
Index: uspace/srv/fs/devfs/devfs_ops.c
===================================================================
--- uspace/srv/fs/devfs/devfs_ops.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/fs/devfs/devfs_ops.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -36,5 +36,4 @@
  */
 
-#include <ipc/ipc.h>
 #include <macros.h>
 #include <bool.h>
@@ -465,10 +464,10 @@
 	    0, NULL);
 	if (retval != EOK) {
-		ipc_answer_0(rid, retval);
+		async_answer_0(rid, retval);
 		return;
 	}
 	
 	free(opts);
-	ipc_answer_3(rid, EOK, 0, 0, 0);
+	async_answer_3(rid, EOK, 0, 0, 0);
 }
 
@@ -480,5 +479,5 @@
 void devfs_unmounted(ipc_callid_t rid, ipc_call_t *request)
 {
-	ipc_answer_0(rid, ENOTSUP);
+	async_answer_0(rid, ENOTSUP);
 }
 
@@ -513,6 +512,6 @@
 		size_t size;
 		if (!async_data_read_receive(&callid, &size)) {
-			ipc_answer_0(callid, EINVAL);
-			ipc_answer_0(rid, EINVAL);
+			async_answer_0(callid, EINVAL);
+			async_answer_0(rid, EINVAL);
 			return;
 		}
@@ -535,5 +534,5 @@
 			async_data_read_finalize(callid, desc[pos].name, str_size(desc[pos].name) + 1);
 			free(desc);
-			ipc_answer_1(rid, EOK, 1);
+			async_answer_1(rid, EOK, 1);
 			return;
 		}
@@ -550,5 +549,5 @@
 				async_data_read_finalize(callid, desc[pos].name, str_size(desc[pos].name) + 1);
 				free(desc);
-				ipc_answer_1(rid, EOK, 1);
+				async_answer_1(rid, EOK, 1);
 				return;
 			}
@@ -557,6 +556,6 @@
 		}
 		
-		ipc_answer_0(callid, ENOENT);
-		ipc_answer_1(rid, ENOENT, 0);
+		async_answer_0(callid, ENOENT);
+		async_answer_1(rid, ENOENT, 0);
 		return;
 	}
@@ -569,6 +568,6 @@
 		size_t size;
 		if (!async_data_read_receive(&callid, &size)) {
-			ipc_answer_0(callid, EINVAL);
-			ipc_answer_0(rid, EINVAL);
+			async_answer_0(callid, EINVAL);
+			async_answer_0(rid, EINVAL);
 			return;
 		}
@@ -580,11 +579,11 @@
 			async_data_read_finalize(callid, desc[pos].name, str_size(desc[pos].name) + 1);
 			free(desc);
-			ipc_answer_1(rid, EOK, 1);
+			async_answer_1(rid, EOK, 1);
 			return;
 		}
 		
 		free(desc);
-		ipc_answer_0(callid, ENOENT);
-		ipc_answer_1(rid, ENOENT, 0);
+		async_answer_0(callid, ENOENT);
+		async_answer_1(rid, ENOENT, 0);
 		return;
 	}
@@ -601,5 +600,5 @@
 		if (lnk == NULL) {
 			fibril_mutex_unlock(&devices_mutex);
-			ipc_answer_0(rid, ENOENT);
+			async_answer_0(rid, ENOENT);
 			return;
 		}
@@ -611,6 +610,6 @@
 		if (!async_data_read_receive(&callid, NULL)) {
 			fibril_mutex_unlock(&devices_mutex);
-			ipc_answer_0(callid, EINVAL);
-			ipc_answer_0(rid, EINVAL);
+			async_answer_0(callid, EINVAL);
+			async_answer_0(rid, EINVAL);
 			return;
 		}
@@ -623,5 +622,5 @@
 		
 		/* Forward the IPC_M_DATA_READ request to the driver */
-		ipc_forward_fast(callid, dev->phone, 0, 0, 0, IPC_FF_ROUTE_FROM_ME);
+		async_forward_fast(callid, dev->phone, 0, 0, 0, IPC_FF_ROUTE_FROM_ME);
 		fibril_mutex_unlock(&devices_mutex);
 		
@@ -632,9 +631,9 @@
 		
 		/* Driver reply is the final result of the whole operation */
-		ipc_answer_1(rid, rc, bytes);
-		return;
-	}
-	
-	ipc_answer_0(rid, ENOENT);
+		async_answer_1(rid, rc, bytes);
+		return;
+	}
+	
+	async_answer_0(rid, ENOENT);
 }
 
@@ -643,5 +642,5 @@
 	fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request);
 	if (index == 0) {
-		ipc_answer_0(rid, ENOTSUP);
+		async_answer_0(rid, ENOTSUP);
 		return;
 	}
@@ -651,5 +650,5 @@
 	if (type == DEV_HANDLE_NAMESPACE) {
 		/* Namespace directory */
-		ipc_answer_0(rid, ENOTSUP);
+		async_answer_0(rid, ENOTSUP);
 		return;
 	}
@@ -665,5 +664,5 @@
 		if (lnk == NULL) {
 			fibril_mutex_unlock(&devices_mutex);
-			ipc_answer_0(rid, ENOENT);
+			async_answer_0(rid, ENOENT);
 			return;
 		}
@@ -675,6 +674,6 @@
 		if (!async_data_write_receive(&callid, NULL)) {
 			fibril_mutex_unlock(&devices_mutex);
-			ipc_answer_0(callid, EINVAL);
-			ipc_answer_0(rid, EINVAL);
+			async_answer_0(callid, EINVAL);
+			async_answer_0(rid, EINVAL);
 			return;
 		}
@@ -687,5 +686,5 @@
 		
 		/* Forward the IPC_M_DATA_WRITE request to the driver */
-		ipc_forward_fast(callid, dev->phone, 0, 0, 0, IPC_FF_ROUTE_FROM_ME);
+		async_forward_fast(callid, dev->phone, 0, 0, 0, IPC_FF_ROUTE_FROM_ME);
 		
 		fibril_mutex_unlock(&devices_mutex);
@@ -697,14 +696,14 @@
 		
 		/* Driver reply is the final result of the whole operation */
-		ipc_answer_1(rid, rc, bytes);
-		return;
-	}
-	
-	ipc_answer_0(rid, ENOENT);
+		async_answer_1(rid, rc, bytes);
+		return;
+	}
+	
+	async_answer_0(rid, ENOENT);
 }
 
 void devfs_truncate(ipc_callid_t rid, ipc_call_t *request)
 {
-	ipc_answer_0(rid, ENOTSUP);
+	async_answer_0(rid, ENOTSUP);
 }
 
@@ -714,5 +713,5 @@
 	
 	if (index == 0) {
-		ipc_answer_0(rid, EOK);
+		async_answer_0(rid, EOK);
 		return;
 	}
@@ -722,5 +721,5 @@
 	if (type == DEV_HANDLE_NAMESPACE) {
 		/* Namespace directory */
-		ipc_answer_0(rid, EOK);
+		async_answer_0(rid, EOK);
 		return;
 	}
@@ -735,5 +734,5 @@
 		if (lnk == NULL) {
 			fibril_mutex_unlock(&devices_mutex);
-			ipc_answer_0(rid, ENOENT);
+			async_answer_0(rid, ENOENT);
 			return;
 		}
@@ -744,5 +743,5 @@
 		
 		if (dev->refcount == 0) {
-			ipc_hangup(dev->phone);
+			async_hangup(dev->phone);
 			hash_table_remove(&devices, key, DEVICES_KEYS);
 		}
@@ -750,9 +749,9 @@
 		fibril_mutex_unlock(&devices_mutex);
 		
-		ipc_answer_0(rid, EOK);
-		return;
-	}
-	
-	ipc_answer_0(rid, ENOENT);
+		async_answer_0(rid, EOK);
+		return;
+	}
+	
+	async_answer_0(rid, ENOENT);
 }
 
@@ -762,5 +761,5 @@
 	
 	if (index == 0) {
-		ipc_answer_0(rid, EOK);
+		async_answer_0(rid, EOK);
 		return;
 	}
@@ -770,5 +769,5 @@
 	if (type == DEV_HANDLE_NAMESPACE) {
 		/* Namespace directory */
-		ipc_answer_0(rid, EOK);
+		async_answer_0(rid, EOK);
 		return;
 	}
@@ -783,5 +782,5 @@
 		if (lnk == NULL) {
 			fibril_mutex_unlock(&devices_mutex);
-			ipc_answer_0(rid, ENOENT);
+			async_answer_0(rid, ENOENT);
 			return;
 		}
@@ -802,14 +801,14 @@
 		
 		/* Driver reply is the final result of the whole operation */
-		ipc_answer_0(rid, rc);
-		return;
-	}
-	
-	ipc_answer_0(rid, ENOENT);
+		async_answer_0(rid, rc);
+		return;
+	}
+	
+	async_answer_0(rid, ENOENT);
 }
 
 void devfs_destroy(ipc_callid_t rid, ipc_call_t *request)
 {
-	ipc_answer_0(rid, ENOTSUP);
+	async_answer_0(rid, ENOTSUP);
 }
 
Index: uspace/srv/fs/devfs/devfs_ops.h
===================================================================
--- uspace/srv/fs/devfs/devfs_ops.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/fs/devfs/devfs_ops.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -34,5 +34,5 @@
 #define DEVFS_DEVFS_OPS_H_
 
-#include <ipc/ipc.h>
+#include <ipc/common.h>
 #include <bool.h>
 
Index: uspace/srv/fs/fat/fat.c
===================================================================
--- uspace/srv/fs/fat/fat.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/fs/fat/fat.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -38,6 +38,6 @@
 
 #include "fat.h"
-#include <ipc/ipc.h>
 #include <ipc/services.h>
+#include <ipc/ns.h>
 #include <async.h>
 #include <errno.h>
@@ -84,5 +84,5 @@
 		 * created by IPC_M_CONNECT_TO_ME.
 		 */
-		ipc_answer_0(iid, EOK);
+		async_answer_0(iid, EOK);
 	}
 	
@@ -136,5 +136,5 @@
 			break;
 		default:
-			ipc_answer_0(callid, ENOTSUP);
+			async_answer_0(callid, ENOTSUP);
 			break;
 		}
@@ -153,5 +153,5 @@
 		goto err;
 
-	vfs_phone = ipc_connect_me_to_blocking(PHONE_NS, SERVICE_VFS, 0, 0);
+	vfs_phone = service_connect_blocking(SERVICE_VFS, 0, 0);
 	if (vfs_phone < EOK) {
 		printf(NAME ": failed to connect to VFS\n");
Index: uspace/srv/fs/fat/fat.h
===================================================================
--- uspace/srv/fs/fat/fat.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/fs/fat/fat.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -35,5 +35,4 @@
 
 #include "fat_fat.h"
-#include <ipc/ipc.h>
 #include <fibril_synch.h>
 #include <libfs.h>
Index: uspace/srv/fs/fat/fat_ops.c
===================================================================
--- uspace/srv/fs/fat/fat_ops.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/fs/fat/fat_ops.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -42,5 +42,4 @@
 #include <libfs.h>
 #include <libblock.h>
-#include <ipc/ipc.h>
 #include <ipc/services.h>
 #include <ipc/devmap.h>
@@ -955,5 +954,5 @@
 	
 	if (rc != EOK) {
-		ipc_answer_0(rid, rc);
+		async_answer_0(rid, rc);
 		return;
 	}
@@ -970,5 +969,5 @@
 	rc = block_init(devmap_handle, BS_SIZE);
 	if (rc != EOK) {
-		ipc_answer_0(rid, rc);
+		async_answer_0(rid, rc);
 		return;
 	}
@@ -978,5 +977,5 @@
 	if (rc != EOK) {
 		block_fini(devmap_handle);
-		ipc_answer_0(rid, rc);
+		async_answer_0(rid, rc);
 		return;
 	}
@@ -987,5 +986,5 @@
 	if (BPS(bs) != BS_SIZE) {
 		block_fini(devmap_handle);
-		ipc_answer_0(rid, ENOTSUP);
+		async_answer_0(rid, ENOTSUP);
 		return;
 	}
@@ -995,5 +994,5 @@
 	if (rc != EOK) {
 		block_fini(devmap_handle);
-		ipc_answer_0(rid, rc);
+		async_answer_0(rid, rc);
 		return;
 	}
@@ -1004,5 +1003,5 @@
 		(void) block_cache_fini(devmap_handle);
 		block_fini(devmap_handle);
-		ipc_answer_0(rid, rc);
+		async_answer_0(rid, rc);
 		return;
 	}
@@ -1012,5 +1011,5 @@
 		(void) block_cache_fini(devmap_handle);
 		block_fini(devmap_handle);
-		ipc_answer_0(rid, rc);
+		async_answer_0(rid, rc);
 		return;
 	}
@@ -1022,5 +1021,5 @@
 		block_fini(devmap_handle);
 		fat_idx_fini_by_devmap_handle(devmap_handle);
-		ipc_answer_0(rid, ENOMEM);
+		async_answer_0(rid, ENOMEM);
 		return;
 	}
@@ -1032,5 +1031,5 @@
 		block_fini(devmap_handle);
 		fat_idx_fini_by_devmap_handle(devmap_handle);
-		ipc_answer_0(rid, ENOMEM);
+		async_answer_0(rid, ENOMEM);
 		return;
 	}
@@ -1044,5 +1043,5 @@
 		block_fini(devmap_handle);
 		fat_idx_fini_by_devmap_handle(devmap_handle);
-		ipc_answer_0(rid, ENOMEM);
+		async_answer_0(rid, ENOMEM);
 		return;
 	}
@@ -1062,5 +1061,5 @@
 	fibril_mutex_unlock(&ridxp->lock);
 
-	ipc_answer_3(rid, EOK, ridxp->index, rootp->size, rootp->lnkcnt);
+	async_answer_3(rid, EOK, ridxp->index, rootp->size, rootp->lnkcnt);
 }
 
@@ -1079,5 +1078,5 @@
 	rc = fat_root_get(&fn, devmap_handle);
 	if (rc != EOK) {
-		ipc_answer_0(rid, rc);
+		async_answer_0(rid, rc);
 		return;
 	}
@@ -1090,5 +1089,5 @@
 	if (nodep->refcnt != 2) {
 		(void) fat_node_put(fn);
-		ipc_answer_0(rid, EBUSY);
+		async_answer_0(rid, EBUSY);
 		return;
 	}
@@ -1110,5 +1109,5 @@
 	block_fini(devmap_handle);
 
-	ipc_answer_0(rid, EOK);
+	async_answer_0(rid, EOK);
 }
 
@@ -1138,9 +1137,9 @@
 	rc = fat_node_get(&fn, devmap_handle, index);
 	if (rc != EOK) {
-		ipc_answer_0(rid, rc);
+		async_answer_0(rid, rc);
 		return;
 	}
 	if (!fn) {
-		ipc_answer_0(rid, ENOENT);
+		async_answer_0(rid, ENOENT);
 		return;
 	}
@@ -1151,6 +1150,6 @@
 	if (!async_data_read_receive(&callid, &len)) {
 		fat_node_put(fn);
-		ipc_answer_0(callid, EINVAL);
-		ipc_answer_0(rid, EINVAL);
+		async_answer_0(callid, EINVAL);
+		async_answer_0(rid, EINVAL);
 		return;
 	}
@@ -1175,6 +1174,6 @@
 			if (rc != EOK) {
 				fat_node_put(fn);
-				ipc_answer_0(callid, rc);
-				ipc_answer_0(rid, rc);
+				async_answer_0(callid, rc);
+				async_answer_0(rid, rc);
 				return;
 			}
@@ -1184,5 +1183,5 @@
 			if (rc != EOK) {
 				fat_node_put(fn);
-				ipc_answer_0(rid, rc);
+				async_answer_0(rid, rc);
 				return;
 			}
@@ -1241,12 +1240,12 @@
 miss:
 		rc = fat_node_put(fn);
-		ipc_answer_0(callid, rc != EOK ? rc : ENOENT);
-		ipc_answer_1(rid, rc != EOK ? rc : ENOENT, 0);
+		async_answer_0(callid, rc != EOK ? rc : ENOENT);
+		async_answer_1(rid, rc != EOK ? rc : ENOENT, 0);
 		return;
 
 err:
 		(void) fat_node_put(fn);
-		ipc_answer_0(callid, rc);
-		ipc_answer_0(rid, rc);
+		async_answer_0(callid, rc);
+		async_answer_0(rid, rc);
 		return;
 
@@ -1257,5 +1256,5 @@
 
 	rc = fat_node_put(fn);
-	ipc_answer_1(rid, rc, (sysarg_t)bytes);
+	async_answer_1(rid, rc, (sysarg_t)bytes);
 }
 
@@ -1277,9 +1276,9 @@
 	rc = fat_node_get(&fn, devmap_handle, index);
 	if (rc != EOK) {
-		ipc_answer_0(rid, rc);
+		async_answer_0(rid, rc);
 		return;
 	}
 	if (!fn) {
-		ipc_answer_0(rid, ENOENT);
+		async_answer_0(rid, ENOENT);
 		return;
 	}
@@ -1290,6 +1289,6 @@
 	if (!async_data_write_receive(&callid, &len)) {
 		(void) fat_node_put(fn);
-		ipc_answer_0(callid, EINVAL);
-		ipc_answer_0(rid, EINVAL);
+		async_answer_0(callid, EINVAL);
+		async_answer_0(rid, EINVAL);
 		return;
 	}
@@ -1319,6 +1318,6 @@
 		if (rc != EOK) {
 			(void) fat_node_put(fn);
-			ipc_answer_0(callid, rc);
-			ipc_answer_0(rid, rc);
+			async_answer_0(callid, rc);
+			async_answer_0(rid, rc);
 			return;
 		}
@@ -1326,6 +1325,6 @@
 		if (rc != EOK) {
 			(void) fat_node_put(fn);
-			ipc_answer_0(callid, rc);
-			ipc_answer_0(rid, rc);
+			async_answer_0(callid, rc);
+			async_answer_0(rid, rc);
 			return;
 		}
@@ -1336,5 +1335,5 @@
 		if (rc != EOK) {
 			(void) fat_node_put(fn);
-			ipc_answer_0(rid, rc);
+			async_answer_0(rid, rc);
 			return;
 		}
@@ -1345,5 +1344,5 @@
 		size = nodep->size;
 		rc = fat_node_put(fn);
-		ipc_answer_2(rid, rc, bytes, nodep->size);
+		async_answer_2(rid, rc, bytes, nodep->size);
 		return;
 	} else {
@@ -1361,6 +1360,6 @@
 			/* could not allocate a chain of nclsts clusters */
 			(void) fat_node_put(fn);
-			ipc_answer_0(callid, rc);
-			ipc_answer_0(rid, rc);
+			async_answer_0(callid, rc);
+			async_answer_0(rid, rc);
 			return;
 		}
@@ -1370,6 +1369,6 @@
 			(void) fat_free_clusters(bs, devmap_handle, mcl);
 			(void) fat_node_put(fn);
-			ipc_answer_0(callid, rc);
-			ipc_answer_0(rid, rc);
+			async_answer_0(callid, rc);
+			async_answer_0(rid, rc);
 			return;
 		}
@@ -1379,6 +1378,6 @@
 			(void) fat_free_clusters(bs, devmap_handle, mcl);
 			(void) fat_node_put(fn);
-			ipc_answer_0(callid, rc);
-			ipc_answer_0(rid, rc);
+			async_answer_0(callid, rc);
+			async_answer_0(rid, rc);
 			return;
 		}
@@ -1390,5 +1389,5 @@
 			(void) fat_free_clusters(bs, devmap_handle, mcl);
 			(void) fat_node_put(fn);
-			ipc_answer_0(rid, rc);
+			async_answer_0(rid, rc);
 			return;
 		}
@@ -1401,5 +1400,5 @@
 			(void) fat_free_clusters(bs, devmap_handle, mcl);
 			(void) fat_node_put(fn);
-			ipc_answer_0(rid, rc);
+			async_answer_0(rid, rc);
 			return;
 		}
@@ -1407,5 +1406,5 @@
 		nodep->dirty = true;		/* need to sync node */
 		rc = fat_node_put(fn);
-		ipc_answer_2(rid, rc, bytes, size);
+		async_answer_2(rid, rc, bytes, size);
 		return;
 	}
@@ -1425,9 +1424,9 @@
 	rc = fat_node_get(&fn, devmap_handle, index);
 	if (rc != EOK) {
-		ipc_answer_0(rid, rc);
+		async_answer_0(rid, rc);
 		return;
 	}
 	if (!fn) {
-		ipc_answer_0(rid, ENOENT);
+		async_answer_0(rid, ENOENT);
 		return;
 	}
@@ -1475,5 +1474,5 @@
 out:
 	fat_node_put(fn);
-	ipc_answer_0(rid, rc);
+	async_answer_0(rid, rc);
 	return;
 }
@@ -1481,5 +1480,5 @@
 void fat_close(ipc_callid_t rid, ipc_call_t *request)
 {
-	ipc_answer_0(rid, EOK);
+	async_answer_0(rid, EOK);
 }
 
@@ -1493,14 +1492,14 @@
 	rc = fat_node_get(&fn, devmap_handle, index);
 	if (rc != EOK) {
-		ipc_answer_0(rid, rc);
+		async_answer_0(rid, rc);
 		return;
 	}
 	if (!fn) {
-		ipc_answer_0(rid, ENOENT);
+		async_answer_0(rid, ENOENT);
 		return;
 	}
 
 	rc = fat_destroy_node(fn);
-	ipc_answer_0(rid, rc);
+	async_answer_0(rid, rc);
 }
 
@@ -1523,9 +1522,9 @@
 	int rc = fat_node_get(&fn, devmap_handle, index);
 	if (rc != EOK) {
-		ipc_answer_0(rid, rc);
+		async_answer_0(rid, rc);
 		return;
 	}
 	if (!fn) {
-		ipc_answer_0(rid, ENOENT);
+		async_answer_0(rid, ENOENT);
 		return;
 	}
@@ -1537,5 +1536,5 @@
 	
 	fat_node_put(fn);
-	ipc_answer_0(rid, rc);
+	async_answer_0(rid, rc);
 }
 
Index: uspace/srv/fs/tmpfs/tmpfs.c
===================================================================
--- uspace/srv/fs/tmpfs/tmpfs.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/fs/tmpfs/tmpfs.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -42,6 +42,6 @@
 
 #include "tmpfs.h"
-#include <ipc/ipc.h>
 #include <ipc/services.h>
+#include <ipc/ns.h>
 #include <async.h>
 #include <errno.h>
@@ -90,5 +90,5 @@
 		 * created by IPC_M_CONNECT_TO_ME.
 		 */
-		ipc_answer_0(iid, EOK);
+		async_answer_0(iid, EOK);
 	}
 	
@@ -142,5 +142,5 @@
 			break;
 		default:
-			ipc_answer_0(callid, ENOTSUP);
+			async_answer_0(callid, ENOTSUP);
 			break;
 		}
@@ -157,5 +157,5 @@
 	}
 
-	int vfs_phone = ipc_connect_me_to_blocking(PHONE_NS, SERVICE_VFS, 0, 0);
+	int vfs_phone = service_connect_blocking(SERVICE_VFS, 0, 0);
 	if (vfs_phone < EOK) {
 		printf(NAME ": Unable to connect to VFS\n");
Index: uspace/srv/fs/tmpfs/tmpfs.h
===================================================================
--- uspace/srv/fs/tmpfs/tmpfs.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/fs/tmpfs/tmpfs.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -34,5 +34,4 @@
 #define TMPFS_TMPFS_H_
 
-#include <ipc/ipc.h>
 #include <libfs.h>
 #include <atomic.h>
Index: uspace/srv/fs/tmpfs/tmpfs_ops.c
===================================================================
--- uspace/srv/fs/tmpfs/tmpfs_ops.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/fs/tmpfs/tmpfs_ops.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -39,5 +39,4 @@
 #include "tmpfs.h"
 #include "../../vfs/vfs.h"
-#include <ipc/ipc.h>
 #include <macros.h>
 #include <stdint.h>
@@ -450,5 +449,5 @@
 	rc = async_data_write_accept((void **) &opts, true, 0, 0, 0, NULL);
 	if (rc != EOK) {
-		ipc_answer_0(rid, rc);
+		async_answer_0(rid, rc);
 		return;
 	}
@@ -459,5 +458,5 @@
 		(void) tmpfs_node_put(rootfn);
 		free(opts);
-		ipc_answer_0(rid, EEXIST);
+		async_answer_0(rid, EEXIST);
 		return;
 	}
@@ -466,5 +465,5 @@
 	if (!tmpfs_instance_init(devmap_handle)) {
 		free(opts);
-		ipc_answer_0(rid, ENOMEM);
+		async_answer_0(rid, ENOMEM);
 		return;
 	}
@@ -475,10 +474,10 @@
 	if (str_cmp(opts, "restore") == 0) {
 		if (tmpfs_restore(devmap_handle))
-			ipc_answer_3(rid, EOK, rootp->index, rootp->size,
+			async_answer_3(rid, EOK, rootp->index, rootp->size,
 			    rootp->lnkcnt);
 		else
-			ipc_answer_0(rid, ELIMIT);
+			async_answer_0(rid, ELIMIT);
 	} else {
-		ipc_answer_3(rid, EOK, rootp->index, rootp->size,
+		async_answer_3(rid, EOK, rootp->index, rootp->size,
 		    rootp->lnkcnt);
 	}
@@ -496,5 +495,5 @@
 
 	tmpfs_instance_done(devmap_handle);
-	ipc_answer_0(rid, EOK);
+	async_answer_0(rid, EOK);
 }
 
@@ -526,5 +525,5 @@
 	hlp = hash_table_find(&nodes, key);
 	if (!hlp) {
-		ipc_answer_0(rid, ENOENT);
+		async_answer_0(rid, ENOENT);
 		return;
 	}
@@ -538,6 +537,6 @@
 	size_t size;
 	if (!async_data_read_receive(&callid, &size)) {
-		ipc_answer_0(callid, EINVAL);
-		ipc_answer_0(rid, EINVAL);
+		async_answer_0(callid, EINVAL);
+		async_answer_0(rid, EINVAL);
 		return;
 	}
@@ -566,6 +565,6 @@
 
 		if (lnk == &nodep->cs_head) {
-			ipc_answer_0(callid, ENOENT);
-			ipc_answer_1(rid, ENOENT, 0);
+			async_answer_0(callid, ENOENT);
+			async_answer_1(rid, ENOENT, 0);
 			return;
 		}
@@ -581,5 +580,5 @@
 	 * Answer the VFS_READ call.
 	 */
-	ipc_answer_1(rid, EOK, bytes);
+	async_answer_1(rid, EOK, bytes);
 }
 
@@ -601,5 +600,5 @@
 	hlp = hash_table_find(&nodes, key);
 	if (!hlp) {
-		ipc_answer_0(rid, ENOENT);
+		async_answer_0(rid, ENOENT);
 		return;
 	}
@@ -613,6 +612,6 @@
 	size_t size;
 	if (!async_data_write_receive(&callid, &size)) {
-		ipc_answer_0(callid, EINVAL);	
-		ipc_answer_0(rid, EINVAL);
+		async_answer_0(callid, EINVAL);	
+		async_answer_0(rid, EINVAL);
 		return;
 	}
@@ -624,5 +623,5 @@
 		/* The file size is not changing. */
 		(void) async_data_write_finalize(callid, nodep->data + pos, size);
-		ipc_answer_2(rid, EOK, size, nodep->size);
+		async_answer_2(rid, EOK, size, nodep->size);
 		return;
 	}
@@ -637,6 +636,6 @@
 	void *newdata = realloc(nodep->data, nodep->size + delta);
 	if (!newdata) {
-		ipc_answer_0(callid, ENOMEM);
-		ipc_answer_2(rid, EOK, 0, nodep->size);
+		async_answer_0(callid, ENOMEM);
+		async_answer_2(rid, EOK, 0, nodep->size);
 		return;
 	}
@@ -646,5 +645,5 @@
 	nodep->data = newdata;
 	(void) async_data_write_finalize(callid, nodep->data + pos, size);
-	ipc_answer_2(rid, EOK, size, nodep->size);
+	async_answer_2(rid, EOK, size, nodep->size);
 }
 
@@ -665,5 +664,5 @@
 	link_t *hlp = hash_table_find(&nodes, key);
 	if (!hlp) {
-		ipc_answer_0(rid, ENOENT);
+		async_answer_0(rid, ENOENT);
 		return;
 	}
@@ -672,10 +671,10 @@
 	
 	if (size == nodep->size) {
-		ipc_answer_0(rid, EOK);
+		async_answer_0(rid, EOK);
 		return;
 	}
 	
 	if (size > SIZE_MAX) {
-		ipc_answer_0(rid, ENOMEM);
+		async_answer_0(rid, ENOMEM);
 		return;
 	}
@@ -683,5 +682,5 @@
 	void *newdata = realloc(nodep->data, size);
 	if (!newdata) {
-		ipc_answer_0(rid, ENOMEM);
+		async_answer_0(rid, ENOMEM);
 		return;
 	}
@@ -694,10 +693,10 @@
 	nodep->size = size;
 	nodep->data = newdata;
-	ipc_answer_0(rid, EOK);
+	async_answer_0(rid, EOK);
 }
 
 void tmpfs_close(ipc_callid_t rid, ipc_call_t *request)
 {
-	ipc_answer_0(rid, EOK);
+	async_answer_0(rid, EOK);
 }
 
@@ -715,5 +714,5 @@
 	hlp = hash_table_find(&nodes, key);
 	if (!hlp) {
-		ipc_answer_0(rid, ENOENT);
+		async_answer_0(rid, ENOENT);
 		return;
 	}
@@ -721,5 +720,5 @@
 	    nh_link);
 	rc = tmpfs_destroy_node(FS_NODE(nodep));
-	ipc_answer_0(rid, rc);
+	async_answer_0(rid, rc);
 }
 
@@ -740,5 +739,5 @@
 	 * thus the sync operation is a no-op.
 	 */
-	ipc_answer_0(rid, EOK);
+	async_answer_0(rid, EOK);
 }
 
Index: uspace/srv/hid/adb_mouse/adb_dev.c
===================================================================
--- uspace/srv/hid/adb_mouse/adb_dev.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/hid/adb_mouse/adb_dev.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -34,5 +34,4 @@
  */
 
-#include <ipc/ipc.h>
 #include <ipc/adb.h>
 #include <async.h>
@@ -68,13 +67,9 @@
 
 	/* NB: The callback connection is slotted for removal */
-	sysarg_t taskhash;
-	sysarg_t phonehash;
-	if (ipc_connect_to_me(dev_phone, 0, 0, 0, &taskhash, &phonehash) != 0) {
+	if (async_connect_to_me(dev_phone, 0, 0, 0, adb_dev_events) != 0) {
 		printf(NAME ": Failed to create callback from device\n");
 		return false;
 	}
-
-	async_new_connection(taskhash, phonehash, 0, NULL, adb_dev_events);
-
+	
 	return 0;
 }
@@ -100,5 +95,5 @@
 			retval = ENOENT;
 		}
-		ipc_answer_0(callid, retval);
+		async_answer_0(callid, retval);
 	}
 }
Index: uspace/srv/hid/adb_mouse/adb_mouse.c
===================================================================
--- uspace/srv/hid/adb_mouse/adb_mouse.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/hid/adb_mouse/adb_mouse.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -39,5 +39,4 @@
  */
 
-#include <ipc/ipc.h>
 #include <ipc/mouse.h>
 #include <stdio.h>
@@ -98,5 +97,5 @@
 	int retval;
 
-	ipc_answer_0(iid, EOK);
+	async_answer_0(iid, EOK);
 
 	while (1) {
@@ -105,9 +104,9 @@
 		case IPC_M_PHONE_HUNGUP:
 			if (client_phone != -1) {
-				ipc_hangup(client_phone);
+				async_hangup(client_phone);
 				client_phone = -1;
 			}
 
-			ipc_answer_0(callid, EOK);
+			async_answer_0(callid, EOK);
 			return;
 		case IPC_M_CONNECT_TO_ME:
@@ -122,5 +121,5 @@
 			retval = EINVAL;
 		}
-		ipc_answer_0(callid, retval);
+		async_answer_0(callid, retval);
 	}
 }
Index: uspace/srv/hid/char_mouse/char_mouse.c
===================================================================
--- uspace/srv/hid/char_mouse/char_mouse.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/hid/char_mouse/char_mouse.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -39,5 +39,4 @@
  */
 
-#include <ipc/ipc.h>
 #include <ipc/mouse.h>
 #include <stdio.h>
@@ -83,5 +82,5 @@
 	int retval;
 
-	ipc_answer_0(iid, EOK);
+	async_answer_0(iid, EOK);
 
 	while (1) {
@@ -90,9 +89,9 @@
 		case IPC_M_PHONE_HUNGUP:
 			if (client_phone != -1) {
-				ipc_hangup(client_phone);
+				async_hangup(client_phone);
 				client_phone = -1;
 			}
 
-			ipc_answer_0(callid, EOK);
+			async_answer_0(callid, EOK);
 			return;
 		case IPC_M_CONNECT_TO_ME:
@@ -107,5 +106,5 @@
 			retval = EINVAL;
 		}
-		ipc_answer_0(callid, retval);
+		async_answer_0(callid, retval);
 	}
 }
Index: uspace/srv/hid/char_mouse/chardev.c
===================================================================
--- uspace/srv/hid/char_mouse/chardev.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/hid/char_mouse/chardev.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -34,5 +34,4 @@
  */
 
-#include <ipc/ipc.h>
 #include <ipc/char.h>
 #include <async.h>
@@ -70,12 +69,8 @@
 
 	/* NB: The callback connection is slotted for removal */
-	sysarg_t taskhash;
-	sysarg_t phonehash;
-	if (ipc_connect_to_me(dev_phone, 0, 0, 0, &taskhash, &phonehash) != 0) {
+	if (async_connect_to_me(dev_phone, 0, 0, 0, chardev_events) != 0) {
 		printf(NAME ": Failed to create callback from device\n");
 		return false;
 	}
-
-	async_new_connection(taskhash, phonehash, 0, NULL, chardev_events);
 
 	return 0;
@@ -115,5 +110,5 @@
 			retval = ENOENT;
 		}
-		ipc_answer_0(callid, retval);
+		async_answer_0(callid, retval);
 	}
 }
Index: uspace/srv/hid/console/console.c
===================================================================
--- uspace/srv/hid/console/console.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/hid/console/console.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -34,5 +34,4 @@
 
 #include <libc.h>
-#include <ipc/ipc.h>
 #include <ipc/kbd.h>
 #include <io/keycode.h>
@@ -40,4 +39,5 @@
 #include <ipc/fb.h>
 #include <ipc/services.h>
+#include <ipc/ns.h>
 #include <errno.h>
 #include <ipc/console.h>
@@ -116,5 +116,5 @@
 static void curs_hide_sync(void)
 {
-	ipc_call_sync_1_0(fb_info.phone, FB_CURSOR_VISIBILITY, false); 
+	async_req_1_0(fb_info.phone, FB_CURSOR_VISIBILITY, false); 
 }
 
@@ -131,20 +131,20 @@
 static void screen_yield(void)
 {
-	ipc_call_sync_0_0(fb_info.phone, FB_SCREEN_YIELD);
+	async_req_0_0(fb_info.phone, FB_SCREEN_YIELD);
 }
 
 static void screen_reclaim(void)
 {
-	ipc_call_sync_0_0(fb_info.phone, FB_SCREEN_RECLAIM);
+	async_req_0_0(fb_info.phone, FB_SCREEN_RECLAIM);
 }
 
 static void kbd_yield(void)
 {
-	ipc_call_sync_0_0(kbd_phone, KBD_YIELD);
+	async_req_0_0(kbd_phone, KBD_YIELD);
 }
 
 static void kbd_reclaim(void)
 {
-	ipc_call_sync_0_0(kbd_phone, KBD_RECLAIM);
+	async_req_0_0(kbd_phone, KBD_RECLAIM);
 }
 
@@ -437,5 +437,5 @@
 			retval = ENOENT;
 		}
-		ipc_answer_0(callid, retval);
+		async_answer_0(callid, retval);
 	}
 }
@@ -472,5 +472,5 @@
 		}
 
-		ipc_answer_0(callid, retval);
+		async_answer_0(callid, retval);
 	}
 }
@@ -483,5 +483,5 @@
 	
 	if (rc != EOK) {
-		ipc_answer_0(rid, rc);
+		async_answer_0(rid, rc);
 		return;
 	}
@@ -498,5 +498,5 @@
 	
 	gcons_notify_char(cons->index);
-	ipc_answer_1(rid, EOK, size);
+	async_answer_1(rid, EOK, size);
 	
 	free(buf);
@@ -508,6 +508,6 @@
 	size_t size;
 	if (!async_data_read_receive(&callid, &size)) {
-		ipc_answer_0(callid, EINVAL);
-		ipc_answer_0(rid, EINVAL);
+		async_answer_0(callid, EINVAL);
+		async_answer_0(rid, EINVAL);
 		return;
 	}
@@ -515,6 +515,6 @@
 	char *buf = (char *) malloc(size);
 	if (buf == NULL) {
-		ipc_answer_0(callid, ENOMEM);
-		ipc_answer_0(rid, ENOMEM);
+		async_answer_0(callid, ENOMEM);
+		async_answer_0(rid, ENOMEM);
 		return;
 	}
@@ -534,5 +534,5 @@
 	if (pos == size) {
 		(void) async_data_read_finalize(callid, buf, size);
-		ipc_answer_1(rid, EOK, size);
+		async_answer_1(rid, EOK, size);
 		free(buf);
 	} else {
@@ -552,5 +552,5 @@
 recheck:
 	if (keybuffer_pop(&cons->keybuffer, &ev)) {
-		ipc_answer_4(rid, EOK, ev.type, ev.key, ev.mods, ev.c);
+		async_answer_4(rid, EOK, ev.type, ev.key, ev.mods, ev.c);
 	} else {
 		fibril_condvar_wait(&input_cv, &input_mutex);
@@ -578,5 +578,5 @@
 	
 	if (cons == NULL) {
-		ipc_answer_0(iid, ENOENT);
+		async_answer_0(iid, ENOENT);
 		return;
 	}
@@ -597,5 +597,5 @@
 	
 	/* Accept the connection */
-	ipc_answer_0(iid, EOK);
+	async_answer_0(iid, EOK);
 	
 	while (true) {
@@ -657,5 +657,5 @@
 			rc = ccap_fb_to_con(fb_info.color_cap, &arg1);
 			if (rc != EOK) {
-				ipc_answer_0(callid, rc);
+				async_answer_0(callid, rc);
 				continue;
 			}
@@ -701,5 +701,5 @@
 			break;
 		}
-		ipc_answer_3(callid, EOK, arg1, arg2, arg3);
+		async_answer_3(callid, EOK, arg1, arg2, arg3);
 	}
 }
@@ -726,13 +726,9 @@
 	
 	/* NB: The callback connection is slotted for removal */
-	sysarg_t taskhash;
-	sysarg_t phonehash;
-	if (ipc_connect_to_me(kbd_phone, SERVICE_CONSOLE, 0, 0, &taskhash,
-	    &phonehash) != 0) {
+	if (async_connect_to_me(kbd_phone, SERVICE_CONSOLE, 0, 0, keyboard_events)
+	    != 0) {
 		printf(NAME ": Failed to create callback from input device\n");
 		return false;
 	}
-	
-	async_new_connection(taskhash, phonehash, 0, NULL, keyboard_events);
 	
 	/* Connect to mouse device */
@@ -751,6 +747,6 @@
 	}
 	
-	if (ipc_connect_to_me(mouse_phone, SERVICE_CONSOLE, 0, 0, &taskhash,
-	    &phonehash) != 0) {
+	if (async_connect_to_me(mouse_phone, SERVICE_CONSOLE, 0, 0, mouse_events)
+	    != 0) {
 		printf(NAME ": Failed to create callback from mouse device\n");
 		mouse_phone = -1;
@@ -758,9 +754,8 @@
 	}
 	
-	async_new_connection(taskhash, phonehash, 0, NULL, mouse_events);
 skip_mouse:
 	
 	/* Connect to framebuffer driver */
-	fb_info.phone = ipc_connect_me_to_blocking(PHONE_NS, SERVICE_VIDEO, 0, 0);
+	fb_info.phone = service_connect_blocking(SERVICE_VIDEO, 0, 0);
 	if (fb_info.phone < 0) {
 		printf(NAME ": Failed to connect to video service\n");
@@ -838,8 +833,7 @@
 	
 	/* Receive kernel notifications */
+	async_set_interrupt_received(interrupt_received);
 	if (event_subscribe(EVENT_KCONSOLE, 0) != EOK)
 		printf(NAME ": Error registering kconsole notifications\n");
-	
-	async_set_interrupt_received(interrupt_received);
 	
 	return true;
Index: uspace/srv/hid/console/gcons.c
===================================================================
--- uspace/srv/hid/console/gcons.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/hid/console/gcons.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -34,5 +34,4 @@
 
 #include <ipc/fb.h>
-#include <ipc/ipc.h>
 #include <async.h>
 #include <stdio.h>
Index: uspace/srv/hid/fb/ega.c
===================================================================
--- uspace/srv/hid/fb/ega.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/hid/fb/ega.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -39,5 +39,4 @@
 #include <align.h>
 #include <async.h>
-#include <ipc/ipc.h>
 #include <errno.h>
 #include <stdio.h>
@@ -46,5 +45,4 @@
 #include <as.h>
 #include <ipc/fb.h>
-#include <ipc/ipc.h>
 #include <ipc/ns.h>
 #include <ipc/services.h>
@@ -262,5 +260,5 @@
 	
 	if (client_connected) {
-		ipc_answer_0(iid, ELIMIT);
+		async_answer_0(iid, ELIMIT);
 		return;
 	}
@@ -268,5 +266,5 @@
 	/* Accept connection */
 	client_connected = 1;
-	ipc_answer_0(iid, EOK);
+	async_answer_0(iid, EOK);
 	
 	while (true) {
@@ -296,5 +294,5 @@
 		case IPC_M_PHONE_HUNGUP:
 			client_connected = 0;
-			ipc_answer_0(callid, EOK);
+			async_answer_0(callid, EOK);
 			
 			/* Exit thread */
@@ -332,8 +330,8 @@
 			break;
 		case FB_GET_CSIZE:
-			ipc_answer_2(callid, EOK, scr_width, scr_height);
+			async_answer_2(callid, EOK, scr_width, scr_height);
 			continue;
 		case FB_GET_COLOR_CAP:
-			ipc_answer_1(callid, EOK, FB_CCAP_INDEXED);
+			async_answer_1(callid, EOK, FB_CCAP_INDEXED);
 			continue;
 		case FB_CLEAR:
@@ -440,5 +438,5 @@
 			retval = EINVAL;
 		}
-		ipc_answer_0(callid, retval);
+		async_answer_0(callid, retval);
 	}
 }
Index: uspace/srv/hid/fb/fb.c
===================================================================
--- uspace/srv/hid/fb/fb.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/hid/fb/fb.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -47,5 +47,4 @@
 #include <as.h>
 #include <ipc/fb.h>
-#include <ipc/ipc.h>
 #include <ipc/ns.h>
 #include <ipc/services.h>
@@ -1089,5 +1088,5 @@
 			void *dest = as_get_mappable_page(IPC_GET_ARG2(*call));
 			shm_size = IPC_GET_ARG2(*call);
-			if (ipc_answer_1(callid, EOK, (sysarg_t) dest)) {
+			if (async_answer_1(callid, EOK, (sysarg_t) dest)) {
 				shm_id = 0;
 				return false;
@@ -1166,5 +1165,5 @@
 	
 	if (handled)
-		ipc_answer_0(callid, retval);
+		async_answer_0(callid, retval);
 	return handled;
 }
@@ -1445,5 +1444,5 @@
 	}
 	if (handled)
-		ipc_answer_0(callid, retval);
+		async_answer_0(callid, retval);
 	return handled;
 }
@@ -1498,5 +1497,5 @@
 	
 	if (handled)
-		ipc_answer_0(callid, retval);
+		async_answer_0(callid, retval);
 	return handled;
 	
@@ -1582,5 +1581,5 @@
 	
 	if (client_connected) {
-		ipc_answer_0(iid, ELIMIT);
+		async_answer_0(iid, ELIMIT);
 		return;
 	}
@@ -1588,5 +1587,5 @@
 	/* Accept connection */
 	client_connected = true;
-	ipc_answer_0(iid, EOK);
+	async_answer_0(iid, EOK);
 	
 	while (true) {
@@ -1641,5 +1640,5 @@
 				break;
 			}
-			ipc_answer_0(callid, EOK);
+			async_answer_0(callid, EOK);
 			
 			draw_char(vport, ch, col, row);
@@ -1674,8 +1673,8 @@
 			break;
 		case FB_GET_CSIZE:
-			ipc_answer_2(callid, EOK, vport->cols, vport->rows);
+			async_answer_2(callid, EOK, vport->cols, vport->rows);
 			continue;
 		case FB_GET_COLOR_CAP:
-			ipc_answer_1(callid, EOK, FB_CCAP_RGB);
+			async_answer_1(callid, EOK, FB_CCAP_RGB);
 			continue;
 		case FB_SCROLL:
@@ -1742,5 +1741,5 @@
 			break;
 		case FB_GET_RESOLUTION:
-			ipc_answer_2(callid, EOK, screen.xres, screen.yres);
+			async_answer_2(callid, EOK, screen.xres, screen.yres);
 			continue;
 		case FB_POINTER_MOVE:
@@ -1756,5 +1755,5 @@
 			retval = ENOENT;
 		}
-		ipc_answer_0(callid, retval);
+		async_answer_0(callid, retval);
 	}
 }
Index: uspace/srv/hid/fb/main.c
===================================================================
--- uspace/srv/hid/fb/main.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/hid/fb/main.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -27,6 +27,6 @@
  */
 
-#include <ipc/ipc.h>
 #include <ipc/services.h>
+#include <ipc/ns.h>
 #include <sysinfo.h>
 #include <async.h>
@@ -51,5 +51,5 @@
 	
 	dest = as_get_mappable_page(IPC_GET_ARG2(*call));
-	if (ipc_answer_1(callid, EOK, (sysarg_t) dest) == 0) {
+	if (async_answer_1(callid, EOK, (sysarg_t) dest) == 0) {
 		if (*area)
 			as_area_destroy(*area);
@@ -114,5 +114,5 @@
 		return -1;
 	
-	if (ipc_connect_to_me(PHONE_NS, SERVICE_VIDEO, 0, 0, NULL, NULL) != 0)
+	if (service_register(SERVICE_VIDEO) != EOK)
 		return -1;
 	
Index: uspace/srv/hid/fb/serial_console.c
===================================================================
--- uspace/srv/hid/fb/serial_console.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/hid/fb/serial_console.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -39,5 +39,4 @@
 
 #include <stdio.h>
-#include <ipc/ipc.h>
 #include <async.h>
 #include <ipc/fb.h>
@@ -319,10 +318,10 @@
 	
 	if (client_connected) {
-		ipc_answer_0(iid, ELIMIT);
+		async_answer_0(iid, ELIMIT);
 		return;
 	}
 	
 	client_connected = 1;
-	ipc_answer_0(iid, EOK);
+	async_answer_0(iid, EOK);
 	
 	/* Clear the terminal, set scrolling region
@@ -348,5 +347,5 @@
 		case IPC_M_PHONE_HUNGUP:
 			client_connected = 0;
-			ipc_answer_0(callid, EOK);
+			async_answer_0(callid, EOK);
 			
 			/* Exit thread */
@@ -407,8 +406,8 @@
 			break;
 		case FB_GET_CSIZE:
-			ipc_answer_2(callid, EOK, scr_width, scr_height);
+			async_answer_2(callid, EOK, scr_width, scr_height);
 			continue;
 		case FB_GET_COLOR_CAP:
-			ipc_answer_1(callid, EOK, color ? FB_CCAP_INDEXED :
+			async_answer_1(callid, EOK, color ? FB_CCAP_INDEXED :
 			    FB_CCAP_STYLE);
 			continue;
@@ -478,5 +477,5 @@
 			retval = ENOENT;
 		}
-		ipc_answer_0(callid, retval);
+		async_answer_0(callid, retval);
 	}
 }
Index: uspace/srv/hid/fb/serial_console.h
===================================================================
--- uspace/srv/hid/fb/serial_console.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/hid/fb/serial_console.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -39,5 +39,6 @@
 #define FB_SERIAL_CONSOLE_H_
 
-#include <ipc/ipc.h>
+#include <sys/types.h>
+#include <ipc/common.h>
 
 typedef void (*putc_function_t)(char);
Index: uspace/srv/hid/kbd/generic/kbd.c
===================================================================
--- uspace/srv/hid/kbd/generic/kbd.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/hid/kbd/generic/kbd.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -36,5 +36,4 @@
  */
 
-#include <ipc/ipc.h>
 #include <ipc/services.h>
 #include <ipc/kbd.h>
@@ -173,5 +172,5 @@
 	int retval;
 
-	ipc_answer_0(iid, EOK);
+	async_answer_0(iid, EOK);
 
 	while (1) {
@@ -180,9 +179,9 @@
 		case IPC_M_PHONE_HUNGUP:
 			if (client_phone != -1) {
-				ipc_hangup(client_phone);
+				async_hangup(client_phone);
 				client_phone = -1;
 			}
 			
-			ipc_answer_0(callid, EOK);
+			async_answer_0(callid, EOK);
 			return;
 		case IPC_M_CONNECT_TO_ME:
@@ -205,5 +204,5 @@
 			retval = EINVAL;
 		}
-		ipc_answer_0(callid, retval);
+		async_answer_0(callid, retval);
 	}	
 }
@@ -223,8 +222,6 @@
 	
 	if (cir_service) {
-		while (cir_phone < 0) {
-			cir_phone = ipc_connect_me_to_blocking(PHONE_NS, cir_service,
-			    0, 0);
-		}
+		while (cir_phone < 0)
+			cir_phone = service_connect_blocking(cir_service, 0, 0);
 	}
 	
Index: uspace/srv/hid/kbd/port/adb.c
===================================================================
--- uspace/srv/hid/kbd/port/adb.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/hid/kbd/port/adb.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -35,5 +35,4 @@
  */
 
-#include <ipc/ipc.h>
 #include <ipc/adb.h>
 #include <async.h>
@@ -71,12 +70,8 @@
 
 	/* NB: The callback connection is slotted for removal */
-	sysarg_t taskhash;
-	sysarg_t phonehash;
-	if (ipc_connect_to_me(dev_phone, 0, 0, 0, &taskhash, &phonehash) != 0) {
+	if (async_connect_to_me(dev_phone, 0, 0, 0, kbd_port_events) != 0) {
 		printf(NAME ": Failed to create callback from device\n");
 		return false;
 	}
-
-	async_new_connection(taskhash, phonehash, 0, NULL, kbd_port_events);
 
 	return 0;
@@ -116,5 +111,5 @@
 			retval = ENOENT;
 		}
-		ipc_answer_0(callid, retval);
+		async_answer_0(callid, retval);
 	}
 }
Index: uspace/srv/hid/kbd/port/chardev.c
===================================================================
--- uspace/srv/hid/kbd/port/chardev.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/hid/kbd/port/chardev.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -35,5 +35,4 @@
  */
 
-#include <ipc/ipc.h>
 #include <ipc/char.h>
 #include <async.h>
@@ -91,12 +90,8 @@
 
 	/* NB: The callback connection is slotted for removal */
-	sysarg_t taskhash;
-	sysarg_t phonehash;
-	if (ipc_connect_to_me(dev_phone, 0, 0, 0, &taskhash, &phonehash) != 0) {
+	if (async_connect_to_me(dev_phone, 0, 0, 0, kbd_port_events) != 0) {
 		printf(NAME ": Failed to create callback from device\n");
 		return -1;
 	}
-
-	async_new_connection(taskhash, phonehash, 0, NULL, kbd_port_events);
 
 	return 0;
@@ -136,5 +131,5 @@
 			retval = ENOENT;
 		}
-		ipc_answer_0(callid, retval);
+		async_answer_0(callid, retval);
 	}
 }
Index: uspace/srv/hid/kbd/port/gxemul.c
===================================================================
--- uspace/srv/hid/kbd/port/gxemul.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/hid/kbd/port/gxemul.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -35,5 +35,4 @@
  */
 
-#include <ipc/ipc.h>
 #include <async.h>
 #include <sysinfo.h>
@@ -74,5 +73,5 @@
 	async_set_interrupt_received(gxemul_irq_handler);
 	gxemul_cmds[0].addr = (void *) addr;
-	ipc_register_irq(inr, device_assign_devno(), 0, &gxemul_kbd);
+	register_irq(inr, device_assign_devno(), 0, &gxemul_kbd);
 	return 0;
 }
Index: uspace/srv/hid/kbd/port/msim.c
===================================================================
--- uspace/srv/hid/kbd/port/msim.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/hid/kbd/port/msim.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -35,5 +35,4 @@
  */
 
-#include <ipc/ipc.h>
 #include <async.h>
 #include <sysinfo.h>
@@ -74,5 +73,5 @@
 	msim_cmds[0].addr = (void *) vaddr;
 	async_set_interrupt_received(msim_irq_handler);
-	ipc_register_irq(inr, device_assign_devno(), 0, &msim_kbd);
+	register_irq(inr, device_assign_devno(), 0, &msim_kbd);
 	
 	return 0;
Index: uspace/srv/hid/kbd/port/ns16550.c
===================================================================
--- uspace/srv/hid/kbd/port/ns16550.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/hid/kbd/port/ns16550.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -35,5 +35,4 @@
  */
 
-#include <ipc/ipc.h>
 #include <ipc/irc.h>
 #include <async.h>
@@ -111,5 +110,5 @@
 	
 	async_set_interrupt_received(ns16550_irq_handler);
-	ipc_register_irq(inr, device_assign_devno(), inr, &ns16550_kbd);
+	register_irq(inr, device_assign_devno(), inr, &ns16550_kbd);
 	
 	return pio_enable((void *) ns16550_physical, 8, &vaddr);
Index: uspace/srv/hid/kbd/port/pl050.c
===================================================================
--- uspace/srv/hid/kbd/port/pl050.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/hid/kbd/port/pl050.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -37,5 +37,4 @@
 #include <ddi.h>
 #include <libarch/ddi.h>
-#include <ipc/ipc.h>
 #include <async.h>
 #include <unistd.h>
@@ -101,5 +100,5 @@
 	
 	async_set_interrupt_received(pl050_irq_handler);
-	ipc_register_irq(inr, device_assign_devno(), 0, &pl050_kbd);
+	register_irq(inr, device_assign_devno(), 0, &pl050_kbd);
 	
 	return 0;
Index: uspace/srv/hid/kbd/port/z8530.c
===================================================================
--- uspace/srv/hid/kbd/port/z8530.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/hid/kbd/port/z8530.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -35,5 +35,4 @@
  */
 
-#include <ipc/ipc.h>
 #include <ipc/irc.h>
 #include <async.h>
@@ -99,5 +98,5 @@
 	
 	async_set_interrupt_received(z8530_irq_handler);
-	ipc_register_irq(inr, device_assign_devno(), inr, &z8530_kbd);
+	register_irq(inr, device_assign_devno(), inr, &z8530_kbd);
 	
 	return 0;
Index: uspace/srv/hid/s3c24xx_ts/s3c24xx_ts.c
===================================================================
--- uspace/srv/hid/s3c24xx_ts/s3c24xx_ts.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/hid/s3c24xx_ts/s3c24xx_ts.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -42,5 +42,4 @@
 #include <io/console.h>
 #include <vfs/vfs.h>
-#include <ipc/ipc.h>
 #include <ipc/mouse.h>
 #include <async.h>
@@ -140,5 +139,5 @@
 
 	async_set_interrupt_received(s3c24xx_ts_irq_handler);
-	ipc_register_irq(inr, device_assign_devno(), 0, &ts_irq_code);
+	register_irq(inr, device_assign_devno(), 0, &ts_irq_code);
 
 	s3c24xx_ts_wait_for_int_mode(ts, updn_down);
@@ -377,5 +376,5 @@
 	int retval;
 
-	ipc_answer_0(iid, EOK);
+	async_answer_0(iid, EOK);
 
 	while (1) {
@@ -384,9 +383,9 @@
 		case IPC_M_PHONE_HUNGUP:
 			if (ts->client_phone != -1) {
-				ipc_hangup(ts->client_phone);
+				async_hangup(ts->client_phone);
 				ts->client_phone = -1;
 			}
 
-			ipc_answer_0(callid, EOK);
+			async_answer_0(callid, EOK);
 			return;
 		case IPC_M_CONNECT_TO_ME:
@@ -401,5 +400,5 @@
 			retval = EINVAL;
 		}
-		ipc_answer_0(callid, retval);
+		async_answer_0(callid, retval);
 	}
 }
Index: uspace/srv/hw/bus/cuda_adb/cuda_adb.c
===================================================================
--- uspace/srv/hw/bus/cuda_adb/cuda_adb.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/hw/bus/cuda_adb/cuda_adb.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -209,10 +209,10 @@
 
 	if (dev_addr < 0) {
-		ipc_answer_0(iid, EINVAL);
+		async_answer_0(iid, EINVAL);
 		return;
 	}
 
 	/* Answer the IPC_M_CONNECT_ME_TO call. */
-	ipc_answer_0(iid, EOK);
+	async_answer_0(iid, EOK);
 
 	while (1) {
@@ -222,5 +222,5 @@
 		case IPC_M_PHONE_HUNGUP:
 			/* The other side has hung up. */
-			ipc_answer_0(callid, EOK);
+			async_answer_0(callid, EOK);
 			return;
 		case IPC_M_CONNECT_TO_ME:
@@ -245,5 +245,5 @@
 			break;
 		}
-		ipc_answer_0(callid, retval);
+		async_answer_0(callid, retval);
 	}
 }
@@ -276,5 +276,5 @@
 	cuda_irq_code.cmds[0].addr = (void *) &((cuda_t *) instance->cuda_kernel)->ifr;
 	async_set_interrupt_received(cuda_irq_handler);
-	ipc_register_irq(10, device_assign_devno(), 0, &cuda_irq_code);
+	register_irq(10, device_assign_devno(), 0, &cuda_irq_code);
 
 	/* Enable SR interrupt. */
Index: uspace/srv/hw/char/i8042/i8042.c
===================================================================
--- uspace/srv/hw/char/i8042/i8042.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/hw/char/i8042/i8042.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -40,5 +40,4 @@
 #include <libarch/ddi.h>
 #include <devmap.h>
-#include <ipc/ipc.h>
 #include <async.h>
 #include <unistd.h>
@@ -199,6 +198,6 @@
 	i8042_kbd.cmds[0].addr = (void *) &((i8042_t *) i8042_kernel)->status;
 	i8042_kbd.cmds[3].addr = (void *) &((i8042_t *) i8042_kernel)->data;
-	ipc_register_irq(inr_a, device_assign_devno(), 0, &i8042_kbd);
-	ipc_register_irq(inr_b, device_assign_devno(), 0, &i8042_kbd);
+	register_irq(inr_a, device_assign_devno(), 0, &i8042_kbd);
+	register_irq(inr_b, device_assign_devno(), 0, &i8042_kbd);
 	printf("%s: registered for interrupts %" PRIun " and %" PRIun "\n",
 	    NAME, inr_a, inr_b);
@@ -236,10 +235,10 @@
 
 	if (dev_id < 0) {
-		ipc_answer_0(iid, EINVAL);
+		async_answer_0(iid, EINVAL);
 		return;
 	}
 
 	/* Answer the IPC_M_CONNECT_ME_TO call. */
-	ipc_answer_0(iid, EOK);
+	async_answer_0(iid, EOK);
 
 	printf(NAME ": accepted connection\n");
@@ -251,5 +250,5 @@
 		case IPC_M_PHONE_HUNGUP:
 			/* The other side has hung up. */
-			ipc_answer_0(callid, EOK);
+			async_answer_0(callid, EOK);
 			return;
 		case IPC_M_CONNECT_TO_ME:
@@ -272,5 +271,5 @@
 			break;
 		}
-		ipc_answer_0(callid, retval);
+		async_answer_0(callid, retval);
 	}
 }
Index: uspace/srv/hw/char/s3c24xx_uart/s3c24xx_uart.c
===================================================================
--- uspace/srv/hw/char/s3c24xx_uart/s3c24xx_uart.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/hw/char/s3c24xx_uart/s3c24xx_uart.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -40,5 +40,4 @@
 #include <libarch/ddi.h>
 #include <devmap.h>
-#include <ipc/ipc.h>
 #include <ipc/char.h>
 #include <async.h>
@@ -119,5 +118,5 @@
 
 	/* Answer the IPC_M_CONNECT_ME_TO call. */
-	ipc_answer_0(iid, EOK);
+	async_answer_0(iid, EOK);
 
 	while (1) {
@@ -127,5 +126,5 @@
 		case IPC_M_PHONE_HUNGUP:
 			/* The other side has hung up. */
-			ipc_answer_0(callid, EOK);
+			async_answer_0(callid, EOK);
 			return;
 		case IPC_M_CONNECT_TO_ME:
@@ -144,5 +143,5 @@
 			break;
 		}
-		ipc_answer_0(callid, retval);
+		async_answer_0(callid, retval);
 	}
 }
@@ -191,5 +190,5 @@
 	async_set_interrupt_received(s3c24xx_uart_irq_handler);
 
-	ipc_register_irq(inr, device_assign_devno(), 0, &uart_irq_code);
+	register_irq(inr, device_assign_devno(), 0, &uart_irq_code);
 
 	/* Enable FIFO, Tx trigger level: empty, Rx trigger level: 1 byte. */
Index: uspace/srv/hw/irc/apic/apic.c
===================================================================
--- uspace/srv/hw/irc/apic/apic.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/hw/irc/apic/apic.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -36,5 +36,4 @@
  */
 
-#include <ipc/ipc.h>
 #include <ipc/services.h>
 #include <ipc/irc.h>
@@ -75,5 +74,5 @@
 	 * Answer the first IPC_M_CONNECT_ME_TO call.
 	 */
-	ipc_answer_0(iid, EOK);
+	async_answer_0(iid, EOK);
 	
 	while (true) {
@@ -82,12 +81,12 @@
 		switch (IPC_GET_IMETHOD(call)) {
 		case IRC_ENABLE_INTERRUPT:
-			ipc_answer_0(callid, apic_enable_irq(IPC_GET_ARG1(call)));
+			async_answer_0(callid, apic_enable_irq(IPC_GET_ARG1(call)));
 			break;
 		case IRC_CLEAR_INTERRUPT:
 			/* Noop */
-			ipc_answer_0(callid, EOK);
+			async_answer_0(callid, EOK);
 			break;
 		default:
-			ipc_answer_0(callid, EINVAL);
+			async_answer_0(callid, EINVAL);
 			break;
 		}
@@ -108,5 +107,5 @@
 	
 	async_set_client_connection(apic_connection);
-	ipc_connect_to_me(PHONE_NS, SERVICE_APIC, 0, 0, NULL, NULL);
+	service_register(SERVICE_APIC);
 	
 	return true;
Index: uspace/srv/hw/irc/fhc/fhc.c
===================================================================
--- uspace/srv/hw/irc/fhc/fhc.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/hw/irc/fhc/fhc.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -29,12 +29,11 @@
 /** @addtogroup fhc
  * @{
- */ 
+ */
 
 /**
- * @file	fhc.c
- * @brief	FHC bus controller driver.
+ * @file fhc.c
+ * @brief FHC bus controller driver.
  */
 
-#include <ipc/ipc.h>
 #include <ipc/services.h>
 #include <ipc/irc.h>
@@ -76,5 +75,5 @@
 	 * Answer the first IPC_M_CONNECT_ME_TO call.
 	 */
-	ipc_answer_0(iid, EOK);
+	async_answer_0(iid, EOK);
 
 	while (1) {
@@ -85,5 +84,5 @@
 		case IRC_ENABLE_INTERRUPT:
 			/* Noop */
-			ipc_answer_0(callid, EOK);
+			async_answer_0(callid, EOK);
 			break;
 		case IRC_CLEAR_INTERRUPT:
@@ -92,13 +91,13 @@
 			case FHC_UART_INR:
 				fhc_uart_virt[FHC_UART_ICLR] = 0;
-				ipc_answer_0(callid, EOK);
+				async_answer_0(callid, EOK);
 				break;
 			default:
-				ipc_answer_0(callid, ENOTSUP);
+				async_answer_0(callid, ENOTSUP);
 				break;
 			}
 			break;
 		default:
-			ipc_answer_0(callid, EINVAL);
+			async_answer_0(callid, EINVAL);
 			break;
 		}
@@ -137,5 +136,5 @@
 	
 	async_set_client_connection(fhc_connection);
-	ipc_connect_to_me(PHONE_NS, SERVICE_FHC, 0, 0, NULL, NULL);
+	service_register(SERVICE_FHC);
 	
 	return true;
Index: uspace/srv/hw/irc/i8259/i8259.c
===================================================================
--- uspace/srv/hw/irc/i8259/i8259.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/hw/irc/i8259/i8259.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -36,5 +36,4 @@
  */
 
-#include <ipc/ipc.h>
 #include <ipc/services.h>
 #include <ipc/irc.h>
@@ -109,5 +108,5 @@
 	 * Answer the first IPC_M_CONNECT_ME_TO call.
 	 */
-	ipc_answer_0(iid, EOK);
+	async_answer_0(iid, EOK);
 	
 	while (true) {
@@ -116,12 +115,12 @@
 		switch (IPC_GET_IMETHOD(call)) {
 		case IRC_ENABLE_INTERRUPT:
-			ipc_answer_0(callid, pic_enable_irq(IPC_GET_ARG1(call)));
+			async_answer_0(callid, pic_enable_irq(IPC_GET_ARG1(call)));
 			break;
 		case IRC_CLEAR_INTERRUPT:
 			/* Noop */
-			ipc_answer_0(callid, EOK);
+			async_answer_0(callid, EOK);
 			break;
 		default:
-			ipc_answer_0(callid, EINVAL);
+			async_answer_0(callid, EINVAL);
 			break;
 		}
@@ -150,5 +149,5 @@
 	
 	async_set_client_connection(i8259_connection);
-	ipc_connect_to_me(PHONE_NS, SERVICE_I8259, 0, 0, NULL, NULL);
+	service_register(SERVICE_I8259);
 	
 	return true;
Index: uspace/srv/hw/irc/obio/obio.c
===================================================================
--- uspace/srv/hw/irc/obio/obio.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/hw/irc/obio/obio.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -27,11 +27,11 @@
  */
 
-/** @addtogroup obio 
+/** @addtogroup obio
  * @{
- */ 
+ */
 
 /**
- * @file	obio.c
- * @brief	OBIO driver.
+ * @file obio.c
+ * @brief OBIO driver.
  *
  * OBIO is a short for on-board I/O. On UltraSPARC IIi and systems with U2P,
@@ -42,5 +42,4 @@
  */
 
-#include <ipc/ipc.h>
 #include <ipc/services.h>
 #include <ipc/irc.h>
@@ -86,5 +85,5 @@
 	 * Answer the first IPC_M_CONNECT_ME_TO call.
 	 */
-	ipc_answer_0(iid, EOK);
+	async_answer_0(iid, EOK);
 
 	while (1) {
@@ -95,13 +94,13 @@
 		case IRC_ENABLE_INTERRUPT:
 			/* Noop */
-			ipc_answer_0(callid, EOK);
+			async_answer_0(callid, EOK);
 			break;
 		case IRC_CLEAR_INTERRUPT:
 			inr = IPC_GET_ARG1(call);
 			base_virt[OBIO_CIR(inr & INO_MASK)] = 0;
-			ipc_answer_0(callid, EOK);
+			async_answer_0(callid, EOK);
 			break;
 		default:
-			ipc_answer_0(callid, EINVAL);
+			async_answer_0(callid, EINVAL);
 			break;
 		}
@@ -138,5 +137,5 @@
 	
 	async_set_client_connection(obio_connection);
-	ipc_connect_to_me(PHONE_NS, SERVICE_OBIO, 0, 0, NULL, NULL);
+	service_register(SERVICE_OBIO);
 	
 	return true;
Index: uspace/srv/hw/netif/ne2000/ne2000.c
===================================================================
--- uspace/srv/hw/netif/ne2000/ne2000.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/hw/netif/ne2000/ne2000.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -43,6 +43,6 @@
 #include <malloc.h>
 #include <sysinfo.h>
-#include <ipc/ipc.h>
 #include <ipc/services.h>
+#include <ipc/ns.h>
 #include <ipc/irc.h>
 #include <net/modules.h>
@@ -316,5 +316,5 @@
 		ne2k_cmds[5].addr = ne2k->port + DP_TSR;
 		
-		int rc = ipc_register_irq(ne2k->irq, device->device_id,
+		int rc = register_irq(ne2k->irq, device->device_id,
 		    device->device_id, &ne2k_code);
 		if (rc != EOK)
@@ -323,5 +323,5 @@
 		rc = ne2k_up(ne2k);
 		if (rc != EOK) {
-			ipc_unregister_irq(ne2k->irq, device->device_id);
+			unregister_irq(ne2k->irq, device->device_id);
 			return rc;
 		}
@@ -342,5 +342,5 @@
 		
 		ne2k_down(ne2k);
-		ipc_unregister_irq(ne2k->irq, device->device_id);
+		unregister_irq(ne2k->irq, device->device_id);
 		change_state(device, NETIF_STOPPED);
 	}
@@ -389,13 +389,11 @@
 	
 	if (irc_service) {
-		while (irc_phone < 0) {
-			irc_phone = ipc_connect_me_to_blocking(PHONE_NS, irc_service,
-			    0, 0);
-		}
+		while (irc_phone < 0)
+			irc_phone = service_connect_blocking(irc_service, 0, 0);
 	}
 	
 	async_set_interrupt_received(irq_handler);
 	
-	return ipc_connect_to_me(PHONE_NS, SERVICE_NE2000, 0, 0, NULL, NULL);
+	return async_connect_to_me(PHONE_NS, SERVICE_NE2000, 0, 0, NULL);
 }
 
Index: uspace/srv/loader/main.c
===================================================================
--- uspace/srv/loader/main.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/loader/main.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -50,5 +50,4 @@
 #include <fcntl.h>
 #include <sys/types.h>
-#include <ipc/ipc.h>
 #include <ipc/services.h>
 #include <ipc/loader.h>
@@ -95,5 +94,5 @@
 
 /** Used to limit number of connections to one. */
-static bool connected;
+static bool connected = false;
 
 static void ldr_get_taskid(ipc_callid_t rid, ipc_call_t *request)
@@ -106,6 +105,6 @@
 	
 	if (!async_data_read_receive(&callid, &len)) {
-		ipc_answer_0(callid, EINVAL);
-		ipc_answer_0(rid, EINVAL);
+		async_answer_0(callid, EINVAL);
+		async_answer_0(rid, EINVAL);
 		return;
 	}
@@ -115,5 +114,5 @@
 	
 	async_data_read_finalize(callid, &task_id, len);
-	ipc_answer_0(rid, EOK);
+	async_answer_0(rid, EOK);
 }
 
@@ -135,5 +134,5 @@
 	}
 	
-	ipc_answer_0(rid, rc);
+	async_answer_0(rid, rc);
 }
 
@@ -155,5 +154,5 @@
 	}
 	
-	ipc_answer_0(rid, rc);
+	async_answer_0(rid, rc);
 }
 
@@ -188,5 +187,5 @@
 		if (_argv == NULL) {
 			free(buf);
-			ipc_answer_0(rid, ENOMEM);
+			async_answer_0(rid, ENOMEM);
 			return;
 		}
@@ -220,5 +219,5 @@
 	}
 	
-	ipc_answer_0(rid, rc);
+	async_answer_0(rid, rc);
 }
 
@@ -244,5 +243,5 @@
 		if (_filv == NULL) {
 			free(buf);
-			ipc_answer_0(rid, ENOMEM);
+			async_answer_0(rid, ENOMEM);
 			return;
 		}
@@ -271,5 +270,5 @@
 	}
 	
-	ipc_answer_0(rid, EOK);
+	async_answer_0(rid, EOK);
 }
 
@@ -287,5 +286,5 @@
 	if (rc != EE_OK) {
 		DPRINTF("Failed to load executable '%s'.\n", pathname);
-		ipc_answer_0(rid, EINVAL);
+		async_answer_0(rid, EINVAL);
 		return 1;
 	}
@@ -304,5 +303,5 @@
 		/* Statically linked program */
 		is_dyn_linked = false;
-		ipc_answer_0(rid, EOK);
+		async_answer_0(rid, EOK);
 		return 0;
 	}
@@ -312,10 +311,10 @@
 		DPRINTF("Failed to load interpreter '%s.'\n",
 		    prog_info.interp);
-		ipc_answer_0(rid, EINVAL);
+		async_answer_0(rid, EINVAL);
 		return 1;
 	}
 	
 	is_dyn_linked = true;
-	ipc_answer_0(rid, EOK);
+	async_answer_0(rid, EOK);
 	
 	return 0;
@@ -343,9 +342,9 @@
 		DPRINTF("Entry point: %p\n", interp_info.entry);
 		
-		ipc_answer_0(rid, EOK);
+		async_answer_0(rid, EOK);
 		elf_run(&interp_info, &pcb);
 	} else {
 		/* Statically linked program */
-		ipc_answer_0(rid, EOK);
+		async_answer_0(rid, EOK);
 		elf_run(&prog_info, &pcb);
 	}
@@ -367,5 +366,5 @@
 	/* Already have a connection? */
 	if (connected) {
-		ipc_answer_0(iid, ELIMIT);
+		async_answer_0(iid, ELIMIT);
 		return;
 	}
@@ -374,5 +373,5 @@
 	
 	/* Accept the connection */
-	ipc_answer_0(iid, EOK);
+	async_answer_0(iid, EOK);
 	
 	/* Ignore parameters, the connection is already open */
@@ -414,5 +413,5 @@
 			DPRINTF("Responding EINVAL to method %d.\n",
 			    IPC_GET_IMETHOD(call));
-			ipc_answer_0(callid, EINVAL);
+			async_answer_0(callid, EINVAL);
 		}
 	}
@@ -423,22 +422,17 @@
 int main(int argc, char *argv[])
 {
-	task_id_t id;
-	int rc;
-
-	connected = false;
-
+	/* Set a handler of incomming connections. */
+	async_set_client_connection(ldr_connection);
+	
 	/* Introduce this task to the NS (give it our task ID). */
-	id = task_get_id();
-	rc = async_req_2_0(PHONE_NS, NS_ID_INTRO, LOWER32(id), UPPER32(id));
+	task_id_t id = task_get_id();
+	int rc = async_req_2_0(PHONE_NS, NS_ID_INTRO, LOWER32(id), UPPER32(id));
 	if (rc != EOK)
 		return -1;
-
-	/* Set a handler of incomming connections. */
-	async_set_client_connection(ldr_connection);
 	
 	/* Register at naming service. */
-	if (ipc_connect_to_me(PHONE_NS, SERVICE_LOAD, 0, 0, NULL, NULL) != 0)
+	if (service_register(SERVICE_LOAD) != EOK)
 		return -2;
-
+	
 	async_manager();
 	
Index: uspace/srv/net/il/arp/arp.c
===================================================================
--- uspace/srv/net/il/arp/arp.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/net/il/arp/arp.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -45,5 +45,4 @@
 #include <task.h>
 #include <adt/measured_strings.h>
-#include <ipc/ipc.h>
 #include <ipc/services.h>
 #include <ipc/net.h>
@@ -428,5 +427,5 @@
 		case NET_IL_DEVICE_STATE:
 			/* Do nothing - keep the cache */
-			ipc_answer_0(iid, (sysarg_t) EOK);
+			async_answer_0(iid, (sysarg_t) EOK);
 			break;
 		
@@ -448,5 +447,5 @@
 				fibril_mutex_unlock(&arp_globals.lock);
 			}
-			ipc_answer_0(iid, (sysarg_t) rc);
+			async_answer_0(iid, (sysarg_t) rc);
 			break;
 		
@@ -454,9 +453,9 @@
 			rc = arp_mtu_changed_message(IPC_GET_DEVICE(*icall),
 			    IPC_GET_MTU(*icall));
-			ipc_answer_0(iid, (sysarg_t) rc);
+			async_answer_0(iid, (sysarg_t) rc);
 			break;
 		
 		default:
-			ipc_answer_0(iid, (sysarg_t) ENOTSUP);
+			async_answer_0(iid, (sysarg_t) ENOTSUP);
 		}
 		
Index: uspace/srv/net/il/arp/arp.h
===================================================================
--- uspace/srv/net/il/arp/arp.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/net/il/arp/arp.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -39,8 +39,5 @@
 
 #include <fibril_synch.h>
-
-#include <ipc/ipc.h>
 #include <ipc/services.h>
-
 #include <net/device.h>
 #include <net/packet.h>
Index: uspace/srv/net/il/ip/ip.c
===================================================================
--- uspace/srv/net/il/ip/ip.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/net/il/ip/ip.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -41,5 +41,4 @@
 #include <stdio.h>
 #include <str.h>
-#include <ipc/ipc.h>
 #include <ipc/services.h>
 #include <ipc/net.h>
@@ -1596,5 +1595,5 @@
 			rc = ip_device_state_message(IPC_GET_DEVICE(*icall),
 			    IPC_GET_STATE(*icall));
-			ipc_answer_0(iid, (sysarg_t) rc);
+			async_answer_0(iid, (sysarg_t) rc);
 			break;
 		
@@ -1610,5 +1609,5 @@
 			}
 			
-			ipc_answer_0(iid, (sysarg_t) rc);
+			async_answer_0(iid, (sysarg_t) rc);
 			break;
 		
@@ -1616,9 +1615,9 @@
 			rc = ip_mtu_changed_message(IPC_GET_DEVICE(*icall),
 			    IPC_GET_MTU(*icall));
-			ipc_answer_0(iid, (sysarg_t) rc);
+			async_answer_0(iid, (sysarg_t) rc);
 			break;
 		
 		default:
-			ipc_answer_0(iid, (sysarg_t) ENOTSUP);
+			async_answer_0(iid, (sysarg_t) ENOTSUP);
 		}
 		
Index: uspace/srv/net/il/ip/ip.h
===================================================================
--- uspace/srv/net/il/ip/ip.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/net/il/ip/ip.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -39,7 +39,5 @@
 
 #include <fibril_synch.h>
-#include <ipc/ipc.h>
 #include <ipc/services.h>
-
 #include <net/device.h>
 #include <net/inet.h>
Index: uspace/srv/net/net/net.c
===================================================================
--- uspace/srv/net/net/net.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/net/net/net.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -47,5 +47,4 @@
 #include <str_error.h>
 
-#include <ipc/ipc.h>
 #include <ipc/services.h>
 #include <ipc/net.h>
@@ -337,5 +336,5 @@
 		goto out;
 	
-	rc = ipc_connect_to_me(PHONE_NS, SERVICE_NETWORKING, 0, 0, NULL, NULL);
+	rc = async_connect_to_me(PHONE_NS, SERVICE_NETWORKING, 0, 0, NULL);
 	if (rc != EOK)
 		goto out;
@@ -686,5 +685,5 @@
 	 *  - Answer the first IPC_M_CONNECT_ME_TO call.
 	 */
-	ipc_answer_0(iid, EOK);
+	async_answer_0(iid, EOK);
 	
 	while (true) {
Index: uspace/srv/net/net/net.h
===================================================================
--- uspace/srv/net/net/net.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/net/net/net.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -38,6 +38,4 @@
 #ifndef NET_NET_H_
 #define NET_NET_H_
-
-#include <ipc/ipc.h>
 
 #include <net/device.h>
Index: uspace/srv/net/net/net_standalone.c
===================================================================
--- uspace/srv/net/net/net_standalone.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/net/net/net_standalone.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -40,5 +40,4 @@
 #include <adt/measured_strings.h>
 #include <adt/module_map.h>
-#include <ipc/ipc.h>
 #include <ipc/net.h>
 #include <errno.h>
Index: uspace/srv/net/netif/lo/lo.c
===================================================================
--- uspace/srv/net/netif/lo/lo.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/net/netif/lo/lo.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -39,9 +39,6 @@
 #include <stdio.h>
 #include <str.h>
-
-#include <ipc/ipc.h>
 #include <ipc/services.h>
 #include <ipc/nil.h>
-
 #include <net/modules.h>
 #include <adt/measured_strings.h>
@@ -167,5 +164,5 @@
 int netif_initialize(void)
 {
-	return ipc_connect_to_me(PHONE_NS, SERVICE_LO, 0, 0, NULL, NULL);
+	return async_connect_to_me(PHONE_NS, SERVICE_LO, 0, 0, NULL);
 }
 
Index: uspace/srv/net/nil/eth/eth.c
===================================================================
--- uspace/srv/net/nil/eth/eth.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/net/nil/eth/eth.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -43,10 +43,7 @@
 #include <str.h>
 #include <errno.h>
-
-#include <ipc/ipc.h>
 #include <ipc/nil.h>
 #include <ipc/net.h>
 #include <ipc/services.h>
-
 #include <net/modules.h>
 #include <net_checksum.h>
@@ -242,5 +239,5 @@
 			nil_device_state_msg_local(0, IPC_GET_DEVICE(*icall),
 			    IPC_GET_STATE(*icall));
-			ipc_answer_0(iid, EOK);
+			async_answer_0(iid, EOK);
 			break;
 		case NET_NIL_RECEIVED:
@@ -251,8 +248,8 @@
 				    IPC_GET_DEVICE(*icall), packet, 0);
 			
-			ipc_answer_0(iid, (sysarg_t) rc);
+			async_answer_0(iid, (sysarg_t) rc);
 			break;
 		default:
-			ipc_answer_0(iid, (sysarg_t) ENOTSUP);
+			async_answer_0(iid, (sysarg_t) ENOTSUP);
 		}
 		
Index: uspace/srv/net/nil/nildummy/nildummy.c
===================================================================
--- uspace/srv/net/nil/nildummy/nildummy.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/net/nil/nildummy/nildummy.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -41,5 +41,4 @@
 #include <stdio.h>
 #include <str.h>
-#include <ipc/ipc.h>
 #include <ipc/nil.h>
 #include <ipc/net.h>
@@ -112,5 +111,5 @@
 			rc = nil_device_state_msg_local(0,
 			    IPC_GET_DEVICE(*icall), IPC_GET_STATE(*icall));
-			ipc_answer_0(iid, (sysarg_t) rc);
+			async_answer_0(iid, (sysarg_t) rc);
 			break;
 		
@@ -122,9 +121,9 @@
 				    IPC_GET_DEVICE(*icall), packet, 0);
 			
-			ipc_answer_0(iid, (sysarg_t) rc);
+			async_answer_0(iid, (sysarg_t) rc);
 			break;
 		
 		default:
-			ipc_answer_0(iid, (sysarg_t) ENOTSUP);
+			async_answer_0(iid, (sysarg_t) ENOTSUP);
 		}
 		
Index: uspace/srv/net/tl/icmp/icmp.c
===================================================================
--- uspace/srv/net/tl/icmp/icmp.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/net/tl/icmp/icmp.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -41,5 +41,4 @@
 #include <stdint.h>
 #include <str.h>
-#include <ipc/ipc.h>
 #include <ipc/services.h>
 #include <ipc/net.h>
@@ -628,5 +627,5 @@
 			}
 			
-			ipc_answer_0(iid, (sysarg_t) rc);
+			async_answer_0(iid, (sysarg_t) rc);
 			break;
 		case IPC_M_PHONE_HUNGUP:
@@ -634,5 +633,5 @@
 			continue;
 		default:
-			ipc_answer_0(iid, (sysarg_t) ENOTSUP);
+			async_answer_0(iid, (sysarg_t) ENOTSUP);
 		}
 		
Index: uspace/srv/net/tl/tcp/tcp.c
===================================================================
--- uspace/srv/net/tl/tcp/tcp.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/net/tl/tcp/tcp.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -44,5 +44,4 @@
 #include <errno.h>
 
-#include <ipc/ipc.h>
 #include <ipc/services.h>
 #include <ipc/net.h>
@@ -1506,5 +1505,5 @@
 
 	/* Release the application phone */
-	ipc_hangup(app_phone);
+	async_hangup(app_phone);
 
 	printf("release\n");
@@ -2454,8 +2453,8 @@
 				    SERVICE_TCP, IPC_GET_ERROR(*icall));
 			
-			ipc_answer_0(iid, (sysarg_t) rc);
+			async_answer_0(iid, (sysarg_t) rc);
 			break;
 		default:
-			ipc_answer_0(iid, (sysarg_t) ENOTSUP);
+			async_answer_0(iid, (sysarg_t) ENOTSUP);
 		}
 		
Index: uspace/srv/net/tl/udp/udp.c
===================================================================
--- uspace/srv/net/tl/udp/udp.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/net/tl/udp/udp.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -40,5 +40,4 @@
 #include <malloc.h>
 #include <stdio.h>
-#include <ipc/ipc.h>
 #include <ipc/services.h>
 #include <ipc/net.h>
@@ -354,8 +353,8 @@
 				    SERVICE_UDP, IPC_GET_ERROR(*icall));
 			
-			ipc_answer_0(iid, (sysarg_t) rc);
+			async_answer_0(iid, (sysarg_t) rc);
 			break;
 		default:
-			ipc_answer_0(iid, (sysarg_t) ENOTSUP);
+			async_answer_0(iid, (sysarg_t) ENOTSUP);
 		}
 		
@@ -868,5 +867,5 @@
 
 	/* Release the application phone */
-	ipc_hangup(app_phone);
+	async_hangup(app_phone);
 
 	/* Release all local sockets */
Index: uspace/srv/ns/clonable.c
===================================================================
--- uspace/srv/ns/clonable.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/ns/clonable.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -92,5 +92,5 @@
 	
 	ipc_forward_fast(csr->callid, phone, IPC_GET_ARG2(csr->call),
-		IPC_GET_ARG3(csr->call), 0, IPC_FF_NONE);
+	    IPC_GET_ARG3(csr->call), 0, IPC_FF_NONE);
 	
 	free(csr);
@@ -127,4 +127,5 @@
 	}
 	
+	link_initialize(&csr->link);
 	csr->service = service;
 	csr->call = *call;
Index: uspace/srv/ns/clonable.h
===================================================================
--- uspace/srv/ns/clonable.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/ns/clonable.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -34,14 +34,13 @@
 #define NS_CLONABLE_H__
 
-#include <ipc/ipc.h>
+#include <ipc/common.h>
+#include <sys/types.h>
 #include <bool.h>
 
 extern int clonable_init(void);
 
-extern bool service_clonable(int service);
-extern void register_clonable(sysarg_t service, sysarg_t phone,
-    ipc_call_t *call, ipc_callid_t callid);
-extern void connect_to_clonable(sysarg_t service, ipc_call_t *call,
-    ipc_callid_t callid);
+extern bool service_clonable(int);
+extern void register_clonable(sysarg_t, sysarg_t, ipc_call_t *, ipc_callid_t);
+extern void connect_to_clonable(sysarg_t, ipc_call_t *, ipc_callid_t);
 
 #endif
Index: uspace/srv/ns/ns.c
===================================================================
--- uspace/srv/ns/ns.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/ns/ns.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -37,75 +37,12 @@
 
 #include <ipc/ipc.h>
-#include <ipc/services.h>
 #include <ipc/ns.h>
-#include <unistd.h>
 #include <stdio.h>
 #include <errno.h>
-#include <as.h>
-#include <ddi.h>
-#include <event.h>
 #include <macros.h>
-#include <sysinfo.h>
 #include "ns.h"
 #include "service.h"
 #include "clonable.h"
 #include "task.h"
-
-static void *clockaddr = NULL;
-static void *klogaddr = NULL;
-
-static void get_as_area(ipc_callid_t callid, ipc_call_t *call, void *faddr,
-    size_t pages, void **addr)
-{
-	if ((faddr == NULL) || (pages == 0)) {
-		ipc_answer_0(callid, ENOENT);
-		return;
-	}
-	
-	if (*addr == NULL) {
-		*addr = as_get_mappable_page(pages * PAGE_SIZE);
-		
-		if (*addr == NULL) {
-			ipc_answer_0(callid, ENOENT);
-			return;
-		}
-		
-		if (physmem_map(faddr, *addr, pages,
-		    AS_AREA_READ | AS_AREA_CACHEABLE) != 0) {
-			ipc_answer_0(callid, ENOENT);
-			return;
-		}
-	}
-	
-	ipc_answer_2(callid, EOK, (sysarg_t) *addr, AS_AREA_READ);
-}
-
-static void setup_clock_area(ipc_callid_t callid, ipc_call_t *call, void **addr)
-{
-	uintptr_t faddr;
-	int err = sysinfo_get_value("clock.faddr", &faddr);
-	
-	if (err != EOK)
-		ipc_answer_0(callid, err);
-	
-	get_as_area(callid, call, (void *) faddr, 1, addr);
-}
-
-static void setup_klog_area(ipc_callid_t callid, ipc_call_t *call, void **addr)
-{
-	uintptr_t faddr;
-	int err = sysinfo_get_value("klog.faddr", &faddr);
-	
-	if (err != EOK)
-		ipc_answer_0(callid, err);
-	
-	size_t pages;
-	err = sysinfo_get_value("klog.pages", &pages);
-	
-	if (err != EOK)
-		ipc_answer_0(callid, err);
-	
-	get_as_area(callid, call, (void *) faddr, pages, addr);
-}
 
 int main(int argc, char **argv)
@@ -138,16 +75,4 @@
 		
 		switch (IPC_GET_IMETHOD(call)) {
-		case IPC_M_SHARE_IN:
-			switch (IPC_GET_ARG3(call)) {
-			case SERVICE_MEM_REALTIME:
-				setup_clock_area(callid, &call, &clockaddr);
-				break;
-			case SERVICE_MEM_KLOG:
-				setup_klog_area(callid, &call, &klogaddr);
-				break;
-			default:
-				ipc_answer_0(callid, ENOENT);
-			}
-			continue;
 		case IPC_M_PHONE_HUNGUP:
 			retval = ns_task_disconnect(&call);
Index: uspace/srv/ns/service.c
===================================================================
--- uspace/srv/ns/service.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/ns/service.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -43,5 +43,5 @@
 typedef struct {
 	link_t link;
-	sysarg_t service;        /**< Number of the service. */
+	sysarg_t service;        /**< Service ID. */
 	sysarg_t phone;          /**< Phone registered with the service. */
 	sysarg_t in_phone_hash;  /**< Incoming phone hash. */
@@ -56,8 +56,8 @@
  *
  */
-static hash_index_t service_hash(unsigned long *key)
+static hash_index_t service_hash(unsigned long key[])
 {
 	assert(key);
-	return (*key % SERVICE_HASH_TABLE_CHAINS);
+	return (key[0] % SERVICE_HASH_TABLE_CHAINS);
 }
 
@@ -86,5 +86,5 @@
 	
 	if (keys == 2)
-		return (key[1] == hs->in_phone_hash);
+		return ((key[0] == hs->service) && (key[1] == hs->in_phone_hash));
 	else
 		return (key[0] == hs->service);
@@ -195,5 +195,5 @@
 	hash_table_insert(&service_hash_table, keys, &hs->link);
 	
-	return 0;
+	return EOK;
 }
 
@@ -227,4 +227,5 @@
 			}
 			
+			link_initialize(&pr->link);
 			pr->service = service;
 			pr->callid = callid;
Index: uspace/srv/ns/service.h
===================================================================
--- uspace/srv/ns/service.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/ns/service.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -34,12 +34,12 @@
 #define NS_SERVICE_H__
 
-#include <ipc/ipc.h>
+#include <sys/types.h>
+#include <ipc/common.h>
 
 extern int service_init(void);
 extern void process_pending_conn(void);
 
-extern int register_service(sysarg_t service, sysarg_t phone, ipc_call_t *call);
-extern void connect_to_service(sysarg_t service, ipc_call_t *call,
-     ipc_callid_t callid);
+extern int register_service(sysarg_t, sysarg_t, ipc_call_t *);
+extern void connect_to_service(sysarg_t, ipc_call_t *, ipc_callid_t);
 
 #endif
Index: uspace/srv/ns/task.c
===================================================================
--- uspace/srv/ns/task.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/ns/task.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -43,7 +43,5 @@
 
 #define TASK_HASH_TABLE_CHAINS  256
-#define P2I_HASH_TABLE_CHAINS  256
-
-static int get_id_by_phone(sysarg_t phone_hash, task_id_t *id);
+#define P2I_HASH_TABLE_CHAINS   256
 
 /* TODO:
@@ -57,8 +55,9 @@
 typedef struct {
 	link_t link;
-	task_id_t id;	/**< Task ID. */
-	bool finished;	/**< Task is done. */
-	bool have_rval;	/**< Task returned a value. */
-	int retval;	/**< The return value. */
+	
+	task_id_t id;    /**< Task ID. */
+	bool finished;   /**< Task is done. */
+	bool have_rval;  /**< Task returned a value. */
+	int retval;      /**< The return value. */
 } hashed_task_t;
 
@@ -71,8 +70,8 @@
  *
  */
-static hash_index_t task_hash(unsigned long *key)
+static hash_index_t task_hash(unsigned long key[])
 {
 	assert(key);
-	return (LOWER32(*key) % TASK_HASH_TABLE_CHAINS);
+	return (LOWER32(key[0]) % TASK_HASH_TABLE_CHAINS);
 }
 
@@ -124,6 +123,6 @@
 typedef struct {
 	link_t link;
-	sysarg_t phash;    /**< Task ID. */
-	task_id_t id;    /**< Task ID. */
+	sysarg_t in_phone_hash;  /**< Incoming phone hash. */
+	task_id_t id;            /**< Task ID. */
 } p2i_entry_t;
 
@@ -131,11 +130,12 @@
  *
  * @param key Array of keys.
+ *
  * @return Hash index corresponding to key[0].
  *
  */
-static hash_index_t p2i_hash(unsigned long *key)
+static hash_index_t p2i_hash(unsigned long key[])
 {
 	assert(key);
-	return (*key % TASK_HASH_TABLE_CHAINS);
+	return (key[0] % TASK_HASH_TABLE_CHAINS);
 }
 
@@ -154,8 +154,8 @@
 	assert(keys == 1);
 	assert(item);
-
-	p2i_entry_t *e = hash_table_get_instance(item, p2i_entry_t, link);
-
-	return (key[0] == e->phash);
+	
+	p2i_entry_t *entry = hash_table_get_instance(item, p2i_entry_t, link);
+	
+	return (key[0] == entry->in_phone_hash);
 }
 
@@ -197,5 +197,5 @@
 		return ENOMEM;
 	}
-
+	
 	if (!hash_table_create(&phone_to_id, P2I_HASH_TABLE_CHAINS,
 	    1, &p2i_ops)) {
@@ -205,5 +205,4 @@
 	
 	list_initialize(&pending_wait);
-	
 	return EOK;
 }
@@ -238,5 +237,5 @@
 			    ht->retval);
 		}
-
+		
 		hash_table_remove(&task_hash_table, keys, 2);
 		list_remove(cur);
@@ -250,14 +249,14 @@
 	sysarg_t retval;
 	task_exit_t texit;
-
+	
 	unsigned long keys[2] = {
 		LOWER32(id),
 		UPPER32(id)
 	};
-
+	
 	link_t *link = hash_table_find(&task_hash_table, keys);
 	hashed_task_t *ht = (link != NULL) ?
 	    hash_table_get_instance(link, hashed_task_t, link) : NULL;
-
+	
 	if (ht == NULL) {
 		/* No such task exists. */
@@ -265,5 +264,5 @@
 		return;
 	}
-
+	
 	if (!ht->finished) {
 		/* Add to pending list */
@@ -275,4 +274,5 @@
 		}
 		
+		link_initialize(&pr->link);
 		pr->id = id;
 		pr->callid = callid;
@@ -293,38 +293,37 @@
 int ns_task_id_intro(ipc_call_t *call)
 {
-	task_id_t id;
 	unsigned long keys[2];
-	link_t *link;
-	p2i_entry_t *e;
-	hashed_task_t *ht;
-
-	id = MERGE_LOUP32(IPC_GET_ARG1(*call), IPC_GET_ARG2(*call));
-
+	
+	task_id_t id = MERGE_LOUP32(IPC_GET_ARG1(*call), IPC_GET_ARG2(*call));
 	keys[0] = call->in_phone_hash;
-
-	link = hash_table_find(&phone_to_id, keys);
+	
+	link_t *link = hash_table_find(&phone_to_id, keys);
 	if (link != NULL)
 		return EEXISTS;
-
-	e = (p2i_entry_t *) malloc(sizeof(p2i_entry_t));
-	if (e == NULL)
+	
+	p2i_entry_t *entry = (p2i_entry_t *) malloc(sizeof(p2i_entry_t));
+	if (entry == NULL)
 		return ENOMEM;
-
-	ht = (hashed_task_t *) malloc(sizeof(hashed_task_t));
+	
+	hashed_task_t *ht = (hashed_task_t *) malloc(sizeof(hashed_task_t));
 	if (ht == NULL)
 		return ENOMEM;
-
-	/* Insert to phone-to-id map. */
-
-	link_initialize(&e->link);
-	e->phash = call->in_phone_hash;
-	e->id = id;
-	hash_table_insert(&phone_to_id, keys, &e->link);
-
-	/* Insert to main table. */
-
+	
+	/*
+	 * Insert into the phone-to-id map.
+	 */
+	
+	link_initialize(&entry->link);
+	entry->in_phone_hash = call->in_phone_hash;
+	entry->id = id;
+	hash_table_insert(&phone_to_id, keys, &entry->link);
+	
+	/*
+	 * Insert into the main table.
+	 */
+	
 	keys[0] = LOWER32(id);
 	keys[1] = UPPER32(id);
-
+	
 	link_initialize(&ht->link);
 	ht->id = id;
@@ -333,20 +332,33 @@
 	ht->retval = -1;
 	hash_table_insert(&task_hash_table, keys, &ht->link);
-
+	
 	return EOK;
 }
 
+static int get_id_by_phone(sysarg_t phone_hash, task_id_t *id)
+{
+	unsigned long keys[1] = {phone_hash};
+	
+	link_t *link = hash_table_find(&phone_to_id, keys);
+	if (link == NULL)
+		return ENOENT;
+	
+	p2i_entry_t *entry = hash_table_get_instance(link, p2i_entry_t, link);
+	*id = entry->id;
+	
+	return EOK;
+}
+
 int ns_task_retval(ipc_call_t *call)
 {
 	task_id_t id;
-	unsigned long keys[2];
-	int rc;
-
-	rc = get_id_by_phone(call->in_phone_hash, &id);
+	int rc = get_id_by_phone(call->in_phone_hash, &id);
 	if (rc != EOK)
 		return rc;
-
-	keys[0] = LOWER32(id);
-	keys[1] = UPPER32(id);
+	
+	unsigned long keys[2] = {
+		LOWER32(id),
+		UPPER32(id)
+	};
 	
 	link_t *link = hash_table_find(&task_hash_table, keys);
@@ -354,11 +366,11 @@
 	    hash_table_get_instance(link, hashed_task_t, link) : NULL;
 	
-	if ((ht == NULL) || ht->finished)
+	if ((ht == NULL) || (ht->finished))
 		return EINVAL;
-
+	
 	ht->finished = true;
 	ht->have_rval = true;
 	ht->retval = IPC_GET_ARG1(*call);
-
+	
 	return EOK;
 }
@@ -367,19 +379,18 @@
 {
 	unsigned long keys[2];
+	
 	task_id_t id;
-	int rc;
-
-	rc = get_id_by_phone(call->in_phone_hash, &id);
+	int rc = get_id_by_phone(call->in_phone_hash, &id);
 	if (rc != EOK)
 		return rc;
-
+	
 	/* Delete from phone-to-id map. */
 	keys[0] = call->in_phone_hash;
 	hash_table_remove(&phone_to_id, keys, 1);
-
+	
 	/* Mark task as finished. */
 	keys[0] = LOWER32(id);
 	keys[1] = UPPER32(id);
-
+	
 	link_t *link = hash_table_find(&task_hash_table, keys);
 	hashed_task_t *ht =
@@ -387,24 +398,7 @@
 	if (ht == NULL)
 		return EOK;
-
+	
 	ht->finished = true;
-
-	return EOK;
-}
-
-static int get_id_by_phone(sysarg_t phone_hash, task_id_t *id)
-{
-	unsigned long keys[1];
-	link_t *link;
-	p2i_entry_t *e;
-
-	keys[0] = phone_hash;
-	link = hash_table_find(&phone_to_id, keys);
-	if (link == NULL)
-		return ENOENT;
-
-	e = hash_table_get_instance(link, p2i_entry_t, link);
-	*id = e->id;
-
+	
 	return EOK;
 }
Index: uspace/srv/ns/task.h
===================================================================
--- uspace/srv/ns/task.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/ns/task.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -34,14 +34,15 @@
 #define NS_TASK_H__
 
-#include <ipc/ipc.h>
+#include <ipc/common.h>
+#include <task.h>
 
 extern int task_init(void);
 extern void process_pending_wait(void);
 
-extern void wait_for_task(task_id_t id, ipc_call_t *call, ipc_callid_t callid);
+extern void wait_for_task(task_id_t, ipc_call_t *, ipc_callid_t);
 
-extern int ns_task_id_intro(ipc_call_t *call);
-extern int ns_task_disconnect(ipc_call_t *call);
-extern int ns_task_retval(ipc_call_t *call);
+extern int ns_task_id_intro(ipc_call_t *);
+extern int ns_task_disconnect(ipc_call_t *);
+extern int ns_task_retval(ipc_call_t *);
 
 
Index: uspace/srv/taskmon/taskmon.c
===================================================================
--- uspace/srv/taskmon/taskmon.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/taskmon/taskmon.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -36,5 +36,4 @@
 
 #include <stdio.h>
-#include <ipc/ipc.h>
 #include <async.h>
 #include <ipc/services.h>
Index: uspace/srv/vfs/vfs.c
===================================================================
--- uspace/srv/vfs/vfs.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/vfs/vfs.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -36,6 +36,6 @@
  */
 
-#include <ipc/ipc.h>
 #include <ipc/services.h>
+#include <ipc/ns.h>
 #include <async.h>
 #include <errno.h>
@@ -47,5 +47,5 @@
 #include "vfs.h"
 
-#define NAME "vfs"
+#define NAME  "vfs"
 
 static void vfs_connection(ipc_callid_t iid, ipc_call_t *icall)
@@ -57,5 +57,5 @@
 	 * This call needs to be answered.
 	 */
-	ipc_answer_0(iid, EOK);
+	async_answer_0(iid, EOK);
 	
 	while (keep_on_going) {
@@ -119,5 +119,5 @@
 			vfs_dup(callid, &call);
 		default:
-			ipc_answer_0(callid, ENOTSUP);
+			async_answer_0(callid, ENOTSUP);
 			break;
 		}
@@ -172,5 +172,8 @@
 	 * Register at the naming service.
 	 */
-	ipc_connect_to_me(PHONE_NS, SERVICE_VFS, 0, 0, NULL, NULL);
+	if (service_register(SERVICE_VFS) != EOK) {
+		printf("%s: Cannot register VFS service\n", NAME);
+		return EINVAL;
+	}
 	
 	/*
Index: uspace/srv/vfs/vfs.h
===================================================================
--- uspace/srv/vfs/vfs.h	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/vfs/vfs.h	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -35,5 +35,4 @@
 
 #include <async.h>
-#include <ipc/ipc.h>
 #include <adt/list.h>
 #include <fibril_synch.h>
Index: uspace/srv/vfs/vfs_lookup.c
===================================================================
--- uspace/srv/vfs/vfs_lookup.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/vfs/vfs_lookup.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -37,5 +37,4 @@
 
 #include "vfs.h"
-#include <ipc/ipc.h>
 #include <macros.h>
 #include <async.h>
Index: uspace/srv/vfs/vfs_ops.c
===================================================================
--- uspace/srv/vfs/vfs_ops.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/vfs/vfs_ops.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -37,5 +37,4 @@
 
 #include "vfs.h"
-#include <ipc/ipc.h>
 #include <macros.h>
 #include <stdint.h>
@@ -91,5 +90,5 @@
 			/* Trying to mount root FS over root FS */
 			fibril_rwlock_write_unlock(&namespace_rwlock);
-			ipc_answer_0(rid, EBUSY);
+			async_answer_0(rid, EBUSY);
 			return;
 		}
@@ -99,5 +98,5 @@
 			/* The lookup failed for some reason. */
 			fibril_rwlock_write_unlock(&namespace_rwlock);
-			ipc_answer_0(rid, rc);
+			async_answer_0(rid, rc);
 			return;
 		}
@@ -106,5 +105,5 @@
 		if (!mp_node) {
 			fibril_rwlock_write_unlock(&namespace_rwlock);
-			ipc_answer_0(rid, ENOMEM);
+			async_answer_0(rid, ENOMEM);
 			return;
 		}
@@ -134,5 +133,5 @@
 				vfs_release_phone(fs_handle, phone);
 				fibril_rwlock_write_unlock(&namespace_rwlock);
-				ipc_answer_0(rid, rc);
+				async_answer_0(rid, rc);
 				return;
 			}
@@ -142,5 +141,5 @@
 			if (rc != EOK) {
 				fibril_rwlock_write_unlock(&namespace_rwlock);
-				ipc_answer_0(rid, rc);
+				async_answer_0(rid, rc);
 				return;
 			}
@@ -165,5 +164,5 @@
 			
 			fibril_rwlock_write_unlock(&namespace_rwlock);
-			ipc_answer_0(rid, rc);
+			async_answer_0(rid, rc);
 			return;
 		} else {
@@ -173,5 +172,5 @@
 			 */
 			fibril_rwlock_write_unlock(&namespace_rwlock);
-			ipc_answer_0(rid, ENOENT);
+			async_answer_0(rid, ENOENT);
 			return;
 		}
@@ -202,5 +201,5 @@
 		if (mp_node)
 			vfs_node_put(mp_node);
-		ipc_answer_0(rid, rc);
+		async_answer_0(rid, rc);
 		fibril_rwlock_write_unlock(&namespace_rwlock);
 		return;
@@ -218,5 +217,5 @@
 			vfs_node_put(mp_node);
 		fibril_rwlock_write_unlock(&namespace_rwlock);
-		ipc_answer_0(rid, rc);
+		async_answer_0(rid, rc);
 		return;
 	}
@@ -245,5 +244,5 @@
 	}
 
-	ipc_answer_0(rid, rc);
+	async_answer_0(rid, rc);
 	fibril_rwlock_write_unlock(&namespace_rwlock);
 }
@@ -275,5 +274,5 @@
 	    0, NULL);
 	if (rc != EOK) {
-		ipc_answer_0(rid, rc);
+		async_answer_0(rid, rc);
 		return;
 	}
@@ -285,5 +284,5 @@
 	if (rc != EOK) {
 		free(mp);
-		ipc_answer_0(rid, rc);
+		async_answer_0(rid, rc);
 		return;
 	}
@@ -299,5 +298,5 @@
 		free(mp);
 		free(opts);
-		ipc_answer_0(rid, rc);
+		async_answer_0(rid, rc);
 		return;
 	}
@@ -310,6 +309,6 @@
 	ipc_callid_t callid = async_get_call(&data);
 	if (IPC_GET_IMETHOD(data) != IPC_M_PING) {
-		ipc_answer_0(callid, ENOTSUP);
-		ipc_answer_0(rid, ENOTSUP);
+		async_answer_0(callid, ENOTSUP);
+		async_answer_0(rid, ENOTSUP);
 		free(mp);
 		free(opts);
@@ -333,6 +332,6 @@
 		
 		fibril_mutex_unlock(&fs_head_lock);
-		ipc_answer_0(callid, ENOENT);
-		ipc_answer_0(rid, ENOENT);
+		async_answer_0(callid, ENOENT);
+		async_answer_0(rid, ENOENT);
 		free(mp);
 		free(fs_name);
@@ -343,5 +342,5 @@
 	
 	/* Acknowledge that we know fs_name. */
-	ipc_answer_0(callid, EOK);
+	async_answer_0(callid, EOK);
 	
 	/* Do the mount */
@@ -367,5 +366,5 @@
 	    0, NULL);
 	if (rc != EOK)
-		ipc_answer_0(rid, rc);
+		async_answer_0(rid, rc);
 
 	/*
@@ -386,5 +385,5 @@
 		fibril_rwlock_write_unlock(&namespace_rwlock);
 		free(mp);
-		ipc_answer_0(rid, rc);
+		async_answer_0(rid, rc);
 		return;
 	}
@@ -393,5 +392,5 @@
 		fibril_rwlock_write_unlock(&namespace_rwlock);
 		free(mp);
-		ipc_answer_0(rid, ENOMEM);
+		async_answer_0(rid, ENOMEM);
 		return;
 	}
@@ -409,5 +408,5 @@
 		vfs_node_put(mr_node);
 		free(mp);
-		ipc_answer_0(rid, EBUSY);
+		async_answer_0(rid, EBUSY);
 		return;
 	}
@@ -430,5 +429,5 @@
 			fibril_rwlock_write_unlock(&namespace_rwlock);
 			vfs_node_put(mr_node);
-			ipc_answer_0(rid, rc);
+			async_answer_0(rid, rc);
 			return;
 		}
@@ -449,5 +448,5 @@
 			fibril_rwlock_write_unlock(&namespace_rwlock);
 			vfs_node_put(mr_node);
-			ipc_answer_0(rid, rc);
+			async_answer_0(rid, rc);
 			return;
 		}
@@ -456,5 +455,5 @@
 			fibril_rwlock_write_unlock(&namespace_rwlock);
 			vfs_node_put(mr_node);
-			ipc_answer_0(rid, ENOMEM);
+			async_answer_0(rid, ENOMEM);
 			return;
 		}
@@ -468,5 +467,5 @@
 			vfs_node_put(mp_node);
 			vfs_node_put(mr_node);
-			ipc_answer_0(rid, rc);
+			async_answer_0(rid, rc);
 			return;
 		}
@@ -486,5 +485,5 @@
 
 	fibril_rwlock_write_unlock(&namespace_rwlock);
-	ipc_answer_0(rid, EOK);
+	async_answer_0(rid, EOK);
 }
 
@@ -514,5 +513,5 @@
 	    ((lflag & (L_FILE | L_DIRECTORY)) == (L_FILE | L_DIRECTORY)) ||
 	    (lflag & (L_OPEN | L_ROOT | L_MP))) {
-		ipc_answer_0(rid, EINVAL);
+		async_answer_0(rid, EINVAL);
 		return;
 	}
@@ -526,5 +525,5 @@
 	int rc = async_data_write_accept((void **) &path, true, 0, 0, 0, NULL);
 	if (rc != EOK) {
-		ipc_answer_0(rid, rc);
+		async_answer_0(rid, rc);
 		return;
 	}
@@ -548,5 +547,5 @@
 		else
 			fibril_rwlock_read_unlock(&namespace_rwlock);
-		ipc_answer_0(rid, rc);
+		async_answer_0(rid, rc);
 		free(path);
 		return;
@@ -571,5 +570,5 @@
 				fibril_rwlock_write_unlock(&node->contents_rwlock);
 				vfs_node_put(node);
-				ipc_answer_0(rid, rc);
+				async_answer_0(rid, rc);
 				return;
 			}
@@ -586,5 +585,5 @@
 	if (fd < 0) {
 		vfs_node_put(node);
-		ipc_answer_0(rid, fd);
+		async_answer_0(rid, fd);
 		return;
 	}
@@ -607,5 +606,5 @@
 	
 	/* Success! Return the new file descriptor to the client. */
-	ipc_answer_1(rid, EOK, fd);
+	async_answer_1(rid, EOK, fd);
 }
 
@@ -629,5 +628,5 @@
 	if (rc != EOK) {
 		fibril_rwlock_read_unlock(&namespace_rwlock);
-		ipc_answer_0(rid, rc);
+		async_answer_0(rid, rc);
 		return;
 	}
@@ -645,5 +644,5 @@
 				fibril_rwlock_write_unlock(&node->contents_rwlock);
 				vfs_node_put(node);
-				ipc_answer_0(rid, rc);
+				async_answer_0(rid, rc);
 				return;
 			}
@@ -660,5 +659,5 @@
 	if (fd < 0) {
 		vfs_node_put(node);
-		ipc_answer_0(rid, fd);
+		async_answer_0(rid, fd);
 		return;
 	}
@@ -680,5 +679,5 @@
 	
 	/* Success! Return the new file descriptor to the client. */
-	ipc_answer_1(rid, EOK, fd);
+	async_answer_1(rid, EOK, fd);
 }
 
@@ -690,5 +689,5 @@
 	vfs_file_t *file = vfs_file_get(fd);
 	if (!file) {
-		ipc_answer_0(rid, ENOENT);
+		async_answer_0(rid, ENOENT);
 		return;
 	}
@@ -715,5 +714,5 @@
 
 	vfs_file_put(file);
-	ipc_answer_0(rid, rc);
+	async_answer_0(rid, rc);
 }
 
@@ -760,5 +759,5 @@
 	vfs_file_t *file = vfs_file_get(fd);
 	if (!file) {
-		ipc_answer_0(rid, ENOENT);
+		async_answer_0(rid, ENOENT);
 		return;
 	}
@@ -766,9 +765,9 @@
 	int ret = vfs_close_internal(file);
 	if (ret != EOK)
-		ipc_answer_0(rid, ret);
+		async_answer_0(rid, ret);
 	
 	vfs_file_put(file);
 	ret = vfs_fd_free(fd);
-	ipc_answer_0(rid, ret);
+	async_answer_0(rid, ret);
 }
 
@@ -792,5 +791,5 @@
 	vfs_file_t *file = vfs_file_get(fd);
 	if (!file) {
-		ipc_answer_0(rid, ENOENT);
+		async_answer_0(rid, ENOENT);
 		return;
 	}
@@ -875,5 +874,5 @@
 	 * return to the client.
 	 */
-	ipc_answer_1(rid, rc, bytes);
+	async_answer_1(rid, rc, bytes);
 }
 
@@ -898,5 +897,5 @@
 	vfs_file_t *file = vfs_file_get(fd);
 	if (!file) {
-		ipc_answer_0(rid, ENOENT);
+		async_answer_0(rid, ENOENT);
 		return;
 	}
@@ -911,5 +910,5 @@
 			fibril_mutex_unlock(&file->lock);
 			vfs_file_put(file);
-			ipc_answer_1(rid, EOK, off);
+			async_answer_1(rid, EOK, off);
 			return;
 		}
@@ -919,5 +918,5 @@
 			fibril_mutex_unlock(&file->lock);
 			vfs_file_put(file);
-			ipc_answer_0(rid, EOVERFLOW);
+			async_answer_0(rid, EOVERFLOW);
 			return;
 		}
@@ -926,5 +925,5 @@
 			fibril_mutex_unlock(&file->lock);
 			vfs_file_put(file);
-			ipc_answer_0(rid, EOVERFLOW);
+			async_answer_0(rid, EOVERFLOW);
 			return;
 		}
@@ -935,5 +934,5 @@
 		fibril_mutex_unlock(&file->lock);
 		vfs_file_put(file);
-		ipc_answer_2(rid, EOK, LOWER32(newoff),
+		async_answer_2(rid, EOK, LOWER32(newoff),
 		    UPPER32(newoff));
 		return;
@@ -946,5 +945,5 @@
 			fibril_mutex_unlock(&file->lock);
 			vfs_file_put(file);
-			ipc_answer_0(rid, EOVERFLOW);
+			async_answer_0(rid, EOVERFLOW);
 			return;
 		}
@@ -954,5 +953,5 @@
 			fibril_mutex_unlock(&file->lock);
 			vfs_file_put(file);
-			ipc_answer_0(rid, EOVERFLOW);
+			async_answer_0(rid, EOVERFLOW);
 			return;
 		}
@@ -964,5 +963,5 @@
 		fibril_mutex_unlock(&file->lock);
 		vfs_file_put(file);
-		ipc_answer_2(rid, EOK, LOWER32(newoff), UPPER32(newoff));
+		async_answer_2(rid, EOK, LOWER32(newoff), UPPER32(newoff));
 		return;
 	}
@@ -970,5 +969,5 @@
 	fibril_mutex_unlock(&file->lock);
 	vfs_file_put(file);
-	ipc_answer_0(rid, EINVAL);
+	async_answer_0(rid, EINVAL);
 }
 
@@ -995,5 +994,5 @@
 	vfs_file_t *file = vfs_file_get(fd);
 	if (!file) {
-		ipc_answer_0(rid, ENOENT);
+		async_answer_0(rid, ENOENT);
 		return;
 	}
@@ -1009,5 +1008,5 @@
 	fibril_mutex_unlock(&file->lock);
 	vfs_file_put(file);
-	ipc_answer_0(rid, (sysarg_t)rc);
+	async_answer_0(rid, (sysarg_t)rc);
 }
 
@@ -1019,5 +1018,5 @@
 	vfs_file_t *file = vfs_file_get(fd);
 	if (!file) {
-		ipc_answer_0(rid, ENOENT);
+		async_answer_0(rid, ENOENT);
 		return;
 	}
@@ -1026,6 +1025,6 @@
 	if (!async_data_read_receive(&callid, NULL)) {
 		vfs_file_put(file);
-		ipc_answer_0(callid, EINVAL);
-		ipc_answer_0(rid, EINVAL);
+		async_answer_0(callid, EINVAL);
+		async_answer_0(rid, EINVAL);
 		return;
 	}
@@ -1038,5 +1037,5 @@
 	msg = async_send_3(fs_phone, VFS_OUT_STAT, file->node->devmap_handle,
 	    file->node->index, true, NULL);
-	ipc_forward_fast(callid, fs_phone, 0, 0, 0, IPC_FF_ROUTE_FROM_ME);
+	async_forward_fast(callid, fs_phone, 0, 0, 0, IPC_FF_ROUTE_FROM_ME);
 	async_wait_for(msg, &rc);
 	vfs_release_phone(file->node->fs_handle, fs_phone);
@@ -1044,5 +1043,5 @@
 	fibril_mutex_unlock(&file->lock);
 	vfs_file_put(file);
-	ipc_answer_0(rid, rc);
+	async_answer_0(rid, rc);
 }
 
@@ -1052,5 +1051,5 @@
 	int rc = async_data_write_accept((void **) &path, true, 0, 0, 0, NULL);
 	if (rc != EOK) {
-		ipc_answer_0(rid, rc);
+		async_answer_0(rid, rc);
 		return;
 	}
@@ -1059,6 +1058,6 @@
 	if (!async_data_read_receive(&callid, NULL)) {
 		free(path);
-		ipc_answer_0(callid, EINVAL);
-		ipc_answer_0(rid, EINVAL);
+		async_answer_0(callid, EINVAL);
+		async_answer_0(rid, EINVAL);
 		return;
 	}
@@ -1070,6 +1069,6 @@
 	if (rc != EOK) {
 		fibril_rwlock_read_unlock(&namespace_rwlock);
-		ipc_answer_0(callid, rc);
-		ipc_answer_0(rid, rc);
+		async_answer_0(callid, rc);
+		async_answer_0(rid, rc);
 		return;
 	}
@@ -1077,6 +1076,6 @@
 	if (!node) {
 		fibril_rwlock_read_unlock(&namespace_rwlock);
-		ipc_answer_0(callid, ENOMEM);
-		ipc_answer_0(rid, ENOMEM);
+		async_answer_0(callid, ENOMEM);
+		async_answer_0(rid, ENOMEM);
 		return;
 	}
@@ -1088,5 +1087,5 @@
 	msg = async_send_3(fs_phone, VFS_OUT_STAT, node->devmap_handle,
 	    node->index, false, NULL);
-	ipc_forward_fast(callid, fs_phone, 0, 0, 0, IPC_FF_ROUTE_FROM_ME);
+	async_forward_fast(callid, fs_phone, 0, 0, 0, IPC_FF_ROUTE_FROM_ME);
 	
 	sysarg_t rv;
@@ -1094,5 +1093,5 @@
 	vfs_release_phone(node->fs_handle, fs_phone);
 
-	ipc_answer_0(rid, rv);
+	async_answer_0(rid, rv);
 
 	vfs_node_put(node);
@@ -1106,5 +1105,5 @@
 	int rc = async_data_write_accept((void **) &path, true, 0, 0, 0, NULL);
 	if (rc != EOK) {
-		ipc_answer_0(rid, rc);
+		async_answer_0(rid, rc);
 		return;
 	}
@@ -1118,5 +1117,5 @@
 	fibril_rwlock_write_unlock(&namespace_rwlock);
 	free(path);
-	ipc_answer_0(rid, rc);
+	async_answer_0(rid, rc);
 }
 
@@ -1128,5 +1127,5 @@
 	int rc = async_data_write_accept((void **) &path, true, 0, 0, 0, NULL);
 	if (rc != EOK) {
-		ipc_answer_0(rid, rc);
+		async_answer_0(rid, rc);
 		return;
 	}
@@ -1139,5 +1138,5 @@
 	if (rc != EOK) {
 		fibril_rwlock_write_unlock(&namespace_rwlock);
-		ipc_answer_0(rid, rc);
+		async_answer_0(rid, rc);
 		return;
 	}
@@ -1154,5 +1153,5 @@
 	fibril_rwlock_write_unlock(&namespace_rwlock);
 	vfs_node_put(node);
-	ipc_answer_0(rid, EOK);
+	async_answer_0(rid, EOK);
 }
 
@@ -1163,5 +1162,5 @@
 	int rc = async_data_write_accept((void **) &old, true, 0, 0, 0, NULL);
 	if (rc != EOK) {
-		ipc_answer_0(rid, rc);
+		async_answer_0(rid, rc);
 		return;
 	}
@@ -1172,5 +1171,5 @@
 	if (rc != EOK) {
 		free(old);
-		ipc_answer_0(rid, rc);
+		async_answer_0(rid, rc);
 		return;
 	}
@@ -1182,5 +1181,5 @@
 	
 	if ((!oldc) || (!newc)) {
-		ipc_answer_0(rid, EINVAL);
+		async_answer_0(rid, EINVAL);
 		free(old);
 		free(new);
@@ -1201,5 +1200,5 @@
 		 * - oldc and newc are equal.
 		 */
-		ipc_answer_0(rid, EINVAL);
+		async_answer_0(rid, EINVAL);
 		free(old);
 		free(new);
@@ -1216,5 +1215,5 @@
 	if (rc != EOK) {
 		fibril_rwlock_write_unlock(&namespace_rwlock);
-		ipc_answer_0(rid, rc);
+		async_answer_0(rid, rc);
 		free(old);
 		free(new);
@@ -1225,5 +1224,5 @@
 	if (!old_node) {
 		fibril_rwlock_write_unlock(&namespace_rwlock);
-		ipc_answer_0(rid, ENOMEM);
+		async_answer_0(rid, ENOMEM);
 		free(old);
 		free(new);
@@ -1235,5 +1234,5 @@
 	if (!parentc) {
 		fibril_rwlock_write_unlock(&namespace_rwlock);
-		ipc_answer_0(rid, rc);
+		async_answer_0(rid, rc);
 		free(old);
 		free(new);
@@ -1252,5 +1251,5 @@
 	if (rc != EOK) {
 		fibril_rwlock_write_unlock(&namespace_rwlock);
-		ipc_answer_0(rid, rc);
+		async_answer_0(rid, rc);
 		free(old);
 		free(new);
@@ -1262,5 +1261,5 @@
 	    (old_node->devmap_handle != new_par_lr.triplet.devmap_handle)) {
 		fibril_rwlock_write_unlock(&namespace_rwlock);
-		ipc_answer_0(rid, EXDEV);	/* different file systems */
+		async_answer_0(rid, EXDEV);	/* different file systems */
 		free(old);
 		free(new);
@@ -1280,5 +1279,5 @@
 		if (!new_node) {
 			fibril_rwlock_write_unlock(&namespace_rwlock);
-			ipc_answer_0(rid, ENOMEM);
+			async_answer_0(rid, ENOMEM);
 			free(old);
 			free(new);
@@ -1291,5 +1290,5 @@
 	default:
 		fibril_rwlock_write_unlock(&namespace_rwlock);
-		ipc_answer_0(rid, ENOTEMPTY);
+		async_answer_0(rid, ENOTEMPTY);
 		free(old);
 		free(new);
@@ -1303,5 +1302,5 @@
 		if (new_node)
 			vfs_node_put(new_node);
-		ipc_answer_0(rid, rc);
+		async_answer_0(rid, rc);
 		free(old);
 		free(new);
@@ -1320,5 +1319,5 @@
 		if (new_node)
 			vfs_node_put(new_node);
-		ipc_answer_0(rid, rc);
+		async_answer_0(rid, rc);
 		free(old);
 		free(new);
@@ -1337,5 +1336,5 @@
 	free(old);
 	free(new);
-	ipc_answer_0(rid, EOK);
+	async_answer_0(rid, EOK);
 }
 
@@ -1347,5 +1346,5 @@
 	/* If the file descriptors are the same, do nothing. */
 	if (oldfd == newfd) {
-		ipc_answer_1(rid, EOK, newfd);
+		async_answer_1(rid, EOK, newfd);
 		return;
 	}
@@ -1354,5 +1353,5 @@
 	vfs_file_t *oldfile = vfs_file_get(oldfd);
 	if (!oldfile) {
-		ipc_answer_0(rid, EBADF);
+		async_answer_0(rid, EBADF);
 		return;
 	}
@@ -1373,5 +1372,5 @@
 			vfs_file_put(oldfile);
 			vfs_file_put(newfile);
-			ipc_answer_0(rid, ret);
+			async_answer_0(rid, ret);
 			return;
 		}
@@ -1382,5 +1381,5 @@
 			vfs_file_put(oldfile);
 			vfs_file_put(newfile);
-			ipc_answer_0(rid, ret);
+			async_answer_0(rid, ret);
 			return;
 		}
@@ -1394,7 +1393,7 @@
 	
 	if (ret != EOK)
-		ipc_answer_0(rid, ret);
+		async_answer_0(rid, ret);
 	else
-		ipc_answer_1(rid, EOK, newfd);
+		async_answer_1(rid, EOK, newfd);
 }
 
Index: uspace/srv/vfs/vfs_register.c
===================================================================
--- uspace/srv/vfs/vfs_register.c	(revision aa893e0c1c2438f546d8cc1d5ff8f9942998561c)
+++ uspace/srv/vfs/vfs_register.c	(revision c5f0bfffe0644d5f68b8770b64ce778a4d946424)
@@ -36,5 +36,4 @@
  */
 
-#include <ipc/ipc.h>
 #include <ipc/services.h>
 #include <async.h>
@@ -122,5 +121,5 @@
 		dprintf("Failed to deliver the VFS info into our AS, rc=%d.\n",
 		    rc);
-		ipc_answer_0(rid, rc);
+		async_answer_0(rid, rc);
 		return;
 	}
@@ -132,5 +131,5 @@
 	if (!fs_info) {
 		dprintf("Could not allocate memory for FS info.\n");
-		ipc_answer_0(rid, ENOMEM);
+		async_answer_0(rid, ENOMEM);
 		return;
 	}
@@ -144,5 +143,5 @@
 	if (!vfs_info_sane(&fs_info->vfs_info)) {
 		free(fs_info);
-		ipc_answer_0(rid, EINVAL);
+		async_answer_0(rid, EINVAL);
 		return;
 	}
@@ -160,5 +159,5 @@
 		fibril_mutex_unlock(&fs_head_lock);
 		free(fs_info);
-		ipc_answer_0(rid, EEXISTS);
+		async_answer_0(rid, EEXISTS);
 		return;
 	}
@@ -182,6 +181,6 @@
 		fibril_mutex_unlock(&fs_head_lock);
 		free(fs_info);
-		ipc_answer_0(callid, EINVAL);
-		ipc_answer_0(rid, EINVAL);
+		async_answer_0(callid, EINVAL);
+		async_answer_0(rid, EINVAL);
 		return;
 	}
@@ -189,5 +188,5 @@
 	phone = IPC_GET_ARG5(call);
 	async_session_create(&fs_info->session, phone, 0);
-	ipc_answer_0(callid, EOK);
+	async_answer_0(callid, EOK);
 	
 	dprintf("Callback connection to FS created.\n");
@@ -203,8 +202,8 @@
 		fibril_mutex_unlock(&fs_head_lock);
 		async_session_destroy(&fs_info->session);
-		ipc_hangup(phone);
-		free(fs_info);
-		ipc_answer_0(callid, EINVAL);
-		ipc_answer_0(rid, EINVAL);
+		async_hangup(phone);
+		free(fs_info);
+		async_answer_0(callid, EINVAL);
+		async_answer_0(rid, EINVAL);
 		return;
 	}
@@ -218,8 +217,8 @@
 		fibril_mutex_unlock(&fs_head_lock);
 		async_session_destroy(&fs_info->session);
-		ipc_hangup(phone);
-		free(fs_info);
-		ipc_answer_0(callid, EINVAL);
-		ipc_answer_0(rid, EINVAL);
+		async_hangup(phone);
+		free(fs_info);
+		async_answer_0(callid, EINVAL);
+		async_answer_0(rid, EINVAL);
 		return;
 	}
@@ -239,5 +238,5 @@
 	 */
 	fs_info->fs_handle = (fs_handle_t) atomic_postinc(&fs_handle_next);
-	ipc_answer_1(rid, EOK, (sysarg_t) fs_info->fs_handle);
+	async_answer_1(rid, EOK, (sysarg_t) fs_info->fs_handle);
 	
 	fibril_condvar_broadcast(&fs_head_cv);
