Changeset 5a77550 in mainline for kernel/generic/src/ipc/ipc.c


Ignore:
Timestamp:
2012-08-28T23:13:18Z (13 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9c9903a
Parents:
f39d5c2
Message:

Always remember the original caller phone in a call.

File:
1 edited

Legend:

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

    rf39d5c2 r5a77550  
    165165}
    166166
    167 /** Demasquerade the caller phone. */
    168 static void ipc_caller_phone_demasquerade(call_t *call)
    169 {
    170         if (call->flags & IPC_CALL_FORWARDED) {
    171                 if (call->caller_phone) {
    172                         call->data.phone = call->caller_phone;
    173                 }
    174         }
    175 }
    176 
    177167/** Answer a message which was not dispatched and is not listed in any queue.
    178168 *
     
    213203        call->flags |= IPC_CALL_ANSWERED;
    214204       
    215         ipc_caller_phone_demasquerade(call);
    216 
    217205        call->data.task_id = TASK->taskid;
    218206       
     
    257245void ipc_backsend_err(phone_t *phone, call_t *call, sysarg_t err)
    258246{
     247        call->caller_phone = phone;
    259248        call->data.phone = phone;
    260249        atomic_inc(&phone->active_calls);
     
    285274                atomic_inc(&phone->active_calls);
    286275
     276                call->caller_phone = phone;
    287277                call->active = true;
    288278
     
    401391       
    402392        if (mode & IPC_FF_ROUTE_FROM_ME) {
    403                 if (!call->caller_phone)
    404                         call->caller_phone = call->data.phone;
    405393                call->data.phone = newphone;
    406394                call->data.task_id = TASK->taskid;
     
    459447                    call_t, ab_link);
    460448                list_remove(&request->ab_link);
    461                 atomic_dec(&request->data.phone->active_calls);
     449                atomic_dec(&request->caller_phone->active_calls);
    462450        } else if (!list_empty(&box->calls)) {
    463451                /* Count received call */
     
    605593        list_remove(&call->ta_link);
    606594
    607         ipc_caller_phone_demasquerade(call);
    608         atomic_dec(&call->data.phone->active_calls);
    609 
    610595        spinlock_unlock(&call->forget_lock);
    611596        spinlock_unlock(&TASK->active_calls_lock);
     597
     598        atomic_dec(&call->caller_phone->active_calls);
    612599
    613600        sysipc_ops_t *ops = sysipc_ops_get(call->request_method);
Note: See TracChangeset for help on using the changeset viewer.