scheduler: begin rework

This commit is contained in:
Matheus
2025-08-19 00:44:14 -03:00
parent c10bebb9ef
commit 5098c09f26
7 changed files with 97 additions and 0 deletions
+7
View File
@@ -4,6 +4,7 @@
#include <kernel/file.h>
#include <kernel/interrupt.h>
#include <kernel/jobctl.h>
#include <kernel/interrupt.h>
syscallret_t syscall_fork(context_t *ctx) {
syscallret_t ret = {
@@ -62,6 +63,12 @@ syscallret_t syscall_fork(context_t *ctx) {
memcpy(&nproc->signals.pending, &proc->signals.pending, sizeof(sigset_t));
memcpy(&nproc->signals.actions, &proc->signals.actions[0], sizeof(sigaction_t) * NSIG);
// copy thread scheduling metrics over
// raised to IPL_DPC to prevent scheduling
long ipl = interrupt_raiseipl(IPL_DPC);
memcpy(&nthread->metrics, &current_thread()->metrics, sizeof(nthread->metrics));
interrupt_loweripl(ipl);
ret.ret = nproc->pid;
sched_queue(nthread);