all procs are user procs
This commit is contained in:
@ -200,21 +200,19 @@ void proc_reaper(void) {
|
||||
pmm_free((uintptr_t)(zombie->platformdata.kstack - PROC_STACKSIZE), PROC_STACKBLOCKS);
|
||||
pmm_free((uintptr_t)(zombie->platformdata.pstack - PROC_STACKSIZE), PROC_STACKBLOCKS);
|
||||
|
||||
if (!zombie->kern) {
|
||||
VasRange *vas, *vastmp;
|
||||
LL_FOREACH_SAFE(zombie->vas, vas, vastmp) {
|
||||
hal_vmm_unmap_range(zombie->platformdata.cr3, vas->virtstart, vas->physstart, vas->size);
|
||||
pmm_free((uintptr_t)vas->physstart, vas->size / HAL_PAGE_SIZE);
|
||||
dlfree(vas);
|
||||
}
|
||||
VasRange *vas, *vastmp;
|
||||
LL_FOREACH_SAFE(zombie->vas, vas, vastmp) {
|
||||
hal_vmm_unmap_range(zombie->platformdata.cr3, vas->virtstart, vas->physstart, vas->size);
|
||||
pmm_free((uintptr_t)vas->physstart, vas->size / HAL_PAGE_SIZE);
|
||||
dlfree(vas);
|
||||
}
|
||||
|
||||
pmm_free((uintptr_t)zombie->platformdata.cr3, 1);
|
||||
pmm_free((uintptr_t)zombie->platformdata.cr3, 1);
|
||||
|
||||
ProcArg *arg, *argtmp;
|
||||
LL_FOREACH_SAFE(zombie->procargs.list, arg, argtmp) {
|
||||
dlfree(arg->string);
|
||||
dlfree(arg);
|
||||
}
|
||||
ProcArg *arg, *argtmp;
|
||||
LL_FOREACH_SAFE(zombie->procargs.list, arg, argtmp) {
|
||||
dlfree(arg->string);
|
||||
dlfree(arg);
|
||||
}
|
||||
dlfree(zombie);
|
||||
}
|
||||
@ -250,22 +248,6 @@ void proc_killself(void) {
|
||||
spinlock_release(&PROCS.spinlock);
|
||||
}
|
||||
|
||||
void proc_status(void) {
|
||||
static const char *statuses[] = {"ready", "running", "zombie", "waiting"};
|
||||
for (;;) {
|
||||
spinlock_acquire(&PROCS.spinlock);
|
||||
Proc *head = PROCS.procs;
|
||||
while (head) {
|
||||
kprintf("%s %s %s\n", head->kern ? "kern" : "user", statuses[head->state], head->name);
|
||||
head = head->next;
|
||||
}
|
||||
kprintf("\n\n");
|
||||
spinlock_release(&PROCS.spinlock);
|
||||
|
||||
hal_wait(3 * 1000);
|
||||
}
|
||||
}
|
||||
|
||||
void proc_init(void) {
|
||||
spinlock_init(&PROCS.spinlock);
|
||||
PROCS.procs = NULL;
|
||||
|
Reference in New Issue
Block a user