Index: init/Makefile
===================================================================
--- init/Makefile	(revision 4f34b6ac42375724d853b5027eb939a834cacdba)
+++ init/Makefile	(revision 936351c1f07abd9557396c96a0c7ff72a82989ec)
@@ -59,5 +59,5 @@
 
 $(OUTPUT): $(OBJECTS)
-	$(LD) -T $(LIBC_PREFIX)/arch/$(ARCH)/_link.ld  $(OBJECTS) $(LIBC_PREFIX)/libc.a $(LIBIPC_PREFIX)/libipc.a $(LFLAGS) -o $@ -Map $(OUTPUT).map
+	$(LD) -T $(LIBC_PREFIX)/arch/$(ARCH)/_link.ld  $(OBJECTS) $(LIBIPC_PREFIX)/libipc.a $(LIBC_PREFIX)/libc.a $(LFLAGS) -o $@ -Map $(OUTPUT).map
 
 disasm:
Index: init/init.c
===================================================================
--- init/init.c	(revision 4f34b6ac42375724d853b5027eb939a834cacdba)
+++ init/init.c	(revision 936351c1f07abd9557396c96a0c7ff72a82989ec)
@@ -33,4 +33,5 @@
 #include <unistd.h>
 #include <stdlib.h>
+
 /*
 static void test_printf(void)
@@ -45,4 +46,5 @@
 }
 */
+
 /*
 static void test_mremap(void)
@@ -90,9 +92,45 @@
 */
 
+/*
+static void got_answer(void *private, int retval, ipc_data_t *data)
+{
+	printf("Retval: %d...%s...%X, %X\n", retval, private,
+	       IPC_GET_ARG1(*data), IPC_GET_ARG2(*data));
+}
+static void test_async_ipc(void)
+{
+	ipc_data_t data;
+	int i;
+
+	printf("Sending ping\n");
+	ipc_call_async_2(PHONE_NS, NS_PING, 1, 0xbeefbee2,
+			 "Pong1", got_answer);
+	ipc_call_async_2(PHONE_NS, NS_PING, 2, 0xbeefbee4, 
+			 "Pong2", got_answer);
+	ipc_call_async_2(PHONE_NS, NS_PING, 3, 0xbeefbee4, 
+			 "Pong3", got_answer);
+	ipc_call_async_2(PHONE_NS, NS_PING, 4, 0xbeefbee4, 
+			 "Pong4", got_answer);
+	ipc_call_async_2(PHONE_NS, NS_PING, 5, 0xbeefbee4, 
+			 "Pong5", got_answer);
+	ipc_call_async_2(PHONE_NS, NS_PING, 6, 0xbeefbee4, 
+			 "Pong6", got_answer);
+	printf("Waiting forever...\n");
+	for (i=0; i<100;i++)
+		printf(".");
+	printf("\n");
+	ipc_wait_for_call(&data, NULL);
+	printf("Received call???\n");
+}
+*/
+
 int main(int argc, char *argv[])
 {
+	ipcarg_t arg1, arg2;
+
 	version_print();
 
-	ipc_call_sync_2(PHONE_NS, NS_PING, 2, 0, 0, 0);
+	ipc_call_sync_2(PHONE_NS, NS_PING, 0xaaaa, 0xbbbb, &arg1, &arg2);
+	printf("Pong: %P %P\n", arg1, arg2);
 	
 	return 0;
Index: libadt/include/list.h
===================================================================
--- libadt/include/list.h	(revision 4f34b6ac42375724d853b5027eb939a834cacdba)
+++ libadt/include/list.h	(revision 936351c1f07abd9557396c96a0c7ff72a82989ec)
@@ -178,5 +178,5 @@
 }
 
-#define list_get_instance(link,type,member) (type *)(((__u8*)(link))-((__u8*)&(((type *)NULL)->member)))
+#define list_get_instance(link,type,member) (type *)(((char *)(link))-((char *)&(((type *)NULL)->member)))
 
 extern int list_member(const link_t *link, const link_t *head);
