summaryrefslogtreecommitdiff
path: root/vm
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 /vm
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.
Diffstat (limited to 'vm')
-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
5 files changed, 21 insertions, 73 deletions
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);
}