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/hppa64/dev/astro.c | 5 +++-- sys/arch/hppa64/hppa64/mainbus.c | 7 +++++-- sys/arch/hppa64/hppa64/pmap.c | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) (limited to 'sys/arch/hppa64') diff --git a/sys/arch/hppa64/dev/astro.c b/sys/arch/hppa64/dev/astro.c index dd804e91380..0af29e0751b 100644 --- a/sys/arch/hppa64/dev/astro.c +++ b/sys/arch/hppa64/dev/astro.c @@ -1,4 +1,4 @@ -/* $OpenBSD: astro.c,v 1.1 2008/04/20 17:17:32 kettenis Exp $ */ +/* $OpenBSD: astro.c,v 1.2 2009/04/14 16:01:04 oga Exp $ */ /* * Copyright (c) 2007 Mark Kettenis @@ -272,7 +272,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/hppa64/hppa64/mainbus.c b/sys/arch/hppa64/hppa64/mainbus.c index 8feca3234df..183c5aaab75 100644 --- a/sys/arch/hppa64/hppa64/mainbus.c +++ b/sys/arch/hppa64/hppa64/mainbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mainbus.c,v 1.8 2009/03/08 19:26:39 martin Exp $ */ +/* $OpenBSD: mainbus.c,v 1.9 2009/04/14 16:01:04 oga Exp $ */ /* * Copyright (c) 2005 Michael Shalayeff @@ -492,12 +492,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, (paddr_t)0, (paddr_t)-1, alignment, boundary, - &pglist, 1, flags & BUS_DMA_NOWAIT)) + &pglist, 1, plaflag)) return (ENOMEM); pg = TAILQ_FIRST(&pglist); diff --git a/sys/arch/hppa64/hppa64/pmap.c b/sys/arch/hppa64/hppa64/pmap.c index e04c55ff31b..49497df07a1 100644 --- a/sys/arch/hppa64/hppa64/pmap.c +++ b/sys/arch/hppa64/hppa64/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.6 2008/04/27 17:48:10 martin Exp $ */ +/* $OpenBSD: pmap.c,v 1.7 2009/04/14 16:01:04 oga Exp $ */ /* * Copyright (c) 2005 Michael Shalayeff @@ -622,7 +622,7 @@ pmap_create() TAILQ_INIT(&pmap->pm_pglist); if (uvm_pglistalloc(2 * PAGE_SIZE, 0, VM_MIN_KERNEL_ADDRESS, - PAGE_SIZE, 2 * PAGE_SIZE, &pmap->pm_pglist, 1, 1)) + PAGE_SIZE, 2 * PAGE_SIZE, &pmap->pm_pglist, 1, UVM_PLA_WAITOK)) panic("pmap_create: no pages"); pg = TAILQ_FIRST(&pmap->pm_pglist); -- cgit v1.2.3