-/* $OpenBSD: pmap.c,v 1.143 2021/05/19 17:46:36 patrick Exp $ */
+/* $OpenBSD: pmap.c,v 1.144 2021/06/16 09:02:21 mpi Exp $ */
/* $NetBSD: pmap.c,v 1.3 2003/05/08 18:13:13 thorpej Exp $ */
/*
kpm = pmap_kernel();
for (i = 0; i < PTP_LEVELS - 1; i++) {
- uvm_objinit(&kpm->pm_obj[i], NULL, 1);
+ uvm_obj_init(&kpm->pm_obj[i], NULL, 1);
kpm->pm_ptphint[i] = NULL;
}
memset(&kpm->pm_list, 0, sizeof(kpm->pm_list)); /* pm_list not used */
/* init uvm_object */
for (i = 0; i < PTP_LEVELS - 1; i++) {
- uvm_objinit(&pmap->pm_obj[i], NULL, 1);
+ uvm_obj_init(&pmap->pm_obj[i], NULL, 1);
pmap->pm_ptphint[i] = NULL;
}
pmap->pm_stats.wired_count = 0;
-/* $OpenBSD: pmap.c,v 1.174 2020/05/29 04:42:23 deraadt Exp $ */
+/* $OpenBSD: pmap.c,v 1.175 2021/06/16 09:02:21 mpi Exp $ */
/*
* Copyright (c) 1998-2004 Michael Shalayeff
*/
kpm = &kernel_pmap_store;
bzero(kpm, sizeof(*kpm));
- uvm_objinit(&kpm->pm_obj, NULL, 1);
+ uvm_obj_init(&kpm->pm_obj, NULL, 1);
kpm->pm_space = HPPA_SID_KERNEL;
kpm->pm_pid = HPPA_PID_KERNEL;
kpm->pm_pdir_pg = NULL;
mtx_init(&pmap->pm_mtx, IPL_VM);
- uvm_objinit(&pmap->pm_obj, NULL, 1);
+ uvm_obj_init(&pmap->pm_obj, NULL, 1);
for (space = 1 + arc4random_uniform(hppa_sid_max);
pmap_sdir_get(space); space = (space + 1) % hppa_sid_max);
-/* $OpenBSD: pmap.c,v 1.213 2021/05/16 15:10:19 deraadt Exp $ */
+/* $OpenBSD: pmap.c,v 1.214 2021/06/16 09:02:21 mpi Exp $ */
/* $NetBSD: pmap.c,v 1.91 2000/06/02 17:46:37 thorpej Exp $ */
/*
kpm = pmap_kernel();
mtx_init(&kpm->pm_mtx, -1); /* must not be used */
mtx_init(&kpm->pm_apte_mtx, IPL_VM);
- uvm_objinit(&kpm->pm_obj, NULL, 1);
+ uvm_obj_init(&kpm->pm_obj, NULL, 1);
bzero(&kpm->pm_list, sizeof(kpm->pm_list)); /* pm_list not used */
kpm->pm_pdir = (vaddr_t)(proc0.p_addr->u_pcb.pcb_cr3 + KERNBASE);
kpm->pm_pdirpa = proc0.p_addr->u_pcb.pcb_cr3;
mtx_init(&pmap->pm_apte_mtx, IPL_VM);
/* init uvm_object */
- uvm_objinit(&pmap->pm_obj, NULL, 1);
+ uvm_obj_init(&pmap->pm_obj, NULL, 1);
pmap->pm_stats.wired_count = 0;
pmap->pm_stats.resident_count = 1; /* count the PDP allocd below */
pmap->pm_ptphint = NULL;
drm_gem_private_object_init(dev, obj, size);
obj->uao = uao_create(size, 0);
- uvm_objinit(&obj->uobj, &drm_pgops, 1);
+ uvm_obj_init(&obj->uobj, &drm_pgops, 1);
obj->filp = (void *)obj->uao;
#else
struct pglist plist;
TAILQ_INIT(&plist);
- if (uvm_objwire(obj->base.uao, i * PAGE_SIZE,
+ if (uvm_obj_wire(obj->base.uao, i * PAGE_SIZE,
(i + 1) * PAGE_SIZE, &plist))
goto err_st;
page = TAILQ_FIRST(&plist);
#ifdef __linux__
put_page(page);
#else
- uvm_objunwire(obj->base.uao, i * PAGE_SIZE,
+ uvm_obj_unwire(obj->base.uao, i * PAGE_SIZE,
(i + 1) * PAGE_SIZE);
#endif
dst += PAGE_SIZE;
#else
struct pglist plist;
TAILQ_INIT(&plist);
- if (uvm_objwire(obj->base.uao, i * PAGE_SIZE,
+ if (uvm_obj_wire(obj->base.uao, i * PAGE_SIZE,
(i + 1) * PAGE_SIZE, &plist))
continue;
page = TAILQ_FIRST(&plist);
mark_page_accessed(page);
put_page(page);
#else
- uvm_objunwire(obj->base.uao, i * PAGE_SIZE,
+ uvm_obj_unwire(obj->base.uao, i * PAGE_SIZE,
(i + 1) * PAGE_SIZE);
#endif
sg_page_sizes = 0;
TAILQ_INIT(&plist);
- if (uvm_objwire(obj->base.uao, 0, obj->base.size, &plist)) {
+ if (uvm_obj_wire(obj->base.uao, 0, obj->base.size, &plist)) {
sg_free_table(st);
kfree(st);
return -ENOMEM;
for_each_sgt_page(page, sgt_iter, st)
put_page(page);
#else
- uvm_objunwire(obj->base.uao, 0, obj->base.size);
+ uvm_obj_unwire(obj->base.uao, 0, obj->base.size);
#endif
sg_free_table(st);
}
#else
err_pages:
- uvm_objunwire(obj->base.uao, 0, obj->base.size);
+ uvm_obj_unwire(obj->base.uao, 0, obj->base.size);
#endif
sg_free_table(st);
kfree(st);
if (pagevec_count(&pvec))
check_release_pagevec(&pvec);
#else
- uvm_objunwire(obj->base.uao, 0, obj->base.size);
+ uvm_obj_unwire(obj->base.uao, 0, obj->base.size);
#endif
obj->mm.dirty = false;
#else
struct pglist plist;
TAILQ_INIT(&plist);
- if (uvm_objwire(obj->base.uao, trunc_page(offset),
+ if (uvm_obj_wire(obj->base.uao, trunc_page(offset),
trunc_page(offset) + PAGE_SIZE, &plist)) {
err = -ENOMEM;
return err;
if (err < 0)
return err;
#else
- uvm_objunwire(obj->base.uao, trunc_page(offset),
+ uvm_obj_unwire(obj->base.uao, trunc_page(offset),
trunc_page(offset) + PAGE_SIZE);
#endif
}
bo->destroy = destroy ? destroy : ttm_bo_default_destroy;
- uvm_objinit(&bo->base.uobj, NULL, 0);
+ uvm_obj_init(&bo->base.uobj, NULL, 0);
kref_init(&bo->kref);
INIT_LIST_HEAD(&bo->lru);
INIT_LIST_HEAD(&bo->ddestroy);
BUG_ON(swap_storage == NULL);
TAILQ_INIT(&plist);
- if (uvm_objwire(swap_storage, 0, ttm->num_pages << PAGE_SHIFT, &plist))
+ if (uvm_obj_wire(swap_storage, 0, ttm->num_pages << PAGE_SHIFT, &plist))
goto out_err;
from_page = TAILQ_FIRST(&plist);
from_page = TAILQ_NEXT(from_page, pageq);
}
- uvm_objunwire(swap_storage, 0, ttm->num_pages << PAGE_SHIFT);
+ uvm_obj_unwire(swap_storage, 0, ttm->num_pages << PAGE_SHIFT);
if (!(ttm->page_flags & TTM_PAGE_FLAG_PERSISTENT_SWAP))
uao_detach(swap_storage);
}
TAILQ_INIT(&plist);
- if (uvm_objwire(swap_storage, 0, ttm->num_pages << PAGE_SHIFT, &plist))
+ if (uvm_obj_wire(swap_storage, 0, ttm->num_pages << PAGE_SHIFT, &plist))
goto out_err;
to_page = TAILQ_FIRST(&plist);
to_page = TAILQ_NEXT(to_page, pageq);
}
- uvm_objunwire(swap_storage, 0, ttm->num_pages << PAGE_SHIFT);
+ uvm_obj_unwire(swap_storage, 0, ttm->num_pages << PAGE_SHIFT);
ttm_tt_unpopulate(ttm);
ttm->swap_storage = swap_storage;
-/* $OpenBSD: vfs_bio.c,v 1.205 2021/03/10 10:21:47 jsg Exp $ */
+/* $OpenBSD: vfs_bio.c,v 1.206 2021/06/16 09:02:21 mpi Exp $ */
/* $NetBSD: vfs_bio.c,v 1.44 1996/06/11 11:15:36 pk Exp $ */
/*
struct uvm_object *oldobj = &bp->b_uobj;
int page;
- uvm_objinit(newobj, NULL, 1);
+ uvm_obj_init(newobj, NULL, 1);
for (page = 0; page < atop(xbpp[i]->b_bufsize); page++) {
struct vm_page *pg = uvm_pagelookup(oldobj,
xbpp[i]->b_poffs + ptoa(page));
-/* $OpenBSD: vfs_biomem.c,v 1.48 2020/04/15 16:46:34 kettenis Exp $ */
+/* $OpenBSD: vfs_biomem.c,v 1.49 2021/06/16 09:02:21 mpi Exp $ */
/*
* Copyright (c) 2007 Artur Grabowski <art@openbsd.org>
KASSERT(bp->b_data == NULL);
splassert(IPL_BIO);
- uvm_objinit(&bp->b_uobj, NULL, 1);
+ uvm_obj_init(&bp->b_uobj, NULL, 1);
/*
* Attempt to allocate with NOWAIT. if we can't, then throw
CLR(bp->b_flags, B_DMA);
/* XXX refactor to do this without splbio later */
- uvm_objfree(uobj);
+ uvm_obj_free(uobj);
}
/* Reallocate a buf into a particular pmem range specified by "where". */
-/* $OpenBSD: uvm_aobj.c,v 1.97 2021/06/15 16:38:09 mpi Exp $ */
+/* $OpenBSD: uvm_aobj.c,v 1.98 2021/06/16 09:02:21 mpi Exp $ */
/* $NetBSD: uvm_aobj.c,v 1.39 2001/02/18 21:19:08 chs Exp $ */
/*
/*
* Initialise UVM object.
*/
- uvm_objinit(&aobj->u_obj, &aobj_pager, refs);
+ uvm_obj_init(&aobj->u_obj, &aobj_pager, refs);
/*
* now that aobj is ready, add it to the global list
-/* $OpenBSD: uvm_device.c,v 1.61 2021/03/20 10:24:21 mpi Exp $ */
+/* $OpenBSD: uvm_device.c,v 1.62 2021/06/16 09:02:21 mpi Exp $ */
/* $NetBSD: uvm_device.c,v 1.30 2000/11/25 06:27:59 chs Exp $ */
/*
* we have it! init the data structures, add to list
* and return.
*/
- uvm_objinit(&udv->u_obj, &uvm_deviceops, 1);
+ uvm_obj_init(&udv->u_obj, &uvm_deviceops, 1);
udv->u_flags = 0;
udv->u_device = device;
LIST_INSERT_HEAD(&udv_list, udv, u_list);
-/* $OpenBSD: uvm_object.c,v 1.18 2020/11/24 13:49:09 mpi Exp $ */
+/* $OpenBSD: uvm_object.c,v 1.19 2021/06/16 09:02:21 mpi Exp $ */
/*
* Copyright (c) 2006 The NetBSD Foundation, Inc.
#define FETCH_PAGECOUNT 16
/*
- * uvm_objinit: initialise a uvm object.
+ * uvm_obj_init: initialise a uvm object.
*/
void
-uvm_objinit(struct uvm_object *uobj, const struct uvm_pagerops *pgops, int refs)
+uvm_obj_init(struct uvm_object *uobj, const struct uvm_pagerops *pgops, int refs)
{
uobj->pgops = pgops;
RBT_INIT(uvm_objtree, &uobj->memt);
#ifndef SMALL_KERNEL
/*
- * uvm_objwire: wire the pages of entire uobj
+ * uvm_obj_wire: wire the pages of entire uobj
*
* => caller must pass page-aligned start and end values
* => if the caller passes in a pageq pointer, we'll return a list of
*/
int
-uvm_objwire(struct uvm_object *uobj, voff_t start, voff_t end,
+uvm_obj_wire(struct uvm_object *uobj, voff_t start, voff_t end,
struct pglist *pageq)
{
int i, npages, left, error;
error:
/* Unwire the pages which have been wired */
- uvm_objunwire(uobj, start, offset);
+ uvm_obj_unwire(uobj, start, offset);
return error;
}
*/
void
-uvm_objunwire(struct uvm_object *uobj, voff_t start, voff_t end)
+uvm_obj_unwire(struct uvm_object *uobj, voff_t start, voff_t end)
{
struct vm_page *pg;
off_t offset;
#endif /* !SMALL_KERNEL */
/*
- * uvm_objfree: free all pages in a uvm object, used by the buffer
+ * uvm_obj_free: free all pages in a uvm object, used by the buffer
* cache to free all pages attached to a buffer.
*/
void
-uvm_objfree(struct uvm_object *uobj)
+uvm_obj_free(struct uvm_object *uobj)
{
struct vm_page *pg;
struct pglist pgl;
-/* $OpenBSD: uvm_object.h,v 1.25 2021/06/15 16:38:09 mpi Exp $ */
+/* $OpenBSD: uvm_object.h,v 1.26 2021/06/16 09:02:21 mpi Exp $ */
/* $NetBSD: uvm_object.h,v 1.11 2001/03/09 01:02:12 chs Exp $ */
/*
#define UVM_OBJ_IS_AOBJ(uobj) \
((uobj)->pgops == &aobj_pager)
-void uvm_objinit(struct uvm_object *, const struct uvm_pagerops *, int);
-int uvm_objwire(struct uvm_object *, voff_t, voff_t, struct pglist *);
-void uvm_objunwire(struct uvm_object *, voff_t, voff_t);
-void uvm_objfree(struct uvm_object *);
+void uvm_obj_init(struct uvm_object *, const struct uvm_pagerops *, int);
+int uvm_obj_wire(struct uvm_object *, voff_t, voff_t, struct pglist *);
+void uvm_obj_unwire(struct uvm_object *, voff_t, voff_t);
+void uvm_obj_free(struct uvm_object *);
#endif /* _KERNEL */
-/* $OpenBSD: uvm_vnode.c,v 1.113 2021/03/26 13:40:05 mpi Exp $ */
+/* $OpenBSD: uvm_vnode.c,v 1.114 2021/06/16 09:02:21 mpi Exp $ */
/* $NetBSD: uvm_vnode.c,v 1.36 2000/11/24 20:34:01 chs Exp $ */
/*
#endif
/* now set up the uvn. */
- uvm_objinit(&uvn->u_obj, &uvm_vnodeops, 1);
+ uvm_obj_init(&uvn->u_obj, &uvm_vnodeops, 1);
oldflags = uvn->u_flags;
uvn->u_flags = UVM_VNODE_VALID|UVM_VNODE_CANPERSIST;
uvn->u_nio = 0;