+/*
+ * EXC_GUARD definitions for virtual memory.
+ */
+#define GUARD_TYPE_VIRT_MEMORY 0x5
+
+/* Reasons for exception for virtual memory */
+enum virtual_memory_guard_exception_codes {
+ kGUARD_EXC_DEALLOC_GAP = 1u << 0
+};
+
+#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_cs_enforcement_override:1,
+ vmkf_cs_enforcement:1,
+ vmkf_nested_pmap:1,
+ vmkf_no_copy_on_read:1,
+#if !defined(CONFIG_EMBEDDED)
+ vmkf_32bit_map_va:1,
+ __vmkf_unused:13;
+#else
+ __vmkf_unused:14;
+#endif
+} 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_cs_enforcement_override = 0, /* override CS_ENFORCEMENT */ \
+ .vmkf_cs_enforcement = 0, /* new value for CS_ENFORCEMENT */ \
+ .vmkf_nested_pmap = 0, /* use a nested pmap */ \
+ .vmkf_no_copy_on_read = 0, /* do not use copy_on_read */ \
+ .__vmkf_unused = 0 \
+}
+
+typedef struct {
+ unsigned int
+ vmnekf_ledger_tag:3,
+ vmnekf_ledger_no_footprint:1,
+ __vmnekf_unused:28;
+} vm_named_entry_kernel_flags_t;
+#define VM_NAMED_ENTRY_KERNEL_FLAGS_NONE (vm_named_entry_kernel_flags_t) { \
+ .vmnekf_ledger_tag = 0, \
+ .vmnekf_ledger_no_footprint = 0, \
+ .__vmnekf_unused = 0 \
+}
+
+#endif /* KERNEL_PRIVATE */
+
+/* current accounting postmark */
+#define __VM_LEDGER_ACCOUNTING_POSTMARK 2019032600
+
+/* discrete values: */
+#define VM_LEDGER_TAG_NONE 0x00000000
+#define VM_LEDGER_TAG_DEFAULT 0x00000001
+#define VM_LEDGER_TAG_NETWORK 0x00000002
+#define VM_LEDGER_TAG_MEDIA 0x00000003
+#define VM_LEDGER_TAG_GRAPHICS 0x00000004
+#define VM_LEDGER_TAG_NEURAL 0x00000005
+#define VM_LEDGER_TAG_MAX 0x00000005
+/* individual bits: */
+#define VM_LEDGER_FLAG_NO_FOOTPRINT 0x00000001
+#define VM_LEDGER_FLAGS (VM_LEDGER_FLAG_NO_FOOTPRINT)