Changes in kernel/generic/src/ipc/sysipc.c [a53ed3a:cde999a] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/ipc/sysipc.c
ra53ed3a rcde999a 158 158 * 159 159 */ 160 errno_t answer_preprocess(call_t *answer, ipc_data_t *olddata)161 { 162 errno_t rc = EOK;160 int answer_preprocess(call_t *answer, ipc_data_t *olddata) 161 { 162 int rc = EOK; 163 163 164 164 spinlock_lock(&answer->forget_lock); … … 194 194 spinlock_unlock(&answer->forget_lock); 195 195 196 if (( errno_t) IPC_GET_RETVAL(answer->data) == EHANGUP) {196 if ((int) IPC_GET_RETVAL(answer->data) == EHANGUP) { 197 197 phone_t *phone = answer->caller_phone; 198 198 mutex_lock(&phone->lock); … … 222 222 * 223 223 */ 224 static errno_t request_preprocess(call_t *call, phone_t *phone)224 static int request_preprocess(call_t *call, phone_t *phone) 225 225 { 226 226 call->request_method = IPC_GET_IMETHOD(call->data); … … 239 239 static void process_answer(call_t *call) 240 240 { 241 if ((( errno_t) IPC_GET_RETVAL(call->data) == EHANGUP) &&241 if (((int) IPC_GET_RETVAL(call->data) == EHANGUP) && 242 242 (call->flags & IPC_CALL_FORWARDED)) 243 243 IPC_SET_RETVAL(call->data, EFORWARD); … … 271 271 * 272 272 */ 273 errno_t ipc_req_internal(cap_handle_t handle, ipc_data_t *data, sysarg_t priv)273 int ipc_req_internal(cap_handle_t handle, ipc_data_t *data, sysarg_t priv) 274 274 { 275 275 kobject_t *kobj = kobject_get(TASK, handle, KOBJECT_TYPE_PHONE); … … 281 281 memcpy(call->data.args, data->args, sizeof(data->args)); 282 282 283 errno_t rc = request_preprocess(call, kobj->phone);283 int rc = request_preprocess(call, kobj->phone); 284 284 if (!rc) { 285 285 #ifdef CONFIG_UDEBUG … … 362 362 * 363 363 */ 364 sys _errno_t sys_ipc_call_async_fast(sysarg_t handle, sysarg_t imethod,364 sysarg_t sys_ipc_call_async_fast(sysarg_t handle, sysarg_t imethod, 365 365 sysarg_t arg1, sysarg_t arg2, sysarg_t arg3, sysarg_t label) 366 366 { … … 389 389 call->data.label = label; 390 390 391 errno_t res = request_preprocess(call, kobj->phone);391 int res = request_preprocess(call, kobj->phone); 392 392 393 393 if (!res) … … 409 409 * 410 410 */ 411 sys _errno_t sys_ipc_call_async_slow(sysarg_t handle, ipc_data_t *data,411 sysarg_t sys_ipc_call_async_slow(sysarg_t handle, ipc_data_t *data, 412 412 sysarg_t label) 413 413 { … … 422 422 423 423 call_t *call = ipc_call_alloc(0); 424 errno_t rc = copy_from_uspace(&call->data.args, &data->args,424 int rc = copy_from_uspace(&call->data.args, &data->args, 425 425 sizeof(call->data.args)); 426 if (rc != EOK) {426 if (rc != 0) { 427 427 kobject_put(call->kobject); 428 428 kobject_put(kobj); 429 return (sys _errno_t) rc;429 return (sysarg_t) rc; 430 430 } 431 431 … … 433 433 call->data.label = label; 434 434 435 errno_t res = request_preprocess(call, kobj->phone);435 int res = request_preprocess(call, kobj->phone); 436 436 437 437 if (!res) … … 466 466 * 467 467 */ 468 static sys _errno_t sys_ipc_forward_common(sysarg_t chandle, sysarg_t phandle,468 static sysarg_t sys_ipc_forward_common(sysarg_t chandle, sysarg_t phandle, 469 469 sysarg_t imethod, sysarg_t arg1, sysarg_t arg2, sysarg_t arg3, 470 470 sysarg_t arg4, sysarg_t arg5, unsigned int mode, bool slow) … … 482 482 483 483 bool after_forward = false; 484 errno_t rc;484 int rc; 485 485 486 486 kobject_t *pkobj = kobject_get(TASK, phandle, KOBJECT_TYPE_PHONE); … … 577 577 * 578 578 */ 579 sys _errno_t sys_ipc_forward_fast(sysarg_t chandle, sysarg_t phandle,579 sysarg_t sys_ipc_forward_fast(sysarg_t chandle, sysarg_t phandle, 580 580 sysarg_t imethod, sysarg_t arg1, sysarg_t arg2, unsigned int mode) 581 581 { … … 601 601 * 602 602 */ 603 sys _errno_t sys_ipc_forward_slow(sysarg_t chandle, sysarg_t phandle,603 sysarg_t sys_ipc_forward_slow(sysarg_t chandle, sysarg_t phandle, 604 604 ipc_data_t *data, unsigned int mode) 605 605 { 606 606 ipc_data_t newdata; 607 errno_t rc = copy_from_uspace(&newdata.args, &data->args,607 int rc = copy_from_uspace(&newdata.args, &data->args, 608 608 sizeof(newdata.args)); 609 if (rc != EOK)610 return (sys _errno_t) rc;609 if (rc != 0) 610 return (sysarg_t) rc; 611 611 612 612 return sys_ipc_forward_common(chandle, phandle, … … 631 631 * 632 632 */ 633 sys _errno_t sys_ipc_answer_fast(sysarg_t chandle, sysarg_t retval, sysarg_t arg1,633 sysarg_t sys_ipc_answer_fast(sysarg_t chandle, sysarg_t retval, sysarg_t arg1, 634 634 sysarg_t arg2, sysarg_t arg3, sysarg_t arg4) 635 635 { … … 660 660 */ 661 661 IPC_SET_ARG5(call->data, 0); 662 errno_t rc = answer_preprocess(call, saved ? &saved_data : NULL);662 int rc = answer_preprocess(call, saved ? &saved_data : NULL); 663 663 664 664 ipc_answer(&TASK->answerbox, call); … … 678 678 * 679 679 */ 680 sys _errno_t sys_ipc_answer_slow(sysarg_t chandle, ipc_data_t *data)680 sysarg_t sys_ipc_answer_slow(sysarg_t chandle, ipc_data_t *data) 681 681 { 682 682 kobject_t *kobj = cap_unpublish(TASK, chandle, KOBJECT_TYPE_CALL); … … 695 695 saved = false; 696 696 697 errno_t rc = copy_from_uspace(&call->data.args, &data->args,697 int rc = copy_from_uspace(&call->data.args, &data->args, 698 698 sizeof(call->data.args)); 699 if (rc != EOK) {699 if (rc != 0) { 700 700 /* 701 701 * Republish the capability so that the call does not get lost. … … 722 722 * 723 723 */ 724 sys _errno_t sys_ipc_hangup(sysarg_t handle)724 sysarg_t sys_ipc_hangup(sysarg_t handle) 725 725 { 726 726 kobject_t *kobj = kobject_get(TASK, handle, KOBJECT_TYPE_PHONE); … … 728 728 return ENOENT; 729 729 730 errno_t rc = ipc_phone_hangup(kobj->phone);730 int rc = ipc_phone_hangup(kobj->phone); 731 731 kobject_put(kobj); 732 732 return rc; … … 742 742 * @return An error code on error. 743 743 */ 744 sys _errno_t sys_ipc_wait_for_call(ipc_data_t *calldata, uint32_t usec,744 sysarg_t sys_ipc_wait_for_call(ipc_data_t *calldata, uint32_t usec, 745 745 unsigned int flags) 746 746 { … … 800 800 801 801 cap_handle_t handle; 802 errno_t rc = cap_alloc(TASK, &handle);802 int rc = cap_alloc(TASK, &handle); 803 803 if (rc != EOK) { 804 804 goto error; … … 848 848 * 849 849 */ 850 sys _errno_t sys_ipc_poke(void)850 sysarg_t sys_ipc_poke(void) 851 851 { 852 852 waitq_unsleep(&TASK->answerbox.wq); … … 866 866 * 867 867 */ 868 sys _errno_t sys_ipc_irq_subscribe(inr_t inr, sysarg_t imethod, irq_code_t *ucode,868 sysarg_t sys_ipc_irq_subscribe(inr_t inr, sysarg_t imethod, irq_code_t *ucode, 869 869 cap_handle_t *uspace_handle) 870 870 { … … 883 883 * 884 884 */ 885 sys _errno_t sys_ipc_irq_unsubscribe(sysarg_t cap)885 sysarg_t sys_ipc_irq_unsubscribe(sysarg_t cap) 886 886 { 887 887 if (!(perm_get(TASK) & PERM_IRQ_REG)) … … 898 898 * 899 899 */ 900 sys _errno_t sys_ipc_connect_kbox(task_id_t *uspace_taskid, cap_handle_t *uspace_phone)900 sysarg_t sys_ipc_connect_kbox(task_id_t *uspace_taskid, cap_handle_t *uspace_phone) 901 901 { 902 902 #ifdef CONFIG_UDEBUG … … 904 904 cap_handle_t phone; 905 905 906 errno_t rc = copy_from_uspace(&taskid, uspace_taskid, sizeof(task_id_t));906 int rc = copy_from_uspace(&taskid, uspace_taskid, sizeof(task_id_t)); 907 907 if (rc == EOK) { 908 908 rc = ipc_connect_kbox((task_id_t) taskid, &phone); … … 917 917 } 918 918 919 return (sys _errno_t) rc;919 return (sysarg_t) rc; 920 920 #else 921 return (sys _errno_t) ENOTSUP;921 return (sysarg_t) ENOTSUP; 922 922 #endif 923 923 }
Note:
See TracChangeset
for help on using the changeset viewer.