2 * Apple System Management Control (SMC) Tool
3 * Copyright (C) 2006 devnull
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 #define SMC_VERSION "0.01"
32 #define KERNEL_INDEX_SMC 2
34 #define SMC_CMD_READ_BYTES 5
35 #define SMC_CMD_WRITE_BYTES 6
36 #define SMC_CMD_READ_INDEX 8
37 #define SMC_CMD_READ_KEYINFO 9
38 #define SMC_CMD_READ_PLIMIT 11
39 #define SMC_CMD_READ_VERS 12
41 #define DATATYPE_FPE2 "fpe2"
42 #define DATATYPE_UINT8 "ui8 "
43 #define DATATYPE_UINT16 "ui16"
44 #define DATATYPE_UINT32 "ui32"
45 #define DATATYPE_SP78 "sp78"
48 #define SMC_KEY_CPU_TEMP "TC0D"
49 #define SMC_KEY_GPU_TEMP "TG0D"
50 #define SMC_KEY_FAN0_RPM_MIN "F0Mn"
51 #define SMC_KEY_FAN1_RPM_MIN "F1Mn"
52 #define SMC_KEY_FAN0_RPM_CUR "F0Ac"
53 #define SMC_KEY_FAN1_RPM_CUR "F1Ac"
70 } SMCKeyData_pLimitData_t;
76 } SMCKeyData_keyInfo_t;
78 typedef char SMCBytes_t[32];
82 SMCKeyData_vers_t vers;
83 SMCKeyData_pLimitData_t pLimitData;
84 SMCKeyData_keyInfo_t keyInfo;
92 typedef const char UInt32ConstChar_t[5];
93 typedef char UInt32Char_t[5];
98 UInt32Char_t dataType;
108 double SMCGetTemperature(const char *key);