Changeset 6f9c8f6 in mainline


Ignore:
Timestamp:
2012-09-26T16:56:30Z (12 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6b83300
Parents:
f3b97d1
Message:

Code deduplication.

File:
1 edited

Legend:

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

    rf3b97d1 r6f9c8f6  
    255255}
    256256
    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  */
    267 void ipc_backsend_err(phone_t *phone, call_t *call, sysarg_t err)
     257static void _ipc_call_actions_internal(phone_t *phone, call_t *call)
    268258{
    269259        task_t *caller = phone->caller;
     
    279269
    280270        call->data.phone = phone;
    281 
     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 */
     284void ipc_backsend_err(phone_t *phone, call_t *call, sysarg_t err)
     285{
     286        _ipc_call_actions_internal(phone, call);
    282287        IPC_SET_RETVAL(call->data, err);
    283288        _ipc_answer_free_call(call, false);
     
    300305        irq_spinlock_unlock(&caller->lock, true);
    301306       
    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         }
     307        if (!(call->flags & IPC_CALL_FORWARDED))
     308                _ipc_call_actions_internal(phone, call);
    315309       
    316310        irq_spinlock_lock(&box->lock, true);
Note: See TracChangeset for help on using the changeset viewer.