summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorTobias Weingartner <weingart@cvs.openbsd.org>2006-06-08 03:18:09 +0000
committerTobias Weingartner <weingart@cvs.openbsd.org>2006-06-08 03:18:09 +0000
commita0570576d9ba1d523927c55e53a38ca792c6deac (patch)
tree15f4a17ced3586deb8aa0c73d818f15d2d202a39 /sys
parentcfaf23508a25c2c6addff8930944454b3546bcc4 (diff)
Move ISA logic of allocation functions to better place.
Thanks for krw@ for testing isa floppies. brad@ ok, jason@ ok.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/amd64/amd64/bus_dma.c9
-rw-r--r--sys/arch/amd64/isa/isa_machdep.c19
2 files changed, 14 insertions, 14 deletions
diff --git a/sys/arch/amd64/amd64/bus_dma.c b/sys/arch/amd64/amd64/bus_dma.c
index 71ba402f231..4aeeed9eb7a 100644
--- a/sys/arch/amd64/amd64/bus_dma.c
+++ b/sys/arch/amd64/amd64/bus_dma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus_dma.c,v 1.5 2006/05/10 12:36:39 krw Exp $ */
+/* $OpenBSD: bus_dma.c,v 1.6 2006/06/08 03:18:08 weingart Exp $ */
/* $NetBSD: bus_dma.c,v 1.3 2003/05/07 21:33:58 fvdl Exp $ */
/*-
@@ -669,11 +669,8 @@ _bus_dmamem_alloc_range(t, size, alignment, boundary, segs, nsegs, rsegs,
/*
* Allocate pages from the VM system.
*/
- if (high <= ISA_DMA_BOUNCE_THRESHOLD || (error = uvm_pglistalloc(size,
- round_page(ISA_DMA_BOUNCE_THRESHOLD), high, alignment, boundary,
- &mlist, nsegs, (flags & BUS_DMA_NOWAIT) == 0)))
- error = uvm_pglistalloc(size, low, high, alignment, boundary,
- &mlist, nsegs, (flags & BUS_DMA_NOWAIT) == 0);
+ error = uvm_pglistalloc(size, low, high, alignment, boundary,
+ &mlist, nsegs, (flags & BUS_DMA_NOWAIT) == 0);
if (error)
return (error);
diff --git a/sys/arch/amd64/isa/isa_machdep.c b/sys/arch/amd64/isa/isa_machdep.c
index c8366a83dcf..74efd9479c9 100644
--- a/sys/arch/amd64/isa/isa_machdep.c
+++ b/sys/arch/amd64/isa/isa_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: isa_machdep.c,v 1.8 2006/03/08 19:44:02 kettenis Exp $ */
+/* $OpenBSD: isa_machdep.c,v 1.9 2006/06/08 03:18:08 weingart Exp $ */
/* $NetBSD: isa_machdep.c,v 1.22 1997/06/12 23:57:32 thorpej Exp $ */
#define ISA_DMA_STATS
@@ -770,15 +770,18 @@ _isa_bus_dmamem_alloc(t, size, alignment, boundary, segs, nsegs, rsegs, flags)
int *rsegs;
int flags;
{
- paddr_t high;
+ int error;
- if (avail_end > ISA_DMA_BOUNCE_THRESHOLD)
- high = trunc_page(ISA_DMA_BOUNCE_THRESHOLD);
- else
- high = trunc_page(avail_end);
+ /* Try in ISA addressable region first */
+ error = _bus_dmamem_alloc_range(t, size, alignment, boundary,
+ segs, nsegs, rsegs, flags, 0, ISA_DMA_BOUNCE_THRESHOLD);
+ if (!error)
+ return (error);
- return (_bus_dmamem_alloc_range(t, size, alignment, boundary,
- segs, nsegs, rsegs, flags, 0, high));
+ /* Otherwise try anywhere (we'll bounce later) */
+ error = _bus_dmamem_alloc_range(t, size, alignment, boundary,
+ segs, nsegs, rsegs, flags, 0, trunc_page(avail_end));
+ return (error);
}
/*