Changeset 6deb2cd in mainline for uspace/lib/c/generic/ipc.c
- Timestamp:
- 2017-12-08T21:17:27Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9233e9d
- Parents:
- 125c09c
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2017-12-07 16:46:52)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2017-12-08 21:17:27)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/ipc.c
r125c09c r6deb2cd 254 254 * @param usec Timeout in microseconds 255 255 * @param flags Flags passed to SYS_IPC_WAIT (blocking, nonblocking). 256 * 257 * @return Call handle. 258 * @return Negative error code. 259 */ 260 cap_handle_t ipc_wait_cycle(ipc_call_t *call, sysarg_t usec, unsigned int flags) 261 { 262 cap_handle_t chandle = 263 __SYSCALL3(SYS_IPC_WAIT, (sysarg_t) call, usec, flags); 256 * @param[out] out_handle Call handle. 257 * 258 * @return Error code. 259 */ 260 int ipc_wait_cycle(ipc_call_t *call, sysarg_t usec, unsigned int flags) 261 { 262 int rc = __SYSCALL3(SYS_IPC_WAIT, (sysarg_t) call, usec, flags); 264 263 265 264 /* Handle received answers */ 266 if ((chandle == CAP_NIL) && (call->flags & IPC_CALL_ANSWERED)) 265 if ((rc == EOK) && (call->cap_handle == CAP_NIL) && 266 (call->flags & IPC_CALL_ANSWERED)) { 267 267 handle_answer(call); 268 269 return chandle; 268 } 269 270 return rc; 270 271 } 271 272 … … 285 286 * @param usec Timeout in microseconds 286 287 * 287 * @return Call handle. 288 * @return Negative error code. 289 * 290 */ 291 cap_handle_t ipc_wait_for_call_timeout(ipc_call_t *call, sysarg_t usec) 292 { 293 cap_handle_t chandle; 288 * @return Error code. 289 * 290 */ 291 int ipc_wait_for_call_timeout(ipc_call_t *call, sysarg_t usec) 292 { 293 int rc; 294 294 295 295 do { 296 chandle= ipc_wait_cycle(call, usec, SYNCH_FLAGS_NONE);297 } while (( chandle == CAP_NIL) && (call->flags & IPC_CALL_ANSWERED));298 299 return chandle;296 rc = ipc_wait_cycle(call, usec, SYNCH_FLAGS_NONE); 297 } while ((rc == EOK) && (call->cap_handle == CAP_NIL) && (call->flags & IPC_CALL_ANSWERED)); 298 299 return rc; 300 300 } 301 301 … … 306 306 * @param call Incoming call storage. 307 307 * 308 * @return Call handle. 309 * @return Negative error code. 310 * 311 */ 312 cap_handle_t ipc_trywait_for_call(ipc_call_t *call) 313 { 314 cap_handle_t chandle; 308 * @return Error code. 309 * 310 */ 311 int ipc_trywait_for_call(ipc_call_t *call) 312 { 313 int rc; 315 314 316 315 do { 317 chandle= ipc_wait_cycle(call, SYNCH_NO_TIMEOUT,316 rc = ipc_wait_cycle(call, SYNCH_NO_TIMEOUT, 318 317 SYNCH_FLAGS_NON_BLOCKING); 319 } while (( chandle == CAP_NIL) && (call->flags & IPC_CALL_ANSWERED));320 321 return chandle;318 } while ((rc == EOK) && (call->cap_handle == CAP_NIL) && (call->flags & IPC_CALL_ANSWERED)); 319 320 return rc; 322 321 } 323 322
Note:
See TracChangeset
for help on using the changeset viewer.