]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/mach/vm_statistics.h
xnu-4570.41.2.tar.gz
[apple/xnu.git] / osfmk / mach / vm_statistics.h
index bd74e1ef696da20b3399b6c10862b27bc65c808f..fa0560559023e7c83191d7435af39eed6c71c4ec 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2009 Apple Inc. All rights reserved.
+ * Copyright (c) 2000-2016 Apple Inc. All rights reserved.
  *
  * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
  * 
@@ -290,52 +290,37 @@ typedef struct pmap_statistics    *pmap_statistics_t;
  *     queue instead of the active queue.  In other words, they are not
  *     cached so that they will be stolen first if memory runs low.
  */
+
 #define VM_FLAGS_FIXED         0x0000
 #define VM_FLAGS_ANYWHERE      0x0001
 #define VM_FLAGS_PURGABLE      0x0002
-#ifdef KERNEL_PRIVATE
-#endif /* KERNEL_PRIVATE */
+#define VM_FLAGS_RANDOM_ADDR   0x0008
 #define VM_FLAGS_NO_CACHE      0x0010
 #define VM_FLAGS_RESILIENT_CODESIGN    0x0020
 #define VM_FLAGS_RESILIENT_MEDIA       0x0040
-#ifdef KERNEL_PRIVATE
-#define VM_FLAGS_PERMANENT     0x0100  /* mapping can NEVER be unmapped */
-#define VM_FLAGS_GUARD_AFTER   0x0200  /* guard page after the mapping */
-#define VM_FLAGS_GUARD_BEFORE  0x0400  /* guard page before the mapping */
-#define VM_FLAGS_SUBMAP                0x0800  /* mapping a VM submap */
-#define VM_FLAGS_ALREADY       0x1000  /* OK if same mapping already exists */
-#define VM_FLAGS_BEYOND_MAX    0x2000  /* map beyond the map's max offset */
-#endif /* KERNEL_PRIVATE */
 #define VM_FLAGS_OVERWRITE     0x4000  /* delete any existing mappings first */
-#ifdef KERNEL_PRIVATE
-#define VM_FLAGS_NO_PMAP_CHECK 0x8000  /* do not check that pmap is empty */
-#endif /* KERNEL_PRIVATE */
 /*
  * VM_FLAGS_SUPERPAGE_MASK
  *     3 bits that specify whether large pages should be used instead of
  *     base pages (!=0), as well as the requested page size.
  */
 #define VM_FLAGS_SUPERPAGE_MASK        0x70000 /* bits 0x10000, 0x20000, 0x40000 */
-#ifdef KERNEL_PRIVATE
-#define        VM_FLAGS_MAP_JIT        0x80000 /* Used to mark an entry as describing a JIT region */
-#endif /* KERNEL_PRIVATE */
 #define VM_FLAGS_RETURN_DATA_ADDR      0x100000 /* Return address of target data, rather than base of page */
-#ifdef KERNEL_PRIVATE
-#define VM_FLAGS_IOKIT_ACCT            0x200000 /* IOKit accounting */
-#define VM_FLAGS_KEEP_MAP_LOCKED       0x400000 /* Keep the map locked when returning from vm_map_enter() */
-#endif /* KERNEL_PRIVATE */
 #define VM_FLAGS_RETURN_4K_DATA_ADDR   0x800000 /* Return 4K aligned address of target data */
 #define VM_FLAGS_ALIAS_MASK    0xFF000000
 #define VM_GET_FLAGS_ALIAS(flags, alias)                       \
                (alias) = ((flags) & VM_FLAGS_ALIAS_MASK) >> 24 
+#if !XNU_KERNEL_PRIVATE
 #define VM_SET_FLAGS_ALIAS(flags, alias)                       \
                (flags) = (((flags) & ~VM_FLAGS_ALIAS_MASK) |   \
                (((alias) & ~VM_FLAGS_ALIAS_MASK) << 24))
+#endif /* !XNU_KERNEL_PRIVATE */
 
 /* These are the flags that we accept from user-space */
 #define VM_FLAGS_USER_ALLOCATE (VM_FLAGS_FIXED |               \
                                 VM_FLAGS_ANYWHERE |            \
                                 VM_FLAGS_PURGABLE |            \
