Subversion Repositories HelenOS

Rev

Rev 2471 | Rev 2494 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2471 Rev 2472
Line 98... Line 98...
98
{
98
{
99
    _ipc_call_init(call);
99
    _ipc_call_init(call);
100
    call->flags |= IPC_CALL_STATIC_ALLOC;
100
    call->flags |= IPC_CALL_STATIC_ALLOC;
101
}
101
}
102
 
102
 
103
/** Deallocate a call stracuture.
103
/** Deallocate a call structure.
104
 *
104
 *
105
 * @param call      Call structure to be freed.
105
 * @param call      Call structure to be freed.
106
 */
106
 */
107
void ipc_call_free(call_t *call)
107
void ipc_call_free(call_t *call)
108
{
108
{
Line 434... Line 434...
434
restart_phones:
434
restart_phones:
435
    spinlock_lock(&TASK->answerbox.lock);
435
    spinlock_lock(&TASK->answerbox.lock);
436
    while (!list_empty(&TASK->answerbox.connected_phones)) {
436
    while (!list_empty(&TASK->answerbox.connected_phones)) {
437
        phone = list_get_instance(TASK->answerbox.connected_phones.next,
437
        phone = list_get_instance(TASK->answerbox.connected_phones.next,
438
            phone_t, link);
438
            phone_t, link);
439
        if (! spinlock_trylock(&phone->lock)) {
439
        if (!spinlock_trylock(&phone->lock)) {
440
            spinlock_unlock(&TASK->answerbox.lock);
440
            spinlock_unlock(&TASK->answerbox.lock);
441
            DEADLOCK_PROBE(p_phonelck, DEADLOCK_THRESHOLD);
441
            DEADLOCK_PROBE(p_phonelck, DEADLOCK_THRESHOLD);
442
            goto restart_phones;
442
            goto restart_phones;
443
        }
443
        }
444
       
444
       
Line 542... Line 542...
542
                       task->phones[i].callee);
542
                       task->phones[i].callee);
543
                break;
543
                break;
544
            default:
544
            default:
545
                break;
545
                break;
546
            }
546
            }
-
 
547
            printf("active: %d\n",
547
            printf("active: %d\n", atomic_get(&task->phones[i].active_calls));
548
                atomic_get(&task->phones[i].active_calls));
548
        }
549
        }
549
        spinlock_unlock(&task->phones[i].lock);
550
        spinlock_unlock(&task->phones[i].lock);
550
    }
551
    }
551
 
552
 
552
 
553
 
553
    /* Print answerbox - calls */
554
    /* Print answerbox - calls */
554
    spinlock_lock(&task->answerbox.lock);
555
    spinlock_lock(&task->answerbox.lock);
555
    printf("ABOX - CALLS:\n");
556
    printf("ABOX - CALLS:\n");
556
    for (tmp=task->answerbox.calls.next; tmp != &task->answerbox.calls;tmp = tmp->next) {
557
    for (tmp = task->answerbox.calls.next; tmp != &task->answerbox.calls;
-
 
558
        tmp = tmp->next) {
557
        call = list_get_instance(tmp, call_t, link);
559
        call = list_get_instance(tmp, call_t, link);
558
        printf("Callid: %p Srctask:%llu M:%d A1:%d A2:%d A3:%d Flags:%x\n",call,
560
        printf("Callid: %p Srctask:%llu M:%d A1:%d A2:%d A3:%d "
-
 
561
            "Flags:%x\n", call, call->sender->taskid,
559
               call->sender->taskid, IPC_GET_METHOD(call->data), IPC_GET_ARG1(call->data),
562
            IPC_GET_METHOD(call->data), IPC_GET_ARG1(call->data),
560
               IPC_GET_ARG2(call->data), IPC_GET_ARG3(call->data), call->flags);
563
            IPC_GET_ARG2(call->data), IPC_GET_ARG3(call->data),
-
 
564
            call->flags);
561
    }
565
    }
562
    /* Print answerbox - calls */
566
    /* Print answerbox - calls */
563
    printf("ABOX - DISPATCHED CALLS:\n");
567
    printf("ABOX - DISPATCHED CALLS:\n");
564
    for (tmp=task->answerbox.dispatched_calls.next;
568
    for (tmp=task->answerbox.dispatched_calls.next;
565
         tmp != &task->answerbox.dispatched_calls;
569
         tmp != &task->answerbox.dispatched_calls;
566
         tmp = tmp->next) {
570
         tmp = tmp->next) {
567
        call = list_get_instance(tmp, call_t, link);
571
        call = list_get_instance(tmp, call_t, link);
568
        printf("Callid: %p Srctask:%llu M:%d A1:%d A2:%d A3:%d Flags:%x\n",call,
572
        printf("Callid: %p Srctask:%llu M:%d A1:%d A2:%d A3:%d "
-
 
573
            "Flags:%x\n", call, call->sender->taskid,
569
               call->sender->taskid, IPC_GET_METHOD(call->data), IPC_GET_ARG1(call->data),
574
            IPC_GET_METHOD(call->data), IPC_GET_ARG1(call->data),
570
               IPC_GET_ARG2(call->data), IPC_GET_ARG3(call->data), call->flags);
575
            IPC_GET_ARG2(call->data), IPC_GET_ARG3(call->data),
-
 
576
            call->flags);
571
    }
577
    }
572
    /* Print answerbox - calls */
578
    /* Print answerbox - calls */
573
    printf("ABOX - ANSWERS:\n");
579
    printf("ABOX - ANSWERS:\n");
574
    for (tmp=task->answerbox.answers.next; tmp != &task->answerbox.answers; tmp = tmp->next) {
580
    for (tmp = task->answerbox.answers.next; tmp != &task->answerbox.answers;
-
 
581
        tmp = tmp->next) {
575
        call = list_get_instance(tmp, call_t, link);
582
        call = list_get_instance(tmp, call_t, link);
576
        printf("Callid:%p M:%d A1:%d A2:%d A3:%d Flags:%x\n",call,
583
        printf("Callid:%p M:%d A1:%d A2:%d A3:%d Flags:%x\n", call,
577
               IPC_GET_METHOD(call->data), IPC_GET_ARG1(call->data),
584
            IPC_GET_METHOD(call->data), IPC_GET_ARG1(call->data),
578
               IPC_GET_ARG2(call->data), IPC_GET_ARG3(call->data), call->flags);
585
            IPC_GET_ARG2(call->data), IPC_GET_ARG3(call->data),
-
 
586
            call->flags);
579
    }
587
    }
580
 
588
 
581
    spinlock_unlock(&task->answerbox.lock);
589
    spinlock_unlock(&task->answerbox.lock);
582
    spinlock_unlock(&task->lock);
590
    spinlock_unlock(&task->lock);
583
}
591
}