summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2009-03-07 15:34:35 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2009-03-07 15:34:35 +0000
commit533af00bc490d661c0485172ecc85661f5bfb8b2 (patch)
tree0958bc0190d3b4a65abceee125e75f4f0cb4dc78 /sys/arch
parent199a9dc702cd212e8bdb1f42566fb537bb2acc5b (diff)
When allocating memory in bus_dmamem_alloc() with uvm_pglistalloc(), do not
try to be smart for the address range, uvm_pglistalloc() is smart enough nowadays.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/alpha/dev/bus_dma.c4
-rw-r--r--sys/arch/amd64/amd64/bus_dma.c4
-rw-r--r--sys/arch/arm/arm/bus_dma.c5
-rw-r--r--sys/arch/hppa/hppa/mainbus.c4
-rw-r--r--sys/arch/hppa64/hppa64/mainbus.c4
-rw-r--r--sys/arch/i386/i386/bus_dma.c4
-rw-r--r--sys/arch/landisk/landisk/bus_dma.c4
-rw-r--r--sys/arch/macppc/macppc/dma.c4
-rw-r--r--sys/arch/mvme88k/mvme88k/bus_dma.c4
-rw-r--r--sys/arch/mvmeppc/mvmeppc/bus_dma.c4
-rw-r--r--sys/arch/sgi/sgi/bus_dma.c4
-rw-r--r--sys/arch/socppc/socppc/dma.c4
-rw-r--r--sys/arch/sparc64/sparc64/machdep.c7
-rw-r--r--sys/arch/vax/vax/bus_dma.c7
14 files changed, 29 insertions, 34 deletions
diff --git a/sys/arch/alpha/dev/bus_dma.c b/sys/arch/alpha/dev/bus_dma.c
index f7471a135ca..a4307fb73b6 100644
--- a/sys/arch/alpha/dev/bus_dma.c
+++ b/sys/arch/alpha/dev/bus_dma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus_dma.c,v 1.23 2008/06/26 05:42:08 ray Exp $ */
+/* $OpenBSD: bus_dma.c,v 1.24 2009/03/07 15:34:32 miod Exp $ */
/* $NetBSD: bus_dma.c,v 1.40 2000/07/17 04:47:56 thorpej Exp $ */
/*-
@@ -461,7 +461,7 @@ _bus_dmamem_alloc(t, size, alignment, boundary, segs, nsegs, rsegs, flags)
{
return (_bus_dmamem_alloc_range(t, size, alignment, boundary,
- segs, nsegs, rsegs, flags, 0, trunc_page(avail_end)));
+ segs, nsegs, rsegs, flags, (paddr_t)0, (paddr_t)-1));
}
/*
diff --git a/sys/arch/amd64/amd64/bus_dma.c b/sys/arch/amd64/amd64/bus_dma.c
index aec2010a601..6f52ee5d9c5 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.14 2009/02/05 01:15:20 oga Exp $ */
+/* $OpenBSD: bus_dma.c,v 1.15 2009/03/07 15:34:34 miod Exp $ */
/* $NetBSD: bus_dma.c,v 1.3 2003/05/07 21:33:58 fvdl Exp $ */
/*-
@@ -372,7 +372,7 @@ _bus_dmamem_alloc(bus_dma_tag_t t, bus_size_t size, bus_size_t alignment,
{
return (_bus_dmamem_alloc_range(t, size, alignment, boundary,
- segs, nsegs, rsegs, flags, 0, trunc_page(avail_end)));
+ segs, nsegs, rsegs, flags, (paddr_t)0, (paddr_t)-1));
}
/*
diff --git a/sys/arch/arm/arm/bus_dma.c b/sys/arch/arm/arm/bus_dma.c
index 446e08ed15e..cb3196c96ec 100644
--- a/sys/arch/arm/arm/bus_dma.c
+++ b/sys/arch/arm/arm/bus_dma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus_dma.c,v 1.12 2008/06/26 05:42:09 ray Exp $ */
+/* $OpenBSD: bus_dma.c,v 1.13 2009/03/07 15:34:34 miod Exp $ */
/* $NetBSD: bus_dma.c,v 1.38 2003/10/30 08:44:13 scw Exp $ */
/*-
@@ -636,8 +636,7 @@ _bus_dmamem_alloc(bus_dma_tag_t t, bus_size_t size, bus_size_t alignment,
}
} else {
error = _bus_dmamem_alloc_range(t, size, alignment, boundary,
- segs, nsegs, rsegs, flags, trunc_page(physical_start),
- trunc_page(physical_end));
+ segs, nsegs, rsegs, flags, 0, -1);
}
#ifdef DEBUG_DMA
diff --git a/sys/arch/hppa/hppa/mainbus.c b/sys/arch/hppa/hppa/mainbus.c
index 3718475056c..3bc0c753600 100644
--- a/sys/arch/hppa/hppa/mainbus.c
+++ b/sys/arch/hppa/hppa/mainbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mainbus.c,v 1.70 2009/02/01 14:53:02 miod Exp $ */
+/* $OpenBSD: mainbus.c,v 1.71 2009/03/07 15:34:34 miod Exp $ */
/*
* Copyright (c) 1998-2004 Michael Shalayeff
@@ -942,7 +942,7 @@ mbus_dmamem_alloc(void *v, bus_size_t size, bus_size_t alignment,
size = round_page(size);
TAILQ_INIT(&pglist);
- if (uvm_pglistalloc(size, 0, avail_end, alignment, boundary,
+ if (uvm_pglistalloc(size, 0, -1, alignment, boundary,
&pglist, 1, flags & BUS_DMA_NOWAIT))
return (ENOMEM);
diff --git a/sys/arch/hppa64/hppa64/mainbus.c b/sys/arch/hppa64/hppa64/mainbus.c
index 6ea53cd05e7..bd61120be15 100644
--- a/sys/arch/hppa64/hppa64/mainbus.c
+++ b/sys/arch/hppa64/hppa64/mainbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mainbus.c,v 1.6 2008/04/20 17:13:47 kettenis Exp $ */
+/* $OpenBSD: mainbus.c,v 1.7 2009/03/07 15:34:34 miod Exp $ */
/*
* Copyright (c) 2005 Michael Shalayeff
@@ -497,7 +497,7 @@ mbus_dmamem_alloc(void *v, bus_size_t size, bus_size_t alignment,
size = round_page(size);
TAILQ_INIT(&pglist);
- if (uvm_pglistalloc(size, 0, avail_end, alignment, boundary,
+ if (uvm_pglistalloc(size, (paddr_t)0, (paddr_t)-1, alignment, boundary,
&pglist, 1, flags & BUS_DMA_NOWAIT))
return (ENOMEM);
diff --git a/sys/arch/i386/i386/bus_dma.c b/sys/arch/i386/i386/bus_dma.c
index f2fbc9ff40c..a09c87bc248 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.3 2009/02/05 01:13:21 oga Exp $ */
+/* $OpenBSD: bus_dma.c,v 1.4 2009/03/07 15:34:34 miod Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -327,7 +327,7 @@ _bus_dmamem_alloc(bus_dma_tag_t t, bus_size_t size, bus_size_t alignment,
{
return (_bus_dmamem_alloc_range(t, size, alignment, boundary,
- segs, nsegs, rsegs, flags, 0, trunc_page(avail_end)));
+ segs, nsegs, rsegs, flags, (paddr_t)0, (paddr_t)-1));
}
/*
diff --git a/sys/arch/landisk/landisk/bus_dma.c b/sys/arch/landisk/landisk/bus_dma.c
index e3b1af937ee..bc51919cd76 100644
--- a/sys/arch/landisk/landisk/bus_dma.c
+++ b/sys/arch/landisk/landisk/bus_dma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus_dma.c,v 1.4 2007/10/06 23:12:17 krw Exp $ */
+/* $OpenBSD: bus_dma.c,v 1.5 2009/03/07 15:34:34 miod Exp $ */
/* $NetBSD: bus_dma.c,v 1.1 2006/09/01 21:26:18 uwe Exp $ */
/*
@@ -548,7 +548,7 @@ _bus_dmamem_alloc(bus_dma_tag_t t, bus_size_t size, bus_size_t alignment,
/*
* Allocate the pages from the VM system.
*/
- error = uvm_pglistalloc(size, avail_start, avail_end - PAGE_SIZE,
+ error = uvm_pglistalloc(size, 0, -1,
alignment, boundary, &mlist, nsegs, (flags & BUS_DMA_NOWAIT) == 0);
if (error)
return (error);
diff --git a/sys/arch/macppc/macppc/dma.c b/sys/arch/macppc/macppc/dma.c
index bc8438f7317..55b6dd4050d 100644
--- a/sys/arch/macppc/macppc/dma.c
+++ b/sys/arch/macppc/macppc/dma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dma.c,v 1.28 2008/06/26 05:42:12 ray Exp $ */
+/* $OpenBSD: dma.c,v 1.29 2009/03/07 15:34:34 miod Exp $ */
/* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */
/*-
@@ -421,7 +421,7 @@ _dmamem_alloc(bus_dma_tag_t t, bus_size_t size, bus_size_t alignment,
int flags)
{
return (_dmamem_alloc_range(t, size, alignment, boundary,
- segs, nsegs, rsegs, flags, 0, 0xf0000000));
+ segs, nsegs, rsegs, flags, 0, -1));
}
/*
diff --git a/sys/arch/mvme88k/mvme88k/bus_dma.c b/sys/arch/mvme88k/mvme88k/bus_dma.c
index fd07b5ab473..ab1d2ab67b4 100644
--- a/sys/arch/mvme88k/mvme88k/bus_dma.c
+++ b/sys/arch/mvme88k/mvme88k/bus_dma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus_dma.c,v 1.9 2009/02/01 00:52:19 miod Exp $ */
+/* $OpenBSD: bus_dma.c,v 1.10 2009/03/07 15:34:34 miod Exp $ */
/* $NetBSD: bus_dma.c,v 1.2 2001/06/10 02:31:25 briggs Exp $ */
/*-
@@ -482,7 +482,7 @@ bus_dmamem_alloc(t, size, alignment, boundary, segs, nsegs, rsegs, flags)
}
return _bus_dmamem_alloc_range(t, size, alignment, boundary, segs,
- nsegs, rsegs, flags, avail_start, avail_end - PAGE_SIZE);
+ nsegs, rsegs, flags, 0, -1);
}
/*
diff --git a/sys/arch/mvmeppc/mvmeppc/bus_dma.c b/sys/arch/mvmeppc/mvmeppc/bus_dma.c
index 99d7390a284..aa1c4020021 100644
--- a/sys/arch/mvmeppc/mvmeppc/bus_dma.c
+++ b/sys/arch/mvmeppc/mvmeppc/bus_dma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus_dma.c,v 1.21 2008/06/26 05:42:12 ray Exp $ */
+/* $OpenBSD: bus_dma.c,v 1.22 2009/03/07 15:34:34 miod Exp $ */
/* $NetBSD: bus_dma.c,v 1.2 2001/06/10 02:31:25 briggs Exp $ */
/*-
@@ -448,7 +448,7 @@ _bus_dmamem_alloc(t, size, alignment, boundary, segs, nsegs, rsegs, flags)
}
return _bus_dmamem_alloc_range(t, size, alignment, boundary, segs,
- nsegs, rsegs, flags, avail_start, avail_end - PAGE_SIZE);
+ nsegs, rsegs, flags, 0, -1);
}
/*
diff --git a/sys/arch/sgi/sgi/bus_dma.c b/sys/arch/sgi/sgi/bus_dma.c
index aa6bc431c30..9842544c9eb 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.6 2008/07/16 15:49:22 miod Exp $ */
+/* $OpenBSD: bus_dma.c,v 1.7 2009/03/07 15:34:34 miod Exp $ */
/*
* Copyright (c) 2003-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -438,7 +438,7 @@ _dmamem_alloc(t, size, alignment, boundary, segs, nsegs, rsegs, flags)
int flags;
{
return (_dmamem_alloc_range(t, size, alignment, boundary,
- segs, nsegs, rsegs, flags, 0, -1));
+ segs, nsegs, rsegs, flags, (paddr_t)0, (paddr_t)-1));
}
/*
diff --git a/sys/arch/socppc/socppc/dma.c b/sys/arch/socppc/socppc/dma.c
index b85656dfcc0..bb03dfd0655 100644
--- a/sys/arch/socppc/socppc/dma.c
+++ b/sys/arch/socppc/socppc/dma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dma.c,v 1.2 2008/06/26 05:42:13 ray Exp $ */
+/* $OpenBSD: dma.c,v 1.3 2009/03/07 15:34:34 miod Exp $ */
/* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */
/*-
@@ -421,7 +421,7 @@ _dmamem_alloc(bus_dma_tag_t t, bus_size_t size, bus_size_t alignment,
int flags)
{
return (_dmamem_alloc_range(t, size, alignment, boundary,
- segs, nsegs, rsegs, flags, 0, 0xf0000000));
+ segs, nsegs, rsegs, flags, 0, -1));
}
/*
diff --git a/sys/arch/sparc64/sparc64/machdep.c b/sys/arch/sparc64/sparc64/machdep.c
index 4c6e7be828a..dc3473b8614 100644
--- a/sys/arch/sparc64/sparc64/machdep.c
+++ b/sys/arch/sparc64/sparc64/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.115 2009/02/17 19:05:52 oga Exp $ */
+/* $OpenBSD: machdep.c,v 1.116 2009/03/07 15:34:34 miod Exp $ */
/* $NetBSD: machdep.c,v 1.108 2001/07/24 19:30:14 eeh Exp $ */
/*-
@@ -1422,14 +1422,11 @@ _bus_dmamem_alloc(t, t0, size, alignment, boundary, segs, nsegs, rsegs, flags)
int *rsegs;
int flags;
{
- vaddr_t low, high;
struct pglist *mlist;
int error;
/* Always round the size. */
size = round_page(size);
- low = vm_first_phys;
- high = vm_first_phys + vm_num_phys - PAGE_SIZE;
if ((mlist = malloc(sizeof(*mlist), M_DEVBUF,
(flags & BUS_DMA_NOWAIT) ? M_NOWAIT : M_WAITOK)) == NULL)
@@ -1449,7 +1446,7 @@ _bus_dmamem_alloc(t, t0, size, alignment, boundary, segs, nsegs, rsegs, flags)
* Allocate pages from the VM system.
*/
TAILQ_INIT(mlist);
- error = uvm_pglistalloc(size, low, high,
+ error = uvm_pglistalloc(size, (paddr_t)0, (paddr_t)-1,
alignment, boundary, mlist, nsegs, (flags & BUS_DMA_NOWAIT) == 0);
if (error)
return (error);
diff --git a/sys/arch/vax/vax/bus_dma.c b/sys/arch/vax/vax/bus_dma.c
index 13db9a33e5d..46b5e7e5793 100644
--- a/sys/arch/vax/vax/bus_dma.c
+++ b/sys/arch/vax/vax/bus_dma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus_dma.c,v 1.20 2008/08/15 22:40:00 miod Exp $ */
+/* $OpenBSD: bus_dma.c,v 1.21 2009/03/07 15:34:34 miod Exp $ */
/* $NetBSD: bus_dma.c,v 1.5 1999/11/13 00:32:20 thorpej Exp $ */
/*-
@@ -371,9 +371,8 @@ _bus_dmamem_alloc(t, size, alignment, boundary, segs, nsegs, rsegs, flags)
{
int error;
- error = (_bus_dmamem_alloc_range(t, size, alignment, boundary,
- segs, nsegs, rsegs, flags, round_page(avail_start),
- trunc_page(avail_end)));
+ error = _bus_dmamem_alloc_range(t, size, alignment, boundary,
+ segs, nsegs, rsegs, flags, 0, -1);
return(error);
}