Changeset acf6b55 in mainline for kernel/generic/src/ipc/ipc.c
- Timestamp:
- 2018-07-05T16:20:43Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 058c240
- Parents:
- bd9e868
- git-author:
- Jiří Zárevúcky <jiri.zarevucky@…> (2018-07-04 23:32:32)
- git-committer:
- Jiří Zárevúcky <jiri.zarevucky@…> (2018-07-05 16:20:43)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/ipc/ipc.c
rbd9e868 racf6b55 230 230 } 231 231 232 call_t *answer = ipc_wait_for_call(mybox, SYNCH_NO_TIMEOUT, 233 SYNCH_FLAGS_INTERRUPTIBLE); 232 call_t *answer = NULL; 233 (void) ipc_wait_for_call(mybox, SYNCH_NO_TIMEOUT, 234 SYNCH_FLAGS_INTERRUPTIBLE, &answer); 234 235 if (!answer) { 235 236 … … 267 268 * now. 268 269 */ 269 answer =ipc_wait_for_call(mybox, SYNCH_NO_TIMEOUT,270 SYNCH_FLAGS_NONE );270 (void) ipc_wait_for_call(mybox, SYNCH_NO_TIMEOUT, 271 SYNCH_FLAGS_NONE, &answer); 271 272 } 272 273 } … … 536 537 * waitq_sleep_timeout() for description of its special 537 538 * meaning. 538 * 539 * @return Recived call structure or NULL. 539 * @param call Received call structure or NULL. 540 * 541 * @return Error code from waitq_sleep_timeout. 542 * ENOENT if sleep returns successfully, but there is no call. 540 543 * 541 544 * To distinguish between a call and an answer, have a look at call->flags. 542 545 * 543 546 */ 544 call_t *ipc_wait_for_call(answerbox_t *box, uint32_t usec, unsigned int flags) 547 errno_t ipc_wait_for_call(answerbox_t *box, uint32_t usec, unsigned int flags, 548 call_t **call) 545 549 { 546 550 call_t *request; … … 552 556 rc = waitq_sleep_timeout(&box->wq, usec, flags, NULL); 553 557 if (rc != EOK) 554 return NULL;558 return rc; 555 559 556 560 irq_spinlock_lock(&box->lock, true); … … 594 598 */ 595 599 irq_spinlock_unlock(&box->lock, true); 596 return NULL;600 return ENOENT; 597 601 } 598 602 … … 605 609 irq_spinlock_unlock(&TASK->lock, true); 606 610 607 return request; 611 *call = request; 612 return EOK; 608 613 } 609 614 … … 779 784 { 780 785 while (atomic_get(&TASK->answerbox.active_calls) != 0) { 781 call_t *call = ipc_wait_for_call(&TASK->answerbox, 782 SYNCH_NO_TIMEOUT, SYNCH_FLAGS_NONE); 786 call_t *call = NULL; 787 if (ipc_wait_for_call(&TASK->answerbox, 788 SYNCH_NO_TIMEOUT, SYNCH_FLAGS_NONE, &call) == ENOENT) 789 continue; 790 assert(call); 783 791 assert(call->flags & (IPC_CALL_ANSWERED | IPC_CALL_NOTIF)); 784 792
Note:
See TracChangeset
for help on using the changeset viewer.