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
+6 -6
View File
@@ -496,11 +496,7 @@ kern_status_t pmap_handle_fault(
{
// log_fault(fault_addr, flags);
if (flags & PMAP_FAULT_PRESENT) {
return KERN_FATAL_ERROR;
}
struct task *task = current_task();
struct task *task = get_current_task();
if (!task) {
return KERN_FATAL_ERROR;
}
@@ -511,7 +507,11 @@ kern_status_t pmap_handle_fault(
}
/* this must be called with `space` unlocked. */
return address_space_demand_map(space, fault_addr, flags);
kern_status_t status
= address_space_demand_map(space, fault_addr, flags);
put_current_task(task);
return status;
}
kern_status_t pmap_add(