Implement waiting for process, CE add command cancelation, rctx many cpus
All checks were successful
Build documentation / build-and-deploy (push) Successful in 2m27s

This commit is contained in:
2026-03-01 22:59:04 +01:00
parent 858e55118b
commit 9043c4f9ec
18 changed files with 308 additions and 89 deletions

View File

@@ -3,6 +3,7 @@
#include <amd64/mm.h>
#include <amd64/msr-index.h>
#include <amd64/msr.h>
#include <libk/lengthof.h>
#include <libk/list.h>
#include <libk/string.h>
#include <mm/liballoc.h>
@@ -37,7 +38,7 @@ uintptr_t syscall_dispatch (void* stack_ptr) {
return -ST_SYSCALL_NOT_FOUND;
}
struct reschedule_ctx rctx = {.reschedule = false, .cpu = NULL};
struct reschedule_ctx rctx = {0};
uintptr_t r =
func (caller, regs, &rctx, regs->rdi, regs->rsi, regs->rdx, regs->r10, regs->r8, regs->r9);
@@ -50,8 +51,16 @@ uintptr_t syscall_dispatch (void* stack_ptr) {
spin_unlock (&caller->lock);
}
if (rctx.reschedule)
cpu_request_sched (rctx.cpu);
bool do_thiscpu = false;
for (size_t i = 0; i < lengthof (rctx.cpus); i++) {
if (rctx.cpus[i] != NULL && rctx.cpus[i] != thiscpu)
cpu_request_sched (rctx.cpus[i]);
else
do_thiscpu = true;
}
if (do_thiscpu)
cpu_request_sched (thiscpu);
return r;
}