Changeset 3209923 in mainline for uspace/lib/libc/generic/ipc.c


Ignore:
Timestamp:
2007-11-20T09:12:49Z (18 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b74959bd
Parents:
bc50fc42
Message:

Modify asynchronous IPC to make use of all six syscall arguments. The preferred
means of asynchronous communication is now via the set of ipc_call_async_m()
macros, where m is the number of payload arguments passed to the kernel. These
macros will automatically decide between the fast and the universal slow version
of ipc_call_async.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/libc/generic/ipc.c

    rbc50fc42 r3209923  
    190190static ipc_callid_t _ipc_call_async(int phoneid, ipc_call_t *data)
    191191{
    192         return __SYSCALL2(SYS_IPC_CALL_ASYNC, phoneid, (sysarg_t) data);
     192        return __SYSCALL2(SYS_IPC_CALL_ASYNC_SLOW, phoneid, (sysarg_t) data);
    193193}
    194194
     
    269269/** Make a fast asynchronous call.
    270270 *
    271  * This function can only handle two arguments of payload. It is, however,
    272  * faster than the more generic ipc_call_async_3().
     271 * This function can only handle four arguments of payload. It is, however,
     272 * faster than the more generic ipc_call_async_slow().
    273273 *
    274274 * Note that this function is a void function.
     
    281281 * @param arg1          Service-defined payload argument.
    282282 * @param arg2          Service-defined payload argument.
     283 * @param arg3          Service-defined payload argument.
     284 * @param arg4          Service-defined payload argument.
    283285 * @param private       Argument to be passed to the answer/error callback.
    284286 * @param callback      Answer or error callback.
     
    287289 *                      asynchronous calls.
    288290 */
    289 void ipc_call_async_2(int phoneid, ipcarg_t method, ipcarg_t arg1,
    290     ipcarg_t arg2, void *private, ipc_async_callback_t callback,
    291     int can_preempt)
     291void ipc_call_async_fast(int phoneid, ipcarg_t method, ipcarg_t arg1,
     292    ipcarg_t arg2, ipcarg_t arg3, ipcarg_t arg4, void *private,
     293    ipc_async_callback_t callback, int can_preempt)
    292294{
    293295        async_call_t *call = NULL;
     
    305307         */
    306308        futex_down(&ipc_futex);
    307         callid = __SYSCALL4(SYS_IPC_CALL_ASYNC_FAST, phoneid, method, arg1,
    308             arg2);
     309        callid = __SYSCALL6(SYS_IPC_CALL_ASYNC_FAST, phoneid, method, arg1,
     310            arg2, arg3, arg4);
    309311
    310312        if (callid == IPC_CALLRET_TEMPORARY) {
     
    317319                IPC_SET_ARG1(call->u.msg.data, arg1);
    318320                IPC_SET_ARG2(call->u.msg.data, arg2);
     321                IPC_SET_ARG3(call->u.msg.data, arg3);
     322                IPC_SET_ARG4(call->u.msg.data, arg4);
    319323        }
    320324        ipc_finish_async(callid, phoneid, call, can_preempt);
     
    333337 * @param arg2          Service-defined payload argument.
    334338 * @param arg3          Service-defined payload argument.
     339 * @param arg4          Service-defined payload argument.
     340 * @param arg5          Service-defined payload argument.
    335341 * @param private       Argument to be passed to the answer/error callback.
    336342 * @param callback      Answer or error callback.
     
    340346 *
    341347 */
    342 void ipc_call_async_3(int phoneid, ipcarg_t method, ipcarg_t arg1,
    343     ipcarg_t arg2, ipcarg_t arg3, void *private, ipc_async_callback_t callback,
    344     int can_preempt)
     348void ipc_call_async_slow(int phoneid, ipcarg_t method, ipcarg_t arg1,
     349    ipcarg_t arg2, ipcarg_t arg3, ipcarg_t arg4, ipcarg_t arg5, void *private,
     350    ipc_async_callback_t callback, int can_preempt)
    345351{
    346352        async_call_t *call;
     
    355361        IPC_SET_ARG2(call->u.msg.data, arg2);
    356362        IPC_SET_ARG3(call->u.msg.data, arg3);
     363        IPC_SET_ARG4(call->u.msg.data, arg4);
     364        IPC_SET_ARG5(call->u.msg.data, arg5);
    357365        /*
    358          * We need to make sure that we get callid before another thread accesses
    359          * the queue again.
     366         * We need to make sure that we get callid before another thread
     367         * accesses the queue again.
    360368         */
    361369        futex_down(&ipc_futex);
Note: See TracChangeset for help on using the changeset viewer.