Remove spinlock contexts
All checks were successful
Build documentation / build-and-deploy (push) Successful in 28s

This commit is contained in:
2026-02-08 18:58:53 +01:00
parent 1ca3d11bac
commit 9e6035bd68
26 changed files with 161 additions and 262 deletions

View File

@@ -14,20 +14,18 @@
extern void amd64_syscall_entry (void);
uintptr_t amd64_syscall_dispatch (void* stack_ptr) {
spin_lock_ctx_t ctxcpu, ctxpr;
amd64_load_kernel_cr3 ();
struct saved_regs* regs = stack_ptr;
spin_lock (&thiscpu->lock, &ctxcpu);
spin_lock (&thiscpu->lock);
struct proc* caller = thiscpu->proc_current;
int caller_pid = caller->pid;
spin_lock (&caller->lock, &ctxpr);
spin_lock (&caller->lock);
memcpy (&caller->pdata.regs, regs, sizeof (struct saved_regs));
spin_unlock (&caller->lock, &ctxpr);
spin_unlock (&thiscpu->lock, &ctxcpu);
spin_unlock (&caller->lock);
spin_unlock (&thiscpu->lock);
int syscall_num = regs->rax;
syscall_handler_func_t func = syscall_find_handler (syscall_num);
@@ -45,9 +43,9 @@ uintptr_t amd64_syscall_dispatch (void* stack_ptr) {
caller = proc_find_pid (caller_pid);
if (caller != NULL) {
spin_lock (&caller->lock, &ctxpr);
spin_lock (&caller->lock);
caller->pdata.regs.rax = r;
spin_unlock (&caller->lock, &ctxpr);
spin_unlock (&caller->lock);
}
if (reschedule)