Module Name: src Committed By: reinoud Date: Thu Sep 15 15:08:51 UTC 2011
Modified Files: src/sys/arch/usermode/usermode: pmap.c Log Message: Implement pmap_unwire(); not seen it called yet though To generate a diff of this commit: cvs rdiff -u -r1.66 -r1.67 src/sys/arch/usermode/usermode/pmap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/usermode/usermode/pmap.c diff -u src/sys/arch/usermode/usermode/pmap.c:1.66 src/sys/arch/usermode/usermode/pmap.c:1.67 --- src/sys/arch/usermode/usermode/pmap.c:1.66 Thu Sep 15 15:02:35 2011 +++ src/sys/arch/usermode/usermode/pmap.c Thu Sep 15 15:08:51 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.66 2011/09/15 15:02:35 reinoud Exp $ */ +/* $NetBSD: pmap.c,v 1.67 2011/09/15 15:08:51 reinoud Exp $ */ /*- * Copyright (c) 2011 Reinoud Zandijk <rein...@netbsd.org> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.66 2011/09/15 15:02:35 reinoud Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.67 2011/09/15 15:08:51 reinoud Exp $"); #include "opt_memsize.h" #include "opt_kmempages.h" @@ -892,7 +892,22 @@ void pmap_unwire(pmap_t pmap, vaddr_t va) { -printf("pmap_unwire called not implemented\n'"); + struct pv_entry *pv; + intptr_t lpn; + + dprintf_debug("pmap_unwire called\n'"); + if (pmap == NULL) + return; + + lpn = atop(va - VM_MIN_ADDRESS); /* V->L */ + pv = pmap->pm_entries[lpn]; + if (pv == NULL) + return; + /* but is it wired? */ + if ((pv->pv_vflags & PV_WIRED) == 0) + return; + pmap->pm_stats.wired_count--; + pv->pv_vflags &= ~PV_WIRED; } bool