Index: libc/Makefile
===================================================================
--- libc/Makefile	(revision 4f34b6ac42375724d853b5027eb939a834cacdba)
+++ libc/Makefile	(revision 936351c1f07abd9557396c96a0c7ff72a82989ec)
@@ -43,4 +43,5 @@
 	generic/libc.c \
 	generic/mmap.c \
+	generic/string.c \
 	generic/io/io.c \
 	generic/io/print.c \
Index: libc/generic/mmap.c
===================================================================
--- libc/generic/mmap.c	(revision 4f34b6ac42375724d853b5027eb939a834cacdba)
+++ libc/generic/mmap.c	(revision 936351c1f07abd9557396c96a0c7ff72a82989ec)
@@ -63,6 +63,10 @@
 	if (!res)
 		return NULL;
-	res = (void *)&_heap + incr;
+	
+	/* Compute start of new area */
+	res = (void *)&_heap + heapsize;
+
 	heapsize += incr;
+
 	return res;
 }
Index: libc/generic/string.c
===================================================================
--- libc/generic/string.c	(revision 936351c1f07abd9557396c96a0c7ff72a82989ec)
+++ libc/generic/string.c	(revision 936351c1f07abd9557396c96a0c7ff72a82989ec)
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2005 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.
+ */
+
+#include <types.h>
+#include <string.h>
+
+/* Dummy implementation of mem/ functions */
+
+void * memset(void *s, int c, size_t n)
+{
+	char *os = s;
+	while (n--)
+		*(os++) = c;
+	return s;
+}
+
+void * memcpy(void *dest, void *src, size_t n)
+{
+	char *os = src;
+	char *odst = dest;
+	while (n--)
+		*(odst++) = *(os++);
+	return dest;
+}
Index: libc/include/string.h
===================================================================
--- libc/include/string.h	(revision 4f34b6ac42375724d853b5027eb939a834cacdba)
+++ libc/include/string.h	(revision 936351c1f07abd9557396c96a0c7ff72a82989ec)
@@ -31,20 +31,6 @@
 #define __LIBC__STRING_H__
 
-static inline void * memset(void *s, int c, size_t n)
-{
-	char *os = s;
-	while (n--)
-		*(os++) = c;
-	return s;
-}
-
-static inline void * memcpy(void *dest, void *src, size_t n)
-{
-	char *os = src;
-	char *odst = dest;
-	while (n--)
-		*(odst++) = *(os++);
-	return dest;
-}
+void * memset(void *s, int c, size_t n);
+void * memcpy(void *dest, void *src, size_t n);
 
 #endif
Index: libc/malloc/malloc.c
===================================================================
--- libc/malloc/malloc.c	(revision 4f34b6ac42375724d853b5027eb939a834cacdba)
+++ libc/malloc/malloc.c	(revision 936351c1f07abd9557396c96a0c7ff72a82989ec)
@@ -439,111 +439,38 @@
 */
 
-#ifndef WIN32
-#ifdef _WIN32
-#define WIN32 1
-#endif  /* _WIN32 */
-#endif  /* WIN32 */
-#ifdef WIN32
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#define HAVE_MMAP 1
-#define HAVE_MORECORE 0
-#define LACKS_UNISTD_H
+#include <sys/types.h>  /* For size_t */
+
+/** Non-default helenos customizations */
+#define LACKS_FCNTL_H
+#define LACKS_SYS_MMAN_H
 #define LACKS_SYS_PARAM_H
-#define LACKS_SYS_MMAN_H
-#define LACKS_STRING_H
-#define LACKS_STRINGS_H
-#define LACKS_SYS_TYPES_H
+#undef HAVE_MMAP
+#define HAVE_MMAP 0
 #define LACKS_ERRNO_H
+/* Set errno? */
+#undef MALLOC_FAILURE_ACTION
 #define MALLOC_FAILURE_ACTION
