X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/39236c6e673c41db228275375ab7fdb0f837b292..527f99514973766e9c0382a4d8550dfb00f54939:/osfmk/i386/machine_routines.h diff --git a/osfmk/i386/machine_routines.h b/osfmk/i386/machine_routines.h index f0c1baa71..da6db8347 100644 --- a/osfmk/i386/machine_routines.h +++ b/osfmk/i386/machine_routines.h @@ -40,6 +40,8 @@ #include #include +#include + __BEGIN_DECLS #ifdef XNU_KERNEL_PRIVATE @@ -78,7 +80,9 @@ void ml_install_interrupt_handler( IOInterruptHandler handler, void *refCon); -void ml_get_timebase(unsigned long long *timestamp); +void ml_entropy_collect(void); + +uint64_t ml_get_timebase(void); void ml_init_lock_timeout(void); void ml_init_delay_spin_threshold(int); @@ -120,25 +124,6 @@ extern void ml_cpu_down(void); void bzero_phys_nc( addr64_t phys_address, uint32_t length); -#define NUM_LATENCY_QOS_TIERS (6) -typedef struct { - int32_t timer_coalesce_rt_shift; - int32_t timer_coalesce_bg_shift; - int32_t timer_coalesce_kt_shift; - int32_t timer_coalesce_fp_shift; - int32_t timer_coalesce_ts_shift; - - uint64_t timer_coalesce_rt_ns_max; - uint64_t timer_coalesce_bg_ns_max; - uint64_t timer_coalesce_kt_ns_max; - uint64_t timer_coalesce_fp_ns_max; - uint64_t timer_coalesce_ts_ns_max; - - uint32_t latency_qos_scale[NUM_LATENCY_QOS_TIERS]; - uint64_t latency_qos_ns_max[NUM_LATENCY_QOS_TIERS]; - boolean_t latency_tier_rate_limited[NUM_LATENCY_QOS_TIERS]; -} timer_coalescing_priority_params_t; -extern timer_coalescing_priority_params_t tcoal_prio_params; extern uint32_t interrupt_timer_coalescing_enabled; extern uint32_t idle_entry_timer_processing_hdeadline_threshold; @@ -162,11 +147,22 @@ void ml_get_bouncepool_info( vm_size_t *size); /* Indicates if spinlock, IPI and other timeouts should be suspended */ boolean_t machine_timeout_suspended(void); +void plctrace_disable(void); #endif /* PEXPERT_KERNEL_PRIVATE || MACH_KERNEL_PRIVATE */ /* Warm up a CPU to receive an interrupt */ kern_return_t ml_interrupt_prewarm(uint64_t deadline); +/* Check if the machine layer wants to intercept a panic call */ +boolean_t ml_wants_panic_trap_to_debugger(void); + +/* Machine layer routine for intercepting panics */ +void ml_panic_trap_to_debugger(const char *panic_format_str, + va_list *panic_args, + unsigned int reason, + void *ctx, + uint64_t panic_options_mask, + unsigned long panic_caller); #endif /* XNU_KERNEL_PRIVATE */ #ifdef KERNEL_PRIVATE @@ -235,6 +231,12 @@ unsigned long long ml_phys_read_double( unsigned long long ml_phys_read_double_64( addr64_t paddr); +unsigned long long ml_io_read(uintptr_t iovaddr, int iovsz); +unsigned int ml_io_read8(uintptr_t iovaddr); +unsigned int ml_io_read16(uintptr_t iovaddr); +unsigned int ml_io_read32(uintptr_t iovaddr); +unsigned long long ml_io_read64(uintptr_t iovaddr); + /* Write physical address byte */ void ml_phys_write_byte( vm_offset_t paddr, unsigned int data); @@ -321,6 +323,12 @@ boolean_t ml_set_interrupts_enabled(boolean_t enable); /* Check if running at interrupt context */ boolean_t ml_at_interrupt_context(void); +#ifdef XNU_KERNEL_PRIVATE +extern boolean_t ml_is_quiescing(void); +extern void ml_set_is_quiescing(boolean_t); +extern uint64_t ml_get_booter_memory_size(void); +#endif + /* Zero bytes starting at a physical address */ void bzero_phys( addr64_t phys_address, @@ -329,15 +337,19 @@ void bzero_phys( /* Bytes available on current stack */ vm_offset_t ml_stack_remaining(void); -#if CONFIG_COUNTERS -void ml_get_csw_threads(thread_t * /*old*/, thread_t * /*new*/); -#endif /* CONFIG_COUNTERS */ - __END_DECLS - +#if defined(MACH_KERNEL_PRIVATE) +__private_extern__ uint64_t +ml_phys_read_data(uint64_t paddr, int psz); +__private_extern__ void +pmap_verify_noncacheable(uintptr_t vaddr); +#endif /* MACH_KERNEL_PRIVATE */ #ifdef XNU_KERNEL_PRIVATE boolean_t ml_fpu_avx_enabled(void); +#if !defined(RC_HIDE_XNU_J137) +boolean_t ml_fpu_avx512_enabled(void); +#endif void interrupt_latency_tracker_setup(void); void interrupt_reset_latency_stats(void); @@ -348,8 +360,15 @@ void timer_queue_expire_local(void*); void timer_queue_expire_rescan(void*); void ml_timer_evaluate(void); boolean_t ml_timer_forced_evaluation(void); -int ml_timer_get_user_idle_level(void); -kern_return_t ml_timer_set_user_idle_level(int); + +uint64_t ml_energy_stat(thread_t); +void ml_gpu_stat_update(uint64_t); +uint64_t ml_gpu_stat(thread_t); +boolean_t ml_recent_wake(void); + +extern uint64_t reportphyreaddelayabs; +extern uint32_t reportphyreadosbt; +extern uint32_t phyreadpanic; #endif /* XNU_KERNEL_PRIVATE */ #endif /* _I386_MACHINE_ROUTINES_H_ */