Author: andreast
Date: Fri Jun 3 20:43:12 2011
New Revision: 222659
URL: http://svn.freebsd.org/changeset/base/222659
Log:
- Introduce a define for ZERO_C_TO_K.
- Fix the printing of the temperature when we exceed the critical value.
Approved by: nwhitehorn (mentor)
Modified:
head/sys/powerpc/powermac/powermac_thermal.c
head/sys/powerpc/powermac/powermac_thermal.h
Modified: head/sys/powerpc/powermac/powermac_thermal.c
==============================================================================
--- head/sys/powerpc/powermac/powermac_thermal.c Fri Jun 3 18:58:32
2011 (r222658)
+++ head/sys/powerpc/powermac/powermac_thermal.c Fri Jun 3 20:43:12
2011 (r222659)
@@ -109,9 +109,10 @@ pmac_therm_manage_fans(void)
printf("WARNING: Current temperature (%s: %d.%d C) "
"exceeds critical temperature (%d.%d C)! "
"Shutting down!\n", sensor->sensor->name,
- sensor->last_val / 10, sensor->last_val % 10,
- sensor->sensor->max_temp / 10,
- sensor->sensor->max_temp % 10);
+ (sensor->last_val - ZERO_C_TO_K) / 10,
+ (sensor->last_val - ZERO_C_TO_K) % 10,
+ (sensor->sensor->max_temp - ZERO_C_TO_K) / 10,
+ (sensor->sensor->max_temp - ZERO_C_TO_K) % 10);
shutdown_nice(RB_POWEROFF);
}
}
Modified: head/sys/powerpc/powermac/powermac_thermal.h
==============================================================================
--- head/sys/powerpc/powermac/powermac_thermal.h Fri Jun 3 18:58:32
2011 (r222658)
+++ head/sys/powerpc/powermac/powermac_thermal.h Fri Jun 3 20:43:12
2011 (r222659)
@@ -29,6 +29,8 @@
#ifndef _POWERPC_POWERMAC_POWERMAC_THERMAL_H
#define _POWERPC_POWERMAC_POWERMAC_THERMAL_H
+#define ZERO_C_TO_K 2732
+
struct pmac_fan {
int min_rpm, max_rpm, default_rpm;
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"