Changes in kernel/generic/src/ipc/sysipc.c [20c7c40:057d21a] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/ipc/sysipc.c
r20c7c40 r057d21a 61 61 { \ 62 62 if (phoneid > IPC_MAX_PHONES) { \ 63 err \63 err; \ 64 64 } \ 65 65 phone = &TASK->phones[phoneid]; \ … … 122 122 case IPC_M_DATA_READ: 123 123 return 1; 124 break; 124 125 default: 125 126 return 0; … … 375 376 phone_t *cloned_phone; 376 377 GET_CHECK_PHONE(cloned_phone, IPC_GET_ARG1(call->data), 377 return ENOENT ;);378 return ENOENT); 378 379 phones_lock(cloned_phone, phone); 379 380 if ((cloned_phone->state != IPC_PHONE_CONNECTED) || … … 530 531 unative_t arg1, unative_t arg2, unative_t arg3, ipc_data_t *data) 531 532 { 532 call_t *call;533 call_t call; 533 534 phone_t *phone; 534 535 int res; 535 536 int rc; 536 537 537 GET_CHECK_PHONE(phone, phoneid, return ENOENT ;);538 539 call = ipc_call_alloc(0);540 IPC_SET_METHOD(call ->data, method);541 IPC_SET_ARG1(call ->data, arg1);542 IPC_SET_ARG2(call ->data, arg2);543 IPC_SET_ARG3(call ->data, arg3);538 GET_CHECK_PHONE(phone, phoneid, return ENOENT); 539 540 ipc_call_static_init(&call); 541 IPC_SET_METHOD(call.data, method); 542 IPC_SET_ARG1(call.data, arg1); 543 IPC_SET_ARG2(call.data, arg2); 544 IPC_SET_ARG3(call.data, arg3); 544 545 /* 545 546 * To achieve deterministic behavior, zero out arguments that are beyond 546 547 * the limits of the fast version. 547 548 */ 548 IPC_SET_ARG4(call ->data, 0);549 IPC_SET_ARG5(call ->data, 0);550 551 if (!(res = request_preprocess( call, phone))) {549 IPC_SET_ARG4(call.data, 0); 550 IPC_SET_ARG5(call.data, 0); 551 552 if (!(res = request_preprocess(&call, phone))) { 552 553 #ifdef CONFIG_UDEBUG 553 554 udebug_stoppable_begin(); 554 555 #endif 555 rc = ipc_call_sync(phone, call);556 rc = ipc_call_sync(phone, &call); 556 557 #ifdef CONFIG_UDEBUG 557 558 udebug_stoppable_end(); 558 559 #endif 559 if (rc != EOK) { 560 /* The call will be freed by ipc_cleanup(). */ 560 if (rc != EOK) 561 561 return rc; 562 } 563 process_answer(call); 562 process_answer(&call); 564 563 565 564 } else { 566 IPC_SET_RETVAL(call->data, res); 567 } 568 rc = STRUCT_TO_USPACE(&data->args, &call->data.args); 569 ipc_call_free(call); 565 IPC_SET_RETVAL(call.data, res); 566 } 567 rc = STRUCT_TO_USPACE(&data->args, &call.data.args); 570 568 if (rc != 0) 571 569 return rc; … … 586 584 ipc_data_t *reply) 587 585 { 588 call_t *call;586 call_t call; 589 587 phone_t *phone; 590 588 int res; 591 589 int rc; 592 590 593 GET_CHECK_PHONE(phone, phoneid, return ENOENT;); 594 595 call = ipc_call_alloc(0); 596 rc = copy_from_uspace(&call->data.args, &question->args, 597 sizeof(call->data.args)); 598 if (rc != 0) { 599 ipc_call_free(call); 591 ipc_call_static_init(&call); 592 rc = copy_from_uspace(&call.data.args, &question->args, 593 sizeof(call.data.args)); 594 if (rc != 0) 600 595 return (unative_t) rc; 601 } 602 603 604 if (!(res = request_preprocess( call, phone))) {596 597 GET_CHECK_PHONE(phone, phoneid, return ENOENT); 598 599 if (!(res = request_preprocess(&call, phone))) { 605 600 #ifdef CONFIG_UDEBUG 606 601 udebug_stoppable_begin(); 607 602 #endif 608 rc = ipc_call_sync(phone, call);603 rc = ipc_call_sync(phone, &call); 609 604 #ifdef CONFIG_UDEBUG 610 605 udebug_stoppable_end(); 611 606 #endif 612 if (rc != EOK) { 613 /* The call will be freed by ipc_cleanup(). */ 607 if (rc != EOK) 614 608 return rc; 615 } 616 process_answer(call); 609 process_answer(&call); 617 610 } else 618 IPC_SET_RETVAL(call->data, res); 619 620 rc = STRUCT_TO_USPACE(&reply->args, &call->data.args); 621 ipc_call_free(call); 611 IPC_SET_RETVAL(call.data, res); 612 613 rc = STRUCT_TO_USPACE(&reply->args, &call.data.args); 622 614 if (rc != 0) 623 615 return rc; … … 666 658 return IPC_CALLRET_TEMPORARY; 667 659 668 GET_CHECK_PHONE(phone, phoneid, return IPC_CALLRET_FATAL ;);660 GET_CHECK_PHONE(phone, phoneid, return IPC_CALLRET_FATAL); 669 661 670 662 call = ipc_call_alloc(0); … … 705 697 return IPC_CALLRET_TEMPORARY; 706 698 707 GET_CHECK_PHONE(phone, phoneid, return IPC_CALLRET_FATAL ;);699 GET_CHECK_PHONE(phone, phoneid, return IPC_CALLRET_FATAL); 708 700 709 701 call = ipc_call_alloc(0); … … 755 747 call->flags |= IPC_CALL_FORWARDED; 756 748 757 GET_CHECK_PHONE(phone, phoneid, { 749 GET_CHECK_PHONE(phone, phoneid, { 758 750 IPC_SET_RETVAL(call->data, EFORWARD); 759 751 ipc_answer(&TASK->answerbox, call); … … 960 952 phone_t *phone; 961 953 962 GET_CHECK_PHONE(phone, phoneid, return ENOENT ;);954 GET_CHECK_PHONE(phone, phoneid, return ENOENT); 963 955 964 956 if (ipc_phone_hangup(phone)) … … 999 991 1000 992 if (call->flags & IPC_CALL_NOTIF) { 993 ASSERT(! (call->flags & IPC_CALL_STATIC_ALLOC)); 994 1001 995 /* Set in_phone_hash to the interrupt counter */ 1002 996 call->data.phone = (void *) call->priv; … … 1011 1005 if (call->flags & IPC_CALL_ANSWERED) { 1012 1006 process_answer(call); 1007 1008 ASSERT(! (call->flags & IPC_CALL_STATIC_ALLOC)); 1013 1009 1014 1010 if (call->flags & IPC_CALL_DISCARD_ANSWER) {
Note:
See TracChangeset
for help on using the changeset viewer.