memory_object_data_supply
Function - Provide kernel with data previously requested by the kernel's Memory Management facility.
SYNOPSIS
kern_return_t memory_object_data_supply
(mem_object_control_port_t memory_control,
vm_offset_t offset,
pointer_t data,
mach_msg_type_number_t data_count,
boolean_t deallocate,
vm_prot_t lock_value,
boolean_t precious,
mach_port_t reply_port);
PARAMETERS
- memory_control
-
[in memory-cache-control send right]
The memory cache control port
to be used by the memory manager for cache management requests.
This port is provided by the kernel in a memory_object_init
or memory_object_create call.
- offset
-
[in scalar]
The offset within the memory object, in bytes.
- data
-
[pointer to page aligned in array of bytes]
The address of the data
being provided to the kernel.
- data_count
-
[in scalar]
The amount of data to be provided. The number must be an
integral number of memory object pages.
- deallocate
-
[in scalar]
If TRUE, the pages to be copied (starting at data) will be
deallocated from the memory manager's address space as a result of
being copied into the message, allowing the pages to be moved into the
kernel instead of being physically copied.
- lock_value
-
[in scalar]
One or more forms of access not permitted for the specified
data. Valid values are:
- VM_PROT_NONE
-
Prohibits no access (that is, all forms of access are permitted).
- VM_PROT_READ
-
Prohibits read access.
- VM_PROT_WRITE
-
Prohibits write access.
- VM_PROT_EXECUTE
-
Prohibits execute access.
- VM_PROT_ALL
-
Prohibits all forms of access.
- precious
-
[in scalar]
If TRUE, the pages being supplied are "precious," that is,
the memory manager is not (necessarily) retaining its own copy. These
pages must be returned to the manager when evicted from memory,
even if not modified.
- reply_port
-
[in reply receive (to be converted to send) right]
A port to which the
kernel should send a memory_object_supply_completed to indicate
the status of the accepted data. MACH_PORT_NULL is allowed. The
reply message indicates which pages have been accepted.
DESCRIPTION
The memory_object_data_supply function supplies the
kernel with a range of
data for the specified memory object. A memory manager can only provide data
that was requested by a memory_object_data_request
call from the kernel.
NOTES
The kernel accepts only integral numbers of pages. It discards
any partial pages
without notification.
CAUTIONS
A memory manager must be careful that it not attempt to provide data that has
not been explicitly requested. In particular, a memory manager
must ensure that
it does not provide writable data again before it receives back modifications
from the kernel. This may require that the memory manager remember which
pages it has provided, or that it exercise other cache control functions (via
memory_object_lock_request) before proceeding. The kernel prohibits the
overwriting of live data pages and will not accept pages it has not requested.
RETURN VALUES
Only generic errors apply.
RELATED INFORMATION
Functions:
memory_object_data_error,
memory_object_data_request,
memory_object_data_unavailable,
memory_object_lock_request,
memory_object_supply_completed.