summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2008-04-07 17:25:20 +0000
committermiod <miod@openbsd.org>2008-04-07 17:25:20 +0000
commit5dbea93d3ed3d59c9f8a79b9f88200a54a320420 (patch)
treeb48f71497e3034b14eaec7ade5a83b694fb1f1d2
parentDon't grab the kernel biglock for syscalls marked SY_NOLOCK; (diff)
downloadwireguard-openbsd-5dbea93d3ed3d59c9f8a79b9f88200a54a320420.tar.xz
wireguard-openbsd-5dbea93d3ed3d59c9f8a79b9f88200a54a320420.zip
In _dmamem_map(), be sure to convert the address from the device view to
a real physical address in the single-segment short-circuit code.
-rw-r--r--sys/arch/sgi/sgi/bus_dma.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/arch/sgi/sgi/bus_dma.c b/sys/arch/sgi/sgi/bus_dma.c
index b380a14aa1d..637a967c097 100644
--- a/sys/arch/sgi/sgi/bus_dma.c
+++ b/sys/arch/sgi/sgi/bus_dma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus_dma.c,v 1.3 2007/10/02 00:59:12 krw Exp $ */
+/* $OpenBSD: bus_dma.c,v 1.4 2008/04/07 17:25:20 miod Exp $ */
/*
* Copyright (c) 2003-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -491,12 +491,11 @@ _dmamem_map(t, segs, nsegs, size, kvap, flags)
int curseg;
if (nsegs == 1) {
+ pa = (*t->_device_to_pa)(segs[0].ds_addr);
if (flags & BUS_DMA_COHERENT)
- *kvap = (caddr_t)PHYS_TO_XKPHYS(segs[0].ds_addr,
- CCA_NC);
+ *kvap = (caddr_t)PHYS_TO_XKPHYS(pa, CCA_NC);
else
- *kvap = (caddr_t)PHYS_TO_XKPHYS(segs[0].ds_addr,
- CCA_NONCOHERENT);
+ *kvap = (caddr_t)PHYS_TO_XKPHYS(pa, CCA_NONCOHERENT);
return (0);
}