Changes in kernel/generic/src/ipc/sysipc.c [33adc6ce:057d21a] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/ipc/sysipc.c
r33adc6ce r057d21a 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 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);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); 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) { 561 /* The call will be freed by ipc_cleanup(). */ 560 if (rc != EOK) 562 561 return rc; 563 } 564 process_answer(call); 562 process_answer(&call); 565 563 566 564 } else { 567 IPC_SET_RETVAL(call->data, res); 568 } 569 rc = STRUCT_TO_USPACE(&data->args, &call->data.args); 570 ipc_call_free(call); 565 IPC_SET_RETVAL(call.data, res); 566 } 567 rc = STRUCT_TO_USPACE(&data->args, &call.data.args); 571 568 if (rc != 0) 572 569 return rc; … … 587 584 ipc_data_t *reply) 588 585 { 589 call_t *call;586 call_t call; 590 587 phone_t *phone; 591 588 int res; 592 589 int rc; 593 590 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) 595 return (unative_t) rc; 596 594 597 GET_CHECK_PHONE(phone, phoneid, return ENOENT); 595 598 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); 601 return (unative_t) rc; 602 } 603 604 605 if (!(res = request_preprocess(call, phone))) { 599 if (!(res = request_preprocess(&call, phone))) { 606 600 #ifdef CONFIG_UDEBUG 607 601 udebug_stoppable_begin(); 608 602 #endif 609 rc = ipc_call_sync(phone, call);603 rc = ipc_call_sync(phone, &call); 610 604 #ifdef CONFIG_UDEBUG 611 605 udebug_stoppable_end(); 612 606 #endif 613 if (rc != EOK) { 614 /* The call will be freed by ipc_cleanup(). */ 607 if (rc != EOK) 615 608 return rc; 616 } 617 process_answer(call); 609 process_answer(&call); 618 610 } else 619 IPC_SET_RETVAL(call->data, res); 620 621 rc = STRUCT_TO_USPACE(&reply->args, &call->data.args); 622 ipc_call_free(call); 611 IPC_SET_RETVAL(call.data, res); 612 613 rc = STRUCT_TO_USPACE(&reply->args, &call.data.args); 623 614 if (rc != 0) 624 615 return rc; … … 1000 991 1001 992 if (call->flags & IPC_CALL_NOTIF) { 993 ASSERT(! (call->flags & IPC_CALL_STATIC_ALLOC)); 994 1002 995 /* Set in_phone_hash to the interrupt counter */ 1003 996 call->data.phone = (void *) call->priv; … … 1012 1005 if (call->flags & IPC_CALL_ANSWERED) { 1013 1006 process_answer(call); 1007 1008 ASSERT(! (call->flags & IPC_CALL_STATIC_ALLOC)); 1014 1009 1015 1010 if (call->flags & IPC_CALL_DISCARD_ANSWER) {
Note:
See TracChangeset
for help on using the changeset viewer.