Changeset 5c90e3e in mainline for kernel/generic/src/ipc/ipc.c
- Timestamp:
- 2012-10-18T22:38:27Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 508fff8
- Parents:
- b801f2d (diff), 7d248e3 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/ipc/ipc.c
rb801f2d r5c90e3e 255 255 } 256 256 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) 257 static void _ipc_call_actions_internal(phone_t *phone, call_t *call) 268 258 { 269 259 task_t *caller = phone->caller; … … 279 269 280 270 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 */ 284 void ipc_backsend_err(phone_t *phone, call_t *call, sysarg_t err) 285 { 286 _ipc_call_actions_internal(phone, call); 282 287 IPC_SET_RETVAL(call->data, err); 283 288 _ipc_answer_free_call(call, false); … … 300 305 irq_spinlock_unlock(&caller->lock, true); 301 306 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); 315 309 316 310 irq_spinlock_lock(&box->lock, true); … … 518 512 519 513 irq_spinlock_unlock(&box->lock, true); 514 515 if (lst == &box->calls) 516 SYSIPC_OP(request_process, call, box); 520 517 521 518 ipc_data_t old = call->data; … … 643 640 atomic_dec(&call->caller_phone->active_calls); 644 641 645 sysipc_ops_t *ops = sysipc_ops_get(call->request_method); 646 if (ops->request_forget) 647 ops->request_forget(call); 642 SYSIPC_OP(request_forget, call); 648 643 649 644 ipc_call_release(call); … … 713 708 SYNCH_FLAGS_NONE); 714 709 ASSERT(call->flags & (IPC_CALL_ANSWERED | IPC_CALL_NOTIF)); 710 711 SYSIPC_OP(answer_process, call); 712 715 713 ipc_call_free(call); 716 714 goto restart; … … 754 752 755 753 /* Answer all messages in 'calls' and 'dispatched_calls' queues */ 754 ipc_cleanup_call_list(&TASK->answerbox, &TASK->answerbox.calls); 756 755 ipc_cleanup_call_list(&TASK->answerbox, 757 756 &TASK->answerbox.dispatched_calls); 758 ipc_cleanup_call_list(&TASK->answerbox, &TASK->answerbox.calls);759 757 760 758 ipc_forget_all_active_calls();
Note:
See TracChangeset
for help on using the changeset viewer.