Changes in kernel/generic/src/ipc/ipc.c [be06914:6aef742] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/ipc/ipc.c
rbe06914 r6aef742 270 270 * 271 271 */ 272 void ipc_backsend_err(phone_t *phone, call_t *call, unative_t err)272 void ipc_backsend_err(phone_t *phone, call_t *call, sysarg_t err) 273 273 { 274 274 call->data.phone = phone; … … 295 295 atomic_inc(&phone->active_calls); 296 296 call->data.phone = phone; 297 call->data.task = TASK; 297 298 } 298 299 … … 367 368 368 369 call_t *call = ipc_call_alloc(0); 369 IPC_SET_ METHOD(call->data, IPC_M_PHONE_HUNGUP);370 IPC_SET_IMETHOD(call->data, IPC_M_PHONE_HUNGUP); 370 371 call->flags |= IPC_CALL_DISCARD_ANSWER; 371 372 _ipc_call(phone, box, call); … … 406 407 call->caller_phone = call->data.phone; 407 408 call->data.phone = newphone; 409 call->data.task = TASK; 408 410 } 409 411 … … 547 549 * disconnected. 548 550 */ 549 IPC_SET_ METHOD(call->data, IPC_M_PHONE_HUNGUP);551 IPC_SET_IMETHOD(call->data, IPC_M_PHONE_HUNGUP); 550 552 call->flags |= IPC_CALL_DISCARD_ANSWER; 551 553 _ipc_call(phone, box, call); … … 655 657 (call->flags & IPC_CALL_NOTIF)); 656 658 657 /*658 * Record the receipt of this call in the current task's counter659 * of active calls. IPC_M_PHONE_HUNGUP calls do not contribute660 * to this counter so do not record answers to them either.661 */662 if (!(call->flags & IPC_CALL_DISCARD_ANSWER))663 atomic_dec(&TASK->active_calls);664 665 659 ipc_call_free(call); 666 660 } … … 696 690 irq_spinlock_exchange(&tasks_lock, &task->lock); 697 691 698 /* Print opened phones & details */ 699 printf("PHONE:\n"); 692 printf("[phone id] [calls] [state\n"); 700 693 701 694 size_t i; 702 695 for (i = 0; i < IPC_MAX_PHONES; i++) { 703 696 if (SYNCH_FAILED(mutex_trylock(&task->phones[i].lock))) { 704 printf("% d: mutex busy\n", i);697 printf("%-10zu (mutex busy)\n", i); 705 698 continue; 706 699 } 707 700 708 701 if (task->phones[i].state != IPC_PHONE_FREE) { 709 printf("%" PRIs ": ", i); 702 printf("%-10zu %7" PRIun " ", i, 703 atomic_get(&task->phones[i].active_calls)); 710 704 711 705 switch (task->phones[i].state) { 712 706 case IPC_PHONE_CONNECTING: 713 printf("connecting 707 printf("connecting"); 714 708 break; 715 709 case IPC_PHONE_CONNECTED: 716 printf("connected to: %p ", 717 task->phones[i].callee); 710 printf("connected to %" PRIu64 " (%s)", 711 task->phones[i].callee->task->taskid, 712 task->phones[i].callee->task->name); 718 713 break; 719 714 case IPC_PHONE_SLAMMED: 720 printf("slammed by : %p ",715 printf("slammed by %p", 721 716 task->phones[i].callee); 722 717 break; 723 718 case IPC_PHONE_HUNGUP: 724 printf("hung up - was: %p ",719 printf("hung up by %p", 725 720 task->phones[i].callee); 726 721 break; … … 729 724 } 730 725 731 printf("active: %" PRIun "\n", 732 atomic_get(&task->phones[i].active_calls)); 726 printf("\n"); 733 727 } 734 728 … … 738 732 irq_spinlock_lock(&task->answerbox.lock, false); 739 733 734 #ifdef __32_BITS__ 735 printf("[call id ] [method] [arg1] [arg2] [arg3] [arg4] [arg5]" 736 " [flags] [sender\n"); 737 #endif 738 739 #ifdef __64_BITS__ 740 printf("[call id ] [method] [arg1] [arg2] [arg3] [arg4]" 741 " [arg5] [flags] [sender\n"); 742 #endif 743 740 744 link_t *cur; 741 745 742 /* Print answerbox - calls */ 743 printf("ABOX - CALLS:\n"); 746 printf(" --- incomming calls ---\n"); 744 747 for (cur = task->answerbox.calls.next; cur != &task->answerbox.calls; 745 748 cur = cur->next) { 746 749 call_t *call = list_get_instance(cur, call_t, link); 747 printf("Callid: %p Srctask:%" PRIu64 " M:%" PRIun 748 " A1:%" PRIun " A2:%" PRIun " A3:%" PRIun 749 " A4:%" PRIun " A5:%" PRIun " Flags:%x\n", call, 750 call->sender->taskid, 751 IPC_GET_METHOD(call->data), IPC_GET_ARG1(call->data), 750 751 #ifdef __32_BITS__ 752 printf("%10p ", call); 753 #endif 754 755 #ifdef __64_BITS__ 756 printf("%18p ", call); 757 #endif 758 759 printf("%-8" PRIun " %-6" PRIun " %-6" PRIun " %-6" PRIun 760 " %-6" PRIun " %-6" PRIun " %-7x %" PRIu64 " (%s)\n", 761 IPC_GET_IMETHOD(call->data), IPC_GET_ARG1(call->data), 752 762 IPC_GET_ARG2(call->data), IPC_GET_ARG3(call->data), 753 763 IPC_GET_ARG4(call->data), IPC_GET_ARG5(call->data), 754 call->flags); 755 } 756 757 /* Print answerbox - dispatched calls */ 758 printf("ABOX - DISPATCHED CALLS:\n"); 764 call->flags, call->sender->taskid, call->sender->name); 765 } 766 767 printf(" --- dispatched calls ---\n"); 759 768 for (cur = task->answerbox.dispatched_calls.next; 760 769 cur != &task->answerbox.dispatched_calls; 761 770 cur = cur->next) { 762 771 call_t *call = list_get_instance(cur, call_t, link); 763 printf("Callid: %p Srctask:%" PRIu64 " M:%" PRIun 764 " A1:%" PRIun " A2:%" PRIun " A3:%" PRIun 765 " A4:%" PRIun " A5:%" PRIun " Flags:%x\n", call, 766 call->sender->taskid, 767 IPC_GET_METHOD(call->data), IPC_GET_ARG1(call->data), 772 773 #ifdef __32_BITS__ 774 printf("%10p ", call); 775 #endif 776 777 #ifdef __64_BITS__ 778 printf("%18p ", call); 779 #endif 780 781 printf("%-8" PRIun " %-6" PRIun " %-6" PRIun " %-6" PRIun 782 " %-6" PRIun " %-6" PRIun " %-7x %" PRIu64 " (%s)\n", 783 IPC_GET_IMETHOD(call->data), IPC_GET_ARG1(call->data), 768 784 IPC_GET_ARG2(call->data), IPC_GET_ARG3(call->data), 769 785 IPC_GET_ARG4(call->data), IPC_GET_ARG5(call->data), 770 call->flags); 771 } 772 773 /* Print answerbox - answers */ 774 printf("ABOX - ANSWERS:\n"); 786 call->flags, call->sender->taskid, call->sender->name); 787 } 788 789 printf(" --- incoming answers ---\n"); 775 790 for (cur = task->answerbox.answers.next; 776 791 cur != &task->answerbox.answers; 777 792 cur = cur->next) { 778 793 call_t *call = list_get_instance(cur, call_t, link); 779 printf("Callid:%p M:%" PRIun " A1:%" PRIun " A2:%" PRIun 780 " A3:%" PRIun " A4:%" PRIun " A5:%" PRIun " Flags:%x\n", 781 call, IPC_GET_METHOD(call->data), IPC_GET_ARG1(call->data), 794 795 #ifdef __32_BITS__ 796 printf("%10p ", call); 797 #endif 798 799 #ifdef __64_BITS__ 800 printf("%18p ", call); 801 #endif 802 803 printf("%-8" PRIun " %-6" PRIun " %-6" PRIun " %-6" PRIun 804 " %-6" PRIun " %-6" PRIun " %-7x %" PRIu64 " (%s)\n", 805 IPC_GET_IMETHOD(call->data), IPC_GET_ARG1(call->data), 782 806 IPC_GET_ARG2(call->data), IPC_GET_ARG3(call->data), 783 807 IPC_GET_ARG4(call->data), IPC_GET_ARG5(call->data), 784 call->flags );808 call->flags, call->sender->taskid, call->sender->name); 785 809 } 786 810
Note:
See TracChangeset
for help on using the changeset viewer.