Home | History | Annotate | Download | only in uvm

Lines Matching defs:umap

88 	(vaddr_t)(ubc_object.kva + (((u) - ubc_object.umap) << ubc_winshift))
112 struct ubc_map *umap; /* array of ubc_map's */
183 ubc_object.umap = kmem_zalloc(ubc_nwins * sizeof(struct ubc_map),
185 if (ubc_object.umap == NULL)
202 struct ubc_map *umap;
203 umap = &ubc_object.umap[i];
205 umap, inactive);
239 ubc_fault_page(const struct uvm_faultinfo *ufi, const struct ubc_map *umap,
284 pg->offset < umap->writeoff ||
285 pg->offset + PAGE_SIZE > umap->writeoff + umap->writelen);
312 struct ubc_map *umap;
333 umap = &ubc_object.umap[ubc_offset >> ubc_winshift];
334 KASSERT(umap->refcount != 0);
335 KASSERT((umap->flags & UMAP_PAGES_LOCKED) == 0);
348 access_type = umap->writelen ? VM_PROT_WRITE : VM_PROT_READ;
356 KASSERTMSG((trunc_page(umap->writeoff) <= slot_offset),
358 slot_offset, (intmax_t)umap->writeoff);
359 KASSERTMSG((slot_offset < umap->writeoff + umap->writelen),
362 slot_offset, (intmax_t)umap->writeoff, umap->writelen);
365 /* no umap locking needed since we have a ref on the umap */
366 uobj = umap->uobj;
371 npages = (round_page(umap->offset + umap->writeoff +
372 umap->writelen) - (umap->offset + slot_offset))
382 slot_offset, umap->writeoff, umap->writelen, 0);
384 (uintptr_t)uobj, umap->offset + slot_offset, npages, 0);
386 error = (*uobj->pgops->pgo_get)(uobj, umap->offset + slot_offset, pgs,
387 &npages, 0, access_type, umap->advice, flags | PGO_NOBLOCKALLOC |
436 error = ubc_fault_page(ufi, umap, pg, prot, access_type, va);
462 struct ubc_map *umap;
464 LIST_FOREACH(umap, &ubc_object.hash[UBC_HASH(uobj, offset)], hash) {
465 if (umap->uobj == uobj && umap->offset == offset) {
466 return umap;
486 struct ubc_map *umap;
505 umap = ubc_find_mapping(uobj, umap_offset);
506 if (umap == NULL) {
510 umap = TAILQ_FIRST(UBC_QUEUE(offset));
511 if (umap == NULL) {
518 va = UBC_UMAP_ADDR(umap);
519 oobj = umap->uobj;
530 if (umap->flags & UMAP_MAPPING_CACHED) {
531 umap->flags &= ~UMAP_MAPPING_CACHED;
538 LIST_REMOVE(umap, hash);
539 LIST_REMOVE(umap, list);
541 KASSERT((umap->flags & UMAP_MAPPING_CACHED) == 0);
543 umap->uobj = uobj;
544 umap->offset = umap_offset;
546 umap, hash);
547 LIST_INSERT_HEAD(&uobj->uo_ubc, umap, list);
550 va = UBC_UMAP_ADDR(umap);
553 if (umap->refcount == 0) {
554 TAILQ_REMOVE(UBC_QUEUE(offset), umap, inactive);
558 KASSERTMSG(umap->writeoff == 0,
560 KASSERTMSG(umap->writelen == 0,
562 umap->writeoff = slot_offset;
563 umap->writelen = *lenp;
566 umap->refcount++;
567 umap->advice = advice;
569 UVMHIST_LOG(ubchist, "umap %#jx refs %jd va %#jx flags %#jx",
570 (uintptr_t)umap, umap->refcount, (uintptr_t)va, flags);
581 KASSERT(umap->refcount == 1);
586 if (umap->flags & UMAP_MAPPING_CACHED) {
587 umap->flags &= ~UMAP_MAPPING_CACHED;
628 umap->flags |= UMAP_PAGES_LOCKED;
631 KASSERT((umap->flags & UMAP_PAGES_LOCKED) == 0);
645 struct ubc_map *umap;
652 umap = &ubc_object.umap[((char *)va - ubc_object.kva) >> ubc_winshift];
653 umapva = UBC_UMAP_ADDR(umap);
654 uobj = umap->uobj;
657 if (umap->flags & UMAP_PAGES_LOCKED) {
658 const voff_t endoff = umap->writeoff + umap->writelen;
662 trunc_page(umap->writeoff)) >> PAGE_SHIFT);
663 KASSERT((umap->flags & UMAP_MAPPING_CACHED) == 0);
667 umap->flags &= ~UMAP_PAGES_LOCKED;
675 umap->writeoff + (i << PAGE_SHIFT), &pa);
700 umap->writeoff = 0;
701 umap->writelen = 0;
702 umap->refcount--;
703 if (umap->refcount == 0) {
716 umap->flags &= ~UMAP_MAPPING_CACHED;
717 LIST_REMOVE(umap, hash);
718 LIST_REMOVE(umap, list);
719 umap->uobj = NULL;
720 TAILQ_INSERT_HEAD(UBC_QUEUE(umap->offset), umap,
724 umap->flags |= UMAP_MAPPING_CACHED;
726 TAILQ_INSERT_TAIL(UBC_QUEUE(umap->offset), umap,
730 UVMHIST_LOG(ubchist, "umap %#jx refs %jd", (uintptr_t)umap,
731 umap->refcount, 0, 0);
1087 struct ubc_map *umap;
1100 while ((umap = LIST_FIRST(&uobj->uo_ubc)) != NULL) {
1101 KASSERT(umap->refcount == 0);
1104 va + UBC_UMAP_ADDR(umap), NULL));
1106 LIST_REMOVE(umap, list);
1107 LIST_REMOVE(umap, hash);
1108 umap->flags &= ~UMAP_MAPPING_CACHED;
1109 umap->uobj = NULL;
1117 struct ubc_map *umap;
1130 LIST_FOREACH(umap, &ubc_object.hash[i], hash) {