]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/kern/sched_prim.c
xnu-792.13.8.tar.gz
[apple/xnu.git] / osfmk / kern / sched_prim.c
index ff05df2536bb976652f0c1e4d2d1da1d3590dd78..813051c75d7483e36078bf00b672abda65573d9f 100644 (file)
@@ -78,6 +78,7 @@
 
 #include <machine/machine_routines.h>
 #include <machine/sched_param.h>
+#include <machine/machine_cpu.h>
 
 #include <kern/kern_types.h>
 #include <kern/clock.h>
 
 #include <sys/kdebug.h>
 
-#ifdef __ppc__
-#include <ppc/pms.h>
-#endif
+#include <kern/pms.h>
 
 #define                DEFAULT_PREEMPTION_RATE         100             /* (1/s) */
 int                    default_preemption_rate = DEFAULT_PREEMPTION_RATE;
@@ -1577,10 +1576,8 @@ thread_dispatch(
         *      If blocked at a continuation, discard
         *      the stack.
         */
-#ifndef i386
     if (thread->continuation != NULL && thread->kernel_stack)
                stack_free(thread);
-#endif
 
        if (!(thread->state & TH_IDLE)) {
                wake_lock(thread);
@@ -1661,6 +1658,16 @@ thread_block_reason(
 
        s = splsched();
 
+#if 0
+#if    MACH_KDB
+       {
+               extern void db_chkpmgr(void);
+               db_chkpmgr();                                           /* (BRINGUP) See if pm config changed */
+
+       }
+#endif
+#endif
+
        if (!(reason & AST_PREEMPT))
                funnel_release_check(self, 2);
 
@@ -2496,8 +2503,10 @@ delay_idle(
 
                        timer_event((uint32_t)abstime, &processor->idle_thread->system_timer);
                }
-               else
+               else {
+                       cpu_pause();
                        abstime = mach_absolute_time();
+               }
        }
 
        timer_event((uint32_t)abstime, &self->system_timer);
@@ -2538,9 +2547,7 @@ idle_thread(void)
 
        (void)splsched();                       /* Turn interruptions off */
 
-#ifdef __ppc__
        pmsDown();                                      /* Step power down.  Note: interruptions must be disabled for this call */
-#endif
 
        while ( (*threadp == THREAD_NULL)                               &&
                                (*gcount == 0) && (*lcount == 0)        ) {
@@ -2564,9 +2571,7 @@ idle_thread(void)
        pset = processor->processor_set;
        simple_lock(&pset->sched_lock);
 
-#ifdef __ppc__
        pmsStep(0);                                     /* Step up out of idle power, may start timer for next step */
-#endif
 
        state = processor->state;
        if (state == PROCESSOR_DISPATCHING) {