summaryrefslogtreecommitdiffstats
path: root/src/usr/diag/prdf/common/framework/resolution
diff options
context:
space:
mode:
authorPrem Shanker Jha <premjha2@in.ibm.com>2013-09-20 07:40:14 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2014-12-01 18:51:43 -0600
commit554aa3dbb530d6da0de7c83bf23346ae5f6032eb (patch)
tree572c61c8da5932bd593804ddef39e78ccc2076f2 /src/usr/diag/prdf/common/framework/resolution
parent90b6464a0364c1bb86ad490c3807dcbbaab3b26b (diff)
downloadblackbird-hostboot-554aa3dbb530d6da0de7c83bf23346ae5f6032eb.tar.gz
blackbird-hostboot-554aa3dbb530d6da0de7c83bf23346ae5f6032eb.zip
PRDF: Added support for secondary filter in rule code.
- Secondary filter basically mask the certain bits. As a result it is possible to divide FIR analysis in two phase. This filter is intended to filter out secondary bits during first phase of analysis. Change-Id: Ib42b269d2e9fd5588b58950949c379bdc8518bfc RTC: 85130 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/6288 Tested-by: Jenkins Server Reviewed-by: Christopher T. Phan <cphan@us.ibm.com> Reviewed-by: Bilicon Patil <bilpatil@in.ibm.com> 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.aus.stglabs.ibm.com:8080/gerrit/14572
Diffstat (limited to 'src/usr/diag/prdf/common/framework/resolution')
-rwxr-xr-xsrc/usr/diag/prdf/common/framework/resolution/prdfResolutionMap.C58
-rwxr-xr-xsrc/usr/diag/prdf/common/framework/resolution/prdfResolutionMap.H27
2 files changed, 56 insertions, 29 deletions
diff --git a/src/usr/diag/prdf/common/framework/resolution/prdfResolutionMap.C b/src/usr/diag/prdf/common/framework/resolution/prdfResolutionMap.C
index e30378328..597fceb37 100755
--- a/src/usr/diag/prdf/common/framework/resolution/prdfResolutionMap.C
+++ b/src/usr/diag/prdf/common/framework/resolution/prdfResolutionMap.C
@@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* COPYRIGHT International Business Machines Corp. 2004,2014 */
+/* Contributors Listed Below - COPYRIGHT 2012,2014 */
+/* [+] International Business Machines Corp. */
+/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
@@ -247,51 +249,73 @@ void ResolutionMap::Add(const uint8_t *i_ble,
//------------------------------------------------------------------------------
-void ResolutionMap::LookUp( ResolutionList & o_list,
- BitKey & io_bitList,
- STEP_CODE_DATA_STRUCT & scd )
+int32_t ResolutionMap::LookUp( ResolutionList & o_list,
+ BitKey & io_bitList,
+ STEP_CODE_DATA_STRUCT & scd )
{
uint32_t lsize = o_list.size();
+ int32_t l_rc = SUCCESS;
if(iv_filter != NULL)
{
- iv_filter->Apply(io_bitList);
+ iv_filter->Apply( io_bitList,scd );
}
ErrorSignature * esig = scd.service_data->GetErrorSignature();
- switch(io_bitList.size())
+ switch( io_bitList.size() )
{
+ // we are setting rc to PRD_SCAN_COMM_REGISTER_ZERO in case 0 below.
+ // But we don't set rc to bit found set ( case 1 ) or
+ // PRD_MULTIPLE_ERRORS. It's because for the code calling this
+ // function, one bit set or multiple bit set make little
+ // difference. In both cases, it has to do same set of actions.
+ // We need to treat case 0 separately. It is because we want to
+ // know the outcome of action of secondary filter. If secondary
+ // filter yields 0xdd02, we know we need to launch one more pass
+ // with filter turned off.
case 0:
- esig->setErrCode(PRD_SCAN_COMM_REGISTER_ZERO);
+ esig->setErrCode( PRD_SCAN_COMM_REGISTER_ZERO );
+ l_rc = PRD_SCAN_COMM_REGISTER_ZERO;
break;
case 1:
- esig->setErrCode(io_bitList.getListValue(0));
+ esig->setErrCode( io_bitList.getListValue(0) );
break;
default:
- for(uint32_t index = 0; index < io_bitList.size(); ++index)
+ for( uint32_t index = 0; index < io_bitList.size(); ++index )
{
- esig->setErrCode(io_bitList.getListValue(index));
+ esig->setErrCode( io_bitList.getListValue(index) );
}
- esig->setErrCode(PRD_MULTIPLE_ERRORS);
+ esig->setErrCode( PRD_MULTIPLE_ERRORS );
};
- for(MapList::iterator i = iv_list.begin(); i != iv_list.end(); ++i)
+ for( MapList::iterator i = iv_list.begin(); i != iv_list.end(); ++i )
{
- if((i->iv_blist).isSubset(io_bitList))
+ if( ( i->iv_blist ).isSubset( io_bitList ) )
{
- o_list.push_back(i->iv_res);
+ o_list.push_back( i->iv_res );
}
}
- if(lsize == o_list.size()) // we didn't find anything to add, so use default
+ // we didn't find anything to add, so use default
+ if( lsize == o_list.size() )
{
- o_list.push_back(defaultRes);
+ // if it is a primary pass and we haven't found any bit set, let us
+ // prevent default resolution from getting executed. It is primarily
+ // because end of primary pass doesn't necessarily mean end of analysis.
+ // There may be a case when a FIR has only a secondary bit on. In that
+ // case, primary pass shall fail to find any bit set and initiate
+ // secondary pass. In secondary pass, bits set shall be identified and
+ // associated resolution shall be executed.
+
+ if( !scd.service_data->isPrimaryPass() ) o_list.push_back( defaultRes );
}
- if(iv_filter != NULL)
+ if( iv_filter != NULL )
{
iv_filter->Undo(io_bitList); // so returned bit list will have proper
// value for reset
}
+
+ return l_rc;
}
//------------------------------------------------------------------------------
diff --git a/src/usr/diag/prdf/common/framework/resolution/prdfResolutionMap.H b/src/usr/diag/prdf/common/framework/resolution/prdfResolutionMap.H
index 77ca2e04d..9e8b03a34 100755
--- a/src/usr/diag/prdf/common/framework/resolution/prdfResolutionMap.H
+++ b/src/usr/diag/prdf/common/framework/resolution/prdfResolutionMap.H
@@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* COPYRIGHT International Business Machines Corp. 2004,2014 */
+/* Contributors Listed Below - COPYRIGHT 2012,2014 */
+/* [+] International Business Machines Corp. */
+/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
@@ -178,17 +180,18 @@ public:
void AddRange(const char *i_ble,
Resolution * r1, Resolution * r2, Resolution * r3,
Resolution * r4, Resolution * r5, Resolution * r6) { Add(i_ble,r1,r2,r3,r4,r5,r6); }
- /**
- Look up a Resolution for a bitlist
- @param bitList
- @returns List of all Resolutions that match
- @pre none
- @post Resolution returned is only valid until the next call to LookUp or this object is destroyed.
- i_bitList may be modified
- @notes if the bitList does not have a match then the defaultResolution is returned.
- */
- void LookUp( ResolutionList & o_list, BitKey & io_bitList,
- STEP_CODE_DATA_STRUCT & scd );
+ /**
+ * @brief Look up resolutions associated with a bitlist
+ * @param o_list list of resolution.
+ * All the resolutions associated with a particular bit
+ * is stacked in this list.
+ * @param io_bitList bit key under analysis.
+ * @param scd reference to STEP_CODE_STRUCT
+ * @return PRD_SCAN_COMM_REGISTER_ZERO, if filter returns bitkey of zero
+ * size, SUCCESS otherwise.
+ */
+ int32_t LookUp( ResolutionList & o_list, BitKey & io_bitList,
+ STEP_CODE_DATA_STRUCT & scd );
/**
* @brief Get the stored filter associated with this resolution map.
OpenPOWER on IntegriCloud