Changes in uspace/lib/c/generic/ipc.c [b7fd2a0:addbce4] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/ipc.c
rb7fd2a0 raddbce4 93 93 * @param call Structure returned by ipc_prepare_async(). 94 94 */ 95 static inline void ipc_finish_async( errno_t rc, async_call_t *call)95 static inline void ipc_finish_async(int rc, async_call_t *call) 96 96 { 97 97 if (!call) { … … 136 136 return; 137 137 138 errno_t rc = (errno_t)__SYSCALL6(SYS_IPC_CALL_ASYNC_FAST, phandle, imethod, arg1,138 int rc = __SYSCALL6(SYS_IPC_CALL_ASYNC_FAST, phandle, imethod, arg1, 139 139 arg2, arg3, (sysarg_t) call); 140 140 … … 175 175 IPC_SET_ARG5(call->msg.data, arg5); 176 176 177 errno_t rc = (errno_t)__SYSCALL3(SYS_IPC_CALL_ASYNC_SLOW, phandle,177 int rc = __SYSCALL3(SYS_IPC_CALL_ASYNC_SLOW, phandle, 178 178 (sysarg_t) &call->msg.data, (sysarg_t) call); 179 179 … … 197 197 * 198 198 */ 199 errno_t ipc_answer_fast(cap_handle_t chandle, errno_t retval, sysarg_t arg1,199 sysarg_t ipc_answer_fast(cap_handle_t chandle, sysarg_t retval, sysarg_t arg1, 200 200 sysarg_t arg2, sysarg_t arg3, sysarg_t arg4) 201 201 { 202 return (errno_t) __SYSCALL6(SYS_IPC_ANSWER_FAST, chandle, (sysarg_t)retval, arg1, arg2,202 return __SYSCALL6(SYS_IPC_ANSWER_FAST, chandle, retval, arg1, arg2, 203 203 arg3, arg4); 204 204 } … … 218 218 * 219 219 */ 220 errno_t ipc_answer_slow(cap_handle_t chandle, errno_t retval, sysarg_t arg1,220 sysarg_t ipc_answer_slow(cap_handle_t chandle, sysarg_t retval, sysarg_t arg1, 221 221 sysarg_t arg2, sysarg_t arg3, sysarg_t arg4, sysarg_t arg5) 222 222 { … … 230 230 IPC_SET_ARG5(data, arg5); 231 231 232 return (errno_t)__SYSCALL2(SYS_IPC_ANSWER_SLOW, chandle, (sysarg_t) &data);232 return __SYSCALL2(SYS_IPC_ANSWER_SLOW, chandle, (sysarg_t) &data); 233 233 } 234 234 … … 254 254 * @param usec Timeout in microseconds 255 255 * @param flags Flags passed to SYS_IPC_WAIT (blocking, nonblocking). 256 * @param[out] out_handle Call handle. 257 * 258 * @return Error code. 259 */ 260 errno_t ipc_wait_cycle(ipc_call_t *call, sysarg_t usec, unsigned int flags) 261 { 262 errno_t rc = (errno_t) __SYSCALL3(SYS_IPC_WAIT, (sysarg_t) call, usec, flags); 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); 263 264 264 265 /* Handle received answers */ 265 if ((rc == EOK) && (call->cap_handle == CAP_NIL) && 266 (call->flags & IPC_CALL_ANSWERED)) { 266 if ((chandle == CAP_NIL) && (call->flags & IPC_CALL_ANSWERED)) 267 267 handle_answer(call); 268 } 269 270 return rc; 268 269 return chandle; 271 270 } 272 271 … … 286 285 * @param usec Timeout in microseconds 287 286 * 288 * @return Error code. 289 * 290 */ 291 errno_t ipc_wait_for_call_timeout(ipc_call_t *call, sysarg_t usec) 292 { 293 errno_t rc; 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; 294 294 295 295 do { 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;296 chandle = ipc_wait_cycle(call, usec, SYNCH_FLAGS_NONE); 297 } while ((chandle == CAP_NIL) && (call->flags & IPC_CALL_ANSWERED)); 298 299 return chandle; 300 300 } 301 301 … … 306 306 * @param call Incoming call storage. 307 307 * 308 * @return Error code. 309 * 310 */ 311 errno_t ipc_trywait_for_call(ipc_call_t *call) 312 { 313 errno_t rc; 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; 314 315 315 316 do { 316 rc= ipc_wait_cycle(call, SYNCH_NO_TIMEOUT,317 chandle = ipc_wait_cycle(call, SYNCH_NO_TIMEOUT, 317 318 SYNCH_FLAGS_NON_BLOCKING); 318 } while (( rc == EOK) && (call->cap_handle == CAP_NIL) && (call->flags & IPC_CALL_ANSWERED));319 320 return rc;319 } while ((chandle == CAP_NIL) && (call->flags & IPC_CALL_ANSWERED)); 320 321 return chandle; 321 322 } 322 323 … … 325 326 * @param phandle Handle of the phone to be hung up. 326 327 * 327 * @return Zero on success or a nerror code.328 * 329 */ 330 errno_t ipc_hangup(cap_handle_t phandle)331 { 332 return (errno_t)__SYSCALL1(SYS_IPC_HANGUP, phandle);328 * @return Zero on success or a negative error code. 329 * 330 */ 331 int ipc_hangup(cap_handle_t phandle) 332 { 333 return __SYSCALL1(SYS_IPC_HANGUP, phandle); 333 334 } 334 335 … … 350 351 * 351 352 */ 352 errno_t ipc_forward_fast(cap_handle_t chandle, cap_handle_t phandle,353 int ipc_forward_fast(cap_handle_t chandle, cap_handle_t phandle, 353 354 sysarg_t imethod, sysarg_t arg1, sysarg_t arg2, unsigned int mode) 354 355 { 355 return (errno_t)__SYSCALL6(SYS_IPC_FORWARD_FAST, chandle, phandle, imethod, arg1,356 return __SYSCALL6(SYS_IPC_FORWARD_FAST, chandle, phandle, imethod, arg1, 356 357 arg2, mode); 357 358 } 358 359 359 errno_t ipc_forward_slow(cap_handle_t chandle, cap_handle_t phandle,360 int ipc_forward_slow(cap_handle_t chandle, cap_handle_t phandle, 360 361 sysarg_t imethod, sysarg_t arg1, sysarg_t arg2, sysarg_t arg3, 361 362 sysarg_t arg4, sysarg_t arg5, unsigned int mode) … … 370 371 IPC_SET_ARG5(data, arg5); 371 372 372 return (errno_t)__SYSCALL4(SYS_IPC_FORWARD_SLOW, chandle, phandle,373 return __SYSCALL4(SYS_IPC_FORWARD_SLOW, chandle, phandle, 373 374 (sysarg_t) &data, mode); 374 375 } … … 377 378 * 378 379 */ 379 errno_t ipc_connect_kbox(task_id_t id, cap_handle_t *phone) 380 { 381 return (errno_t) __SYSCALL2(SYS_IPC_CONNECT_KBOX, (sysarg_t) &id, (sysarg_t) phone); 380 int ipc_connect_kbox(task_id_t id) 381 { 382 #ifdef __32_BITS__ 383 sysarg64_t arg = (sysarg64_t) id; 384 return __SYSCALL1(SYS_IPC_CONNECT_KBOX, (sysarg_t) &arg); 385 #endif 386 387 #ifdef __64_BITS__ 388 return __SYSCALL1(SYS_IPC_CONNECT_KBOX, (sysarg_t) id); 389 #endif 382 390 } 383 391
Note:
See TracChangeset
for help on using the changeset viewer.