Changeset 3f35634c in mainline for kernel/generic/src/ipc/sysipc.c
- Timestamp:
- 2009-11-28T20:28:13Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- eb79d60
- Parents:
- 3da11f37 (diff), 2e07d27e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/ipc/sysipc.c
r3da11f37 r3f35634c 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;125 124 default: 126 125 return 0; … … 376 375 phone_t *cloned_phone; 377 376 GET_CHECK_PHONE(cloned_phone, IPC_GET_ARG1(call->data), 378 return ENOENT );377 return ENOENT;); 379 378 phones_lock(cloned_phone, phone); 380 379 if ((cloned_phone->state != IPC_PHONE_CONNECTED) || … … 531 530 unative_t arg1, unative_t arg2, unative_t arg3, ipc_data_t *data) 532 531 { 533 call_t call;532 call_t *call; 534 533 phone_t *phone; 535 534 int res; 536 535 int rc; 537 536 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);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); 545 544 /* 546 545 * To achieve deterministic behavior, zero out arguments that are beyond 547 546 * the limits of the fast version. 548 547 */ 549 IPC_SET_ARG4(call .data, 0);550 IPC_SET_ARG5(call .data, 0);551 552 if (!(res = request_preprocess( &call, phone))) {548 IPC_SET_ARG4(call->data, 0); 549 IPC_SET_ARG5(call->data, 0); 550 551 if (!(res = request_preprocess(call, phone))) { 553 552 #ifdef CONFIG_UDEBUG 554 553 udebug_stoppable_begin(); 555 554 #endif 556 rc = ipc_call_sync(phone, &call);555 rc = ipc_call_sync(phone, call); 557 556 #ifdef CONFIG_UDEBUG 558 557 udebug_stoppable_end(); 559 558 #endif 560 if (rc != EOK) 559 if (rc != EOK) { 560 /* The call will be freed by ipc_cleanup(). */ 561 561 return rc; 562 process_answer(&call); 562 } 563 process_answer(call); 563 564 564 565 } else { 565 IPC_SET_RETVAL(call.data, res); 566 } 567 rc = STRUCT_TO_USPACE(&data->args, &call.data.args); 566 IPC_SET_RETVAL(call->data, res); 567 } 568 rc = STRUCT_TO_USPACE(&data->args, &call->data.args); 569 ipc_call_free(call); 568 570 if (rc != 0) 569 571 return rc; … … 584 586 ipc_data_t *reply) 585 587 { 586 call_t call;588 call_t *call; 587 589 phone_t *phone; 588 590 int res; 589 591 int rc; 590 592 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) 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); 595 600 return (unative_t) rc; 596 597 GET_CHECK_PHONE(phone, phoneid, return ENOENT); 598 599 if (!(res = request_preprocess( &call, phone))) {601 } 602 603 604 if (!(res = request_preprocess(call, phone))) { 600 605 #ifdef CONFIG_UDEBUG 601 606 udebug_stoppable_begin(); 602 607 #endif 603 rc = ipc_call_sync(phone, &call);608 rc = ipc_call_sync(phone, call); 604 609 #ifdef CONFIG_UDEBUG 605 610 udebug_stoppable_end(); 606 611 #endif 607 if (rc != EOK) 612 if (rc != EOK) { 613 /* The call will be freed by ipc_cleanup(). */ 608 614 return rc; 609 process_answer(&call); 615 } 616 process_answer(call); 610 617 } else 611 IPC_SET_RETVAL(call.data, res); 612 613 rc = STRUCT_TO_USPACE(&reply->args, &call.data.args); 618 IPC_SET_RETVAL(call->data, res); 619 620 rc = STRUCT_TO_USPACE(&reply->args, &call->data.args); 621 ipc_call_free(call); 614 622 if (rc != 0) 615 623 return rc; … … 658 666 return IPC_CALLRET_TEMPORARY; 659 667 660 GET_CHECK_PHONE(phone, phoneid, return IPC_CALLRET_FATAL );668 GET_CHECK_PHONE(phone, phoneid, return IPC_CALLRET_FATAL;); 661 669 662 670 call = ipc_call_alloc(0); … … 697 705 return IPC_CALLRET_TEMPORARY; 698 706 699 GET_CHECK_PHONE(phone, phoneid, return IPC_CALLRET_FATAL );707 GET_CHECK_PHONE(phone, phoneid, return IPC_CALLRET_FATAL;); 700 708 701 709 call = ipc_call_alloc(0); … … 747 755 call->flags |= IPC_CALL_FORWARDED; 748 756 749 GET_CHECK_PHONE(phone, phoneid, { 757 GET_CHECK_PHONE(phone, phoneid, { 750 758 IPC_SET_RETVAL(call->data, EFORWARD); 751 759 ipc_answer(&TASK->answerbox, call); … … 952 960 phone_t *phone; 953 961 954 GET_CHECK_PHONE(phone, phoneid, return ENOENT );962 GET_CHECK_PHONE(phone, phoneid, return ENOENT;); 955 963 956 964 if (ipc_phone_hangup(phone)) … … 991 999 992 1000 if (call->flags & IPC_CALL_NOTIF) { 993 ASSERT(! (call->flags & IPC_CALL_STATIC_ALLOC));994 995 1001 /* Set in_phone_hash to the interrupt counter */ 996 1002 call->data.phone = (void *) call->priv; … … 1005 1011 if (call->flags & IPC_CALL_ANSWERED) { 1006 1012 process_answer(call); 1007 1008 ASSERT(! (call->flags & IPC_CALL_STATIC_ALLOC));1009 1013 1010 1014 if (call->flags & IPC_CALL_DISCARD_ANSWER) {
Note:
See TracChangeset
for help on using the changeset viewer.