]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/i386/pmCPU.c
xnu-4570.71.2.tar.gz
[apple/xnu.git] / osfmk / i386 / pmCPU.c
index a4b8c62e61a7e39bc6734d63341a9e66ea49d665..de55ad8dd6ed009cecde714262889ce35f1c29d8 100644 (file)
@@ -364,7 +364,7 @@ static void
 pmLockCPUTopology(int lock)
 {
     if (lock) {
-       simple_lock(&x86_topo_lock);
+       mp_safe_spin_lock(&x86_topo_lock);
     } else {
        simple_unlock(&x86_topo_lock);
     }
@@ -569,12 +569,7 @@ ml_get_maxbusdelay(void)
 }
 
 /*
- * Set the maximum delay time allowed for snoop on the bus.
- *
- * Note that this value will be compared to the amount of time that it takes
- * to transition from a non-snooping power state (C4) to a snooping state (C2).
- * If maxBusDelay is less than C4C2SnoopDelay,
- * we will not enter the lowest power state.
+ * Advertise a memory access latency tolerance of "mdelay" ns
  */
 void
 ml_set_maxbusdelay(uint32_t mdelay)
@@ -682,18 +677,6 @@ machine_run_count(uint32_t count)
        saved_run_count = count;
 }
 
-boolean_t
-machine_processor_is_inactive(processor_t processor)
-{
-    int                cpu = processor->cpu_id;
-
-    if (pmDispatch != NULL
-       && pmDispatch->pmIsCPUUnAvailable != NULL)
-       return(pmDispatch->pmIsCPUUnAvailable(cpu_to_lcpu(cpu)));
-    else
-       return(FALSE);
-}
-
 processor_t
 machine_choose_processor(processor_set_t pset,
                         processor_t preferred)
@@ -747,8 +730,6 @@ pmThreadGetUrgency(uint64_t *rt_period, uint64_t *rt_deadline)
                        *rt_deadline = arg2;
        }
 
-       KERNEL_DEBUG(MACHDBG_CODE(DBG_MACH_SCHED, MACH_SCHED_GET_URGENCY), urgency, arg1, arg2, 0, 0);
-
        return(urgency);
 }
 
@@ -763,9 +744,10 @@ void
 thread_tell_urgency(int urgency,
     uint64_t rt_period,
     uint64_t rt_deadline,
+    uint64_t sched_latency,
     thread_t nthread)
 {
-       uint64_t        urgency_notification_time_start, delta;
+       uint64_t        urgency_notification_time_start = 0, delta;
        boolean_t       urgency_assert = (urgency_notification_assert_abstime_threshold != 0);
        assert(get_preemption_level() > 0 || ml_get_interrupts_enabled() == FALSE);
 #if    DEBUG
@@ -776,7 +758,7 @@ thread_tell_urgency(int urgency,
            || pmDispatch->pmThreadTellUrgency == NULL)
                return;
 
-       KERNEL_DEBUG_CONSTANT(MACHDBG_CODE(DBG_MACH_SCHED,MACH_URGENCY) | DBG_FUNC_START, urgency, rt_period, rt_deadline, 0, 0);
+       SCHED_DEBUG_PLATFORM_KERNEL_DEBUG_CONSTANT(MACHDBG_CODE(DBG_MACH_SCHED,MACH_URGENCY) | DBG_FUNC_START, urgency, rt_period, rt_deadline, sched_latency, 0);
 
        if (__improbable((urgency_assert == TRUE)))
                urgency_notification_time_start = mach_absolute_time();
@@ -799,7 +781,51 @@ thread_tell_urgency(int urgency,
                }
        }
 
-       KERNEL_DEBUG_CONSTANT(MACHDBG_CODE(DBG_MACH_SCHED,MACH_URGENCY) | DBG_FUNC_END, urgency, rt_period, rt_deadline, 0, 0);
+       SCHED_DEBUG_PLATFORM_KERNEL_DEBUG_CONSTANT(MACHDBG_CODE(DBG_MACH_SCHED,MACH_URGENCY) | DBG_FUNC_END, urgency, rt_period, rt_deadline, 0, 0);
+}
+
+void
+machine_thread_going_on_core(__unused thread_t      new_thread,
+                                                        __unused int           urgency,
+                                                        __unused uint64_t      sched_latency,
+                                                        __unused uint64_t      same_pri_latency,
+                                                        __unused uint64_t      dispatch_time)
+{
+}
+
+void
+machine_thread_going_off_core(__unused thread_t old_thread, __unused boolean_t thread_terminating, __unused uint64_t last_dispatch)
+{
+}
+
+void
+machine_max_runnable_latency(__unused uint64_t bg_max_latency,
+                                                        __unused uint64_t default_max_latency,
+                                                        __unused uint64_t realtime_max_latency)
+{
+}
+
+void
+machine_work_interval_notify(__unused thread_t thread,
+                             __unused struct kern_work_interval_args* kwi_args)
+{
+}
+
+
+void machine_switch_perfcontrol_context(__unused perfcontrol_event event,
+                                       __unused uint64_t timestamp,
+                                       __unused uint32_t flags,
+                                       __unused uint64_t new_thread_same_pri_latency,
+                                       __unused thread_t old,
+                                       __unused thread_t new)
+{
+}
+
+void machine_switch_perfcontrol_state_update(__unused perfcontrol_event event,
+                                            __unused uint64_t timestamp,
+                                            __unused uint32_t flags,
+                                            __unused thread_t thread)
+{
 }
 
 void