/*
- * Copyright (c) 2000-2008 Apple Inc. All rights reserved.
+ * Copyright (c) 2000-2019 Apple Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
*/
#include <string.h> /* For memcpy() */
-#include <kern/xpr.h>
#include <kern/host.h>
#include <kern/thread.h> /* For current_thread() */
#include <kern/ipc_mig.h>
#include <vm/vm_protos.h>
memory_object_default_t memory_manager_default = MEMORY_OBJECT_DEFAULT_NULL;
-decl_lck_mtx_data(, memory_manager_default_lock)
+decl_lck_mtx_data(, memory_manager_default_lock);
/*
boolean_t should_flush,
vm_prot_t prot)
{
- XPR(XPR_MEMORY_OBJECT,
- "m_o_lock_page, page 0x%X rtn %d flush %d prot %d\n",
- m, should_return, should_flush, prot, 0);
-
-
if (m->vmp_busy || m->vmp_cleaning) {
return MEMORY_OBJECT_LOCK_RESULT_MUST_BLOCK;
}
boolean_t rv;
int flags;
- XPR(XPR_VM_OBJECT,
- "vm_o_sync, object 0x%X, offset 0x%X size 0x%x flush %d rtn %d\n",
- object, offset, size, should_flush, should_return);
-
/*
* Lock the object, and acquire a paging reference to
* prevent the memory_object and control ports from
{
boolean_t object_became_ready;
- XPR(XPR_MEMORY_OBJECT,
- "m_o_set_attr_com, object 0x%X flg %x strat %d\n",
- object, (may_cache & 1), copy_strategy, 0, 0);
-
if (object == VM_OBJECT_NULL) {
return KERN_INVALID_ARGUMENT;
}
}
}
+void
+memory_object_mark_trusted(
+ memory_object_control_t control)
+{
+ vm_object_t object;
+
+ if (control == NULL) {
+ return;
+ }
+ object = memory_object_control_to_vm_object(control);
+
+ if (object != VM_OBJECT_NULL) {
+ vm_object_lock(object);
+ object->pager_trusted = TRUE;
+ vm_object_unlock(object);
+ }
+}
+
#if CONFIG_SECLUDED_MEMORY
void
memory_object_mark_eligible_for_secluded(