-/* $OpenBSD: drm_linux.c,v 1.89 2022/01/21 23:49:36 jsg Exp $ */
+/* $OpenBSD: drm_linux.c,v 1.90 2022/02/07 13:16:42 kettenis Exp $ */
/*
* Copyright (c) 2013 Jonathan Gray <jsg@openbsd.org>
* Copyright (c) 2015, 2016 Mark Kettenis <kettenis@openbsd.org>
pagevec_reinit(pvec);
}
+static struct kmem_va_mode kv_physwait = {
+ .kv_map = &phys_map,
+ .kv_wait = 1,
+};
+
void *
kmap(struct vm_page *pg)
{
#if defined (__HAVE_PMAP_DIRECT)
va = pmap_map_direct(pg);
#else
- va = uvm_km_valloc_wait(phys_map, PAGE_SIZE);
+ va = (vaddr_t)km_alloc(PAGE_SIZE, &kv_physwait, &kp_none, &kd_waitok);
pmap_kenter_pa(va, VM_PAGE_TO_PHYS(pg), PROT_READ | PROT_WRITE);
pmap_update(pmap_kernel());
#endif
#else
pmap_kremove(va, PAGE_SIZE);
pmap_update(pmap_kernel());
- uvm_km_free_wakeup(phys_map, va, PAGE_SIZE);
+ km_free((void *)va, PAGE_SIZE, &kv_physwait, &kp_none);
#endif
}
paddr_t pa;
int i;
- va = uvm_km_valloc(kernel_map, PAGE_SIZE * npages);
+ va = (vaddr_t)km_alloc(PAGE_SIZE * npages, &kv_any, &kp_none,
+ &kd_nowait);
if (va == 0)
return NULL;
for (i = 0; i < npages; i++) {
pmap_remove(pmap_kernel(), va, va + size);
pmap_update(pmap_kernel());
- uvm_km_free(kernel_map, va, size);
+ km_free((void *)va, size, &kv_any, &kp_none);
}
bool