-#define MMAP_CLEARS 0 /* WINCE and some others apparently don't clear */
-#endif  /* WIN32 */
-
-#if defined(DARWIN) || defined(_DARWIN)
-/* Mac OSX docs advise not to use sbrk; it seems better to use mmap */
-#ifndef HAVE_MORECORE
-#define HAVE_MORECORE 0
-#define HAVE_MMAP 1
-#endif  /* HAVE_MORECORE */
-#endif  /* DARWIN */
-
-#ifndef LACKS_SYS_TYPES_H
-#include <sys/types.h>  /* For size_t */
-#endif  /* LACKS_SYS_TYPES_H */
 
 /* The maximum possible size_t value has all bits set */
 #define MAX_SIZE_T           (~(size_t)0)
 
-#ifndef ONLY_MSPACES
 #define ONLY_MSPACES 0
-#endif  /* ONLY_MSPACES */
-#ifndef MSPACES
-#if ONLY_MSPACES
-#define MSPACES 1
-#else   /* ONLY_MSPACES */
 #define MSPACES 0
-#endif  /* ONLY_MSPACES */
-#endif  /* MSPACES */
-#ifndef MALLOC_ALIGNMENT
 #define MALLOC_ALIGNMENT ((size_t)8U)
-#endif  /* MALLOC_ALIGNMENT */
-#ifndef FOOTERS
 #define FOOTERS 0
-#endif  /* FOOTERS */
-#ifndef ABORT
 #define ABORT  abort()
-#endif  /* ABORT */
-#ifndef ABORT_ON_ASSERT_FAILURE
 #define ABORT_ON_ASSERT_FAILURE 1
-#endif  /* ABORT_ON_ASSERT_FAILURE */
-#ifndef PROCEED_ON_ERROR
 #define PROCEED_ON_ERROR 0
-#endif  /* PROCEED_ON_ERROR */
-#ifndef USE_LOCKS
 #define USE_LOCKS 0
-#endif  /* USE_LOCKS */
-#ifndef INSECURE
 #define INSECURE 0
-#endif  /* INSECURE */
-#ifndef HAVE_MMAP
-#define HAVE_MMAP 1
-#endif  /* HAVE_MMAP */
-#ifndef MMAP_CLEARS
+#define HAVE_MMAP 0
+
 #define MMAP_CLEARS 1
-#endif  /* MMAP_CLEARS */
-#ifndef HAVE_MREMAP
-#ifdef linux
-#define HAVE_MREMAP 1
-#else   /* linux */
-#define HAVE_MREMAP 0
-#endif  /* linux */
-#endif  /* HAVE_MREMAP */
-#ifndef MALLOC_FAILURE_ACTION
-#define MALLOC_FAILURE_ACTION  errno = ENOMEM;
-#endif  /* MALLOC_FAILURE_ACTION */
-#ifndef HAVE_MORECORE
-#if ONLY_MSPACES
-#define HAVE_MORECORE 0
-#else   /* ONLY_MSPACES */
+
 #define HAVE_MORECORE 1
-#endif  /* ONLY_MSPACES */
-#endif  /* HAVE_MORECORE */
-#if !HAVE_MORECORE
-#define MORECORE_CONTIGUOUS 0
-#else   /* !HAVE_MORECORE */
-#ifndef MORECORE
+#define MORECORE_CONTIGUOUS 1
 #define MORECORE sbrk
-#endif  /* MORECORE */
-#ifndef MORECORE_CONTIGUOUS
-#define MORECORE_CONTIGUOUS 1
-#endif  /* MORECORE_CONTIGUOUS */
-#endif  /* HAVE_MORECORE */
-#ifndef DEFAULT_GRANULARITY
-#if MORECORE_CONTIGUOUS
 #define DEFAULT_GRANULARITY (0)  /* 0 means to compute in init_mparams */
-#else   /* MORECORE_CONTIGUOUS */
-#define DEFAULT_GRANULARITY ((size_t)64U * (size_t)1024U)
-#endif  /* MORECORE_CONTIGUOUS */
-#endif  /* DEFAULT_GRANULARITY */
+
 #ifndef DEFAULT_TRIM_THRESHOLD
 #ifndef MORECORE_CANNOT_TRIM
@@ -584,16 +511,4 @@
 #define M_MMAP_THRESHOLD     (-3)
 
