Ignore:
File:
1 edited

Legend:

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

    r466e95f7 re9fe33b  
    255255}
    256256
    257 static void _ipc_call_actions_internal(phone_t *phone, call_t *call)
     257/** Simulate sending back a message.
     258 *
     259 * Most errors are better handled by forming a normal backward
     260 * message and sending it as a normal answer.
     261 *
     262 * @param phone Phone structure the call should appear to come from.
     263 * @param call  Call structure to be answered.
     264 * @param err   Return value to be used for the answer.
     265 *
     266 */
     267void ipc_backsend_err(phone_t *phone, call_t *call, sysarg_t err)
    258268{
    259269        task_t *caller = phone->caller;
     
    269279
    270280        call->data.phone = phone;
    271         call->data.task_id = caller->taskid;
    272 }
    273 
    274 /** Simulate sending back a message.
    275  *
    276  * Most errors are better handled by forming a normal backward
    277  * message and sending it as a normal answer.
    278  *
    279  * @param phone Phone structure the call should appear to come from.
    280  * @param call  Call structure to be answered.
    281  * @param err   Return value to be used for the answer.
    282  *
    283  */
    284 void ipc_backsend_err(phone_t *phone, call_t *call, sysarg_t err)
    285 {
    286         _ipc_call_actions_internal(phone, call);
     281
    287282        IPC_SET_RETVAL(call->data, err);
    288283        _ipc_answer_free_call(call, false);
     
    305300        irq_spinlock_unlock(&caller->lock, true);
    306301       
    307         if (!(call->flags & IPC_CALL_FORWARDED))
    308                 _ipc_call_actions_internal(phone, call);
     302        if (!(call->flags & IPC_CALL_FORWARDED)) {
     303                atomic_inc(&phone->active_calls);
     304                call->caller_phone = phone;
     305                call->sender = caller;
     306
     307                call->active = true;
     308                spinlock_lock(&caller->active_calls_lock);
     309                list_append(&call->ta_link, &caller->active_calls);
     310                spinlock_unlock(&caller->active_calls_lock);
     311
     312                call->data.phone = phone;
     313                call->data.task_id = caller->taskid;
     314        }
    309315       
    310316        irq_spinlock_lock(&box->lock, true);
     
    512518
    513519                irq_spinlock_unlock(&box->lock, true);
    514 
    515                 if (lst == &box->calls)
    516                         SYSIPC_OP(request_process, call, box);
    517520
    518521                ipc_data_t old = call->data;
     
    640643        atomic_dec(&call->caller_phone->active_calls);
    641644
    642         SYSIPC_OP(request_forget, call);
     645        sysipc_ops_t *ops = sysipc_ops_get(call->request_method);
     646        if (ops->request_forget)
     647                ops->request_forget(call);
    643648
    644649        ipc_call_release(call);
     
    708713            SYNCH_FLAGS_NONE);
    709714        ASSERT(call->flags & (IPC_CALL_ANSWERED | IPC_CALL_NOTIF));
    710 
    711         SYSIPC_OP(answer_process, call);
    712 
    713715        ipc_call_free(call);
    714716        goto restart;
     
    752754       
    753755        /* Answer all messages in 'calls' and 'dispatched_calls' queues */
    754         ipc_cleanup_call_list(&TASK->answerbox, &TASK->answerbox.calls);
    755756        ipc_cleanup_call_list(&TASK->answerbox,
    756757            &TASK->answerbox.dispatched_calls);
     758        ipc_cleanup_call_list(&TASK->answerbox, &TASK->answerbox.calls);
    757759
    758760        ipc_forget_all_active_calls();
Note: See TracChangeset for help on using the changeset viewer.