X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/511daa4c8e95ca3a9f4a918942d9350855df1da0..4c63d2152434d7a24cd627ef559f93b096274076:/include/libkern/OSThermalNotification.h?ds=inline diff --git a/include/libkern/OSThermalNotification.h b/include/libkern/OSThermalNotification.h index ab61e5a..cc81223 100644 --- a/include/libkern/OSThermalNotification.h +++ b/include/libkern/OSThermalNotification.h @@ -25,6 +25,7 @@ #define _OSTHERMALNOTIFICATION_H_ #include +#include /* ** OSThermalNotification.h @@ -40,32 +41,80 @@ __BEGIN_DECLS typedef enum { OSThermalNotificationLevelAny = -1, OSThermalNotificationLevelNormal = 0, - OSThermalNotificationLevel70PercentTorch = 1, - OSThermalNotificationLevel70PercentBacklight = 3, - OSThermalNotificationLevel50PercentTorch = 3, - OSThermalNotificationLevel50PercentBacklight = 5, - OSThermalNotificationLevelDisableTorch = 5, - OSThermalNotificationLevel25PercentBacklight = 7, - OSThermalNotificationLevelAppTerminate = 12, - OSThermalNotificationLevelDeviceRestart = 16 } OSThermalNotificationLevel; +extern OSThermalNotificationLevel _OSThermalNotificationLevelForBehavior(int) __OSX_AVAILABLE_STARTING(__MAC_NA, __IPHONE_4_2); +extern void _OSThermalNotificationSetLevelForBehavior(int, int) __OSX_AVAILABLE_STARTING(__MAC_NA, __IPHONE_4_2); + +enum { + kOSThermalMitigationNone, + kOSThermalMitigation70PercentTorch, + kOSThermalMitigation70PercentBacklight, + kOSThermalMitigation50PercentTorch, + kOSThermalMitigation50PercentBacklight, + kOSThermalMitigationDisableTorch, + kOSThermalMitigation25PercentBacklight, + kOSThermalMitigationDisableMapsHalo, + kOSThermalMitigationAppTerminate, + kOSThermalMitigationDeviceRestart, + kOSThermalMitigationThermalTableReady, + kOSThermalMitigationCount +}; + +#define OSThermalNotificationLevel70PercentTorch _OSThermalNotificationLevelForBehavior(kOSThermalMitigation70PercentTorch) +#define OSThermalNotificationLevel70PercentBacklight _OSThermalNotificationLevelForBehavior(kOSThermalMitigation70PercentBacklight) +#define OSThermalNotificationLevel50PercentTorch _OSThermalNotificationLevelForBehavior(kOSThermalMitigation50PercentTorch) +#define OSThermalNotificationLevel50PercentBacklight _OSThermalNotificationLevelForBehavior(kOSThermalMitigation50PercentBacklight) +#define OSThermalNotificationLevelDisableTorch _OSThermalNotificationLevelForBehavior(kOSThermalMitigationDisableTorch) +#define OSThermalNotificationLevel25PercentBacklight _OSThermalNotificationLevelForBehavior(kOSThermalMitigation25PercentBacklight) +#define OSThermalNotificationLevelDisableMapsHalo _OSThermalNotificationLevelForBehavior(kOSThermalMitigationDisableMapsHalo) +#define OSThermalNotificationLevelAppTerminate _OSThermalNotificationLevelForBehavior(kOSThermalMitigationAppTerminate) +#define OSThermalNotificationLevelDeviceRestart _OSThermalNotificationLevelForBehavior(kOSThermalMitigationDeviceRestart) + /* Backwards compatibility */ #define OSThermalNotificationLevelWarning OSThermalNotificationLevel70PercentBacklight #define OSThermalNotificationLevelUrgent OSThermalNotificationLevelAppTerminate #define OSThermalNotificationLevelCritical OSThermalNotificationLevelDeviceRestart +/* Define pressure levels usable by OSThermalPressureLevel */ +typedef enum { + kOSThermalPressureLevelNominal = 0, + kOSThermalPressureLevelModerate, + kOSThermalPressureLevelHeavy, + kOSThermalPressureLevelTrapping, + kOSThermalPressureLevelSleeping +} OSThermalPressureLevel; + /* ** Simple polling interface to detect current thermal level */ -OSThermalNotificationLevel OSThermalNotificationCurrentLevel(void); +extern OSThermalNotificationLevel OSThermalNotificationCurrentLevel(void) __OSX_AVAILABLE_STARTING(__MAC_NA, __IPHONE_2_0); /* ** External notify(3) string for manual notification setup */ -extern const char *kOSThermalNotificationName; +extern const char * const kOSThermalNotificationName __OSX_AVAILABLE_STARTING(__MAC_NA, __IPHONE_2_0); + +/* +** External notify(3) string for alerting user of a thermal condition +*/ + +extern const char * const kOSThermalNotificationAlert __OSX_AVAILABLE_STARTING(__MAC_NA, __IPHONE_6_0); + +/* +** External notify(3) string for notifying system the options taken to resolve thermal condition +*/ + +extern const char * const kOSThermalNotificationDecision __OSX_AVAILABLE_STARTING(__MAC_NA, __IPHONE_6_0); + +/* +** External notify(3) string for thermal pressure level notification +*/ + +extern const char * const kOSThermalNotificationPressureLevelName __OSX_AVAILABLE_STARTING(__MAC_NA, __IPHONE_7_0); + __END_DECLS