Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/chs-ubc2]: src/sys add casts for trunc_page() and round_page() args.



details:   https://anonhg.NetBSD.org/src/rev/fdfed2a337db
branches:  chs-ubc2
changeset: 471460:fdfed2a337db
user:      chs <chs%NetBSD.org@localhost>
date:      Wed Aug 11 05:47:03 1999 +0000

description:
add casts for trunc_page() and round_page() args.

diffstat:

 sys/arch/alpha/alpha/machdep.c    |  12 ++++++------
 sys/arch/alpha/alpha/pmap.c       |   8 ++++----
 sys/arch/alpha/alpha/vm_machdep.c |   9 +++++----
 sys/arch/i386/i386/vm_machdep.c   |   7 ++++---
 sys/arch/sparc/sparc/vm_machdep.c |   6 +++---
 sys/compat/osf1/osf1_mmap.c       |   6 +++---
 sys/kern/sysv_shm.c               |   5 +++--
 sys/uvm/uvm_glue.c                |  18 +++++++++---------
 sys/uvm/uvm_mmap.c                |   9 ++++++---
 sys/uvm/uvm_unix.c                |   4 ++--
 10 files changed, 45 insertions(+), 39 deletions(-)

diffs (truncated from 305 to 300 lines):

diff -r b3c146665ea8 -r fdfed2a337db sys/arch/alpha/alpha/machdep.c
--- a/sys/arch/alpha/alpha/machdep.c    Wed Aug 11 05:42:52 1999 +0000
+++ b/sys/arch/alpha/alpha/machdep.c    Wed Aug 11 05:47:03 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.167.2.4.2.2 1999/07/01 23:00:55 thorpej Exp $ */
+/* $NetBSD: machdep.c,v 1.167.2.4.2.3 1999/08/11 05:47:03 chs Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -80,7 +80,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.167.2.4.2.2 1999/07/01 23:00:55 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.167.2.4.2.3 1999/08/11 05:47:03 chs Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -460,13 +460,13 @@
         * bit of space before the beginning for the bootstrap
         * stack).
         */
-       kernstart = trunc_page(kernel_text) - 2 * PAGE_SIZE;
+       kernstart = trunc_page((vaddr_t)kernel_text) - 2 * PAGE_SIZE;
 #ifdef DDB
        ksym_start = (void *)bootinfo.ssym;
        ksym_end   = (void *)bootinfo.esym;
-       kernend = (vaddr_t)round_page(ksym_end);
+       kernend = (vaddr_t)round_page((vaddr_t)ksym_end);
 #else
-       kernend = (vaddr_t)round_page(_end);
+       kernend = (vaddr_t)round_page((vaddr_t)_end);
 #endif
 
        kernstartpfn = atop(ALPHA_K0SEG_TO_PHYS(kernstart));
@@ -723,7 +723,7 @@
                /* warn if the message buffer had to be shrunk */
                if (sz != round_page(MSGBUFSIZE))
                        printf("WARNING: %ld bytes not available for msgbuf in last cluster (%ld used)\n",
-                           round_page(MSGBUFSIZE), sz);
+                           round_page((vaddr_t)MSGBUFSIZE), sz);
 
        }
 
