diff options
author | Bilicon Patil <bilpatil@in.ibm.com> | 2013-08-27 07:34:32 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2013-10-10 22:31:19 -0500 |
commit | d581d230cf2a1540f98a5aed1e195fa5ac81f731 (patch) | |
tree | 59dd1eaf0b4ad0908f5d2188cb6187076a2148c6 /src/usr/diag | |
parent | 59108ff30a458e124b5d6ab489f7e6d502ff65aa (diff) | |
download | talos-hostboot-d581d230cf2a1540f98a5aed1e195fa5ac81f731.tar.gz talos-hostboot-d581d230cf2a1540f98a5aed1e195fa5ac81f731.zip |
PRD: Change datatype of infinite threshold value
RTC: 72403
Change-Id: Id4cbf6531b26ee1329e81ec569d9b87f441abb52
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/5957
Tested-by: Jenkins Server
Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Reviewed-by: Zane Shelley <zshelle@us.ibm.com>
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/6618
Diffstat (limited to 'src/usr/diag')
5 files changed, 22 insertions, 35 deletions
diff --git a/src/usr/diag/prdf/common/mnfgtools/prdfMfgThresholdFile_common.C b/src/usr/diag/prdf/common/mnfgtools/prdfMfgThresholdFile_common.C index 3fbd418ea..b7e065668 100755 --- a/src/usr/diag/prdf/common/mnfgtools/prdfMfgThresholdFile_common.C +++ b/src/usr/diag/prdf/common/mnfgtools/prdfMfgThresholdFile_common.C @@ -40,10 +40,10 @@ namespace PRDF { -int MfgThresholdFileCommon::getThreshold(uint32_t i_thrName) +uint8_t MfgThresholdFileCommon::getThreshold(uint32_t i_thrName) { if (iv_thresholds.end() == iv_thresholds.find(i_thrName)) - return -1; + return INFINITE_LIMIT_THR; else return iv_thresholds[i_thrName]; } diff --git a/src/usr/diag/prdf/common/mnfgtools/prdfMfgThresholdFile_common.H b/src/usr/diag/prdf/common/mnfgtools/prdfMfgThresholdFile_common.H index 81137e8f8..226a2e4c8 100755 --- a/src/usr/diag/prdf/common/mnfgtools/prdfMfgThresholdFile_common.H +++ b/src/usr/diag/prdf/common/mnfgtools/prdfMfgThresholdFile_common.H @@ -73,6 +73,11 @@ class MfgThresholdFileCommon typedef std::map<uint32_t, uint8_t> Threshold_t; /** + * @brief Infinite threshold enum + */ + enum { INFINITE_LIMIT_THR = 0xff }; + + /** * @brief constructor */ MfgThresholdFileCommon() {}; @@ -93,7 +98,7 @@ class MfgThresholdFileCommon * * @return corresponding threshold value */ - int getThreshold(uint32_t i_thrName); + uint8_t getThreshold(uint32_t i_thrName); /** * @brief set threshold name/value diff --git a/src/usr/diag/prdf/common/mnfgtools/prdfMfgThresholdMgr.C b/src/usr/diag/prdf/common/mnfgtools/prdfMfgThresholdMgr.C index 3ae79c536..25c0b1049 100755 --- a/src/usr/diag/prdf/common/mnfgtools/prdfMfgThresholdMgr.C +++ b/src/usr/diag/prdf/common/mnfgtools/prdfMfgThresholdMgr.C @@ -49,30 +49,27 @@ MfgThresholdMgr * MfgThresholdMgr::getInstance() return &l_mgr; } -uint16_t MfgThresholdMgr::getThreshold(uint32_t i_thrName) +uint8_t MfgThresholdMgr::getThreshold(uint32_t i_thrName) { this->setupFile(); - int l_thr = iv_file->getThreshold(i_thrName); + uint8_t l_thr = iv_file->getThreshold(i_thrName); - if (0 > l_thr) + if ((MfgThresholdFileCommon::INFINITE_LIMIT_THR) <= l_thr) return getThresholdDefault(i_thrName); else if (0 == l_thr) // zero is the "infinite" threshold. - return INFINITE_LIMIT_THR; + return (MfgThresholdFileCommon::INFINITE_LIMIT_THR); else - return (uint16_t) l_thr; + return l_thr; } ThresholdResolution::ThresholdPolicy* MfgThresholdMgr::getThresholdP(uint32_t i_thrName) { - uint16_t threshold = getThreshold(i_thrName); + uint8_t threshold = getThreshold(i_thrName); uint32_t interval = ThresholdResolution::NONE; - // FIXME - RTC: 72403 will address this issue - // if threshold >= 255 then set the interval to a very - // small number which will make it an infinite threshold - if( 255 <= threshold ) + if( (MfgThresholdFileCommon::INFINITE_LIMIT_THR) <= threshold ) { PRDF_TRAC("MfgThresholdMgr::getThresholdP: " "infinite threshold: 0x%x", i_thrName); @@ -95,20 +92,20 @@ void MfgThresholdMgr::reset() } } -uint16_t MfgThresholdMgr::getThresholdDefault(uint32_t i_thrName) +uint8_t MfgThresholdMgr::getThresholdDefault(uint32_t i_thrName) { - uint32_t l_value = 0; + uint8_t l_value = 0; #define PRDF_MFGTHRESHOLD_TABLE_BEGIN if #define PRDF_MFGTHRESHOLD_TABLE_END \ - (true) l_value = INFINITE_LIMIT_THR; + (true) l_value = (MfgThresholdFileCommon::INFINITE_LIMIT_THR); #define PRDF_MFGTHRESHOLD_ENTRY(a,b,c) \ (i_thrName == b) { l_value = c; } else if #include <prdfMfgThresholds.H> // zero is a special "infinite limit" value. if (0 == l_value) - l_value = INFINITE_LIMIT_THR; + l_value = (MfgThresholdFileCommon::INFINITE_LIMIT_THR); return l_value; } diff --git a/src/usr/diag/prdf/common/mnfgtools/prdfMfgThresholdMgr.H b/src/usr/diag/prdf/common/mnfgtools/prdfMfgThresholdMgr.H index 1c7ee6bca..cec7b02fa 100755 --- a/src/usr/diag/prdf/common/mnfgtools/prdfMfgThresholdMgr.H +++ b/src/usr/diag/prdf/common/mnfgtools/prdfMfgThresholdMgr.H @@ -24,16 +24,7 @@ #ifndef __PRDF_PRDFMFGTHRESHOLDMGR_H #define __PRDF_PRDFMFGTHRESHOLDMGR_H -#ifdef __HOSTBOOT_MODULE - #ifndef INT_MAX - #define INT_MAX 0xFFFFFFFF // FIXME: defined here for now - #endif -#else - #include <limits> -#endif - #include <stdint.h> -#include <limits.h> // for INT_MAX #include <prdfMfgThresholdFile.H> #include <prdfThresholdResolutions.H> #include <prdfFlyWeight.H> @@ -68,7 +59,7 @@ class MfgThresholdMgr * * @return corresponding threshold value */ - uint16_t getThreshold(uint32_t i_thrName); + uint8_t getThreshold(uint32_t i_thrName); /** * @brief get threshold policy from name @@ -90,12 +81,6 @@ class MfgThresholdMgr */ inline MfgThresholdFile * getMfgThresholdFile() { return iv_file; }; - - /** - * @brief Infinite threshold enum - */ - enum { INFINITE_LIMIT_THR = 0xffff }; - private: /** @@ -104,7 +89,7 @@ class MfgThresholdMgr * * @return corresponding threshold value */ - uint16_t getThresholdDefault(uint32_t i_thrName); + uint8_t getThresholdDefault(uint32_t i_thrName); /** * @brief set up MfgThresholdFile diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaThresholds_common.C b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaThresholds_common.C index 8975618f0..0d8157a26 100755 --- a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaThresholds_common.C +++ b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaThresholds_common.C @@ -59,7 +59,7 @@ int32_t getMnfgMemCeTh( ExtensibleChip * i_mbaChip, const CenRank & i_rank, if ( 0 == baseTh ) { o_cePerDram = o_cePerHalfRank = o_cePerDimm = - MfgThresholdMgr::INFINITE_LIMIT_THR; + MfgThresholdFileCommon::INFINITE_LIMIT_THR; break; } |