sched: enforce ref-counting on current task/thread pointers
This commit is contained in:
+4
-2
@@ -217,16 +217,18 @@ static void print_stack_trace(
|
||||
|
||||
void ml_print_stack_trace(uintptr_t ip)
|
||||
{
|
||||
struct task *task = current_task();
|
||||
struct task *task = get_current_task();
|
||||
struct address_space *space = task ? task->t_address_space : NULL;
|
||||
uintptr_t bp;
|
||||
asm volatile("mov %%rbp, %0" : "=r"(bp));
|
||||
print_stack_trace(space, ip, bp);
|
||||
put_current_task(task);
|
||||
}
|
||||
|
||||
void ml_print_stack_trace_irq(struct ml_cpu_context *ctx)
|
||||
{
|
||||
struct task *task = current_task();
|
||||
struct task *task = get_current_task();
|
||||
struct address_space *space = task ? task->t_address_space : NULL;
|
||||
print_stack_trace(space, ctx->rip, ctx->rbp);
|
||||
put_current_task(task);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user