diff -r b3c146665ea8 -r fdfed2a337db sys/arch/alpha/alpha/pmap.c
--- a/sys/arch/alpha/alpha/pmap.c       Wed Aug 11 05:42:52 1999 +0000
+++ b/sys/arch/alpha/alpha/pmap.c       Wed Aug 11 05:47:03 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.88.2.3.2.3 1999/08/02 19:32:42 thorpej Exp $ */
+/* $NetBSD: pmap.c,v 1.88.2.3.2.4 1999/08/11 05:47:03 chs Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -155,7 +155,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.88.2.3.2.3 1999/08/02 19:32:42 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.88.2.3.2.4 1999/08/11 05:47:03 chs Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -3364,7 +3364,7 @@
        paddr_t pa;
        int rval;
 
-       pa = ALPHA_K0SEG_TO_PHYS(trunc_page(kva));
+       pa = ALPHA_K0SEG_TO_PHYS(trunc_page((vaddr_t)kva));
        pvh = pa_to_pvh(pa);
 
        simple_lock(&pvh->pvh_slock);
@@ -3392,7 +3392,7 @@
        paddr_t pa;
        int rval;
 
-       pa = ALPHA_K0SEG_TO_PHYS(trunc_page(kva));
+       pa = ALPHA_K0SEG_TO_PHYS(trunc_page((vaddr_t)kva));
        pvh = pa_to_pvh(pa);
 
        simple_lock(&pvh->pvh_slock);
diff -r b3c146665ea8 -r fdfed2a337db sys/arch/alpha/alpha/vm_machdep.c
--- a/sys/arch/alpha/alpha/vm_machdep.c Wed Aug 11 05:42:52 1999 +0000
+++ b/sys/arch/alpha/alpha/vm_machdep.c Wed Aug 11 05:47:03 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vm_machdep.c,v 1.45.4.2 1999/08/02 19:32:42 thorpej Exp $ */
+/* $NetBSD: vm_machdep.c,v 1.45.4.3 1999/08/11 05:47:04 chs Exp $ */
 
 /*
  * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@@ -29,7 +29,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.45.4.2 1999/08/02 19:32:42 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.45.4.3 1999/08/11 05:47:04 chs Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -364,7 +364,8 @@
        if ((bp->b_flags & B_PHYS) == 0)
                panic("vmapbuf");
        p = bp->b_proc;
-       faddr = trunc_page(bp->b_saveaddr = bp->b_data);
+       bp->b_saveaddr = bp->b_data;
+       faddr = trunc_page((vaddr_t)bp->b_data);
        off = (vaddr_t)bp->b_data - faddr;
        len = round_page(off + len);
        taddr = uvm_km_valloc_wait(phys_map, len);
@@ -393,7 +394,7 @@
 
        if ((bp->b_flags & B_PHYS) == 0)
                panic("vunmapbuf");
-       addr = trunc_page(bp->b_data);
+       addr = trunc_page((vaddr_t)bp->b_data);
        off = (vaddr_t)bp->b_data - addr;
        len = round_page(off + len);
        uvm_km_free_wakeup(phys_map, addr, len);
diff -r b3c146665ea8 -r fdfed2a337db sys/arch/i386/i386/vm_machdep.c
--- a/sys/arch/i386/i386/vm_machdep.c   Wed Aug 11 05:42:52 1999 +0000
+++ b/sys/arch/i386/i386/vm_machdep.c   Wed Aug 11 05:47:03 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vm_machdep.c,v 1.75.2.1.2.2 1999/08/02 19:50:34 thorpej Exp $  */
+/*     $NetBSD: vm_machdep.c,v 1.75.2.1.2.3 1999/08/11 05:47:05 chs Exp $      */
 
 /*-
  * Copyright (c) 1995 Charles M. Hannum.  All rights reserved.
@@ -373,7 +373,8 @@
 
        if ((bp->b_flags & B_PHYS) == 0)
                panic("vmapbuf");
-       faddr = trunc_page(bp->b_saveaddr = bp->b_data);
+       bp->b_saveaddr = bp->b_data;
+       faddr = trunc_page((vaddr_t)bp->b_data);
        off = (vaddr_t)bp->b_data - faddr;
        len = round_page(off + len);
        taddr= uvm_km_valloc_wait(phys_map, len);
@@ -413,7 +414,7 @@
 
        if ((bp->b_flags & B_PHYS) == 0)
                panic("vunmapbuf");
-       addr = trunc_page(bp->b_data);
+       addr = trunc_page((vaddr_t)bp->b_data);
        off = (vaddr_t)bp->b_data - addr;
        len = round_page(off + len);
        uvm_km_free_wakeup(phys_map, addr, len);
diff -r b3c146665ea8 -r fdfed2a337db sys/arch/sparc/sparc/vm_machdep.c
--- a/sys/arch/sparc/sparc/vm_machdep.c Wed Aug 11 05:42:52 1999 +0000
+++ b/sys/arch/sparc/sparc/vm_machdep.c Wed Aug 11 05:47:03 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vm_machdep.c,v 1.44.4.2 1999/08/02 20:09:15 thorpej Exp $ */
+/*     $NetBSD: vm_machdep.c,v 1.44.4.3 1999/08/11 05:47:05 chs Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -119,7 +119,7 @@
         * segment boundary to avoid VAC problems!
         */
        bp->b_saveaddr = bp->b_data;
