-/* $OpenBSD: uvm_aobj.c,v 1.63 2014/04/30 19:25:14 kettenis Exp $ */
+/* $OpenBSD: uvm_aobj.c,v 1.64 2014/05/08 20:08:50 kettenis Exp $ */
/* $NetBSD: uvm_aobj.c,v 1.39 2001/02/18 21:19:08 chs Exp $ */
/*
{
KASSERT(startpg < endpg);
KASSERT(uobj->uo_refs == 1);
- uao_flush(uobj, startpg << PAGE_SHIFT, endpg << PAGE_SHIFT, PGO_FREE);
+ uao_flush(uobj, (voff_t)startpg << PAGE_SHIFT,
+ (voff_t)endpg << PAGE_SHIFT, PGO_FREE);
uao_dropswap_range(uobj, startpg, endpg);
}
if (flags & PGO_ALLPAGES) {
start = 0;
- stop = aobj->u_pages << PAGE_SHIFT;
+ stop = (voff_t)aobj->u_pages << PAGE_SHIFT;
} else {
start = trunc_page(start);
stop = round_page(stop);
- if (stop > (aobj->u_pages << PAGE_SHIFT)) {
+ if (stop > ((voff_t)aobj->u_pages << PAGE_SHIFT)) {
printf("uao_flush: strange, got an out of range "
"flush (fixed)\n");
- stop = aobj->u_pages << PAGE_SHIFT;
+ stop = (voff_t)aobj->u_pages << PAGE_SHIFT;
}
}
pg = NULL;
npages = 1;
- rv = uao_get(&aobj->u_obj, pageidx << PAGE_SHIFT,
+ rv = uao_get(&aobj->u_obj, (voff_t)pageidx << PAGE_SHIFT,
&pg, &npages, 0, VM_PROT_READ|VM_PROT_WRITE, 0, 0);
switch (rv) {
int slot = elt->slots[j];
KASSERT(uvm_pagelookup(&aobj->u_obj,
- (UAO_SWHASH_ELT_PAGEIDX_BASE(elt)
+ (voff_t)(UAO_SWHASH_ELT_PAGEIDX_BASE(elt)
+ j) << PAGE_SHIFT) == NULL);
if (slot > 0) {
-/* $OpenBSD: uvm_fault.c,v 1.72 2014/04/13 23:14:15 tedu Exp $ */
+/* $OpenBSD: uvm_fault.c,v 1.73 2014/05/08 20:08:50 kettenis Exp $ */
/* $NetBSD: uvm_fault.c,v 1.51 2000/08/06 00:22:53 thorpej Exp $ */
/*
/* wide fault (!narrow) */
nback = min(uvmadvice[ufi.entry->advice].nback,
(ufi.orig_rvaddr - ufi.entry->start) >> PAGE_SHIFT);
- startva = ufi.orig_rvaddr - (nback << PAGE_SHIFT);
+ startva = ufi.orig_rvaddr - ((vsize_t)nback << PAGE_SHIFT);
nforw = min(uvmadvice[ufi.entry->advice].nforw,
((ufi.entry->end - ufi.orig_rvaddr) >>
PAGE_SHIFT) - 1);
if (uobj) {
uoff = (startva - ufi.entry->start) + ufi.entry->offset;
(void) uobj->pgops->pgo_flush(uobj, uoff, uoff +
- (nback << PAGE_SHIFT), PGO_DEACTIVATE);
+ ((vsize_t)nback << PAGE_SHIFT), PGO_DEACTIVATE);
}
/* now forget about the backpages */
if (amap)
anons += nback;
- startva += (nback << PAGE_SHIFT);
+ startva += ((vsize_t)nback << PAGE_SHIFT);
npages -= nback;
centeridx = 0;
}
-/* $OpenBSD: uvm_object.c,v 1.7 2013/05/30 15:17:59 tedu Exp $ */
+/* $OpenBSD: uvm_object.c,v 1.8 2014/05/08 20:08:50 kettenis Exp $ */
/*
* Copyright (c) 2006 The NetBSD Foundation, Inc.
*/
int
-uvm_objwire(struct uvm_object *uobj, off_t start, off_t end,
+uvm_objwire(struct uvm_object *uobj, voff_t start, voff_t end,
struct pglist *pageq)
{
- int i, npages, error;
+ int i, npages, left, error;
struct vm_page *pgs[FETCH_PAGECOUNT];
- off_t offset = start, left;
+ voff_t offset = start;
left = (end - start) >> PAGE_SHIFT;
uvm_page_unbusy(pgs, npages);
left -= npages;
- offset += npages << PAGE_SHIFT;
+ offset += (voff_t)npages << PAGE_SHIFT;
}
return 0;
*/
void
-uvm_objunwire(struct uvm_object *uobj, off_t start, off_t end)
+uvm_objunwire(struct uvm_object *uobj, voff_t start, voff_t end)
{
struct vm_page *pg;
off_t offset;
-/* $OpenBSD: uvm_object.h,v 1.19 2013/05/30 15:17:59 tedu Exp $ */
+/* $OpenBSD: uvm_object.h,v 1.20 2014/05/08 20:08:50 kettenis Exp $ */
/* $NetBSD: uvm_object.h,v 1.11 2001/03/09 01:02:12 chs Exp $ */
/*
((struct vnode *)uobj)->v_flag & VTEXT)
void uvm_objinit(struct uvm_object *, struct uvm_pagerops *, int);
-int uvm_objwire(struct uvm_object *, off_t, off_t, struct pglist *);
-void uvm_objunwire(struct uvm_object *, off_t, off_t);
+int uvm_objwire(struct uvm_object *, voff_t, voff_t, struct pglist *);
+void uvm_objunwire(struct uvm_object *, voff_t, voff_t);
#endif /* _KERNEL */
-/* $OpenBSD: uvm_pager.c,v 1.65 2014/04/13 23:14:15 tedu Exp $ */
+/* $OpenBSD: uvm_pager.c,v 1.66 2014/05/08 20:08:50 kettenis Exp $ */
/* $NetBSD: uvm_pager.c,v 1.36 2000/11/27 18:26:41 chs Exp $ */
/*
uvm_pagermapout(vaddr_t kva, int npages)
{
- pmap_remove(pmap_kernel(), kva, kva + (npages << PAGE_SHIFT));
+ pmap_remove(pmap_kernel(), kva, kva + ((vsize_t)npages << PAGE_SHIFT));
pmap_update(pmap_kernel());
uvm_pseg_release(kva);
uobj = NULL;
for (i = 0; i < npages; i++)
- pgs[i] = uvm_atopg((vaddr_t)bp->b_data + (i << PAGE_SHIFT));
+ pgs[i] = uvm_atopg((vaddr_t)bp->b_data +
+ ((vsize_t)i << PAGE_SHIFT));
uvm_pagermapout((vaddr_t)bp->b_data, npages);
#ifdef UVM_SWAP_ENCRYPT
/*
-/* $OpenBSD: uvm_swap.c,v 1.126 2014/04/29 09:55:28 kettenis Exp $ */
+/* $OpenBSD: uvm_swap.c,v 1.127 2014/05/08 20:08:50 kettenis Exp $ */
/* $NetBSD: uvm_swap.c,v 1.40 2000/11/17 11:39:39 mrg Exp $ */
/*
bp->b_vp = NULL;
buf_replacevnode(bp, swapdev_vp);
splx(s);
- bp->b_bufsize = bp->b_bcount = npages << PAGE_SHIFT;
+ bp->b_bufsize = bp->b_bcount = (long)npages << PAGE_SHIFT;
/*
* for pageouts we must set "dirtyoff" [NFS client code needs it].
-/* $OpenBSD: uvm_vnode.c,v 1.81 2014/04/13 23:14:15 tedu Exp $ */
+/* $OpenBSD: uvm_vnode.c,v 1.82 2014/05/08 20:08:50 kettenis Exp $ */
/* $NetBSD: uvm_vnode.c,v 1.36 2000/11/24 20:34:01 chs Exp $ */
/*
*/
/* fill out uio/iov */
iov.iov_base = (caddr_t) kva;
- wanted = npages << PAGE_SHIFT;
+ wanted = (size_t)npages << PAGE_SHIFT;
if (file_offset + wanted > uvn->u_size)
wanted = uvn->u_size - file_offset; /* XXX: needed? */
iov.iov_len = wanted;
result = EIO; /* XXX: error? */
} else if (got < PAGE_SIZE * npages && rw == UIO_READ) {
memset((void *) (kva + got), 0,
- (npages << PAGE_SHIFT) - got);
+ ((size_t)npages << PAGE_SHIFT) - got);
}
}