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 Don't allow unmapping of WIRED pa...
details: https://anonhg.NetBSD.org/src/rev/49b48eade9d2
branches: trunk
changeset: 772014:49b48eade9d2
user: reinoud <reinoud%NetBSD.org@localhost>
date: Tue Dec 13 15:43:55 2011 +0000
description:
Don't allow unmapping of WIRED pages!
Also on unwire, call pmap_update_page() though this propably is not needed.
diffstat:
sys/arch/usermode/usermode/pmap.c | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
diffs (47 lines):
diff -r c5547404929c -r 49b48eade9d2 sys/arch/usermode/usermode/pmap.c
--- a/sys/arch/usermode/usermode/pmap.c Tue Dec 13 14:46:07 2011 +0000
+++ b/sys/arch/usermode/usermode/pmap.c Tue Dec 13 15:43:55 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.76 2011/12/13 12:29:19 reinoud Exp $ */
+/* $NetBSD: pmap.c,v 1.77 2011/12/13 15:43:55 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.76 2011/12/13 12:29:19 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.77 2011/12/13 15:43:55 reinoud Exp $");
#include "opt_memsize.h"
#include "opt_kmempages.h"
@@ -643,6 +643,9 @@
vaddr_t va = pv->pv_lpn * PAGE_SIZE + VM_MIN_ADDRESS; /* L->V */
void *addr;
+ if (pv->pv_vflags & PV_WIRED)
+ return;
+
addr = thunk_mmap((void *) va, PAGE_SIZE, THUNK_PROT_NONE,
THUNK_MAP_FILE | THUNK_MAP_FIXED | THUNK_MAP_SHARED,
mem_fh, pa);
@@ -918,7 +921,7 @@
struct pv_entry *pv;
intptr_t lpn;
- dprintf_debug("pmap_unwire called\n'");
+ dprintf_debug("pmap_unwire called va = %p\n", (void *) va);
if (pmap == NULL)
return;
@@ -931,6 +934,9 @@
return;
pmap->pm_stats.wired_count--;
pv->pv_vflags &= ~PV_WIRED;
+
+ /* XXX needed? */
+ pmap_update_page(pv->pv_ppn);
}
bool
Home |
Main Index |
Thread Index |
Old Index