Changeset c70ce74 in mainline
- Timestamp:
- 2009-11-19T21:15:35Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 33adc6ce
- Parents:
- 4ca28512
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/ipc/ipc.c
r4ca28512 rc70ce74 62 62 63 63 static slab_cache_t *ipc_call_slab; 64 static slab_cache_t *ipc_answerbox_slab; 64 65 65 66 /** Initialize a call structure. … … 167 168 int ipc_call_sync(phone_t *phone, call_t *request) 168 169 { 169 answerbox_t sync_box; 170 171 ipc_answerbox_init(&sync_box, TASK); 170 answerbox_t *sync_box; 171 172 sync_box = slab_alloc(ipc_answerbox_slab, 0); 173 ipc_answerbox_init(sync_box, TASK); 172 174 173 175 /* We will receive data in a special box. */ 174 request->callerbox = &sync_box;176 request->callerbox = sync_box; 175 177 176 178 ipc_call(phone, request); 177 if (!ipc_wait_for_call(&sync_box, SYNCH_NO_TIMEOUT, 178 SYNCH_FLAGS_INTERRUPTIBLE)) 179 if (!ipc_wait_for_call(sync_box, SYNCH_NO_TIMEOUT, 180 SYNCH_FLAGS_INTERRUPTIBLE)) { 181 /* The asnwerbox will be freed by someone else. */ 179 182 return EINTR; 183 } 184 slab_free(ipc_answerbox_slab, sync_box); 180 185 return EOK; 181 186 } … … 580 585 ipc_call_slab = slab_cache_create("ipc_call", sizeof(call_t), 0, NULL, 581 586 NULL, 0); 587 ipc_answerbox_slab = slab_cache_create("ipc_answerbox", 588 sizeof(answerbox_t), 0, NULL, NULL, 0); 582 589 } 583 590
Note:
See TracChangeset
for help on using the changeset viewer.