-/** Non-default helenos customizations */
-#define LACKS_FCNTL_H
-#define LACKS_SYS_MMAN_H
-#define LACKS_SYS_PARAM_H
-#undef HAVE_MMAP
-#define HAVE_MMAP 0
-#define LACKS_ERRNO_H
-/* Set errno? */
-#undef MALLOC_FAILURE_ACTION
-#define MALLOC_FAILURE_ACTION 
-
-
 /*
   ========================================================================
@@ -608,9 +523,6 @@
 /*------------------------------ internal #includes ---------------------- */
 
-#ifdef WIN32
-#pragma warning( disable : 4146 ) /* no "unsigned" warnings */
-#endif /* WIN32 */
-
 #include <stdio.h>       /* for printing in malloc_stats */
+#include <string.h>
 
 #ifndef LACKS_ERRNO_H
@@ -632,7 +544,4 @@
 #define assert(x)
 #endif /* DEBUG */
-#ifndef LACKS_STRING_H
-#include <string.h>      /* for memset etc */
-#endif  /* LACKS_STRING_H */
 #if USE_BUILTIN_FFS
 #ifndef LACKS_STRINGS_H
Index: libipc/Makefile
===================================================================
--- libipc/Makefile	(revision 4f34b6ac42375724d853b5027eb939a834cacdba)
+++ libipc/Makefile	(revision 936351c1f07abd9557396c96a0c7ff72a82989ec)
@@ -37,5 +37,5 @@
 include $(LIBC_PREFIX)/Makefile.toolchain
 
-CFLAGS += -Iinclude
+CFLAGS += -Iinclude -I../libadt/include -I../libc/include
 
 ## Sources
Index: libipc/generic/ipc.c
===================================================================
--- libipc/generic/ipc.c	(revision 4f34b6ac42375724d853b5027eb939a834cacdba)
+++ libipc/generic/ipc.c	(revision 936351c1f07abd9557396c96a0c7ff72a82989ec)
@@ -29,12 +29,38 @@
 #include <ipc.h>
 #include <libc.h>
