Changeset 645d9ed in mainline


Ignore:
Timestamp:
2008-08-24T18:19:21Z (16 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
74965d2
Parents:
088ab05
Message:

Fix processing of answers to forwarded masqueraded calls.

Location:
kernel/generic
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/ipc/ipc.h

    r088ab05 r645d9ed  
    261261        unative_t args[IPC_CALL_LEN];
    262262        phone_t *phone;
     263        /*
     264         * The forward operation can masquerade the caller phone. For those
     265         * cases, we must keep it aside so that the answer is processed
     266         * correctly.
     267         */
     268        phone_t *caller_phone;
    263269} ipc_data_t;
    264270
  • kernel/generic/src/ipc/ipc.c

    r088ab05 r645d9ed  
    348348        spinlock_unlock(&oldbox->lock);
    349349
    350         if (mode & IPC_FF_ROUTE_FROM_ME)
     350        if (mode & IPC_FF_ROUTE_FROM_ME) {
     351                if (!call->data.caller_phone)
     352                        call->data.caller_phone = call->data.phone;
    351353                call->data.phone = newphone;
     354        }
    352355
    353356        return ipc_call(newphone, call);
     
    393396                request = list_get_instance(box->answers.next, call_t, link);
    394397                list_remove(&request->link);
    395                 atomic_dec(&request->data.phone->active_calls);
     398                if (request->data.caller_phone)
     399                        atomic_dec(&request->data.caller_phone->active_calls);
     400                else
     401                        atomic_dec(&request->data.phone->active_calls);
    396402        } else if (!list_empty(&box->calls)) {
    397403                /* Handle requests */
  • kernel/generic/src/ipc/ipcrsc.c

    r088ab05 r645d9ed  
    171171
    172172        spinlock_lock(&TASK->lock);
    173        
    174173        for (i = 0; i < IPC_MAX_PHONES; i++) {
    175174                if (TASK->phones[i].state == IPC_PHONE_HUNGUP &&
     
    184183        spinlock_unlock(&TASK->lock);
    185184
    186         if (i >= IPC_MAX_PHONES)
     185        if (i == IPC_MAX_PHONES)
    187186                return -1;
     187
    188188        return i;
    189189}
  • kernel/generic/src/main/kinit.c

    r088ab05 r645d9ed  
    178178                        cap_set(programs[i].task, CAP_CAP | CAP_MEM_MANAGER |
    179179                            CAP_IO_MANAGER | CAP_PREEMPT_CONTROL | CAP_IRQ_REG);
    180 
    181180                       
    182181                        if (!ipc_phone_0)
Note: See TracChangeset for help on using the changeset viewer.