summaryrefslogtreecommitdiff
path: root/sys/arch/sparc64
diff options
context:
space:
mode:
authorOwain Ainsworth <oga@cvs.openbsd.org>2009-04-14 16:01:05 +0000
committerOwain Ainsworth <oga@cvs.openbsd.org>2009-04-14 16:01:05 +0000
commit736b9535289dd9e3a0ffaafbb736c868a7f377d6 (patch)
tree608c5bb2fc645051c56618391202edc1c0f9e6e8 /sys/arch/sparc64
parent1b91dd8d89d56b40421b288402b14602db6d9a0f (diff)
Convert the waitok field of uvm_pglistalloc to "flags", more will be added soon.
For the possibility of sleeping, the first two flags are UVM_PLA_WAITOK and UVM_PLA_NOWAIT. It is an error not to show intention, so assert that one of the two is provided. Switch over every caller in the tree to using the appropriate flag. ok art@, ariane@
Diffstat (limited to 'sys/arch/sparc64')
-rw-r--r--sys/arch/sparc64/dev/iommu.c4
-rw-r--r--sys/arch/sparc64/sparc64/machdep.c8
2 files changed, 7 insertions, 5 deletions
diff --git a/sys/arch/sparc64/dev/iommu.c b/sys/arch/sparc64/dev/iommu.c
index 6f1fd90b236..40f4c81e304 100644
--- a/sys/arch/sparc64/dev/iommu.c
+++ b/sys/arch/sparc64/dev/iommu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: iommu.c,v 1.56 2009/04/05 21:57:41 oga Exp $ */
+/* $OpenBSD: iommu.c,v 1.57 2009/04/14 16:01:04 oga Exp $ */
/* $NetBSD: iommu.c,v 1.47 2002/02/08 20:03:45 eeh Exp $ */
/*
@@ -166,7 +166,7 @@ iommu_init(char *name, struct iommu_state *is, int tsbsize, u_int32_t iovabase)
size = PAGE_SIZE << is->is_tsbsize;
TAILQ_INIT(&mlist);
if (uvm_pglistalloc((psize_t)size, (paddr_t)0, (paddr_t)-1,
- (paddr_t)PAGE_SIZE, (paddr_t)0, &mlist, 1, 0) != 0)
+ (paddr_t)PAGE_SIZE, (paddr_t)0, &mlist, 1, UVM_PLA_NOWAIT) != 0)
panic("iommu_init: no memory");
va = uvm_km_valloc(kernel_map, size);
diff --git a/sys/arch/sparc64/sparc64/machdep.c b/sys/arch/sparc64/sparc64/machdep.c
index dc3473b8614..c71de3b886a 100644
--- a/sys/arch/sparc64/sparc64/machdep.c
+++ b/sys/arch/sparc64/sparc64/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.116 2009/03/07 15:34:34 miod Exp $ */
+/* $OpenBSD: machdep.c,v 1.117 2009/04/14 16:01:04 oga Exp $ */
/* $NetBSD: machdep.c,v 1.108 2001/07/24 19:30:14 eeh Exp $ */
/*-
@@ -1423,7 +1423,7 @@ _bus_dmamem_alloc(t, t0, size, alignment, boundary, segs, nsegs, rsegs, flags)
int flags;
{
struct pglist *mlist;
- int error;
+ int error, plaflag;
/* Always round the size. */
size = round_page(size);
@@ -1445,9 +1445,11 @@ _bus_dmamem_alloc(t, t0, size, alignment, boundary, segs, nsegs, rsegs, flags)
/*
* Allocate pages from the VM system.
*/
+ plaflag = flags & BUS_DMA_NOWAIT ? UVM_PLA_NOWAIT : UVM_PLA_WAITOK;
+
TAILQ_INIT(mlist);
error = uvm_pglistalloc(size, (paddr_t)0, (paddr_t)-1,
- alignment, boundary, mlist, nsegs, (flags & BUS_DMA_NOWAIT) == 0);
+ alignment, boundary, mlist, nsegs, plaflag);
if (error)
return (error);