]> git.saurik.com Git - apple/xnu.git/blobdiff - iokit/IOKit/pwr_mgt/IOPMPrivate.h
xnu-3247.1.106.tar.gz
[apple/xnu.git] / iokit / IOKit / pwr_mgt / IOPMPrivate.h
index 4aecff1462dc49e28ad01d2d0c1aefb875fdd4df..25226da746b218b28690b561482e99625b0aa971 100644 (file)
@@ -97,6 +97,12 @@ enum {
 #define kIOPMMessageLastCallBeforeSleep \
                 iokit_family_msg(sub_iokit_powermanagement, 0x410)
 
 #define kIOPMMessageLastCallBeforeSleep \
                 iokit_family_msg(sub_iokit_powermanagement, 0x410)
 
+#define kIOPMMessageIdleSleepPreventers \
+                iokit_family_msg(sub_iokit_powermanagement, 0x420)
+
+#define kIOPMMessageSystemSleepPreventers \
+                iokit_family_msg(sub_iokit_powermanagement, 0x430)
+
 /* @enum SystemSleepReasons
  * @abstract The potential causes for system sleep as logged in the system event record.
  */
 /* @enum SystemSleepReasons
  * @abstract The potential causes for system sleep as logged in the system event record.
  */
@@ -258,6 +264,8 @@ enum {
 // Keys for IOPMrootDomain registry properties
 #define kIOPMSleepStatisticsKey                 "SleepStatistics"
 #define kIOPMSleepStatisticsAppsKey             "AppStatistics"
 // Keys for IOPMrootDomain registry properties
 #define kIOPMSleepStatisticsKey                 "SleepStatistics"
 #define kIOPMSleepStatisticsAppsKey             "AppStatistics"
+#define kIOPMIdleSleepPreventersKey             "IdleSleepPreventers"
+#define kIOPMSystemSleepPreventersKey           "SystemSleepPreventers"
 
 // Application response statistics
 #define kIOPMStatsNameKey                       "Name"
 
 // Application response statistics
 #define kIOPMStatsNameKey                       "Name"
@@ -700,7 +708,9 @@ enum {
     kIOPMSleepFactorExternalDisplay         = 0x00080000ULL,
     kIOPMSleepFactorNetworkKeepAliveActive  = 0x00100000ULL,
     kIOPMSleepFactorLocalUserActivity       = 0x00200000ULL,
     kIOPMSleepFactorExternalDisplay         = 0x00080000ULL,
     kIOPMSleepFactorNetworkKeepAliveActive  = 0x00100000ULL,
     kIOPMSleepFactorLocalUserActivity       = 0x00200000ULL,
-    kIOPMSleepFactorHibernateFailed         = 0x00400000ULL
+    kIOPMSleepFactorHibernateFailed         = 0x00400000ULL,
+    kIOPMSleepFactorThermalWarning          = 0x00800000ULL,
+    kIOPMSleepFactorDisplayCaptured         = 0x01000000ULL
 };
 
 // System Sleep Types
 };
 
 // System Sleep Types
@@ -798,6 +808,9 @@ typedef struct {
 #define SWD_BUF_SIZE            (40*PAGE_SIZE)
 #define SWD_INITIAL_STACK_SIZE  ((SWD_BUF_SIZE/2)-sizeof(swd_hdr))
 
 #define SWD_BUF_SIZE            (40*PAGE_SIZE)
 #define SWD_INITIAL_STACK_SIZE  ((SWD_BUF_SIZE/2)-sizeof(swd_hdr))
 
+#define SWD_SPINDUMP_SIZE          (256*1024)
+#define SWD_INITIAL_SPINDUMP_SIZE  ((SWD_SPINDUMP_SIZE/2)-sizeof(swd_hdr))
+
 /* Bits in swd_flags */
 #define SWD_WDOG_ENABLED        0x01
 #define SWD_BOOT_BY_SW_WDOG     0x02
 /* Bits in swd_flags */
 #define SWD_WDOG_ENABLED        0x01
 #define SWD_BOOT_BY_SW_WDOG     0x02
@@ -807,6 +820,7 @@ typedef struct {
 #define SWD_LOGS_IN_MEM         0x20
 
 /* Filenames associated with the stackshots/logs generated by the SWD */
 #define SWD_LOGS_IN_MEM         0x20
 
 /* Filenames associated with the stackshots/logs generated by the SWD */
+#define kSleepWakeStackBinFilename          "/var/log/SleepWakeStacks.bin"
 #define kSleepWakeStackFilename             "/var/log/SleepWakeStacks.dump"
 #define kSleepWakeLogFilename               "/var/log/SleepWakeLog.dump"
 #define kAppleOSXWatchdogStackFilename      "/var/log/AppleOSXWatchdogStacks.dump"
 #define kSleepWakeStackFilename             "/var/log/SleepWakeStacks.dump"
 #define kSleepWakeLogFilename               "/var/log/SleepWakeLog.dump"
 #define kAppleOSXWatchdogStackFilename      "/var/log/AppleOSXWatchdogStacks.dump"
@@ -831,6 +845,22 @@ inline char const* getDumpLogFilename(swd_hdr *hdr)
 #define kDarkWkCntChID IOREPORT_MAKEID('G','U','I','W','k','C','n','t')
 #define kUserWkCntChID IOREPORT_MAKEID('D','r','k','W','k','C','n','t')
 
 #define kDarkWkCntChID IOREPORT_MAKEID('G','U','I','W','k','C','n','t')
 #define kUserWkCntChID IOREPORT_MAKEID('D','r','k','W','k','C','n','t')
 
+/*
+ * kAssertDelayChID - Histogram of time elapsed before assertion after wake.
+ */
+#define kAssertDelayBcktCnt     11
+#define kAssertDelayBcktSize    3
+#define kAssertDelayChID IOREPORT_MAKEID('r','d','A','s','r','t','D','l')
+
+/*
+ * kSleepDelaysChID - Histogram of time taken to put system to sleep
+ */
+#define kSleepDelaysBcktCnt     13
+#define kSleepDelaysBcktSize    10
+#define kSleepDelaysChID IOREPORT_MAKEID('r','d','S','l','p','D','l','y')
+
+/* Sleep Options/settings */
+#define kSleepOptionDisplayCapturedModeKey         "DisplayCapturedMode"
 
 
 #if defined(KERNEL) && defined(__cplusplus)
 
 
 #if defined(KERNEL) && defined(__cplusplus)
@@ -853,4 +883,22 @@ typedef IOReturn (*IOPMSystemSleepPolicyHandler)(
 
 #endif /* KERNEL */
 
 
 #endif /* KERNEL */
 
+/*****************************************************************************
+ *
+ * Performance Warning
+ *
+ *****************************************************************************/
+
+/* Performance Warning Key
+ * Key for performance warning event published using IOPMrootDomain::
+ * systemPowerEventOccurred()
+ */
+#define kIOPMPerformanceWarningKey          "Performance_Warning"
+
+/* Performance warning values */
+enum {
+  kIOPMPerformanceNormal    = 0,
+  kIOPMPerformanceWarning   = 100
+};
+
 #endif /* ! _IOKIT_IOPMPRIVATE_H */
 #endif /* ! _IOKIT_IOPMPRIVATE_H */