Rev 3606 | Rev 3623 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3606 | Rev 3611 | ||
---|---|---|---|
Line 230... | Line 230... | ||
230 | } |
230 | } |
231 | } |
231 | } |
232 | 232 | ||
233 | /** Upon being scheduled to run, check if the current thread should stop. |
233 | /** Upon being scheduled to run, check if the current thread should stop. |
234 | * |
234 | * |
235 | * This function is called from clock(). Preemption is enabled. |
235 | * This function is called from clock(). |
236 | * interrupts are disabled, but since this is called after |
- | |
237 | * being scheduled-in, we can enable them, if we're careful enough |
- | |
238 | * not to allow arbitrary recursion or deadlock with the thread context. |
- | |
239 | */ |
236 | */ |
240 | void udebug_before_thread_runs(void) |
237 | void udebug_before_thread_runs(void) |
241 | { |
238 | { |
242 | ipl_t ipl; |
- | |
243 | - | ||
244 | return; |
- | |
245 | - | ||
246 | ipl = interrupts_enable(); |
- | |
247 | - | ||
248 | /* Now we're free to do whatever we need (lock mutexes, sleep, etc.) */ |
- | |
249 | - | ||
250 | /* Check if we're supposed to stop */ |
239 | /* Check if we are supposed to stop. */ |
251 | udebug_stoppable_begin(); |
240 | udebug_stoppable_begin(); |
252 | udebug_stoppable_end(); |
241 | udebug_stoppable_end(); |
253 | - | ||
254 | interrupts_restore(ipl); |
- | |
255 | } |
242 | } |
256 | 243 | ||
257 | /** Syscall event hook. |
244 | /** Syscall event hook. |
258 | * |
245 | * |
259 | * Must be called before and after servicing a system call. This generates |
246 | * Must be called before and after servicing a system call. This generates |
Line 439... | Line 426... | ||
439 | mutex_unlock(&THREAD->udebug.lock); |
426 | mutex_unlock(&THREAD->udebug.lock); |
440 | mutex_unlock(&TASK->udebug.lock); |
427 | mutex_unlock(&TASK->udebug.lock); |
441 | return; |
428 | return; |
442 | } |
429 | } |
443 | 430 | ||
444 | printf("udebug_breakpoint/trap_event\n"); |
431 | LOG("udebug_breakpoint/trap_event\n"); |
445 | call = THREAD->udebug.go_call; |
432 | call = THREAD->udebug.go_call; |
446 | THREAD->udebug.go_call = NULL; |
433 | THREAD->udebug.go_call = NULL; |
447 | 434 | ||
448 | IPC_SET_RETVAL(call->data, 0); |
435 | IPC_SET_RETVAL(call->data, 0); |
449 | IPC_SET_ARG1(call->data, etype); |
436 | IPC_SET_ARG1(call->data, etype); |
Line 455... | Line 442... | ||
455 | * point it must be back to the initial true value). |
442 | * point it must be back to the initial true value). |
456 | */ |
443 | */ |
457 | THREAD->udebug.go = false; |
444 | THREAD->udebug.go = false; |
458 | THREAD->udebug.cur_event = etype; |
445 | THREAD->udebug.cur_event = etype; |
459 | 446 | ||
460 | printf("- send answer\n"); |
447 | LOG("- send answer\n"); |
461 | ipc_answer(&TASK->answerbox, call); |
448 | ipc_answer(&TASK->answerbox, call); |
462 | 449 | ||
463 | mutex_unlock(&THREAD->udebug.lock); |
450 | mutex_unlock(&THREAD->udebug.lock); |
464 | mutex_unlock(&TASK->udebug.lock); |
451 | mutex_unlock(&TASK->udebug.lock); |
465 | 452 |