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;
|
||||
|
@ -54,8 +54,6 @@ typedef struct Proc {
|
||||
uint8_t state;
|
||||
VasRange *vas;
|
||||
|
||||
bool kern;
|
||||
|
||||
VfsObj *vobjs[PROC_VFSHANDLES_MAX];
|
||||
uint64_t vobjcnt;
|
||||
|
||||
|
@ -139,7 +139,6 @@ int32_t SYSCALL5(sys_processctl, pid1, cmd1, arg1, arg2, arg3) {
|
||||
stat->pid = p->pid;
|
||||
hal_strcpy(stat->name, p->name);
|
||||
stat->state = p->state;
|
||||
stat->kern = p->kern;
|
||||
|
||||
VasRange *vas, *vastmp;
|
||||
LL_FOREACH_SAFE(p->vas, vas, vastmp) {
|
||||
|
Reference in New Issue
Block a user