Changeset b1f51f0 in mainline for libc/generic/ipc.c
- Timestamp:
- 2006-06-02T16:09:18Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b917098
- Parents:
- a116ef22
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libc/generic/ipc.c
ra116ef22 rb1f51f0 134 134 135 135 /** Epilogue of ipc_async_send functions */ 136 static inline void ipc_finish_async(ipc_callid_t callid, int phoneid, async_call_t *call) 136 static inline void ipc_finish_async(ipc_callid_t callid, int phoneid, 137 async_call_t *call, int can_preempt) 137 138 { 138 139 if (callid == IPC_CALLRET_FATAL) { … … 149 150 150 151 call->u.msg.phoneid = phoneid; 151 152 call->ptid = psthread_get_id(); 152 153 153 futex_down(&async_futex); 154 154 list_append(&call->list, &queued_calls); 155 155 156 psthread_schedule_next_adv(PS_TO_MANAGER); 157 /* Async futex unlocked by previous call */ 156 if (can_preempt) { 157 call->ptid = psthread_get_id(); 158 psthread_schedule_next_adv(PS_TO_MANAGER); 159 /* Async futex unlocked by previous call */ 160 } else { 161 call->ptid = 0; 162 futex_up(&async_futex); 163 } 158 164 return; 159 165 } … … 172 178 void ipc_call_async_2(int phoneid, ipcarg_t method, ipcarg_t arg1, 173 179 ipcarg_t arg2, void *private, 174 ipc_async_callback_t callback )180 ipc_async_callback_t callback, int can_preempt) 175 181 { 176 182 async_call_t *call; … … 191 197 IPC_SET_ARG2(call->u.msg.data, arg2); 192 198 } 193 ipc_finish_async(callid, phoneid, call );199 ipc_finish_async(callid, phoneid, call, can_preempt); 194 200 } 195 201 … … 201 207 void ipc_call_async_3(int phoneid, ipcarg_t method, ipcarg_t arg1, 202 208 ipcarg_t arg2, ipcarg_t arg3, void *private, 203 ipc_async_callback_t callback )209 ipc_async_callback_t callback, int can_preempt) 204 210 { 205 211 async_call_t *call; … … 219 225 callid = _ipc_call_async(phoneid, &call->u.msg.data); 220 226 221 ipc_finish_async(callid, phoneid, call );227 ipc_finish_async(callid, phoneid, call, can_preempt); 222 228 } 223 229 … … 277 283 278 284 futex_up(&async_futex); 279 psthread_add_ready(call->ptid); 285 if (call->ptid) 286 psthread_add_ready(call->ptid); 280 287 281 288 if (callid == IPC_CALLRET_FATAL) { … … 431 438 } 432 439 433 434 /** Open shared memory connection over specified phoneid 435 * 436 * 437 * Allocate as_area, notify the other side about our intention 438 * to open the connection 439 * 440 * @return Connection id identifying this connection 441 */ 442 //int ipc_dgr_open(int pohoneid, size_t bufsize) 443 //{ 444 /* Find new file descriptor in local descriptor table */ 445 /* Create AS_area, initialize structures */ 446 /* Send AS to other side, handle error states */ 447 448 //} 449 /* 450 void ipc_dgr_close(int cid) 451 { 452 } 453 454 void * ipc_dgr_alloc(int cid, size_t size) 455 { 456 } 457 458 void ipc_dgr_free(int cid, void *area) 459 { 460 461 } 462 463 int ipc_dgr_send(int cid, void *area) 464 { 465 } 466 467 468 int ipc_dgr_send_data(int cid, void *data, size_t size) 469 { 470 } 471 472 */ 440 /* Primitive functions for simple communication */ 441 void send_call_3(int phoneid, ipcarg_t method, ipcarg_t arg1, 442 ipcarg_t arg2, ipcarg_t arg3) 443 { 444 ipc_call_async_3(phoneid, method, arg1, arg2, arg3, NULL, NULL, 1); 445 } 446 447 void send_call_2(int phoneid, ipcarg_t method, ipcarg_t arg1, ipcarg_t arg2) 448 { 449 ipc_call_async_2(phoneid, method, arg1, arg2, NULL, NULL, 1); 450 } 451 452 void nsend_call_3(int phoneid, ipcarg_t method, ipcarg_t arg1, 453 ipcarg_t arg2, ipcarg_t arg3) 454 { 455 ipc_call_async_3(phoneid, method, arg1, arg2, arg3, NULL, NULL, 0); 456 } 457 458 void nsend_call_2(int phoneid, ipcarg_t method, ipcarg_t arg1, ipcarg_t arg2) 459 { 460 ipc_call_async_2(phoneid, method, arg1, arg2, NULL, NULL, 0); 461 } 462
Note:
See TracChangeset
for help on using the changeset viewer.