+ struct vm_shared_region *shared_region;
+ uint32_t taskFeatures[2]; /* Special feature for this task */
+#define tf64BitAddr 0x80000000 /* Task has 64-bit addressing */
+#define tf64BitData 0x40000000 /* Task has 64-bit data registers */
+#define task_has_64BitAddr(task) \
+ (((task)->taskFeatures[0] & tf64BitAddr) != 0)
+#define task_set_64BitAddr(task) \
+ ((task)->taskFeatures[0] |= tf64BitAddr)
+#define task_clear_64BitAddr(task) \
+ ((task)->taskFeatures[0] &= ~tf64BitAddr)
+
+ mach_vm_address_t all_image_info_addr; /* dyld __all_image_info */
+ mach_vm_size_t all_image_info_size; /* section location and size */
+#if CONFIG_MACF_MACH
+ ipc_labelh_t label;
+#endif
+
+#if CONFIG_COUNTERS
+#define TASK_PMC_FLAG 0x1 /* Bit in "t_chud" signifying PMC interest */
+ uint32_t t_chud; /* CHUD flags, used for Shark */
+#endif
+
+};
+
+#define task_lock(task) lck_mtx_lock(&(task)->lock)
+#define task_lock_try(task) lck_mtx_try_lock(&(task)->lock)
+#define task_unlock(task) lck_mtx_unlock(&(task)->lock)
+
+#if CONFIG_MACF_MACH
+#define maclabel label->lh_label
+
+#define tasklabel_lock(task) lh_lock((task)->label)
+#define tasklabel_unlock(task) lh_unlock((task)->label)
+
+extern void tasklabel_lock2(task_t a, task_t b);
+extern void tasklabel_unlock2(task_t a, task_t b);
+#endif /* MAC_MACH */
+
+#define itk_lock_init(task) lck_mtx_init(&(task)->itk_lock_data, &ipc_lck_grp, &ipc_lck_attr)
+#define itk_lock_destroy(task) lck_mtx_destroy(&(task)->itk_lock_data, &ipc_lck_grp)
+#define itk_lock(task) lck_mtx_lock(&(task)->itk_lock_data)
+#define itk_unlock(task) lck_mtx_unlock(&(task)->itk_lock_data)
+
+#define task_reference_internal(task) \
+ (void)hw_atomic_add(&(task)->ref_count, 1)
+
+#define task_deallocate_internal(task) \
+ hw_atomic_sub(&(task)->ref_count, 1)
+
+#define task_reference(task) \
+MACRO_BEGIN \
+ if ((task) != TASK_NULL) \
+ task_reference_internal(task); \
+MACRO_END
+
+extern kern_return_t kernel_task_create(
+ task_t task,
+ vm_offset_t map_base,
+ vm_size_t map_size,
+ task_t *child);