Simplify reschedule points, mail works now!
All checks were successful
Build documentation / build-and-deploy (push) Successful in 2m55s

This commit is contained in:
2026-02-19 18:25:47 +01:00
parent a1730dfdc2
commit 4472ad5bb3
13 changed files with 45 additions and 143 deletions

View File

@@ -37,7 +37,7 @@ uintptr_t amd64_syscall_dispatch (void* stack_ptr) {
return -ST_SYSCALL_NOT_FOUND;
}
struct reschedule_ctx rctx = {.entries = NULL, .lock = SPIN_LOCK_INIT};
struct reschedule_ctx rctx = {.reschedule = false, .cpu = NULL};
uintptr_t r =
func (caller, regs, &rctx, regs->rdi, regs->rsi, regs->rdx, regs->r10, regs->r8, regs->r9);
@@ -50,30 +50,8 @@ uintptr_t amd64_syscall_dispatch (void* stack_ptr) {
spin_unlock (&caller->lock);
}
bool reschedule_thiscpu = false;
spin_lock (&rctx.lock);
struct list_node_link *node, *tmp;
list_foreach (rctx.entries, node, tmp) {
struct reschedule_entry* entry = list_entry (node, struct reschedule_entry, link);
struct cpu* cpu = entry->cpu;
if (cpu != thiscpu) {
cpu_request_sched (cpu);
} else {
reschedule_thiscpu = true;
}
list_remove (rctx.entries, &entry->link);
free (entry);
}
spin_unlock (&rctx.lock);
if (reschedule_thiscpu) {
proc_sched ();
}
if (rctx.reschedule)
cpu_request_sched (rctx.cpu);
return r;
}