2 * Copyright (c) 2004-2011 Apple Inc. All rights reserved.
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
30 * CPU-specific power management support.
32 * Implements the "wrappers" to the KEXT.
35 #include <i386/machine_cpu.h>
37 #include <i386/machine_routines.h>
38 #include <i386/proc_reg.h>
39 #include <i386/pmap.h>
40 #include <i386/misc_protos.h>
41 #include <kern/machine.h>
43 #include <kern/processor.h>
44 #include <kern/etimer.h>
45 #include <i386/cpu_threads.h>
46 #include <i386/pmCPU.h>
47 #include <i386/cpuid.h>
48 #include <i386/rtclock_protos.h>
49 #include <kern/sched_prim.h>
50 #include <i386/lapic.h>
51 #include <i386/pal_routines.h>
52 #include <sys/kdebug.h>
54 extern int disableConsoleOutput
;
56 #define DELAY_UNSET 0xFFFFFFFFFFFFFFFFULL
58 uint64_t cpu_itime_bins
[CPU_ITIME_BINS
] = {16* NSEC_PER_USEC
, 32* NSEC_PER_USEC
, 64* NSEC_PER_USEC
, 128* NSEC_PER_USEC
, 256* NSEC_PER_USEC
, 512* NSEC_PER_USEC
, 1024* NSEC_PER_USEC
, 2048* NSEC_PER_USEC
, 4096* NSEC_PER_USEC
, 8192* NSEC_PER_USEC
, 16384* NSEC_PER_USEC
, 32768* NSEC_PER_USEC
};
59 uint64_t *cpu_rtime_bins
= &cpu_itime_bins
[0];
62 * The following is set when the KEXT loads and initializes.
64 pmDispatch_t
*pmDispatch
= NULL
;
66 uint32_t pmInitDone
= 0;
67 static boolean_t earlyTopology
= FALSE
;
68 static uint64_t earlyMaxBusDelay
= DELAY_UNSET
;
69 static uint64_t earlyMaxIntDelay
= DELAY_UNSET
;
72 * Initialize the Cstate change code.
75 power_management_init(void)
77 if (pmDispatch
!= NULL
&& pmDispatch
->cstateInit
!= NULL
)
78 (*pmDispatch
->cstateInit
)();
81 static inline void machine_classify_interval(uint64_t interval
, uint64_t *bins
, uint64_t *binvals
, uint32_t nbins
) {
83 for (i
= 0; i
< nbins
; i
++) {
84 if (interval
< binvals
[i
]) {
92 * Called when the CPU is idle. It calls into the power management kext
93 * to determine the best way to idle the CPU.
98 cpu_data_t
*my_cpu
= current_cpu_datap();
99 uint64_t ctime
, rtime
, itime
;
104 ctime
= mach_absolute_time();
106 my_cpu
->lcpu
.state
= LCPU_IDLE
;
107 DBGLOG(cpu_handle
, cpu_number(), MP_IDLE
);
108 MARK_CPU_IDLE(cpu_number());
110 rtime
= ctime
- my_cpu
->cpu_ixtime
;
112 my_cpu
->cpu_rtime_total
+= rtime
;
113 machine_classify_interval(rtime
, &my_cpu
->cpu_rtimes
[0], &cpu_rtime_bins
[0], CPU_RTIME_BINS
);
117 * Handle case where ml_set_maxbusdelay() or ml_set_maxintdelay()
118 * were called prior to the CPU PM kext being registered. We do
119 * this here since we know at this point the values will be first
120 * used since idle is where the decisions using these values is made.
122 if (earlyMaxBusDelay
!= DELAY_UNSET
)
123 ml_set_maxbusdelay((uint32_t)(earlyMaxBusDelay
& 0xFFFFFFFF));
125 if (earlyMaxIntDelay
!= DELAY_UNSET
)
126 ml_set_maxintdelay(earlyMaxIntDelay
);
130 && pmDispatch
!= NULL
131 && pmDispatch
->MachineIdle
!= NULL
)
132 (*pmDispatch
->MachineIdle
)(0x7FFFFFFFFFFFFFFFULL
);
135 * If no power management, re-enable interrupts and halt.
136 * This will keep the CPU from spinning through the scheduler
137 * and will allow at least some minimal power savings (but it
138 * cause problems in some MP configurations w.r.t. the APIC
139 * stopping during a GV3 transition).
143 /* Once woken, re-disable interrupts. */
148 * Mark the CPU as running again.
150 MARK_CPU_ACTIVE(cpu_number());
151 DBGLOG(cpu_handle
, cpu_number(), MP_UNIDLE
);
153 uint64_t ixtime
= my_cpu
->cpu_ixtime
= mach_absolute_time();
154 my_cpu
->cpu_idle_exits
++;
156 itime
= ixtime
- ctime
;
158 my_cpu
->lcpu
.state
= LCPU_RUN
;
160 machine_classify_interval(itime
, &my_cpu
->cpu_itimes
[0], &cpu_itime_bins
[0], CPU_ITIME_BINS
);
161 my_cpu
->cpu_itime_total
+= itime
;
165 * Re-enable interrupts.
172 * Called when the CPU is to be halted. It will choose the best C-State
176 pmCPUHalt(uint32_t reason
)
178 cpu_data_t
*cpup
= current_cpu_datap();
182 cpup
->lcpu
.state
= LCPU_PAUSE
;
187 cpup
->lcpu
.state
= LCPU_PAUSE
;
197 && pmDispatch
!= NULL
198 && pmDispatch
->pmCPUHalt
!= NULL
) {
200 * Halt the CPU (and put it in a low power state.
202 (*pmDispatch
->pmCPUHalt
)();
205 * We've exited halt, so get the CPU schedulable again.
206 * - by calling the fast init routine for a slave, or
207 * - by returning if we're the master processor.
209 if (cpup
->cpu_number
!= master_cpu
) {
210 i386_init_slave_fast();
211 panic("init_slave_fast returned");
216 * If no power managment and a processor is taken off-line,
217 * then invalidate the cache and halt it (it will not be able
218 * to be brought back on-line without resetting the CPU).
220 __asm__
volatile ("wbinvd");
221 cpup
->lcpu
.state
= LCPU_HALT
;
224 panic("back from Halt");
232 pmMarkAllCPUsOff(void)
235 && pmDispatch
!= NULL
236 && pmDispatch
->markAllCPUsOff
!= NULL
)
237 (*pmDispatch
->markAllCPUsOff
)();
244 && pmDispatch
!= NULL
245 && pmDispatch
->pmCPUStateInit
!= NULL
) {
246 (*pmDispatch
->pmCPUStateInit
)();
247 earlyTopology
= FALSE
;
254 pmGetLogicalCPU(int cpu
)
256 return(cpu_to_lcpu(cpu
));
260 pmGetMyLogicalCPU(void)
262 cpu_data_t
*cpup
= current_cpu_datap();
270 return(cpu_to_core(cpu
));
276 cpu_data_t
*cpup
= current_cpu_datap();
278 return(cpup
->lcpu
.core
);
284 return(cpu_to_die(cpu
));
290 cpu_data_t
*cpup
= current_cpu_datap();
292 return(cpup
->lcpu
.die
);
296 pmGetPackage(int cpu
)
298 return(cpu_to_package(cpu
));
304 cpu_data_t
*cpup
= current_cpu_datap();
306 return(cpup
->lcpu
.package
);
310 pmLockCPUTopology(int lock
)
313 simple_lock(&x86_topo_lock
);
315 simple_unlock(&x86_topo_lock
);
320 * Called to get the next deadline that has been set by the
321 * power management code.
322 * Note: a return of 0 from AICPM and this routine signifies
323 * that no deadline is set.
326 pmCPUGetDeadline(cpu_data_t
*cpu
)
328 uint64_t deadline
= 0;
331 && pmDispatch
!= NULL
332 && pmDispatch
->GetDeadline
!= NULL
)
333 deadline
= (*pmDispatch
->GetDeadline
)(&cpu
->lcpu
);
339 * Called to determine if the supplied deadline or the power management
340 * deadline is sooner. Returns which ever one is first.
343 pmCPUSetDeadline(cpu_data_t
*cpu
, uint64_t deadline
)
346 && pmDispatch
!= NULL
347 && pmDispatch
->SetDeadline
!= NULL
)
348 deadline
= (*pmDispatch
->SetDeadline
)(&cpu
->lcpu
, deadline
);
354 * Called when a power management deadline expires.
357 pmCPUDeadline(cpu_data_t
*cpu
)
360 && pmDispatch
!= NULL
361 && pmDispatch
->Deadline
!= NULL
)
362 (*pmDispatch
->Deadline
)(&cpu
->lcpu
);
366 * Called to get a CPU out of idle.
369 pmCPUExitIdle(cpu_data_t
*cpu
)
374 && pmDispatch
!= NULL
375 && pmDispatch
->exitIdle
!= NULL
)
376 do_ipi
= (*pmDispatch
->exitIdle
)(&cpu
->lcpu
);
384 pmCPUExitHalt(int cpu
)
386 kern_return_t rc
= KERN_INVALID_ARGUMENT
;
389 && pmDispatch
!= NULL
390 && pmDispatch
->exitHalt
!= NULL
)
391 rc
= pmDispatch
->exitHalt(cpu_to_lcpu(cpu
));
397 pmCPUExitHaltToOff(int cpu
)
399 kern_return_t rc
= KERN_SUCCESS
;
402 && pmDispatch
!= NULL
403 && pmDispatch
->exitHaltToOff
!= NULL
)
404 rc
= pmDispatch
->exitHaltToOff(cpu_to_lcpu(cpu
));
410 * Called to initialize the power management structures for the CPUs.
415 if (pmDispatch
!= NULL
&& pmDispatch
->pmCPUStateInit
!= NULL
)
416 (*pmDispatch
->pmCPUStateInit
)();
418 earlyTopology
= TRUE
;
422 * Called when a CPU is being restarted after being powered off (as in S3).
425 pmCPUMarkRunning(cpu_data_t
*cpu
)
427 cpu_data_t
*cpup
= current_cpu_datap();
430 && pmDispatch
!= NULL
431 && pmDispatch
->markCPURunning
!= NULL
)
432 (*pmDispatch
->markCPURunning
)(&cpu
->lcpu
);
434 cpup
->lcpu
.state
= LCPU_RUN
;
438 * Called to get/set CPU power management state.
441 pmCPUControl(uint32_t cmd
, void *datap
)
445 if (pmDispatch
!= NULL
446 && pmDispatch
->pmCPUControl
!= NULL
)
447 rc
= (*pmDispatch
->pmCPUControl
)(cmd
, datap
);
453 * Called to save the timer state used by power management prior
459 if (pmDispatch
!= NULL
460 && pmDispatch
->pmTimerStateSave
!= NULL
)
461 (*pmDispatch
->pmTimerStateSave
)();
465 * Called to restore the timer state used by power management after
466 * waking from "sleep".
471 if (pmDispatch
!= NULL
472 && pmDispatch
->pmTimerStateRestore
!= NULL
)
473 (*pmDispatch
->pmTimerStateRestore
)();
477 * Set the worst-case time for the C4 to C2 transition.
478 * No longer does anything.
481 ml_set_maxsnoop(__unused
uint32_t maxdelay
)
487 * Get the worst-case time for the C4 to C2 transition. Returns nanoseconds.
490 ml_get_maxsnoop(void)
492 uint64_t max_snoop
= 0;
495 && pmDispatch
!= NULL
496 && pmDispatch
->getMaxSnoop
!= NULL
)
497 max_snoop
= pmDispatch
->getMaxSnoop();
499 return((unsigned)(max_snoop
& 0xffffffff));
504 ml_get_maxbusdelay(void)
506 uint64_t max_delay
= 0;
509 && pmDispatch
!= NULL
510 && pmDispatch
->getMaxBusDelay
!= NULL
)
511 max_delay
= pmDispatch
->getMaxBusDelay();
513 return((uint32_t)(max_delay
& 0xffffffff));
517 * Set the maximum delay time allowed for snoop on the bus.
519 * Note that this value will be compared to the amount of time that it takes
520 * to transition from a non-snooping power state (C4) to a snooping state (C2).
521 * If maxBusDelay is less than C4C2SnoopDelay,
522 * we will not enter the lowest power state.
525 ml_set_maxbusdelay(uint32_t mdelay
)
527 uint64_t maxdelay
= mdelay
;
529 if (pmDispatch
!= NULL
530 && pmDispatch
->setMaxBusDelay
!= NULL
) {
531 earlyMaxBusDelay
= DELAY_UNSET
;
532 pmDispatch
->setMaxBusDelay(maxdelay
);
534 earlyMaxBusDelay
= maxdelay
;
538 ml_get_maxintdelay(void)
540 uint64_t max_delay
= 0;
542 if (pmDispatch
!= NULL
543 && pmDispatch
->getMaxIntDelay
!= NULL
)
544 max_delay
= pmDispatch
->getMaxIntDelay();
550 * Set the maximum delay allowed for an interrupt.
553 ml_set_maxintdelay(uint64_t mdelay
)
555 if (pmDispatch
!= NULL
556 && pmDispatch
->setMaxIntDelay
!= NULL
) {
557 earlyMaxIntDelay
= DELAY_UNSET
;
558 pmDispatch
->setMaxIntDelay(mdelay
);
560 earlyMaxIntDelay
= mdelay
;
564 ml_get_interrupt_prewake_applicable()
566 boolean_t applicable
= FALSE
;
569 && pmDispatch
!= NULL
570 && pmDispatch
->pmInterruptPrewakeApplicable
!= NULL
)
571 applicable
= pmDispatch
->pmInterruptPrewakeApplicable();
577 * Put a CPU into "safe" mode with respect to power.
579 * Some systems cannot operate at a continuous "normal" speed without
580 * exceeding the thermal design. This is called per-CPU to place the
581 * CPUs into a "safe" operating mode.
584 pmSafeMode(x86_lcpu_t
*lcpu
, uint32_t flags
)
586 if (pmDispatch
!= NULL
587 && pmDispatch
->pmCPUSafeMode
!= NULL
)
588 pmDispatch
->pmCPUSafeMode(lcpu
, flags
);
591 * Do something reasonable if the KEXT isn't present.
593 * We only look at the PAUSE and RESUME flags. The other flag(s)
594 * will not make any sense without the KEXT, so just ignore them.
596 * We set the CPU's state to indicate that it's halted. If this
597 * is the CPU we're currently running on, then spin until the
598 * state becomes non-halted.
600 if (flags
& PM_SAFE_FL_PAUSE
) {
601 lcpu
->state
= LCPU_PAUSE
;
602 if (lcpu
== x86_lcpu()) {
603 while (lcpu
->state
== LCPU_PAUSE
)
609 * Clear the halted flag for the specified CPU, that will
610 * get it out of it's spin loop.
612 if (flags
& PM_SAFE_FL_RESUME
) {
613 lcpu
->state
= LCPU_RUN
;
618 static uint32_t saved_run_count
= 0;
621 machine_run_count(uint32_t count
)
623 if (pmDispatch
!= NULL
624 && pmDispatch
->pmSetRunCount
!= NULL
)
625 pmDispatch
->pmSetRunCount(count
);
627 saved_run_count
= count
;
631 machine_processor_is_inactive(processor_t processor
)
633 int cpu
= processor
->cpu_id
;
635 if (pmDispatch
!= NULL
636 && pmDispatch
->pmIsCPUUnAvailable
!= NULL
)
637 return(pmDispatch
->pmIsCPUUnAvailable(cpu_to_lcpu(cpu
)));
643 machine_choose_processor(processor_set_t pset
,
644 processor_t preferred
)
658 startCPU
= pset
->cpu_set_low
;
659 endCPU
= pset
->cpu_set_hi
;
662 if (preferred
== NULL
)
665 preferredCPU
= preferred
->cpu_id
;
667 if (pmDispatch
!= NULL
668 && pmDispatch
->pmChooseCPU
!= NULL
) {
669 chosenCPU
= pmDispatch
->pmChooseCPU(startCPU
, endCPU
, preferredCPU
);
673 return(cpu_datap(chosenCPU
)->cpu_processor
);
680 pmThreadGetUrgency(uint64_t *rt_period
, uint64_t *rt_deadline
)
683 return(thread_get_urgency(rt_period
, rt_deadline
));
687 uint32_t urgency_stats
[64][THREAD_URGENCY_MAX
];
690 #define URGENCY_NOTIFICATION_ASSERT_NS (5 * 1000 * 1000)
691 uint64_t urgency_notification_assert_abstime_threshold
, urgency_notification_max_recorded
;
694 thread_tell_urgency(int urgency
,
696 uint64_t rt_deadline
)
698 uint64_t urgency_notification_time_start
, delta
;
699 boolean_t urgency_assert
= (urgency_notification_assert_abstime_threshold
!= 0);
700 assert(get_preemption_level() > 0 || ml_get_interrupts_enabled() == FALSE
);
702 urgency_stats
[cpu_number() % 64][urgency
]++;
705 || pmDispatch
== NULL
706 || pmDispatch
->pmThreadTellUrgency
== NULL
)
709 KERNEL_DEBUG_CONSTANT(MACHDBG_CODE(DBG_MACH_SCHED
,MACH_URGENCY
) | DBG_FUNC_START
, urgency
, rt_period
, (rt_deadline
>> 32), rt_deadline
, 0);
711 if (__improbable((urgency_assert
== TRUE
)))
712 urgency_notification_time_start
= mach_absolute_time();
714 pmDispatch
->pmThreadTellUrgency(urgency
, rt_period
, rt_deadline
);
716 if (__improbable((urgency_assert
== TRUE
))) {
717 delta
= mach_absolute_time() - urgency_notification_time_start
;
719 if (__improbable(delta
> urgency_notification_max_recorded
)) {
720 /* This is not synchronized, but it doesn't matter
721 * if we (rarely) miss an event, as it is statistically
722 * unlikely that it will never recur.
724 urgency_notification_max_recorded
= delta
;
726 if (__improbable((delta
> urgency_notification_assert_abstime_threshold
) && !machine_timeout_suspended()))
727 panic("Urgency notification callout %p exceeded threshold, 0x%llx abstime units", pmDispatch
->pmThreadTellUrgency
, delta
);
731 KERNEL_DEBUG_CONSTANT(MACHDBG_CODE(DBG_MACH_SCHED
,MACH_URGENCY
) | DBG_FUNC_END
, urgency
, rt_period
, (rt_deadline
>> 32), rt_deadline
, 0);
735 active_rt_threads(boolean_t active
)
738 || pmDispatch
== NULL
739 || pmDispatch
->pmActiveRTThreads
== NULL
)
742 pmDispatch
->pmActiveRTThreads(active
);
746 pmGetSavedRunCount(void)
748 return(saved_run_count
);
752 * Returns the root of the package tree.
761 pmCPUGetHibernate(int cpu
)
763 return(cpu_datap(cpu
)->cpu_hibernate
);
767 pmLCPUtoProcessor(int lcpu
)
769 return(cpu_datap(lcpu
)->cpu_processor
);
773 pmReSyncDeadlines(int cpu
)
775 static boolean_t registered
= FALSE
;
778 PM_interrupt_register(&etimer_resync_deadlines
);
782 if ((uint32_t)cpu
== current_cpu_datap()->lcpu
.cpu_num
)
783 etimer_resync_deadlines();
785 cpu_PM_interrupt(cpu
);
791 lapic_send_ipi(cpu
, LAPIC_PM_INTERRUPT
);
795 pmGetNanotimeInfo(pm_rtc_nanotime_t
*rtc_nanotime
)
798 * Make sure that nanotime didn't change while we were reading it.
801 rtc_nanotime
->generation
= pal_rtc_nanotime_info
.generation
; /* must be first */
802 rtc_nanotime
->tsc_base
= pal_rtc_nanotime_info
.tsc_base
;
803 rtc_nanotime
->ns_base
= pal_rtc_nanotime_info
.ns_base
;
804 rtc_nanotime
->scale
= pal_rtc_nanotime_info
.scale
;
805 rtc_nanotime
->shift
= pal_rtc_nanotime_info
.shift
;
806 } while(pal_rtc_nanotime_info
.generation
!= 0
807 && rtc_nanotime
->generation
!= pal_rtc_nanotime_info
.generation
);
811 pmTimerQueueMigrate(int target_cpu
)
813 /* Call the etimer code to do this. */
814 return (target_cpu
!= cpu_number())
815 ? etimer_queue_migrate(target_cpu
)
821 * Called by the power management kext to register itself and to get the
822 * callbacks it might need into other kernel functions. This interface
823 * is versioned to allow for slight mis-matches between the kext and the
827 pmKextRegister(uint32_t version
, pmDispatch_t
*cpuFuncs
,
828 pmCallBacks_t
*callbacks
)
830 if (callbacks
!= NULL
&& version
== PM_DISPATCH_VERSION
) {
831 callbacks
->setRTCPop
= setPop
;
832 callbacks
->resyncDeadlines
= pmReSyncDeadlines
;
833 callbacks
->initComplete
= pmInitComplete
;
834 callbacks
->GetLCPU
= pmGetLogicalCPU
;
835 callbacks
->GetCore
= pmGetCore
;
836 callbacks
->GetDie
= pmGetDie
;
837 callbacks
->GetPackage
= pmGetPackage
;
838 callbacks
->GetMyLCPU
= pmGetMyLogicalCPU
;
839 callbacks
->GetMyCore
= pmGetMyCore
;
840 callbacks
->GetMyDie
= pmGetMyDie
;
841 callbacks
->GetMyPackage
= pmGetMyPackage
;
842 callbacks
->GetPkgRoot
= pmGetPkgRoot
;
843 callbacks
->LockCPUTopology
= pmLockCPUTopology
;
844 callbacks
->GetHibernate
= pmCPUGetHibernate
;
845 callbacks
->LCPUtoProcessor
= pmLCPUtoProcessor
;
846 callbacks
->ThreadBind
= thread_bind
;
847 callbacks
->GetSavedRunCount
= pmGetSavedRunCount
;
848 callbacks
->GetNanotimeInfo
= pmGetNanotimeInfo
;
849 callbacks
->ThreadGetUrgency
= pmThreadGetUrgency
;
850 callbacks
->RTCClockAdjust
= rtc_clock_adjust
;
851 callbacks
->timerQueueMigrate
= pmTimerQueueMigrate
;
852 callbacks
->topoParms
= &topoParms
;
853 callbacks
->pmSendIPI
= pmSendIPI
;
854 callbacks
->InterruptPending
= lapic_is_interrupt_pending
;
855 callbacks
->IsInterrupting
= lapic_is_interrupting
;
856 callbacks
->InterruptStats
= lapic_interrupt_counts
;
857 callbacks
->DisableApicTimer
= lapic_disable_timer
;
859 panic("Version mis-match between Kernel and CPU PM");
862 if (cpuFuncs
!= NULL
) {
864 panic("Attempt to re-register power management interface--AICPM present in xcpm mode? %p->%p", pmDispatch
, cpuFuncs
);
867 pmDispatch
= cpuFuncs
;
870 && pmDispatch
->pmCPUStateInit
!= NULL
) {
871 (*pmDispatch
->pmCPUStateInit
)();
872 earlyTopology
= FALSE
;
875 if (pmDispatch
->pmIPIHandler
!= NULL
) {
876 lapic_set_pm_func((i386_intr_func_t
)pmDispatch
->pmIPIHandler
);
882 * Unregisters the power management functions from the kext.
885 pmUnRegister(pmDispatch_t
*cpuFuncs
)
887 if (cpuFuncs
!= NULL
&& pmDispatch
== cpuFuncs
) {
892 /******************************************************************************
894 * All of the following are deprecated interfaces and no longer used.
896 ******************************************************************************/
898 pmsControl(__unused
uint32_t request
, __unused user_addr_t reqaddr
,
899 __unused
uint32_t reqsize
)
901 return(KERN_SUCCESS
);
920 pmsRun(__unused
uint32_t nstep
)
925 pmsBuild(__unused pmsDef
*pd
, __unused
uint32_t pdsize
,
926 __unused pmsSetFunc_t
*functab
,
927 __unused
uint32_t platformData
, __unused pmsQueryFunc_t queryFunc
)
929 return(KERN_SUCCESS
);
932 void machine_track_platform_idle(boolean_t entry
) {
933 cpu_data_t
*my_cpu
= current_cpu_datap();
936 (void)__sync_fetch_and_add(&my_cpu
->lcpu
.package
->num_idle
, 1);
939 uint32_t nidle
= __sync_fetch_and_sub(&my_cpu
->lcpu
.package
->num_idle
, 1);
940 if (nidle
== topoParms
.nLThreadsPerPackage
) {
941 my_cpu
->lcpu
.package
->package_idle_exits
++;