summaryrefslogtreecommitdiff
path: root/sys/uvm
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2001-05-05 21:26:48 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2001-05-05 21:26:48 +0000
commitca8a4ccfe938b07fa473a582784074e5f93813cd (patch)
treee9075d1e6c63ae7e0fd9c950fcdebcfb637b3405 /sys/uvm
parent368552036fe6029364e1abc2351955db681286fc (diff)
Remove the (vaddr_t) casts inside the round_page and trunc_page macros.
We might want to use them on types that are bigger than vaddr_t. Fix all callers that pass pointers without casts.
Diffstat (limited to 'sys/uvm')
-rw-r--r--sys/uvm/uvm_glue.c20
-rw-r--r--sys/uvm/uvm_mmap.c6
-rw-r--r--sys/uvm/uvm_unix.c4
3 files changed, 15 insertions, 15 deletions
diff --git a/sys/uvm/uvm_glue.c b/sys/uvm/uvm_glue.c
index 64727047753..2908673394f 100644
--- a/sys/uvm/uvm_glue.c
+++ b/sys/uvm/uvm_glue.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_glue.c,v 1.11 2001/04/03 15:28:06 aaron Exp $ */
+/* $OpenBSD: uvm_glue.c,v 1.12 2001/05/05 21:26:45 art Exp $ */
/* $NetBSD: uvm_glue.c,v 1.23 1999/05/28 20:49:51 thorpej Exp $ */
/*
@@ -122,8 +122,8 @@ uvm_kernacc(addr, len, rw)
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);
@@ -170,7 +170,7 @@ uvm_useracc(addr, len, rw)
#endif
rv = uvm_map_checkprot(&curproc->p_vmspace->vm_map,
- trunc_page(addr), round_page(addr+len), prot);
+ trunc_page((vaddr_t)addr), round_page((vaddr_t)addr+len), prot);
return(rv);
}
@@ -198,8 +198,8 @@ uvm_chgkprot(addr, len, rw)
vaddr_t sva, eva;
prot = rw == B_READ ? VM_PROT_READ : VM_PROT_READ|VM_PROT_WRITE;
- eva = round_page(addr + len);
- for (sva = trunc_page(addr); sva < eva; sva += PAGE_SIZE) {
+ eva = round_page((vaddr_t)addr + len);
+ for (sva = trunc_page((vaddr_t)addr); sva < eva; sva += PAGE_SIZE) {
/*
* Extract physical address for the page.
* We use a cheezy hack to differentiate physical
@@ -229,8 +229,8 @@ uvm_vslock(p, addr, len, access_type)
vm_prot_t access_type;
{
- uvm_fault_wire(&p->p_vmspace->vm_map, trunc_page(addr),
- round_page(addr+len), access_type);
+ uvm_fault_wire(&p->p_vmspace->vm_map, trunc_page((vaddr_t)addr),
+ round_page((vaddr_t)addr+len), access_type);
}
/*
@@ -246,8 +246,8 @@ uvm_vsunlock(p, addr, len)
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 --git a/sys/uvm/uvm_mmap.c b/sys/uvm/uvm_mmap.c
index 56e23b78352..3aa87738299 100644
--- a/sys/uvm/uvm_mmap.c
+++ b/sys/uvm/uvm_mmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_mmap.c,v 1.10 2001/03/22 03:05:56 smart Exp $ */
+/* $OpenBSD: uvm_mmap.c,v 1.11 2001/05/05 21:26:46 art Exp $ */
/* $NetBSD: uvm_mmap.c,v 1.23 1999/06/16 17:25:39 minoura Exp $ */
/*
@@ -383,8 +383,8 @@ sys_mmap(p, v, retval)
* 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 --git a/sys/uvm/uvm_unix.c b/sys/uvm/uvm_unix.c
index 44ac0c01018..eef8c966119 100644
--- a/sys/uvm/uvm_unix.c
+++ b/sys/uvm/uvm_unix.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_unix.c,v 1.9 2001/05/05 20:57:03 art Exp $ */
+/* $OpenBSD: uvm_unix.c,v 1.10 2001/05/05 21:26:46 art Exp $ */
/* $NetBSD: uvm_unix.c,v 1.8 1999/03/25 18:48:56 mrg Exp $ */
/*
@@ -83,7 +83,7 @@ sys_obreak(p, v, retval)
long diff;
old = (vaddr_t)vm->vm_daddr;
- new = round_page(SCARG(uap, nsize));
+ new = round_page((vaddr_t)SCARG(uap, nsize));
if ((new - old) > p->p_rlimit[RLIMIT_DATA].rlim_cur)
return(ENOMEM);