summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2009-04-19 18:34:37 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2009-04-19 18:34:37 +0000
commit48d9815e77242189dd6f312177927ec582365042 (patch)
tree1a25b13154ae243803dcde6303b727fb26eabe79
parent20e2f4466606d1095baf3b5cbfeefefd06ee6b47 (diff)
Correctly handle bus_dma_tag with _dma_mask == 0.
-rw-r--r--sys/arch/sgi/sgi/bus_dma.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/arch/sgi/sgi/bus_dma.c b/sys/arch/sgi/sgi/bus_dma.c
index f80d9fe350b..3ed08d4fbc0 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.8 2009/04/14 16:01:04 oga Exp $ */
+/* $OpenBSD: bus_dma.c,v 1.9 2009/04/19 18:34:36 miod Exp $ */
/*
* Copyright (c) 2003-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -134,7 +134,8 @@ _dmamap_load(t, map, buf, buflen, p, flags)
lastaddr = ~0; /* XXX gcc */
bmask = ~(map->_dm_boundary - 1);
- bmask &= t->_dma_mask;
+ if (t->_dma_mask != 0)
+ bmask &= t->_dma_mask;
saved_buflen = buflen;
for (first = 1, seg = 0; buflen > 0; ) {
@@ -299,7 +300,8 @@ _dmamap_load_raw(t, map, segs, nsegs, size, flags)
bus_addr_t bmask = ~(map->_dm_boundary - 1);
int i;
- bmask &= t->_dma_mask;
+ if (t->_dma_mask != 0)
+ bmask &= t->_dma_mask;
for (i = 0; i < nsegs; i++) {
if (segs[i].ds_len > map->_dm_maxsegsz)
return (EINVAL);
@@ -521,7 +523,7 @@ _dmamem_map(t, segs, nsegs, size, kvap, flags)
segs[curseg].ds_vaddr = va;
if (flags & BUS_DMA_COHERENT &&
- sys_config.system_type == SGI_O2)
+ sys_config.system_type == SGI_O2)
pmap_page_cache(PHYS_TO_VM_PAGE(pa),
PV_UNCACHED);
}