]> git.saurik.com Git - apple/xnu.git/blobdiff - iokit/IOKit/pwr_mgt/IOPMPrivate.h
xnu-2050.48.11.tar.gz
[apple/xnu.git] / iokit / IOKit / pwr_mgt / IOPMPrivate.h
index 09fdb19e82a7c694f8eda289f517efc46eb66c63..55f86b4755ebff900662225a97a96eff6fae7d32 100644 (file)
@@ -131,7 +131,8 @@ enum {
     kIOPMSleepReasonLowPower                    = 106,
     kIOPMSleepReasonThermalEmergency            = 107,
     kIOPMSleepReasonMaintenance                 = 108,
-    kIOPMSleepReasonSleepServiceExit            = 109
+    kIOPMSleepReasonSleepServiceExit            = 109,
+    kIOPMSleepReasonDarkWakeThermalEmergency    = 110
 };
 
 /*
@@ -145,6 +146,7 @@ enum {
 #define kIOPMLowPowerSleepKey                       "Low Power Sleep"
 #define kIOPMThermalEmergencySleepKey               "Thermal Emergency Sleep"
 #define kIOPMSleepServiceExitKey                    "Sleep Service Back to Sleep"
+#define kIOPMDarkWakeThermalEmergencyKey            "Dark Wake Thermal Emergency"
 
 
 enum {
@@ -624,6 +626,11 @@ enum {
  *
  *****************************************************************************/
 
+/* kIOPMFeatureAutoPowerOffKey
+ * Feature published if Auto Power Off is supported
+ */
+#define kIOPMFeatureAutoPowerOffKey         "AutoPowerOff"
+
 /* kIOPMAutoPowerOffEnabledKey
  * Indicates if Auto Power Off is enabled.
  * It has a boolean value.
@@ -640,6 +647,25 @@ enum {
  */
 #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"
+
+/* 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"
+
 /*****************************************************************************
  *
  * System Sleep Policy
@@ -674,12 +700,22 @@ struct IOPMSystemSleepPolicyVariables
 
     uint32_t    standbyDelay;               // standby delay in seconds
     uint32_t    poweroffDelay;              // auto-poweroff delay in seconds
+    uint32_t    scheduledAlarms;            // bitmask of scheduled alarm types
+    uint32_t    poweroffTimer;              // auto-poweroff timer in seconds
 
-    uint32_t    reserved[51];               // pad sizeof 256 bytes
+    uint32_t    reserved[49];               // pad sizeof 256 bytes
+};
+
+enum {
+    kIOPMAlarmBitDebugWake                  = 0x01,
+    kIOPMAlarmBitCalendarWake               = 0x02,
+    kIOPMAlarmBitMaintenanceWake            = 0x04,
+    kIOPMAlarmBitSleepServiceWake           = 0x08
 };
 
 enum {
-    kIOPMSleepPhase1 = 1,
+    kIOPMSleepPhase0 = 0,
+    kIOPMSleepPhase1,
     kIOPMSleepPhase2
 };
 
@@ -700,7 +736,8 @@ enum {
     kIOPMSleepFactorMagicPacketWakeEnabled  = 0x00001000ULL,
     kIOPMSleepFactorHibernateForced         = 0x00010000ULL,
     kIOPMSleepFactorAutoPowerOffDisabled    = 0x00020000ULL,
-    kIOPMSleepFactorAutoPowerOffForced      = 0x00040000ULL
+    kIOPMSleepFactorAutoPowerOffForced      = 0x00040000ULL,
+    kIOPMSleepFactorExternalDisplay         = 0x00080000ULL
 };
 
 // System Sleep Types
@@ -712,7 +749,8 @@ enum {
     kIOPMSleepTypeHibernate                 = 4,
     kIOPMSleepTypeStandby                   = 5,
     kIOPMSleepTypePowerOff                  = 6,
-    kIOPMSleepTypeLast                      = 7
+    kIOPMSleepTypeDeepIdle                  = 7,
+    kIOPMSleepTypeLast                      = 8
 };
 
 // System Sleep Flags
@@ -728,7 +766,12 @@ enum {
     kIOPMWakeEventLidClose                  = 0x00000002,
     kIOPMWakeEventACAttach                  = 0x00000004,
     kIOPMWakeEventACDetach                  = 0x00000008,
+    kIOPMWakeEventCDInsert                  = 0x00000010,
+    kIOPMWakeEventCDEject                   = 0x00000020,
+    kIOPMWakeEventHPDAttach                 = 0x00000040,
+    kIOPMWakeEventHPDDetach                 = 0x00000080,
     kIOPMWakeEventPowerButton               = 0x00000100,
+    kIOPMWakeEventG3PowerOn                 = 0x00000200,
     kIOPMWakeEventUserPME                   = 0x00000400,
     kIOPMWakeEventSleepTimer                = 0x00000800,
     kIOPMWakeEventBatteryLow                = 0x00001000,
@@ -757,7 +800,7 @@ struct IOPMSystemSleepParameters
     uint32_t    reserved2[10];
 } __attribute__((packed));
 
-#ifdef KERNEL
+#if defined(KERNEL) && defined(__cplusplus)
 
 /*!
  * @defined kIOPMInstallSystemSleepPolicyHandlerKey
@@ -771,7 +814,8 @@ struct IOPMSystemSleepParameters
         "IOPMInstallSystemSleepPolicyHandler"
 
 typedef IOReturn (*IOPMSystemSleepPolicyHandler)(
-        void * target, const IOPMSystemSleepPolicyVariables * vars,
+        void * target,
+        const IOPMSystemSleepPolicyVariables * vars,
         IOPMSystemSleepParameters * params );
 
 #endif /* KERNEL */