Changeset 04a73cdf in mainline for libc/generic/ipc.c
- Timestamp:
- 2006-05-17T14:05:01Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 04552a80
- Parents:
- afa6e74
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libc/generic/ipc.c
rafa6e74 r04a73cdf 35 35 #include <unistd.h> 36 36 #include <futex.h> 37 #include <kernel/synch/synch.h> 37 38 38 39 /** Structure used for keeping track of sent async msgs … … 252 253 253 254 254 /** Wait for IPC call and return255 /** Unconditionally wait for an IPC call. 255 256 * 256 257 * - dispatch ASYNC reoutines in the background 257 * @param data Space where the message is stored 258 * @return Callid or 0 if nothing available and started with 259 * IPC_WAIT_NONBLOCKING 260 */ 261 ipc_callid_t ipc_wait_for_call(ipc_call_t *call, int flags) 258 * @param call Space where the message is stored 259 * @return Callid of the answer. 260 */ 261 ipc_callid_t ipc_wait_for_call(ipc_call_t *call) 262 262 { 263 263 ipc_callid_t callid; … … 266 266 try_dispatch_queued_calls(); 267 267 268 callid = __SYSCALL2(SYS_IPC_WAIT, (sysarg_t)call, flags); 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); 273 274 return callid; 275 } 276 277 /** Wait some time for an IPC call. 278 * 279 * - dispatch ASYNC reoutines in the background 280 * @param call Space where the message is stored 281 * @param usec Timeout in microseconds. 282 * @return Callid of the answer. 283 */ 284 ipc_callid_t ipc_wait_for_call_timeout(ipc_call_t *call, uint32_t usec) 285 { 286 ipc_callid_t callid; 287 288 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); 295 } while (callid & IPC_CALLID_ANSWERED); 296 297 return callid; 298 } 299 300 /** Check if there is an IPC call waiting to be picked up. 301 * 302 * - dispatch ASYNC reoutines in the background 303 * @param call Space where the message is stored 304 * @return Callid of the answer. 305 */ 306 ipc_callid_t ipc_trywait_for_call(ipc_call_t *call) 307 { 308 ipc_callid_t callid; 309 310 do { 311 try_dispatch_queued_calls(); 312 313 callid = __SYSCALL3(SYS_IPC_WAIT, (sysarg_t)call, SYNCH_NO_TIMEOUT, SYNCH_NON_BLOCKING); 269 314 /* Handle received answers */ 270 315 if (callid & IPC_CALLID_ANSWERED)
Note:
See TracChangeset
for help on using the changeset viewer.