Fix CPU load balancer bugs, scheduling points support for remote CPUs
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:
@@ -21,6 +21,7 @@ uintptr_t amd64_syscall_dispatch (void* stack_ptr) {
|
||||
|
||||
spin_lock (&thiscpu->lock, &ctxcpu);
|
||||
struct proc* caller = thiscpu->proc_current;
|
||||
int caller_pid = caller->pid;
|
||||
spin_lock (&caller->lock, &ctxpr);
|
||||
|
||||
memcpy (&caller->pdata.regs, regs, sizeof (struct saved_regs));
|
||||
@@ -35,7 +36,24 @@ uintptr_t amd64_syscall_dispatch (void* stack_ptr) {
|
||||
return -ST_SYSCALL_NOT_FOUND;
|
||||
}
|
||||
|
||||
return func (caller, regs, regs->rdi, regs->rsi, regs->rdx, regs->r10, regs->r8, regs->r9);
|
||||
bool reschedule = false;
|
||||
|
||||
struct cpu* reschedule_cpu = NULL;
|
||||
uintptr_t r = func (caller, regs, &reschedule, &reschedule_cpu, regs->rdi, regs->rsi, regs->rdx,
|
||||
regs->r10, regs->r8, regs->r9);
|
||||
|
||||
caller = proc_find_pid (caller_pid);
|
||||
|
||||
if (caller != NULL) {
|
||||
spin_lock (&caller->lock, &ctxpr);
|
||||
caller->pdata.regs.rax = r;
|
||||
spin_unlock (&caller->lock, &ctxpr);
|
||||
}
|
||||
|
||||
if (reschedule)
|
||||
cpu_request_sched (reschedule_cpu);
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
void syscall_init (void) {
|
||||
|
||||
Reference in New Issue
Block a user