Changeset b74959bd in mainline for uspace/lib/libc/include/ipc/ipc.h


Ignore:
Timestamp:
2007-11-20T21:33:32Z (17 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8498915
Parents:
3209923
Message:

Modify ipc_answer_*() to make use of all six syscall arguments. The recommended
means of answering calls is via the ipc_answer_m() macros (where m denotes the
number of return arguments) that automatically decide between the fast register
version or the slow universal version of ipc_answer().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/libc/include/ipc/ipc.h

    r3209923 rb74959bd  
    191191extern ipc_callid_t ipc_trywait_for_call(ipc_call_t *data);
    192192
    193 #define ipc_answer_fast_0(callid, retval) \
    194     ipc_answer_fast((callid), (retval), 0, 0)
    195 #define ipc_answer_fast_1(callid, retval, arg1) \
    196     ipc_answer_fast((callid), (retval), (arg1), 0)
     193/*
     194 * User-friendly wrappers for ipc_answer_fast() and ipc_answer_slow().
     195 * They are in the form of ipc_answer_m(), where m is the number of return
     196 * arguments. The macros decide between the fast and the slow version according
     197 * to m.
     198 */
     199#define ipc_answer_0(callid, retval) \
     200    ipc_answer_fast((callid), (retval), 0, 0, 0, 0)
     201#define ipc_answer_1(callid, retval, arg1) \
     202    ipc_answer_fast((callid), (retval), (arg1), 0, 0, 0)
     203#define ipc_answer_2(callid, retval, arg1, arg2) \
     204    ipc_answer_fast((callid), (retval), (arg1), (arg2), 0, 0)
     205#define ipc_answer_3(callid, retval, arg1, arg2, arg3) \
     206    ipc_answer_fast((callid), (retval), (arg1), (arg2), (arg3), 0)
     207#define ipc_answer_4(callid, retval, arg1, arg2, arg3, arg4) \
     208    ipc_answer_fast((callid), (retval), (arg1), (arg2), (arg3), (arg4))
     209#define ipc_answer_5(callid, retval, arg1, arg2, arg3, arg4, arg5) \
     210    ipc_answer_slow((callid), (retval), (arg1), (arg2), (arg3), (arg4), (arg5))
     211
    197212extern ipcarg_t ipc_answer_fast(ipc_callid_t callid, ipcarg_t retval,
    198     ipcarg_t arg1, ipcarg_t arg2);
    199 extern ipcarg_t ipc_answer(ipc_callid_t callid, ipc_call_t *call);
     213    ipcarg_t arg1, ipcarg_t arg2, ipcarg_t arg3, ipcarg_t arg4);
     214extern ipcarg_t ipc_answer_slow(ipc_callid_t callid, ipcarg_t retval,
     215    ipcarg_t arg1, ipcarg_t arg2, ipcarg_t arg3, ipcarg_t arg4, ipcarg_t arg5);
    200216
    201217/*
     
    245261    ipcarg_t arg1);
    246262extern int ipc_data_send(int phoneid, void *src, size_t size);
    247 extern int ipc_data_receive(ipc_callid_t *callid, ipc_call_t *call, void **dst,
    248     size_t *size);
    249 extern ipcarg_t ipc_data_deliver(ipc_callid_t callid, ipc_call_t *call,
    250     void *dst, size_t size);
     263extern int ipc_data_receive(ipc_callid_t *callid, void **dst, size_t *size);
     264extern ipcarg_t ipc_data_deliver(ipc_callid_t callid, void *dst, size_t size);
    251265
    252266#endif
Note: See TracChangeset for help on using the changeset viewer.