diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2010-03-31 19:46:28 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2010-03-31 19:46:28 +0000 |
commit | 4cddf39fa9f2c247e9b4dffe23108d570a07d80c (patch) | |
tree | 9df839790aa56567db75db4a0f289c8a7d888c22 /sys/arch | |
parent | 294102cc36f58535b618cfa97ca80dd1461dc030 (diff) |
Make sure the boundaries of uvm_pglistalloc() calls are set up with low
being page-aligned, and high being end of page (i.e.
high & PAGE_MASK == PAGE_MASK) everywhere, for consistency. Future code
will depend on this.
ok deraadt@
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/alpha/alpha/cpu.c | 4 | ||||
-rw-r--r-- | sys/arch/arm/arm/bus_dma.c | 4 | ||||
-rw-r--r-- | sys/arch/arm/arm/pmap.c | 5 | ||||
-rw-r--r-- | sys/arch/aviion/dev/if_le_syscon.c | 4 | ||||
-rw-r--r-- | sys/arch/hppa64/hppa64/pmap.c | 4 | ||||
-rw-r--r-- | sys/arch/mac68k/dev/if_mc_obio.c | 6 | ||||
-rw-r--r-- | sys/arch/mac68k/dev/if_sn.c | 4 | ||||
-rw-r--r-- | sys/arch/macppc/macppc/cpu.c | 4 |
8 files changed, 18 insertions, 17 deletions
diff --git a/sys/arch/alpha/alpha/cpu.c b/sys/arch/alpha/alpha/cpu.c index 75cdf808b24..0ba05952be5 100644 --- a/sys/arch/alpha/alpha/cpu.c +++ b/sys/arch/alpha/alpha/cpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.c,v 1.26 2010/02/20 12:39:41 sobrado Exp $ */ +/* $OpenBSD: cpu.c,v 1.27 2010/03/31 19:46:25 miod Exp $ */ /* $NetBSD: cpu.c,v 1.44 2000/05/23 05:12:53 thorpej Exp $ */ /*- @@ -338,7 +338,7 @@ recognized: * Allocate UPAGES contiguous pages for the idle PCB and stack. */ TAILQ_INIT(&mlist); - error = uvm_pglistalloc(USPACE, avail_start, avail_end, 0, 0, + error = uvm_pglistalloc(USPACE, avail_start, avail_end - 1, 0, 0, &mlist, 1, UVM_PLA_WAITOK); if (error != 0) { if (ma->ma_slot == hwrpb->rpb_primary_cpu_id) { diff --git a/sys/arch/arm/arm/bus_dma.c b/sys/arch/arm/arm/bus_dma.c index d0b2c8ed199..f81bc6dd9ed 100644 --- a/sys/arch/arm/arm/bus_dma.c +++ b/sys/arch/arm/arm/bus_dma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bus_dma.c,v 1.16 2010/03/29 19:21:58 oga Exp $ */ +/* $OpenBSD: bus_dma.c,v 1.17 2010/03/31 19:46:26 miod Exp $ */ /* $NetBSD: bus_dma.c,v 1.38 2003/10/30 08:44:13 scw Exp $ */ /*- @@ -630,7 +630,7 @@ _bus_dmamem_alloc(bus_dma_tag_t t, bus_size_t size, bus_size_t alignment, error = _bus_dmamem_alloc_range(t, size, alignment, boundary, segs, nsegs, rsegs, flags, trunc_page(dr->dr_sysbase), - trunc_page(dr->dr_sysbase + dr->dr_len)); + trunc_page(dr->dr_sysbase + dr->dr_len) - 1); if (error == 0) break; } diff --git a/sys/arch/arm/arm/pmap.c b/sys/arch/arm/arm/pmap.c index 077379b490e..96df3c0a0e8 100644 --- a/sys/arch/arm/arm/pmap.c +++ b/sys/arch/arm/arm/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.24 2009/07/14 13:59:49 drahn Exp $ */ +/* $OpenBSD: pmap.c,v 1.25 2010/03/31 19:46:26 miod Exp $ */ /* $NetBSD: pmap.c,v 1.147 2004/01/18 13:03:50 scw Exp $ */ /* @@ -4208,7 +4208,8 @@ pmap_postinit(void) TAILQ_INIT(&plist); error = uvm_pglistalloc(L1_TABLE_SIZE, physical_start, - physical_end, L1_TABLE_SIZE, 0, &plist, 1, UVM_PLA_WAITOK); + physical_end - 1, L1_TABLE_SIZE, 0, &plist, 1, + UVM_PLA_WAITOK); if (error) panic("Cannot allocate L1 physical pages"); diff --git a/sys/arch/aviion/dev/if_le_syscon.c b/sys/arch/aviion/dev/if_le_syscon.c index 2bdf414a7e8..ba1bf832b7b 100644 --- a/sys/arch/aviion/dev/if_le_syscon.c +++ b/sys/arch/aviion/dev/if_le_syscon.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_le_syscon.c,v 1.7 2009/04/14 16:01:04 oga Exp $ */ +/* $OpenBSD: if_le_syscon.c,v 1.8 2010/03/31 19:46:27 miod Exp $ */ /*- * Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -148,7 +148,7 @@ le_syscon_attach(parent, self, aux) etherpages = 16; for (;;) { TAILQ_INIT(&pglist); - rc = uvm_pglistalloc(ptoa(etherpages), 0, 1 << 24, + rc = uvm_pglistalloc(ptoa(etherpages), 0, (1 << 24) - 1, 0, 0, &pglist, 1, UVM_PLA_NOWAIT); if (rc == 0) break; diff --git a/sys/arch/hppa64/hppa64/pmap.c b/sys/arch/hppa64/hppa64/pmap.c index 43cc943d358..879d7f9951a 100644 --- a/sys/arch/hppa64/hppa64/pmap.c +++ b/sys/arch/hppa64/hppa64/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.8 2009/12/16 16:54:42 jasper Exp $ */ +/* $OpenBSD: pmap.c,v 1.9 2010/03/31 19:46:27 miod Exp $ */ /* * Copyright (c) 2005 Michael Shalayeff @@ -620,7 +620,7 @@ pmap_create() pmap->pm_ptphint = NULL; TAILQ_INIT(&pmap->pm_pglist); - if (uvm_pglistalloc(2 * PAGE_SIZE, 0, VM_MIN_KERNEL_ADDRESS, + if (uvm_pglistalloc(2 * PAGE_SIZE, 0, VM_MIN_KERNEL_ADDRESS - 1, PAGE_SIZE, 2 * PAGE_SIZE, &pmap->pm_pglist, 1, UVM_PLA_WAITOK)) panic("pmap_create: no pages"); diff --git a/sys/arch/mac68k/dev/if_mc_obio.c b/sys/arch/mac68k/dev/if_mc_obio.c index 5601ebd76c5..89f701e9a7d 100644 --- a/sys/arch/mac68k/dev/if_mc_obio.c +++ b/sys/arch/mac68k/dev/if_mc_obio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_mc_obio.c,v 1.8 2009/04/14 16:01:04 oga Exp $ */ +/* $OpenBSD: if_mc_obio.c,v 1.9 2010/03/31 19:46:27 miod Exp $ */ /* $NetBSD: if_mc_obio.c,v 1.13 2004/03/26 12:15:46 wiz Exp $ */ /*- @@ -138,7 +138,7 @@ mc_obio_attach(parent, self, aux) /* allocate memory for transmit buffer and mark it non-cacheable */ TAILQ_INIT(&txlist); - if (uvm_pglistalloc(PAGE_SIZE, 0, -PAGE_SIZE, PAGE_SIZE, 0, + if (uvm_pglistalloc(PAGE_SIZE, 0, -1, PAGE_SIZE, 0, &txlist, 1, UVM_PLA_NOWAIT) != 0) { printf(": could not allocate transmit buffer memory\n"); goto out1; @@ -158,7 +158,7 @@ mc_obio_attach(parent, self, aux) * allocate memory for receive buffer and mark it non-cacheable */ TAILQ_INIT(&rxlist); - if (uvm_pglistalloc(MC_NPAGES * PAGE_SIZE, 0, -PAGE_SIZE, PAGE_SIZE, 0, + if (uvm_pglistalloc(MC_NPAGES * PAGE_SIZE, 0, -1, PAGE_SIZE, 0, &rxlist, 1, UVM_PLA_NOWAIT) != 0) { printf(": could not allocate receive buffer memory\n"); goto out3; diff --git a/sys/arch/mac68k/dev/if_sn.c b/sys/arch/mac68k/dev/if_sn.c index 74bf85d5c3d..b60fbe50eb0 100644 --- a/sys/arch/mac68k/dev/if_sn.c +++ b/sys/arch/mac68k/dev/if_sn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_sn.c,v 1.53 2009/04/14 16:01:04 oga Exp $ */ +/* $OpenBSD: if_sn.c,v 1.54 2010/03/31 19:46:27 miod Exp $ */ /* $NetBSD: if_sn.c,v 1.13 1997/04/25 03:40:10 briggs Exp $ */ /* @@ -113,7 +113,7 @@ snsetup(struct sn_softc *sc, u_int8_t *lladdr) * to do that? */ TAILQ_INIT(&pglist); - error = uvm_pglistalloc(SN_NPAGES * PAGE_SIZE, 0, -PAGE_SIZE, + error = uvm_pglistalloc(SN_NPAGES * PAGE_SIZE, 0, -1, PAGE_SIZE, 0, &pglist, 1, UVM_PLA_NOWAIT); if (error != 0) { printf(": could not allocate descriptor memory\n"); diff --git a/sys/arch/macppc/macppc/cpu.c b/sys/arch/macppc/macppc/cpu.c index ff0bf64d184..2f76590892d 100644 --- a/sys/arch/macppc/macppc/cpu.c +++ b/sys/arch/macppc/macppc/cpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.c,v 1.64 2009/08/27 20:42:01 miod Exp $ */ +/* $OpenBSD: cpu.c,v 1.65 2010/03/31 19:46:27 miod Exp $ */ /* * Copyright (c) 1997 Per Fogelstrom @@ -583,7 +583,7 @@ cpu_spinup(struct device *self, struct cpu_info *ci) size += 8192; /* SPILLSTK(1k) + DDBSTK(7k) */ TAILQ_INIT(&mlist); - error = uvm_pglistalloc(size, 0x0, 0x10000000, 0, 0, + error = uvm_pglistalloc(size, 0x0, 0x10000000 - 1, 0, 0, &mlist, 1, UVM_PLA_WAITOK); if (error) { printf(": unable to allocate idle stack\n"); |