osfmk/man/vm_wire.html
Function - Modify the target region's paging characteristics.
**kern\_return\_t vm\_wire**** (host\_priv\_t **host,** vm\_task\_t **target\_task,** vm\_address\_t **address,** vm\_size\_t **size,** vm\_prot\_t **wired\_access** );**
host[in host-control send right] The control port for the host for which information is to be obtained.
target_task[in task send right] The port for the task whose address space contains the region.
address[in scalar] The starting address for the region.
size[in scalar] The number of bytes in the region.
wired_access[in scalar] The pageability of the region. The following values cause the region to be wired and protected as specified (values may be combined): VM_PROT_READ VM_PROT_WRITE VM_PROT_execute
The following value causes the region to be unwired (made pageable):
VM_PROT_NONE
The vm_wire function sets the pageability privileges for a region within the specified task's address space. wired_access specifies the types of accesses to the memory region which must not suffer from (internal) faults of any kind after this call returns. A non-null wired_access value indicates that the page is to be "wired" into memory; a null value indicates "un-wiring". The kernel maintains for the region a count of the number of times the region is wired. A page is wired into physical memory if any task accessing it has a non-zero wired count for the page.
The region starts at the beginning of the virtual page containing address; it ends at the end of the virtual page containing address + size - 1. Because of this rounding to virtual page boundaries, the amount of memory affected may be greater than size. Use host_page_size to find the current virtual page size.
This interface is machine word length specific because of the virtual address parameter.
KERN_INVALID_ADDRESS The address is illegal or specifies a non-allocated region.
Functions: thread_wire.