Remove spinlock contexts
All checks were successful
Build documentation / build-and-deploy (push) Successful in 28s
All checks were successful
Build documentation / build-and-deploy (push) Successful in 28s
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user