+/* kIOPMAutoPowerOffEnabledKey
+ * Indicates if Auto Power Off is enabled.
+ * It has a boolean value.
+ * true == Auto Power Off is enabled
+ * false == Auto Power Off is disabled
+ * not present == Auto Power Off is not supported on this hardware
+ */
+#define kIOPMAutoPowerOffEnabledKey "AutoPowerOff Enabled"
+
+/* kIOPMAutoPowerOffDelayKey
+ * Key refers to a CFNumberRef that represents the delay in seconds before
+ * entering the Auto Power Off state. The property is not present if Auto
+ * Power Off is unsupported.
+ */
+#define kIOPMAutoPowerOffDelayKey "AutoPowerOff Delay"
+
+/* kIOPMAutoPowerOffTimerKey
+ * Key refers to a CFNumberRef that indicates the time in seconds until the
+ * expiration of the Auto Power Off delay period. This value should be used
+ * to program a wake alarm before system sleep.
+ */
+#define kIOPMAutoPowerOffTimerKey "AutoPowerOff Timer"
+
+/* kIOPMDeepSleepTimerKey
+ * Key refers to a CFNumberRef that indicates the time in seconds until the
+ * expiration of the Standby delay period. This value should be used
+ * to program a wake alarm before system sleep.
+ */
+#define kIOPMDeepSleepTimerKey "Standby Timer"
+
+/* kIOPMUserWakeAlarmScheduledKey
+ * Key refers to a boolean value that indicates if an user alarm was scheduled
+ * or pending.
+ */
+#define kIOPMUserWakeAlarmScheduledKey "UserWakeAlarmScheduled"
+
+/* kIOPMDeepIdleSupportedKey
+ * Presence of this key indicates Deep Idle is supported on this platform.
+ * Key will always refer to a value of kOSBooleanTrue.
+ */
+#define kIOPMDeepIdleSupportedKey "IOPMDeepIdleSupported"
+
+/* kIOPMUserTriggeredFullWakeKey
+ * Key refers to a boolean value that indicates if the first full wake since
+ * last system sleep was triggered by the local user. This property is set
+ * before the initial full wake transition, and removed after powering down
+ * drivers for system sleep.
+ */
+#define kIOPMUserTriggeredFullWakeKey "IOPMUserTriggeredFullWake"
+
+/* kIOPMUserIsActiveKey
+ * Key refers to a boolean value that indicates if the user is active.
+ */
+#define kIOPMUserIsActiveKey "IOPMUserIsActive"
+
+/* kIOPMDriverWakeEventsKey
+ * Key refers to a property that should only be examined by powerd.
+ */
+#define kIOPMDriverWakeEventsKey "IOPMDriverWakeEvents"
+
+/*****************************************************************************
+ *
+ * IOPMDriverWakeEvents dictionary keys
+ *
+ *****************************************************************************/
+
+#define kIOPMWakeEventTimeKey "Time"
+#define kIOPMWakeEventFlagsKey "Flags"
+#define kIOPMWakeEventReasonKey "Reason"
+#define kIOPMWakeEventDetailsKey "Details"
+
+/* kIOPMFeatureProModeKey
+ * Feature published if ProMode is supported
+ */
+#define kIOPMFeatureProModeKey "ProMode"
+
+/*****************************************************************************
+ *
+ * Wake event flags reported to IOPMrootDomain::claimSystemWakeEvent()
+ *
+ *****************************************************************************/
+
+#define kIOPMWakeEventSource 0x00000001
+
+#if !(defined(RC_HIDE_N144) || defined(RC_HIDE_N146))
+/*****************************************************************************
+ *
+ * AOT defs
+ *
+ *****************************************************************************/
+
+// signals the device should wake up to user space running
+#define kIOPMWakeEventAOTExit 0x00000002
+
+// will start a 400 ms timer before sleeping
+#define kIOPMWakeEventAOTPossibleExit 0x00000004
+
+// signals the device should wake up to user space running
+#define kIOPMWakeEventAOTConfirmedPossibleExit 0x00000008
+
+// signals the device should go back to AOT
+#define kIOPMWakeEventAOTRejectedPossibleExit 0x00000010
+
+// signals the device should go back to AOT
+#define kIOPMWakeEventAOTExpiredPossibleExit 0x00000020
+
+#define kIOPMWakeEventAOTFlags \
+ (kIOPMWakeEventAOTExit \
+ | kIOPMWakeEventAOTPossibleExit \
+ | kIOPMWakeEventAOTConfirmedPossibleExit \
+ | kIOPMWakeEventAOTRejectedPossibleExit \
+ | kIOPMWakeEventAOTExpiredPossibleExit)
+
+#define kIOPMWakeEventAOTPossibleFlags \
+ (kIOPMWakeEventAOTPossibleExit \
+ | kIOPMWakeEventAOTConfirmedPossibleExit \
+ | kIOPMWakeEventAOTRejectedPossibleExit \
+ | kIOPMWakeEventAOTExpiredPossibleExit)
+
+#define kIOPMWakeEventAOTPerCycleFlags \
+ (kIOPMWakeEventAOTPossibleExit \
+ | kIOPMWakeEventAOTRejectedPossibleExit \
+ | kIOPMWakeEventAOTExpiredPossibleExit)
+
+#define kIOPMWakeEventAOTExitFlags \
+ (kIOPMWakeEventAOTExit \
+ | kIOPMWakeEventAOTConfirmedPossibleExit)
+
+enum {
+ kIOPMAOTModeEnable = 0x00000001,
+ kIOPMAOTModeCycle = 0x00000002,
+ kIOPMAOTModeAddEventFlags = 0x00000004,
+ kIOPMAOTModeRespectTimers = 0x00000008,
+ kIOPMAOTModeDefault = (kIOPMAOTModeEnable | kIOPMAOTModeAddEventFlags | kIOPMAOTModeRespectTimers)
+};
+
+enum {
+ kIOPMAOTMetricsKernelWakeCountMax = 24
+};
+
+struct IOPMAOTMetrics
+{
+ uint32_t sleepCount;
+ uint32_t possibleCount;
+ uint32_t confirmedPossibleCount;
+ uint32_t rejectedPossibleCount;
+ uint32_t expiredPossibleCount;
+ uint32_t noTimeSetCount;
+ uint32_t rtcAlarmsCount;
+ uint32_t softwareRequestCount;
+ uint64_t totalTime;
+
+ char kernelWakeReason[kIOPMAOTMetricsKernelWakeCountMax][64];
+ // 54:10 secs:ms calendar time
+ uint64_t kernelSleepTime[kIOPMAOTMetricsKernelWakeCountMax];
+ uint64_t kernelWakeTime[kIOPMAOTMetricsKernelWakeCountMax];
+};
+
+#define kIOPMAOTPowerKey "aot-power"
+
+#endif /* !(defined(RC_HIDE_N144) || defined(RC_HIDE_N146)) */
+
+/*****************************************************************************
+ *
+ * System Sleep Policy
+ *
+ *****************************************************************************/
+
+#define kIOPMSystemSleepPolicySignature 0x54504c53
+#define kIOPMSystemSleepPolicyVersion 2
+
+/*!
+ * @defined kIOPMSystemSleepTypeKey
+ * @abstract Indicates the type of system sleep.
+ * @discussion An OSNumber property of root domain that describes the type
+ * of system sleep. This property is set after notifying priority sleep/wake
+ * clients, but before informing interested drivers and shutting down power
+ * plane drivers. On a hibernate abort or failure, this property will not be
+ * updated and will indicate the failed sleep type.
+ */
+#define kIOPMSystemSleepTypeKey "IOPMSystemSleepType"
+
+struct IOPMSystemSleepPolicyVariables
+{
+ uint32_t signature; // kIOPMSystemSleepPolicySignature
+ uint32_t version; // kIOPMSystemSleepPolicyVersion