diff options
author | andreast <andreast@FreeBSD.org> | 2011-06-03 20:43:12 +0000 |
---|---|---|
committer | andreast <andreast@FreeBSD.org> | 2011-06-03 20:43:12 +0000 |
commit | 916a33cfad77dd8dfff1d4d21acc9470fb689d7e (patch) | |
tree | fc39f7d6e35cf32d66d5a172f14c780c3f2961c8 /sys/powerpc/powermac | |
parent | c87aaacb37e486140abfa953a47faede328892bc (diff) | |
download | FreeBSD-src-916a33cfad77dd8dfff1d4d21acc9470fb689d7e.zip FreeBSD-src-916a33cfad77dd8dfff1d4d21acc9470fb689d7e.tar.gz |
- Introduce a define for ZERO_C_TO_K.
- Fix the printing of the temperature when we exceed the critical value.
Approved by: nwhitehorn (mentor)
Diffstat (limited to 'sys/powerpc/powermac')
-rw-r--r-- | sys/powerpc/powermac/powermac_thermal.c | 7 | ||||
-rw-r--r-- | sys/powerpc/powermac/powermac_thermal.h | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/sys/powerpc/powermac/powermac_thermal.c b/sys/powerpc/powermac/powermac_thermal.c index 1b03072..9c1f59d 100644 --- a/sys/powerpc/powermac/powermac_thermal.c +++ b/sys/powerpc/powermac/powermac_thermal.c @@ -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); } } diff --git a/sys/powerpc/powermac/powermac_thermal.h b/sys/powerpc/powermac/powermac_thermal.h index 43bd629..424c612 100644 --- a/sys/powerpc/powermac/powermac_thermal.h +++ b/sys/powerpc/powermac/powermac_thermal.h @@ -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; |