Index: uspace/lib/c/generic/ipc.c
===================================================================
--- uspace/lib/c/generic/ipc.c	(revision 38542dcb2946dff802762528d1ad1190b481d010)
+++ uspace/lib/c/generic/ipc.c	(revision 6c34f587dc553bfe599e1e96d19701a9d33eddf4)
@@ -83,101 +83,4 @@
 
 static atomic_t ipc_futex = FUTEX_INITIALIZER;
-
-/** 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 = __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);
-	if (result2)
-		*result2 = IPC_GET_ARG2(resdata);
-	if (result3)
-		*result3 = IPC_GET_ARG3(resdata);
-	if (result4)
-		*result4 = IPC_GET_ARG4(resdata);
-	if (result5)
-		*result5 = IPC_GET_ARG5(resdata);
-	
-	return IPC_GET_RETVAL(resdata);
-}
-
-/** Synchronous call transmitting 5 arguments of payload.
- *
- * @param phoneid Phone handle for the call.
- * @param imethod Requested interface and method.
- * @param arg1    Service-defined payload argument.
- * @param arg2    Service-defined payload argument.
- * @param arg3    Service-defined payload argument.
- * @param arg4    Service-defined payload argument.
- * @param arg5    Service-defined payload argument.
- * @param result1 If non-NULL, storage for the first return argument.
- * @param result2 If non-NULL, storage for the second return argument.
- * @param result3 If non-NULL, storage for the third return argument.
- * @param result4 If non-NULL, storage for the fourth return argument.
- * @param result5 If non-NULL, storage for the fifth return argument.
- *
- * @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;
-	
-	IPC_SET_IMETHOD(data, imethod);
-	IPC_SET_ARG1(data, arg1);
-	IPC_SET_ARG2(data, arg2);
-	IPC_SET_ARG3(data, arg3);
-	IPC_SET_ARG4(data, arg4);
-	IPC_SET_ARG5(data, arg5);
-	
-	int callres = __SYSCALL3(SYS_IPC_CALL_SYNC_SLOW, phoneid,
-	    (sysarg_t) &data, (sysarg_t) &data);
-	if (callres)
-		return callres;
-	
-	if (result1)
-		*result1 = IPC_GET_ARG1(data);
-	if (result2)
-		*result2 = IPC_GET_ARG2(data);
-	if (result3)
-		*result3 = IPC_GET_ARG3(data);
-	if (result4)
-		*result4 = IPC_GET_ARG4(data);
-	if (result5)
-		*result5 = IPC_GET_ARG5(data);
-	
-	return IPC_GET_RETVAL(data);
-}
 
 /** Send asynchronous message via syscall.
@@ -611,98 +514,4 @@
 }
 
-/** Request callback connection.
- *
- * The @a task_id 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 task_id   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,
-    task_id_t *task_id, sysarg_t *phonehash)
-{
-	ipc_call_t data;
-	int rc = __SYSCALL6(SYS_IPC_CALL_SYNC_FAST, phoneid,
-	    IPC_M_CONNECT_TO_ME, arg1, arg2, arg3, (sysarg_t) &data);
-	if (rc == EOK) {
-		*task_id = data.in_task_id;
-		*phonehash = IPC_GET_ARG5(data);
-	}	
-	return rc;
-}
-
-/** Request cloned connection.
- *
- * @param phoneid Phone handle used for contacting the other side.
- *
- * @return Cloned phone handle on success or a negative error code.
- *
- */
-int ipc_clone_establish(int phoneid)
-{
-	sysarg_t newphid;
-	int res = ipc_call_sync_0_5(phoneid, IPC_M_CLONE_ESTABLISH, NULL,
-	    NULL, NULL, NULL, &newphid);
-	if (res)
-		return res;
-	
-	return newphid;
-}
-
-/** 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 = 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;
-}
-
-/** Request new connection (blocking)
- *
- * If the connection is not available at the moment, the
- * 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 = 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;
-}
-
 /** Hang up a phone.
  *
@@ -758,30 +567,4 @@
 }
 
-/** Wrapper for IPC_M_SHARE_IN calls.
- *
- * @param phoneid Phone that will be used to contact the receiving side.
- * @param size    Size of the destination address space area.
- * @param arg     User defined argument.
- * @param flags   Storage for received flags. Can be NULL.
- * @param dst     Destination address space area base. Cannot be NULL.
- *
- * @return Zero on success or a negative error code from errno.h.
- *
- */
-int ipc_share_in_start(int phoneid, size_t size, sysarg_t arg,
-    unsigned int *flags, void **dst)
-{
-	sysarg_t _flags = 0;
-	sysarg_t _dst = (sysarg_t) -1;
-	int res = ipc_call_sync_2_4(phoneid, IPC_M_SHARE_IN, (sysarg_t) size,
-	    arg, NULL, &_flags, NULL, &_dst);
-	
-	if (flags)
-		*flags = (unsigned int) _flags;
-	
-	*dst = (void *) _dst;
-	return res;
-}
-
 /** Wrapper for answering the IPC_M_SHARE_IN calls.
  *
@@ -803,19 +586,4 @@
 }
 
-/** 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,
-	    (sysarg_t) flags);
-}
-
 /** Wrapper for answering the IPC_M_SHARE_OUT calls.
  *
@@ -833,19 +601,4 @@
 {
 	return ipc_answer_2(callid, EOK, (sysarg_t) __entry, (sysarg_t) dst);
-}
-
-/** 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)
-{
-	return ipc_call_sync_2_0(phoneid, IPC_M_DATA_READ, (sysarg_t) dst,
-	    (sysarg_t) size);
 }
 
@@ -869,19 +622,4 @@
 }
 
-/** 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)
-{
-	return ipc_call_sync_2_0(phoneid, IPC_M_DATA_WRITE, (sysarg_t) src,
-	    (sysarg_t) size);
-}
-
 /** Wrapper for answering the IPC_M_DATA_WRITE calls.
  *
Index: uspace/lib/c/include/ipc/ipc.h
===================================================================
--- uspace/lib/c/include/ipc/ipc.h	(revision 38542dcb2946dff802762528d1ad1190b481d010)
+++ uspace/lib/c/include/ipc/ipc.h	(revision 6c34f587dc553bfe599e1e96d19701a9d33eddf4)
@@ -47,140 +47,4 @@
 
 typedef void (*ipc_async_callback_t)(void *, int, ipc_call_t *);
-
-/*
- * User-friendly wrappers for ipc_call_sync_fast() and ipc_call_sync_slow().
- * They are in the form ipc_call_sync_m_n(), where m denotes the number of
- * arguments of payload and n denotes number of return values. Whenever
- * 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)
-#define ipc_call_sync_0_1(phoneid, method, res1) \
-	ipc_call_sync_fast((phoneid), (method), 0, 0, 0, (res1), 0, 0, 0, 0)
-#define ipc_call_sync_0_2(phoneid, method, res1, res2) \
-	ipc_call_sync_fast((phoneid), (method), 0, 0, 0, (res1), (res2), 0, 0, 0)
-#define ipc_call_sync_0_3(phoneid, method, res1, res2, res3) \
-	ipc_call_sync_fast((phoneid), (method), 0, 0, 0, (res1), (res2), (res3), \
-	    0, 0)
-#define ipc_call_sync_0_4(phoneid, method, res1, res2, res3, res4) \
-	ipc_call_sync_fast((phoneid), (method), 0, 0, 0, (res1), (res2), (res3), \
-	    (res4), 0)
-#define ipc_call_sync_0_5(phoneid, method, res1, res2, res3, res4, res5) \
-	ipc_call_sync_fast((phoneid), (method), 0, 0, 0, (res1), (res2), (res3), \
-	    (res4), (res5))
-
-#define ipc_call_sync_1_0(phoneid, method, arg1) \
-	ipc_call_sync_fast((phoneid), (method), (arg1), 0, 0, 0, 0, 0, 0, 0)
-#define ipc_call_sync_1_1(phoneid, method, arg1, res1) \
-	ipc_call_sync_fast((phoneid), (method), (arg1), 0, 0, (res1), 0, 0, 0, 0)
-#define ipc_call_sync_1_2(phoneid, method, arg1, res1, res2) \
-	ipc_call_sync_fast((phoneid), (method), (arg1), 0, 0, (res1), (res2), 0, \
-	    0, 0)
-#define ipc_call_sync_1_3(phoneid, method, arg1, res1, res2, res3) \
-	ipc_call_sync_fast((phoneid), (method), (arg1), 0, 0, (res1), (res2), \
-	    (res3), 0, 0)
-#define ipc_call_sync_1_4(phoneid, method, arg1, res1, res2, res3, res4) \
-	ipc_call_sync_fast((phoneid), (method), (arg1), 0, 0, (res1), (res2), \
-	    (res3), (res4), 0)
-#define ipc_call_sync_1_5(phoneid, method, arg1, res1, res2, res3, res4, \
-    res5) \
-	ipc_call_sync_fast((phoneid), (method), (arg1), 0, 0, (res1), (res2), \
-	    (res3), (res4), (res5))
-
-#define ipc_call_sync_2_0(phoneid, method, arg1, arg2) \
-	ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), 0, 0, 0, 0, \
-	    0, 0)
-#define ipc_call_sync_2_1(phoneid, method, arg1, arg2, res1) \
-	ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), 0, (res1), 0, 0, \
-	    0, 0)
-#define ipc_call_sync_2_2(phoneid, method, arg1, arg2, res1, res2) \
-	ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), 0, (res1), \
-	    (res2), 0, 0, 0)
-#define ipc_call_sync_2_3(phoneid, method, arg1, arg2, res1, res2, res3) \
-	ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), 0, (res1), \
-	    (res2), (res3), 0, 0)
-#define ipc_call_sync_2_4(phoneid, method, arg1, arg2, res1, res2, res3, \
-    res4) \
-	ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), 0, (res1), \
-	    (res2), (res3), (res4), 0)
-#define ipc_call_sync_2_5(phoneid, method, arg1, arg2, res1, res2, res3, \
-    res4, res5)\
-	ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), 0, (res1), \
-	    (res2), (res3), (res4), (res5))
-
-#define ipc_call_sync_3_0(phoneid, method, arg1, arg2, arg3) \
-	ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), (arg3), 0, 0, 0, \
-	    0, 0)
-#define ipc_call_sync_3_1(phoneid, method, arg1, arg2, arg3, res1) \
-	ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), (arg3), (res1), \
-	    0, 0, 0, 0)
-#define ipc_call_sync_3_2(phoneid, method, arg1, arg2, arg3, res1, res2) \
-	ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), (arg3), (res1), \
-	    (res2), 0, 0, 0)
-#define ipc_call_sync_3_3(phoneid, method, arg1, arg2, arg3, res1, res2, \
-    res3) \
-	ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), (arg3), \
-	    (res1), (res2), (res3), 0, 0)
-#define ipc_call_sync_3_4(phoneid, method, arg1, arg2, arg3, res1, res2, \
-    res3, res4) \
-	ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), (arg3), \
-	    (res1), (res2), (res3), (res4), 0)
-#define ipc_call_sync_3_5(phoneid, method, arg1, arg2, arg3, res1, res2, \
-    res3, res4, res5) \
-	ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), (arg3), \
-	    (res1), (res2), (res3), (res4), (res5))
-
-#define ipc_call_sync_4_0(phoneid, method, arg1, arg2, arg3, arg4) \
-	ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), 0, \
-	    0, 0, 0, 0, 0)
-#define ipc_call_sync_4_1(phoneid, method, arg1, arg2, arg3, arg4, res1) \
-	ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), 0, \
-	    (res1), 0, 0, 0, 0)
-#define ipc_call_sync_4_2(phoneid, method, arg1, arg2, arg3, arg4, res1, res2) \
-	ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), 0, \
-	    (res1), (res2), 0, 0, 0)
-#define ipc_call_sync_4_3(phoneid, method, arg1, arg2, arg3, arg4, res1, res2, \
-    res3) \
-	ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), \
-	    (arg4), 0, (res1), (res2), (res3), 0, 0)
-#define ipc_call_sync_4_4(phoneid, method, arg1, arg2, arg3, arg4, res1, res2, \
-    res3, res4) \
-	ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), \
-	    (arg4), 0, (res1), (res2), (res3), (res4), 0)
-#define ipc_call_sync_4_5(phoneid, method, arg1, arg2, arg3, arg4, res1, res2, \
-    res3, res4, res5) \
-	ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), \
-	    (arg4), 0, (res1), (res2), (res3), (res4), (res5))
-
-#define ipc_call_sync_5_0(phoneid, method, arg1, arg2, arg3, arg4, arg5) \
-	ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \
-	    (arg5), 0, 0, 0, 0, 0)
-#define ipc_call_sync_5_1(phoneid, method, arg1, arg2, arg3, arg4, arg5, res1) \
-	ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \
-	    (arg5), (res1), 0, 0, 0, 0)
-#define ipc_call_sync_5_2(phoneid, method, arg1, arg2, arg3, arg4, arg5, res1, \
-    res2) \
-	ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), \
-	    (arg4), (arg5), (res1), (res2), 0, 0, 0)
-#define ipc_call_sync_5_3(phoneid, method, arg1, arg2, arg3, arg4, arg5, res1, \
-    res2, res3) \
-	ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), \
-	    (arg4), (arg5), (res1), (res2), (res3), 0, 0)
-#define ipc_call_sync_5_4(phoneid, method, arg1, arg2, arg3, arg4, arg5, res1, \
-    res2, res3, res4) \
-	ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), \
-	    (arg4), (arg5), (res1), (res2), (res3), (res4), 0)
-#define ipc_call_sync_5_5(phoneid, method, arg1, arg2, arg3, arg4, arg5, res1, \
-    res2, res3, res4, res5) \
-	ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), \
-	    (arg4), (arg5), (res1), (res2), (res3), (res4), (res5))
-
-extern int ipc_call_sync_fast(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t,
-    sysarg_t *, sysarg_t *, sysarg_t *, sysarg_t *, sysarg_t *);
-
-extern int ipc_call_sync_slow(int, sysarg_t, sysarg_t, sysarg_t, sysarg_t,
-    sysarg_t, sysarg_t, sysarg_t *, sysarg_t *, sysarg_t *, sysarg_t *,
-    sysarg_t *);
 
 extern ipc_callid_t ipc_wait_cycle(ipc_call_t *, sysarg_t, unsigned int);
@@ -254,10 +118,4 @@
     sysarg_t, sysarg_t, void *, ipc_async_callback_t, bool);
 
-extern int ipc_clone_establish(int);
-extern int ipc_connect_to_me(int, sysarg_t, sysarg_t, sysarg_t, task_id_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);
 
@@ -267,24 +125,7 @@
     sysarg_t, sysarg_t, sysarg_t, unsigned int);
 
-/*
- * User-friendly wrappers for ipc_share_in_start().
- */
-
-#define ipc_share_in_start_0_0(phoneid, size, dst) \
-	ipc_share_in_start((phoneid), (size), 0, NULL, (dst))
-#define ipc_share_in_start_0_1(phoneid, size, flags, dst) \
-	ipc_share_in_start((phoneid), (size), 0, (flags), (dst))
-#define ipc_share_in_start_1_0(phoneid, size, arg, dst) \
-	ipc_share_in_start((phoneid), (size), (arg), NULL, (dst))
-#define ipc_share_in_start_1_1(phoneid, size, arg, flags, dst) \
-	ipc_share_in_start((phoneid), (size), (arg), (flags), (dst))
-
-extern int ipc_share_in_start(int, size_t, sysarg_t, unsigned int *, void **);
 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);
 extern int ipc_data_read_finalize(ipc_callid_t, const void *, size_t);
-extern int ipc_data_write_start(int, const void *, size_t);
 extern int ipc_data_write_finalize(ipc_callid_t, void *, size_t);
 
