summaryrefslogtreecommitdiff
path: root/sys/arch/i386
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/i386
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/i386')
-rw-r--r--sys/arch/i386/i386/bus_dma.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/arch/i386/i386/bus_dma.c b/sys/arch/i386/i386/bus_dma.c
index 7cbd3a8c9b5..bafc5376102 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.11 2009/04/09 03:08:36 dlg Exp $ */
+/* $OpenBSD: bus_dma.c,v 1.12 2009/04/14 16:01:04 oga Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -588,7 +588,7 @@ _bus_dmamem_alloc_range(bus_dma_tag_t t, bus_size_t size, bus_size_t alignment,
paddr_t curaddr, lastaddr;
struct vm_page *m;
struct pglist mlist;
- int curseg, error;
+ int curseg, error, plaflag;
/* Always round the size. */
size = round_page(size);
@@ -598,11 +598,13 @@ _bus_dmamem_alloc_range(bus_dma_tag_t t, bus_size_t size, bus_size_t alignment,
* Allocate pages from the VM system.
* For non-ISA mappings first try higher memory segments.
*/
+ plaflag = flags & BUS_DMA_NOWAIT ? UVM_PLA_NOWAIT : UVM_PLA_WAITOK;
+
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)))
+ &mlist, nsegs, plaflag)))
error = uvm_pglistalloc(size, low, high, alignment, boundary,
- &mlist, nsegs, (flags & BUS_DMA_NOWAIT) == 0);
+ &mlist, nsegs, plaflag);
if (error)
return (error);