Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/usermode/usermode Implement pmap_unwire(); not seen...



details:   https://anonhg.NetBSD.org/src/rev/cea6ba27e41c
branches:  trunk
changeset: 769598:cea6ba27e41c
user:      reinoud <reinoud%NetBSD.org@localhost>
date:      Thu Sep 15 15:08:51 2011 +0000

description:
Implement pmap_unwire(); not seen it called yet though

diffstat:

 sys/arch/usermode/usermode/pmap.c |  21 ++++++++++++++++++---
 1 files changed, 18 insertions(+), 3 deletions(-)

diffs (42 lines):

diff -r c5034416e335 -r cea6ba27e41c sys/arch/usermode/usermode/pmap.c
--- a/sys/arch/usermode/usermode/pmap.c Thu Sep 15 15:02:35 2011 +0000
+++ b/sys/arch/usermode/usermode/pmap.c Thu Sep 15 15:08:51 2011 +0000
@@ -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 <reinoud%NetBSD.org@localhost>
@@ -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



Home | Main Index | Thread Index | Old Index