Changeset eadaeae8 in mainline for uspace/lib/c/generic/ipc.c
- Timestamp:
- 2018-03-21T20:58:49Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3be9d10
- Parents:
- 874381a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/ipc.c
r874381a readaeae8 129 129 * @param callback Answer or error callback. 130 130 */ 131 void ipc_call_async_fast(cap_handle_t phandle, sysarg_t imethod, sysarg_t arg1, 132 sysarg_t arg2, sysarg_t arg3, void *private, ipc_async_callback_t callback) 131 void ipc_call_async_fast(cap_phone_handle_t phandle, sysarg_t imethod, 132 sysarg_t arg1, sysarg_t arg2, sysarg_t arg3, void *private, 133 ipc_async_callback_t callback) 133 134 { 134 135 async_call_t *call = ipc_prepare_async(private, callback); … … 136 137 return; 137 138 138 errno_t rc = (errno_t) __SYSCALL6(SYS_IPC_CALL_ASYNC_FAST, phandle, imethod, arg1, 139 arg2, arg3, (sysarg_t) call); 139 errno_t rc = (errno_t) __SYSCALL6(SYS_IPC_CALL_ASYNC_FAST, 140 CAP_HANDLE_RAW(phandle), imethod, arg1, arg2, arg3, 141 (sysarg_t) call); 140 142 141 143 ipc_finish_async(rc, call); … … 160 162 * @param callback Answer or error callback. 161 163 */ 162 void ipc_call_async_slow( int phandle, sysarg_t imethod, sysarg_t arg1,163 sysarg_t arg 2, sysarg_t arg3, sysarg_t arg4, sysarg_t arg5, void *private,164 ipc_async_callback_t callback)164 void ipc_call_async_slow(cap_phone_handle_t phandle, sysarg_t imethod, 165 sysarg_t arg1, sysarg_t arg2, sysarg_t arg3, sysarg_t arg4, sysarg_t arg5, 166 void *private, ipc_async_callback_t callback) 165 167 { 166 168 async_call_t *call = ipc_prepare_async(private, callback); … … 175 177 IPC_SET_ARG5(call->msg.data, arg5); 176 178 177 errno_t rc = (errno_t) __SYSCALL3(SYS_IPC_CALL_ASYNC_SLOW, phandle, 178 (sysarg_t) &call->msg.data, (sysarg_t) call); 179 errno_t rc = (errno_t) __SYSCALL3(SYS_IPC_CALL_ASYNC_SLOW, 180 CAP_HANDLE_RAW(phandle), (sysarg_t) &call->msg.data, 181 (sysarg_t) call); 179 182 180 183 ipc_finish_async(rc, call); … … 197 200 * 198 201 */ 199 errno_t ipc_answer_fast(cap_ handle_t chandle, errno_t retval, sysarg_t arg1,200 sysarg_t arg 2, sysarg_t arg3, sysarg_t arg4)201 { 202 return (errno_t) __SYSCALL6(SYS_IPC_ANSWER_FAST, chandle, (sysarg_t) retval, arg1, arg2,203 arg3, arg4);202 errno_t ipc_answer_fast(cap_call_handle_t chandle, errno_t retval, 203 sysarg_t arg1, sysarg_t arg2, sysarg_t arg3, sysarg_t arg4) 204 { 205 return (errno_t) __SYSCALL6(SYS_IPC_ANSWER_FAST, 206 CAP_HANDLE_RAW(chandle), (sysarg_t) retval, arg1, arg2, arg3, arg4); 204 207 } 205 208 … … 218 221 * 219 222 */ 220 errno_t ipc_answer_slow(cap_ handle_t chandle, errno_t retval, sysarg_t arg1,221 sysarg_t arg 2, sysarg_t arg3, sysarg_t arg4, sysarg_t arg5)223 errno_t ipc_answer_slow(cap_call_handle_t chandle, errno_t retval, 224 sysarg_t arg1, sysarg_t arg2, sysarg_t arg3, sysarg_t arg4, sysarg_t arg5) 222 225 { 223 226 ipc_call_t data; … … 230 233 IPC_SET_ARG5(data, arg5); 231 234 232 return (errno_t) __SYSCALL2(SYS_IPC_ANSWER_SLOW, chandle, (sysarg_t) &data); 235 return (errno_t) __SYSCALL2(SYS_IPC_ANSWER_SLOW, 236 CAP_HANDLE_RAW(chandle), (sysarg_t) &data); 233 237 } 234 238 … … 251 255 /** Wait for first IPC call to come. 252 256 * 253 * @param call Incoming call storage. 254 * @param usec Timeout in microseconds 255 * @param flags Flags passed to SYS_IPC_WAIT (blocking, nonblocking). 256 * @param[out] out_handle Call handle. 257 * @param[out] call Storage for the received call. 258 * @param[in] usec Timeout in microseconds 259 * @param[in[ flags Flags passed to SYS_IPC_WAIT (blocking, nonblocking). 257 260 * 258 261 * @return Error code. … … 260 263 errno_t ipc_wait_cycle(ipc_call_t *call, sysarg_t usec, unsigned int flags) 261 264 { 262 errno_t rc = (errno_t) __SYSCALL3(SYS_IPC_WAIT, (sysarg_t) call, usec, flags); 265 errno_t rc = (errno_t) __SYSCALL3(SYS_IPC_WAIT, (sysarg_t) call, usec, 266 flags); 263 267 264 268 /* Handle received answers */ … … 295 299 do { 296 300 rc = ipc_wait_cycle(call, usec, SYNCH_FLAGS_NONE); 297 } while ((rc == EOK) && (call->cap_handle == CAP_NIL) && (call->flags & IPC_CALL_ANSWERED)); 301 } while ((rc == EOK) && (call->cap_handle == CAP_NIL) && 302 (call->flags & IPC_CALL_ANSWERED)); 298 303 299 304 return rc; … … 316 321 rc = ipc_wait_cycle(call, SYNCH_NO_TIMEOUT, 317 322 SYNCH_FLAGS_NON_BLOCKING); 318 } while ((rc == EOK) && (call->cap_handle == CAP_NIL) && (call->flags & IPC_CALL_ANSWERED)); 323 } while ((rc == EOK) && (call->cap_handle == CAP_NIL) && 324 (call->flags & IPC_CALL_ANSWERED)); 319 325 320 326 return rc; … … 328 334 * 329 335 */ 330 errno_t ipc_hangup(cap_ handle_t phandle)331 { 332 return (errno_t) __SYSCALL1(SYS_IPC_HANGUP, phandle);336 errno_t ipc_hangup(cap_phone_handle_t phandle) 337 { 338 return (errno_t) __SYSCALL1(SYS_IPC_HANGUP, CAP_HANDLE_RAW(phandle)); 333 339 } 334 340 … … 350 356 * 351 357 */ 352 errno_t ipc_forward_fast(cap_ handle_t chandle, cap_handle_t phandle,358 errno_t ipc_forward_fast(cap_call_handle_t chandle, cap_phone_handle_t phandle, 353 359 sysarg_t imethod, sysarg_t arg1, sysarg_t arg2, unsigned int mode) 354 360 { 355 return (errno_t) __SYSCALL6(SYS_IPC_FORWARD_FAST, chandle, phandle, imethod, arg1, 361 return (errno_t) __SYSCALL6(SYS_IPC_FORWARD_FAST, 362 CAP_HANDLE_RAW(chandle), CAP_HANDLE_RAW(phandle), imethod, arg1, 356 363 arg2, mode); 357 364 } 358 365 359 errno_t ipc_forward_slow(cap_ handle_t chandle, cap_handle_t phandle,366 errno_t ipc_forward_slow(cap_call_handle_t chandle, cap_phone_handle_t phandle, 360 367 sysarg_t imethod, sysarg_t arg1, sysarg_t arg2, sysarg_t arg3, 361 368 sysarg_t arg4, sysarg_t arg5, unsigned int mode) … … 370 377 IPC_SET_ARG5(data, arg5); 371 378 372 return (errno_t) __SYSCALL4(SYS_IPC_FORWARD_SLOW, chandle, phandle, 373 (sysarg_t) &data, mode); 379 return (errno_t) __SYSCALL4(SYS_IPC_FORWARD_SLOW, 380 CAP_HANDLE_RAW(chandle), CAP_HANDLE_RAW(phandle), (sysarg_t) &data, 381 mode); 374 382 } 375 383 … … 377 385 * 378 386 */ 379 errno_t ipc_connect_kbox(task_id_t id, cap_ handle_t *phone)387 errno_t ipc_connect_kbox(task_id_t id, cap_phone_handle_t *phone) 380 388 { 381 389 return (errno_t) __SYSCALL2(SYS_IPC_CONNECT_KBOX, (sysarg_t) &id, (sysarg_t) phone);
Note:
See TracChangeset
for help on using the changeset viewer.