Handle process arguments
This commit is contained in:
@ -198,7 +198,6 @@ Proc *proc_nextready(void) {
|
||||
}
|
||||
proc = proc->next;
|
||||
}
|
||||
return proc;
|
||||
}
|
||||
|
||||
void proc_reaper(void) {
|
||||
@ -243,6 +242,14 @@ void proc_reaper(void) {
|
||||
}
|
||||
|
||||
pmm_free((uintptr_t)zombie->platformdata.cr3, 1);
|
||||
|
||||
ProcArg *arg = zombie->procargs.list;
|
||||
while (arg) {
|
||||
dlfree(arg->string);
|
||||
ProcArg *tmp = arg;
|
||||
arg = arg->next;
|
||||
dlfree(tmp);
|
||||
}
|
||||
}
|
||||
dlfree(zombie);
|
||||
} else {
|
||||
@ -251,19 +258,21 @@ void proc_reaper(void) {
|
||||
}
|
||||
}
|
||||
|
||||
extern void hal_zombiespin(void);
|
||||
|
||||
void proc_sched(void *cpustate) {
|
||||
hal_intr_disable();
|
||||
sched_ticks++;
|
||||
|
||||
if (sched_ticks % PROC_REAPER_FREQ == 0) {
|
||||
proc_reaper();
|
||||
}
|
||||
|
||||
IntrStackFrame *frame = cpustate;
|
||||
|
||||
PROCS.current->platformdata.trapframe = *frame;
|
||||
|
||||
|
||||
PROCS.current = proc_nextready();
|
||||
|
||||
if (sched_ticks % PROC_REAPER_FREQ == 0) {
|
||||
proc_reaper();
|
||||
}
|
||||
|
||||
hal_switchproc(&PROCS.current->platformdata.trapframe, (void *)PROCS.current->platformdata.cr3);
|
||||
}
|
||||
|
Reference in New Issue
Block a user