Date: Fri, 3 Jun 2011 20:43:12 +0000 (UTC) From: Andreas Tobler <andreast@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r222659 - head/sys/powerpc/powermac Message-ID: <201106032043.p53KhC8v079233@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201106032043.p53KhC8v079233>