diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2012-03-28 20:35:42 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2012-03-28 20:35:42 +0000 |
commit | b71835f84a40d614f56816274c2400a719e82600 (patch) | |
tree | 692e4cbc7ae487618fce7fcd3829e01d82fb3372 /sys | |
parent | 39236d4256267486db4bf89b4a4a8896c5690c88 (diff) |
Allow dma map boundary smaller than the kernel page size to work in
bus_dmamap_load*().
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/sgi/sgi/bus_dma.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/arch/sgi/sgi/bus_dma.c b/sys/arch/sgi/sgi/bus_dma.c index ff704442e39..4b7c979554a 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.24 2012/03/25 13:52:52 miod Exp $ */ +/* $OpenBSD: bus_dma.c,v 1.25 2012/03/28 20:35:41 miod Exp $ */ /* * Copyright (c) 2003-2004 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -605,7 +605,7 @@ _dmamap_load_buffer(bus_dma_tag_t t, bus_dmamap_t map, void *buf, map->dm_segs[seg]._ds_vaddr = vaddr; first = 0; } else { - if ((bus_addr_t)curaddr == lastaddr && + if ((bus_addr_t)curaddr == lastaddr + 1 && (map->dm_segs[seg].ds_len + sgsize) <= map->_dm_maxsegsz && (map->_dm_boundary == 0 || @@ -623,7 +623,7 @@ _dmamap_load_buffer(bus_dma_tag_t t, bus_dmamap_t map, void *buf, } } - lastaddr = (bus_addr_t)curaddr + sgsize; + lastaddr = (bus_addr_t)curaddr + sgsize - 1; vaddr += sgsize; buflen -= sgsize; } |