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