/*
- * Copyright (c) 2000-2009 Apple Inc. All rights reserved.
+ * Copyright (c) 2000-2016 Apple Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
#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_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
#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 | \
VM_FLAGS_ALIAS_MASK)
#define VM_FLAGS_USER_MAP (VM_FLAGS_USER_ALLOCATE | \
+ VM_FLAGS_RETURN_4K_DATA_ADDR | \
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_RETURN_DATA_ADDR |\
+ VM_FLAGS_RESILIENT_CODESIGN)
#define VM_FLAGS_SUPERPAGE_SHIFT 16
#define SUPERPAGE_NONE 0 /* no superpages, if all bits are 0 */
/* 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
/* Genealogy buffers */
#define VM_MEMORY_GENEALOGY 78
+/* RawCamera VM allocated memory */
+#define VM_MEMORY_RAWCAMERA 79
+
+/* corpse info for dead process */
+#define VM_MEMORY_CORPSEINFO 80
+
+/* 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
+
/* Reserve 240-255 for application */
#define VM_MEMORY_APPLICATION_SPECIFIC_1 240
#define VM_MEMORY_APPLICATION_SPECIFIC_16 255
#define VM_MAKE_TAG(tag) ((tag) << 24)
+
+
+#if KERNEL_PRIVATE
+
+/* kernel map tags */
+/* please add new definition strings to zprint */
+
+#define VM_KERN_MEMORY_NONE 0
+
+#define VM_KERN_MEMORY_OSFMK 1
+#define VM_KERN_MEMORY_BSD 2
+#define VM_KERN_MEMORY_IOKIT 3
+#define VM_KERN_MEMORY_LIBKERN 4
+#define VM_KERN_MEMORY_OSKEXT 5
+#define VM_KERN_MEMORY_KEXT 6
+#define VM_KERN_MEMORY_IPC 7
+#define VM_KERN_MEMORY_STACK 8
+#define VM_KERN_MEMORY_CPU 9
+#define VM_KERN_MEMORY_PMAP 10
+#define VM_KERN_MEMORY_PTE 11
+#define VM_KERN_MEMORY_ZONE 12
+#define VM_KERN_MEMORY_KALLOC 13
+#define VM_KERN_MEMORY_COMPRESSOR 14
+#define VM_KERN_MEMORY_COMPRESSED_DATA 15
+#define VM_KERN_MEMORY_PHANTOM_CACHE 16
+#define VM_KERN_MEMORY_WAITQ 17
+#define VM_KERN_MEMORY_DIAG 18
+#define VM_KERN_MEMORY_LOG 19
+#define VM_KERN_MEMORY_FILE 20
+#define VM_KERN_MEMORY_MBUF 21
+#define VM_KERN_MEMORY_UBC 22
+#define VM_KERN_MEMORY_SECURITY 23
+#define VM_KERN_MEMORY_MLOCK 24
+#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
+
+/* end kernel map tags */
+
+// mach_memory_info.flags
+#define VM_KERN_SITE_TYPE 0x000000FF
+#define VM_KERN_SITE_TAG 0x00000000
+#define VM_KERN_SITE_KMOD 0x00000001
+#define VM_KERN_SITE_KERNEL 0x00000002
+#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_COUNT_MANAGED 0
+#define VM_KERN_COUNT_RESERVED 1
+#define VM_KERN_COUNT_WIRED 2
+#define VM_KERN_COUNT_WIRED_MANAGED 3
+#define VM_KERN_COUNT_STOLEN 4
+#define VM_KERN_COUNT_LOPAGE 5
+#define VM_KERN_COUNT_MAP_KERNEL 6
+#define VM_KERN_COUNT_MAP_ZONE 7
+#define VM_KERN_COUNT_MAP_KALLOC 8
+
+#define VM_KERN_COUNTER_COUNT 9
+
+#endif /* KERNEL_PRIVATE */
+
#endif /* _MACH_VM_STATISTICS_H_ */