vm_wire


Function - Modify the target region's paging characteristics.

SYNOPSIS

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);

PARAMETERS

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

DESCRIPTION

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.

NOTES

This interface is machine word length specific because of the virtual address parameter.

RETURN VALUES

KERN_INVALID_ADDRESS
The address is illegal or specifies a non-allocated region.

RELATED INFORMATION

Functions: thread_wire.