From 736b9535289dd9e3a0ffaafbb736c868a7f377d6 Mon Sep 17 00:00:00 2001 From: Owain Ainsworth Date: Tue, 14 Apr 2009 16:01:05 +0000 Subject: 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@ --- sys/arch/sgi/sgi/bus_dma.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'sys/arch/sgi') diff --git a/sys/arch/sgi/sgi/bus_dma.c b/sys/arch/sgi/sgi/bus_dma.c index 9842544c9eb..f80d9fe350b 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.7 2009/03/07 15:34:34 miod Exp $ */ +/* $OpenBSD: bus_dma.c,v 1.8 2009/04/14 16:01:04 oga Exp $ */ /* * Copyright (c) 2003-2004 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -609,7 +609,7 @@ _dmamem_alloc_range(t, size, alignment, boundary, segs, nsegs, rsegs, vaddr_t curaddr, lastaddr; vm_page_t m; struct pglist mlist; - int curseg, error; + int curseg, error, plaflag; /* Always round the size. */ size = round_page(size); @@ -617,9 +617,11 @@ _dmamem_alloc_range(t, size, alignment, boundary, segs, nsegs, rsegs, /* * Allocate pages from the VM system. */ + plaflag = flags & BUS_DMA_NOWAIT ? UVM_PLA_NOWAIT : UVM_PLA_WAITOK; + TAILQ_INIT(&mlist); - 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, plaflag); if (error) return (error); -- cgit v1.2.3