-       uva = trunc_page(bp->b_data);
+       uva = trunc_page((vaddr_t)bp->b_data);
        off = (vaddr_t)bp->b_data - uva;
        len = round_page(off + len);
        kva = uvm_km_valloc_wait(kernel_map, len);
@@ -161,7 +161,7 @@
        if ((bp->b_flags & B_PHYS) == 0)
                panic("vunmapbuf");
 
-       kva = trunc_page(bp->b_data);
+       kva = trunc_page((vaddr_t)bp->b_data);
        off = (vaddr_t)bp->b_data - kva;
        len = round_page(off + len);
 
diff -r b3c146665ea8 -r fdfed2a337db sys/compat/osf1/osf1_mmap.c
--- a/sys/compat/osf1/osf1_mmap.c       Wed Aug 11 05:42:52 1999 +0000
+++ b/sys/compat/osf1/osf1_mmap.c       Wed Aug 11 05:47:03 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: osf1_mmap.c,v 1.3.2.1 1999/06/21 01:08:34 thorpej Exp $ */
+/* $NetBSD: osf1_mmap.c,v 1.3.2.2 1999/08/11 05:47:05 chs Exp $ */
 
 /*
  * Copyright (c) 1999 Christopher G. Demetriou.  All rights reserved.
@@ -174,8 +174,8 @@
         *   provide a better way to avoid the data region altogether.
         */
        if ((SCARG(&a, flags) & MAP_FIXED) == 0) {
-               vaddr_t addr = round_page(SCARG(&a, addr));
-               vsize_t size = round_page(SCARG(&a, len));
+               vaddr_t addr = round_page((vaddr_t)SCARG(&a, addr));
+               vsize_t size = round_page((vsize_t)SCARG(&a, len));
                int fixed = 0;
 
                vm_map_lock(&p->p_vmspace->vm_map);
diff -r b3c146665ea8 -r fdfed2a337db sys/kern/sysv_shm.c
--- a/sys/kern/sysv_shm.c       Wed Aug 11 05:42:52 1999 +0000
+++ b/sys/kern/sysv_shm.c       Wed Aug 11 05:47:03 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sysv_shm.c,v 1.51 1999/03/24 05:51:25 mrg Exp $        */
+/*     $NetBSD: sysv_shm.c,v 1.51.4.1 1999/08/11 05:47:05 chs Exp $    */
 
 /*
  * Copyright (c) 1994 Adam Glass and Charles M. Hannum.  All rights reserved.
@@ -247,7 +247,8 @@
        } else {
                /* This is just a hint to vm_mmap() about where to put it. */
                attach_va =
-                   round_page(p->p_vmspace->vm_taddr + MAXTSIZ + MAXDSIZ);
+                   round_page((vaddr_t)p->p_vmspace->vm_taddr + MAXTSIZ +
+                              MAXDSIZ);
        }
        shm_handle = shmseg->shm_internal;
        uao_reference(shm_handle->shm_object);
