Index: uspace/lib/c/include/ipc/adb.h
===================================================================
--- uspace/lib/c/include/ipc/adb.h	(revision 2c577e0ba0c3d4da6f9430cbe193b8411923aad2)
+++ uspace/lib/c/include/ipc/adb.h	(revision 64d2b101abaf56a6f7c27f0d6b099785aa173f36)
@@ -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 2c577e0ba0c3d4da6f9430cbe193b8411923aad2)
+++ uspace/lib/c/include/ipc/arp.h	(revision 64d2b101abaf56a6f7c27f0d6b099785aa173f36)
@@ -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 2c577e0ba0c3d4da6f9430cbe193b8411923aad2)
+++ uspace/lib/c/include/ipc/bd.h	(revision 64d2b101abaf56a6f7c27f0d6b099785aa173f36)
@@ -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 2c577e0ba0c3d4da6f9430cbe193b8411923aad2)
+++ uspace/lib/c/include/ipc/char.h	(revision 64d2b101abaf56a6f7c27f0d6b099785aa173f36)
@@ -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 2c577e0ba0c3d4da6f9430cbe193b8411923aad2)
+++ uspace/lib/c/include/ipc/clipboard.h	(revision 64d2b101abaf56a6f7c27f0d6b099785aa173f36)
@@ -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 64d2b101abaf56a6f7c27f0d6b099785aa173f36)
+++ uspace/lib/c/include/ipc/common.h	(revision 64d2b101abaf56a6f7c27f0d6b099785aa173f36)
@@ -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 2c577e0ba0c3d4da6f9430cbe193b8411923aad2)
+++ uspace/lib/c/include/ipc/console.h	(revision 64d2b101abaf56a6f7c27f0d6b099785aa173f36)
@@ -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 2c577e0ba0c3d4da6f9430cbe193b8411923aad2)
+++ uspace/lib/c/include/ipc/dev_iface.h	(revision 64d2b101abaf56a6f7c27f0d6b099785aa173f36)
@@ -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 2c577e0ba0c3d4da6f9430cbe193b8411923aad2)
+++ uspace/lib/c/include/ipc/devman.h	(revision 64d2b101abaf56a6f7c27f0d6b099785aa173f36)
@@ -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 2c577e0ba0c3d4da6f9430cbe193b8411923aad2)
+++ uspace/lib/c/include/ipc/devmap.h	(revision 64d2b101abaf56a6f7c27f0d6b099785aa173f36)
@@ -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 2c577e0ba0c3d4da6f9430cbe193b8411923aad2)
+++ uspace/lib/c/include/ipc/fb.h	(revision 64d2b101abaf56a6f7c27f0d6b099785aa173f36)
@@ -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 2c577e0ba0c3d4da6f9430cbe193b8411923aad2)
+++ uspace/lib/c/include/ipc/icmp.h	(revision 64d2b101abaf56a6f7c27f0d6b099785aa173f36)
@@ -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 2c577e0ba0c3d4da6f9430cbe193b8411923aad2)
+++ uspace/lib/c/include/ipc/il.h	(revision 64d2b101abaf56a6f7c27f0d6b099785aa173f36)
@@ -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 2c577e0ba0c3d4da6f9430cbe193b8411923aad2)
+++ uspace/lib/c/include/ipc/ip.h	(revision 64d2b101abaf56a6f7c27f0d6b099785aa173f36)
@@ -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 2c577e0ba0c3d4da6f9430cbe193b8411923aad2)
+++ uspace/lib/c/include/ipc/ipc.h	(revision 64d2b101abaf56a6f7c27f0d6b099785aa173f36)
@@ -33,24 +33,17 @@
  */
 
+#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 *);
 
 /*
@@ -263,6 +256,4 @@
 extern int ipc_connect_me_to_blocking(int, int, int, int);
 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,
Index: uspace/lib/c/include/ipc/irc.h
===================================================================
--- uspace/lib/c/include/ipc/irc.h	(revision 2c577e0ba0c3d4da6f9430cbe193b8411923aad2)
+++ uspace/lib/c/include/ipc/irc.h	(revision 64d2b101abaf56a6f7c27f0d6b099785aa173f36)
@@ -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 2c577e0ba0c3d4da6f9430cbe193b8411923aad2)
+++ uspace/lib/c/include/ipc/kbd.h	(revision 64d2b101abaf56a6f7c27f0d6b099785aa173f36)
@@ -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 2c577e0ba0c3d4da6f9430cbe193b8411923aad2)
+++ uspace/lib/c/include/ipc/loader.h	(revision 64d2b101abaf56a6f7c27f0d6b099785aa173f36)
@@ -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 2c577e0ba0c3d4da6f9430cbe193b8411923aad2)
+++ uspace/lib/c/include/ipc/mouse.h	(revision 64d2b101abaf56a6f7c27f0d6b099785aa173f36)
@@ -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 2c577e0ba0c3d4da6f9430cbe193b8411923aad2)
+++ uspace/lib/c/include/ipc/net.h	(revision 64d2b101abaf56a6f7c27f0d6b099785aa173f36)
@@ -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 2c577e0ba0c3d4da6f9430cbe193b8411923aad2)
+++ uspace/lib/c/include/ipc/net_net.h	(revision 64d2b101abaf56a6f7c27f0d6b099785aa173f36)
@@ -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 2c577e0ba0c3d4da6f9430cbe193b8411923aad2)
+++ uspace/lib/c/include/ipc/netif.h	(revision 64d2b101abaf56a6f7c27f0d6b099785aa173f36)
@@ -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 2c577e0ba0c3d4da6f9430cbe193b8411923aad2)
+++ uspace/lib/c/include/ipc/nil.h	(revision 64d2b101abaf56a6f7c27f0d6b099785aa173f36)
@@ -38,5 +38,4 @@
 #define LIBC_NIL_MESSAGES_H_
 
-#include <ipc/ipc.h>
 #include <ipc/net.h>
 
Index: uspace/lib/c/include/ipc/packet.h
===================================================================
--- uspace/lib/c/include/ipc/packet.h	(revision 2c577e0ba0c3d4da6f9430cbe193b8411923aad2)
+++ uspace/lib/c/include/ipc/packet.h	(revision 64d2b101abaf56a6f7c27f0d6b099785aa173f36)
@@ -38,5 +38,4 @@
 #define LIBC_PACKET_MESSAGES_
 
-#include <ipc/ipc.h>
 #include <ipc/net.h>
 
Index: uspace/lib/c/include/ipc/socket.h
===================================================================
--- uspace/lib/c/include/ipc/socket.h	(revision 2c577e0ba0c3d4da6f9430cbe193b8411923aad2)
+++ uspace/lib/c/include/ipc/socket.h	(revision 64d2b101abaf56a6f7c27f0d6b099785aa173f36)
@@ -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 2c577e0ba0c3d4da6f9430cbe193b8411923aad2)
+++ uspace/lib/c/include/ipc/tl.h	(revision 64d2b101abaf56a6f7c27f0d6b099785aa173f36)
@@ -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 2c577e0ba0c3d4da6f9430cbe193b8411923aad2)
+++ uspace/lib/c/include/ipc/vfs.h	(revision 64d2b101abaf56a6f7c27f0d6b099785aa173f36)
@@ -36,5 +36,5 @@
 #define LIBC_IPC_VFS_H_
 
-#include <ipc/ipc.h>
+#include <ipc/common.h>
 #include <sys/types.h>
 #include <bool.h>
