summaryrefslogtreecommitdiff
path: root/sys/arch/arm
diff options
context:
space:
mode:
authorPatrick Wildt <patrick@cvs.openbsd.org>2013-05-09 23:46:06 +0000
committerPatrick Wildt <patrick@cvs.openbsd.org>2013-05-09 23:46:06 +0000
commit0d5c5b2f634a018af9c9382cdb991c51e7cfc94a (patch)
tree234f641773b249cbda9bb50bf9415f9a03a7d4a1 /sys/arch/arm
parent6bc70803872b4e2ea37eae6700e2ab6df4de214a (diff)
Don't rely on uvm_km_free() to remove the pmap mapping when unmapping
in bus space. ok miod@
Diffstat (limited to 'sys/arch/arm')
-rw-r--r--sys/arch/arm/armv7/armv7_space.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/arch/arm/armv7/armv7_space.c b/sys/arch/arm/armv7/armv7_space.c
index 2103bc11540..a98cd881810 100644
--- a/sys/arch/arm/armv7/armv7_space.c
+++ b/sys/arch/arm/armv7/armv7_space.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: armv7_space.c,v 1.3 2013/05/09 20:41:47 patrick Exp $ */
+/* $OpenBSD: armv7_space.c,v 1.4 2013/05/09 23:46:05 patrick Exp $ */
/*
* Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -211,10 +211,16 @@ armv7_bs_map(void *t, bus_addr_t bpa, bus_size_t size,
void
armv7_bs_unmap(void *t, bus_space_handle_t bsh, bus_size_t size)
{
+ vaddr_t va, endva;
if (bsh > (u_long)KERNEL_BASE)
return;
+ va = trunc_page((vaddr_t)bsh);
+ endva = round_page((vaddr_t)bsh + size);
+
+ pmap_kremove(va, endva - va);
+ pmap_update(pmap_kernel());
uvm_km_free(kernel_map, bsh, size);
}