Changeset af6bd113 in mainline
- Timestamp:
- 2018-03-11T07:35:05Z (7 years ago)
- Children:
- 03d5697
- Parents:
- bbf38ad
- git-author:
- Jakub Jermar <jakub@…> (2018-03-10 19:59:41)
- git-committer:
- Jakub Jermar <jakub@…> (2018-03-11 07:35:05)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/ipc/ipc.c
rbbf38ad raf6bd113 753 753 } 754 754 755 /** Wait for all answers to asynchronous calls to arrive. */756 static void ipc_wait_for_all_answered_calls(void)757 {758 while (atomic_get(&TASK->answerbox.active_calls) != 0) {759 call_t *call = ipc_wait_for_call(&TASK->answerbox,760 SYNCH_NO_TIMEOUT, SYNCH_FLAGS_NONE);761 assert(call->flags & (IPC_CALL_ANSWERED | IPC_CALL_NOTIF));762 763 SYSIPC_OP(answer_process, call);764 765 kobject_put(call->kobject);766 }767 }768 769 755 static bool phone_cap_cleanup_cb(cap_t *cap, void *arg) 770 756 { … … 775 761 cap_free(cap->task, cap->handle); 776 762 return true; 763 } 764 765 /** Wait for all answers to asynchronous calls to arrive. */ 766 static void ipc_wait_for_all_answered_calls(void) 767 { 768 while (atomic_get(&TASK->answerbox.active_calls) != 0) { 769 call_t *call = ipc_wait_for_call(&TASK->answerbox, 770 SYNCH_NO_TIMEOUT, SYNCH_FLAGS_NONE); 771 assert(call->flags & (IPC_CALL_ANSWERED | IPC_CALL_NOTIF)); 772 773 SYSIPC_OP(answer_process, call); 774 775 kobject_put(call->kobject); 776 777 /* 778 * Now there may be some new phones and new hangup calls to 779 * immediately forget. 780 */ 781 caps_apply_to_kobject_type(TASK, KOBJECT_TYPE_PHONE, 782 phone_cap_cleanup_cb, NULL); 783 ipc_forget_all_active_calls(); 784 } 777 785 } 778 786 … … 814 822 irq_spinlock_unlock(&TASK->answerbox.lock, true); 815 823 816 /* Disconnect all our phones ('ipc_phone_hangup')*/824 /* Hangup all phones and destroy all phone capabilities */ 817 825 caps_apply_to_kobject_type(TASK, KOBJECT_TYPE_PHONE, 818 826 phone_cap_cleanup_cb, NULL); 819 827 820 /* Unsubscribe from any event notifications .*/828 /* Unsubscribe from any event notifications */ 821 829 event_cleanup_answerbox(&TASK->answerbox); 822 830 … … 844 852 ipc_forget_all_active_calls(); 845 853 ipc_wait_for_all_answered_calls(); 854 855 assert(atomic_get(&TASK->answerbox.active_calls) == 0); 846 856 } 847 857
Note:
See TracChangeset
for help on using the changeset viewer.