Previous: Memory Object Attributes, Up: External Memory Management
The function
vm_set_default_memory_manager
sets the kernel's default memory manager. It sets the port to which newly-created temporary memory objects are delivered bymemory_object_create
to the host. The old memory manager port is returned. If default_manager isMACH_PORT_NULL
then this routine just returns the current default manager port without changing it.The argument host is a task port to the kernel whose default memory manager is to be changed. default_manager is an in/out parameter. As input, default_manager is the port that the new memory manager is listening on for
memory_object_create
calls. As output, it is the old default memory manager's port.The function returns
KERN_SUCCESS
if the new memory manager is installed, andKERN_INVALID_ARGUMENT
if this task does not have the privileges required for this call.
The function
memory_object_create
is a request that the given memory manager accept responsibility for the given memory object created by the kernel. This call will only be made to the system default memory manager. The memory object in question initially consists of zero-filled memory; only memory pages that are actually written will ever be provided tomemory_object_data_request
calls, the default memory manager must usememory_object_data_unavailable
for any pages that have not previously been written.No reply is expected after this call. Since this call is directed to the default memory manager, the kernel assumes that it will be ready to handle data requests to this object and does not need the confirmation of a
memory_object_set_attributes
call.The argument old_memory_object is a memory object provided by the default memory manager on which the kernel can make
memory_object_create
calls. new_memory_object is a new memory object created by the kernel; see synopsis for further description. Note that all port rights (including receive rights) are included for the new memory object. new_object_size is the maximum size of the new object. new_control is a port, created by the kernel, on which a memory manager may issue cache management requests for the new object. new_name a port used by the kernel to refer to the new memory object data in response tovm_region
calls. new_page_size is the page size to be used by this kernel. All data sizes in calls involving this kernel must be an integral multiple of the page size. Note that different kernels, indicated by different amemory_control
, may have different page sizes.The function should return
KERN_SUCCESS
, but since this routine is called by the kernel, which does not wait for a reply message, this value is ignored.
The function
memory_object_data_initialize
provides the memory manager with initial data for a kernel-created memory object. If the memory manager already has been supplied data (by a previousmemory_object_data_initialize
,memory_object_data_write
ormemory_object_data_return
), then this data should be ignored. Otherwise, this call behaves exactly as doesmemory_object_data_return
on memory objects created by the kernel viamemory_object_create
and thus will only be made to default memory managers. This call will not be made on objects created viamemory_object_copy
.The argument memory_object the port that represents the memory object data, as supplied by the kernel in a
memory_object_create
call. memory_control is the request port to which a response is requested. (In the event that a memory object has been supplied to more than one the kernel that has made the request.) offset is the offset within a memory object to which this call refers. This will be page aligned. data is the data which has been modified while cached in physical memory. data_count is the amount of data to be written, in bytes. This will be an integral number of memory object pages.The function should return
KERN_SUCCESS
, but since this routine is called by the kernel, which does not wait for a reply message, this value is ignored.