+                                VM_FLAGS_RANDOM_ADDR |         \
                                 VM_FLAGS_NO_CACHE |            \
                                 VM_FLAGS_OVERWRITE |           \
                                 VM_FLAGS_SUPERPAGE_MASK |      \
@@ -345,6 +330,7 @@ typedef struct pmap_statistics      *pmap_statistics_t;
                                 VM_FLAGS_RETURN_DATA_ADDR)
 #define VM_FLAGS_USER_REMAP    (VM_FLAGS_FIXED |    \
                                 VM_FLAGS_ANYWHERE | \
+                                VM_FLAGS_RANDOM_ADDR | \
                                 VM_FLAGS_OVERWRITE| \
                                 VM_FLAGS_RETURN_DATA_ADDR |\
                                 VM_FLAGS_RESILIENT_CODESIGN)
@@ -359,6 +345,47 @@ typedef struct pmap_statistics     *pmap_statistics_t;
 #define VM_FLAGS_SUPERPAGE_SIZE_2MB (SUPERPAGE_SIZE_2MB<<VM_FLAGS_SUPERPAGE_SHIFT)
 #endif
 
+
+#ifdef KERNEL_PRIVATE
+typedef struct {
+       unsigned int
+               vmkf_atomic_entry:1,
+               vmkf_permanent:1,
+               vmkf_guard_after:1,
+               vmkf_guard_before:1,
+               vmkf_submap:1,
+               vmkf_already:1,
+               vmkf_beyond_max:1,
+               vmkf_no_pmap_check:1,
+               vmkf_map_jit:1,
+               vmkf_iokit_acct:1,
+               vmkf_keep_map_locked:1,
+               vmkf_fourk:1,
+               vmkf_overwrite_immutable:1,
+               vmkf_remap_prot_copy:1,
+               __vmkf_unused:18;
+} vm_map_kernel_flags_t;
+#define VM_MAP_KERNEL_FLAGS_NONE (vm_map_kernel_flags_t) {             \
+       .vmkf_atomic_entry = 0, /* keep entry atomic (no coalescing) */ \
+       .vmkf_permanent = 0,    /* mapping can NEVER be unmapped */     \
+       .vmkf_guard_after = 0,  /* guard page after the mapping */      \
+       .vmkf_guard_before = 0, /* guard page before the mapping */     \
+       .vmkf_submap = 0,       /* mapping a VM submap */               \
+       .vmkf_already = 0,      /* OK if same mapping already exists */ \
+       .vmkf_beyond_max = 0,   /* map beyond the map's max offset */   \
+       .vmkf_no_pmap_check = 0, /* do not check that pmap is empty */  \
+       .vmkf_map_jit = 0,      /* mark entry as JIT region */          \
+       .vmkf_iokit_acct = 0,   /* IOKit accounting */                  \
+       .vmkf_keep_map_locked = 0, /* keep map locked when returning from vm_map_enter() */ \
+       .vmkf_fourk = 0,        /* use fourk pager */                   \
+       .vmkf_overwrite_immutable = 0,  /* can overwrite immutable mappings */ \
+       .vmkf_remap_prot_copy = 0, /* vm_remap for VM_PROT_COPY */      \
+       .__vmkf_unused = 0                                              \
+}
+#endif /* KERNEL_PRIVATE */
+
+
+
 #define VM_MEMORY_MALLOC 1
 #define VM_MEMORY_MALLOC_SMALL 2
 #define VM_MEMORY_MALLOC_LARGE 3
@@ -413,6 +440,9 @@ typedef struct pmap_statistics      *pmap_statistics_t;
 /* Window backing stores, custom shadow data, and compressed backing stores */
 #define VM_MEMORY_COREGRAPHICS_BACKINGSTORES   57
 
+/* x-alloc'd memory */
+#define VM_MEMORY_COREGRAPHICS_XALLOC 58
+
 /* catch-all for other uses, such as the read-only shared data page */
 #define VM_MEMORY_COREGRAPHICS_MISC VM_MEMORY_COREGRAPHICS
 
