Simplify reschedule points, mail works now!
All checks were successful
Build documentation / build-and-deploy (push) Successful in 2m55s
All checks were successful
Build documentation / build-and-deploy (push) Successful in 2m55s
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user