Subversion Repositories HelenOS

Rev

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

Rev 2834 Rev 2848
Line 75... Line 75...
75
{
75
{
76
    call_t *call;
76
    call_t *call;
77
    ipl_t ipl;
77
    ipl_t ipl;
78
 
78
 
79
    ipl = interrupts_disable();
79
    ipl = interrupts_disable();
80
    spinlock_lock(&THREAD->lock);
80
    spinlock_lock(&THREAD->debug_lock);
81
 
81
 
82
    if (THREAD->debug_active == true) {
82
    if (THREAD->debug_active == true) {
83
        klog_printf("udebug_syscall_event");
83
        klog_printf("udebug_syscall_event");
84
        call = THREAD->debug_go_call;
84
        call = THREAD->debug_go_call;
85
        IPC_SET_RETVAL(call->data, 0);
85
        IPC_SET_RETVAL(call->data, 0);
Line 99... Line 99...
99
         * Make sure debug_stop is true when going to sleep
99
         * Make sure debug_stop is true when going to sleep
100
         * in case we get woken up by DEBUG_END. (At which
100
         * in case we get woken up by DEBUG_END. (At which
101
         * point it must be back to the initial true value).
101
         * point it must be back to the initial true value).
102
         */
102
         */
103
        THREAD->debug_stop = true;
103
        THREAD->debug_stop = true;
104
        spinlock_unlock(&THREAD->lock);
104
        spinlock_unlock(&THREAD->debug_lock);
105
 
105
 
106
        spinlock_lock(&TASK->lock);
106
        spinlock_lock(&TASK->lock);
107
        ipc_answer(&TASK->answerbox, THREAD->debug_go_call);
107
        ipc_answer(&TASK->answerbox, THREAD->debug_go_call);
108
        spinlock_unlock(&TASK->lock);
108
        spinlock_unlock(&TASK->lock);
109
 
109
 
110
        interrupts_restore(ipl);
110
        interrupts_restore(ipl);
111
 
111
 
112
        waitq_sleep(&THREAD->go_wq);
112
        waitq_sleep(&THREAD->go_wq);
113
    } else {
113
    } else {
114
        spinlock_unlock(&THREAD->lock);
114
        spinlock_unlock(&THREAD->debug_lock);
115
        interrupts_restore(ipl);
115
        interrupts_restore(ipl);
116
    }
116
    }
117
}
117
}
118
 
118
 
119
/** @}
119
/** @}