Changeset eadaeae8 in mainline for kernel/generic/src/ipc/sysipc.c
- Timestamp:
- 2018-03-21T20:58:49Z (6 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
-
kernel/generic/src/ipc/sysipc.c
r874381a readaeae8 271 271 * 272 272 */ 273 errno_t ipc_req_internal(cap_handle_t handle, ipc_data_t *data, sysarg_t priv) 273 errno_t 274 ipc_req_internal(cap_phone_handle_t handle, ipc_data_t *data, sysarg_t priv) 274 275 { 275 276 kobject_t *kobj = kobject_get(TASK, handle, KOBJECT_TYPE_PHONE); … … 362 363 * 363 364 */ 364 sys_errno_t sys_ipc_call_async_fast( sysarg_t handle, sysarg_t imethod,365 sys_errno_t sys_ipc_call_async_fast(cap_phone_handle_t handle, sysarg_t imethod, 365 366 sysarg_t arg1, sysarg_t arg2, sysarg_t arg3, sysarg_t label) 366 367 { … … 409 410 * 410 411 */ 411 sys_errno_t sys_ipc_call_async_slow( sysarg_t handle, ipc_data_t *data,412 sys_errno_t sys_ipc_call_async_slow(cap_phone_handle_t handle, ipc_data_t *data, 412 413 sysarg_t label) 413 414 { … … 466 467 * 467 468 */ 468 static sys_errno_t sys_ipc_forward_common( sysarg_t chandle, sysarg_t phandle,469 sysarg_t imethod, sysarg_t arg1, sysarg_t arg2, sysarg_t arg3,470 sysarg_t arg 4, sysarg_t arg5, unsigned int mode, bool slow)469 static sys_errno_t sys_ipc_forward_common(cap_call_handle_t chandle, 470 cap_phone_handle_t phandle, sysarg_t imethod, sysarg_t arg1, sysarg_t arg2, 471 sysarg_t arg3, sysarg_t arg4, sysarg_t arg5, unsigned int mode, bool slow) 471 472 { 472 473 kobject_t *ckobj = cap_unpublish(TASK, chandle, KOBJECT_TYPE_CALL); … … 506 507 if (method_is_system(IPC_GET_IMETHOD(call->data))) { 507 508 if (IPC_GET_IMETHOD(call->data) == IPC_M_CONNECT_TO_ME) 508 phone_dealloc(IPC_GET_ARG5(call->data)); 509 phone_dealloc((cap_phone_handle_t) 510 IPC_GET_ARG5(call->data)); 509 511 510 512 IPC_SET_ARG1(call->data, imethod); … … 577 579 * 578 580 */ 579 sys_errno_t sys_ipc_forward_fast(sysarg_t chandle, sysarg_t phandle, 580 sysarg_t imethod, sysarg_t arg1, sysarg_t arg2, unsigned int mode) 581 sys_errno_t sys_ipc_forward_fast(cap_call_handle_t chandle, 582 cap_phone_handle_t phandle, sysarg_t imethod, sysarg_t arg1, sysarg_t arg2, 583 unsigned int mode) 581 584 { 582 585 return sys_ipc_forward_common(chandle, phandle, imethod, arg1, arg2, 0, … … 601 604 * 602 605 */ 603 sys_errno_t sys_ipc_forward_slow( sysarg_t chandle, sysarg_t phandle,604 ipc_data_t *data, unsigned int mode)606 sys_errno_t sys_ipc_forward_slow(cap_call_handle_t chandle, 607 cap_phone_handle_t phandle, ipc_data_t *data, unsigned int mode) 605 608 { 606 609 ipc_data_t newdata; … … 631 634 * 632 635 */ 633 sys_errno_t sys_ipc_answer_fast( sysarg_t chandle, sysarg_t retval, sysarg_t arg1,634 sysarg_t arg 2, sysarg_t arg3, sysarg_t arg4)636 sys_errno_t sys_ipc_answer_fast(cap_call_handle_t chandle, sysarg_t retval, 637 sysarg_t arg1, sysarg_t arg2, sysarg_t arg3, sysarg_t arg4) 635 638 { 636 639 kobject_t *kobj = cap_unpublish(TASK, chandle, KOBJECT_TYPE_CALL); … … 678 681 * 679 682 */ 680 sys_errno_t sys_ipc_answer_slow( sysarg_t chandle, ipc_data_t *data)683 sys_errno_t sys_ipc_answer_slow(cap_call_handle_t chandle, ipc_data_t *data) 681 684 { 682 685 kobject_t *kobj = cap_unpublish(TASK, chandle, KOBJECT_TYPE_CALL); … … 722 725 * 723 726 */ 724 sys_errno_t sys_ipc_hangup( sysarg_t handle)727 sys_errno_t sys_ipc_hangup(cap_phone_handle_t handle) 725 728 { 726 729 kobject_t *kobj = cap_unpublish(TASK, handle, KOBJECT_TYPE_PHONE); … … 800 803 goto restart; 801 804 802 cap_handle_t handle ;805 cap_handle_t handle = CAP_NIL; 803 806 errno_t rc = cap_alloc(TASK, &handle); 804 807 if (rc != EOK) { … … 821 824 822 825 error: 823 if ( handle >= 0)826 if (CAP_HANDLE_VALID(handle)) 824 827 cap_free(TASK, handle); 825 828 … … 861 864 * @param ucode Uspace pointer to the top-half pseudocode. 862 865 * 863 * @param[out] uspace_handle Uspace pointer to IRQ kernel object capability866 * @param[out] uspace_handle Uspace pointer to IRQ capability handle 864 867 * 865 868 * @return EPERM … … 867 870 * 868 871 */ 869 sys_errno_t sys_ipc_irq_subscribe(inr_t inr, sysarg_t imethod, irq_code_t *ucode,870 cap_handle_t *uspace_handle)872 sys_errno_t sys_ipc_irq_subscribe(inr_t inr, sysarg_t imethod, 873 irq_code_t *ucode, cap_irq_handle_t *uspace_handle) 871 874 { 872 875 if (!(perm_get(TASK) & PERM_IRQ_REG)) … … 878 881 /** Disconnect an IRQ handler from a task. 879 882 * 880 * @param inr IRQ number. 881 * @param devno Device number. 883 * @param handle IRQ capability handle. 882 884 * 883 885 * @return Zero on success or EPERM on error. 884 886 * 885 887 */ 886 sys_errno_t sys_ipc_irq_unsubscribe( sysarg_t cap)888 sys_errno_t sys_ipc_irq_unsubscribe(cap_irq_handle_t handle) 887 889 { 888 890 if (!(perm_get(TASK) & PERM_IRQ_REG)) 889 891 return EPERM; 890 892 891 ipc_irq_unsubscribe(&TASK->answerbox, cap);893 ipc_irq_unsubscribe(&TASK->answerbox, handle); 892 894 893 895 return 0; … … 899 901 * 900 902 */ 901 sys_errno_t sys_ipc_connect_kbox(task_id_t *uspace_taskid, cap_handle_t *uspace_phone) 903 sys_errno_t sys_ipc_connect_kbox(task_id_t *uspace_taskid, 904 cap_phone_handle_t *uspace_phone) 902 905 { 903 906 #ifdef CONFIG_UDEBUG 904 907 task_id_t taskid; 905 cap_ handle_t phone;908 cap_phone_handle_t phone; 906 909 907 910 errno_t rc = copy_from_uspace(&taskid, uspace_taskid, sizeof(task_id_t));
Note:
See TracChangeset
for help on using the changeset viewer.