syscall: adjust kernel blocking mechanism

Allow for a seamless escalation of privilege that maintains the same
thread of execution during a syscall, allowing syscalls to more easily
block and unblock
This commit is contained in:
Michael Shaw 2024-06-26 23:48:39 -04:00
commit 210663fe0f
5 changed files with 36 additions and 33 deletions

View file

@ -166,6 +166,9 @@ void schedule()
break;
case PROC_BLOCKED:
if (!sem_trywait(&proc->block_sem))
proc_unblock(proc->pid);
spinlock_release(&proc->lock);
case PROC_RUNNING:
spinlock_release(&proc->lock);
break;