diff -r b3c146665ea8 -r fdfed2a337db sys/uvm/uvm_glue.c
--- a/sys/uvm/uvm_glue.c        Wed Aug 11 05:42:52 1999 +0000
+++ b/sys/uvm/uvm_glue.c        Wed Aug 11 05:47:03 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_glue.c,v 1.18.4.2 1999/08/02 23:16:14 thorpej Exp $        */
+/*     $NetBSD: uvm_glue.c,v 1.18.4.3 1999/08/11 05:47:06 chs Exp $    */
 
 /* 
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -149,8 +149,8 @@
        vaddr_t saddr, eaddr;
        vm_prot_t prot = rw == B_READ ? VM_PROT_READ : VM_PROT_WRITE;
 
-       saddr = trunc_page(addr);
-       eaddr = round_page(addr+len);
+       saddr = trunc_page((vaddr_t)addr);
+       eaddr = round_page((vaddr_t)addr + len);
        vm_map_lock_read(kernel_map);
        rv = uvm_map_checkprot(kernel_map, saddr, eaddr, prot);
        vm_map_unlock_read(kernel_map);
@@ -190,8 +190,8 @@
        map = &curproc->p_vmspace->vm_map;
 
        vm_map_lock_read(map);
-       rv = uvm_map_checkprot(map, trunc_page(addr), round_page(addr+len),
-           prot);
+       rv = uvm_map_checkprot(map, trunc_page((vaddr_t)addr),
+                              round_page((vaddr_t)addr + len), prot);
        vm_map_unlock_read(map);
 
        return(rv);
@@ -255,8 +255,8 @@
        int rv;
 
        map = &p->p_vmspace->vm_map;
-       start = trunc_page(addr);
-       end = round_page(addr + len);
+       start = trunc_page((vaddr_t)addr);
+       end = round_page((vaddr_t)addr + len);
 
        rv = uvm_fault_wire(map, start, end, access_type);
 
@@ -276,8 +276,8 @@
        caddr_t addr;
        size_t  len;
 {
-       uvm_fault_unwire(&p->p_vmspace->vm_map, trunc_page(addr), 
-               round_page(addr+len));
+       uvm_fault_unwire(&p->p_vmspace->vm_map, trunc_page((vaddr_t)addr),
+               round_page((vaddr_t)addr + len));
 }
 
 /*
diff -r b3c146665ea8 -r fdfed2a337db sys/uvm/uvm_mmap.c
--- a/sys/uvm/uvm_mmap.c        Wed Aug 11 05:42:52 1999 +0000
+++ b/sys/uvm/uvm_mmap.c        Wed Aug 11 05:47:03 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_mmap.c,v 1.19.4.6 1999/08/09 00:05:56 chs Exp $    */
+/*     $NetBSD: uvm_mmap.c,v 1.19.4.7 1999/08/11 05:47:06 chs Exp $    */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -379,8 +379,11 @@
                 * not fixed: make sure we skip over the largest possible heap.
                 * we will refine our guess later (e.g. to account for VAC, etc)
                 */
-               if (addr < round_page(p->p_vmspace->vm_daddr + MAXDSIZ))
-                       addr = round_page(p->p_vmspace->vm_daddr + MAXDSIZ);
+
+               if (addr < round_page((vaddr_t)p->p_vmspace->vm_daddr +
+                                     MAXDSIZ))
+                       addr = round_page((vaddr_t)p->p_vmspace->vm_daddr +
+                                         MAXDSIZ);
        }
 
        /*
diff -r b3c146665ea8 -r fdfed2a337db sys/uvm/uvm_unix.c
--- a/sys/uvm/uvm_unix.c        Wed Aug 11 05:42:52 1999 +0000
+++ b/sys/uvm/uvm_unix.c        Wed Aug 11 05:47:03 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_unix.c,v 1.8 1999/03/25 18:48:56 mrg Exp $ */
+/*     $NetBSD: uvm_unix.c,v 1.8.4.1 1999/08/11 05:47:06 chs Exp $     */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -82,7 +82,7 @@
        register int diff;
 
        old = (vaddr_t)vm->vm_daddr;



Home | Main Index | Thread Index | Old Index