Implement uvm_exit(), which frees VM resources when a process finishes

exiting.
This commit is contained in:
thorpej 1998-09-08 23:44:21 +00:00
parent 63ef9847d5
commit 28904fca48
2 changed files with 20 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: uvm_extern.h,v 1.20 1998/08/28 20:05:49 thorpej Exp $ */
/* $NetBSD: uvm_extern.h,v 1.21 1998/09/08 23:44:21 thorpej Exp $ */
/*
* XXXCDC: "ROUGH DRAFT" QUALITY UVM PRE-RELEASE FILE!
@ -274,6 +274,7 @@ int uvm_fault __P((vm_map_t, vaddr_t,
void uvm_chgkprot __P((caddr_t, size_t, int));
#endif
void uvm_fork __P((struct proc *, struct proc *, boolean_t));
void uvm_exit __P((struct proc *));
void uvm_init_limits __P((struct proc *));
boolean_t uvm_kernacc __P((caddr_t, size_t, int));
__dead void uvm_scheduler __P((void)) __attribute__((noreturn));

View File

@ -1,4 +1,4 @@
/* $NetBSD: uvm_glue.c,v 1.13 1998/08/13 02:11:00 eeh Exp $ */
/* $NetBSD: uvm_glue.c,v 1.14 1998/09/08 23:44:22 thorpej Exp $ */
/*
* XXXCDC: "ROUGH DRAFT" QUALITY UVM PRE-RELEASE FILE!
@ -313,6 +313,23 @@ uvm_fork(p1, p2, shared)
cpu_fork(p1, p2);
}
/*
* uvm_exit: exit a virtual address space
*
* - the process passed to us is a dead (pre-zombie) process; we
* are running on a different context now (the reaper).
* - we must run in a separate thread because freeing the vmspace
* of the dead process may block.
*/
void
uvm_exit(p)
struct proc *p;
{
uvmspace_free(p->p_vmspace);
uvm_km_free(kernel_map, (vaddr_t)p->p_addr, USPACE);
}
/*
* uvm_init_limit: init per-process VM limits
*