Changeset 4c61e60 in mainline for libipc/generic/ipc.c


Ignore:
Timestamp:
2006-03-19T19:42:38Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
06b0d112
Parents:
7048773
Message:

Adapt userspace API to conform to kernel api.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libipc/generic/ipc.c

    r7048773 r4c61e60  
    4747                ipc_callid_t callid;
    4848                struct {
     49                        ipc_call_t data;
    4950                        int phoneid;
    50                         ipc_data_t data;
    5151                } msg;
    5252        }u;
     
    5959                  ipcarg_t *result)
    6060{
    61         ipc_data_t resdata;
     61        ipc_call_t resdata;
    6262        int callres;
    6363       
     
    7575                    ipcarg_t *result1, ipcarg_t *result2, ipcarg_t *result3)
    7676{
    77         ipc_data_t data;
     77        ipc_call_t data;
    7878        int callres;
    7979
     
    9898
    9999/** Syscall to send asynchronous message */
    100 static  ipc_callid_t _ipc_call_async(int phoneid, ipc_data_t *data)
     100static  ipc_callid_t _ipc_call_async(int phoneid, ipc_call_t *data)
    101101{
    102102        return __SYSCALL2(SYS_IPC_CALL_ASYNC, phoneid, (sysarg_t)data);
     
    153153{
    154154        __SYSCALL4(SYS_IPC_ANSWER_FAST, callid, retval, arg1, arg2);
    155 }
    156 
    157 
    158 /** Call syscall function sys_ipc_wait_for_call */
    159 static inline ipc_callid_t _ipc_wait_for_call(ipc_call_t *call, int flags)
    160 {
    161         return __SYSCALL3(SYS_IPC_WAIT, (sysarg_t)&call->data,
    162                           (sysarg_t)&call->taskid, flags);
    163155}
    164156
     
    194186 * @param callid Callid (with first bit set) of the answered call
    195187 */
    196 static void handle_answer(ipc_callid_t callid, ipc_data_t *data)
     188static void handle_answer(ipc_callid_t callid, ipc_call_t *data)
    197189{
    198190        link_t *item;
     
    230222                try_dispatch_queued_calls();
    231223
    232                 callid = _ipc_wait_for_call(call, flags);
     224                callid = __SYSCALL2(SYS_IPC_WAIT, (sysarg_t)call, flags);
    233225                /* Handle received answers */
    234226                if (callid & IPC_CALLID_ANSWERED)
    235                         handle_answer(callid, &call->data);
     227                        handle_answer(callid, call);
    236228        } while (callid & IPC_CALLID_ANSWERED);
    237229
     
    239231}
    240232
    241 /** Ask destination to do a callback connection */
    242 int ipc_connect_to_me(int phoneid, int arg1, int arg2,
    243                       unsigned long long *taskid)
    244 {
    245         return __SYSCALL4(SYS_IPC_CONNECT_TO_ME, phoneid, arg1, arg2,
    246                           (sysarg_t) taskid);
    247 }
    248 
    249 /** Ask through phone for a new connection to some service */
     233/** Ask destination to do a callback connection
     234 *
     235 * @return 0 - OK, error code
     236 */
     237int ipc_connect_to_me(int phoneid, int arg1, int arg2, ipcarg_t *phone)
     238{
     239        return ipc_call_sync_3(phoneid, IPC_M_CONNECT_TO_ME, arg1,
     240                               arg2, 0, 0, 0, phone);
     241}
     242
     243/** Ask through phone for a new connection to some service
     244 *
     245 * @return new phoneid - OK, error code
     246 */
    250247int ipc_connect_me_to(int phoneid, int arg1, int arg2)
    251248{
    252         return __SYSCALL3(SYS_IPC_CONNECT_ME_TO, phoneid, arg1, arg2);
     249        int newphid;
     250        int res;
     251
     252        res =  ipc_call_sync_3(phoneid, IPC_M_CONNECT_ME_TO, arg1,
     253                               arg2, 0, 0, 0, &newphid);
     254        if (res)
     255                return res;
     256        return newphid;
    253257}
    254258
Note: See TracChangeset for help on using the changeset viewer.