Changeset 286e03d in mainline for generic/src/syscall/syscall.c


Ignore:
Timestamp:
2006-03-15T11:44:26Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8965838e
Parents:
91d5ad6
Message:

Added support for taskid.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • generic/src/syscall/syscall.c

    r91d5ad6 r286e03d  
    9898
    9999/** Synchronous IPC call allowing to send whole message */
    100 static __native sys_ipc_call_sync(__native phoneid, __native *data)
     100static __native sys_ipc_call_sync(__native phoneid, __native *question,
     101                                  __native *reply)
    101102{
    102103        call_t call;
     
    109110
    110111        ipc_call_init(&call);
    111         copy_from_uspace(&call.data, data, sizeof(call.data));
     112        copy_from_uspace(&call.data, question, sizeof(call.data));
    112113       
    113114        ipc_call_sync(phone, &call);
    114115
    115         copy_to_uspace(data, &call.data, sizeof(call.data));
     116        copy_to_uspace(reply, &call.data, sizeof(call.data));
    116117
    117118        return 0;
     
    185186
    186187/** Send IPC answer */
    187 static __native sys_ipc_answer(__native callid, __native retval, __native arg1,
    188                               __native arg2)
     188static __native sys_ipc_answer_fast(__native callid, __native retval,
     189                                    __native arg1, __native arg2)
    189190{
    190191        call_t *call;
     
    203204}
    204205
     206/** Send IPC answer */
     207static __native sys_ipc_answer(__native callid, __native *data)
     208{
     209        call_t *call;
     210
     211        /* Check that the user is not sending us answer callid */
     212        ASSERT(! (callid & 1));
     213        /* TODO: Check that the callid is in the dispatch table */
     214        call = (call_t *) callid;
     215        copy_from_uspace(&call->data, data, sizeof(call->data));
     216        ipc_answer(&TASK->answerbox, call);
     217
     218        return 0;
     219}
     220
    205221/** Wait for incoming ipc call or answer
    206222 *
     
    209225 * @return Callid, if callid & 1, then the call is answer
    210226 */
    211 static __native sys_ipc_wait_for_call(__native *calldata, __native flags)
     227static __native sys_ipc_wait_for_call(__native *calldata, task_id_t *taskid,
     228                                      __native flags)
    212229{
    213230        call_t *call;
     
    223240                return ((__native)call) | IPC_CALLID_ANSWERED;
    224241        }
     242        copy_to_uspace(taskid, (void *)&TASK->taskid, sizeof(TASK->taskid));
    225243        return (__native)call;
    226244}
     
    239257        sys_ipc_call_async_fast,
    240258        sys_ipc_call_async,
     259        sys_ipc_answer_fast,
    241260        sys_ipc_answer,
    242261        sys_ipc_wait_for_call
Note: See TracChangeset for help on using the changeset viewer.