2 * Copyright (c) 1998-2005 Apple Computer, 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@
31 #include <IOKit/IOTypes.h>
32 #include <IOKit/IOMessage.h>
33 #include <IOKit/IOReturn.h>
36 #include <IOKit/pwr_mgt/IOPMDeprecated.h>
40 @abstract Defines power management constants and keys used by both in-kernel and user space power management.
41 @discussion IOPM.h defines a range of power management constants used in several in-kernel and user space APIs. Most significantly, the IOPMPowerFlags used to specify the fields of an IOPMPowerState struct are defined here.
43 Most of the constants defined in IOPM.h are deprecated or for Apple internal use only, and are not elaborated on in headerdoc.
47 kIOPMMaxPowerStates
= 10,
48 IOPMMaxPowerStates
= kIOPMMaxPowerStates
51 /*! @enum IOPMPowerFlags
52 @abstract Bits are used in defining capabilityFlags, inputPowerRequirements, and outputPowerCharacter in the IOPMPowerState structure.
53 @discussion These bits may be bitwise-OR'd together in the IOPMPowerState capabilityFlags field, the outputPowerCharacter field, and/or the inputPowerRequirement field.
55 The comments clearly mark whether each flag should be used in the capabilityFlags field, outputPowerCharacter field, and inputPowerRequirement field, or all three.
57 The value of capabilityFlags, inputPowerRequirement or outputPowerCharacter may be 0. Most drivers implement their 'OFF' state, used when asleep, by defininf each of the 3 fields as 0.
59 The bits listed below are only the most common bits used to define a device's power states. Your device's IO family may require that your device specify other input or output power flags to interact properly. Consult family-specific documentation to determine if your IOPower plane parents or children require other power flags; they probably don't.
61 @constant kIOPMPowerOn Indicates the device is on, requires power, and provides power. Useful as a: Capability, InputPowerRequirement, OutputPowerCharacter
63 @constant kIOPMDeviceUsable Indicates the device is usable in this state. Useful only as a Capability
65 @constant kIOPMLowPower
66 Indicates device is in a low power state. May be bitwis-OR'd together
67 with kIOPMDeviceUsable flag, to indicate the device is still usable.
69 A device with a capability of kIOPMLowPower may:
70 Require either 0 or kIOPMPowerOn from its power parent
71 Offer either kIOPMLowPower, kIOPMPowerOn, or 0 (no power at all)
72 to its power plane children.
74 Useful only as a Capability, although USB drivers should consult USB family documentation for other valid circumstances to use the kIOPMLowPower bit.
76 @constant kIOPMPreventIdleSleep
77 In the capability field of a power state, disallows idle system sleep while the device is in that state.
79 For example, displays and disks set this capability for their ON power state; since the system may not idle sleep while the display (and thus keyboard or mouse) or the disk is active.
81 Useful only as a Capability.
83 @constant kIOPMSleepCapability
84 Used only by certain IOKit Families (USB). Not defined or used by generic Power Management. Read your family documentation to see if you should define a powerstate using these capabilities.
86 @constant kIOPMRestartCapability
87 Used only by certain IOKit Families (USB). Not defined or used by generic Power Management. Read your family documentation to see if you should define a powerstate using these capabilities.
90 Used only by certain IOKit Families (USB). Not defined or used by generic Power Management. Read your family documentation to see if you should define a powerstate using these capabilities.
92 @constant kIOPMRestart
93 Used only by certain IOKit Families (USB). Not defined or used by generic Power Management. Read your family documentation to see if you should define a powerstate using these capabilities.
95 typedef unsigned long IOPMPowerFlags
;
97 kIOPMPowerOn
= 0x00000002,
98 kIOPMDeviceUsable
= 0x00008000,
99 kIOPMLowPower
= 0x00010000,
100 kIOPMPreventIdleSleep
= 0x00000040,
101 kIOPMSleepCapability
= 0x00000004,
102 kIOPMRestartCapability
= 0x00000080,
103 kIOPMSleep
= 0x00000001,
104 kIOPMRestart
= 0x00000080
108 * Private IOPMPowerFlags
111 * Not for use with non-Apple drivers
112 * Their behavior is undefined
115 kIOPMClockNormal
= 0x0004,
116 kIOPMClockRunning
= 0x0008,
117 kIOPMPreventSystemSleep
= 0x0010,
119 kIOPMChildClamp
= 0x0080,
120 kIOPMChildClamp2
= 0x0200,
121 kIOPMNotPowerManaged
= 0x0800
126 * Deprecated IOPMPowerFlags
127 * Their behavior is undefined when used in IOPMPowerState
128 * Capability, InputPowerRequirement, or OutputPowerCharacter fields.
131 kIOPMMaxPerformance
= 0x4000,
132 kIOPMPassThrough
= 0x0100,
133 kIOPMAuxPowerOn
= 0x0020,
134 kIOPMNotAttainable
= 0x0001,
135 kIOPMContextRetained
= 0x2000,
136 kIOPMConfigRetained
= 0x1000,
137 kIOPMStaticPowerValid
= 0x0800,
138 kIOPMSoftSleep
= 0x0400,
139 kIOPMCapabilitiesMask
= kIOPMPowerOn
| kIOPMDeviceUsable
|
140 kIOPMMaxPerformance
| kIOPMContextRetained
|
141 kIOPMConfigRetained
| kIOPMSleepCapability
|
142 kIOPMRestartCapability
146 * Support for old names of IOPMPowerFlag constants
149 IOPMNotAttainable
= kIOPMNotAttainable
,
150 IOPMPowerOn
= kIOPMPowerOn
,
151 IOPMClockNormal
= kIOPMClockNormal
,
152 IOPMClockRunning
= kIOPMClockRunning
,
153 IOPMAuxPowerOn
= kIOPMAuxPowerOn
,
154 IOPMDeviceUsable
= kIOPMDeviceUsable
,
155 IOPMMaxPerformance
= kIOPMMaxPerformance
,
156 IOPMContextRetained
= kIOPMContextRetained
,
157 IOPMConfigRetained
= kIOPMConfigRetained
,
158 IOPMNotPowerManaged
= kIOPMNotPowerManaged
,
159 IOPMSoftSleep
= kIOPMSoftSleep
164 kIOPMNextHigherState
= 1,
165 kIOPMHighestState
= 2,
166 kIOPMNextLowerState
= 3,
171 IOPMNextHigherState
= kIOPMNextHigherState
,
172 IOPMHighestState
= kIOPMHighestState
,
173 IOPMNextLowerState
= kIOPMNextLowerState
,
174 IOPMLowestState
= kIOPMLowestState
177 // Internal commands used by power managment command queue
179 kIOPMBroadcastAggressiveness
= 1,
183 // Power consumption unknown value
185 kIOPMUnknown
= 0xFFFF
188 /*******************************************************************************
190 * Root Domain property keys of interest
192 ******************************************************************************/
194 /* AppleClamshellState
195 * reflects the state of the clamshell (lid) on a portable.
196 * It has a boolean value.
197 * true == clamshell is closed
198 * false == clamshell is open
199 * not present == no clamshell on this hardware
201 #define kAppleClamshellStateKey "AppleClamshellState"
203 /* AppleClamshellCausesSleep
204 * reflects the clamshell close behavior on a portable.
205 * It has a boolean value.
206 * true == system will sleep when clamshell is closed
207 * false == system will not sleep on clamshell close
208 * (typically external display mode)
209 * not present == no clamshell on this hardware
211 #define kAppleClamshellCausesSleepKey "AppleClamshellCausesSleep"
213 /* kIOPMSleepWakeUUIDKey
214 * Key refers to a CFStringRef that will uniquely identify
215 * a sleep/wake cycle for logging & tracking.
216 * The key becomes valid at the beginning of a sleep cycle - before we
217 * initiate any sleep/wake notifications.
218 * The key becomes invalid at the completion of a system wakeup. The
219 * property will not be present in the IOPMrootDomain's registry entry
220 * when it is invalid.
222 * See IOPMrootDomain notification kIOPMMessageSleepWakeUUIDChange
224 #define kIOPMSleepWakeUUIDKey "SleepWakeUUID"
226 /* kIOPMDeepSleepEnabledKey
227 * Indicates the Deep Sleep enable state.
228 * It has a boolean value.
229 * true == Deep Sleep is enabled
230 * false == Deep Sleep is disabled
231 * not present == Deep Sleep is not supported on this hardware
233 #define kIOPMDeepSleepEnabledKey "DeepSleep Enabled"
235 /* kIOPMDeepSleepDelayKey
236 * Key refers to a CFNumberRef that represents the delay in seconds before
237 * entering Deep Sleep state. The property is not present if Deep Sleep is
240 #define kIOPMDeepSleepDelayKey "DeepSleep Delay"
242 /* kIOPMLowBatteryWakeThresholdKey
243 * Key refers to a CFNumberRef that represents the percentage of battery
244 * remaining charge that will trigger a system wake followed by Deep Sleep.
246 #define kIOPMLowBatteryWakeThresholdKey "LowBatteryWakeThreshold"
248 /*******************************************************************************
250 * Driver PM Assertions
252 ******************************************************************************/
254 /* Driver Assertion bitfield description
255 * Driver PM assertions are defined by these bits.
258 /*! kIOPMDriverAssertionCPUBit
259 * When set, PM kernel will prefer to leave the CPU and core hardware
260 * running in "Dark Wake" state, instead of sleeping.
262 kIOPMDriverAssertionCPUBit
= 0x01,
264 /*! kIOPMDriverAssertionUSBExternalDeviceBit
265 * When set, driver is informing PM that an external USB device is attached.
267 kIOPMDriverAssertionUSBExternalDeviceBit
= 0x04,
269 /*! kIOPMDriverAssertionBluetoothHIDDevicePairedBit
270 * When set, driver is informing PM that a Bluetooth HID device is paired.
272 kIOPMDriverAssertionBluetoothHIDDevicePairedBit
= 0x08,
274 /*! kIOPMDriverAssertionExternalMediaMountedBit
275 * When set, driver is informing PM that an external media is mounted.
277 kIOPMDriverAssertionExternalMediaMountedBit
= 0x10,
279 kIOPMDriverAssertionReservedBit5
= 0x20,
280 kIOPMDriverAssertionReservedBit6
= 0x40,
281 kIOPMDriverAssertionReservedBit7
= 0x80
284 /* kIOPMAssertionsDriverKey
285 * This kIOPMrootDomain key refers to a CFNumberRef property, containing
286 * a bitfield describing the aggregate PM assertion levels.
287 * Example: A value of 0 indicates that no driver has asserted anything.
288 * Or, a value of <link>kIOPMDriverAssertionCPUBit</link>
289 * indicates that a driver (or drivers) have asserted a need fro CPU and video.
291 #define kIOPMAssertionsDriverKey "DriverPMAssertions"
293 /* kIOPMAssertionsDriverKey
294 * This kIOPMrootDomain key refers to a CFNumberRef property, containing
295 * a bitfield describing the aggregate PM assertion levels.
296 * Example: A value of 0 indicates that no driver has asserted anything.
297 * Or, a value of <link>kIOPMDriverAssertionCPUBit</link>
298 * indicates that a driver (or drivers) have asserted a need fro CPU and video.
300 #define kIOPMAssertionsDriverDetailedKey "DriverPMAssertionsDetailed"
302 /*******************************************************************************
304 * Kernel Driver assertion detailed dictionary keys
306 * Keys decode the Array & dictionary data structure under IOPMrootDomain property
307 * kIOPMAssertionsDriverKey.
310 #define kIOPMDriverAssertionIDKey "ID"
311 #define kIOPMDriverAssertionCreatedTimeKey "CreatedTime"
312 #define kIOPMDriverAssertionModifiedTimeKey "ModifiedTime"
313 #define kIOPMDriverAssertionOwnerStringKey "Owner"
314 #define kIOPMDriverAssertionOwnerServiceKey "ServicePtr"
315 #define kIOPMDriverAssertionLevelKey "Level"
316 #define kIOPMDriverAssertionAssertedKey "Assertions"
318 /*******************************************************************************
320 * Root Domain general interest messages
322 * Available by registering for interest type 'gIOGeneralInterest'
325 ******************************************************************************/
327 /* kIOPMMessageClamshellStateChange
328 * Delivered as a general interest notification on the IOPMrootDomain
329 * IOPMrootDomain sends this message when state of either AppleClamshellState
330 * or AppleClamshellCausesSleep changes. If this clamshell change results in
331 * a sleep, the sleep will initiate soon AFTER delivery of this message.
332 * The state of both variables is encoded in a bitfield argument sent with
333 * the message. Check bits 0 and 1 using kClamshellStateBit & kClamshellSleepBit
336 kClamshellStateBit
= (1 << 0),
337 kClamshellSleepBit
= (1 << 1)
340 #define kIOPMMessageClamshellStateChange \
341 iokit_family_msg(sub_iokit_powermanagement, 0x100)
343 /* kIOPMMessageFeatureChange
344 * Delivered when the set of supported features ("Supported Features" dictionary
345 * under IOPMrootDomain registry) changes in some way. Typically addition or
346 * removal of a supported feature.
347 * RootDomain passes no argument with this message.
349 #define kIOPMMessageFeatureChange \
350 iokit_family_msg(sub_iokit_powermanagement, 0x110)
352 /* kIOPMMessageInflowDisableCancelled
353 * The battery has drained completely to its "Fully Discharged" state.
354 * If a user process has disabled battery inflow for battery
355 * calibration, we forcibly re-enable Inflow at this point.
356 * If inflow HAS been forcibly re-enabled, bit 0
357 * (kInflowForciblyEnabledBit) will be set.
360 kInflowForciblyEnabledBit
= (1 << 0)
363 /* kIOPMMessageInternalBatteryFullyDischarged
364 * The battery has drained completely to its "Fully Discharged" state.
366 #define kIOPMMessageInternalBatteryFullyDischarged \
367 iokit_family_msg(sub_iokit_powermanagement, 0x120)
369 /* kIOPMMessageSystemPowerEventOccurred
370 * Some major system thermal property has changed, and interested clients may
371 * modify their behavior.
373 #define kIOPMMessageSystemPowerEventOccurred \
374 iokit_family_msg(sub_iokit_powermanagement, 0x130)
376 /* kIOPMMessageSleepWakeUUIDChange
377 * Either a new SleepWakeUUID has been specified at the beginning of a sleep,
378 * or we're removing the existing property upon completion of a wakeup.
380 #define kIOPMMessageSleepWakeUUIDChange \
381 iokit_family_msg(sub_iokit_powermanagement, 0x140)
383 /* kIOPMMessageSleepWakeUUIDSet
384 * Argument accompanying the kIOPMMessageSleepWakeUUIDChange notification when
385 * a new UUID has been specified.
387 #define kIOPMMessageSleepWakeUUIDSet ((void *)1)
389 /* kIOPMMessageSleepWakeUUIDCleared
390 * Argument accompanying the kIOPMMessageSleepWakeUUIDChange notification when
391 * the current UUID has been removed.
393 #define kIOPMMessageSleepWakeUUIDCleared ((void *)0)
395 /*! kIOPMMessageDriverAssertionsChanged
396 * Sent when kernel PM driver assertions have changed.
398 #define kIOPMMessageDriverAssertionsChanged \
399 iokit_family_msg(sub_iokit_powermanagement, 0x150)
401 /*******************************************************************************
403 * Power commands issued to root domain
404 * Use with IOPMrootDomain::receivePowerNotification()
406 * These commands are issued from system drivers only:
407 * ApplePMU, AppleSMU, IOGraphics, AppleACPIFamily
409 ******************************************************************************/
411 kIOPMSleepNow
= (1<<0), // put machine to sleep now
412 kIOPMAllowSleep
= (1<<1), // allow idle sleep
413 kIOPMPreventSleep
= (1<<2), // do not allow idle sleep
414 kIOPMPowerButton
= (1<<3), // power button was pressed
415 kIOPMClamshellClosed
= (1<<4), // clamshell was closed
416 kIOPMPowerEmergency
= (1<<5), // battery dangerously low
417 kIOPMDisableClamshell
= (1<<6), // do not sleep on clamshell closure
418 kIOPMEnableClamshell
= (1<<7), // sleep on clamshell closure
419 kIOPMProcessorSpeedChange
= (1<<8), // change the processor speed
420 kIOPMOverTemp
= (1<<9), // system dangerously hot
421 kIOPMClamshellOpened
= (1<<10) // clamshell was opened
425 /*******************************************************************************
427 * Power Management Return Codes
429 ******************************************************************************/
433 // Returned by driver's setPowerState(), powerStateWillChangeTo(),
434 // powerStateDidChangeTo(), or acknowledgeSetPowerState() to
435 // implicitly acknowledge power change upon function return.
439 kIOPMWillAckLater
= 1,
441 // Returned by requestPowerDomainState() to indicate
442 // unrecognized specification parameter.
443 kIOPMBadSpecification
= 4,
445 // Returned by requestPowerDomainState() to indicate
446 // no power state matches search specification.
447 kIOPMNoSuchState
= 5,
450 kIOPMCannotRaisePower
= 6,
453 kIOPMParameterError
= 7,
455 // Returned when power management state is accessed
456 // before driver has called PMinit().
457 kIOPMNotYetInitialized
= 8,
459 // And the old constants; deprecated
460 IOPMNoErr
= kIOPMNoErr
,
461 IOPMAckImplied
= kIOPMAckImplied
,
462 IOPMWillAckLater
= kIOPMWillAckLater
,
463 IOPMBadSpecification
= kIOPMBadSpecification
,
464 IOPMNoSuchState
= kIOPMNoSuchState
,
465 IOPMCannotRaisePower
= kIOPMCannotRaisePower
,
466 IOPMParameterError
= kIOPMParameterError
,
467 IOPMNotYetInitialized
= kIOPMNotYetInitialized
471 // IOPMPowerSource class descriptive strings
472 // Power Source state is published as properties to the IORegistry under these
474 #define kIOPMPSExternalConnectedKey "ExternalConnected"
475 #define kIOPMPSExternalChargeCapableKey "ExternalChargeCapable"
476 #define kIOPMPSBatteryInstalledKey "BatteryInstalled"
477 #define kIOPMPSIsChargingKey "IsCharging"
478 #define kIOPMFullyChargedKey "FullyCharged"
479 #define kIOPMPSAtWarnLevelKey "AtWarnLevel"
480 #define kIOPMPSAtCriticalLevelKey "AtCriticalLevel"
481 #define kIOPMPSCurrentCapacityKey "CurrentCapacity"
482 #define kIOPMPSMaxCapacityKey "MaxCapacity"
483 #define kIOPMPSDesignCapacityKey "DesignCapacity"
484 #define kIOPMPSTimeRemainingKey "TimeRemaining"
485 #define kIOPMPSAmperageKey "Amperage"
486 #define kIOPMPSVoltageKey "Voltage"
487 #define kIOPMPSCycleCountKey "CycleCount"
488 #define kIOPMPSMaxErrKey "MaxErr"
489 #define kIOPMPSAdapterInfoKey "AdapterInfo"
490 #define kIOPMPSLocationKey "Location"
491 #define kIOPMPSErrorConditionKey "ErrorCondition"
492 #define kIOPMPSManufacturerKey "Manufacturer"
493 #define kIOPMPSManufactureDateKey "ManufactureDate"
494 #define kIOPMPSModelKey "Model"
495 #define kIOPMPSSerialKey "Serial"
496 #define kIOPMDeviceNameKey "DeviceName"
497 #define kIOPMPSLegacyBatteryInfoKey "LegacyBatteryInfo"
498 #define kIOPMPSBatteryHealthKey "BatteryHealth"
499 #define kIOPMPSHealthConfidenceKey "HealthConfidence"
500 #define kIOPMPSCapacityEstimatedKey "CapacityEstimated"
501 #define kIOPMPSBatteryChargeStatusKey "ChargeStatus"
502 #define kIOPMPSBatteryTemperatureKey "Temperature"
504 // kIOPMPSBatteryChargeStatusKey may have one of the following values, or may have
505 // no value. If kIOPMBatteryChargeStatusKey has a NULL value (or no value) associated with it
506 // then charge is proceeding normally. If one of these battery charge status reasons is listed,
507 // then the charge may have been interrupted.
508 #define kIOPMBatteryChargeStatusTooHot "HighTemperature"
509 #define kIOPMBatteryChargeStatusTooCold "LowTemperature"
510 #define kIOPMBatteryChargeStatusGradient "BatteryTemperatureGradient"
512 // Definitions for battery location, in case of multiple batteries.
513 // A location of 0 is unspecified
514 // Location is undefined for single battery systems
516 kIOPMPSLocationLeft
= 1001,
517 kIOPMPSLocationRight
= 1002
520 // Battery quality health types, specified by BatteryHealth and HealthConfidence
521 // properties in an IOPMPowerSource battery kext.
523 kIOPMUndefinedValue
= 0,
529 // Battery's time remaining estimate is invalid this long (seconds) after a wake
530 #define kIOPMPSInvalidWakeSecondsKey "BatteryInvalidWakeSeconds"
532 // Battery must wait this long (seconds) after being completely charged before
533 // the battery is settled.
534 #define kIOPMPSPostChargeWaitSecondsKey "PostChargeWaitSeconds"
536 // Battery must wait this long (seconds) after being completely discharged
537 // before the battery is settled.
538 #define kIOPMPSPostDishargeWaitSecondsKey "PostDischargeWaitSeconds"
541 /* CPU Power Management status keys
542 * Pass as arguments to IOPMrootDomain::systemPowerEventOccurred
543 * Or as arguments to IOPMSystemPowerEventOccurred()
544 * Or to decode the dictionary obtained from IOPMCopyCPUPowerStatus()
545 * These keys reflect restrictions placed on the CPU by the system
546 * to bring the CPU's power consumption within allowable thermal and
551 /* kIOPMGraphicsPowerLimitsKey
552 * The key representing the dictionary of graphics power limits.
553 * The dictionary contains the other kIOPMCPUPower keys & their associated
554 * values (e.g. Speed limit, Processor Count, and Schedule limits).
556 #define kIOPMGraphicsPowerLimitsKey "Graphics_Power_Limits"
558 /* kIOPMGraphicsPowerLimitPerformanceKey
559 * The key representing the percent of overall performance made available
560 * by the graphics chip as a percentage (integer 0 - 100).
562 #define kIOPMGraphicsPowerLimitPerformanceKey "Graphics_Power_Performance"
566 /* kIOPMCPUPowerLimitsKey
567 * The key representing the dictionary of CPU Power Limits.
568 * The dictionary contains the other kIOPMCPUPower keys & their associated
569 * values (e.g. Speed limit, Processor Count, and Schedule limits).
571 #define kIOPMCPUPowerLimitsKey "CPU_Power_Limits"
573 /* kIOPMCPUPowerLimitProcessorSpeedKey defines the speed & voltage limits placed
575 * Represented as a percentage (0-100) of maximum CPU speed.
577 #define kIOPMCPUPowerLimitProcessorSpeedKey "CPU_Speed_Limit"
579 /* kIOPMCPUPowerLimitProcessorCountKey reflects how many, if any, CPUs have been
580 * taken offline. Represented as an integer number of CPUs (0 - Max CPUs).
582 #define kIOPMCPUPowerLimitProcessorCountKey "CPU_Available_CPUs"
584 /* kIOPMCPUPowerLimitSchedulerTimeKey represents the percentage (0-100) of CPU time
585 * available. 100% at normal operation. The OS may limit this time for a percentage
588 #define kIOPMCPUPowerLimitSchedulerTimeKey "CPU_Scheduler_Limit"
591 /* Thermal Level Warning Key
592 * Indicates the thermal constraints placed on the system. This value may
593 * cause clients to action to consume fewer system resources.
594 * The value associated with this warning is defined by the platform.
596 #define kIOPMThermalLevelWarningKey "Thermal_Level_Warning"
598 /* Thermal Warning Level values
599 * kIOPMThermalWarningLevelNormal - under normal operating conditions
600 * kIOPMThermalWarningLevelDanger - thermal pressure may cause system slowdown
601 * kIOPMThermalWarningLevelCrisis - thermal conditions may cause imminent shutdown
603 * The platform may define additional thermal levels if necessary.
606 kIOPMThermalWarningLevelNormal
= 0,
607 kIOPMThermalWarningLevelDanger
= 5,
608 kIOPMThermalWarningLevelCrisis
= 10
612 // PM Settings Controller setting types
613 // Settings types used primarily with:
614 // IOPMrootDomain::registerPMSettingController
615 // The values are identical to the similarly named keys for use in user space
616 // PM settings work. Those keys are defined in IOPMLibPrivate.h.
617 #define kIOPMSettingWakeOnRingKey "Wake On Modem Ring"
618 #define kIOPMSettingRestartOnPowerLossKey "Automatic Restart On Power Loss"
619 #define kIOPMSettingWakeOnACChangeKey "Wake On AC Change"
620 #define kIOPMSettingSleepOnPowerButtonKey "Sleep On Power Button"
621 #define kIOPMSettingWakeOnClamshellKey "Wake On Clamshell Open"
622 #define kIOPMSettingReduceBrightnessKey "ReduceBrightness"
623 #define kIOPMSettingDisplaySleepUsesDimKey "Display Sleep Uses Dim"
624 #define kIOPMSettingTimeZoneOffsetKey "TimeZoneOffsetSeconds"
625 #define kIOPMSettingMobileMotionModuleKey "MobileMotionModule"
626 #define kIOPMSettingGraphicsSwitchKey "GPUSwitch"
628 // Setting controlling drivers can register to receive scheduled wake data
629 // Either in "CF seconds" type, or structured calendar data in a formatted
630 // IOPMCalendarStruct defined below.
631 #define kIOPMSettingAutoWakeSecondsKey "wake"
632 #define kIOPMSettingAutoWakeCalendarKey "WakeByCalendarDate"
633 #define kIOPMSettingAutoPowerSecondsKey "poweron"
634 #define kIOPMSettingAutoPowerCalendarKey "PowerByCalendarDate"
636 // Debug seconds auto wake
637 // Used by sleep cycling debug tools
638 #define kIOPMSettingDebugWakeRelativeKey "WakeRelativeToSleep"
639 #define kIOPMSettingDebugPowerRelativeKey "PowerRelativeToShutdown"
641 // Maintenance wake calendar.
642 #define kIOPMSettingMaintenanceWakeCalendarKey "MaintenanceWakeCalendarDate"
644 struct IOPMCalendarStruct
{
652 typedef struct IOPMCalendarStruct IOPMCalendarStruct
;
654 // SetAggressiveness types
656 kPMGeneralAggressiveness
= 0,
658 kPMMinutesToSpinDown
,
660 kPMEthernetWakeOnLANSettings
,
661 kPMSetProcessorSpeed
,
664 kPMLastAggressivenessType
666 #define kMaxType (kPMLastAggressivenessType-1)
668 // SetAggressiveness values for the kPMPowerSource aggressiveness type
670 kIOPMInternalPower
= 1,
674 #define kIOREMSleepEnabledKey "REMSleepEnabled"
676 // Strings for deciphering the dictionary returned from IOPMCopyBatteryInfo
677 #define kIOBatteryInfoKey "IOBatteryInfo"
678 #define kIOBatteryCurrentChargeKey "Current"
679 #define kIOBatteryCapacityKey "Capacity"
680 #define kIOBatteryFlagsKey "Flags"
681 #define kIOBatteryVoltageKey "Voltage"
682 #define kIOBatteryAmperageKey "Amperage"
683 #define kIOBatteryCycleCountKey "Cycle Count"
686 kIOBatteryInstalled
= (1 << 2),
687 kIOBatteryCharge
= (1 << 1),
688 kIOBatteryChargerConnect
= (1 << 0)
692 // Private power management message indicating battery data has changed
693 // Indicates new data resides in the IORegistry
694 #define kIOPMMessageBatteryStatusHasChanged iokit_family_msg(sub_iokit_pmu, 0x100)
696 // Apple private Legacy messages for re-routing AutoWake and AutoPower messages to the PMU
697 // through newer user space IOPMSchedulePowerEvent API
698 #define kIOPMUMessageLegacyAutoWake iokit_family_msg(sub_iokit_pmu, 0x200)
699 #define kIOPMUMessageLegacyAutoPower iokit_family_msg(sub_iokit_pmu, 0x210)
701 // For use with IOPMPowerSource bFlags
702 #define IOPM_POWER_SOURCE_REV 2
704 kIOPMACInstalled
= kIOBatteryChargerConnect
,
705 kIOPMBatteryCharging
= kIOBatteryCharge
,
706 kIOPMBatteryInstalled
= kIOBatteryInstalled
,
707 kIOPMUPSInstalled
= (1<<3),
708 kIOPMBatteryAtWarn
= (1<<4),
709 kIOPMBatteryDepleted
= (1<<5),
710 kIOPMACnoChargeCapability
= (1<<6), // AC adapter cannot charge battery
711 kIOPMRawLowBattery
= (1<<7), // used only by Platform Expert
712 kIOPMForceLowSpeed
= (1<<8), // set by Platfm Expert, chk'd by Pwr Plugin
713 kIOPMClosedClamshell
= (1<<9), // set by PMU - reflects state of the clamshell
714 kIOPMClamshellStateOnWake
= (1<<10) // used only by Platform Expert
718 // **********************************************
719 // Internal power management data structures
720 // **********************************************
722 #if KERNEL && __cplusplus
726 kIOPowerEmergencyLevel
= 1000
731 kIOPMSuperclassPolicy1
734 struct stateChangeNote
{
735 IOPMPowerFlags stateFlags
;
736 unsigned long stateNum
;
739 typedef struct stateChangeNote stateChangeNote
;
741 struct IOPowerStateChangeNotification
{
743 unsigned long returnValue
;
744 unsigned long stateNumber
;
745 IOPMPowerFlags stateFlags
;
747 typedef struct IOPowerStateChangeNotification IOPowerStateChangeNotification
;
748 typedef IOPowerStateChangeNotification sleepWakeNote
;
749 #endif /* KERNEL && __cplusplus */
751 #endif /* ! _IOKIT_IOPM_H */