Function - Map memory objects in one task's address space to that of another task's.
[in task send right]
The port for the task in whose address space the
memory is to be mapped.
[pointer to in/out scalar]
The starting address for the mapped memory
in the target task. The mapped memory will start at the beginning of
the page containing target_address. If there is not enough room
following the address, the kernel does not map the memory. The kernel
returns the starting address actually used for the mapped memory.
The number of bytes to map. The kernel rounds this number
up to an integral number of virtual pages.
Alignment restrictions for starting address. Bits turned on in
the mask will not be turned on in the starting address.
The valid values are:
The kernel allocates the region in the next unused space that
is sufficient within the address space. The kernel returns the
starting address actually used in address.
The kernel allocates the region starting at address unless that
space is already allocated.
[in task send right]
The port for the task whose address space is to be
The starting address for the memory to be mapped from the
source task. The memory to be mapped will start at the beginning of
the page containing source_address. If not enough memory exists
following the address, the kernel does not map the memory.
Copy indicator. If true, the kernel copies the region for the
memory to the specified task's address space. If false, the region is
The most restrictive current protection for the memory in
the region. Valid values are obtained by or'ing together the following
Allows read access.
Allows write access.
Allows execute access.
The most restrictive maximum protection for the memory
in the region. Values are the same as for cur_protection.
The initial inheritance attribute for the region. Valid values
Allows child tasks to share the region.
Gives child tasks a copy of the region.
Provides no access to the region for child tasks.
The vm_remap function maps the memory objects underlying
a portion of the
specified source_task's virtual address space into the address
space belonging to
target_task. The target task can be the calling task or another
task, identified by
its task kernel port. The effect is as if the target task performed
a vm_map call
given the same memory object, maximum protection, current
protection, and inheritance as the source task.
However, the two
tasks must reside on the same host. The kernel maps the memory objects
starting at target_address, so that access to target_address
is as if the source task
accessed its source_address.
The mask parameter
specifies additional alignment restrictions on the kernel's
selection of the starting address. Uses for this mask include:
The cur_protection and max_protection parameters return the protection
attributes for the mapped memory. If all memory within the range had the same
attributes, these attributes are returned; otherwise the call returns the most
restrictive values for any memory in the region.
Forcing the memory address alignment for a mapping to be the same as the
alignment within the source task.
Quickly finding the beginning of an allocated region by performing bit
arithmetic on an address known to be in the region.
Emulating a larger virtual page size.
This interface is machine word length specific because of the virtual address
There is not enough space in the task's address space to allocate the
new region for the memory object.
Specified memory is valid, but the backing memory manager is
not permitted by the requesting task.