]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/kern/timer_queue.h
xnu-4570.1.46.tar.gz
[apple/xnu.git] / osfmk / kern / timer_queue.h
index 060e72183c0cac3d921b686dd7d94975e429458d..99284d42e596e89a055c04aa593f660fa2f8edbd 100644 (file)
@@ -47,6 +47,7 @@
 #if defined(i386) || defined(x86_64)
 #define DECR_RDHPET            MACHDBG_CODE(DBG_MACH_EXCP_DECI, 5)
 #define DECR_SET_TSC_DEADLINE  MACHDBG_CODE(DBG_MACH_EXCP_DECI, 6)
+#define DECR_SET_APIC_DEADLINE MACHDBG_CODE(DBG_MACH_EXCP_DECI, 16)
 #endif
 #define DECR_TIMER_ENTER       MACHDBG_CODE(DBG_MACH_EXCP_DECI, 7)
 #define DECR_TIMER_CANCEL      MACHDBG_CODE(DBG_MACH_EXCP_DECI, 8)
@@ -100,6 +101,44 @@ extern void                timer_call_nosync_cpu(
  *     Invoked by platform, implemented by kernel.
  */
 
+/*
+ *     Invoked by kernel, implemented by platform.
+ */
+
+#define NUM_LATENCY_QOS_TIERS (6)
+
+typedef struct {
+       uint32_t idle_entry_timer_processing_hdeadline_threshold_ns;
+       uint32_t interrupt_timer_coalescing_ilat_threshold_ns;
+       uint32_t timer_resort_threshold_ns;
+
+       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_ns_t;
+
+extern timer_coalescing_priority_params_ns_t * timer_call_get_priority_params(void);
+
+
+extern uint64_t                timer_call_slop(
+       uint64_t                deadline,
+       uint64_t                armtime,
+       uint32_t                urgency,
+       thread_t                arming_thread,
+       boolean_t               *rlimited);
+
 /* Process deadline expiration for queue, returns new deadline */
 extern uint64_t                timer_queue_expire(
                                mpqueue_head_t          *queue,
@@ -110,6 +149,9 @@ extern uint64_t             timer_queue_expire_with_options(
                                uint64_t,
                                boolean_t);
 
+extern void            quantum_timer_expire(
+                               uint64_t                deadline);
+
 /* Shutdown a timer queue and reassign existing activities */
 extern void            timer_queue_shutdown(
                                mpqueue_head_t          *queue);
@@ -135,6 +177,8 @@ extern void         timer_resync_deadlines(void);
 
 extern void            timer_set_deadline(uint64_t deadline);
 
+extern void            quantum_timer_set_deadline(uint64_t deadline);
+
 /* Migrate the local timer queue of a given cpu to the master cpu */
 extern uint32_t                timer_queue_migrate_cpu(int target_cpu);