/trunk/kernel/generic/include/ipc/ipc.h |
---|
260,6 → 260,12 |
typedef struct { |
unative_t args[IPC_CALL_LEN]; |
phone_t *phone; |
/* |
* The forward operation can masquerade the caller phone. For those |
* cases, we must keep it aside so that the answer is processed |
* correctly. |
*/ |
phone_t *caller_phone; |
} ipc_data_t; |
typedef struct { |
/trunk/kernel/generic/src/main/kinit.c |
---|
177,7 → 177,6 |
*/ |
cap_set(programs[i].task, CAP_CAP | CAP_MEM_MANAGER | |
CAP_IO_MANAGER | CAP_PREEMPT_CONTROL | CAP_IRQ_REG); |
if (!ipc_phone_0) |
ipc_phone_0 = &programs[i].task->answerbox; |
/trunk/kernel/generic/src/ipc/ipcrsc.c |
---|
170,7 → 170,6 |
int i; |
spinlock_lock(&TASK->lock); |
for (i = 0; i < IPC_MAX_PHONES; i++) { |
if (TASK->phones[i].state == IPC_PHONE_HUNGUP && |
atomic_get(&TASK->phones[i].active_calls) == 0) |
183,8 → 182,9 |
} |
spinlock_unlock(&TASK->lock); |
if (i >= IPC_MAX_PHONES) |
if (i == IPC_MAX_PHONES) |
return -1; |
return i; |
} |
/trunk/kernel/generic/src/ipc/ipc.c |
---|
347,8 → 347,11 |
list_remove(&call->link); |
spinlock_unlock(&oldbox->lock); |
if (mode & IPC_FF_ROUTE_FROM_ME) |
if (mode & IPC_FF_ROUTE_FROM_ME) { |
if (!call->data.caller_phone) |
call->data.caller_phone = call->data.phone; |
call->data.phone = newphone; |
} |
return ipc_call(newphone, call); |
} |
392,7 → 395,10 |
/* Handle asynchronous answers */ |
request = list_get_instance(box->answers.next, call_t, link); |
list_remove(&request->link); |
atomic_dec(&request->data.phone->active_calls); |
if (request->data.caller_phone) |
atomic_dec(&request->data.caller_phone->active_calls); |
else |
atomic_dec(&request->data.phone->active_calls); |
} else if (!list_empty(&box->calls)) { |
/* Handle requests */ |
request = list_get_instance(box->calls.next, call_t, link); |