Pass a proper vaddr to uvm_mmap.
This commit is contained in:
parent
4535c92912
commit
4683f1b535
@ -1058,7 +1058,7 @@ int drm_mapbufs(DRM_IOCTL_ARGS)
|
|||||||
#elif defined(__NetBSD__) || defined(__OpenBSD__)
|
#elif defined(__NetBSD__) || defined(__OpenBSD__)
|
||||||
struct vnode *vn;
|
struct vnode *vn;
|
||||||
voff_t foff;
|
voff_t foff;
|
||||||
vsize_t size;
|
vsize_t size, rsize;
|
||||||
vaddr_t vaddr;
|
vaddr_t vaddr;
|
||||||
#endif /* __NetBSD__ || __OpenBSD__ */
|
#endif /* __NetBSD__ || __OpenBSD__ */
|
||||||
|
|
||||||
@ -1110,9 +1110,11 @@ int drm_mapbufs(DRM_IOCTL_ARGS)
|
|||||||
VM_PROT_ALL, MAP_SHARED, SLIST_FIRST(&kdev->si_hlist), foff );
|
VM_PROT_ALL, MAP_SHARED, SLIST_FIRST(&kdev->si_hlist), foff );
|
||||||
#endif
|
#endif
|
||||||
#elif defined(__NetBSD__) || defined(__OpenBSD__)
|
#elif defined(__NetBSD__) || defined(__OpenBSD__)
|
||||||
vaddr = round_page((vaddr_t)vms->vm_daddr + MAXDSIZ);
|
vaddr = p->l_proc->p_emul->e_vm_default_addr(p->l_proc,
|
||||||
DRM_DEBUG("mmap %lx\n", vaddr);
|
(vaddr_t)vms->vm_daddr, size);
|
||||||
retcode = uvm_mmap(&vms->vm_map, &vaddr, size,
|
rsize = round_page(size);
|
||||||
|
DRM_DEBUG("mmap %lx/%ld\n", vaddr, rsize);
|
||||||
|
retcode = uvm_mmap(&vms->vm_map, &vaddr, rsize,
|
||||||
UVM_PROT_READ | UVM_PROT_WRITE, UVM_PROT_ALL, MAP_SHARED,
|
UVM_PROT_READ | UVM_PROT_WRITE, UVM_PROT_ALL, MAP_SHARED,
|
||||||
&vn->v_uobj, foff, p->l_proc->p_rlimit[RLIMIT_MEMLOCK].rlim_cur);
|
&vn->v_uobj, foff, p->l_proc->p_rlimit[RLIMIT_MEMLOCK].rlim_cur);
|
||||||
#endif /* __NetBSD__ || __OpenBSD */
|
#endif /* __NetBSD__ || __OpenBSD */
|
||||||
|
Loading…
Reference in New Issue
Block a user