Add PV_REFERENCED and track as for PV_MODIFIED,.

UVM relies on pmap modules keeping track of modified/referenced bits
after a page has been removed from all mappings.  So *dont* clear
PV_REFERENCED or PV_MODIFIED flags in pmap_remove().
This commit is contained in:
jonathan 1998-11-29 03:18:32 +00:00
parent 2407a4bd22
commit 7d813b16c3
2 changed files with 27 additions and 19 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap.h,v 1.20 1998/11/15 02:34:19 mhitch Exp $ */
/* $NetBSD: pmap.h,v 1.21 1998/11/29 03:18:32 jonathan Exp $ */
/*
* Copyright (c) 1987 Carnegie-Mellon University
@ -104,6 +104,7 @@ typedef struct pv_entry {
#define PV_UNCACHED 0x0001 /* page is mapped uncached */
#define PV_MODIFIED 0x0002 /* page has been modified */
#define PV_REFERENCED 0x0004 /* page has been recently referenced */
#ifdef _KERNEL
@ -121,6 +122,7 @@ struct pmap kernel_pmap_store;
void pmap_bootstrap __P((void));
void pmap_set_modified __P((vm_offset_t));
void pmap_set_referenced __P((vm_offset_t));
/*
* pmap_prefer() helps reduce virtual-coherency exceptions in

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap.c,v 1.43 1998/11/15 02:34:37 mhitch Exp $ */
/* $NetBSD: pmap.c,v 1.44 1998/11/29 03:18:32 jonathan Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -78,7 +78,7 @@
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.43 1998/11/15 02:34:37 mhitch Exp $");
__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.44 1998/11/29 03:18:32 jonathan Exp $");
/*
* Manages physical address maps.
@ -728,9 +728,12 @@ pmap_remove(pmap, sva, eva)
MachFlushDCache(sva, PAGE_SIZE);
#endif /* mips3 */
}
#ifdef notanymore
if (PAGE_IS_MANAGED(pfn_to_vad(entry)))
*pa_to_attribute(pfn_to_vad(entry)) &=
~PV_MODIFIED;
#endif
if (CPUISMIPS3)
@ -784,9 +787,12 @@ pmap_remove(pmap, sva, eva)
MachFlushDCache(sva, PAGE_SIZE);
#endif /* mips3 */
}
#ifdef notanymore
if (PAGE_IS_MANAGED(pfn_to_vad(entry)))
*pa_to_attribute(pfn_to_vad(entry)) &=
~PV_MODIFIED;
#endif
pte->pt_entry = mips_pg_nv_bit();
/*
* Flush the TLB for the given address.
@ -1648,22 +1654,6 @@ pmap_pageable(pmap, sva, eva, pageable)
#endif
}
/*
* Clear the modify bits on the specified physical page.
*/
void
pmap_clear_modify(pa)
vm_offset_t pa;
{
#ifdef DEBUG
if (pmapdebug & PDB_FOLLOW)
printf("pmap_clear_modify(%lx)\n", pa);
#endif
if (PAGE_IS_MANAGED(pa))
*pa_to_attribute(pa) &= ~PV_MODIFIED;
}
/*
* pmap_clear_reference:
*
@ -1700,6 +1690,22 @@ pmap_is_referenced(pa)
#endif
}
/*
* Clear the modify bits on the specified physical page.
*/
void
pmap_clear_modify(pa)
vm_offset_t pa;
{
#ifdef DEBUG
if (pmapdebug & PDB_FOLLOW)
printf("pmap_clear_modify(%lx)\n", pa);
#endif
if (PAGE_IS_MANAGED(pa))
*pa_to_attribute(pa) &= ~PV_MODIFIED;
}
/*
* pmap_is_modified:
*