Changeset 80649a91 in mainline for libc/generic/ipc.c
- Timestamp:
- 2006-05-21T19:28:37Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a410beb
- Parents:
- 1ee11f4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libc/generic/ipc.c
r1ee11f4 r80649a91 58 58 LIST_INITIALIZE(queued_calls); 59 59 60 static atomic_t ipc_futex; 61 62 void _ipc_init(void) 63 { 64 futex_initialize(&ipc_futex, 1); 65 } 60 static atomic_t ipc_futex = FUTEX_INITIALIZER; 66 61 67 62 int ipc_call_sync(int phoneid, ipcarg_t method, ipcarg_t arg1, … … 253 248 254 249 255 /** Unconditionally wait for an IPC call.250 /** One cycle of ipc wait for call call 256 251 * 257 252 * - dispatch ASYNC reoutines in the background 258 253 * @param call Space where the message is stored 254 * @param usec Timeout in microseconds 255 * @param flags Flags passed to SYS_IPC_WAIT (blocking, nonblocking) 259 256 * @return Callid of the answer. 260 257 */ 261 ipc_callid_t ipc_wait_for_call(ipc_call_t *call) 262 { 263 ipc_callid_t callid; 264 265 do { 266 try_dispatch_queued_calls(); 267 268 callid = __SYSCALL3(SYS_IPC_WAIT, (sysarg_t) call, SYNCH_NO_TIMEOUT, SYNCH_BLOCKING); 269 /* Handle received answers */ 270 if (callid & IPC_CALLID_ANSWERED) 271 handle_answer(callid, call); 272 } while (callid & IPC_CALLID_ANSWERED); 258 ipc_callid_t ipc_wait_cycle(ipc_call_t *call, uint32_t usec, int flags) 259 { 260 ipc_callid_t callid; 261 262 try_dispatch_queued_calls(); 263 264 callid = __SYSCALL3(SYS_IPC_WAIT, (sysarg_t) call, usec, flags); 265 /* Handle received answers */ 266 if (callid & IPC_CALLID_ANSWERED) 267 handle_answer(callid, call); 273 268 274 269 return callid; … … 287 282 288 283 do { 289 try_dispatch_queued_calls(); 290 291 callid = __SYSCALL3(SYS_IPC_WAIT, (sysarg_t) call, usec, SYNCH_BLOCKING); 292 /* Handle received answers */ 293 if (callid & IPC_CALLID_ANSWERED) 294 handle_answer(callid, call); 284 callid = ipc_wait_cycle(call, usec, SYNCH_BLOCKING); 295 285 } while (callid & IPC_CALLID_ANSWERED); 296 286 … … 309 299 310 300 do { 311 try_dispatch_queued_calls(); 312 313 callid = __SYSCALL3(SYS_IPC_WAIT, (sysarg_t)call, SYNCH_NO_TIMEOUT, SYNCH_NON_BLOCKING); 314 /* Handle received answers */ 315 if (callid & IPC_CALLID_ANSWERED) 316 handle_answer(callid, call); 301 callid = ipc_wait_cycle(call, SYNCH_NO_TIMEOUT, SYNCH_NON_BLOCKING); 317 302 } while (callid & IPC_CALLID_ANSWERED); 318 303
Note:
See TracChangeset
for help on using the changeset viewer.