-/* $OpenBSD: vm_machdep.c,v 1.44 2021/05/16 06:20:28 jsg Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.45 2022/02/05 09:37:06 kettenis Exp $ */
/* $NetBSD: vm_machdep.c,v 1.1 2003/04/26 18:39:33 fvdl Exp $ */
/*-
pmap_update(pmap_kernel());
}
+struct kmem_va_mode kv_physwait = {
+ .kv_map = &phys_map,
+ .kv_wait = 1,
+};
+
/*
* Map a user I/O request into kernel virtual address space.
* Note: the pages are already locked by uvm_vslock(), so we
- * do not need to pass an access_type to pmap_enter().
+ * do not need to pass an access_type to pmap_enter().
*/
void
vmapbuf(struct buf *bp, vsize_t len)
faddr = trunc_page((vaddr_t)(bp->b_saveaddr = bp->b_data));
off = (vaddr_t)bp->b_data - faddr;
len = round_page(off + len);
- taddr= uvm_km_valloc_wait(phys_map, len);
+ taddr = (vaddr_t)km_alloc(len, &kv_physwait, &kp_none, &kd_waitok);
bp->b_data = (caddr_t)(taddr + off);
/*
* The region is locked, so we expect that pmap_pte() will return
* non-NULL.
* XXX: unwise to expect this in a multithreaded environment.
- * anything can happen to a pmap between the time we lock a
+ * anything can happen to a pmap between the time we lock a
* region, release the pmap lock, and then relock it for
* the pmap_extract().
*
taddr += PAGE_SIZE;
len -= PAGE_SIZE;
}
+ pmap_update(pmap_kernel());
}
/*
len = round_page(off + len);
pmap_kremove(addr, len);
pmap_update(pmap_kernel());
- uvm_km_free_wakeup(phys_map, addr, len);
+ km_free((void *)addr, len, &kv_physwait, &kp_none);
bp->b_data = bp->b_saveaddr;
bp->b_saveaddr = NULL;
}