sched: enforce ref-counting on current task/thread pointers

This commit is contained in:
2026-04-01 18:17:05 +01:00
parent 15c2207ab9
commit 512356ac2d
28 changed files with 364 additions and 103 deletions
+5 -2
View File
@@ -19,8 +19,8 @@ void panic_irq(struct ml_cpu_context *ctx, const char *fmt, ...)
printk("---[ kernel panic: %s", buf);
printk("kernel: " BUILD_ID ", compiler version: " __VERSION__);
struct task *task = current_task();
struct thread *thr = current_thread();
struct task *task = get_current_task();
struct thread *thr = get_current_thread();
if (task && thr) {
printk("task: %s (id: %d, thread: %d)",
@@ -31,6 +31,9 @@ void panic_irq(struct ml_cpu_context *ctx, const char *fmt, ...)
printk("task: [bootstrap]");
}
put_current_thread(thr);
put_current_task(task);
printk("cpu: %u", this_cpu());
ml_print_cpu_state(ctx);