@@ -426,6 +456,7 @@ typedef struct pmap_statistics      *pmap_statistics_t;
 
 /* JavaScriptCore heaps */
 #define VM_MEMORY_JAVASCRIPT_CORE 63
+#define VM_MEMORY_WEBASSEMBLY VM_MEMORY_JAVASCRIPT_CORE
 /* memory allocated for the JIT */
 #define VM_MEMORY_JAVASCRIPT_JIT_EXECUTABLE_ALLOCATOR 64
 #define VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE 65
@@ -478,17 +509,43 @@ typedef struct pmap_statistics    *pmap_statistics_t;
 /* Apple System Logger (ASL) messages */
 #define VM_MEMORY_ASL 81
 
+/* Swift runtime */
+#define VM_MEMORY_SWIFT_RUNTIME 82
+
+/* Swift metadata */
+#define VM_MEMORY_SWIFT_METADATA 83
+
+/* DHMM data */
+#define VM_MEMORY_DHMM 84
+
+
+/* memory allocated by SceneKit.framework */
+#define VM_MEMORY_SCENEKIT 86
+
+/* memory allocated by skywalk networking */
+#define VM_MEMORY_SKYWALK 87
+
+#define VM_MEMORY_IOSURFACE 88
+
+#define VM_MEMORY_LIBNETWORK 89
+
+#define VM_MEMORY_AUDIO 90
+
+#define VM_MEMORY_VIDEOBITSTREAM 91
+
 /* Reserve 240-255 for application */
 #define VM_MEMORY_APPLICATION_SPECIFIC_1 240
 #define VM_MEMORY_APPLICATION_SPECIFIC_16 255
 
+#if !XNU_KERNEL_PRIVATE
 #define VM_MAKE_TAG(tag) ((tag) << 24)
-
+#endif /* XNU_KERNEL_PRIVATE */
 
 
 #if KERNEL_PRIVATE
 
 /* kernel map tags */
+/* please add new definition strings to zprint */
 
 #define VM_KERN_MEMORY_NONE            0
 
@@ -516,8 +573,11 @@ typedef struct pmap_statistics     *pmap_statistics_t;
 #define VM_KERN_MEMORY_UBC             22
 #define VM_KERN_MEMORY_SECURITY                23
 #define VM_KERN_MEMORY_MLOCK           24
-//
-#define VM_KERN_MEMORY_FIRST_DYNAMIC   25
+#define VM_KERN_MEMORY_REASON          25
+#define VM_KERN_MEMORY_SKYWALK         26
+#define VM_KERN_MEMORY_LTABLE          27
+
+#define VM_KERN_MEMORY_FIRST_DYNAMIC   28
 /* out of tags: */
 #define VM_KERN_MEMORY_ANY             255
 #define VM_KERN_MEMORY_COUNT           256
@@ -532,6 +592,8 @@ typedef struct pmap_statistics      *pmap_statistics_t;
 #define VM_KERN_SITE_COUNTER           0x00000003
 #define VM_KERN_SITE_WIRED             0x00000100      /* add to wired count */
 #define VM_KERN_SITE_HIDE              0x00000200      /* no zprint */
+#define VM_KERN_SITE_NAMED             0x00000400
+#define VM_KERN_SITE_ZONE              0x00000800
 
 #define VM_KERN_COUNT_MANAGED          0
 #define VM_KERN_COUNT_RESERVED         1
@@ -543,7 +605,11 @@ typedef struct pmap_statistics     *pmap_statistics_t;
 #define VM_KERN_COUNT_MAP_ZONE         7
 #define VM_KERN_COUNT_MAP_KALLOC       8
 
-#define VM_KERN_COUNTER_COUNT          9
+#define VM_KERN_COUNT_WIRED_BOOT    9
+
+#define VM_KERN_COUNT_BOOT_STOLEN      10
+
+#define VM_KERN_COUNTER_COUNT          11
 
 #endif /* KERNEL_PRIVATE */