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_clear_reference()



details:   https://anonhg.NetBSD.org/src/rev/33832bf56851
branches:  trunk
changeset: 769030:33832bf56851
user:      reinoud <reinoud%NetBSD.org@localhost>
date:      Tue Aug 30 12:02:38 2011 +0000

description:
Implement pmap_clear_reference()

diffstat:

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

diffs (43 lines):

diff -r 420d70b16250 -r 33832bf56851 sys/arch/usermode/usermode/pmap.c
--- a/sys/arch/usermode/usermode/pmap.c Tue Aug 30 11:57:20 2011 +0000
+++ b/sys/arch/usermode/usermode/pmap.c Tue Aug 30 12:02:38 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.47 2011/08/30 11:57:20 reinoud Exp $ */
+/* $NetBSD: pmap.c,v 1.48 2011/08/30 12:02:38 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.47 2011/08/30 11:57:20 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.48 2011/08/30 12:02:38 reinoud Exp $");
 
 #include "opt_memsize.h"
 #include "opt_kmempages.h"
@@ -908,10 +908,21 @@
 }
 
 bool
-pmap_clear_reference(struct vm_page *pg)
+pmap_clear_reference(struct vm_page *page)
 {
-aprint_debug("pmap_clear_reference not implemented\n");
-       return true;
+       uintptr_t ppn;
+       bool rv;
+
+       ppn = atop(VM_PAGE_TO_PHYS(page));
+       rv = pmap_is_referenced(page);
+
+       aprint_debug("pmap_clear_reference page %"PRIiPTR"\n", ppn);
+
+       if (rv) {
+               pv_table[ppn].pv_pflags &= ~PV_REFERENCED;
+               pmap_update_page(ppn);
+       }
+       return rv;
 }
 
 bool



Home | Main Index | Thread Index | Old Index