]> git.saurik.com Git - apple/libc.git/blame - include/libkern/OSThermalNotification.h
Libc-763.13.tar.gz
[apple/libc.git] / include / libkern / OSThermalNotification.h
CommitLineData
b5d655f7
A
1/*
2 * Copyright (c) 2007 Apple Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23
24#ifndef _OSTHERMALNOTIFICATION_H_
25#define _OSTHERMALNOTIFICATION_H_
26
27#include <sys/cdefs.h>
1f2f436a 28#include <Availability.h>
b5d655f7
A
29
30/*
31** OSThermalNotification.h
32**
33** Notification mechanism to alert registered tasks when device thermal conditions
34** reach certain thresholds. Notifications are triggered in both directions
35** so clients can manage their memory usage more and less aggressively.
36**
37*/
38
39__BEGIN_DECLS
40
41typedef enum {
42 OSThermalNotificationLevelAny = -1,
43 OSThermalNotificationLevelNormal = 0,
b5d655f7
A
44} OSThermalNotificationLevel;
45
1f2f436a
A
46extern OSThermalNotificationLevel _OSThermalNotificationLevelForBehavior(int) __OSX_AVAILABLE_STARTING(__MAC_NA, __IPHONE_4_2);
47extern void _OSThermalNotificationSetLevelForBehavior(int, int) __OSX_AVAILABLE_STARTING(__MAC_NA, __IPHONE_4_2);
48
49enum {
50 kOSThermalMitigationNone,
51 kOSThermalMitigation70PercentTorch,
52 kOSThermalMitigation70PercentBacklight,
53 kOSThermalMitigation50PercentTorch,
54 kOSThermalMitigation50PercentBacklight,
55 kOSThermalMitigationDisableTorch,
56 kOSThermalMitigation25PercentBacklight,
57 kOSThermalMitigationDisableMapsHalo,
58 kOSThermalMitigationAppTerminate,
59 kOSThermalMitigationDeviceRestart,
60 kOSThermalMitigationCount
61};
62
63#define OSThermalNotificationLevel70PercentTorch _OSThermalNotificationLevelForBehavior(kOSThermalMitigation70PercentTorch)
64#define OSThermalNotificationLevel70PercentBacklight _OSThermalNotificationLevelForBehavior(kOSThermalMitigation70PercentBacklight)
65#define OSThermalNotificationLevel50PercentTorch _OSThermalNotificationLevelForBehavior(kOSThermalMitigation50PercentTorch)
66#define OSThermalNotificationLevel50PercentBacklight _OSThermalNotificationLevelForBehavior(kOSThermalMitigation50PercentBacklight)
67#define OSThermalNotificationLevelDisableTorch _OSThermalNotificationLevelForBehavior(kOSThermalMitigationDisableTorch)
68#define OSThermalNotificationLevel25PercentBacklight _OSThermalNotificationLevelForBehavior(kOSThermalMitigation25PercentBacklight)
69#define OSThermalNotificationLevelDisableMapsHalo _OSThermalNotificationLevelForBehavior(kOSThermalMitigationDisableMapsHalo)
70#define OSThermalNotificationLevelAppTerminate _OSThermalNotificationLevelForBehavior(kOSThermalMitigationAppTerminate)
71#define OSThermalNotificationLevelDeviceRestart _OSThermalNotificationLevelForBehavior(kOSThermalMitigationDeviceRestart)
72
b5d655f7
A
73/* Backwards compatibility */
74#define OSThermalNotificationLevelWarning OSThermalNotificationLevel70PercentBacklight
75#define OSThermalNotificationLevelUrgent OSThermalNotificationLevelAppTerminate
76#define OSThermalNotificationLevelCritical OSThermalNotificationLevelDeviceRestart
77
78/*
79** Simple polling interface to detect current thermal level
80*/
81
1f2f436a 82extern OSThermalNotificationLevel OSThermalNotificationCurrentLevel(void) __OSX_AVAILABLE_STARTING(__MAC_NA, __IPHONE_2_0);
b5d655f7
A
83
84/*
85** External notify(3) string for manual notification setup
86*/
87
1f2f436a 88extern const char * const kOSThermalNotificationName __OSX_AVAILABLE_STARTING(__MAC_NA, __IPHONE_2_0);
b5d655f7
A
89
90__END_DECLS
91
92#endif /* _OSTHERMALNOTIFICATION_H_ */