mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 12:48:22 +00:00
scheduler: begin rework
This commit is contained in:
@@ -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, ¤t_thread()->metrics, sizeof(nthread->metrics));
|
||||
interrupt_loweripl(ipl);
|
||||
|
||||
ret.ret = nproc->pid;
|
||||
|
||||
sched_queue(nthread);
|
||||
|
||||
Reference in New Issue
Block a user