diff options
author | Owain Ainsworth <oga@cvs.openbsd.org> | 2009-04-14 16:01:05 +0000 |
---|---|---|
committer | Owain Ainsworth <oga@cvs.openbsd.org> | 2009-04-14 16:01:05 +0000 |
commit | 736b9535289dd9e3a0ffaafbb736c868a7f377d6 (patch) | |
tree | 608c5bb2fc645051c56618391202edc1c0f9e6e8 /sys/arch/hppa | |
parent | 1b91dd8d89d56b40421b288402b14602db6d9a0f (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/hppa')
-rw-r--r-- | sys/arch/hppa/dev/astro.c | 5 | ||||
-rw-r--r-- | sys/arch/hppa/hppa/mainbus.c | 7 |
2 files changed, 8 insertions, 4 deletions
diff --git a/sys/arch/hppa/dev/astro.c b/sys/arch/hppa/dev/astro.c index 13c18a086ee..2edf4596dcd 100644 --- a/sys/arch/hppa/dev/astro.c +++ b/sys/arch/hppa/dev/astro.c @@ -1,4 +1,4 @@ -/* $OpenBSD: astro.c,v 1.8 2007/10/06 23:50:54 krw Exp $ */ +/* $OpenBSD: astro.c,v 1.9 2009/04/14 16:01:04 oga Exp $ */ /* * Copyright (c) 2007 Mark Kettenis @@ -271,7 +271,8 @@ astro_attach(struct device *parent, struct device *self, void *aux) size = (1 << (iova_bits - PAGE_SHIFT)) * sizeof(u_int64_t); TAILQ_INIT(&mlist); - if (uvm_pglistalloc(size, 0, -1, PAGE_SIZE, 0, &mlist, 1, 0) != 0) + if (uvm_pglistalloc(size, 0, -1, PAGE_SIZE, 0, &mlist, + 1, UVM_PLA_NOWAIT) != 0) panic("astrottach: no memory"); va = uvm_km_valloc(kernel_map, size); diff --git a/sys/arch/hppa/hppa/mainbus.c b/sys/arch/hppa/hppa/mainbus.c index 2507dc203de..72cb94111dc 100644 --- a/sys/arch/hppa/hppa/mainbus.c +++ b/sys/arch/hppa/hppa/mainbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mainbus.c,v 1.72 2009/03/08 19:26:39 martin Exp $ */ +/* $OpenBSD: mainbus.c,v 1.73 2009/04/14 16:01:04 oga Exp $ */ /* * Copyright (c) 1998-2004 Michael Shalayeff @@ -937,12 +937,15 @@ mbus_dmamem_alloc(void *v, bus_size_t size, bus_size_t alignment, { struct pglist pglist; struct vm_page *pg; + int plaflag; size = round_page(size); + plaflag = flags & BUS_DMA_NOWAIT ? UVM_PLA_NOWAIT : UVM_PLA_WAITOK; + TAILQ_INIT(&pglist); if (uvm_pglistalloc(size, 0, -1, alignment, boundary, - &pglist, 1, flags & BUS_DMA_NOWAIT)) + &pglist, 1, plaflag)) return (ENOMEM); pg = TAILQ_FIRST(&pglist); |