-
-int ipc_call_sync(int phoneid, sysarg_t method, sysarg_t arg1, 
-		  sysarg_t *result)
+#include <malloc.h>
+#include <errno.h>
+#include <list.h>
+#include <stdio.h>
+#include <unistd.h>
+
+/** Structure used for keeping track of sent async msgs 
+ * and queing unsent msgs
+ *
+ */
+typedef struct {
+	link_t list;
+
+	ipc_async_callback_t callback;
+	void *private;
+	union {
+		ipc_callid_t callid;
+		struct {
+			int phoneid;
+			ipc_data_t data;
+		} msg;
+	}u;
+} async_call_t;
+
+LIST_INITIALIZE(dispatched_calls);
+LIST_INITIALIZE(queued_calls);
+
+int ipc_call_sync(int phoneid, ipcarg_t method, ipcarg_t arg1, 
+		  ipcarg_t *result)
 {
 	ipc_data_t resdata;
 	int callres;
 	
-	callres = __SYSCALL4(SYS_IPC_CALL_SYNC, phoneid, method, arg1,
+	callres = __SYSCALL4(SYS_IPC_CALL_SYNC_FAST, phoneid, method, arg1,
 			     (sysarg_t)&resdata);
 	if (callres)
@@ -45,7 +71,7 @@
 }
 
-int ipc_call_sync_3(int phoneid, sysarg_t method, sysarg_t arg1,
-		    sysarg_t arg2, sysarg_t arg3,
-		    sysarg_t *result1, sysarg_t *result2, sysarg_t *result3)
+int ipc_call_sync_3(int phoneid, ipcarg_t method, ipcarg_t arg1,
+		    ipcarg_t arg2, ipcarg_t arg3,
+		    ipcarg_t *result1, ipcarg_t *result2, ipcarg_t *result3)
 {
 	ipc_data_t data;
@@ -57,5 +83,5 @@
 	IPC_SET_ARG3(data, arg3);
 
-	callres = __SYSCALL2(SYS_IPC_CALL_SYNC_MEDIUM, phoneid, (sysarg_t)&data);
+	callres = __SYSCALL2(SYS_IPC_CALL_SYNC, phoneid, (sysarg_t)&data);
 	if (callres)
 		return callres;
@@ -70,4 +96,10 @@
 }
 
+/** Syscall to send asynchronous message */
+static	ipc_callid_t _ipc_call_async(int phoneid, ipc_data_t *data)
+{
+	return __SYSCALL2(SYS_IPC_CALL_ASYNC, phoneid, (sysarg_t)data);
+}
+
 /** Send asynchronous message
  *
@@ -75,34 +107,47 @@
  * - if message cannot be temporarily sent, add to queue
  */
-void ipc_call_async_2(int phoneid, sysarg_t method, sysarg_t arg1,
-		      sysarg_t arg2,
+void ipc_call_async_2(int phoneid, ipcarg_t method, ipcarg_t arg1,
+		      ipcarg_t arg2, void *private,
 		      ipc_async_callback_t callback)
 {
+	async_call_t *call;
 	ipc_callid_t callid;
-	ipc_data_t data; /* Data storage for saving calls */
-
-	callid = __SYSCALL4(SYS_IPC_CALL_ASYNC, phoneid, method, arg1, arg2);
+
+	call = malloc(sizeof(*call));
+	if (!call) {
+		callback(private, ENOMEM, NULL);
+	}
+		
+	callid = __SYSCALL4(SYS_IPC_CALL_ASYNC_FAST, phoneid, method, arg1, arg2);
 	if (callid == IPC_CALLRET_FATAL) {
 		/* Call asynchronous handler with error code */
-		IPC_SET_RETVAL(data, IPC_CALLRET_FATAL);
-		callback(&data);
+		IPC_SET_RETVAL(call->u.msg.data, ENOENT);
+		callback(private, ENOENT, NULL);
+		free(call);
 		return;
 	}
+
+	call->callback = callback;
+	call->private = private;
+
 	if (callid == IPC_CALLRET_TEMPORARY) {
 		/* Add asynchronous call to queue of non-dispatched async calls */
-		IPC_SET_METHOD(data, method);
-		IPC_SET_ARG1(data, arg1);
-		IPC_SET_ARG2(data, arg2);
-		
+		call->u.msg.phoneid = phoneid;
+		IPC_SET_METHOD(call->u.msg.data, method);
+		IPC_SET_ARG1(call->u.msg.data, arg1);
+		IPC_SET_ARG2(call->u.msg.data, arg2);
+
+		list_append(&call->list, &queued_calls);
 		return;
 	}
-	/* Add callid to list of dispatched calls */
-	
+	call->u.callid = callid;
+	/* Add call to list of dispatched calls */
+	list_append(&call->list, &dispatched_calls);
 }
 
 
 /** Send answer to a received call */
-void ipc_answer(ipc_callid_t callid, sysarg_t retval, sysarg_t arg1,
-		sysarg_t arg2)
+void ipc_answer(ipc_callid_t callid, ipcarg_t retval, ipcarg_t arg1,
+		ipcarg_t arg2)
 {
 	__SYSCALL4(SYS_IPC_ANSWER, callid, retval, arg1, arg2);
@@ -116,7 +161,63 @@
 }
 
+/** Try to dispatch queed calls from async queue */
+static void try_dispatch_queued_calls(void)
+{
+	async_call_t *call;
+	ipc_callid_t callid;
+
+	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_CALLRET_TEMPORARY)
+			break;
+		list_remove(&call->list);
+		if (callid == IPC_CALLRET_FATAL) {
+			call->callback(call->private, ENOENT, NULL);
+			free(call);
+		} else {
+			call->u.callid = callid;
+			list_append(&call->list, &dispatched_calls);
+		}
+	}
+}
+
+/** Handle received answer
+ *
+ * TODO: Make it use hash table
+ *
+ * @param callid Callid (with first bit set) of the answered call
+ */
+static void handle_answer(ipc_callid_t callid, ipc_data_t *data)
+{
+	link_t *item;
+	async_call_t *call;
+
+	callid &= ~IPC_CALLID_ANSWERED;
+	
+	for (item = dispatched_calls.next; item != &dispatched_calls;
+	     item = item->next) {
+		call = list_get_instance(item, async_call_t, list);
+		if (call->u.callid == callid) {
+			list_remove(&call->list);
+			call->callback(call->private, 
+				       IPC_GET_RETVAL(*data),
+				       data);
+			return;
+		}
+	}
+	printf("Received unidentified answer: %P!!!\n", callid);
+}
+
+
 /** Wait for IPC call and return
  *
  * - dispatch ASYNC reoutines in the background
+ * @param data Space where the message is stored
+ * @return Callid or 0 if nothing available and started with 
+ *         IPC_WAIT_NONBLOCKING
  */
 int ipc_wait_for_call(ipc_data_t *data, int flags)
