Changeset 35bb2e7 in mainline
- Timestamp:
- 2009-11-19T21:02:52Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4ca28512
- Parents:
- 4e739652
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/ipc/sysipc.c
r4e739652 r35bb2e7 531 531 unative_t arg1, unative_t arg2, unative_t arg3, ipc_data_t *data) 532 532 { 533 call_t call;533 call_t *call; 534 534 phone_t *phone; 535 535 int res; … … 538 538 GET_CHECK_PHONE(phone, phoneid, return ENOENT); 539 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);540 call = ipc_call_alloc(0); 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); 545 545 /* 546 546 * To achieve deterministic behavior, zero out arguments that are beyond 547 547 * the limits of the fast version. 548 548 */ 549 IPC_SET_ARG4(call .data, 0);550 IPC_SET_ARG5(call .data, 0);551 552 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))) { 553 553 #ifdef CONFIG_UDEBUG 554 554 udebug_stoppable_begin(); 555 555 #endif 556 rc = ipc_call_sync(phone, &call);556 rc = ipc_call_sync(phone, call); 557 557 #ifdef CONFIG_UDEBUG 558 558 udebug_stoppable_end(); 559 559 #endif 560 if (rc != EOK) 560 if (rc != EOK) { 561 /* The call will be freed by someone else. */ 561 562 return rc; 562 process_answer(&call); 563 } 564 process_answer(call); 563 565 564 566 } else { 565 IPC_SET_RETVAL(call.data, res); 566 } 567 rc = STRUCT_TO_USPACE(&data->args, &call.data.args); 567 IPC_SET_RETVAL(call->data, res); 568 } 569 rc = STRUCT_TO_USPACE(&data->args, &call->data.args); 570 ipc_call_free(call); 568 571 if (rc != 0) 569 572 return rc; … … 584 587 ipc_data_t *reply) 585 588 { 586 call_t call;589 call_t *call; 587 590 phone_t *phone; 588 591 int res; 589 592 int rc; 590 593 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) 594 GET_CHECK_PHONE(phone, phoneid, return ENOENT); 595 596 call = ipc_call_alloc(0); 597 rc = copy_from_uspace(&call->data.args, &question->args, 598 sizeof(call->data.args)); 599 if (rc != 0) { 600 ipc_call_free(call); 595 601 return (unative_t) rc; 596 597 GET_CHECK_PHONE(phone, phoneid, return ENOENT); 598 599 if (!(res = request_preprocess( &call, phone))) {602 } 603 604 605 if (!(res = request_preprocess(call, phone))) { 600 606 #ifdef CONFIG_UDEBUG 601 607 udebug_stoppable_begin(); 602 608 #endif 603 rc = ipc_call_sync(phone, &call);609 rc = ipc_call_sync(phone, call); 604 610 #ifdef CONFIG_UDEBUG 605 611 udebug_stoppable_end(); 606 612 #endif 607 if (rc != EOK) 613 if (rc != EOK) { 614 /* The call will be freed by someone else. */ 608 615 return rc; 609 process_answer(&call); 616 } 617 process_answer(call); 610 618 } else 611 IPC_SET_RETVAL(call.data, res); 612 613 rc = STRUCT_TO_USPACE(&reply->args, &call.data.args); 619 IPC_SET_RETVAL(call->data, res); 620 621 rc = STRUCT_TO_USPACE(&reply->args, &call->data.args); 622 ipc_call_free(call); 614 623 if (rc != 0) 615 624 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.