summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/sys/vnode.h3
-rw-r--r--sys/uvm/uvm_aobj.c30
-rw-r--r--sys/uvm/uvm_device.c24
-rw-r--r--sys/uvm/uvm_extern.h16
-rw-r--r--sys/uvm/uvm_glue.c6
-rw-r--r--sys/uvm/uvm_map.c12
-rw-r--r--sys/uvm/uvm_map.h6
-rw-r--r--sys/uvm/uvm_mmap.c23
-rw-r--r--sys/uvm/uvm_page.c8
-rw-r--r--sys/uvm/uvm_page.h6
-rw-r--r--sys/uvm/uvm_page_i.h6
-rw-r--r--sys/uvm/uvm_pager.c12
-rw-r--r--sys/uvm/uvm_pager.h22
-rw-r--r--sys/uvm/uvm_unix.c4
-rw-r--r--sys/uvm/uvm_vnode.c82
-rw-r--r--sys/uvm/uvm_vnode.h6
-rw-r--r--sys/vm/vm.h7
-rw-r--r--sys/vm/vm_map.h6
-rw-r--r--sys/vm/vm_page.h10
-rw-r--r--sys/vm/vm_param.h4
20 files changed, 134 insertions, 159 deletions
diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h
index 17dabf6a289..f1866ed6003 100644
--- a/sys/sys/vnode.h
+++ b/sys/sys/vnode.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vnode.h,v 1.36 2001/07/05 07:31:52 art Exp $ */
+/* $OpenBSD: vnode.h,v 1.37 2001/08/06 14:03:04 art Exp $ */
/* $NetBSD: vnode.h,v 1.38 1996/02/29 20:59:05 cgd Exp $ */
/*
@@ -43,6 +43,7 @@
/* XXX: clean up includes later */
#include <vm/pglist.h> /* XXX */
#include <vm/vm_param.h> /* XXX */
+#include <vm/vm.h> /* XXX */
#include <sys/lock.h> /* XXX */
#include <uvm/uvm_object.h> /* XXX */
#include <uvm/uvm_vnode.h> /* XXX */
diff --git a/sys/uvm/uvm_aobj.c b/sys/uvm/uvm_aobj.c
index d54131f4178..c0502bbe321 100644
--- a/sys/uvm/uvm_aobj.c
+++ b/sys/uvm/uvm_aobj.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: uvm_aobj.c,v 1.12 2001/07/26 19:37:13 art Exp $ */
-/* $NetBSD: uvm_aobj.c,v 1.27 2000/01/11 06:57:49 chs Exp $ */
+/* $OpenBSD: uvm_aobj.c,v 1.13 2001/08/06 14:03:04 art Exp $ */
+/* $NetBSD: uvm_aobj.c,v 1.28 2000/03/26 20:54:46 kleink Exp $ */
/*
* Copyright (c) 1998 Chuck Silvers, Charles D. Cranor and
@@ -121,7 +121,7 @@
struct uao_swhash_elt {
LIST_ENTRY(uao_swhash_elt) list; /* the hash list */
- vaddr_t tag; /* our 'tag' */
+ voff_t tag; /* our 'tag' */
int count; /* our number of active slots */
int slots[UAO_SWHASH_CLUSTER_SIZE]; /* the slots */
};
@@ -172,16 +172,14 @@ struct pool uvm_aobj_pool;
static struct uao_swhash_elt *uao_find_swhash_elt __P((struct uvm_aobj *,
int, boolean_t));
-static int uao_find_swslot __P((struct uvm_aobj *,
- int));
-static boolean_t uao_flush __P((struct uvm_object *,
- vaddr_t, vaddr_t,
- int));
+static int uao_find_swslot __P((struct uvm_aobj *, int));
+static boolean_t uao_flush __P((struct uvm_object *,
+ voff_t, voff_t, int));
static void uao_free __P((struct uvm_aobj *));
-static int uao_get __P((struct uvm_object *, vaddr_t,
- vm_page_t *, int *, int,
+static int uao_get __P((struct uvm_object *, voff_t,
+ vm_page_t *, int *, int,
vm_prot_t, int, int));
-static boolean_t uao_releasepg __P((struct vm_page *,
+static boolean_t uao_releasepg __P((struct vm_page *,
struct vm_page **));
static boolean_t uao_pagein __P((struct uvm_aobj *, int, int));
static boolean_t uao_pagein_page __P((struct uvm_aobj *, int));
@@ -241,7 +239,7 @@ uao_find_swhash_elt(aobj, pageidx, create)
{
struct uao_swhash *swhash;
struct uao_swhash_elt *elt;
- int page_tag;
+ voff_t page_tag;
swhash = UAO_SWHASH_HASH(aobj, pageidx); /* first hash to get bucket */
page_tag = UAO_SWHASH_ELT_TAG(pageidx); /* tag to search for */
@@ -795,13 +793,13 @@ uao_detach_locked(uobj)
boolean_t
uao_flush(uobj, start, stop, flags)
struct uvm_object *uobj;
- vaddr_t start, stop;
+ voff_t start, stop;
int flags;
{
struct uvm_aobj *aobj = (struct uvm_aobj *) uobj;
struct vm_page *pp, *ppnext;
boolean_t retval, by_list;
- vaddr_t curoff;
+ voff_t curoff;
UVMHIST_FUNC("uao_flush"); UVMHIST_CALLED(maphist);
curoff = 0; /* XXX: shut up gcc */
@@ -963,14 +961,14 @@ uao_flush(uobj, start, stop, flags)
static int
uao_get(uobj, offset, pps, npagesp, centeridx, access_type, advice, flags)
struct uvm_object *uobj;
- vaddr_t offset;
+ voff_t offset;
struct vm_page **pps;
int *npagesp;
int centeridx, advice, flags;
vm_prot_t access_type;
{
struct uvm_aobj *aobj = (struct uvm_aobj *)uobj;
- vaddr_t current_offset;
+ voff_t current_offset;
vm_page_t ptmp;
int lcv, gotpages, maxpages, swslot, rv, pageidx;
boolean_t done;
diff --git a/sys/uvm/uvm_device.c b/sys/uvm/uvm_device.c
index ff7a79d2b58..b2c8d7b7e0c 100644
--- a/sys/uvm/uvm_device.c
+++ b/sys/uvm/uvm_device.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: uvm_device.c,v 1.9 2001/07/25 13:25:33 art Exp $ */
-/* $NetBSD: uvm_device.c,v 1.18 1999/11/13 00:24:38 thorpej Exp $ */
+/* $OpenBSD: uvm_device.c,v 1.10 2001/08/06 14:03:04 art Exp $ */
+/* $NetBSD: uvm_device.c,v 1.20 2000/03/26 20:54:46 kleink Exp $ */
/*
*
@@ -68,16 +68,15 @@ static simple_lock_data_t udv_lock;
*/
static void udv_init __P((void));
-struct uvm_object *udv_attach __P((void *, vm_prot_t, vaddr_t, vsize_t));
static void udv_reference __P((struct uvm_object *));
static void udv_detach __P((struct uvm_object *));
static int udv_fault __P((struct uvm_faultinfo *, vaddr_t,
vm_page_t *, int, int, vm_fault_t,
vm_prot_t, int));
-static boolean_t udv_flush __P((struct uvm_object *, vaddr_t,
- vaddr_t, int));
-static int udv_asyncget __P((struct uvm_object *, vaddr_t,
- int));
+static int udv_asyncget __P((struct uvm_object *, voff_t,
+ int));
+static boolean_t udv_flush __P((struct uvm_object *, voff_t, voff_t,
+ int));
static int udv_put __P((struct uvm_object *, vm_page_t *,
int, boolean_t));
@@ -374,7 +373,7 @@ udv_detach(uobj)
static boolean_t udv_flush(uobj, start, stop, flags)
struct uvm_object *uobj;
- vaddr_t start, stop;
+ voff_t start, stop;
int flags;
{
@@ -409,7 +408,8 @@ udv_fault(ufi, vaddr, pps, npages, centeridx, fault_type, access_type, flags)
struct vm_map_entry *entry = ufi->entry;
struct uvm_object *uobj = entry->object.uvm_obj;
struct uvm_device *udv = (struct uvm_device *)uobj;
- vaddr_t curr_offset, curr_va;
+ vaddr_t curr_va;
+ int curr_offset;
paddr_t paddr;
int lcv, retval, mdpgno;
dev_t device;
@@ -450,7 +450,7 @@ udv_fault(ufi, vaddr, pps, npages, centeridx, fault_type, access_type, flags)
* addresses in a submap must match the main map, this is ok.
*/
/* udv offset = (offset from start of entry) + entry's offset */
- curr_offset = (vaddr - entry->start) + entry->offset;
+ curr_offset = (int)((vaddr - entry->start) + entry->offset);
/* pmap va = vaddr (virtual address of pps[0]) */
curr_va = vaddr;
@@ -467,7 +467,7 @@ udv_fault(ufi, vaddr, pps, npages, centeridx, fault_type, access_type, flags)
if (pps[lcv] == PGO_DONTCARE)
continue;
- mdpgno = (*mapfn)(device, (int)curr_offset, access_type);
+ mdpgno = (*mapfn)(device, curr_offset, access_type);
if (mdpgno == -1) {
retval = VM_PAGER_ERROR;
break;
@@ -510,7 +510,7 @@ udv_fault(ufi, vaddr, pps, npages, centeridx, fault_type, access_type, flags)
static int
udv_asyncget(uobj, offset, npages)
struct uvm_object *uobj;
- vaddr_t offset;
+ voff_t offset;
int npages;
{
diff --git a/sys/uvm/uvm_extern.h b/sys/uvm/uvm_extern.h
index 94f7dc3fbcf..3e8d80a38c4 100644
--- a/sys/uvm/uvm_extern.h
+++ b/sys/uvm/uvm_extern.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: uvm_extern.h,v 1.16 2001/08/02 11:06:38 art Exp $ */
-/* $NetBSD: uvm_extern.h,v 1.37 2000/02/11 19:22:54 thorpej Exp $ */
+/* $OpenBSD: uvm_extern.h,v 1.17 2001/08/06 14:03:04 art Exp $ */
+/* $NetBSD: uvm_extern.h,v 1.38 2000/03/26 20:54:46 kleink Exp $ */
/*
*
@@ -113,7 +113,7 @@
((MAXPROT << 8)|(PROT)|(INH)|((ADVICE) << 12)|(FLAGS))
/* magic offset value */
-#define UVM_UNKNOWN_OFFSET ((vaddr_t) -1)
+#define UVM_UNKNOWN_OFFSET ((voff_t) -1)
/* offset not known(obj) or don't care(!obj) */
/*
@@ -335,7 +335,7 @@ void uvm_km_free_poolpage1 __P((vm_map_t, vaddr_t));
/* uvm_map.c */
int uvm_map __P((vm_map_t, vaddr_t *, vsize_t,
- struct uvm_object *, vaddr_t, uvm_flag_t));
+ struct uvm_object *, voff_t, uvm_flag_t));
int uvm_map_pageable __P((vm_map_t, vaddr_t,
vaddr_t, boolean_t, int));
int uvm_map_pageable_all __P((vm_map_t, int, vsize_t));
@@ -363,18 +363,18 @@ void uvm_total __P((struct vmtotal *));
/* uvm_mmap.c */
int uvm_mmap __P((vm_map_t, vaddr_t *, vsize_t,
vm_prot_t, vm_prot_t, int,
- caddr_t, vaddr_t, vsize_t));
+ caddr_t, voff_t, vsize_t));
/* uvm_page.c */
struct vm_page *uvm_pagealloc_strat __P((struct uvm_object *,
- vaddr_t, struct vm_anon *, int, int, int));
+ voff_t, struct vm_anon *, int, int, int));
#define uvm_pagealloc(obj, off, anon, flags) \
uvm_pagealloc_strat((obj), (off), (anon), (flags), \
UVM_PGA_STRAT_NORMAL, 0)
vaddr_t uvm_pagealloc_contig __P((vaddr_t, vaddr_t,
vaddr_t, vaddr_t));
void uvm_pagerealloc __P((struct vm_page *,
- struct uvm_object *, vaddr_t));
+ struct uvm_object *, voff_t));
/* Actually, uvm_page_physload takes PF#s which need their own type */
void uvm_page_physload __P((paddr_t, paddr_t,
paddr_t, paddr_t, int));
@@ -401,7 +401,7 @@ int uvm_grow __P((struct proc *, vaddr_t));
int uvm_deallocate __P((vm_map_t, vaddr_t, vsize_t));
/* uvm_vnode.c */
-void uvm_vnp_setsize __P((struct vnode *, u_quad_t));
+void uvm_vnp_setsize __P((struct vnode *, voff_t));
void uvm_vnp_sync __P((struct mount *));
void uvm_vnp_terminate __P((struct vnode *));
/* terminate a uvm/uvn object */
diff --git a/sys/uvm/uvm_glue.c b/sys/uvm/uvm_glue.c
index e691af1ef15..ae01993b2f6 100644
--- a/sys/uvm/uvm_glue.c
+++ b/sys/uvm/uvm_glue.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: uvm_glue.c,v 1.17 2001/07/25 13:25:33 art Exp $ */
-/* $NetBSD: uvm_glue.c,v 1.30 1999/11/13 00:24:38 thorpej Exp $ */
+/* $OpenBSD: uvm_glue.c,v 1.18 2001/08/06 14:03:04 art Exp $ */
+/* $NetBSD: uvm_glue.c,v 1.31 2000/03/26 20:54:47 kleink Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -189,7 +189,7 @@ uvm_useracc(addr, len, rw)
vm_map_lock_read(map);
rv = uvm_map_checkprot(map, trunc_page((vaddr_t)addr),
- round_page((vaddr_t)addr+len), prot);
+ round_page((vaddr_t)addr+len), prot);
vm_map_unlock_read(map);
return(rv);
diff --git a/sys/uvm/uvm_map.c b/sys/uvm/uvm_map.c
index 2a191725670..598f20c3a37 100644
--- a/sys/uvm/uvm_map.c
+++ b/sys/uvm/uvm_map.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: uvm_map.c,v 1.21 2001/07/18 14:38:07 art Exp $ */
-/* $NetBSD: uvm_map.c,v 1.69 1999/09/12 01:17:37 chs Exp $ */
+/* $OpenBSD: uvm_map.c,v 1.22 2001/08/06 14:03:04 art Exp $ */
+/* $NetBSD: uvm_map.c,v 1.70 2000/03/26 20:54:47 kleink Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -469,7 +469,7 @@ uvm_map(map, startp, size, uobj, uoffset, flags)
vaddr_t *startp; /* IN/OUT */
vsize_t size;
struct uvm_object *uobj;
- vaddr_t uoffset;
+ voff_t uoffset;
uvm_flag_t flags;
{
vm_map_entry_t prev_entry, new_entry;
@@ -798,7 +798,7 @@ uvm_map_findspace(map, hint, length, result, uobj, uoffset, fixed)
vsize_t length;
vaddr_t *result; /* OUT */
struct uvm_object *uobj;
- vaddr_t uoffset;
+ voff_t uoffset;
boolean_t fixed;
{
vm_map_entry_t entry, next, tmp;
@@ -3235,9 +3235,9 @@ uvm_map_printit(map, full, pr)
return;
for (entry = map->header.next; entry != &map->header;
entry = entry->next) {
- (*pr)(" - %p: 0x%lx->0x%lx: obj=%p/0x%x, amap=%p/%d\n",
+ (*pr)(" - %p: 0x%lx->0x%lx: obj=%p/0x%llx, amap=%p/%d\n",
entry, entry->start, entry->end, entry->object.uvm_obj,
- entry->offset, entry->aref.ar_amap, entry->aref.ar_pageoff);
+ (long long)entry->offset, entry->aref.ar_amap, entry->aref.ar_pageoff);
(*pr)(
"\tsubmap=%c, cow=%c, nc=%c, prot(max)=%d/%d, inh=%d, wc=%d, adv=%d\n",
(entry->etype & UVM_ET_SUBMAP) ? 'T' : 'F',
diff --git a/sys/uvm/uvm_map.h b/sys/uvm/uvm_map.h
index 039cbbd3bdb..517f9bfcb96 100644
--- a/sys/uvm/uvm_map.h
+++ b/sys/uvm/uvm_map.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: uvm_map.h,v 1.7 2001/03/22 03:05:55 smart Exp $ */
-/* $NetBSD: uvm_map.h,v 1.15 1999/06/21 17:25:11 thorpej Exp $ */
+/* $OpenBSD: uvm_map.h,v 1.8 2001/08/06 14:03:05 art Exp $ */
+/* $NetBSD: uvm_map.h,v 1.16 2000/03/26 20:54:47 kleink Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -142,7 +142,7 @@ vm_map_t uvm_map_create __P((pmap_t, vaddr_t, vaddr_t, int));
int uvm_map_extract __P((vm_map_t, vaddr_t, vsize_t,
vm_map_t, vaddr_t *, int));
vm_map_entry_t uvm_map_findspace __P((vm_map_t, vaddr_t, vsize_t, vaddr_t *,
- struct uvm_object *, vaddr_t, boolean_t));
+ struct uvm_object *, voff_t, boolean_t));
int uvm_map_inherit __P((vm_map_t, vaddr_t, vaddr_t, vm_inherit_t));
int uvm_map_advice __P((vm_map_t, vaddr_t, vaddr_t, int));
void uvm_map_init __P((void));
diff --git a/sys/uvm/uvm_mmap.c b/sys/uvm/uvm_mmap.c
index 4511461fd9d..95948d5f113 100644
--- a/sys/uvm/uvm_mmap.c
+++ b/sys/uvm/uvm_mmap.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: uvm_mmap.c,v 1.17 2001/07/25 14:47:59 art Exp $ */
-/* $NetBSD: uvm_mmap.c,v 1.37 1999/12/11 05:38:41 thorpej Exp $ */
+/* $OpenBSD: uvm_mmap.c,v 1.18 2001/08/06 14:03:05 art Exp $ */
+/* $NetBSD: uvm_mmap.c,v 1.38 2000/03/26 20:54:47 kleink Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -345,18 +345,6 @@ sys_mmap(p, v, retval)
return (EINVAL);
/*
- * make sure that the newsize fits within a vaddr_t
- * XXX: need to revise addressing data types
- */
- if (pos + size > (vaddr_t)-PAGE_SIZE) {
-#ifdef DEBUG
- printf("mmap: pos=%qx, size=%lx too big\n", (long long)pos,
- (long)size);
-#endif
- return (EINVAL);
- }
-
- /*
* align file position and save offset. adjust size.
*/
@@ -392,8 +380,9 @@ 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((vaddr_t)p->p_vmspace->vm_daddr + MAXDSIZ))
- addr = round_page((vaddr_t)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);
}
/*
@@ -1113,7 +1102,7 @@ uvm_mmap(map, addr, size, prot, maxprot, flags, handle, foff, locklimit)
vm_prot_t prot, maxprot;
int flags;
caddr_t handle; /* XXX: VNODE? */
- vaddr_t foff;
+ voff_t foff;
vsize_t locklimit;
{
struct uvm_object *uobj;
diff --git a/sys/uvm/uvm_page.c b/sys/uvm/uvm_page.c
index cc6167c2ea8..a7a6462981a 100644
--- a/sys/uvm/uvm_page.c
+++ b/sys/uvm/uvm_page.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: uvm_page.c,v 1.20 2001/07/31 14:03:47 art Exp $ */
-/* $NetBSD: uvm_page.c,v 1.30 2000/02/13 03:34:40 thorpej Exp $ */
+/* $OpenBSD: uvm_page.c,v 1.21 2001/08/06 14:03:05 art Exp $ */
+/* $NetBSD: uvm_page.c,v 1.31 2000/03/26 20:54:47 kleink Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -856,7 +856,7 @@ uvm_page_physdump()
struct vm_page *
uvm_pagealloc_strat(obj, off, anon, flags, strat, free_list)
struct uvm_object *obj;
- vaddr_t off;
+ voff_t off;
int flags;
struct vm_anon *anon;
int strat, free_list;
@@ -1025,7 +1025,7 @@ void
uvm_pagerealloc(pg, newobj, newoff)
struct vm_page *pg;
struct uvm_object *newobj;
- vaddr_t newoff;
+ voff_t newoff;
{
/*
* remove it from the old object
diff --git a/sys/uvm/uvm_page.h b/sys/uvm/uvm_page.h
index 08fee83ed07..484c3a6cb54 100644
--- a/sys/uvm/uvm_page.h
+++ b/sys/uvm/uvm_page.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: uvm_page.h,v 1.7 2001/03/22 03:05:56 smart Exp $ */
-/* $NetBSD: uvm_page.h,v 1.13 1999/06/21 17:25:12 thorpej Exp $ */
+/* $OpenBSD: uvm_page.h,v 1.8 2001/08/06 14:03:05 art Exp $ */
+/* $NetBSD: uvm_page.h,v 1.14 2000/03/26 20:54:47 kleink Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -117,7 +117,7 @@ vaddr_t uvm_pageboot_alloc __P((vsize_t));
PAGE_INLINE void uvm_pagecopy __P((struct vm_page *, struct vm_page *));
PAGE_INLINE void uvm_pagedeactivate __P((struct vm_page *));
void uvm_pagefree __P((struct vm_page *));
-PAGE_INLINE struct vm_page *uvm_pagelookup __P((struct uvm_object *, vaddr_t));
+PAGE_INLINE struct vm_page *uvm_pagelookup __P((struct uvm_object *, voff_t));
void uvm_pageremove __P((struct vm_page *));
/* uvm_pagerename: not needed */
PAGE_INLINE void uvm_pageunwire __P((struct vm_page *));
diff --git a/sys/uvm/uvm_page_i.h b/sys/uvm/uvm_page_i.h
index d191471984f..c38ea665282 100644
--- a/sys/uvm/uvm_page_i.h
+++ b/sys/uvm/uvm_page_i.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: uvm_page_i.h,v 1.6 2001/07/18 10:47:05 art Exp $ */
-/* $NetBSD: uvm_page_i.h,v 1.11 1999/09/12 01:17:38 chs Exp $ */
+/* $OpenBSD: uvm_page_i.h,v 1.7 2001/08/06 14:03:05 art Exp $ */
+/* $NetBSD: uvm_page_i.h,v 1.12 2000/03/26 20:54:47 kleink Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -124,7 +124,7 @@ uvm_unlock_fpageq(s)
struct vm_page *
uvm_pagelookup(obj, off)
struct uvm_object *obj;
- vaddr_t off;
+ voff_t off;
{
struct vm_page *pg;
struct pglist *buck;
diff --git a/sys/uvm/uvm_pager.c b/sys/uvm/uvm_pager.c
index 266e63a69be..caa21d61922 100644
--- a/sys/uvm/uvm_pager.c
+++ b/sys/uvm/uvm_pager.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: uvm_pager.c,v 1.12 2001/07/26 19:37:13 art Exp $ */
-/* $NetBSD: uvm_pager.c,v 1.25 2000/01/11 06:57:50 chs Exp $ */
+/* $OpenBSD: uvm_pager.c,v 1.13 2001/08/06 14:03:05 art Exp $ */
+/* $NetBSD: uvm_pager.c,v 1.26 2000/03/26 20:54:47 kleink Exp $ */
/*
*
@@ -250,10 +250,10 @@ uvm_mk_pcluster(uobj, pps, npages, center, flags, mlo, mhi)
struct uvm_object *uobj; /* IN */
struct vm_page **pps, *center; /* IN/OUT, IN */
int *npages, flags; /* IN/OUT, IN */
- vaddr_t mlo, mhi; /* IN (if !PGO_ALLPAGES) */
+ voff_t mlo, mhi; /* IN (if !PGO_ALLPAGES) */
{
struct vm_page **ppsp, *pclust;
- vaddr_t lo, hi, curoff;
+ voff_t lo, hi, curoff;
int center_idx, forward;
UVMHIST_FUNC("uvm_mk_pcluster"); UVMHIST_CALLED(maphist);
@@ -375,7 +375,7 @@ uvm_shareprot(entry, prot)
{
struct uvm_object *uobj = entry->object.uvm_obj;
struct vm_page *pp;
- vaddr_t start, stop;
+ voff_t start, stop;
UVMHIST_FUNC("uvm_shareprot"); UVMHIST_CALLED(maphist);
if (UVM_ET_ISSUBMAP(entry))
@@ -441,7 +441,7 @@ uvm_pager_put(uobj, pg, ppsp_ptr, npages, flags, start, stop)
struct vm_page *pg, ***ppsp_ptr;/* IN, IN/OUT */
int *npages; /* IN/OUT */
int flags; /* IN */
- vaddr_t start, stop; /* IN, IN */
+ voff_t start, stop; /* IN, IN */
{
int result;
daddr_t swblk;
diff --git a/sys/uvm/uvm_pager.h b/sys/uvm/uvm_pager.h
index dae766f6883..d63c94df155 100644
--- a/sys/uvm/uvm_pager.h
+++ b/sys/uvm/uvm_pager.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: uvm_pager.h,v 1.8 2001/07/26 19:37:13 art Exp $ */
-/* $NetBSD: uvm_pager.h,v 1.11 2000/01/11 06:57:50 chs Exp $ */
+/* $OpenBSD: uvm_pager.h,v 1.9 2001/08/06 14:03:05 art Exp $ */
+/* $NetBSD: uvm_pager.h,v 1.12 2000/03/26 20:54:47 kleink Exp $ */
/*
*
@@ -72,22 +72,22 @@ struct uvm_pagerops {
vm_page_t *, int, int, vm_fault_t,
vm_prot_t, int));
boolean_t (*pgo_flush) /* flush pages out of obj */
- __P((struct uvm_object *, vaddr_t, vaddr_t, int));
+ __P((struct uvm_object *, voff_t, voff_t, int));
int (*pgo_get) /* get/read page */
- __P((struct uvm_object *, vaddr_t,
+ __P((struct uvm_object *, voff_t,
vm_page_t *, int *, int, vm_prot_t, int, int));
int (*pgo_asyncget) /* start async get */
- __P((struct uvm_object *, vaddr_t, int));
+ __P((struct uvm_object *, voff_t, int));
int (*pgo_put) /* put/write page */
__P((struct uvm_object *, vm_page_t *,
int, boolean_t));
void (*pgo_cluster) /* return range of cluster */
- __P((struct uvm_object *, vaddr_t, vaddr_t *,
- vaddr_t *));
+ __P((struct uvm_object *, voff_t, voff_t *,
+ voff_t *));
struct vm_page ** (*pgo_mk_pcluster) /* make "put" cluster */
__P((struct uvm_object *, struct vm_page **,
- int *, struct vm_page *, int, vaddr_t,
- vaddr_t));
+ int *, struct vm_page *, int, voff_t,
+ voff_t));
void (*pgo_shareprot) /* share protect */
__P((vm_map_entry_t, vm_prot_t));
void (*pgo_aiodone) /* async iodone */
@@ -138,7 +138,7 @@ void uvm_pager_dropcluster __P((struct uvm_object *,
void uvm_pager_init __P((void));
int uvm_pager_put __P((struct uvm_object *, struct vm_page *,
struct vm_page ***, int *, int,
- vaddr_t, vaddr_t));
+ voff_t, voff_t));
PAGER_INLINE struct vm_page *uvm_pageratop __P((vaddr_t));
@@ -147,7 +147,7 @@ vaddr_t uvm_pagermapin __P((struct vm_page **, int,
void uvm_pagermapout __P((vaddr_t, int));
struct vm_page **uvm_mk_pcluster __P((struct uvm_object *, struct vm_page **,
int *, struct vm_page *, int,
- vaddr_t, vaddr_t));
+ voff_t, voff_t));
void uvm_shareprot __P((vm_map_entry_t, vm_prot_t));
#endif /* _KERNEL */
diff --git a/sys/uvm/uvm_unix.c b/sys/uvm/uvm_unix.c
index 7b0f894c782..adff42fd360 100644
--- a/sys/uvm/uvm_unix.c
+++ b/sys/uvm/uvm_unix.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: uvm_unix.c,v 1.11 2001/07/25 14:47:59 art Exp $ */
-/* $NetBSD: uvm_unix.c,v 1.10 1999/12/30 16:09:47 eeh Exp $ */
+/* $OpenBSD: uvm_unix.c,v 1.12 2001/08/06 14:03:05 art Exp $ */
+/* $NetBSD: uvm_unix.c,v 1.11 2000/03/26 20:54:47 kleink Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
diff --git a/sys/uvm/uvm_vnode.c b/sys/uvm/uvm_vnode.c
index 9dfdbe2c381..a9ba03bd53a 100644
--- a/sys/uvm/uvm_vnode.c
+++ b/sys/uvm/uvm_vnode.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: uvm_vnode.c,v 1.16 2001/07/31 13:34:46 art Exp $ */
-/* $NetBSD: uvm_vnode.c,v 1.29 2000/03/13 23:52:42 soren Exp $ */
+/* $OpenBSD: uvm_vnode.c,v 1.17 2001/08/06 14:03:05 art Exp $ */
+/* $NetBSD: uvm_vnode.c,v 1.30 2000/03/26 20:54:47 kleink Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -88,15 +88,15 @@ lock_data_t uvn_sync_lock; /* locks sync operation */
* functions
*/
-static int uvn_asyncget __P((struct uvm_object *, vaddr_t,
+static int uvn_asyncget __P((struct uvm_object *, voff_t,
int));
struct uvm_object *uvn_attach __P((void *, vm_prot_t));
-static void uvn_cluster __P((struct uvm_object *, vaddr_t,
- vaddr_t *, vaddr_t *));
+static void uvn_cluster __P((struct uvm_object *, voff_t,
+ voff_t *, voff_t *));
static void uvn_detach __P((struct uvm_object *));
-static boolean_t uvn_flush __P((struct uvm_object *, vaddr_t,
- vaddr_t, int));
-static int uvn_get __P((struct uvm_object *, vaddr_t,
+static boolean_t uvn_flush __P((struct uvm_object *, voff_t,
+ voff_t, int));
+static int uvn_get __P((struct uvm_object *, voff_t,
vm_page_t *, int *, int,
vm_prot_t, int, int));
static void uvn_init __P((void));
@@ -185,6 +185,8 @@ uvn_attach(arg, accessprot)
*/
simple_lock(&uvn->u_obj.vmobjlock);
while (uvn->u_flags & UVM_VNODE_BLOCKED) {
+ printf("uvn_attach: blocked at 0x%p flags 0x%x\n",
+ uvn, uvn->u_flags);
uvn->u_flags |= UVM_VNODE_WANTED;
UVMHIST_LOG(maphist, " SLEEPING on blocked vn",0,0,0,0);
UVM_UNLOCK_AND_WAIT(uvn, &uvn->u_obj.vmobjlock, FALSE,
@@ -289,13 +291,6 @@ uvn_attach(arg, accessprot)
if (vp->v_type == VBLK)
printf("used_vnode_size = %qu\n", (long long)used_vnode_size);
#endif
- if (used_vnode_size > (vaddr_t) -PAGE_SIZE) {
-#ifdef DEBUG
- printf("uvn_attach: vn %p size truncated %qx->%x\n", vp,
- (long long)used_vnode_size, -PAGE_SIZE);
-#endif
- used_vnode_size = (vaddr_t) -PAGE_SIZE;
- }
/*
* now set up the uvn.
@@ -832,15 +827,15 @@ uvn_releasepg(pg, nextpgp)
static boolean_t
uvn_flush(uobj, start, stop, flags)
struct uvm_object *uobj;
- vaddr_t start, stop;
+ voff_t start, stop;
int flags;
{
struct uvm_vnode *uvn = (struct uvm_vnode *) uobj;
struct vm_page *pp, *ppnext, *ptmp;
struct vm_page *pps[MAXBSIZE >> PAGE_SHIFT], **ppsp;
int npages, result, lcv;
- boolean_t retval, need_iosync, by_list, needs_clean;
- vaddr_t curoff;
+ boolean_t retval, need_iosync, by_list, needs_clean, all;
+ voff_t curoff;
u_short pp_version;
UVMHIST_FUNC("uvn_flush"); UVMHIST_CALLED(maphist);
@@ -852,8 +847,7 @@ uvn_flush(uobj, start, stop, flags)
need_iosync = FALSE;
retval = TRUE; /* return value */
if (flags & PGO_ALLPAGES) {
- start = 0;
- stop = round_page(uvn->u_size);
+ all = TRUE;
by_list = TRUE; /* always go by the list */
} else {
start = trunc_page(start);
@@ -863,6 +857,7 @@ uvn_flush(uobj, start, stop, flags)
printf("uvn_flush: strange, got an out of range "
"flush (fixed)\n");
#endif
+ all = FALSE;
by_list = (uobj->uo_npages <=
((stop - start) >> PAGE_SHIFT) * UVN_HASH_PENALTY);
}
@@ -887,7 +882,8 @@ uvn_flush(uobj, start, stop, flags)
if (by_list) {
for (pp = uobj->memq.tqh_first ; pp != NULL ;
pp = pp->listq.tqe_next) {
- if (pp->offset < start || pp->offset >= stop)
+ if (!all &&
+ (pp->offset < start || pp->offset >= stop))
continue;
pp->flags &= ~PG_CLEANCHK;
}
@@ -929,7 +925,8 @@ uvn_flush(uobj, start, stop, flags)
* range check
*/
- if (pp->offset < start || pp->offset >= stop) {
+ if (!all &&
+ (pp->offset < start || pp->offset >= stop)) {
ppnext = pp->listq.tqe_next;
continue;
}
@@ -1200,9 +1197,10 @@ ReTry:
} else {
if (result != VM_PAGER_OK) {
printf("uvn_flush: obj=%p, "
- "offset=0x%lx. error "
+ "offset=0x%llx. error "
"during pageout.\n",
- pp->uobject, pp->offset);
+ pp->uobject,
+ (long long)pp->offset);
printf("uvn_flush: WARNING: "
"changes to page may be "
"lost!\n");
@@ -1257,8 +1255,8 @@ ReTry:
static void
uvn_cluster(uobj, offset, loffset, hoffset)
struct uvm_object *uobj;
- vaddr_t offset;
- vaddr_t *loffset, *hoffset; /* OUT */
+ voff_t offset;
+ voff_t *loffset, *hoffset; /* OUT */
{
struct uvm_vnode *uvn = (struct uvm_vnode *) uobj;
*loffset = offset;
@@ -1317,13 +1315,13 @@ uvn_put(uobj, pps, npages, flags)
static int
uvn_get(uobj, offset, pps, npagesp, centeridx, access_type, advice, flags)
struct uvm_object *uobj;
- vaddr_t offset;
+ voff_t offset;
struct vm_page **pps; /* IN/OUT */
int *npagesp; /* IN (OUT if PGO_LOCKED) */
int centeridx, advice, flags;
vm_prot_t access_type;
{
- vaddr_t current_offset;
+ voff_t current_offset;
struct vm_page *ptmp;
int lcv, result, gotpages;
boolean_t done;
@@ -1564,7 +1562,7 @@ uvn_get(uobj, offset, pps, npagesp, centeridx, access_type, advice, flags)
static int
uvn_asyncget(uobj, offset, npages)
struct uvm_object *uobj;
- vaddr_t offset;
+ voff_t offset;
int npages;
{
@@ -1594,8 +1592,10 @@ uvn_io(uvn, pps, npages, flags, rw)
struct vnode *vn;
struct uio uio;
struct iovec iov;
- vaddr_t kva, file_offset;
- int waitf, result, got, wanted;
+ vaddr_t kva;
+ off_t file_offset;
+ int waitf, result;
+ size_t got, wanted;
UVMHIST_FUNC("uvn_io"); UVMHIST_CALLED(maphist);
UVMHIST_LOG(maphist, "rw=%d", rw,0,0,0);
@@ -1905,7 +1905,7 @@ uvm_vnp_uncache(vp)
void
uvm_vnp_setsize(vp, newsize)
struct vnode *vp;
- u_quad_t newsize;
+ voff_t newsize;
{
struct uvm_vnode *uvn = &vp->v_uvm;
@@ -1916,29 +1916,15 @@ uvm_vnp_setsize(vp, newsize)
if (uvn->u_flags & UVM_VNODE_VALID) {
/*
- * make sure that the newsize fits within a vaddr_t
- * XXX: need to revise addressing data types
- */
-
- if (newsize > (vaddr_t) -PAGE_SIZE) {
-#ifdef DEBUG
- printf("uvm_vnp_setsize: vn %p size truncated "
- "%qx->%lx\n", vp, (long long)newsize,
- (vaddr_t)-PAGE_SIZE);
-#endif
- newsize = (vaddr_t)-PAGE_SIZE;
- }
-
- /*
* now check if the size has changed: if we shrink we had better
* toss some pages...
*/
if (uvn->u_size > newsize) {
- (void)uvn_flush(&uvn->u_obj, (vaddr_t) newsize,
+ (void)uvn_flush(&uvn->u_obj, newsize,
uvn->u_size, PGO_FREE);
}
- uvn->u_size = (vaddr_t)newsize;
+ uvn->u_size = newsize;
}
simple_unlock(&uvn->u_obj.vmobjlock);
diff --git a/sys/uvm/uvm_vnode.h b/sys/uvm/uvm_vnode.h
index cf5285c158f..29efe4d2ac4 100644
--- a/sys/uvm/uvm_vnode.h
+++ b/sys/uvm/uvm_vnode.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: uvm_vnode.h,v 1.7 2001/03/22 03:05:57 smart Exp $ */
-/* $NetBSD: uvm_vnode.h,v 1.8 1999/06/21 17:25:12 thorpej Exp $ */
+/* $OpenBSD: uvm_vnode.h,v 1.8 2001/08/06 14:03:05 art Exp $ */
+/* $NetBSD: uvm_vnode.h,v 1.9 2000/03/26 20:54:48 kleink Exp $ */
/*
*
@@ -54,7 +54,7 @@ struct uvm_vnode {
struct uvm_object u_obj; /* the actual VM object */
int u_flags; /* flags */
int u_nio; /* number of running I/O requests */
- vsize_t u_size; /* size of object */
+ voff_t u_size; /* size of object */
/* the following entry is locked by uvn_wl_lock */
LIST_ENTRY(uvm_vnode) u_wlist; /* list of writeable vnode objects */
diff --git a/sys/vm/vm.h b/sys/vm/vm.h
index 95d04a1d26d..b953a9c26b5 100644
--- a/sys/vm/vm.h
+++ b/sys/vm/vm.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: vm.h,v 1.14 2001/07/05 07:25:54 art Exp $ */
-/* $NetBSD: vm.h,v 1.13 1994/06/29 06:47:52 cgd Exp $ */
+/* $OpenBSD: vm.h,v 1.15 2001/08/06 14:03:05 art Exp $ */
+/* $NetBSD: vm.h,v 1.22 2000/03/26 20:54:48 kleink Exp $ */
/*
* Copyright (c) 1991, 1993
@@ -39,7 +39,8 @@
#ifndef VM_H
#define VM_H
-typedef int vm_inherit_t; /* XXX: inheritance codes */
+typedef int vm_inherit_t; /* XXX: inheritance codes */
+typedef off_t voff_t; /* XXX: offset within a uvm_object */
union vm_map_object;
typedef union vm_map_object vm_map_object_t;
diff --git a/sys/vm/vm_map.h b/sys/vm/vm_map.h
index 6d88dfdf3cb..5ae119ae900 100644
--- a/sys/vm/vm_map.h
+++ b/sys/vm/vm_map.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: vm_map.h,v 1.15 2001/06/27 04:52:39 art Exp $ */
-/* $NetBSD: vm_map.h,v 1.11 1995/03/26 20:39:10 jtc Exp $ */
+/* $OpenBSD: vm_map.h,v 1.16 2001/08/06 14:03:05 art Exp $ */
+/* $NetBSD: vm_map.h,v 1.35 2000/03/26 20:54:48 kleink Exp $ */
/*
* Copyright (c) 1991, 1993
@@ -107,7 +107,7 @@ struct vm_map_entry {
vaddr_t start; /* start address */
vaddr_t end; /* end address */
union vm_map_object object; /* object I point to */
- vsize_t offset; /* offset into object */
+ voff_t offset; /* offset into object */
/* etype is a bitmap that replaces the following 4 items */
int etype; /* entry type */
/* Only in task maps: */
diff --git a/sys/vm/vm_page.h b/sys/vm/vm_page.h
index 3b275773afa..3c9665221fd 100644
--- a/sys/vm/vm_page.h
+++ b/sys/vm/vm_page.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: vm_page.h,v 1.15 2001/07/25 14:47:58 art Exp $ */
-/* $NetBSD: vm_page.h,v 1.24 1998/02/10 14:09:03 mrg Exp $ */
+/* $OpenBSD: vm_page.h,v 1.16 2001/08/06 14:03:05 art Exp $ */
+/* $NetBSD: vm_page.h,v 1.35 2000/03/26 20:54:48 kleink Exp $ */
/*
* Copyright (c) 1991, 1993
@@ -117,10 +117,10 @@ struct vm_page {
TAILQ_ENTRY(vm_page) hashq; /* hash table links (O)*/
TAILQ_ENTRY(vm_page) listq; /* pages in same object (O)*/
- vaddr_t offset; /* offset into object (O,P) */
-
- struct uvm_object *uobject; /* object (O,P) */
struct vm_anon *uanon; /* anon (O,P) */
+ struct uvm_object *uobject; /* object (O,P) */
+ voff_t offset; /* offset into object (O,P) */
+
u_short flags; /* object flags [O] */
u_short version; /* version count [O] */
u_short wire_count; /* wired down map refs [P] */
diff --git a/sys/vm/vm_param.h b/sys/vm/vm_param.h
index 946b183bc39..8d1293309dd 100644
--- a/sys/vm/vm_param.h
+++ b/sys/vm/vm_param.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: vm_param.h,v 1.23 2001/08/02 11:06:38 art Exp $ */
-/* $NetBSD: vm_param.h,v 1.12 1995/03/26 20:39:16 jtc Exp $ */
+/* $OpenBSD: vm_param.h,v 1.24 2001/08/06 14:03:05 art Exp $ */
+/* $NetBSD: vm_param.h,v 1.25 2000/03/26 20:42:45 kleink Exp $ */
/*
* Copyright (c) 1991, 1993