@@ -125,10 +226,12 @@
 
 	do {
-		/* Try to dispatch non-dispatched async calls */
+		try_dispatch_queued_calls();
+
 		callid = _ipc_wait_for_call(data, flags);
-		if (callid & IPC_CALLID_ANSWERED) {
-			/* TODO: Call async answer handler */
-		}
+		/* Handle received answers */
+		if (callid & IPC_CALLID_ANSWERED)
+			handle_answer(callid, data);
 	} while (callid & IPC_CALLID_ANSWERED);
+
 	return callid;
 }
Index: libipc/include/ipc.h
===================================================================
--- libipc/include/ipc.h	(revision 4f34b6ac42375724d853b5027eb939a834cacdba)
+++ libipc/include/ipc.h	(revision 936351c1f07abd9557396c96a0c7ff72a82989ec)
@@ -33,25 +33,28 @@
 #include <libc.h>
 
-typedef sysarg_t ipc_data_t[IPC_CALL_LEN];
+typedef sysarg_t ipcarg_t;
+typedef ipcarg_t ipc_data_t[IPC_CALL_LEN];
 typedef sysarg_t ipc_callid_t;
 
-typedef void (* ipc_async_callback_t)(ipc_data_t *data);
+typedef void (* ipc_async_callback_t)(void *private, 
+				      int retval,
+				      ipc_data_t *data);
 
 #define ipc_call_sync_2(phoneid, method, arg1, arg2, res1, res2) ipc_call_sync_3((phoneid), (method), (arg1), (arg2), 0, (res1), (res2), 0)
-extern int ipc_call_sync_3(int phoneid, sysarg_t method, sysarg_t arg1,
-			   sysarg_t arg2, sysarg_t arg3,
-			   sysarg_t *result1, sysarg_t *result2, 
-			   sysarg_t *result3);
+extern int ipc_call_sync_3(int phoneid, ipcarg_t method, ipcarg_t arg1,
+			   ipcarg_t arg2, ipcarg_t arg3,
+			   ipcarg_t *result1, ipcarg_t *result2, 
+			   ipcarg_t *result3);
 
 
-extern int ipc_call_sync(int phoneid, sysarg_t method, sysarg_t arg1, 
-			 sysarg_t *result);
+extern int ipc_call_sync(int phoneid, ipcarg_t method, ipcarg_t arg1, 
+			 ipcarg_t *result);
 extern int ipc_wait_for_call(ipc_data_t *data, int flags);
-extern void ipc_answer(ipc_callid_t callid, sysarg_t retval, sysarg_t arg1,
-		       sysarg_t arg2);
+extern void ipc_answer(ipc_callid_t callid, ipcarg_t retval, ipcarg_t arg1,
+		       ipcarg_t arg2);
 
-#define ipc_call_async(phoneid,method,arg1,callback) (ipc_call_async_2(phoneid, method, arg1, 0, callback))
-void ipc_call_async_2(int phoneid, sysarg_t method, sysarg_t arg1,
-		      sysarg_t arg2,
+#define ipc_call_async(phoneid,method,arg1,private, callback) (ipc_call_async_2(phoneid, method, arg1, 0, private, callback))
+void ipc_call_async_2(int phoneid, ipcarg_t method, ipcarg_t arg1,
+		      ipcarg_t arg2, void *private,
 		      ipc_async_callback_t callback);
 
