+/* kIOPMMessageFeatureChange
+ * Delivered when the set of supported features ("Supported Features" dictionary
+ * under IOPMrootDomain registry) changes in some way. Typically addition or
+ * removal of a supported feature.
+ * RootDomain passes no argument with this message.
+ */
+#define kIOPMMessageFeatureChange \
+ iokit_family_msg(sub_iokit_powermanagement, 0x110)
+
+/* kIOPMMessageInflowDisableCancelled
+ * The battery has drained completely to its "Fully Discharged" state.
+ * If a user process has disabled battery inflow for battery
+ * calibration, we forcibly re-enable Inflow at this point.
+ * If inflow HAS been forcibly re-enabled, bit 0
+ * (kInflowForciblyEnabledBit) will be set.
+ */
+enum {
+ kInflowForciblyEnabledBit = (1 << 0)
+};
+
+#define kIOPMMessageInternalBatteryFullyDischarged \
+ iokit_family_msg(sub_iokit_powermanagement, 0x120)
+
+
+/*******************************************************************************
+ *
+ * Power commands issued to root domain
+ *
+ * These commands are issued from system drivers only:
+ * ApplePMU, AppleSMU, IOGraphics, AppleACPIFamily
+ *
+ ******************************************************************************/
+enum {
+ kIOPMSleepNow = (1<<0), // put machine to sleep now
+ kIOPMAllowSleep = (1<<1), // allow idle sleep
+ kIOPMPreventSleep = (1<<2), // do not allow idle sleep
+ kIOPMPowerButton = (1<<3), // power button was pressed
+ kIOPMClamshellClosed = (1<<4), // clamshell was closed
+ kIOPMPowerEmergency = (1<<5), // battery dangerously low
+ kIOPMDisableClamshell = (1<<6), // do not sleep on clamshell closure
+ kIOPMEnableClamshell = (1<<7), // sleep on clamshell closure
+ kIOPMProcessorSpeedChange = (1<<8), // change the processor speed
+ kIOPMOverTemp = (1<<9), // system dangerously hot
+ kIOPMClamshellOpened = (1<<10) // clamshell was opened
+};
+
+/*******************************************************************************
+ *
+ * Power Management Return Codes
+ *
+ ******************************************************************************/
+enum {
+ kIOPMNoErr = 0,
+ // Returned by powerStateWillChange and powerStateDidChange:
+ // Immediate acknowledgement of power state change
+ kIOPMAckImplied = 0,
+ // Acknowledgement of power state change will come later
+ kIOPMWillAckLater = 1,
+
+ // Returned by requestDomainState:
+ // Unrecognized specification parameter
+ kIOPMBadSpecification = 4,
+ // No power state matches search specification
+ kIOPMNoSuchState = 5,
+
+ // Device cannot change its power for some reason
+ kIOPMCannotRaisePower = 6,
+
+ // Returned by changeStateTo:
+ // Requested state doesn't exist
+ kIOPMParameterError = 7,
+ // Device not yet fully hooked into power management
+ kIOPMNotYetInitialized = 8,
+
+ // And the old constants; deprecated
+ IOPMNoErr = kIOPMNoErr,
+ IOPMAckImplied = kIOPMAckImplied,
+ IOPMWillAckLater = kIOPMWillAckLater,
+ IOPMBadSpecification = kIOPMBadSpecification,
+ IOPMNoSuchState = kIOPMNoSuchState,
+ IOPMCannotRaisePower = kIOPMCannotRaisePower,
+ IOPMParameterError = kIOPMParameterError,
+ IOPMNotYetInitialized = kIOPMNotYetInitialized
+};
+
+
+// IOPMPowerSource class descriptive strings
+// Power Source state is published as properties to the IORegistry under these
+// keys.
+#define kIOPMPSExternalConnectedKey "ExternalConnected"
+#define kIOPMPSExternalChargeCapableKey "ExternalChargeCapable"
+#define kIOPMPSBatteryInstalledKey "BatteryInstalled"
+#define kIOPMPSIsChargingKey "IsCharging"
+#define kIOPMFullyChargedKey "FullyCharged"
+#define kIOPMPSAtWarnLevelKey "AtWarnLevel"
+#define kIOPMPSAtCriticalLevelKey "AtCriticalLevel"
+#define kIOPMPSCurrentCapacityKey "CurrentCapacity"
+#define kIOPMPSMaxCapacityKey "MaxCapacity"
+#define kIOPMPSDesignCapacityKey "DesignCapacity"
+#define kIOPMPSTimeRemainingKey "TimeRemaining"
+#define kIOPMPSAmperageKey "Amperage"
+#define kIOPMPSVoltageKey "Voltage"
+#define kIOPMPSCycleCountKey "CycleCount"
+#define kIOPMPSMaxErrKey "MaxErr"
+#define kIOPMPSAdapterInfoKey "AdapterInfo"
+#define kIOPMPSLocationKey "Location"
+#define kIOPMPSErrorConditionKey "ErrorCondition"
+#define kIOPMPSManufacturerKey "Manufacturer"
+#define kIOPMPSManufactureDateKey "ManufactureDate"
+#define kIOPMPSModelKey "Model"
+#define kIOPMPSSerialKey "Serial"
+#define kIOPMDeviceNameKey "DeviceName"
+#define kIOPMPSLegacyBatteryInfoKey "LegacyBatteryInfo"
+#define kIOPMPSBatteryHealthKey "BatteryHealth"
+#define kIOPMPSHealthConfidenceKey "HealthConfidence"
+
+// Definitions for battery location, in case of multiple batteries.
+// A location of 0 is unspecified
+// Location is undefined for single battery systems
+enum {
+ kIOPMPSLocationLeft = 1001,
+ kIOPMPSLocationRight = 1002
+};
+
+// Battery quality health types, specified by BatteryHealth and HealthConfidence
+// properties in an IOPMPowerSource battery kext.
+enum {
+ kIOPMUndefinedValue = 0,
+ kIOPMPoorValue = 1,
+ kIOPMFairValue = 2,
+ kIOPMGoodValue = 3
+};
+
+// Battery's time remaining estimate is invalid this long (seconds) after a wake
+#define kIOPMPSInvalidWakeSecondsKey "BatteryInvalidWakeSeconds"
+
+// Battery must wait this long (seconds) after being completely charged before
+// the battery is settled.
+#define kIOPMPSPostChargeWaitSecondsKey "PostChargeWaitSeconds"
+
+// Battery must wait this long (seconds) after being completely discharged
+// before the battery is settled.
+#define kIOPMPSPostDishargeWaitSecondsKey "PostDischargeWaitSeconds"
+
+
+
+// PM Settings Controller setting types
+// Settings types used primarily with:
+// IOPMrootDomain::registerPMSettingController
+// The values are identical to the similarly named keys for use in user space
+// PM settings work. Those keys are defined in IOPMLibPrivate.h.
+#define kIOPMSettingWakeOnRingKey "Wake On Modem Ring"
+#define kIOPMSettingRestartOnPowerLossKey "Automatic Restart On Power Loss"
+#define kIOPMSettingWakeOnACChangeKey "Wake On AC Change"
+#define kIOPMSettingSleepOnPowerButtonKey "Sleep On Power Button"
+#define kIOPMSettingWakeOnClamshellKey "Wake On Clamshell Open"
+#define kIOPMSettingReduceBrightnessKey "ReduceBrightness"
+#define kIOPMSettingDisplaySleepUsesDimKey "Display Sleep Uses Dim"
+#define kIOPMSettingTimeZoneOffsetKey "TimeZoneOffsetSeconds"
+
+// Setting controlling drivers can register to receive scheduled wake data
+// Either in "CF seconds" type, or structured calendar data in a formatted
+// IOPMCalendarStruct defined below.
+#define kIOPMSettingAutoWakeSecondsKey "wake"
+#define kIOPMSettingAutoWakeCalendarKey "WakeByCalendarDate"
+#define kIOPMSettingAutoPowerSecondsKey "poweron"
+#define kIOPMSettingAutoPowerCalendarKey "PowerByCalendarDate"
+
+// Debug seconds auto wake
+// Used by sleep cycling debug tools
+#define kIOPMSettingDebugWakeRelativeKey "WakeRelativeToSleep"
+#define kIOPMSettingDebugPowerRelativeKey "PowerRelativeToShutdown"
+
+struct IOPMCalendarStruct {
+ UInt32 year;
+ UInt8 month;
+ UInt8 day;
+ UInt8 hour;
+ UInt8 minute;
+ UInt8 second;
+};
+typedef struct IOPMCalendarStruct IOPMCalendarStruct;
+
+// SetAggressiveness types