Changeset 631ca4d in mainline for generic/src/syscall/syscall.c


Ignore:
Timestamp:
2006-03-13T20:51:35Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5c089c3a
Parents:
25d7709
Message:

New synchronous ipc.
Widened syscall to support up to 5 parameters.

File:
1 edited

Legend:

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

    r25d7709 r631ca4d  
    5656}
    5757
    58 /** Send a call over syscall
     58/** Send a call over IPC, wait for reply, return to user
    5959 *
    6060 * @return Call identification, returns -1 on fatal error,
    6161           -2 on 'Too many async request, handle answers first
    6262 */
    63 static __native sys_ipc_call(__native phoneid, __native arg1, __native arg2)
     63static __native sys_ipc_call_sync(__native phoneid, __native arg1,
     64                                   __native arg2, __native *respdata)
     65{
     66        call_t *call;
     67        phone_t *phone;
     68        /* Special answerbox for synchronous messages */
     69
     70        if (phoneid >= IPC_MAX_PHONES)
     71                return -ENOENT;
     72
     73        phone = &TASK->phones[phoneid];
     74        if (!phone->callee)
     75                return -ENOENT;
     76
     77        call = ipc_call_alloc();
     78        call->data[0] = arg1;
     79        call->data[1] = arg2;
     80       
     81        ipc_call_sync(phone, call);
     82
     83        copy_to_uspace(respdata, &call->data, sizeof(__native) * IPC_CALL_LEN);
     84
     85        return 0;
     86}
     87
     88/** Send an asynchronous call over ipc
     89 *
     90 * @return Call identification, returns -1 on fatal error,
     91           -2 on 'Too many async request, handle answers first
     92 */
     93static __native sys_ipc_call_async(__native phoneid, __native arg1,
     94                                   __native arg2)
    6495{
    6596        call_t *call;
     
    125156        sys_ctl,
    126157        sys_io,
    127         sys_ipc_call,
     158        sys_ipc_call_sync,
     159        sys_ipc_call_async,
    128160        sys_ipc_answer,
    129161        sys_ipc_wait_for_call
Note: See TracChangeset for help on using the changeset viewer.