1.\" $OpenBSD: uvm_vslock.9,v 1.2 2019/12/06 11:09:47 mpi Exp $ 2.\" $NetBSD: uvm.9,v 1.14 2000/06/29 06:08:44 mrg Exp $ 3.\" 4.\" Copyright (c) 1998 Matthew R. Green 5.\" All rights reserved. 6.\" 7.\" Redistribution and use in source and binary forms, with or without 8.\" modification, are permitted provided that the following conditions 9.\" are met: 10.\" 1. Redistributions of source code must retain the above copyright 11.\" notice, this list of conditions and the following disclaimer. 12.\" 2. Redistributions in binary form must reproduce the above copyright 13.\" notice, this list of conditions and the following disclaimer in the 14.\" documentation and/or other materials provided with the distribution. 15.\" 16.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 21.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 23.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26.\" SUCH DAMAGE. 27.\" 28.Dd $Mdocdate: December 6 2019 $ 29.Dt UVM_VSLOCK 9 30.Os 31.Sh NAME 32.Nm uvm_vslock , 33.Nm uvm_vsunlock , 34.Nm uvm_vslock_device , 35.Nm uvm_vsunlock_device 36.Nd wire user memory for I/O 37.Sh SYNOPSIS 38.In uvm/uvm_extern.h 39.Ft void 40.Fn uvm_vslock "struct proc *p" "caddr_t addr" "size_t len" \ 41 "vm_prot_t access_type" 42.Ft void 43.Fn uvm_vsunlock "struct proc *p" "caddr_t addr" "size_t len" 44.Ft int 45.Fn uvm_vslock_device "struct proc *p" "void *addr" "size_t len" \ 46 "vm_prot_t access_type" "void **retp" 47.Ft void 48.Fn uvm_vsunlock_device "struct proc *p" "void *addr" "size_t len" "void *map" 49.Sh DESCRIPTION 50The 51.Fn uvm_vslock 52family of functions 53control the wiring and unwiring of pages for process 54.Fa p 55from 56.Fa addr 57to 58.Fa addr + len . 59The 60.Fa access_type 61argument is passed to 62.Xr uvm_fault 9 . 63.Pp 64.Fn uvm_vslock_device 65also checks if the pages are DMA reachable. 66When they aren't, it bounces their content into a newly created mapping 67returned in 68.Fa retp . 69.Fn uvm_vsunlock_device 70will release this memory mapping pointed by 71.Fa map . 72.Sh SEE ALSO 73.Xr uvm_fault 9 74