diff options
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/hppa/hppa/machdep.c | 8 | ||||
-rw-r--r-- | sys/arch/hppa/hppa/mainbus.c | 11 |
2 files changed, 11 insertions, 8 deletions
diff --git a/sys/arch/hppa/hppa/machdep.c b/sys/arch/hppa/hppa/machdep.c index f2d8d0387e5..20367e2a9ab 100644 --- a/sys/arch/hppa/hppa/machdep.c +++ b/sys/arch/hppa/hppa/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.84 2002/10/07 15:32:37 mickey Exp $ */ +/* $OpenBSD: machdep.c,v 1.85 2002/10/13 15:53:39 mickey Exp $ */ /* * Copyright (c) 1999-2002 Michael Shalayeff @@ -162,6 +162,7 @@ int (*cpu_dbtlb_ins)(int i, pa_space_t sp, vaddr_t va, paddr_t pa, dev_t bootdev; int totalphysmem, resvmem, physmem, esym; +paddr_t avail_end; /* * Things for MI glue to stick on. @@ -408,8 +409,9 @@ hppa_init(start) ptlball(); fcacheall(); - totalphysmem = PAGE0->imm_max_mem / NBPG; - resvmem = ((vaddr_t)&kernel_text) / NBPG; + totalphysmem = btoc(PAGE0->imm_max_mem); + resvmem = btoc(((vaddr_t)&kernel_text)); + avail_end = ctob(totalphysmem); #if defined(HP7100LC_CPU) || defined(HP7300LC_CPU) if (pdc_call((iodcio_t)pdc, 0, PDC_TLB, PDC_TLB_INFO, &pdc_hwtlb) && diff --git a/sys/arch/hppa/hppa/mainbus.c b/sys/arch/hppa/hppa/mainbus.c index f0737c0a8ac..2499784e03b 100644 --- a/sys/arch/hppa/hppa/mainbus.c +++ b/sys/arch/hppa/hppa/mainbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mainbus.c,v 1.35 2002/10/07 18:35:56 mickey Exp $ */ +/* $OpenBSD: mainbus.c,v 1.36 2002/10/13 15:53:39 mickey Exp $ */ /* * Copyright (c) 1998-2001 Michael Shalayeff @@ -720,6 +720,7 @@ mbus_dmamem_alloc(void *v, bus_size_t size, bus_size_t alignment, bus_size_t boundary, bus_dma_segment_t *segs, int nsegs, int *rsegs, int flags) { + extern paddr_t avail_end; struct pglist pglist; struct vm_page *pg; vaddr_t va; @@ -727,15 +728,15 @@ mbus_dmamem_alloc(void *v, bus_size_t size, bus_size_t alignment, size = round_page(size); TAILQ_INIT(&pglist); - if (uvm_pglistalloc(size, VM_MIN_KERNEL_ADDRESS, VM_MAX_KERNEL_ADDRESS, - alignment, 0, &pglist, 1, FALSE)) - return ENOMEM; + if (uvm_pglistalloc(size, 0, avail_end, alignment, boundary, + &pglist, nsegs, flags & BUS_DMA_NOWAIT)) + return (ENOMEM); if (uvm_map(kernel_map, &va, size, NULL, UVM_UNKNOWN_OFFSET, 0, UVM_MAPFLAG(UVM_PROT_RW, UVM_PROT_RW, UVM_INH_NONE, UVM_ADV_RANDOM, 0))) { uvm_pglistfree(&pglist); - return ENOMEM; + return (ENOMEM); } segs[0].ds_addr = va; |