]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/vm/vm_phantom_cache.h
xnu-4903.270.47.tar.gz
[apple/xnu.git] / osfmk / vm / vm_phantom_cache.h
index dcf0e5a54b8e4f09539551810d1e98845c64a445..24d73ac8949b8f3667f52e261aa4cc4bc52e8910 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (c) 2000-2013 Apple Inc. All rights reserved.
  *
  * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
  * Copyright (c) 2000-2013 Apple Inc. All rights reserved.
  *
  * @APPLE_OSREFERENCE_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
  * 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
  * unlawful or unlicensed copies of an Apple operating system, or to
  * circumvent, violate, or enable the circumvention or violation of, any
  * terms of an Apple operating system software license agreement.
  * unlawful or unlicensed copies of an Apple operating system, or to
  * circumvent, violate, or enable the circumvention or violation of, any
  * terms of an Apple operating system software license agreement.
- * 
+ *
  * Please obtain a copy of the License at
  * http://www.opensource.apple.com/apsl/ and read it before using this file.
  * 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,
  * 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.
  * 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_OSREFERENCE_LICENSE_HEADER_END@
  */
 
 #include <vm/vm_page.h>
 
  * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
  */
 
 #include <vm/vm_page.h>
 
-#define                VM_GHOST_OFFSET_BITS    39
-#define                VM_GHOST_OFFSET_MASK    0x7FFFFFFFFF
-#define                VM_GHOST_PAGES_PER_ENTRY 4
-#define                VM_GHOST_PAGE_MASK      0x3
-#define                VM_GHOST_PAGE_SHIFT     2
-#define                VM_GHOST_INDEX_BITS     (64 - VM_GHOST_OFFSET_BITS - VM_GHOST_PAGES_PER_ENTRY)
-
-struct vm_ghost
-{
-       uint64_t        g_next_index:VM_GHOST_INDEX_BITS,
-                       g_pages_held:VM_GHOST_PAGES_PER_ENTRY,
-                       g_obj_offset:VM_GHOST_OFFSET_BITS;
-       uint32_t        g_obj_id;
+#define         VM_GHOST_OFFSET_BITS    39
+#define         VM_GHOST_OFFSET_MASK    0x7FFFFFFFFF
+#define         VM_GHOST_PAGES_PER_ENTRY 4
+#define         VM_GHOST_PAGE_MASK      0x3
+#define         VM_GHOST_PAGE_SHIFT     2
+#define         VM_GHOST_INDEX_BITS     (64 - VM_GHOST_OFFSET_BITS - VM_GHOST_PAGES_PER_ENTRY)
 
 
+struct  vm_ghost {
+       uint64_t        g_next_index:VM_GHOST_INDEX_BITS,
+           g_pages_held:VM_GHOST_PAGES_PER_ENTRY,
+           g_obj_offset:VM_GHOST_OFFSET_BITS;
+       uint32_t        g_obj_id;
 } __attribute__((packed));
 
 } __attribute__((packed));
 
-typedef        struct vm_ghost *vm_ghost_t;
+typedef struct vm_ghost *vm_ghost_t;
 
 
 
 
-extern void            vm_phantom_cache_init(void);
-extern void            vm_phantom_cache_add_ghost(vm_page_t);
-extern vm_ghost_t      vm_phantom_cache_lookup_ghost(vm_page_t, uint32_t);
-extern void            vm_phantom_cache_update(vm_page_t);
-extern boolean_t       vm_phantom_cache_check_pressure(void);
-extern  void           vm_phantom_cache_restart_sample(void);
+extern  void            vm_phantom_cache_init(void);
+extern  void            vm_phantom_cache_add_ghost(vm_page_t);
+extern  vm_ghost_t      vm_phantom_cache_lookup_ghost(vm_page_t, uint32_t);
+extern  void            vm_phantom_cache_update(vm_page_t);
+extern  boolean_t       vm_phantom_cache_check_pressure(void);
+extern  void            vm_phantom_cache_restart_sample(void);