Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/ipc/sysipc.c

    r33adc6ce r057d21a  
    531531    unative_t arg1, unative_t arg2, unative_t arg3, ipc_data_t *data)
    532532{
    533         call_t *call;
     533        call_t call;
    534534        phone_t *phone;
    535535        int res;
     
    538538        GET_CHECK_PHONE(phone, phoneid, return ENOENT);
    539539
    540         call = ipc_call_alloc(0);
    541         IPC_SET_METHOD(call->data, method);
    542         IPC_SET_ARG1(call->data, arg1);
    543         IPC_SET_ARG2(call->data, arg2);
    544         IPC_SET_ARG3(call->data, arg3);
     540        ipc_call_static_init(&call);
     541        IPC_SET_METHOD(call.data, method);
     542        IPC_SET_ARG1(call.data, arg1);
     543        IPC_SET_ARG2(call.data, arg2);
     544        IPC_SET_ARG3(call.data, arg3);
    545545        /*
    546546         * To achieve deterministic behavior, zero out arguments that are beyond
    547547         * the limits of the fast version.
    548548         */
    549         IPC_SET_ARG4(call->data, 0);
    550         IPC_SET_ARG5(call->data, 0);
    551 
    552         if (!(res = request_preprocess(call, phone))) {
     549        IPC_SET_ARG4(call.data, 0);
     550        IPC_SET_ARG5(call.data, 0);
     551
     552        if (!(res = request_preprocess(&call, phone))) {
    553553#ifdef CONFIG_UDEBUG
    554554                udebug_stoppable_begin();
    555555#endif
    556                 rc = ipc_call_sync(phone, call);
     556                rc = ipc_call_sync(phone, &call);
    557557#ifdef CONFIG_UDEBUG
    558558                udebug_stoppable_end();
    559559#endif
    560                 if (rc != EOK) {
    561                         /* The call will be freed by ipc_cleanup(). */
     560                if (rc != EOK)
    562561                        return rc;
    563                 }
    564                 process_answer(call);
     562                process_answer(&call);
    565563
    566564        } else {
    567                 IPC_SET_RETVAL(call->data, res);
    568         }
    569         rc = STRUCT_TO_USPACE(&data->args, &call->data.args);
    570         ipc_call_free(call);
     565                IPC_SET_RETVAL(call.data, res);
     566        }
     567        rc = STRUCT_TO_USPACE(&data->args, &call.data.args);
    571568        if (rc != 0)
    572569                return rc;
     
    587584    ipc_data_t *reply)
    588585{
    589         call_t *call;
     586        call_t call;
    590587        phone_t *phone;
    591588        int res;
    592589        int rc;
    593590
     591        ipc_call_static_init(&call);
     592        rc = copy_from_uspace(&call.data.args, &question->args,
     593            sizeof(call.data.args));
     594        if (rc != 0)
     595                return (unative_t) rc;
     596
    594597        GET_CHECK_PHONE(phone, phoneid, return ENOENT);
    595598
    596         call = ipc_call_alloc(0);
    597         rc = copy_from_uspace(&call->data.args, &question->args,
    598             sizeof(call->data.args));
    599         if (rc != 0) {
    600                 ipc_call_free(call);
    601                 return (unative_t) rc;
    602         }
    603 
    604 
    605         if (!(res = request_preprocess(call, phone))) {
     599        if (!(res = request_preprocess(&call, phone))) {
    606600#ifdef CONFIG_UDEBUG
    607601                udebug_stoppable_begin();
    608602#endif
    609                 rc = ipc_call_sync(phone, call);
     603                rc = ipc_call_sync(phone, &call);
    610604#ifdef CONFIG_UDEBUG
    611605                udebug_stoppable_end();
    612606#endif
    613                 if (rc != EOK) {
    614                         /* The call will be freed by ipc_cleanup(). */
     607                if (rc != EOK)
    615608                        return rc;
    616                 }
    617                 process_answer(call);
     609                process_answer(&call);
    618610        } else
    619                 IPC_SET_RETVAL(call->data, res);
    620 
    621         rc = STRUCT_TO_USPACE(&reply->args, &call->data.args);
    622         ipc_call_free(call);
     611                IPC_SET_RETVAL(call.data, res);
     612
     613        rc = STRUCT_TO_USPACE(&reply->args, &call.data.args);
    623614        if (rc != 0)
    624615                return rc;
     
    1000991
    1001992        if (call->flags & IPC_CALL_NOTIF) {
     993                ASSERT(! (call->flags & IPC_CALL_STATIC_ALLOC));
     994
    1002995                /* Set in_phone_hash to the interrupt counter */
    1003996                call->data.phone = (void *) call->priv;
     
    10121005        if (call->flags & IPC_CALL_ANSWERED) {
    10131006                process_answer(call);
     1007
     1008                ASSERT(! (call->flags & IPC_CALL_STATIC_ALLOC));
    10141009
    10151010                if (call->flags & IPC_CALL_DISCARD_ANSWER) {
Note: See TracChangeset for help on using the changeset viewer.