summaryrefslogtreecommitdiff
path: root/sys/arch/arm
diff options
context:
space:
mode:
authorDale Rahn <drahn@cvs.openbsd.org>2008-10-28 20:16:59 +0000
committerDale Rahn <drahn@cvs.openbsd.org>2008-10-28 20:16:59 +0000
commit747840f33ef30df6f86d63efee38b468ead5f495 (patch)
tree185ed78b33589c0b5d2c91832836fc2e5b01c985 /sys/arch/arm
parent824c1ad4d9c11aff19aacb7e2781949e7f7294c4 (diff)
Do not leave pmap_cache_state pointing to freed memory if it was the
last process running.
Diffstat (limited to 'sys/arch/arm')
-rw-r--r--sys/arch/arm/arm/pmap.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/arch/arm/arm/pmap.c b/sys/arch/arm/arm/pmap.c
index ba43c9042fe..3a8ecd90059 100644
--- a/sys/arch/arm/arm/pmap.c
+++ b/sys/arch/arm/arm/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.18 2008/10/23 23:54:02 tedu Exp $ */
+/* $OpenBSD: pmap.c,v 1.19 2008/10/28 20:16:58 drahn Exp $ */
/* $NetBSD: pmap.c,v 1.147 2004/01/18 13:03:50 scw Exp $ */
/*
@@ -249,6 +249,7 @@ struct pmap kernel_pmap_store;
* XXXSCW: Fix for SMP ...
*/
union pmap_cache_state *pmap_cache_state;
+union pmap_cache_state pmap_deadproc_cache_state;
/*
* Pool and cache that pmap structures are allocated from.
@@ -3204,6 +3205,9 @@ pmap_destroy(pmap_t pm)
LIST_REMOVE(pm, pm_list);
+ if (pmap_cache_state == &pm->pm_cstate)
+ pmap_cache_state = &pmap_deadproc_cache_state;
+
pmap_free_l1(pm);
/* return the pmap to the pool */