David Gutierrez wrote:
Hello, Temperature reporting is dependent on the specific capabilities of the motherboard, see Documentation/hwmon/adm1021 for an example - this documents the temperature sensors for Intel Xeon processors. Under the hwmon subdirectories are the implementation for the different temperature sensing for different CPUs: In drivers/hwmon: coretemp.c k10temp.c k8temp.c via-cputemp.c Via ACPI you can also get the temperature for the CPU, for example drivers/acpi/thermal.c: 249 static int acpi_thermal_get_temperature(struct acpi_thermal *tz) 250 { 251 acpi_status status = AE_OK; 252 unsigned long long tmp; 253 254 if (!tz) 255 return -EINVAL; 256 257 tz->last_temperature = tz->temperature; 258 259 status = acpi_evaluate_integer(tz->device->handle, "_TMP", NULL, &tmp); 260 if (ACPI_FAILURE(status)) 261 return -ENODEV; 262 263 tz->temperature = tmp; 264 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Temperature is %lu dK\n", 265 tz->temperature)); 266 267 return 0; 268 } This is because ACPI specs has a requirement: 24 * 25 * This driver fully implements the ACPI thermal policy as described in the 26 * ACPI 2.0 Specification. 27 * 28 * TBD: 1. Implement passive cooling hysteresis. 29 * 2. Enhance passive cooling (CPU) states/limit interface to support 30 * concepts of 'multiple limiters', upper/lower limits, etc. 31 * 32 */ 33 51 52 #define ACPI_THERMAL_CLASS "thermal_zone" 53 #define ACPI_THERMAL_DEVICE_NAME "Thermal Zone" 54 #define ACPI_THERMAL_FILE_STATE "state" 55 #define ACPI_THERMAL_FILE_TEMPERATURE "temperature" 56 #define ACPI_THERMAL_FILE_TRIP_POINTS "trip_points" 57 #define ACPI_THERMAL_FILE_COOLING_MODE "cooling_mode" 58 #define ACPI_THERMAL_FILE_POLLING_FREQ "polling_frequency" 59 #define ACPI_THERMAL_NOTIFY_TEMPERATURE 0x80 60 #define ACPI_THERMAL_NOTIFY_THRESHOLDS 0x81 61 #define ACPI_THERMAL_NOTIFY_DEVICES 0x82 62 #define ACPI_THERMAL_NOTIFY_CRITICAL 0xF0 63 #define ACPI_THERMAL_NOTIFY_HOT 0xF1 64 #define ACPI_THERMAL_MODE_ACTIVE 0x00 65 66 #define ACPI_THERMAL_MAX_ACTIVE 10 67 #define ACPI_THERMAL_MAX_LIMIT_STR_LEN 65 68 69 #define _COMPONENT ACPI_THERMAL_COMPONENT 70 ACPI_MODULE_NAME("thermal"); 71 72 MODULE_AUTHOR("Paul Diefenbaugh"); 73 MODULE_DESCRIPTION("ACPI Thermal Zone Driver"); 74 MODULE_LICENSE("GPL"); 75 etc etc. Not sure if these are enough to get you going? To unsubscribe from this group, send email to linuxkernelnewbies+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject. |
- [linuxkernelnewbies] CPU Status and temperature David Gutierrez
- [linuxkernelnewbies] Re: CPU Status and temperature peter teoh