Module Name: src
Committed By: reinoud
Date: Tue Aug 30 12:02:38 UTC 2011
Modified Files:
src/sys/arch/usermode/usermode: pmap.c
Log Message:
Implement pmap_clear_reference()
To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 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.47 src/sys/arch/usermode/usermode/pmap.c:1.48
--- src/sys/arch/usermode/usermode/pmap.c:1.47 Tue Aug 30 11:57:20 2011
+++ src/sys/arch/usermode/usermode/pmap.c Tue Aug 30 12:02:38 2011
@@ -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 <[email protected]>
@@ -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