-int proc_get_task_bg_policy(task_t task);
-int proc_get_thread_bg_policy(task_t task, uint64_t tid);
-int proc_get_self_isbackground(void);
-int proc_get_selfthread_isbackground(void);
-
-int proc_get_darwinbgstate(task_t, uint32_t *);
-int proc_set_bgtaskpolicy(task_t task, int intval);
-int proc_set_and_apply_bgtaskpolicy(task_t task, int intval);
-int proc_set_bgthreadpolicy(task_t task, uint64_t tid, int val);
-int proc_set_and_apply_bgthreadpolicy(task_t task, uint64_t tid, int val);
-
-int proc_add_bgtaskpolicy(task_t task, int val);
-int proc_add_bgthreadpolicy(task_t task, uint64_t tid, int val);
-int proc_remove_bgtaskpolicy(task_t task, int policy);
-int proc_remove_bgthreadpolicy(task_t task, uint64_t tid, int val);
-
-int proc_apply_bgtaskpolicy(task_t task);
-int proc_apply_bgtaskpolicy_external(task_t task);
-int proc_apply_bgthreadpolicy(task_t task, uint64_t tid);
-int proc_apply_bgtask_selfpolicy(void);
-int proc_apply_bgthread_selfpolicy(void);
-int proc_apply_workq_bgthreadpolicy(thread_t);
-
-int proc_restore_bgtaskpolicy(task_t task);
-int proc_restore_bgthreadpolicy(task_t task, uint64_t tid);
-int proc_restore_bgthread_selfpolicy(void);
-int proc_restore_workq_bgthreadpolicy(thread_t);
-void proc_task_remove_throttle(task_t task);
-
-/* hw access routines */
-int proc_apply_task_diskacc(task_t task, int policy);
-int proc_apply_thread_diskacc(task_t task, uint64_t tid, int policy);
-int proc_apply_thread_selfdiskacc(int policy);
-int proc_get_task_disacc(task_t task);
-int proc_get_task_selfdiskacc(void);
-int proc_get_diskacc(thread_t thread);
-int proc_get_thread_selfdiskacc(void);
-int proc_denyinherit_policy(task_t task);
-int proc_denyselfset_policy(task_t task);
-
-int proc_get_task_selfgpuacc_deny(void);
-int proc_apply_task_gpuacc(task_t task, int prio);
-
-int proc_get_task_ruse_cpu(task_t task, uint32_t * policyp, uint32_t * percentagep, uint64_t * intervalp, uint64_t * deadlinep);
-int proc_set_task_ruse_cpu(task_t task, uint32_t policy, uint32_t percentage, uint64_t interval, uint64_t deadline);
-int proc_clear_task_ruse_cpu(task_t task);
-thread_t task_findtid(task_t, uint64_t);
-
-#define TASK_RUSECPU_FLAGS_PROC_LIMIT 0x1
-#define TASK_RUSECPU_FLAGS_PERTHR_LIMIT 0x2
-#define TASK_RUSECPU_FLAGS_DEADLINE 0x4
-
-#define PROC_POLICY_OSX_APPTYPE_NONE 0
-#if CONFIG_EMBEDDED
-#define PROC_POLICY_IOS_RESV1_APPTYPE 1
-#define PROC_POLICY_IOS_APPLE_DAEMON 2
-#define PROC_POLICY_IOS_APPTYPE 3
-#define PROC_POLICY_IOS_NONUITYPE 4
-#else
-#define PROC_POLICY_OSX_APPTYPE_TAL 1
-#define PROC_POLICY_OSX_APPTYPE_WIDGET 2
-#define PROC_POLICY_OSX_APPTYPE_DBCLIENT 2 /* Not a bug, just rename of widget */
-#endif
-
-void proc_set_task_apptype(task_t task, int type, thread_t thread);
-int proc_disable_task_apptype(task_t task, int policy_subtype);
-int proc_enable_task_apptype(task_t task, int policy_subtype);
-
-#if CONFIG_EMBEDDED
-extern int proc_setthread_saved_importance(thread_t thread, int importance);
-#endif
-
-/* BSD call back functions */
-extern int proc_apply_resource_actions(void * p, int type, int action);
-extern int proc_restore_resource_actions(void * p, int type, int action);
-extern int task_restore_resource_actions(task_t task, int type);
-
-extern void proc_apply_task_networkbg(void * bsd_info);
-extern void proc_restore_task_networkbg(void * bsd_info);
-extern void proc_set_task_networkbg(void * bsd_info, int setbg);
-extern int task_clear_cpuusage(task_t task);
-
-#if CONFIG_EMBEDDED
-#define TASK_APPSTATE_NONE 0
-#define TASK_APPSTATE_ACTIVE 1
-#define TASK_APPSTATE_BACKGROUND 2
-#define TASK_APPSTATE_NONUI 3
-#define TASK_APPSTATE_INACTIVE 4
-
-extern int proc_lf_getappstate(task_t task);
-extern int proc_lf_setappstate(task_t task, int state);
-extern int proc_lf_pidbind(task_t curtask, uint64_t tid, task_t target_task, int bind);
-extern void thead_remove_taskwatch(thread_t thread);
-extern void task_removewatchers(task_t task);
-#endif /* CONFIG_EMBEDDED */
-
-#endif /* XNU_KERNEL_PRIVATE */
-
-#ifdef KERNEL_PRIVATE
-
-extern void *get_bsdtask_info(task_t);
-extern void *get_bsdthreadtask_info(thread_t);
+/* requires task to be unlocked, returns a referenced thread */
+thread_t task_findtid(task_t task, uint64_t tid);
+int pid_from_task(task_t task);
+
+extern kern_return_t task_wakeups_monitor_ctl(task_t task, uint32_t *rate_hz, int32_t *flags);
+extern kern_return_t task_cpu_usage_monitor_ctl(task_t task, uint32_t *flags);
+extern void task_rollup_accounting_info(task_t new_task, task_t parent_task);
+extern kern_return_t task_io_monitor_ctl(task_t task, uint32_t *flags);
+extern void task_set_did_exec_flag(task_t task);
+extern void task_clear_exec_copy_flag(task_t task);
+extern boolean_t task_is_exec_copy(task_t);
+extern boolean_t task_did_exec(task_t task);
+#ifdef CONFIG_32BIT_TELEMETRY
+extern boolean_t task_consume_32bit_log_flag(task_t task);
+extern void task_set_32bit_log_flag(task_t task);
+#endif /* CONFIG_32BIT_TELEMETRY */
+extern boolean_t task_is_active(task_t task);
+extern boolean_t task_is_halting(task_t task);
+extern void task_clear_return_wait(task_t task, uint32_t flags);
+extern void task_wait_to_return(void) __attribute__((noreturn));
+extern event_t task_get_return_wait_event(task_t task);
+
+extern void task_atm_reset(task_t task);
+extern void task_bank_reset(task_t task);
+extern void task_bank_init(task_t task);
+
+#if CONFIG_ARCADE
+extern void task_prep_arcade(task_t task, thread_t thread);
+#endif /* CONFIG_ARCADE */
+
+extern int task_pid(task_t task);
+extern boolean_t task_has_assertions(task_t task);
+/* End task_policy */
+
+extern void task_set_gpu_denied(task_t task, boolean_t denied);
+extern boolean_t task_is_gpu_denied(task_t task);
+
+extern queue_head_t * task_io_user_clients(task_t task);
+extern void task_set_message_app_suspended(task_t task, boolean_t enable);
+
+extern void task_copy_fields_for_exec(task_t dst_task, task_t src_task);
+
+extern void task_copy_vmobjects(task_t task, vm_object_query_t query, int len, int64_t* num);
+
+#endif /* XNU_KERNEL_PRIVATE */
+
+#ifdef KERNEL_PRIVATE
+
+extern void *get_bsdtask_info(task_t);
+extern void *get_bsdthreadtask_info(thread_t);
+extern void task_bsdtask_kill(task_t);