summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustus Winter <justus@gnupg.org>2016-10-02 00:37:43 +0200
committerJustus Winter <justus@gnupg.org>2016-10-03 22:31:26 +0200
commit8d327ced8c2e539a0e845f522f56a84f6474f5ca (patch)
tree312d6cfc98ed78c56eb7743e43ab910218181fcc
parentd8162a1f9e3baf1a6f0bf9f025ea7d0cdee13d3b (diff)
Remove deprecated external memory management interface.
* NEWS: Update. * device/dev_pager.c (device_pager_data_request): Prune unused branch. (device_pager_data_request_done): Remove function. (device_pager_data_write): Likewise. (device_pager_data_write_done): Likewise. (device_pager_copy): Use 'memory_object_ready'. * device/dev_pager.h (device_pager_data_write_done): Remove prototype. * device/device_pager.srv (memory_object_data_write): Remove macro. * doc/mach.texi: Update documentation. * include/mach/mach.defs (memory_object_data_provided): Drop RPC. (memory_object_set_attributes): Likewise. * include/mach/memory_object.defs: Update comments. (memory_object_data_write): Drop RPC. * include/mach/memory_object_default.defs: Update comments. * include/mach_debug/vm_info.h (VOI_STATE_USE_OLD_PAGEOUT): Drop macro. * vm/memory_object.c (memory_object_data_provided): Remove function. (memory_object_data_error): Simplify. (memory_object_set_attributes_common): Make static, remove unused parameters, simplify. (memory_object_change_attributes): Update callsite. (memory_object_set_attributes): Remove function. (memory_object_ready): Update callsite. * vm/vm_debug.c (mach_vm_object_info): Adapt to the changes. * vm/vm_object.c (vm_object_bootstrap): Likewise. * vm/vm_object.h (struct vm_object): Drop flag 'use_old_pageout'. * vm/vm_pageout.c: Update comments. (vm_pageout_page): Simplify.
-rw-r--r--NEWS4
-rw-r--r--device/dev_pager.c171
-rw-r--r--device/dev_pager.h2
-rw-r--r--device/device_pager.srv1
-rw-r--r--doc/mach.texi114
-rw-r--r--include/mach/mach.defs28
-rw-r--r--include/mach/memory_object.defs60
-rw-r--r--include/mach/memory_object_default.defs4
-rw-r--r--include/mach_debug/vm_info.h1
-rw-r--r--vm/memory_object.c75
-rw-r--r--vm/vm_debug.c2
-rw-r--r--vm/vm_object.c1
-rw-r--r--vm/vm_object.h3
-rw-r--r--vm/vm_pageout.c13
14 files changed, 68 insertions, 411 deletions
diff --git a/NEWS b/NEWS
index 7626e401..a14ac2bd 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,7 @@
+Version 1.8 (2016-10-XX)
+
+The deprecated external memory management interface has been removed.
+
Version 1.7 (2016-05-18)
The code has been updated to work with newer versions of GCC, and numerous bugs
diff --git a/device/dev_pager.c b/device/dev_pager.c
index 40331706..7130229b 100644
--- a/device/dev_pager.c
+++ b/device/dev_pager.c
@@ -356,45 +356,7 @@ kern_return_t device_pager_data_request(
vm_object_deallocate(object);
}
else {
- io_req_t ior;
- mach_device_t device;
- io_return_t result;
-
panic("(device_pager)data_request: dev pager");
-
- device = ds->device;
- mach_device_reference(device);
- dev_pager_deallocate(ds);
-
- /*
- * Package the read for the device driver.
- */
- io_req_alloc(ior, 0);
-
- ior->io_device = device;
- ior->io_unit = device->dev_number;
- ior->io_op = IO_READ | IO_CALL;
- ior->io_mode = 0;
- ior->io_recnum = offset / device->bsize;
- ior->io_data = 0; /* driver must allocate */
- ior->io_count = length;
- ior->io_alloc_size = 0; /* no data allocated yet */
- ior->io_residual = 0;
- ior->io_error = 0;
- ior->io_done = device_pager_data_request_done;
- ior->io_reply_port = pager_request;
- ior->io_reply_port_type = MACH_MSG_TYPE_PORT_SEND;
-
- result = (*device->dev_ops->d_read)(device->dev_number, ior);
- if (result == D_IO_QUEUED)
- return (KERN_SUCCESS);
-
- /*
- * Return by queuing IOR for io_done thread, to reply in
- * correct environment (kernel).
- */
- ior->io_error = result;
- iodone(ior);
}
dev_pager_deallocate(ds);
@@ -402,125 +364,6 @@ kern_return_t device_pager_data_request(
return (KERN_SUCCESS);
}
-/*
- * Always called by io_done thread.
- */
-boolean_t device_pager_data_request_done(io_req_t ior)
-{
- vm_offset_t start_alloc, end_alloc;
- vm_size_t size_read;
-
- if (ior->io_error == D_SUCCESS) {
- size_read = ior->io_count;
- if (ior->io_residual) {
- if (device_pager_debug)
- printf("(device_pager)data_request_done: r: 0x%lx\n", ior->io_residual);
- memset((&ior->io_data[ior->io_count - ior->io_residual]), 0,
- (size_t) ior->io_residual);
- }
- } else {
- size_read = ior->io_count - ior->io_residual;
- }
-
- start_alloc = trunc_page(ior->io_data);
- end_alloc = start_alloc + round_page(ior->io_alloc_size);
-
- if (ior->io_error == D_SUCCESS) {
- vm_map_copy_t copy;
- kern_return_t kr;
-
- kr = vm_map_copyin(kernel_map, (vm_offset_t)ior->io_data,
- size_read, TRUE, &copy);
- if (kr != KERN_SUCCESS)
- panic("device_pager_data_request_done");
-
- (void) r_memory_object_data_provided(
- ior->io_reply_port,
- ior->io_recnum * ior->io_device->bsize,
- (vm_offset_t)copy,
- size_read,
- VM_PROT_NONE);
- }
- else {
- (void) r_memory_object_data_error(
- ior->io_reply_port,
- ior->io_recnum * ior->io_device->bsize,
- (vm_size_t)ior->io_count,
- ior->io_error);
- }
-
- (void)vm_deallocate(kernel_map,
- start_alloc,
- end_alloc - start_alloc);
- mach_device_deallocate(ior->io_device);
- return (TRUE);
-}
-
-kern_return_t device_pager_data_write(
- const ipc_port_t pager,
- const ipc_port_t pager_request,
- vm_offset_t offset,
- pointer_t addr,
- vm_size_t data_count)
-{
- dev_pager_t ds;
- mach_device_t device;
- io_req_t ior;
- kern_return_t result;
-
- panic("(device_pager)data_write: called");
-
- ds = dev_pager_hash_lookup(pager);
- if (ds == DEV_PAGER_NULL)
- panic("(device_pager)data_write: lookup failed");
-
- if (ds->pager_request != pager_request)
- panic("(device_pager)data_write: bad pager_request");
-
- if (ds->type == CHAR_PAGER_TYPE)
- panic("(device_pager)data_write: char pager");
-
- device = ds->device;
- mach_device_reference(device);
- dev_pager_deallocate(ds);
-
- /*
- * Package the write request for the device driver.
- */
- io_req_alloc(ior, data_count);
-
- ior->io_device = device;
- ior->io_unit = device->dev_number;
- ior->io_op = IO_WRITE | IO_CALL;
- ior->io_mode = 0;
- ior->io_recnum = offset / device->bsize;
- ior->io_data = (io_buf_ptr_t)addr;
- ior->io_count = data_count;
- ior->io_alloc_size = data_count; /* amount to deallocate */
- ior->io_residual = 0;
- ior->io_error = 0;
- ior->io_done = device_pager_data_write_done;
- ior->io_reply_port = IP_NULL;
-
- result = (*device->dev_ops->d_write)(device->dev_number, ior);
-
- if (result != D_IO_QUEUED) {
- device_write_dealloc(ior);
- io_req_free((vm_offset_t)ior);
- mach_device_deallocate(device);
- }
-
- return (KERN_SUCCESS);
-}
-
-boolean_t device_pager_data_write_done(io_req_t ior)
-{
- device_write_dealloc(ior);
- mach_device_deallocate(ior->io_device);
-
- return (TRUE);
-}
-
kern_return_t device_pager_copy(
const ipc_port_t pager,
const ipc_port_t pager_request,
@@ -618,15 +461,13 @@ kern_return_t device_pager_init_pager(
/*
* Reply that the object is ready
*/
- (void) r_memory_object_set_attributes(pager_request,
- TRUE, /* ready */
- FALSE, /* do not cache */
- MEMORY_OBJECT_COPY_NONE);
+ (void) r_memory_object_ready(pager_request,
+ FALSE, /* do not cache */
+ MEMORY_OBJECT_COPY_NONE);
} else {
- (void) r_memory_object_set_attributes(pager_request,
- TRUE, /* ready */
- TRUE, /* cache */
- MEMORY_OBJECT_COPY_DELAY);
+ (void) r_memory_object_ready(pager_request,
+ TRUE, /* cache */
+ MEMORY_OBJECT_COPY_DELAY);
}
dev_pager_deallocate(ds);
diff --git a/device/dev_pager.h b/device/dev_pager.h
index 7f97ee7e..7cced949 100644
--- a/device/dev_pager.h
+++ b/device/dev_pager.h
@@ -23,6 +23,4 @@ vm_offset_t device_map_page(void *dsp, vm_offset_t offset);
boolean_t device_pager_data_request_done(io_req_t ior);
-boolean_t device_pager_data_write_done(io_req_t ior);
-
#endif /* _DEVICE_DEV_PAGER_H_ */
diff --git a/device/device_pager.srv b/device/device_pager.srv
index e4e52eac..410323d9 100644
--- a/device/device_pager.srv
+++ b/device/device_pager.srv
@@ -35,7 +35,6 @@
#define memory_object_copy device_pager_copy
#define memory_object_data_request device_pager_data_request
#define memory_object_data_unlock device_pager_data_unlock
-#define memory_object_data_write device_pager_data_write
#define memory_object_lock_completed device_pager_lock_completed
#define memory_object_supply_completed device_pager_supply_completed
#define memory_object_data_return device_pager_data_return
diff --git a/doc/mach.texi b/doc/mach.texi
index 98f72fa8..99ee8548 100644
--- a/doc/mach.texi
+++ b/doc/mach.texi
@@ -3479,7 +3479,7 @@ formatting, the remote procedure call generator produces a procedure,
@code{memory_object_server}, to handle a received message. This
function does all necessary argument handling, and actually calls one of
the following functions: @code{memory_object_init},
-@code{memory_object_data_write}, @code{memory_object_data_return},
+@code{memory_object_data_return},
@code{memory_object_data_request}, @code{memory_object_data_unlock},
@code{memory_object_lock_completed}, @code{memory_object_copy},
@code{memory_object_terminate}. The @strong{default memory manager} may
@@ -3527,8 +3527,7 @@ name ports. The virtual page size that is used by the calling kernel is
included for planning purposes.
When the memory manager is prepared to accept requests for data for
-this object, it must call @code{memory_object_ready}, or set the ready
-flag using @code{memory_object_set_attributes}.
+this object, it must call @code{memory_object_ready}.
Otherwise the kernel will not process requests on this object. To
reject all mappings of this object, the memory manager may use
@code{memory_object_destroy}.
@@ -3785,7 +3784,7 @@ use this call in three different situations.
@item
The object was created by @code{memory_object_create} and the kernel has
not yet provided data for this range (either via a
-@code{memory_object_data_initialize}, @code{memory_object_data_write} or
+@code{memory_object_data_initialize}, or
a @code{memory_object_data_return} for the object.
@item
@@ -3851,57 +3850,6 @@ is called by the kernel, which does not wait for a reply message, this
value is ignored.
@end deftypefun
-The remaining interfaces in this section are obsolete.
-
-@deftypefun kern_return_t memory_object_data_write (@w{memory_object_t @var{memory_object}}, @w{memory_object_control_t @var{memory_control}}, @w{vm_offset_t @var{offset}}, @w{vm_offset_t @var{data}}, @w{vm_size_t @var{data_count}})
-@deftypefunx kern_return_t seqnos_memory_object_data_write (@w{memory_object_t @var{memory_object}}, @w{mach_port_seqno_t @var{seqno}}, @w{memory_object_control_t @var{memory_control}}, @w{vm_offset_t @var{offset}}, @w{vm_offset_t @var{data}}, @w{vm_size_t @var{data_count}})
-The function @code{memory_object_data_write} provides the memory manager
-with data that has been modified while cached in physical memory. It is the old form of @code{memory_object_data_return}. Once
-the memory manager no longer needs this data (e.g., it has been written
-to another storage medium), it should be deallocated using
-@code{vm_deallocate}.
-
-The argument @var{memory_object} is the port that represents the memory
-object data, as supplied to the kernel in a @code{vm_map} call.
-@var{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.) @var{offset} is the
-offset within a memory object to which this call refers. This will be
-page aligned. @var{data} is the data which has been modified while
-cached in physical memory. @var{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 @code{KERN_SUCCESS}, but since this routine
-is called by the kernel, which does not wait for a reply message, this
-value is ignored.
-@end deftypefun
-
-@deftypefun kern_return_t memory_object_data_provided (@w{memory_object_control_t @var{memory_control}}, @w{vm_offset_t @var{offset}}, @w{vm_offset_t @var{data}}, @w{vm_size_t @var{data_count}}, @w{vm_prot_t @var{lock_value}})
-The function @code{memory_object_data_provided} supplies the kernel with
-data for the specified memory object. It is the old form of
-@code{memory_object_data_supply}. Ordinarily, memory managers should
-only provide data in response to @code{memory_object_data_request} calls
-from the kernel. The @var{lock_value} specifies what type of access
-will not be allowed to the data range. The lock values must be one or
-more of the set: @code{VM_PROT_NONE}, @code{VM_PROT_READ},
-@code{VM_PROT_WRITE}, @code{VM_PROT_EXECUTE} and @code{VM_PROT_ALL} as
-defined in @file{mach/vm_prot.h}.
-
-The argument @var{memory_control} is the port, provided by the kernel in
-a @code{memory_object_init} call, to which cache management requests may
-be issued. @var{offset} is an offset within a memory object in bytes.
-This must be page aligned. @var{data} is the data that is being
-provided to the kernel. This is a pointer to the data.
-@var{data_count} is the amount of data to be provided. This must be an
-integral number of memory object pages. @var{lock_value} is a
-protection value indicating those forms of access that should
-@strong{not} be permitted to the specified cached data.
-
-This routine does not receive a reply message (and consequently has no
-return value), so only message transmission errors apply.
-@end deftypefun
-
@node Memory Object Locking
@section Memory Object Locking
@@ -3912,8 +3860,7 @@ to make cache management requests. As specified in arguments to the
call, the kernel will:
@itemize
@item
-clean (i.e., write back using @code{memory_object_data_supply} or
-@code{memory_object_data_write}) any cached data which has been modified
+clean (i.e., write back using @code{memory_object_data_supply} any cached data which has been modified
since the last time it was written
@item
@@ -4026,11 +3973,12 @@ return value), so only message transmission errors apply.
@end deftypefun
@deftypefun kern_return_t memory_object_change_attributes (@w{memory_object_control_t @var{memory_control}}, @w{boolean_t @var{may_cache_object}}, @w{memory_object_copy_strategy_t @var{copy_strategy}}, @w{mach_port_t @var{reply_to}})
-The function @code{memory_object_change_attribute} sets
-performance-related attributes for the specified memory object. If the
-caching attribute is asserted, the kernel is permitted (and encouraged)
-to maintain cached data for this memory object even after no virtual
-address space contains this data.
+The function @code{memory_object_change_attribute} informs the kernel
+that the memory manager is ready to receive data or unlock requests on
+behalf of the clients and sets performance-related attributes for the
+specified memory object. If the caching attribute is asserted, the
+kernel is permitted (and encouraged) to maintain cached data for this
+memory object even after no virtual address space contains this data.
There are three possible caching strategies:
@code{MEMORY_OBJECT_COPY_NONE} which specifies that nothing special
@@ -4067,44 +4015,6 @@ completion of an attribute change call.
@c port.
@end deftypefun
-The following interface is obsoleted by @code{memory_object_ready} and
-@code{memory_object_change_attributes}. If the old form
-@code{memory_object_set_attributes} is used to make a memory object
-ready, the kernel will write back data using the old
-@code{memory_object_data_write} interface rather than
-@code{memory_object_data_return}..
-
-@deftypefun kern_return_t memory_object_set_attributes (@w{memory_object_control_t @var{memory_control}}, @w{boolean @var{object_ready}}, @w{boolean_t @var{may_cache_object}}, @w{memory_object_copy_strategy_t @var{copy_strategy}})
-The function @code{memory_object_set_attribute} controls how the
-memory object. The kernel will only make data or unlock requests when
-the ready attribute is asserted. If the caching attribute is asserted,
-the kernel is permitted (and encouraged) to maintain cached data for
-this memory object even after no virtual address space contains this
-data.
-
-There are three possible caching strategies:
-@code{MEMORY_OBJECT_COPY_NONE} which specifies that nothing special
-should be done when data in the object is copied;
-@code{MEMORY_OBJECT_COPY_CALL} which specifies that the memory manager
-should be notified via a @code{memory_object_copy} call before any part
-of the object is copied; and @code{MEMORY_OBJECT_COPY_DELAY} which
-guarantees that the memory manager does not externally modify the data
-so that the kernel can use its normal copy-on-write algorithms.
-@code{MEMORY_OBJECT_COPY_DELAY} is the strategy most commonly used.
-
-The argument @var{memory_control} is the port, provided by the kernel in
-a @code{memory_object_init} call, to which cache management requests may
-be issued. If @var{object_ready} is set, the kernel may issue new data
-and unlock requests on the associated memory object. If
-@var{may_cache_object} is set, the kernel may keep data associated with
-this memory object, even after virtual memory references to it are gone.
-@var{copy_strategy} tells how the kernel should copy regions of the
-associated memory object.
-
-This routine does not receive a reply message (and consequently has no
-return value), so only message transmission errors apply.
-@end deftypefun
-
@node Default Memory Manager
@section Default Memory Manager
@@ -4143,7 +4053,7 @@ 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 @code{memory_object_set_attributes} call.
+of a @code{memory_object_ready} call.
The argument @var{old_memory_object} is a memory object provided by the
default memory manager on which the kernel can make
@@ -4170,7 +4080,7 @@ value is ignored.
The function @code{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 previous
-@code{memory_object_data_initialize}, @code{memory_object_data_write} or
+@code{memory_object_data_initialize}, or
@code{memory_object_data_return}), then this data should be ignored.
Otherwise, this call behaves exactly as does
@code{memory_object_data_return} on memory objects created by the kernel
diff --git a/include/mach/mach.defs b/include/mach/mach.defs
index 20dc8637..c6ad0770 100644
--- a/include/mach/mach.defs
+++ b/include/mach/mach.defs
@@ -325,23 +325,7 @@ skip;
#endif /* ! KERNEL_USER */
-/*
- * Provide the data contents of a range of the given memory
- * object, with the access restriction specified. [Only
- * whole virtual pages of data can be accepted; partial pages
- * will be discarded. Data should be provided on request, but
- * may be provided in advance as desired. When data already
- * held by this kernel is provided again, the new data is ignored.
- * The access restriction is the subset of {read, write, execute}
- * which are prohibited. The kernel may not provide any data (or
- * protection) consistency among pages with different virtual page
- * alignments within the same object.]
- */
-simpleroutine memory_object_data_provided(
- memory_control : memory_object_control_t;
- offset : vm_offset_t;
- data : pointer_t;
- lock_value : vm_prot_t);
+skip; /* was: memory_object_data_provided */
/*
* Indicate that a range of the given temporary memory object does
@@ -662,15 +646,7 @@ simpleroutine memory_object_data_error(
size : vm_size_t;
error_value : kern_return_t);
-/*
- * Make decisions regarding the use of the specified
- * memory object.
- */
-simpleroutine memory_object_set_attributes(
- memory_control : memory_object_control_t;
- object_ready : boolean_t;
- may_cache : boolean_t;
- copy_strategy : memory_object_copy_strategy_t);
+skip; /* was: memory_object_set_attributes */
/*
*/
diff --git a/include/mach/memory_object.defs b/include/mach/memory_object.defs
index 6372ded8..0d3c2786 100644
--- a/include/mach/memory_object.defs
+++ b/include/mach/memory_object.defs
@@ -57,10 +57,10 @@ serverdemux seqnos_memory_object_server;
* a name port that identifies this object to callers of
* vm_regions.
* [To allow the mapping of this object to be used, the
- * memory manager must call memory_object_set_attributes,
- * specifying the "ready" parameter as TRUE. To reject
- * all mappings of this object, the memory manager may
- * use memory_object_destroy.]
+ * memory manager must call memory_object_ready or
+ * memory_object_change_attributes. To reject all mappings of
+ * this object, the memory manager may use
+ * memory_object_destroy.]
*/
simpleroutine memory_object_init(
memory_object : memory_object_t;
@@ -76,11 +76,12 @@ simpleroutine memory_object_init(
memory_object_page_size : vm_size_t);
/*
- * Indicates that the specified memory object is no longer
- * mapped (or cached -- see memory_object_set_attributes),
- * and that further mappings will cause another memory_object_init
- * call to be made. No further calls will be made on
- * the memory object by this kernel.
+ * Indicates that the specified memory object is no longer mapped
+ * (or cached -- see memory_object_ready or
+ * memory_object_change_attributes), and that further mappings
+ * will cause another memory_object_init call to be made. No
+ * further calls will be made on the memory object by this
+ * kernel.
*
* [All rights to the control and name ports are included
* in this call. The memory manager should use port_deallocate
@@ -144,8 +145,9 @@ simpleroutine memory_object_terminate(
* call to indicate that the appropriate page of the original
* memory object may be used to fulfill a data request.
*
- * [Reply should be memory_object_set_attributes on the
- * new memory object control port to indicate readiness.]
+ * [Reply should be memory_object_ready or
+ * memory_object_change_attributes on the new memory object control
+ * port to indicate readiness.]
*/
simpleroutine memory_object_copy(
old_memory_object : memory_object_t;
@@ -171,7 +173,7 @@ simpleroutine memory_object_copy(
* the specified data should be returned with at
* least the specified access permitted.
*
- * [Reply should be memory_object_data_provided.]
+ * [Reply should be memory_object_data_supply.]
*/
simpleroutine memory_object_data_request(
memory_object : memory_object_t;
@@ -204,26 +206,7 @@ simpleroutine memory_object_data_unlock(
length : vm_size_t;
desired_access : vm_prot_t);
-/*
- * Write back modifications made to this portion of
- * the memory object while in memory.
- *
- * Unless explicitly requested by a memory_object_lock_request
- * (clean, but not flush), the kernel will not retain
- * the data.
- *
- * [Reply should be vm_deallocate to release the data.]
- */
-simpleroutine memory_object_data_write(
- memory_object : memory_object_t;
-#if SEQNOS
- msgseqno seqno : mach_port_seqno_t;
-#endif /* SEQNOS */
- memory_control : memory_object_control_t =
- MACH_MSG_TYPE_MAKE_SEND
- ctype: mach_port_t;
- offset : vm_offset_t;
- data : pointer_t);
+skip; /* was: memory_object_data_write */
/*
* Indicate that a previous memory_object_lock_reqeust has been
@@ -300,13 +283,12 @@ simpleroutine memory_object_supply_completed(
error_offset : vm_offset_t);
/*
- * Return data to manager. This call is used in place of data_write
- * for objects initialized by object_ready instead of set_attributes.
- * This call indicates whether the returned data is dirty and whether
- * the kernel kept a copy. Precious data remains precious if the
- * kernel keeps a copy. The indication that the kernel kept a copy
- * is only a hint if the data is not precious; the cleaned copy may
- * be discarded without further notifying the manager.
+ * Return data to manager. This call indicates whether the
+ * returned data is dirty and whether the kernel kept a copy.
+ * Precious data remains precious if the kernel keeps a copy.
+ * The indication that the kernel kept a copy is only a hint if
+ * the data is not precious; the cleaned copy may be discarded
+ * without further notifying the manager.
*
* [Reply should be vm_deallocate to release the data.]
*/
diff --git a/include/mach/memory_object_default.defs b/include/mach/memory_object_default.defs
index cfd54a48..e62f14dd 100644
--- a/include/mach/memory_object_default.defs
+++ b/include/mach/memory_object_default.defs
@@ -84,7 +84,7 @@ simpleroutine memory_object_create(
* Provide initial data contents for this region of
* the memory object. If data has already been written
* to the object, this value must be discarded; otherwise,
- * this call acts identically to memory_object_data_write.
+ * this call acts identically to memory_object_data_return.
*/
simpleroutine memory_object_data_initialize(
memory_object : memory_object_t;
@@ -101,7 +101,7 @@ simpleroutine memory_object_data_initialize(
/*
* Indicate that the specified range of data in this memory object
* will not be requested again until it is reinitialized with
- * memory_object_data_write or memory_object_data_initialize.
+ * memory_object_data_return or memory_object_data_initialize.
*/
simpleroutine memory_object_data_terminate(
memory_object : memory_object_t;
diff --git a/include/mach_debug/vm_info.h b/include/mach_debug/vm_info.h
index 70ba8878..b50fb92d 100644
--- a/include/mach_debug/vm_info.h
+++ b/include/mach_debug/vm_info.h
@@ -75,7 +75,6 @@ typedef natural_t vm_object_info_state_t;
#define VOI_STATE_ALIVE 0x00000040
#define VOI_STATE_LOCK_IN_PROGRESS 0x00000080
#define VOI_STATE_LOCK_RESTART 0x00000100
-#define VOI_STATE_USE_OLD_PAGEOUT 0x00000200
typedef struct vm_object_info {
vm_offset_t voi_object; /* this object */
diff --git a/vm/memory_object.c b/vm/memory_object.c
index 7d33201b..ad93f87c 100644
--- a/vm/memory_object.c
+++ b/vm/memory_object.c
@@ -302,21 +302,6 @@ retry_lookup:
return(result);
}
-/*
- * If successful, destroys the map copy object.
- */
-kern_return_t memory_object_data_provided(
- vm_object_t object,
- vm_offset_t offset,
- pointer_t data,
- unsigned int data_cnt,
- vm_prot_t lock_value)
-{
- return memory_object_data_supply(object, offset, (vm_map_copy_t) data,
- data_cnt, lock_value, FALSE, IP_NULL,
- 0);
-}
-
kern_return_t memory_object_data_error(
vm_object_t object,
vm_offset_t offset,
@@ -711,25 +696,14 @@ MACRO_BEGIN \
\
(void) vm_map_copyin_object(new_object, 0, new_offset, &copy); \
\
- if (object->use_old_pageout) { \
- assert(pageout_action == MEMORY_OBJECT_LOCK_RESULT_MUST_CLEAN); \
- (void) memory_object_data_write( \
- object->pager, \
- object->pager_request, \
- paging_offset, \
- (pointer_t) copy, \
- new_offset); \
- } \
- else { \
- (void) memory_object_data_return( \
- object->pager, \
- object->pager_request, \
- paging_offset, \
- (pointer_t) copy, \
- new_offset, \
+ (void) memory_object_data_return( \
+ object->pager, \
+ object->pager_request, \
+ paging_offset, \
+ (pointer_t) copy, \
+ new_offset, \
(pageout_action == MEMORY_OBJECT_LOCK_RESULT_MUST_CLEAN), \
- !should_flush); \
- } \
+ !should_flush); \
\
vm_object_lock(object); \
\
@@ -875,13 +849,11 @@ MACRO_END
return (KERN_SUCCESS);
}
-kern_return_t
+static kern_return_t
memory_object_set_attributes_common(
vm_object_t object,
- boolean_t object_ready,
boolean_t may_cache,
- memory_object_copy_strategy_t copy_strategy,
- boolean_t use_old_pageout)
+ memory_object_copy_strategy_t copy_strategy)
{
if (object == VM_OBJECT_NULL)
return(KERN_INVALID_ARGUMENT);
@@ -901,8 +873,6 @@ memory_object_set_attributes_common(
return(KERN_INVALID_ARGUMENT);
}
- if (object_ready)
- object_ready = TRUE;
if (may_cache)
may_cache = TRUE;
@@ -913,8 +883,7 @@ memory_object_set_attributes_common(
* to become asserted.
*/
- if (object_ready && !object->pager_ready) {
- object->use_old_pageout = use_old_pageout;
+ if (!object->pager_ready) {
vm_object_wakeup(object, VM_OBJECT_EVENT_PAGER_READY);
}
@@ -923,7 +892,7 @@ memory_object_set_attributes_common(
*/
object->can_persist = may_cache;
- object->pager_ready = object_ready;
+ object->pager_ready = TRUE;
if (copy_strategy == MEMORY_OBJECT_COPY_TEMPORARY) {
object->temporary = TRUE;
} else {
@@ -961,9 +930,8 @@ kern_return_t memory_object_change_attributes(
* XXX may_cache may become a tri-valued variable to handle
* XXX uncache if not in use.
*/
- result = memory_object_set_attributes_common(object, TRUE,
- may_cache, copy_strategy,
- FALSE);
+ result = memory_object_set_attributes_common(object, may_cache,
+ copy_strategy);
if (IP_VALID(reply_to)) {
@@ -976,26 +944,13 @@ kern_return_t memory_object_change_attributes(
return(result);
}
-kern_return_t
-memory_object_set_attributes(
- vm_object_t object,
- boolean_t object_ready,
- boolean_t may_cache,
- memory_object_copy_strategy_t copy_strategy)
-{
- return memory_object_set_attributes_common(object, object_ready,
- may_cache, copy_strategy,
- TRUE);
-}
-
kern_return_t memory_object_ready(
vm_object_t object,
boolean_t may_cache,
memory_object_copy_strategy_t copy_strategy)
{
- return memory_object_set_attributes_common(object, TRUE,
- may_cache, copy_strategy,
- FALSE);
+ return memory_object_set_attributes_common(object, may_cache,
+ copy_strategy);
}
kern_return_t memory_object_get_attributes(
diff --git a/vm/vm_debug.c b/vm/vm_debug.c
index 227090e6..47889ad0 100644
--- a/vm/vm_debug.c
+++ b/vm/vm_debug.c
@@ -250,8 +250,6 @@ mach_vm_object_info(
state |= VOI_STATE_LOCK_IN_PROGRESS;
if (object->lock_restart)
state |= VOI_STATE_LOCK_RESTART;
- if (object->use_old_pageout)
- state |= VOI_STATE_USE_OLD_PAGEOUT;
info.voi_state = state;
vm_object_unlock(object);
diff --git a/vm/vm_object.c b/vm/vm_object.c
index 1e80bbca..ea81039d 100644
--- a/vm/vm_object.c
+++ b/vm/vm_object.c
@@ -309,7 +309,6 @@ void vm_object_bootstrap(void)
vm_object_template.alive = TRUE;
vm_object_template.lock_in_progress = FALSE;
vm_object_template.lock_restart = FALSE;
- vm_object_template.use_old_pageout = TRUE; /* XXX change later */
vm_object_template.last_alloc = (vm_offset_t) 0;
#if MACH_PAGEMAP
diff --git a/vm/vm_object.h b/vm/vm_object.h
index 1914e8ee..f8f9bf8d 100644
--- a/vm/vm_object.h
+++ b/vm/vm_object.h
@@ -150,9 +150,6 @@ struct vm_object {
/* Should lock request in
* progress restart search?
*/
- /* boolean_t */ use_old_pageout : 1,
- /* Use old pageout primitives?
- */
/* boolean_t */ use_shared_copy : 1,/* Use shared (i.e.,
* delayed) copy on write */
/* boolean_t */ shadowed: 1, /* Shadow may exist */
diff --git a/vm/vm_pageout.c b/vm/vm_pageout.c
index dd0f995c..85db021e 100644
--- a/vm/vm_pageout.c
+++ b/vm/vm_pageout.c
@@ -72,7 +72,7 @@ static int vm_pageout_continue;
*
* Move or copy the page to a new object, as part
* of which it will be sent to its memory manager
- * in a memory_object_data_write or memory_object_initialize
+ * in a memory_object_data_return or memory_object_initialize
* message.
*
* The "paging_offset" argument specifies the offset
@@ -95,7 +95,7 @@ static int vm_pageout_continue;
* this routine returns a pointer to a place-holder page,
* inserted at the same offset, to block out-of-order
* requests for the page. The place-holder page must
- * be freed after the data_write or initialize message
+ * be freed after the data_return or initialize message
* has been sent. If the page is copied,
* the holding page is VM_PAGE_NULL.
*
@@ -288,7 +288,7 @@ vm_pageout_setup(
* The "initial" argument specifies whether this
* data is an initialization only, and should use
* memory_object_data_initialize instead of
- * memory_object_data_write.
+ * memory_object_data_return.
*
* The "flush" argument specifies whether the page
* should be flushed from the object. If not, a
@@ -364,10 +364,9 @@ vm_pageout_page(
rc = vm_map_copyin_object(new_object, 0, PAGE_SIZE, &copy);
assert(rc == KERN_SUCCESS);
- if (initial || old_object->use_old_pageout) {
- rc = (*(initial ? memory_object_data_initialize
- : memory_object_data_write))
- (old_object->pager,
+ if (initial) {
+ rc = memory_object_data_initialize(
+ old_object->pager,
old_object->pager_request,
paging_offset, (pointer_t) copy, PAGE_SIZE);
}