]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/vm/vm_purgeable_internal.h
xnu-7195.101.1.tar.gz
[apple/xnu.git] / osfmk / vm / vm_purgeable_internal.h
index c958f6b0e059da97a1ae0d59164e43942a750c7c..fb0a7d4735eeaa489608226a09a88eebad3a600e 100644 (file)
@@ -1,15 +1,15 @@
 /*
- * Copyright (c) 2007 Apple Inc. All rights reserved.
+ * Copyright (c) 2019 Apple Inc. All rights reserved.
  *
  * @APPLE_LICENSE_HEADER_START@
- * 
+ *
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
  * compliance with the License. Please obtain a copy of the License at
  * http://www.opensource.apple.com/apsl/ and read it before using this
  * file.
- * 
+ *
  * The Original Code and all software distributed under the License are
  * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
  * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
  * Please see the License for the specific language governing rights and
  * limitations under the License.
- * 
+ *
  * @APPLE_LICENSE_HEADER_END@
  */
 
 /*
  * Purgeable spelling rules
- * It is believed that the correct spelling is 
+ * It is believed that the correct spelling is
  * { 'p', 'u', 'r', 'g', 'e', 'a', 'b', 'l', 'e' }.
  * However, there is one published API that likes to spell it without the
  * first 'e', vm_purgable_control(). Since we can't change that API,
@@ -82,7 +82,7 @@ extern int available_for_purge;
  * mostly used on a user context and we don't want any contention with the
  * pageout daemon.
  */
-decl_lck_mtx_data(extern,vm_purgeable_queue_lock)
+decl_lck_mtx_data(extern, vm_purgeable_queue_lock);
 
 /* add a new token to queue. called by vm_object_purgeable_control */
 /* enter with page queue locked */
@@ -119,13 +119,24 @@ void vm_purgeable_stats(vm_purgeable_info_t info, task_t target_task);
 kern_return_t vm_purgeable_account(task_t task, pvm_account_info_t acnt_info);
 #endif /* DEVELOPMENT || DEBUG */
 
-int vm_purgeable_purge_task_owned(task_t task);
+uint64_t vm_purgeable_purge_task_owned(task_t task);
 void vm_purgeable_nonvolatile_enqueue(vm_object_t object, task_t task);
 void vm_purgeable_nonvolatile_dequeue(vm_object_t object);
-void vm_purgeable_accounting(vm_object_t       object,
-                            vm_purgable_t      old_state,
-                            boolean_t          disown);
-void vm_purgeable_compressed_update(vm_object_t        object,
-                                   int         delta);
+void vm_purgeable_accounting(vm_object_t        object,
+    vm_purgable_t      old_state);
+void vm_object_owner_compressed_update(vm_object_t      object,
+    int              delta);
+
+#define PURGEABLE_LOOP_MAX 64
+
+#define TOKEN_ADD               0x40    /* 0x100 */
+#define TOKEN_DELETE            0x41    /* 0x104 */
+#define TOKEN_RIPEN             0x42    /* 0x108 */
+#define OBJECT_ADD              0x48    /* 0x120 */
+#define OBJECT_REMOVE           0x49    /* 0x124 */
+#define OBJECT_PURGE            0x4a    /* 0x128 */
+#define OBJECT_PURGE_ALL        0x4b    /* 0x12c */
+#define OBJECT_PURGE_ONE        0x4c    /* 0x12d */
+#define OBJECT_PURGE_LOOP       0x4e    /* 0x12e */
 
 #endif /* __VM_PURGEABLE_INTERNAL__ */