Changeset 2c2d54a in mainline for kernel/generic/src/ipc/ipc.c
- Timestamp:
- 2016-09-02T17:58:05Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4c3602c4
- Parents:
- 4bf0926e (diff), 3233adb (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
r4bf0926e r2c2d54a 77 77 call->forget = false; 78 78 call->sender = NULL; 79 call->callerbox = &TASK->answerbox; 79 80 call->buffer = NULL; 80 81 } … … 185 186 phone->state = IPC_PHONE_FREE; 186 187 atomic_set(&phone->active_calls, 0); 188 } 189 190 /** Helper function to facilitate synchronous calls. 191 * 192 * @param phone Destination kernel phone structure. 193 * @param request Call structure with request. 194 * 195 * @return EOK on success or a negative error code. 196 * 197 */ 198 int ipc_call_sync(phone_t *phone, call_t *request) 199 { 200 answerbox_t *mybox = slab_alloc(ipc_answerbox_slab, 0); 201 ipc_answerbox_init(mybox, TASK); 202 203 /* We will receive data in a special box. */ 204 request->callerbox = mybox; 205 206 int rc = ipc_call(phone, request); 207 if (rc != EOK) { 208 slab_free(ipc_answerbox_slab, mybox); 209 return rc; 210 } 211 // TODO: forget the call if interrupted 212 (void) ipc_wait_for_call(mybox, SYNCH_NO_TIMEOUT, SYNCH_FLAGS_NONE); 213 214 slab_free(ipc_answerbox_slab, mybox); 215 return EOK; 187 216 } 188 217 … … 220 249 spinlock_unlock(&call->forget_lock); 221 250 222 answerbox_t *callerbox = &call->sender->answerbox;251 answerbox_t *callerbox = call->callerbox; 223 252 bool do_lock = ((!selflocked) || (callerbox != &TASK->answerbox)); 224 253 … … 755 784 ipc_cleanup_call_list(&TASK->answerbox, 756 785 &TASK->answerbox.dispatched_calls); 757 786 758 787 ipc_forget_all_active_calls(); 759 788 ipc_wait_for_all_answered_calls();
Note:
See TracChangeset
for help on using the changeset viewer.