Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 2822 → Rev 2823

/branches/tracing/kernel/generic/src/udebug/udebug.c
16,7 → 16,9
{
int nsc;
call_t *db_call;
ipl_t ipl;
 
ipl = interrupts_disable();
spinlock_lock(&TASK->lock);
 
nsc = --TASK->not_stoppable_count;
31,6 → 33,7
TASK->stop_request = false;
TASK->debug_begin_call = NULL;
spinlock_unlock(&TASK->lock);
interrupts_restore(ipl);
 
IPC_SET_RETVAL(db_call->data, 0);
klog_printf("udebug_stoppable_begin/ipc_answer");
37,17 → 40,23
ipc_answer(&TASK->answerbox, db_call);
} else {
spinlock_unlock(&TASK->lock);
interrupts_restore(ipl);
}
}
 
void udebug_stoppable_end(void)
{
ipl_t ipl;
 
restart:
ipl = interrupts_disable();
spinlock_lock(&TASK->lock);
 
if (TASK->stop_request) {
TASK->debug_begin_call = NULL;
spinlock_unlock(&TASK->lock);
interrupts_restore(ipl);
 
klog_printf("udebug_stoppable_end: waitq_sleep");
waitq_sleep(&THREAD->go_wq);
goto restart;
55,6 → 64,7
} else {
++TASK->not_stoppable_count;
spinlock_unlock(&TASK->lock);
interrupts_restore(ipl);
}
}
 
62,10 → 72,13
unative_t a4, unative_t a5, unative_t a6, unative_t id, unative_t rc)
{
call_t *call;
ipl_t ipl;
 
ipl = interrupts_disable();
spinlock_lock(&TASK->lock);
 
/* being debugged + have go */
if (TASK->being_debugged && !TASK->stop_request) { /* locking! */
if (TASK->being_debugged && !TASK->stop_request) {
klog_printf("udebug_syscall_event");
call = TASK->debug_go_call;
IPC_SET_RETVAL(call->data, 0);
83,9 → 96,12
 
ipc_answer(&TASK->answerbox, TASK->debug_go_call);
spinlock_unlock(&TASK->lock);
interrupts_restore(ipl);
 
waitq_sleep(&THREAD->go_wq);
} else {
spinlock_unlock(&TASK->lock);
interrupts_restore(ipl);
}
}