Subversion Repositories HelenOS

Rev

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

Rev 3425 Rev 3431
Line 454... Line 454...
454
    phone_t *phone;
454
    phone_t *phone;
455
    DEADLOCK_PROBE_INIT(p_phonelck);
455
    DEADLOCK_PROBE_INIT(p_phonelck);
456
    ipl_t ipl;
456
    ipl_t ipl;
457
    call_t *call;
457
    call_t *call;
458
 
458
 
459
    call = ipc_call_alloc(0);
459
    call = notify_box ? ipc_call_alloc(0) : NULL;
460
 
460
 
461
    /* Disconnect all phones connected to our answerbox */
461
    /* Disconnect all phones connected to our answerbox */
462
restart_phones:
462
restart_phones:
463
    ipl = interrupts_disable();
463
    ipl = interrupts_disable();
464
    spinlock_lock(&box->lock);
464
    spinlock_lock(&box->lock);
Line 508... Line 508...
508
 
508
 
509
    /* Free unused call */
509
    /* Free unused call */
510
    if (call) ipc_call_free(call);
510
    if (call) ipc_call_free(call);
511
}
511
}
512
 
512
 
-
 
513
#ifdef CONFIG_UDEBUG
-
 
514
 
513
static void ipc_kbox_cleanup()
515
static void ipc_kbox_cleanup()
514
{
516
{
515
    bool have_kb_thread;
517
    bool have_kb_thread;
516
 
518
 
517
    /* Only hold kb_cleanup_lock while setting kb_finished - this is enough */
519
    /* Only hold kb_cleanup_lock while setting kb_finished - this is enough */
Line 544... Line 546...
544
    ipc_cleanup_call_list(&TASK->kernel_box.dispatched_calls);
546
    ipc_cleanup_call_list(&TASK->kernel_box.dispatched_calls);
545
    ipc_cleanup_call_list(&TASK->kernel_box.calls);
547
    ipc_cleanup_call_list(&TASK->kernel_box.calls);
546
    spinlock_unlock(&TASK->kernel_box.lock);
548
    spinlock_unlock(&TASK->kernel_box.lock);
547
}
549
}
548
 
550
 
-
 
551
#endif
549
 
552
 
550
/** Cleans up all IPC communication of the current task.
553
/** Cleans up all IPC communication of the current task.
551
 *
554
 *
552
 * Note: ipc_hangup sets returning answerbox to TASK->answerbox, you
555
 * Note: ipc_hangup sets returning answerbox to TASK->answerbox, you
553
 * have to change it as well if you want to cleanup other tasks than TASK.
556
 * have to change it as well if you want to cleanup other tasks than TASK.
Line 565... Line 568...
565
    ipc_irq_cleanup(&TASK->answerbox);
568
    ipc_irq_cleanup(&TASK->answerbox);
566
 
569
 
567
    /* Disconnect all phones connected to our regular answerbox */
570
    /* Disconnect all phones connected to our regular answerbox */
568
    ipc_answerbox_slam_phones(&TASK->answerbox, false);
571
    ipc_answerbox_slam_phones(&TASK->answerbox, false);
569
 
572
 
-
 
573
#ifdef CONFIG_UDEBUG
570
    /* Clean up kbox thread and communications */
574
    /* Clean up kbox thread and communications */
571
    ipc_kbox_cleanup();
575
    ipc_kbox_cleanup();
-
 
576
#endif
572
 
577
 
573
    /* Answer all messages in 'calls' and 'dispatched_calls' queues */
578
    /* Answer all messages in 'calls' and 'dispatched_calls' queues */
574
    spinlock_lock(&TASK->answerbox.lock);
579
    spinlock_lock(&TASK->answerbox.lock);
575
    ipc_cleanup_call_list(&TASK->answerbox.dispatched_calls);
580
    ipc_cleanup_call_list(&TASK->answerbox.dispatched_calls);
576
    ipc_cleanup_call_list(&TASK->answerbox.calls);
581
    ipc_cleanup_call_list(&TASK->answerbox.calls);
Line 721... Line 726...
721
 
726
 
722
    spinlock_unlock(&task->answerbox.lock);
727
    spinlock_unlock(&task->answerbox.lock);
723
    spinlock_unlock(&task->lock);
728
    spinlock_unlock(&task->lock);
724
}
729
}
725
 
730
 
-
 
731
#ifdef CONFIG_UDEBUG
-
 
732
 
726
#include <ipc/ipcrsc.h>
733
#include <ipc/ipcrsc.h>
727
#include <print.h>
734
#include <print.h>
728
#include <udebug/udebug_ipc.h>
735
#include <udebug/udebug_ipc.h>
729
 
736
 
730
static void kbox_thread_proc(void *arg)
737
static void kbox_thread_proc(void *arg)
Line 862... Line 869...
862
    mutex_unlock(&ta->kb_cleanup_lock);
869
    mutex_unlock(&ta->kb_cleanup_lock);
863
 
870
 
864
    return newphid;
871
    return newphid;
865
}
872
}
866
 
873
 
-
 
874
#endif /* defined(CONFIG_UDEBUG) */
-
 
875
 
867
/** @}
876
/** @}
868
 */
877
 */