Changes in kernel/generic/src/ipc/sysipc.c [dd884cb:5a5269d] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/ipc/sysipc.c
rdd884cb r5a5269d 131 131 static inline bool answer_need_old(call_t *call) 132 132 { 133 switch ( IPC_GET_IMETHOD(call->data)) {133 switch (ipc_get_imethod(&call->data)) { 134 134 case IPC_M_CONNECT_TO_ME: 135 135 case IPC_M_CONNECT_ME_TO: … … 192 192 spinlock_unlock(&answer->forget_lock); 193 193 194 if ((errno_t) IPC_GET_RETVAL(answer->data) == EHANGUP) {194 if ((errno_t) ipc_get_retval(&answer->data) == EHANGUP) { 195 195 phone_t *phone = answer->caller_phone; 196 196 mutex_lock(&phone->lock); … … 223 223 static errno_t request_preprocess(call_t *call, phone_t *phone) 224 224 { 225 call->request_method = IPC_GET_IMETHOD(call->data);225 call->request_method = ipc_get_imethod(&call->data); 226 226 return SYSIPC_OP(request_preprocess, call, phone); 227 227 } … … 238 238 static void process_answer(call_t *call) 239 239 { 240 if (((errno_t) IPC_GET_RETVAL(call->data) == EHANGUP) &&240 if (((errno_t) ipc_get_retval(&call->data) == EHANGUP) && 241 241 (call->flags & IPC_CALL_FORWARDED)) 242 IPC_SET_RETVAL(call->data, EFORWARD);242 ipc_set_retval(&call->data, EFORWARD); 243 243 244 244 SYSIPC_OP(answer_process, call); … … 326 326 process_answer(call); 327 327 } else 328 IPC_SET_RETVAL(call->data, rc);328 ipc_set_retval(&call->data, rc); 329 329 330 330 memcpy(data->args, call->data.args, sizeof(data->args)); … … 385 385 } 386 386 387 IPC_SET_IMETHOD(call->data, imethod);388 IPC_SET_ARG1(call->data, arg1);389 IPC_SET_ARG2(call->data, arg2);390 IPC_SET_ARG3(call->data, arg3);387 ipc_set_imethod(&call->data, imethod); 388 ipc_set_arg1(&call->data, arg1); 389 ipc_set_arg2(&call->data, arg2); 390 ipc_set_arg3(&call->data, arg3); 391 391 392 392 /* … … 394 394 * the limits of the fast version. 395 395 */ 396 IPC_SET_ARG5(call->data, 0);396 ipc_set_arg5(&call->data, 0); 397 397 398 398 /* Set the user-defined label */ … … 419 419 * 420 420 */ 421 sys_errno_t sys_ipc_call_async_slow(cap_phone_handle_t handle, ipc_data_t *data,421 sys_errno_t sys_ipc_call_async_slow(cap_phone_handle_t handle, uspace_ptr_ipc_data_t data, 422 422 sysarg_t label) 423 423 { … … 437 437 } 438 438 439 errno_t rc = copy_from_uspace(&call->data.args, &data->args,439 errno_t rc = copy_from_uspace(&call->data.args, data + offsetof(ipc_data_t, args), 440 440 sizeof(call->data.args)); 441 441 if (rc != EOK) { … … 505 505 } 506 506 507 if (!method_is_forwardable( IPC_GET_IMETHOD(call->data))) {507 if (!method_is_forwardable(ipc_get_imethod(&call->data))) { 508 508 rc = EPERM; 509 509 goto error; … … 518 518 * If the interface and method is immutable, don't change anything. 519 519 */ 520 if (!method_is_immutable( IPC_GET_IMETHOD(call->data))) {521 if (method_is_system( IPC_GET_IMETHOD(call->data))) {522 if ( IPC_GET_IMETHOD(call->data) ==520 if (!method_is_immutable(ipc_get_imethod(&call->data))) { 521 if (method_is_system(ipc_get_imethod(&call->data))) { 522 if (ipc_get_imethod(&call->data) == 523 523 IPC_M_CONNECT_TO_ME) { 524 524 kobject_put((kobject_t *) call->priv); 525 525 call->priv = 0; 526 526 cap_free(TASK, 527 (cap_handle_t) IPC_GET_ARG5(call->data));527 (cap_handle_t) ipc_get_arg5(&call->data)); 528 528 } 529 529 530 IPC_SET_ARG1(call->data, imethod);531 IPC_SET_ARG2(call->data, arg1);532 IPC_SET_ARG3(call->data, arg2);530 ipc_set_arg1(&call->data, imethod); 531 ipc_set_arg2(&call->data, arg1); 532 ipc_set_arg3(&call->data, arg2); 533 533 534 534 if (slow) 535 IPC_SET_ARG4(call->data, arg3);535 ipc_set_arg4(&call->data, arg3); 536 536 537 537 /* … … 540 540 */ 541 541 } else { 542 IPC_SET_IMETHOD(call->data, imethod);543 IPC_SET_ARG1(call->data, arg1);544 IPC_SET_ARG2(call->data, arg2);542 ipc_set_imethod(&call->data, imethod); 543 ipc_set_arg1(&call->data, arg1); 544 ipc_set_arg2(&call->data, arg2); 545 545 if (slow) { 546 IPC_SET_ARG3(call->data, arg3);547 IPC_SET_ARG4(call->data, arg4);548 IPC_SET_ARG5(call->data, arg5);546 ipc_set_arg3(&call->data, arg3); 547 ipc_set_arg4(&call->data, arg4); 548 ipc_set_arg5(&call->data, arg5); 549 549 } 550 550 } … … 563 563 564 564 error: 565 IPC_SET_RETVAL(call->data, EFORWARD);565 ipc_set_retval(&call->data, EFORWARD); 566 566 (void) answer_preprocess(call, need_old ? &old : NULL); 567 567 if (after_forward) … … 623 623 */ 624 624 sys_errno_t sys_ipc_forward_slow(cap_call_handle_t chandle, 625 cap_phone_handle_t phandle, ipc_data_t *data, unsigned int mode)625 cap_phone_handle_t phandle, uspace_ptr_ipc_data_t data, unsigned int mode) 626 626 { 627 627 ipc_data_t newdata; 628 errno_t rc = copy_from_uspace(&newdata.args, &data->args,628 errno_t rc = copy_from_uspace(&newdata.args, data + offsetof(ipc_data_t, args), 629 629 sizeof(newdata.args)); 630 630 if (rc != EOK) … … 632 632 633 633 return sys_ipc_forward_common(chandle, phandle, 634 IPC_GET_IMETHOD(newdata), IPC_GET_ARG1(newdata),635 IPC_GET_ARG2(newdata), IPC_GET_ARG3(newdata),636 IPC_GET_ARG4(newdata), IPC_GET_ARG5(newdata), mode, true);634 ipc_get_imethod(&newdata), ipc_get_arg1(&newdata), 635 ipc_get_arg2(&newdata), ipc_get_arg3(&newdata), 636 ipc_get_arg4(&newdata), ipc_get_arg5(&newdata), mode, true); 637 637 } 638 638 … … 671 671 saved = false; 672 672 673 IPC_SET_RETVAL(call->data, retval);674 IPC_SET_ARG1(call->data, arg1);675 IPC_SET_ARG2(call->data, arg2);676 IPC_SET_ARG3(call->data, arg3);677 IPC_SET_ARG4(call->data, arg4);673 ipc_set_retval(&call->data, retval); 674 ipc_set_arg1(&call->data, arg1); 675 ipc_set_arg2(&call->data, arg2); 676 ipc_set_arg3(&call->data, arg3); 677 ipc_set_arg4(&call->data, arg4); 678 678 679 679 /* … … 681 681 * the limits of the fast version. 682 682 */ 683 IPC_SET_ARG5(call->data, 0);683 ipc_set_arg5(&call->data, 0); 684 684 errno_t rc = answer_preprocess(call, saved ? &saved_data : NULL); 685 685 … … 700 700 * 701 701 */ 702 sys_errno_t sys_ipc_answer_slow(cap_call_handle_t chandle, ipc_data_t *data)702 sys_errno_t sys_ipc_answer_slow(cap_call_handle_t chandle, uspace_ptr_ipc_data_t data) 703 703 { 704 704 kobject_t *kobj = cap_unpublish(TASK, chandle, KOBJECT_TYPE_CALL); … … 718 718 saved = false; 719 719 720 errno_t rc = copy_from_uspace(&call->data.args, &data->args,720 errno_t rc = copy_from_uspace(&call->data.args, data + offsetof(ipc_data_t, args), 721 721 sizeof(call->data.args)); 722 722 if (rc != EOK) { … … 766 766 * @return An error code on error. 767 767 */ 768 sys_errno_t sys_ipc_wait_for_call( ipc_data_t *calldata, uint32_t usec,768 sys_errno_t sys_ipc_wait_for_call(uspace_ptr_ipc_data_t calldata, uint32_t usec, 769 769 unsigned int flags) 770 770 { … … 841 841 842 842 error: 843 if ( CAP_HANDLE_VALID(handle))843 if (cap_handle_valid(handle)) 844 844 cap_free(TASK, handle); 845 845 … … 858 858 saved = false; 859 859 860 IPC_SET_RETVAL(call->data, EPARTY);860 ipc_set_retval(&call->data, EPARTY); 861 861 (void) answer_preprocess(call, saved ? &saved_data : NULL); 862 862 call->flags |= IPC_CALL_AUTO_REPLY; … … 888 888 */ 889 889 sys_errno_t sys_ipc_irq_subscribe(inr_t inr, sysarg_t imethod, 890 irq_code_t *ucode, cap_irq_handle_t *uspace_handle)890 uspace_ptr_irq_code_t ucode, uspace_ptr_cap_irq_handle_t uspace_handle) 891 891 { 892 892 if (!(perm_get(TASK) & PERM_IRQ_REG)) … … 918 918 * 919 919 */ 920 sys_errno_t sys_ipc_connect_kbox( task_id_t *uspace_taskid,921 cap_phone_handle_t *uspace_phone)920 sys_errno_t sys_ipc_connect_kbox(uspace_ptr_task_id_t uspace_taskid, 921 uspace_ptr_cap_phone_handle_t uspace_phone) 922 922 { 923 923 #ifdef CONFIG_UDEBUG
Note:
See TracChangeset
for help on using the changeset viewer.