-#define highest_entry_end vmu1.vmu1_highest_entry_end
-#define lowest_unnestable_start vmu1.vmu1_lowest_unnestable_start
-
- int ref_count; /* Reference count */
-#if TASK_SWAPPER
- int res_count; /* Residence count (swap) */
- int sw_state; /* Swap state */
-#endif /* TASK_SWAPPER */
- decl_lck_mtx_data(, s_lock) /* Lock ref, res fields */
- lck_mtx_ext_t s_lock_ext;
- vm_map_entry_t hint; /* hint for quick lookups */
- struct vm_map_links* hole_hint; /* hint for quick hole lookups */
- union{
- vm_map_entry_t _first_free; /* First free space hint */
- struct vm_map_links* _holes; /* links all holes between entries */
- }f_s; /* Union for free space data structures being used */
-
-#define first_free f_s._first_free
-#define holes_list f_s._holes
-
- unsigned int
- /* boolean_t */ wait_for_space:1, /* Should callers wait for space? */
- /* boolean_t */ wiring_required:1, /* All memory wired? */
- /* boolean_t */ no_zero_fill:1, /*No zero fill absent pages */
- /* boolean_t */ mapped_in_other_pmaps:1, /*has this submap been mapped in maps that use a different pmap */
- /* boolean_t */ switch_protect:1, /* Protect map from write faults while switched */
- /* boolean_t */ disable_vmentry_reuse:1, /* All vm entries should keep using newer and higher addresses in the map */
- /* boolean_t */ map_disallow_data_exec:1, /* Disallow execution from data pages on exec-permissive architectures */
- /* boolean_t */ holelistenabled:1,
- /* boolean_t */ is_nested_map:1,
- /* boolean_t */ map_disallow_new_exec:1, /* Disallow new executable code */
- /* reserved */ pad:22;
- unsigned int timestamp; /* Version number */
- unsigned int color_rr; /* next color (not protected by a lock) */
-
- boolean_t jit_entry_exists;
-} ;
-
-#define vm_map_to_entry(map) ((struct vm_map_entry *) &(map)->hdr.links)
-#define vm_map_first_entry(map) ((map)->hdr.links.next)
-#define vm_map_last_entry(map) ((map)->hdr.links.prev)
-
-#if TASK_SWAPPER
-/*
- * VM map swap states. There are no transition states.
- */
-#define MAP_SW_IN 1 /* map is swapped in; residence count > 0 */
-#define MAP_SW_OUT 2 /* map is out (res_count == 0 */
-#endif /* TASK_SWAPPER */
+#define highest_entry_end vmu1.vmu1_highest_entry_end
+#define lowest_unnestable_start vmu1.vmu1_lowest_unnestable_start
+ decl_lck_mtx_data(, s_lock); /* Lock ref, res fields */
+ lck_mtx_ext_t s_lock_ext;
+ vm_map_entry_t hint; /* hint for quick lookups */
+ union {
+ struct vm_map_links* vmmap_hole_hint; /* hint for quick hole lookups */
+ struct vm_map_corpse_footprint_header *vmmap_corpse_footprint;
+ } vmmap_u_1;
+#define hole_hint vmmap_u_1.vmmap_hole_hint
+#define vmmap_corpse_footprint vmmap_u_1.vmmap_corpse_footprint
+ union {
+ vm_map_entry_t _first_free; /* First free space hint */
+ struct vm_map_links* _holes; /* links all holes between entries */
+ } f_s; /* Union for free space data structures being used */
+
+#define first_free f_s._first_free
+#define holes_list f_s._holes
+
+ struct os_refcnt map_refcnt; /* Reference count */
+
+ unsigned int
+ /* boolean_t */ wait_for_space:1, /* Should callers wait for space? */
+ /* boolean_t */ wiring_required:1, /* All memory wired? */
+ /* boolean_t */ no_zero_fill:1, /* No zero fill absent pages */
+ /* boolean_t */ mapped_in_other_pmaps:1, /* has this submap been mapped in maps that use a different pmap */
+ /* boolean_t */ switch_protect:1, /* Protect map from write faults while switched */
+ /* boolean_t */ disable_vmentry_reuse:1, /* All vm entries should keep using newer and higher addresses in the map */
+ /* boolean_t */ map_disallow_data_exec:1, /* Disallow execution from data pages on exec-permissive architectures */
+ /* boolean_t */ holelistenabled:1,
+ /* boolean_t */ is_nested_map:1,
+ /* boolean_t */ map_disallow_new_exec:1, /* Disallow new executable code */
+ /* boolean_t */ jit_entry_exists:1,
+ /* boolean_t */ has_corpse_footprint:1,
+ /* boolean_t */ terminated:1,
+ /* boolean_t */ is_alien:1, /* for platform simulation, i.e. PLATFORM_IOS on OSX */
+ /* boolean_t */ cs_enforcement:1, /* code-signing enforcement */
+ /* boolean_t */ reserved_regions:1, /* has reserved regions. The map size that userspace sees should ignore these. */
+ /* boolean_t */ single_jit:1, /* only allow one JIT mapping */
+ /* reserved */ pad:15;
+ unsigned int timestamp; /* Version number */
+};
+
+#define CAST_TO_VM_MAP_ENTRY(x) ((struct vm_map_entry *)(uintptr_t)(x))
+#define vm_map_to_entry(map) CAST_TO_VM_MAP_ENTRY(&(map)->hdr.links)
+#define vm_map_first_entry(map) ((map)->hdr.links.next)
+#define vm_map_last_entry(map) ((map)->hdr.links.prev)