summaryrefslogtreecommitdiff
path: root/sys/arch/landisk
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/landisk
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/landisk')
-rw-r--r--sys/arch/landisk/landisk/bus_dma.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/arch/landisk/landisk/bus_dma.c b/sys/arch/landisk/landisk/bus_dma.c
index 0aa9694cb55..f321c81eae9 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.6 2009/03/15 09:35:50 miod Exp $ */
+/* $OpenBSD: bus_dma.c,v 1.7 2009/04/14 16:01:04 oga Exp $ */
/* $NetBSD: bus_dma.c,v 1.1 2006/09/01 21:26:18 uwe Exp $ */
/*
@@ -535,19 +535,21 @@ _bus_dmamem_alloc(bus_dma_tag_t t, bus_size_t size, bus_size_t alignment,
struct pglist mlist;
paddr_t curaddr, lastaddr;
struct vm_page *m;
- int curseg, error;
+ int curseg, error, plaflag;
DPRINTF(("bus_dmamem_alloc: t = %p, size = %ld, alignment = %ld, boundary = %ld, segs = %p, nsegs = %d, rsegs = %p, flags = %x\n", t, size, alignment, boundary, segs, nsegs, rsegs, flags));
/* Always round the size. */
size = round_page(size);
- TAILQ_INIT(&mlist);
/*
* Allocate the pages from the VM system.
*/
- error = uvm_pglistalloc(size, 0, -1,
- alignment, boundary, &mlist, nsegs, (flags & BUS_DMA_NOWAIT) == 0);
+ plaflag = flags & BUS_DMA_NOWAIT ? UVM_PLA_NOWAIT : UVM_PLA_WAITOK;
+
+ TAILQ_INIT(&mlist);
+ error = uvm_pglistalloc(size, 0, -1, alignment, boundary,
+ &mlist, nsegs, plaflag);
if (error)
return (error);