* 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_ATOMIC_ENTRY 0x0080
-#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 | \
#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
/* 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
/* DHMM data */
#define VM_MEMORY_DHMM 84
-#if !(defined(RC_HIDE_XNU_J79) || defined(RC_HIDE_XNU_J80))
-/* memory needed for DFR related actions */
-#define VM_MEMORY_DFR 85
-#endif // !(defined(RC_HIDE_XNU_J79) || defined(RC_HIDE_XNU_J80))
/* 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
#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
#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 */