summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorAlexandre Ratchov <ratchov@cvs.openbsd.org>2009-03-30 17:43:16 +0000
committerAlexandre Ratchov <ratchov@cvs.openbsd.org>2009-03-30 17:43:16 +0000
commit674ee8a796bc56d9215201e9519b8ebb8a1687b8 (patch)
treee5b55f4c5802c96752bd0c69c1dda7ae684c40de /sys/arch
parent5422563144e0c36d2d8a27c337f96eca136e4c21 (diff)
don't use pmapflags unitialized. Fixes envy(4) consuming 80% CPU
when recording ok oga, deraadt
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/i386/i386/bus_dma.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/arch/i386/i386/bus_dma.c b/sys/arch/i386/i386/bus_dma.c
index 890bfc0aee6..970830d3e7a 100644
--- a/sys/arch/i386/i386/bus_dma.c
+++ b/sys/arch/i386/i386/bus_dma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus_dma.c,v 1.5 2009/03/10 15:03:17 oga Exp $ */
+/* $OpenBSD: bus_dma.c,v 1.6 2009/03/30 17:43:15 ratchov Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -369,6 +369,7 @@ _bus_dmamem_map(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs,
bus_addr_t addr;
int curseg, pmapflags;
+ pmapflags = VM_PROT_READ | VM_PROT_WRITE | PMAP_WIRED;
if (flags & BUS_DMA_NOCACHE)
pmapflags |= PMAP_NOCACHE;
@@ -386,9 +387,7 @@ _bus_dmamem_map(bus_dma_tag_t t, bus_dma_segment_t *segs, int nsegs,
if (size == 0)
panic("_bus_dmamem_map: size botch");
pmap_enter(pmap_kernel(), va, addr,
- VM_PROT_READ | VM_PROT_WRITE,
- VM_PROT_READ | VM_PROT_WRITE | PMAP_WIRED |
- pmapflags);
+ VM_PROT_READ | VM_PROT_WRITE, pmapflags);
}
}
pmap_update(pmap_kernel());