Disable kernel preemption, fix requesting rescheduling
All checks were successful
Build documentation / build-and-deploy (push) Successful in 29s

This commit is contained in:
2026-01-22 19:32:15 +01:00
parent c26fd3cb2b
commit 7bb3b77ede
11 changed files with 32 additions and 27 deletions

View File

@@ -3,6 +3,7 @@
#include <amd64/mm.h>
#include <amd64/msr-index.h>
#include <amd64/msr.h>
#include <libk/string.h>
#include <m/status.h>
#include <m/syscall_defs.h>
#include <proc/proc.h>
@@ -13,10 +14,16 @@
extern void amd64_syscall_entry (void);
int amd64_syscall_dispatch (void* stack_ptr) {
spin_lock_ctx_t ctxcpu;
amd64_load_kernel_cr3 ();
struct saved_regs* regs = stack_ptr;
spin_lock (&thiscpu->lock, &ctxcpu);
memcpy (&thiscpu->regs, regs, sizeof (struct saved_regs));
spin_unlock (&thiscpu->lock, &ctxcpu);
int syscall_num = regs->rax;
syscall_handler_func_t func = syscall_find_handler (syscall_num);