From 7d813b16c3fc9b5d1d996af11b41624c41b9aee3 Mon Sep 17 00:00:00 2001 From: jonathan Date: Sun, 29 Nov 1998 03:18:32 +0000 Subject: [PATCH] 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(). --- sys/arch/mips/include/pmap.h | 4 +++- sys/arch/mips/mips/pmap.c | 42 ++++++++++++++++++++---------------- 2 files changed, 27 insertions(+), 19 deletions(-) diff --git a/sys/arch/mips/include/pmap.h b/sys/arch/mips/include/pmap.h index 4158228a696a..0a448eb1c999 100644 --- a/sys/arch/mips/include/pmap.h +++ b/sys/arch/mips/include/pmap.h @@ -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 diff --git a/sys/arch/mips/mips/pmap.c b/sys/arch/mips/mips/pmap.c index 5859048e19b8..674ec641f72e 100644 --- a/sys/arch/mips/mips/pmap.c +++ b/sys/arch/mips/mips/pmap.c @@ -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 -__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: *