diff options
Diffstat (limited to 'src/usr/diag/prdf/common')
188 files changed, 2501 insertions, 2581 deletions
diff --git a/src/usr/diag/prdf/common/framework/config/iipConfigurator.C b/src/usr/diag/prdf/common/framework/config/iipConfigurator.C index 2b3bb8ca1..a3425a73e 100755 --- a/src/usr/diag/prdf/common/framework/config/iipConfigurator.C +++ b/src/usr/diag/prdf/common/framework/config/iipConfigurator.C @@ -34,35 +34,10 @@ #include <iipConfigurator.h> #undef iipConfigurator_C -//---------------------------------------------------------------------- -// User Types -//---------------------------------------------------------------------- - -//---------------------------------------------------------------------- -// Constants -//---------------------------------------------------------------------- - -//---------------------------------------------------------------------- -// Macros -//---------------------------------------------------------------------- - -//---------------------------------------------------------------------- -// Internal Function Prototypes -//---------------------------------------------------------------------- - -//---------------------------------------------------------------------- -// Global Variables -//---------------------------------------------------------------------- - -//--------------------------------------------------------------------- -// Member Function Specifications -//--------------------------------------------------------------------- namespace PRDF { -Configurator::~Configurator() -{ -} +Configurator::~Configurator() {} -} // End namespace PRDF +} // end namespace PRDF diff --git a/src/usr/diag/prdf/common/framework/config/iipConfigurator.h b/src/usr/diag/prdf/common/framework/config/iipConfigurator.h index 311a1fc78..262a9b9e7 100755 --- a/src/usr/diag/prdf/common/framework/config/iipConfigurator.h +++ b/src/usr/diag/prdf/common/framework/config/iipConfigurator.h @@ -76,6 +76,10 @@ #include <prdfMain.H> #include <vector> + +namespace PRDF +{ + /*--------------------------------------------------------------------*/ /* Forward References */ /*--------------------------------------------------------------------*/ @@ -83,9 +87,6 @@ class CHIP_CLASS; class Domain; class System; -namespace PRDF -{ - class Configurator { public: diff --git a/src/usr/diag/prdf/common/framework/config/iipDomain.C b/src/usr/diag/prdf/common/framework/config/iipDomain.C index 5a86822af..fde702412 100755 --- a/src/usr/diag/prdf/common/framework/config/iipDomain.C +++ b/src/usr/diag/prdf/common/framework/config/iipDomain.C @@ -61,6 +61,9 @@ // Member Function Specifications //--------------------------------------------------------------------- +namespace PRDF +{ + Domain::Domain(DOMAIN_ID domain_id) : dom_id(domain_id) { @@ -76,9 +79,9 @@ int32_t Domain::Initialize (void) return(SUCCESS); } - -// @jl02 Add this for Unit CS. This is a virtual function so it doesn't need and code here. void Domain::Remove(TARGETING::TargetHandle_t i_ptargetChip) { }; -// @jl02 a End. + +} // end namespace PRDF + diff --git a/src/usr/diag/prdf/common/framework/config/iipDomain.h b/src/usr/diag/prdf/common/framework/config/iipDomain.h index 4fdab1a57..8545801aa 100755 --- a/src/usr/diag/prdf/common/framework/config/iipDomain.h +++ b/src/usr/diag/prdf/common/framework/config/iipDomain.h @@ -31,6 +31,9 @@ #include <iipsdbug.h> // Include file for ATTENTION_TYPE #endif +namespace PRDF +{ + // Forward References struct STEP_CODE_DATA_STRUCT; @@ -122,5 +125,6 @@ private: }; +} // end namespace PRDF #endif diff --git a/src/usr/diag/prdf/common/framework/config/iipDomainContainer.C b/src/usr/diag/prdf/common/framework/config/iipDomainContainer.C index 2274adce9..09399eb1c 100755 --- a/src/usr/diag/prdf/common/framework/config/iipDomainContainer.C +++ b/src/usr/diag/prdf/common/framework/config/iipDomainContainer.C @@ -41,6 +41,9 @@ #include <prdfPlatServices.H> #include <algorithm> +namespace PRDF +{ + //---------------------------------------------------------------------- // User Types //---------------------------------------------------------------------- @@ -163,3 +166,6 @@ void DomainContainer<T>::Remove(TARGETING::TargetHandle_t i_pChipHandle) // This will iterate thru the vectors and remove any vectors with chip ID that matches the i_chip. chips.erase(std::remove_if(chips.begin(), chips.end(), prdfCompareChipIds(i_pChipHandle)), chips.end()); } + +} // end namespace PRDF + diff --git a/src/usr/diag/prdf/common/framework/config/iipDomainContainer.h b/src/usr/diag/prdf/common/framework/config/iipDomainContainer.h index 223fb8120..36f2d8850 100755 --- a/src/usr/diag/prdf/common/framework/config/iipDomainContainer.h +++ b/src/usr/diag/prdf/common/framework/config/iipDomainContainer.h @@ -30,6 +30,9 @@ #include <vector> +namespace PRDF +{ + // Forward References struct STEP_CODE_DATA_STRUCT; @@ -256,6 +259,8 @@ private: }; +} // end namespace PRDF + #include "iipDomainContainer.inl" //#ifdef RS6000 -- changed for V4R1 Bali - 2/27/96 JFP diff --git a/src/usr/diag/prdf/common/framework/config/iipDomainContainer.inl b/src/usr/diag/prdf/common/framework/config/iipDomainContainer.inl index effca23b3..be75887ac 100755 --- a/src/usr/diag/prdf/common/framework/config/iipDomainContainer.inl +++ b/src/usr/diag/prdf/common/framework/config/iipDomainContainer.inl @@ -24,6 +24,8 @@ #ifndef iipDomainContainer_inl #define iipDomainContainer_inl +namespace PRDF +{ template<class T> inline @@ -53,5 +55,7 @@ uint32_t DomainContainer<T>::GetSize(void) const return(chips.size()); } +} // end namespace PRDF + #endif diff --git a/src/usr/diag/prdf/common/framework/config/iipSystem.C b/src/usr/diag/prdf/common/framework/config/iipSystem.C index 4fda713cf..b66f2f0de 100755 --- a/src/usr/diag/prdf/common/framework/config/iipSystem.C +++ b/src/usr/diag/prdf/common/framework/config/iipSystem.C @@ -54,6 +54,9 @@ #include <prdfMfgThresholdMgr.H> #endif +namespace PRDF +{ + //---------------------------------------------------------------------- // User Types //---------------------------------------------------------------------- @@ -102,9 +105,9 @@ System::~System(void) ResolutionFactory::Access().Reset(); #ifndef __HOSTBOOT_MODULE - // FIXME: need to implement PrdfMfgThresholdMgr in Hostboot + // FIXME: need to implement MfgThresholdMgr in Hostboot // clear the MfgThresholdMgr - PrdfMfgThresholdMgr::getInstance()->reset(); + MfgThresholdMgr::getInstance()->reset(); #endif // clear the threshold policies @@ -148,8 +151,6 @@ Domain * System::GetDomain(DOMAIN_ID domainId) void System::AddChips(ChipContainerIterator begin, ChipContainerIterator end) { - using namespace PRDF; - size_t l_size = 0; if(begin < end) l_size = end-begin; else l_size = begin-end; @@ -189,8 +190,6 @@ void System::RemoveStoppedChips(TARGETING::TargetHandle_t i_pchipHandle) void System::RemoveNonFunctionalChips() { - using namespace PRDF; - ChipMapType l_chips; for(ChipMapType::iterator chipIterator = chips.begin(); @@ -255,8 +254,6 @@ void System::Initialize(void) int System::Analyze(STEP_CODE_DATA_STRUCT & serviceData, ATTENTION_TYPE attentionType) { - using namespace PRDF; - SYSTEM_DEBUG_CLASS sysdebug; Domain * domainAtAttentionPtr = NULL; ServiceDataCollector * l_saved_sdc = NULL; @@ -336,3 +333,6 @@ int System::Analyze(STEP_CODE_DATA_STRUCT & serviceData, return(rc); } + +} // end namespace PRDF + diff --git a/src/usr/diag/prdf/common/framework/config/iipSystem.h b/src/usr/diag/prdf/common/framework/config/iipSystem.h index 23f84e4da..b608b377f 100755 --- a/src/usr/diag/prdf/common/framework/config/iipSystem.h +++ b/src/usr/diag/prdf/common/framework/config/iipSystem.h @@ -90,6 +90,9 @@ #include <iipsdbug.h> // Include file for ATTENTION_TYPE +namespace PRDF +{ + // Forward Declarations class CHIP_CLASS; class Domain; @@ -308,5 +311,6 @@ class System Resolution & noAttnResolution; }; +} // end namespace PRDF #endif diff --git a/src/usr/diag/prdf/common/framework/config/iipchip.C b/src/usr/diag/prdf/common/framework/config/iipchip.C index 78e1ed378..d5c2187fd 100755 --- a/src/usr/diag/prdf/common/framework/config/iipchip.C +++ b/src/usr/diag/prdf/common/framework/config/iipchip.C @@ -60,6 +60,9 @@ #include <iipchip.h> #include <prdfPlatServices.H> +namespace PRDF +{ + /*--------------------------------------------------------------------*/ /* Forward References */ /*--------------------------------------------------------------------*/ @@ -138,9 +141,11 @@ int32_t CHIP_CLASS::Initialize return(SUCCESS); } -PRDF::HUID CHIP_CLASS::GetId() const +HUID CHIP_CLASS::GetId() const { - return(PRDF::PlatServices::getHuid(iv_pchipHandle)); + return(PlatServices::getHuid(iv_pchipHandle)); } +} // end namespace PRDF + #undef IIPCHIP_CPP diff --git a/src/usr/diag/prdf/common/framework/config/iipchip.h b/src/usr/diag/prdf/common/framework/config/iipchip.h index e45adb0d5..51f0ce3b2 100755 --- a/src/usr/diag/prdf/common/framework/config/iipchip.h +++ b/src/usr/diag/prdf/common/framework/config/iipchip.h @@ -49,6 +49,9 @@ /* Forward References */ /*--------------------------------------------------------------------*/ +namespace PRDF +{ + class STEP_CODE_DATA_STRUCT; class CaptureData; @@ -181,7 +184,7 @@ class CHIP_CLASS <br><b>Notes: </b> default is to do nothing </ul><br> */ - PRDF::HUID GetId() const; + HUID GetId() const; protected: @@ -239,4 +242,6 @@ class CHIP_CLASS }; +} // end namespace PRDF + #endif diff --git a/src/usr/diag/prdf/common/framework/config/prdfExDomain.H b/src/usr/diag/prdf/common/framework/config/prdfExDomain.H index 0849affb4..964aa87a1 100644 --- a/src/usr/diag/prdf/common/framework/config/prdfExDomain.H +++ b/src/usr/diag/prdf/common/framework/config/prdfExDomain.H @@ -26,7 +26,10 @@ #include <prdfRuleChipDomain.H> -class PrdfExDomain : public PrdfRuleChipDomain +namespace PRDF +{ + +class ExDomain : public RuleChipDomain { public: @@ -35,8 +38,8 @@ class PrdfExDomain : public PrdfRuleChipDomain * @param i_did The domain ID * @param i_size The projected size of the domain */ - PrdfExDomain( DOMAIN_ID i_did, uint32_t i_size = EX_DOMAIN_SIZE ) : - PrdfRuleChipDomain( i_did, i_size ) + ExDomain( DOMAIN_ID i_did, uint32_t i_size = EX_DOMAIN_SIZE ) : + RuleChipDomain( i_did, i_size ) {} /** @@ -51,5 +54,7 @@ class PrdfExDomain : public PrdfRuleChipDomain }; +} // end namespace PRDF + #endif /* __PRDFEXDOMAIN_H */ diff --git a/src/usr/diag/prdf/common/framework/config/prdfExtensibleChip.H b/src/usr/diag/prdf/common/framework/config/prdfExtensibleChip.H index 01f17c0eb..8a5e8d4eb 100755 --- a/src/usr/diag/prdf/common/framework/config/prdfExtensibleChip.H +++ b/src/usr/diag/prdf/common/framework/config/prdfExtensibleChip.H @@ -29,16 +29,19 @@ #include <prdfPluginDef.H> -class PrdfDataBundle; +namespace PRDF +{ + +class DataBundle; -class PrdfExtensibleChip : public CHIP_CLASS +class ExtensibleChip : public CHIP_CLASS { public: - PrdfExtensibleChip( TARGETING::TargetHandle_t i_target ) : + ExtensibleChip( TARGETING::TargetHandle_t i_target ) : CHIP_CLASS(i_target) {} - virtual PrdfExtensibleChipFunction * getExtensibleFunction( + virtual ExtensibleChipFunction * getExtensibleFunction( const char * i_func, bool i_expectNull = false ) = 0; @@ -46,7 +49,7 @@ class PrdfExtensibleChip : public CHIP_CLASS const char * i_reg, bool i_expectNull = false ) = 0; - virtual PrdfDataBundle *& getDataBundle() = 0; + virtual DataBundle *& getDataBundle() = 0; /** * Add Capture data to the Capture Data object @@ -58,11 +61,13 @@ class PrdfExtensibleChip : public CHIP_CLASS virtual uint32_t getSignatureOffset() const = 0; }; -class PrdfDataBundle +class DataBundle { public: - virtual ~PrdfDataBundle() {}; + virtual ~DataBundle() {}; }; +} // end namespace PRDF + #endif diff --git a/src/usr/diag/prdf/common/framework/config/prdfExtensibleDomain.C b/src/usr/diag/prdf/common/framework/config/prdfExtensibleDomain.C index ef6991896..31e03a513 100755 --- a/src/usr/diag/prdf/common/framework/config/prdfExtensibleDomain.C +++ b/src/usr/diag/prdf/common/framework/config/prdfExtensibleDomain.C @@ -30,15 +30,18 @@ #include <prdfPfa5Data.h> #include <iipglobl.h> -PrdfExtensibleDomainFunction * - PrdfExtensibleDomain::getExtensibleFunction(const char * i_func, +namespace PRDF +{ + +ExtensibleDomainFunction * + ExtensibleDomain::getExtensibleFunction(const char * i_func, bool i_expectNull) { - PrdfExtensibleFunctionType * plugin = - prdfGetPluginGlobalMap().getPlugins(iv_domainName)[i_func]; + ExtensibleFunctionType * plugin = + getPluginGlobalMap().getPlugins(iv_domainName)[i_func]; if (NULL == plugin) { - static PrdfPlugin<PrdfExtensibleDomain> l_nullPlugin(NULL); + static Plugin<ExtensibleDomain> l_nullPlugin(NULL); plugin = &l_nullPlugin; if (!i_expectNull) @@ -57,19 +60,22 @@ PrdfExtensibleDomainFunction * PRDF_ADD_FFDC(l_errl, iv_domainName, strlen(iv_domainName), - prdfErrlVer1, - prdfErrlString); + ErrlVer1, + ErrlString); PRDF_ADD_FFDC(l_errl, i_func, strlen(i_func), - prdfErrlVer1, - prdfErrlString); + ErrlVer1, + ErrlString); PRDF_COMMIT_ERRL(l_errl, ERRL_ACTION_REPORT); delete l_errl; } } - return (PrdfExtensibleDomainFunction *) plugin; + return (ExtensibleDomainFunction *) plugin; } + +} // end namespace PRDF + diff --git a/src/usr/diag/prdf/common/framework/config/prdfExtensibleDomain.H b/src/usr/diag/prdf/common/framework/config/prdfExtensibleDomain.H index b37f60c9e..9432a5ad2 100755 --- a/src/usr/diag/prdf/common/framework/config/prdfExtensibleDomain.H +++ b/src/usr/diag/prdf/common/framework/config/prdfExtensibleDomain.H @@ -27,13 +27,16 @@ #include <prdfPluginDef.H> #include <prdfExtensibleChip.H> -class PrdfExtensibleDomain +namespace PRDF +{ + +class ExtensibleDomain { public: - PrdfExtensibleDomain(const char * i_domainName) : + ExtensibleDomain(const char * i_domainName) : iv_domainName(i_domainName), iv_dataBundle(NULL) {}; - virtual ~PrdfExtensibleDomain() + virtual ~ExtensibleDomain() { if (NULL != iv_dataBundle) { @@ -42,16 +45,18 @@ class PrdfExtensibleDomain } }; - virtual PrdfExtensibleDomainFunction * + virtual ExtensibleDomainFunction * getExtensibleFunction(const char * i_func, bool i_expectNull = false); - virtual PrdfDataBundle *& getDataBundle() { return iv_dataBundle; }; + virtual DataBundle *& getDataBundle() { return iv_dataBundle; }; private: const char * iv_domainName; - PrdfDataBundle * iv_dataBundle; + DataBundle * iv_dataBundle; }; +} // end namespace PRDF + #endif //__PRDFEXTENSIBLEDOMAIN_H diff --git a/src/usr/diag/prdf/common/framework/config/prdfFabricDomain.C b/src/usr/diag/prdf/common/framework/config/prdfFabricDomain.C index e01d38c02..1efef0eb9 100755 --- a/src/usr/diag/prdf/common/framework/config/prdfFabricDomain.C +++ b/src/usr/diag/prdf/common/framework/config/prdfFabricDomain.C @@ -46,6 +46,8 @@ #include <algorithm> #undef prdfFabricDomain_C +namespace PRDF +{ //---------------------------------------------------------------------- // User Types //---------------------------------------------------------------------- @@ -72,10 +74,8 @@ int32_t FabricDomain::Analyze(STEP_CODE_DATA_STRUCT & serviceData, ATTENTION_TYPE attentionType) { - using namespace PRDF; - int32_t l_rc; - l_rc = DomainContainer<PrdfRuleChip>::Analyze(serviceData, attentionType); + l_rc = DomainContainer<RuleChip>::Analyze(serviceData, attentionType); if( l_rc == PRD_POWER_FAULT ) @@ -108,8 +108,7 @@ int32_t FabricDomain::Analyze(STEP_CODE_DATA_STRUCT & serviceData, void FabricDomain::Order(ATTENTION_TYPE attentionType) { - using namespace PRDF; - using PrdfPluginDef::bindParm; + using PluginDef::bindParm; if (attentionType == MACHINE_CHECK) { @@ -125,7 +124,7 @@ void FabricDomain::Order(ATTENTION_TYPE attentionType) SYSTEM_DEBUG_CLASS sysdbug; for (int32_t i = (GetSize() - 1); i >= 0; --i) //pw03 { - PrdfRuleChip * l_fabChip = LookUp(i); + RuleChip * l_fabChip = LookUp(i); TARGETING::TargetHandle_t l_pchipHandle = l_fabChip->GetChipHandle(); if ((sysdbug.IsAttentionActive(l_pchipHandle)) && (sysdbug.GetAttentionType(l_pchipHandle ) == attentionType)) @@ -143,7 +142,7 @@ void FabricDomain::Order(ATTENTION_TYPE attentionType) // 3. WOF/TOD counters void FabricDomain::SortForXstop() { - using namespace PrdfPluginDef; + using namespace PluginDef; using namespace TARGETING; uint32_t l_internalOnlyCount = 0; @@ -161,14 +160,14 @@ void FabricDomain::SortForXstop() l_externalDrivers[i] = 0; l_wofValues[i] = 0; - PrdfRuleChip * l_fabChip = LookUp(i); + RuleChip * l_fabChip = LookUp(i); ptr.u = &l_externalDrivers[i]; // zs01 - prdfBitString l_externalChips(GetSize(), ptr.c); // zs01 + BitString l_externalChips(GetSize(), ptr.c); // zs01 TargetHandleList l_tmpList; // Call "GetCheckstopInfo" plugin. - PrdfExtensibleChipFunction * l_extFunc + ExtensibleChipFunction * l_extFunc = l_fabChip->getExtensibleFunction("GetCheckstopInfo"); (*l_extFunc)(l_fabChip, @@ -232,7 +231,7 @@ void FabricDomain::SortForXstop() for (uint32_t j = 0; j < GetSize(); j++) { ptr.u = &l_externalDrivers[i]; // zs01 - if ( prdfBitString(GetSize(), ptr.c).IsSet(j) ) // zs01 + if ( BitString(GetSize(), ptr.c).IsSet(j) ) // zs01 l_current.Set(j); } } @@ -284,8 +283,7 @@ namespace __prdfFabricDomain // pw03 --- void FabricDomain::SortForRecov() { - using namespace PRDF; - using namespace PrdfPluginDef; + using namespace PluginDef; SYSTEM_DEBUG_CLASS sysdbug; uint32_t l_sev[GetSize()]; @@ -294,7 +292,7 @@ void FabricDomain::SortForRecov() // Loop through all chips. for (uint32_t i = 0; i < GetSize(); ++i) { - PrdfRuleChip * l_fabChip = LookUp(i); + RuleChip * l_fabChip = LookUp(i); TARGETING::TargetHandle_t l_pchipHandle = l_fabChip->GetChipHandle(); if (sysdbug.IsAttentionActive(l_pchipHandle)) // If at attention, check. { @@ -307,7 +305,7 @@ void FabricDomain::SortForRecov() else if (CHECK_STOP == sysdbug.GetAttentionType(l_pchipHandle)) { // Check for recovered error at checkstop. - PrdfExtensibleChipFunction * l_extFunc + ExtensibleChipFunction * l_extFunc = l_fabChip->getExtensibleFunction("CheckForRecovered"); bool l_hasRer = false; @@ -324,7 +322,7 @@ void FabricDomain::SortForRecov() // Find real severity level. if (0 != l_sev[i]) { - PrdfExtensibleChipFunction * l_extFunc + ExtensibleChipFunction * l_extFunc = l_fabChip->getExtensibleFunction( "CheckForRecoveredSev"); @@ -363,7 +361,7 @@ int32_t FabricDomain::AnalyzeTheseChips(STEP_CODE_DATA_STRUCT & serviceData, for (TargetHandleList::iterator i = i_chips.begin(); i != i_chips.end(); ++i) { PRDF_DTRAC( "FabricDomain::AnalyzeTheseChips::Before--chip=0x%X", - PRDF::PlatServices::getHuid(*i)); + PlatServices::getHuid(*i)); } OrderTheseChips(attentionType, i_chips); @@ -371,11 +369,11 @@ int32_t FabricDomain::AnalyzeTheseChips(STEP_CODE_DATA_STRUCT & serviceData, for (TargetHandleList::iterator i = i_chips.begin(); i != i_chips.end(); ++i) { PRDF_DTRAC( "FabricDomain::AnalyzeTheseChips::After--chip=0x%X", - PRDF::PlatServices::getHuid(*i) ); + PlatServices::getHuid(*i) ); } //After the Order function is called the first chip should contain the chip to look at. //Look here for the correct LookUp function. I don't think this is working. - PrdfRuleChip * l_fabChip = FindChipInTheseChips(i_chips[0], i_chips); + RuleChip * l_fabChip = FindChipInTheseChips(i_chips[0], i_chips); PRDF_DTRAC( "FabricDomain::AnalyzeTheseChips::Analyzing this one: 0x%X", l_fabChip->GetId() ); if(NULL != l_fabChip) @@ -397,7 +395,7 @@ int32_t FabricDomain::AnalyzeTheseChips(STEP_CODE_DATA_STRUCT & serviceData, //Get P7 chip Global FIR data for FFDC for (TargetHandleList::iterator i = i_chips.begin(); i != i_chips.end(); ++i) { - PrdfRuleChip * l_fabChip = FindChipInTheseChips(*i, i_chips); + RuleChip * l_fabChip = FindChipInTheseChips(*i, i_chips); l_fabChip->CaptureErrorData( serviceData.service_data->GetCaptureData(), Util::hashString("GlobalFIRs")); @@ -412,7 +410,7 @@ int32_t FabricDomain::AnalyzeTheseChips(STEP_CODE_DATA_STRUCT & serviceData, int32_t FabricDomain::OrderTheseChips(ATTENTION_TYPE attentionType, TARGETING::TargetHandleList & i_chips) { - using namespace PrdfPluginDef; + using namespace PluginDef; using namespace TARGETING; PRDF_DENTER( "FabricDomain::OrderTheseChips" ); @@ -429,16 +427,16 @@ int32_t FabricDomain::OrderTheseChips(ATTENTION_TYPE attentionType, for (TargetHandleList::iterator i = i_chips.begin(); i != i_chips.end(); ++i) { - PrdfRuleChip * l_fabChip = FindChipInTheseChips(*i, i_chips); + RuleChip * l_fabChip = FindChipInTheseChips(*i, i_chips); ptr.u = &l_externalDrivers[l_chip]; - prdfBitString l_externalChips(i_chips.size(), ptr.c); + BitString l_externalChips(i_chips.size(), ptr.c); TargetHandleList l_tmpList; if(l_fabChip != NULL) { // Call "GetCheckstopInfo" plugin. - PrdfExtensibleChipFunction * l_extFunc + ExtensibleChipFunction * l_extFunc = l_fabChip->getExtensibleFunction("GetCheckstopInfo"); (*l_extFunc)(l_fabChip, @@ -489,12 +487,12 @@ int32_t FabricDomain::OrderTheseChips(ATTENTION_TYPE attentionType, //This function is to ensure the order of the chip in the list is the correct chip. //Because there is no garaunteed order within the domain container this is necessary. -PrdfRuleChip * FabricDomain::FindChipInTheseChips(TARGETING::TargetHandle_t i_pchipHandle, TARGETING::TargetHandleList & i_chips) +RuleChip * FabricDomain::FindChipInTheseChips(TARGETING::TargetHandle_t i_pchipHandle, TARGETING::TargetHandleList & i_chips) { using namespace TARGETING; PRDF_DENTER( "FabricDomain::FindChipNumber" ); - PrdfRuleChip * l_fabChip = NULL; + RuleChip * l_fabChip = NULL; TargetHandle_t l_tmpfabHandle= NULL; // Loop through all chips. for (TargetHandleList::iterator iter = i_chips.begin(); iter != i_chips.end(); ++iter) @@ -521,3 +519,5 @@ void FabricDomain::MoveToFrontInTheseChips(uint32_t i_chipToFront, TARGETING::Ta std::swap((*i), (*(i-1))); } } + +} //End namespace PRDF diff --git a/src/usr/diag/prdf/common/framework/config/prdfFabricDomain.H b/src/usr/diag/prdf/common/framework/config/prdfFabricDomain.H index 645daac21..c5e3cd5fb 100755 --- a/src/usr/diag/prdf/common/framework/config/prdfFabricDomain.H +++ b/src/usr/diag/prdf/common/framework/config/prdfFabricDomain.H @@ -42,7 +42,11 @@ @brief Fabric Domain, contains Fabric Chips @author Mike Kobler */ -class FabricDomain : public PrdfRuleChipDomain + +namespace PRDF +{ + +class FabricDomain : public RuleChipDomain { public: @@ -52,7 +56,7 @@ class FabricDomain : public PrdfRuleChipDomain * @param i_size The projected size of the domain */ FabricDomain( DOMAIN_ID i_did, uint32_t i_size = PROC_DOMAIN_SIZE ) : - PrdfRuleChipDomain( i_did, i_size ) + RuleChipDomain( i_did, i_size ) {} /* @@ -113,8 +117,8 @@ class FabricDomain : public PrdfRuleChipDomain * @param i_chips List of chips in the domain to analyze. * @return SUCCESS */ - virtual PrdfRuleChip * FindChipInTheseChips( TARGETING::TargetHandle_t i_chipId, - TARGETING::TargetHandleList & i_chips ); + virtual RuleChip * FindChipInTheseChips( TARGETING::TargetHandle_t i_chipId, + TARGETING::TargetHandleList & i_chips ); /** * @brief Moves the chip in question to the front of the list of chips. @@ -160,4 +164,6 @@ private: // Data }; +} // end namespace PRDF + #endif /* prdfFabricDomain_H */ diff --git a/src/usr/diag/prdf/common/framework/config/prdfMbaDomain.H b/src/usr/diag/prdf/common/framework/config/prdfMbaDomain.H index 3b98351c5..d2220b3d4 100644 --- a/src/usr/diag/prdf/common/framework/config/prdfMbaDomain.H +++ b/src/usr/diag/prdf/common/framework/config/prdfMbaDomain.H @@ -26,7 +26,10 @@ #include <prdfRuleChipDomain.H> -class PrdfMbaDomain : public PrdfRuleChipDomain +namespace PRDF +{ + +class MbaDomain : public RuleChipDomain { public: @@ -35,8 +38,8 @@ class PrdfMbaDomain : public PrdfRuleChipDomain * @param i_did The domain ID * @param i_size The projected size of the domain */ - PrdfMbaDomain( DOMAIN_ID i_did, uint32_t i_size = MBA_DOMAIN_SIZE ) : - PrdfRuleChipDomain( i_did, i_size ) + MbaDomain( DOMAIN_ID i_did, uint32_t i_size = MBA_DOMAIN_SIZE ) : + RuleChipDomain( i_did, i_size ) {} /** @@ -51,5 +54,7 @@ class PrdfMbaDomain : public PrdfRuleChipDomain }; +} // end namespace PRDF + #endif /* __PRDFMBADOMAIN_H */ diff --git a/src/usr/diag/prdf/common/framework/config/prdfMcsDomain.H b/src/usr/diag/prdf/common/framework/config/prdfMcsDomain.H index 60cdb5f21..341ecc706 100644 --- a/src/usr/diag/prdf/common/framework/config/prdfMcsDomain.H +++ b/src/usr/diag/prdf/common/framework/config/prdfMcsDomain.H @@ -26,7 +26,10 @@ #include <prdfRuleChipDomain.H> -class PrdfMcsDomain : public PrdfRuleChipDomain +namespace PRDF +{ + +class McsDomain : public RuleChipDomain { public: @@ -35,8 +38,8 @@ class PrdfMcsDomain : public PrdfRuleChipDomain * @param i_did The domain ID * @param i_size The projected size of the domain */ - PrdfMcsDomain( DOMAIN_ID i_did, uint32_t i_size = MCS_DOMAIN_SIZE ) : - PrdfRuleChipDomain( i_did, i_size ) + McsDomain( DOMAIN_ID i_did, uint32_t i_size = MCS_DOMAIN_SIZE ) : + RuleChipDomain( i_did, i_size ) {} /** @@ -51,5 +54,7 @@ class PrdfMcsDomain : public PrdfRuleChipDomain }; +} // end namespace PRDF + #endif /* __PRDFMCSDOMAIN_H */ diff --git a/src/usr/diag/prdf/common/framework/config/prdfMembufDomain.H b/src/usr/diag/prdf/common/framework/config/prdfMembufDomain.H index df4f08970..ca2b9be81 100644 --- a/src/usr/diag/prdf/common/framework/config/prdfMembufDomain.H +++ b/src/usr/diag/prdf/common/framework/config/prdfMembufDomain.H @@ -26,7 +26,10 @@ #include <prdfRuleChipDomain.H> -class PrdfMembufDomain : public PrdfRuleChipDomain +namespace PRDF +{ + +class MembufDomain : public RuleChipDomain { public: @@ -35,11 +38,13 @@ class PrdfMembufDomain : public PrdfRuleChipDomain * @param i_did The domain ID * @param i_size The projected size of the domain */ - PrdfMembufDomain( DOMAIN_ID i_did, uint32_t i_size = MEMBUF_DOMAIN_SIZE ) : - PrdfRuleChipDomain( i_did, i_size ) + MembufDomain( DOMAIN_ID i_did, uint32_t i_size = MEMBUF_DOMAIN_SIZE ) : + RuleChipDomain( i_did, i_size ) {} }; +} // end namespace PRDF + #endif /* __PRDFMEMBUFDOMAIN_H */ diff --git a/src/usr/diag/prdf/common/framework/config/prdfParentDomain.C b/src/usr/diag/prdf/common/framework/config/prdfParentDomain.C index 83c46a7ed..14759cef6 100755 --- a/src/usr/diag/prdf/common/framework/config/prdfParentDomain.C +++ b/src/usr/diag/prdf/common/framework/config/prdfParentDomain.C @@ -64,6 +64,8 @@ // Member Function Specifications //--------------------------------------------------------------------- +namespace PRDF +{ //Constructor template<class T> @@ -102,5 +104,6 @@ typename ParentDomain<T>::iterator ParentDomain<T>::getEndIterator() //This instance of ParentDomain has to remain after the definition // of the Templated class function or it won't link correctly. -template class ParentDomain<PrdfExtensibleDomain>; +template class ParentDomain<ExtensibleDomain>; +} // end namespace PRDF diff --git a/src/usr/diag/prdf/common/framework/config/prdfParentDomain.H b/src/usr/diag/prdf/common/framework/config/prdfParentDomain.H index 79ef13097..8981ed56f 100755 --- a/src/usr/diag/prdf/common/framework/config/prdfParentDomain.H +++ b/src/usr/diag/prdf/common/framework/config/prdfParentDomain.H @@ -27,6 +27,8 @@ #include <prdfRuleChip.H> #include <vector> +namespace PRDF +{ /** Template class that Define a domain Parent that contain other domains as children. @par @@ -126,4 +128,6 @@ private: }; +} // end namespace PRDF + #endif diff --git a/src/usr/diag/prdf/common/framework/config/prdfPllDomain.C b/src/usr/diag/prdf/common/framework/config/prdfPllDomain.C index 3acd6c45c..1076df31c 100755 --- a/src/usr/diag/prdf/common/framework/config/prdfPllDomain.C +++ b/src/usr/diag/prdf/common/framework/config/prdfPllDomain.C @@ -54,15 +54,15 @@ int32_t PllDomain::Initialize(void) //However, the inits from other comps are better are cleaning up the PLL errors. // for (unsigned int i = 0; i < GetSize() && rc == SUCCESS; ++i) // { -// PrdfExtensibleChip * l_chip = LookUp(i); -// PrdfExtensibleFunction * l_clearPll = l_chip->getExtensibleFunction("ClearPll"); +// ExtensibleChip * l_chip = LookUp(i); +// ExtensibleFunction * l_clearPll = l_chip->getExtensibleFunction("ClearPll"); // Call ClearPll on this chip (see prdfPluginDef.H for bindParm defn) -// (*l_clearPll)(l_chip,PrdfPluginDef::bindParm<void *>(NULL)); +// (*l_clearPll)(l_chip,PluginDef::bindParm<void *>(NULL)); //@jl01 D-END // Don't unmask 04/20/2006 Review -// PrdfExtensibleFunction * l_unmask = l_chip->getExtensibleFunction("UnmaskPll"); -// (*l_unmask)(l_chip,PrdfPluginDef::bindParm<void *>(NULL)); +// ExtensibleFunction * l_unmask = l_chip->getExtensibleFunction("UnmaskPll"); +// (*l_unmask)(l_chip,PluginDef::bindParm<void *>(NULL)); // } } return(rc); @@ -84,10 +84,10 @@ bool PllDomain::Query(ATTENTION_TYPE attentionType) { if(sysdbug.IsAttentionActive(LookUp(index)->GetChipHandle())) { - PrdfExtensibleChip * l_chip = LookUp(index); - PrdfExtensibleChipFunction * l_query = + ExtensibleChip * l_chip = LookUp(index); + ExtensibleChipFunction * l_query = l_chip->getExtensibleFunction("QueryPll"); - int32_t rc = (*l_query)(l_chip,PrdfPluginDef::bindParm<bool &>(atAttn)); + int32_t rc = (*l_query)(l_chip,PluginDef::bindParm<bool &>(atAttn)); // if rc then scom read failed - Error log has already been generated if( PRD_POWER_FAULT == rc ) { @@ -110,7 +110,7 @@ bool PllDomain::Query(ATTENTION_TYPE attentionType) int32_t PllDomain::Analyze(STEP_CODE_DATA_STRUCT & serviceData, ATTENTION_TYPE attentionType) { - typedef PrdfExtensibleChip * ChipPtr; + typedef ExtensibleChip * ChipPtr; CcAutoDeletePointerVector<ChipPtr> chip(new ChipPtr[GetSize()]); int count = 0; int32_t rc = SUCCESS; @@ -118,16 +118,16 @@ int32_t PllDomain::Analyze(STEP_CODE_DATA_STRUCT & serviceData, // Due to clock issues some chips may be moved to non-functional during // analysis. In this case, these chips will need to be removed from their // domains. - typedef std::vector<PrdfExtensibleChip *> NonFuncChips; + typedef std::vector<ExtensibleChip *> NonFuncChips; NonFuncChips nfchips; // Count # of chips that had PLL error for(unsigned int index = 0; index < GetSize(); ++index) { - PrdfExtensibleChip * l_chip = LookUp(index); - PrdfExtensibleChipFunction * l_query = l_chip->getExtensibleFunction("QueryPll"); + ExtensibleChip * l_chip = LookUp(index); + ExtensibleChipFunction * l_query = l_chip->getExtensibleFunction("QueryPll"); bool atAttn; - rc = (*l_query)(l_chip,PrdfPluginDef::bindParm<bool &>(atAttn)); + rc = (*l_query)(l_chip,PluginDef::bindParm<bool &>(atAttn)); if(atAttn == true) { chip()[count] = LookUp(index); @@ -160,12 +160,12 @@ int32_t PllDomain::Analyze(STEP_CODE_DATA_STRUCT & serviceData, const uint32_t tmpCount = serviceData.service_data->GetMruList().size(); // Call this chip's CalloutPll plugin if it exists. - PrdfExtensibleChipFunction * l_callout = + ExtensibleChipFunction * l_callout = chip()[0]->getExtensibleFunction( "CalloutPll", true ); if ( NULL != l_callout ) { (*l_callout)( chip()[0], - PrdfPluginDef::bindParm<STEP_CODE_DATA_STRUCT &>(serviceData) ); + PluginDef::bindParm<STEP_CODE_DATA_STRUCT &>(serviceData) ); } if ( tmpCount == serviceData.service_data->GetMruList().size() ) @@ -180,9 +180,9 @@ int32_t PllDomain::Analyze(STEP_CODE_DATA_STRUCT & serviceData, if(serviceData.service_data->IsAtThreshold()) { // Mask in all chips in domain - PrdfExtensibleDomainFunction * l_mask = getExtensibleFunction("MaskPll"); + ExtensibleDomainFunction * l_mask = getExtensibleFunction("MaskPll"); (*l_mask)(this, - PrdfPluginDef::bindParm<STEP_CODE_DATA_STRUCT&>(serviceData)); + PluginDef::bindParm<STEP_CODE_DATA_STRUCT&>(serviceData)); } // Set Signature serviceData.service_data->GetErrorSignature()->setChipId(chip()[0]->GetId()); @@ -194,19 +194,19 @@ int32_t PllDomain::Analyze(STEP_CODE_DATA_STRUCT & serviceData, #endif // Clear PLLs from this domain. - PrdfExtensibleDomainFunction * l_clear = getExtensibleFunction("ClearPll"); + ExtensibleDomainFunction * l_clear = getExtensibleFunction("ClearPll"); (*l_clear)(this, - PrdfPluginDef::bindParm<STEP_CODE_DATA_STRUCT&>(serviceData)); + PluginDef::bindParm<STEP_CODE_DATA_STRUCT&>(serviceData)); // Run any PLL Post Analysis functions from this domain. for(int i = 0; i < count; i++) { - PrdfExtensibleChip * l_chip = chip()[i]; + ExtensibleChip * l_chip = chip()[i]; // Send any special messages indicating there was a PLL error. - PrdfExtensibleChipFunction * l_pllPostAnalysis = + ExtensibleChipFunction * l_pllPostAnalysis = l_chip->getExtensibleFunction("PllPostAnalysis", true); (*l_pllPostAnalysis)(l_chip, - PrdfPluginDef::bindParm<STEP_CODE_DATA_STRUCT&>(serviceData)); + PluginDef::bindParm<STEP_CODE_DATA_STRUCT&>(serviceData)); } return rc; @@ -221,7 +221,7 @@ void PllDomain::Order(ATTENTION_TYPE attentionType) //------------------------------------------------------------------------------ -int32_t PllDomain::ClearPll( PrdfExtensibleDomain * i_domain, +int32_t PllDomain::ClearPll( ExtensibleDomain * i_domain, STEP_CODE_DATA_STRUCT i_sc ) { PllDomain * l_domain = (PllDomain *) i_domain; @@ -229,23 +229,23 @@ int32_t PllDomain::ClearPll( PrdfExtensibleDomain * i_domain, // Clear children chips. for ( uint32_t i = 0; i < l_domain->GetSize(); i++ ) { - PrdfExtensibleChip * l_chip = l_domain->LookUp(i); - PrdfExtensibleChipFunction * l_clear = + ExtensibleChip * l_chip = l_domain->LookUp(i); + ExtensibleChipFunction * l_clear = l_chip->getExtensibleFunction("ClearPll"); (*l_clear)( l_chip, - PrdfPluginDef::bindParm<STEP_CODE_DATA_STRUCT&>(i_sc) ); + PluginDef::bindParm<STEP_CODE_DATA_STRUCT&>(i_sc) ); } // Clear children domains. // This looks like a recursive call. It calls other domains of Clear. - ParentDomain<PrdfExtensibleDomain>::iterator i; + ParentDomain<ExtensibleDomain>::iterator i; for (i = l_domain->getBeginIterator(); i != l_domain->getEndIterator(); i++) { // Clear PLLs from this domain. - PrdfExtensibleDomainFunction * l_clear = + ExtensibleDomainFunction * l_clear = (i->second)->getExtensibleFunction("ClearPll"); (*l_clear)( i->second, - PrdfPluginDef::bindParm<STEP_CODE_DATA_STRUCT&>(i_sc) ); + PluginDef::bindParm<STEP_CODE_DATA_STRUCT&>(i_sc) ); } return SUCCESS; @@ -254,7 +254,7 @@ PRDF_PLUGIN_DEFINE( PllDomain, ClearPll ); //------------------------------------------------------------------------------ -int32_t PllDomain::MaskPll( PrdfExtensibleDomain * i_domain, +int32_t PllDomain::MaskPll( ExtensibleDomain * i_domain, STEP_CODE_DATA_STRUCT i_sc ) { PllDomain * l_domain = (PllDomain *) i_domain; @@ -262,22 +262,22 @@ int32_t PllDomain::MaskPll( PrdfExtensibleDomain * i_domain, // Mask children chips. for ( uint32_t i = 0; i < l_domain->GetSize(); i++ ) { - PrdfExtensibleChip * l_chip = l_domain->LookUp(i); - PrdfExtensibleChipFunction * l_mask = + ExtensibleChip * l_chip = l_domain->LookUp(i); + ExtensibleChipFunction * l_mask = l_chip->getExtensibleFunction("MaskPll"); (*l_mask)( l_chip, - PrdfPluginDef::bindParm<STEP_CODE_DATA_STRUCT&>(i_sc) ); + PluginDef::bindParm<STEP_CODE_DATA_STRUCT&>(i_sc) ); } // Mask children domains. // This looks like a recursive call. It calls other domains of Mask. - ParentDomain<PrdfExtensibleDomain>::iterator i; + ParentDomain<ExtensibleDomain>::iterator i; for (i = l_domain->getBeginIterator(); i != l_domain->getEndIterator(); i++) { - PrdfExtensibleDomainFunction * l_mask = + ExtensibleDomainFunction * l_mask = (i->second)->getExtensibleFunction("MaskPll"); (*l_mask)( i->second, - PrdfPluginDef::bindParm<STEP_CODE_DATA_STRUCT&>(i_sc) ); + PluginDef::bindParm<STEP_CODE_DATA_STRUCT&>(i_sc) ); } return SUCCESS; diff --git a/src/usr/diag/prdf/common/framework/config/prdfPllDomain.H b/src/usr/diag/prdf/common/framework/config/prdfPllDomain.H index b5d55a206..583b54c84 100755 --- a/src/usr/diag/prdf/common/framework/config/prdfPllDomain.H +++ b/src/usr/diag/prdf/common/framework/config/prdfPllDomain.H @@ -40,8 +40,8 @@ namespace PRDF //------------------------------------------------------------------------------ -class PllDomain : public PrdfRuleChipDomain, public PrdfExtensibleDomain, - public ParentDomain<PrdfExtensibleDomain> +class PllDomain : public RuleChipDomain, public ExtensibleDomain, + public ParentDomain<ExtensibleDomain> { public: @@ -106,7 +106,7 @@ class PllDomain : public PrdfRuleChipDomain, public PrdfExtensibleDomain, * @param i_sc The step code data struct. * @return SUCCESS */ - static int32_t ClearPll( PrdfExtensibleDomain * i_domain, + static int32_t ClearPll( ExtensibleDomain * i_domain, STEP_CODE_DATA_STRUCT i_sc ); /** @@ -116,7 +116,7 @@ class PllDomain : public PrdfRuleChipDomain, public PrdfExtensibleDomain, * @param i_sc The step code data struct. * @return SUCCESS */ - static int32_t MaskPll( PrdfExtensibleDomain * i_domain, + static int32_t MaskPll( ExtensibleDomain * i_domain, STEP_CODE_DATA_STRUCT i_sc ); protected: @@ -152,8 +152,8 @@ private: // Data inline PllDomain::PllDomain( DOMAIN_ID domain_id, Resolution & clockSource, const ThresholdResolution::ThresholdPolicy& i_mfgThresh) : - PrdfRuleChipDomain( domain_id, PllDomain::CONTAINER_SIZE ), - PrdfExtensibleDomain("PllDomain"), + RuleChipDomain( domain_id, PllDomain::CONTAINER_SIZE ), + ExtensibleDomain("PllDomain"), closeClockSource(clockSource), farClockSource(clockSource), iv_threshold( ResolutionFactory::Access().GetThresholdResolution( 1, @@ -167,8 +167,8 @@ inline PllDomain::PllDomain( DOMAIN_ID domain_id, Resolution & clockSource, hwTableContent i_hwdc, const ThresholdResolution::ThresholdPolicy& i_mfgThresh) : - PrdfRuleChipDomain( domain_id, PllDomain::CONTAINER_SIZE ), - PrdfExtensibleDomain("PllDomain"), + RuleChipDomain( domain_id, PllDomain::CONTAINER_SIZE ), + ExtensibleDomain("PllDomain"), closeClockSource(clockSource), farClockSource(clockSource), iv_threshold( ResolutionFactory::Access().GetThresholdResolution( 1, diff --git a/src/usr/diag/prdf/common/framework/config/prdfRuleChipDomain.C b/src/usr/diag/prdf/common/framework/config/prdfRuleChipDomain.C index 212fbe993..04e009657 100755 --- a/src/usr/diag/prdf/common/framework/config/prdfRuleChipDomain.C +++ b/src/usr/diag/prdf/common/framework/config/prdfRuleChipDomain.C @@ -31,18 +31,19 @@ //------------------------------------------------------------------------------ -bool PrdfRuleChipDomain::Query( ATTENTION_TYPE i_attnType ) +namespace PRDF { - using namespace PRDF; +bool RuleChipDomain::Query( ATTENTION_TYPE i_attnType ) +{ bool o_rc = false; - using PrdfPluginDef::bindParm; + using PluginDef::bindParm; SYSTEM_DEBUG_CLASS sysdbug; for ( uint32_t i = 0; i < GetSize(); i++ ) { - PrdfRuleChip * chip = LookUp(i); + RuleChip * chip = LookUp(i); TARGETING::TargetHandle_t l_pchipHandle = LookUp(i)->GetChipHandle(); if ( sysdbug.IsAttentionActive(l_pchipHandle) ) @@ -76,7 +77,7 @@ bool PrdfRuleChipDomain::Query( ATTENTION_TYPE i_attnType ) continue; } - PrdfExtensibleChipFunction * ef + ExtensibleChipFunction * ef = chip->getExtensibleFunction( funcName, true ); bool ignore = false; @@ -98,7 +99,7 @@ bool PrdfRuleChipDomain::Query( ATTENTION_TYPE i_attnType ) ( (sysdbug.GetAttentionType(l_pchipHandle) == CHECK_STOP) || (sysdbug.GetAttentionType(l_pchipHandle) == UNIT_CS) ) ) { - PrdfExtensibleChipFunction * ef + ExtensibleChipFunction * ef = chip->getExtensibleFunction("CheckForRecovered"); (*ef)(chip, bindParm<bool &>(o_rc)); @@ -112,18 +113,16 @@ bool PrdfRuleChipDomain::Query( ATTENTION_TYPE i_attnType ) //------------------------------------------------------------------------------ -void PrdfRuleChipDomain::Order( ATTENTION_TYPE i_attnType ) +void RuleChipDomain::Order( ATTENTION_TYPE i_attnType ) { - using namespace PRDF; - - using PrdfPluginDef::bindParm; + using PluginDef::bindParm; SYSTEM_DEBUG_CLASS sysdbug; const char * funcName; //mp01 a for ( int32_t i = (GetSize() - 1); i >= 0; i-- ) { - PrdfRuleChip * chip = LookUp(i); + RuleChip * chip = LookUp(i); TARGETING::TargetHandle_t l_pchipHandle = LookUp(i)->GetChipHandle(); if ( sysdbug.IsAttentionActive(l_pchipHandle) ) @@ -156,7 +155,7 @@ void PrdfRuleChipDomain::Order( ATTENTION_TYPE i_attnType ) continue; } - PrdfExtensibleChipFunction * ef + ExtensibleChipFunction * ef = chip->getExtensibleFunction( funcName, true ); bool ignore = false; @@ -177,7 +176,7 @@ void PrdfRuleChipDomain::Order( ATTENTION_TYPE i_attnType ) ( (sysdbug.GetAttentionType(l_pchipHandle) == CHECK_STOP) || (sysdbug.GetAttentionType(l_pchipHandle) == UNIT_CS) ) ) { - PrdfExtensibleChipFunction * ef + ExtensibleChipFunction * ef = chip->getExtensibleFunction("CheckForRecovered"); bool hasRer = false; (*ef)(chip, bindParm<bool &>(hasRer)); @@ -191,3 +190,5 @@ void PrdfRuleChipDomain::Order( ATTENTION_TYPE i_attnType ) } } } + +} // end namespace PRDF diff --git a/src/usr/diag/prdf/common/framework/config/prdfRuleChipDomain.H b/src/usr/diag/prdf/common/framework/config/prdfRuleChipDomain.H index 9b3fb7654..59dde7f35 100755 --- a/src/usr/diag/prdf/common/framework/config/prdfRuleChipDomain.H +++ b/src/usr/diag/prdf/common/framework/config/prdfRuleChipDomain.H @@ -27,7 +27,10 @@ #include <iipDomainContainer.h> #include <prdfRuleChip.H> -class PrdfRuleChipDomain : public DomainContainer<PrdfRuleChip> +namespace PRDF +{ + +class RuleChipDomain : public DomainContainer<RuleChip> { public: @@ -49,13 +52,13 @@ class PrdfRuleChipDomain : public DomainContainer<PrdfRuleChip> TOTAL_DOMAINS = 5, }; - /** @fn PrdfRuleChipDomain + /** @fn RuleChipDomain * @brief Constructor * @param DOMAIN_ID - the domain ID * @param uint32_t - the projected size of the domain */ - PrdfRuleChipDomain( DOMAIN_ID i_did, uint32_t i_size ) : - DomainContainer<PrdfRuleChip>( i_did, i_size ) + RuleChipDomain( DOMAIN_ID i_did, uint32_t i_size ) : + DomainContainer<RuleChip>( i_did, i_size ) {} /** @fn Query @@ -74,4 +77,6 @@ class PrdfRuleChipDomain : public DomainContainer<PrdfRuleChip> virtual void Order( ATTENTION_TYPE i_attnType); }; +} // end namespace PRDF + #endif /* PRDFRULECHIPDOMAIN_H */ diff --git a/src/usr/diag/prdf/common/framework/config/prdfSystemSpecific.H b/src/usr/diag/prdf/common/framework/config/prdfSystemSpecific.H index 295c67486..af173c3aa 100755 --- a/src/usr/diag/prdf/common/framework/config/prdfSystemSpecific.H +++ b/src/usr/diag/prdf/common/framework/config/prdfSystemSpecific.H @@ -45,10 +45,15 @@ #include <iipConfigurator.h> #include <iipstep.h> -namespace PrdfSystemSpecific +namespace PRDF +{ + +namespace SystemSpecific { PRDF::Configurator * getConfiguratorPtr(); void postAnalysisWorkarounds(STEP_CODE_DATA_STRUCT & i_sdc); }; +} // end namespace PRDF + #endif diff --git a/src/usr/diag/prdf/common/framework/config/xspprdAccessPllChip.C b/src/usr/diag/prdf/common/framework/config/xspprdAccessPllChip.C index b1f2b91e9..609f76595 100755 --- a/src/usr/diag/prdf/common/framework/config/xspprdAccessPllChip.C +++ b/src/usr/diag/prdf/common/framework/config/xspprdAccessPllChip.C @@ -49,6 +49,9 @@ // User Types //---------------------------------------------------------------------- +namespace PRDF +{ + //---------------------------------------------------------------------- // Constants //---------------------------------------------------------------------- @@ -192,15 +195,5 @@ void AccessPllChip::CapturePll(STEP_CODE_DATA_STRUCT & serviceData) (serviceData.service_data->GetCaptureData()).Add(GetChipHandle(), PLL_ID ,pll_lock_reg); } -// -------------------------------------------------------------------- -// -------------------------------------------------------------------- +} // end namespace PRDF - -// Change Log ********************************************************* -// -// Flag Reason Vers Date Coder Description -// ---- --------- ---- -------- -------- ------------------------------ -// v5r2 04/14/00 mkobler Initial Creation -// 512857 fips240 07/29/05 dgilbert add AccessPllChip -// -// End Change Log ***************************************************** diff --git a/src/usr/diag/prdf/common/framework/config/xspprdAccessPllChip.h b/src/usr/diag/prdf/common/framework/config/xspprdAccessPllChip.h index 7abc4d237..bc6a78792 100755 --- a/src/usr/diag/prdf/common/framework/config/xspprdAccessPllChip.h +++ b/src/usr/diag/prdf/common/framework/config/xspprdAccessPllChip.h @@ -40,6 +40,9 @@ #include <iipchip.h> +namespace PRDF +{ + //-------------------------------------------------------------------- // Forward References //-------------------------------------------------------------------- @@ -141,4 +144,6 @@ inline AccessPllChip::AccessPllChip( TARGETING::TargetHandle_t i_target ) : CHIP_CLASS(i_target) {} +} // end namespace PRDF + #endif /* xspprdAccessPllChip_h */ diff --git a/src/usr/diag/prdf/common/framework/register/iipCaptureData.h b/src/usr/diag/prdf/common/framework/register/iipCaptureData.h index eaa25b163..a4c0ce514 100755 --- a/src/usr/diag/prdf/common/framework/register/iipCaptureData.h +++ b/src/usr/diag/prdf/common/framework/register/iipCaptureData.h @@ -82,6 +82,9 @@ #include <prdfPlatServices.H> #include <functional> // @jl04 a Needed for the unary function in new predicate. +namespace PRDF +{ + // Forward Declarations class SCAN_COMM_REGISTER_CLASS; class ScanCommRegisterAccess; @@ -364,4 +367,6 @@ private: }; }; +} // end namespace PRDF + #endif diff --git a/src/usr/diag/prdf/common/framework/register/iipErrorRegister.h b/src/usr/diag/prdf/common/framework/register/iipErrorRegister.h index 82508fe19..db12c223c 100755 --- a/src/usr/diag/prdf/common/framework/register/iipErrorRegister.h +++ b/src/usr/diag/prdf/common/framework/register/iipErrorRegister.h @@ -61,6 +61,10 @@ //-------------------------------------------------------------------- // Forward References //-------------------------------------------------------------------- + +namespace PRDF +{ + class SCAN_COMM_REGISTER_CLASS; class ResolutionMap; @@ -151,7 +155,7 @@ protected: */ virtual BIT_LIST_CLASS Filter(const BIT_STRING_CLASS & bs); - virtual bool FilterUndo(prdfBitKey & i_bit_list) { return false; } + virtual bool FilterUndo(BitKey & i_bit_list) { return false; } /** Find a resolution for the Bit List <ul> @@ -205,20 +209,7 @@ private: // Data }; - +} // end namespace PRDF #endif /* iipErrorRegister_h */ -// Change Log ********************************************************* -// -// Flag Reason Vers Date Coder Description -// ---- -------- ---- -------- ----- ------------------------------- -// 04/05/96 DRG Initial Creation -// p4902214 v4r1m0 05/09/97 DRG Added service data parm to Reset -// v4r1 01/07/98 DRG Add NoErrorOnZeroScrRead() -// d49274.2 V4R5 09/23/98 DRG Add scrId option -// 423599 fsp 10/27/03 dgilbert make scrid a bit16 -// dg02 482244 fips225 11/05/04 dgilbert add SetErrorSignture() -// 558003 fips310 06/21/06 dgilbert add FilterUndo() -// -// End Change Log ***************************************************** diff --git a/src/usr/diag/prdf/common/framework/register/iipErrorRegisterFilter.h b/src/usr/diag/prdf/common/framework/register/iipErrorRegisterFilter.h index 71b016926..a8dc3b027 100755 --- a/src/usr/diag/prdf/common/framework/register/iipErrorRegisterFilter.h +++ b/src/usr/diag/prdf/common/framework/register/iipErrorRegisterFilter.h @@ -49,6 +49,9 @@ #endif #include <prdfFilters.H> +namespace PRDF +{ + //-------------------------------------------------------------------- // Forward References //-------------------------------------------------------------------- @@ -90,7 +93,8 @@ public: <br><b>Notes: </b> </ul><br> */ - ErrorRegisterFilter(SCAN_COMM_REGISTER_CLASS & r, ResolutionMap & rm, prdfFilter * f, uint16_t scrId = 0x0fff); + ErrorRegisterFilter( SCAN_COMM_REGISTER_CLASS & r, ResolutionMap & rm, + FilterClass * f, uint16_t scrId = 0x0fff ); /* Destructor @@ -109,13 +113,13 @@ public: * @brief Get the stored filter associated with this resolution map. * @returns Currently assigned filter. */ - prdfFilter * getFilter() const { return filter; }; + FilterClass * getFilter() const { return filter; }; /** * @brief Store a new filter with this resolution map. - * @param i - Filter to store. + * @param i - FilterClass to store. */ - void setFilter(prdfFilter * i_filter) { filter = i_filter; }; + void setFilter(FilterClass * i_filter) { filter = i_filter; }; protected: // functions @@ -131,14 +135,14 @@ protected: // functions - DEFINTION in iipErrorRegisterMask.C </ul><br> */ - virtual prdfBitKey Filter(const BIT_STRING_CLASS & bs); + virtual BitKey Filter(const BIT_STRING_CLASS & bs); /** * Certain filters need to be reversed in order for Reset() to work right * @return bit_list modified ? [true|false] - * @see prdfFilters.H + * @see Filters.H */ - virtual bool FilterUndo(prdfBitKey & i_bit_list) + virtual bool FilterUndo(BitKey & i_bit_list) { bool modified = false; if(filter) modified = filter->Undo(i_bit_list); @@ -154,7 +158,7 @@ private: // functions protected: // data - prdfFilter * filter; + FilterClass * filter; private: // Data @@ -170,20 +174,12 @@ ErrorRegisterFilter::ErrorRegisterFilter(SCAN_COMM_REGISTER_CLASS & r, inline ErrorRegisterFilter::ErrorRegisterFilter(SCAN_COMM_REGISTER_CLASS & r, ResolutionMap & rm, - prdfFilter * f, + FilterClass * f, uint16_t scrId) : ErrorRegister(r,rm,scrId), filter(f) {} +} // end namespace PRDF #endif /* iipErrorRegisterFilter_h */ -// Change Log ************************************************************************************* -// -// Flag Reason Vers Date Coder Description -// ---- -------- ---- -------- -------- ------------------------------------------------------- -// P4907878 v5r2 04/27/01 dgilbert Initial Creation -// 423599 fsp 10/28/03 dgilbert make scrId a uint16_t -// 558003 fips310 06/21/06 dgilbert add get/setFilter() and FilterUndo -// -// End Change Log ********************************************************************************* diff --git a/src/usr/diag/prdf/common/framework/register/iipErrorRegisterMask.h b/src/usr/diag/prdf/common/framework/register/iipErrorRegisterMask.h index c5b9087b3..45573a232 100755 --- a/src/usr/diag/prdf/common/framework/register/iipErrorRegisterMask.h +++ b/src/usr/diag/prdf/common/framework/register/iipErrorRegisterMask.h @@ -71,6 +71,10 @@ #ifndef IIPBITS_H #include <iipbits.h> #endif + +namespace PRDF +{ + //-------------------------------------------------------------------- // Forward References //-------------------------------------------------------------------- @@ -187,7 +191,8 @@ protected: <br><b>Notes: </b> </ul><br> */ - virtual int32_t Reset(const BIT_LIST_CLASS & bit_list,STEP_CODE_DATA_STRUCT & error); + virtual int32_t Reset( const BIT_LIST_CLASS & bit_list, + STEP_CODE_DATA_STRUCT & error ); private: // functions /** Copy forbidden - no definition (code) exists*/ @@ -213,20 +218,7 @@ inline void ErrorRegisterMask::SetMaskBit(uint32_t bitPosition) inline void ErrorRegisterMask::SetMaskBits(const BIT_STRING_CLASS & bitString) { bitStringMask.SetBits(bitString); } +} // end namespace PRDF + #endif /* iipErrorRegisterMask_h */ -// Change Log ********************************************************* -// -// Flag Reason Vers Date Coder Description -// ---- -------- ---- -------- ----- ------------------------------- -// 05/03/96 DRG Initial Creation -// d49127.1 v4r1m0 05/31/96 DRG Added Analyze() Reset() & maskIt -// p4902214 v4r1m0 05/09/97 DRG Added service data parm to Reset -// Removed maskIt -// D49274.2 v4r5 09/24/98 DRG Added scrId -// dg00 v5r2 04/05/00 DRG Added maskScr -// P4907878 v5r2 04/27/01 drg factor out filter into ErrorRegisterFilter -// class -// 423599 fsp 10/28/03 dgilbert make scrId a uint16_t -// -// End Change Log ***************************************************** diff --git a/src/usr/diag/prdf/common/framework/register/iipErrorRegisterSet.h b/src/usr/diag/prdf/common/framework/register/iipErrorRegisterSet.h index 0d91dd719..2f7c25bdc 100755 --- a/src/usr/diag/prdf/common/framework/register/iipErrorRegisterSet.h +++ b/src/usr/diag/prdf/common/framework/register/iipErrorRegisterSet.h @@ -50,6 +50,9 @@ #include <iipErrorRegisterMask.h> #endif +namespace PRDF +{ + //-------------------------------------------------------------------- // Forward References //-------------------------------------------------------------------- @@ -113,12 +116,7 @@ private: // Data }; +} // end namespace PRDF + #endif /* iipErrorRegisterSet_h */ -// Change Log ********************************************************* -// -// Flag Reason Vers Date Coder Description -// ---- -------- ---- -------- -------- ------------------------------- -// p4901848 v4r1 02/20/97 DGILBERT Initial Creation -// -// End Change Log ***************************************************** diff --git a/src/usr/diag/prdf/common/framework/register/iipErrorRegisterType.h b/src/usr/diag/prdf/common/framework/register/iipErrorRegisterType.h index 85c5a3309..ead888a92 100755 --- a/src/usr/diag/prdf/common/framework/register/iipErrorRegisterType.h +++ b/src/usr/diag/prdf/common/framework/register/iipErrorRegisterType.h @@ -45,6 +45,10 @@ #endif #include <iipsdbug.h> + +namespace PRDF +{ + //-------------------------------------------------------------------- // Forward References //-------------------------------------------------------------------- @@ -114,7 +118,7 @@ protected: // // End Function Specification **************************************** - virtual prdfBitKey Filter(const BIT_STRING_CLASS & bs) = 0; + virtual BitKey Filter(const BIT_STRING_CLASS & bs) = 0; // Function Specification ******************************************** // // Purpose: Filter out unwanted bits in the bit string. @@ -129,7 +133,7 @@ protected: // // End Function Specification **************************************** - virtual bool FilterUndo(prdfBitKey & i_bit_list) = 0; + virtual bool FilterUndo(BitKey & i_bit_list) = 0; /** Find a resolution for the Bit List @@ -144,9 +148,9 @@ protected: Resolution Map then the ResolutionMap default is used </ul><br> */ - virtual int32_t Lookup(STEP_CODE_DATA_STRUCT & sdc, prdfBitKey & bl) = 0; //dg02c + virtual int32_t Lookup(STEP_CODE_DATA_STRUCT & sdc, BitKey & bl) = 0; - virtual int32_t Reset(const prdfBitKey & bit_list,STEP_CODE_DATA_STRUCT & error) = 0; + virtual int32_t Reset(const BitKey & bit_list,STEP_CODE_DATA_STRUCT & error) = 0; // Function Specification ******************************************** // // Purpose: Reset the hardware & perform any other actions needed @@ -164,6 +168,7 @@ protected: }; +} // end namespace PRDF #endif /* iipErrorRegisterType_h */ diff --git a/src/usr/diag/prdf/common/framework/register/iipMopRegisterAccess.h b/src/usr/diag/prdf/common/framework/register/iipMopRegisterAccess.h index dd08c14b9..874d9d745 100755 --- a/src/usr/diag/prdf/common/framework/register/iipMopRegisterAccess.h +++ b/src/usr/diag/prdf/common/framework/register/iipMopRegisterAccess.h @@ -61,6 +61,8 @@ #endif #include <prdfPlatServices.H> +namespace PRDF +{ // Forward References class BIT_STRING_CLASS; @@ -174,16 +176,8 @@ public: }; -#include <iipMopRegisterAccess.inl> - -// Change Log ********************************************************** -// -// Flag PTR/DCR# Userid Date Description -// ---- -------- -------- -------- ----------- -// n/a n/a JST 09/08/95 Created. -// d DGILBERT 05/19/95 Modified Access() parms -// -// End Change Log ****************************************************** +} // end namespace PRDF +#include <iipMopRegisterAccess.inl> #endif diff --git a/src/usr/diag/prdf/common/framework/register/iipMopRegisterAccess.inl b/src/usr/diag/prdf/common/framework/register/iipMopRegisterAccess.inl index 1bb95f597..406d13cfe 100755 --- a/src/usr/diag/prdf/common/framework/register/iipMopRegisterAccess.inl +++ b/src/usr/diag/prdf/common/framework/register/iipMopRegisterAccess.inl @@ -56,8 +56,10 @@ // Member Function Specifications //--------------------------------------------------------------------- +namespace PRDF +{ + inline -MopRegisterAccess::~MopRegisterAccess(void) - { - } +MopRegisterAccess::~MopRegisterAccess() {} +} // end namespace PRDF diff --git a/src/usr/diag/prdf/common/framework/register/iipMopRegisterAccessScanComm.h b/src/usr/diag/prdf/common/framework/register/iipMopRegisterAccessScanComm.h index 1824ac174..c5808f8c3 100755 --- a/src/usr/diag/prdf/common/framework/register/iipMopRegisterAccessScanComm.h +++ b/src/usr/diag/prdf/common/framework/register/iipMopRegisterAccessScanComm.h @@ -53,6 +53,9 @@ #include <iipMopRegisterAccess.h> #endif +namespace PRDF +{ + // Forward References class MopRegisterAccessScanComm : public MopRegisterAccess { @@ -148,17 +151,6 @@ private: // DATA }; -//#include <iipMopRegisterAccessScanComm.inl> // dg00 - -// Change Log ********************************************************** -// -// Flag PTR/DCR# Userid Date Description -// ---- -------- -------- -------- ----------- -// n/a n/a JST 09/08/95 Created. -// v4r3 DGILBERT 05/19/96 Modified Access() -// dg00 365764 dgilbert 04/19/02 remove inlines -// -// End Change Log ****************************************************** - +} // end namespace PRDF #endif diff --git a/src/usr/diag/prdf/common/framework/register/iipMopRegisterAccessScanComm.inl b/src/usr/diag/prdf/common/framework/register/iipMopRegisterAccessScanComm.inl index 7d1c59227..652d67819 100755 --- a/src/usr/diag/prdf/common/framework/register/iipMopRegisterAccessScanComm.inl +++ b/src/usr/diag/prdf/common/framework/register/iipMopRegisterAccessScanComm.inl @@ -28,6 +28,9 @@ // // End Module Description ********************************************** +namespace PRDF +{ + //---------------------------------------------------------------------- // Includes //---------------------------------------------------------------------- @@ -61,4 +64,4 @@ MopRegisterAccessScanComm::MopRegisterAccessScanComm(void) { } - +} // end namespace PRDF diff --git a/src/usr/diag/prdf/common/framework/register/iipResetErrorRegister.h b/src/usr/diag/prdf/common/framework/register/iipResetErrorRegister.h index 90e17d47d..2b449b329 100755 --- a/src/usr/diag/prdf/common/framework/register/iipResetErrorRegister.h +++ b/src/usr/diag/prdf/common/framework/register/iipResetErrorRegister.h @@ -46,7 +46,7 @@ // ErrorRegister * er1 = new ResetErrorRegister(scr1,rm,scr2); // // *** Using a Filter **** -// Filter * f = new PriorityFileter(...); +// FilterClass * f = new PriorityFilter(...); // ErrorRegister * er = new ResetErrorRegister(scr1,rm,f); // ErrorRegister *er1 = new ResetErrorRegister(scr1,rm,scr2,f); // @@ -70,6 +70,9 @@ #include <vector> #include <prdfResetOperators.H> +namespace PRDF +{ + //-------------------------------------------------------------------- // Forward References //-------------------------------------------------------------------- @@ -311,6 +314,6 @@ class ResetAndMaskErrorRegister : public ErrorRegisterMask ResetRegisterVector cv_masks; }; - +} // end namespace PRDF #endif /* iipResetErrorRegister_h */ diff --git a/src/usr/diag/prdf/common/framework/register/iipScanCommRegisterAccess.C b/src/usr/diag/prdf/common/framework/register/iipScanCommRegisterAccess.C index 675bff0a2..72b0f67a2 100755 --- a/src/usr/diag/prdf/common/framework/register/iipScanCommRegisterAccess.C +++ b/src/usr/diag/prdf/common/framework/register/iipScanCommRegisterAccess.C @@ -57,6 +57,9 @@ // Internal Function Prototypes //---------------------------------------------------------------------- +namespace PRDF +{ + //---------------------------------------------------------------------- // Global Variables //---------------------------------------------------------------------- @@ -134,7 +137,7 @@ uint32_t ScanCommRegisterAccess::Write(void) // bs.SetBits(*bit_string_ptr); - rc = Access(bs, GetAddress(),MopRegisterAccess::WRITE); + rc = Access(bs, GetAddress(), MopRegisterAccess::WRITE); // } return(rc); @@ -148,8 +151,6 @@ uint32_t ScanCommRegisterAccess::Write(void) uint32_t ScanCommRegisterAccess::Access(BIT_STRING_CLASS & bs, uint64_t registerId, MopRegisterAccess::Operation op) const { - using namespace PRDF; - uint32_t rc = SCR_ACCESS_FAILED; if(hops != NULL) { @@ -196,20 +197,5 @@ uint32_t ScanCommRegisterAccess::Access(BIT_STRING_CLASS & bs, uint64_t register // #endif -// Change Log ********************************************************** -// -// Flag PTR/DCR# Userid Date Description -// ---- -------- -------- -------- ----------- -// n/a n/a JST ??/??/95 Created. -// D24747.4 JFP 02/23/95 Added #include <CuLib.h> -// DGILBERT 05/23/97 Access()/Read()/Write() change -// dg01 aix343882 dgilbert 07/16/01 Make out of synch if Read fails -// -// End Change Log ****************************************************** - - - - - - +} //end namespace PRDF diff --git a/src/usr/diag/prdf/common/framework/register/iipScanCommRegisterAccess.h b/src/usr/diag/prdf/common/framework/register/iipScanCommRegisterAccess.h index 965d34fe6..8a9c76d14 100755 --- a/src/usr/diag/prdf/common/framework/register/iipScanCommRegisterAccess.h +++ b/src/usr/diag/prdf/common/framework/register/iipScanCommRegisterAccess.h @@ -80,6 +80,9 @@ #include <iipMopRegisterAccess.h> #endif +namespace PRDF +{ + // // Forward References // #ifdef _USE_IOSTREAMS_ // class ostream; @@ -301,6 +304,8 @@ private: // Data uint16_t cv_shortId; }; +} // end namespace PRDF + // #ifdef _USE_IOSTREAMS_ // // Function Specification ******************************************** @@ -321,20 +326,6 @@ private: // Data // #endif - #include <iipScanCommRegisterAccess.inl> -// Change Log ********************************************************** -// -// Flag PTR/DCR# Userid Date Description -// ---- -------- -------- -------- ----------- -// n/a n/a JST 05/05/95 Created. -// D49127.7 DGILBERT 09/19/96 Ctor changed -// DGILBERT 05/23/97 Access change -// dg00 D49420.1 DGILBERT 08/21/00 Add ForceRead() -// f510901 iawillia 06/29/05 Add GetId/SetId -// -// End Change Log ****************************************************** - - #endif diff --git a/src/usr/diag/prdf/common/framework/register/iipScanCommRegisterAccess.inl b/src/usr/diag/prdf/common/framework/register/iipScanCommRegisterAccess.inl index f78d46708..6bd0ac347 100755 --- a/src/usr/diag/prdf/common/framework/register/iipScanCommRegisterAccess.inl +++ b/src/usr/diag/prdf/common/framework/register/iipScanCommRegisterAccess.inl @@ -56,6 +56,9 @@ // Member Function Specifications //--------------------------------------------------------------------- +namespace PRDF +{ + inline ScanCommRegisterAccess::ScanCommRegisterAccess( uint64_t ra, @@ -66,3 +69,5 @@ synch(), hops(&hopsAccessor) { } + +} // end namespace PRDF diff --git a/src/usr/diag/prdf/common/framework/register/iipScanCommRegisterChip.C b/src/usr/diag/prdf/common/framework/register/iipScanCommRegisterChip.C index 72300c691..b6a37712d 100755 --- a/src/usr/diag/prdf/common/framework/register/iipScanCommRegisterChip.C +++ b/src/usr/diag/prdf/common/framework/register/iipScanCommRegisterChip.C @@ -40,6 +40,9 @@ #undef iipScanCommRegisterChip_C +namespace PRDF +{ + //---------------------------------------------------------------------- // User Types //---------------------------------------------------------------------- @@ -104,14 +107,5 @@ void ScanCommRegisterChip::SetBitString(const BIT_STRING_CLASS *bs) // return(chipSelectValues); // } -// Change Log ********************************************************** -// -// Flag PTR/DCR# Userid Date Description -// ---- -------- -------- -------- ----------- -// n/a n/a JST 04/18/95 Created. -// D49127.7 DGILBERT 09/20/96 Added xBitString, Get/SetBitString() -// AccessBitString() -// DGILBERT 05/27/97 V4R3 changes -// -// End Change Log ****************************************************** +} // end namespace PRDF diff --git a/src/usr/diag/prdf/common/framework/register/iipScanCommRegisterChip.h b/src/usr/diag/prdf/common/framework/register/iipScanCommRegisterChip.h index 035cb42d0..e65a55fdb 100755 --- a/src/usr/diag/prdf/common/framework/register/iipScanCommRegisterChip.h +++ b/src/usr/diag/prdf/common/framework/register/iipScanCommRegisterChip.h @@ -64,6 +64,8 @@ #include <iipbits.h> #endif +namespace PRDF +{ // Forward References class CHIP_CLASS; @@ -154,7 +156,8 @@ public: // // End Function Specification **************************************** - virtual const BIT_STRING_CLASS * GetBitString(ATTENTION_TYPE i_type = PRDF::INVALID_ATTENTION_TYPE) const + virtual const BIT_STRING_CLASS * GetBitString( + ATTENTION_TYPE i_type = INVALID_ATTENTION_TYPE ) const { return &xBitString; } // Function Specification ******************************************** // @@ -210,17 +213,6 @@ private: // Data }; -// Change Log ********************************************************** -// -// Flag PTR/DCR# Userid Date Description -// ---- -------- -------- -------- ----------- -// n/a n/a JST 04/18/95 Created. -// D49127.7 DGILBERT 09/20/96 Added xBitString, Get/SetBitString() -// AccessBitString() -// DGILBERT 05/27/97 V4R3 changes -// dgilbert 10/02/02 fips changes -// -// End Change Log ****************************************************** - +} // end namespace PRDF #endif diff --git a/src/usr/diag/prdf/common/framework/register/iipXorResetErrorRegister.h b/src/usr/diag/prdf/common/framework/register/iipXorResetErrorRegister.h index ce41875aa..d220a1520 100755 --- a/src/usr/diag/prdf/common/framework/register/iipXorResetErrorRegister.h +++ b/src/usr/diag/prdf/common/framework/register/iipXorResetErrorRegister.h @@ -51,6 +51,8 @@ #include <iipErrorRegisterMask.h> #endif +namespace PRDF +{ //-------------------------------------------------------------------- // Forward References @@ -130,14 +132,7 @@ XorResetErrorRegister::XorResetErrorRegister(SCAN_COMM_REGISTER_CLASS & r, : ErrorRegisterMask(r,rm,f) {} +} // end namespace PRDF #endif /* iipXorResetErrorRegister_h */ -// Change Log ********************************************************* -// -// Flag Reason Vers Date Coder Description -// ---- --------- ---- -------- ----- ------------------------------- -// D49127.12 v4r1 02/13/97 DRG Initial Creation -// p4902214 v4r1 05/09/97 DRG Added service data parm to Reset -// -// End Change Log ***************************************************** diff --git a/src/usr/diag/prdf/common/framework/register/iipscr.C b/src/usr/diag/prdf/common/framework/register/iipscr.C index 0462f2a51..af067a421 100755 --- a/src/usr/diag/prdf/common/framework/register/iipscr.C +++ b/src/usr/diag/prdf/common/framework/register/iipscr.C @@ -79,6 +79,9 @@ // // End Function Specification ////////////////////////////////////// +namespace PRDF +{ + SCAN_COMM_REGISTER_CLASS::~SCAN_COMM_REGISTER_CLASS ( void @@ -283,4 +286,6 @@ address(a) { } +} // end namespace PRDF + #undef IIPSCR_C diff --git a/src/usr/diag/prdf/common/framework/register/iipscr.h b/src/usr/diag/prdf/common/framework/register/iipscr.h index cd4fb4f83..d8fe942a0 100755 --- a/src/usr/diag/prdf/common/framework/register/iipscr.h +++ b/src/usr/diag/prdf/common/framework/register/iipscr.h @@ -48,6 +48,8 @@ #include <iipsdbug.h> #include <prdfMain.H> +namespace PRDF +{ /*--------------------------------------------------------------------*/ /* Forward References */ @@ -273,7 +275,7 @@ public: */ virtual const BIT_STRING_CLASS * GetBitString(ATTENTION_TYPE - i_type = PRDF::INVALID_ATTENTION_TYPE + i_type = INVALID_ATTENTION_TYPE ) const = 0; /** @@ -442,4 +444,6 @@ private: // Data }; +} // end namespace PRDF + #endif diff --git a/src/usr/diag/prdf/common/framework/register/prdfCaptureData.C b/src/usr/diag/prdf/common/framework/register/prdfCaptureData.C index 29b62f596..f4ff1e4d0 100755 --- a/src/usr/diag/prdf/common/framework/register/prdfCaptureData.C +++ b/src/usr/diag/prdf/common/framework/register/prdfCaptureData.C @@ -64,6 +64,9 @@ #include <algorithm> // @jl04 a Add this for the Drop function. +namespace PRDF +{ + //--------------------------------------------------------------------- // Member Function Specifications //--------------------------------------------------------------------- @@ -158,7 +161,7 @@ void CaptureData::Add( TARGETING::TargetHandle_t i_pchipHandle, int iScomId, uint64_t iScomAddress, uint32_t iScomBitLength, Place iplace ) { - PRDF::HomRegisterAccessScom hops(i_pchipHandle); + HomRegisterAccessScom hops(i_pchipHandle); ScanCommRegisterChip scrc(iScomAddress, iScomBitLength, hops); Add(i_pchipHandle, iScomId, scrc, iplace); @@ -237,7 +240,6 @@ void CaptureData::AddDataElement( Data & dataElement, unsigned int CaptureData::Copy(uint8_t *i_buffer, unsigned int i_bufferSize) const { using namespace TARGETING; - using namespace PRDF; TargetHandle_t l_pcurrentChipHandle =NULL ; uint8_t * l_entryCountPos = NULL; @@ -336,12 +338,11 @@ unsigned int CaptureData::Copy(uint8_t *i_buffer, unsigned int i_bufferSize) con CaptureData & CaptureData::operator=(const uint8_t *i_flatdata) { using namespace TARGETING; - using namespace PRDF; uint32_t l_tmp32 = 0; uint16_t l_tmp16 = 0; - HUID l_chipHuid =PRDF::INVALID_HUID ; + HUID l_chipHuid = INVALID_HUID; const size_t l_huidSize = sizeof(l_chipHuid); // Read size. @@ -386,7 +387,7 @@ CaptureData & CaptureData::operator=(const uint8_t *i_flatdata) uint32_t bytecount = ntohs(l_tmp16); // Read data for register. - prdfBitStringBuffer bs(bytecount * 8); + BitStringBuffer bs(bytecount * 8); for(uint32_t bc = 0; bc < bytecount; ++bc) { bs.SetFieldJustify(bc*8,8,(CPU_WORD)(*(i_flatdata+bc))); //mp01a @@ -434,3 +435,5 @@ CaptureData::Data & CaptureData::Data::operator=(const Data & d) return *this; } + +} // end of namespace PRDF diff --git a/src/usr/diag/prdf/common/framework/register/prdfErrorRegister.C b/src/usr/diag/prdf/common/framework/register/prdfErrorRegister.C index 9d5488678..caebb8baf 100755 --- a/src/usr/diag/prdf/common/framework/register/prdfErrorRegister.C +++ b/src/usr/diag/prdf/common/framework/register/prdfErrorRegister.C @@ -49,6 +49,10 @@ #include <iipconst.h> #include <iipglobl.h> #undef iipErrorRegister_C + +namespace PRDF +{ + //---------------------------------------------------------------------- // User Types //---------------------------------------------------------------------- @@ -73,10 +77,9 @@ // Member Function Specifications //--------------------------------------------------------------------- -int32_t ErrorRegister::SetErrorSignature(STEP_CODE_DATA_STRUCT & error,prdfBitKey & bl) +int32_t ErrorRegister::SetErrorSignature( STEP_CODE_DATA_STRUCT & error, + BitKey & bl ) { - using namespace PRDF; - int32_t rc = SUCCESS; ErrorSignature * esig = error.service_data->GetErrorSignature(); uint32_t blen = bl.size(); @@ -103,20 +106,19 @@ int32_t ErrorRegister::SetErrorSignature(STEP_CODE_DATA_STRUCT & error,prdfBitKe /*---------------------------------------------------------------------*/ -ErrorRegister::ErrorRegister -(SCAN_COMM_REGISTER_CLASS & r, prdfResolutionMap & rm, uint16_t scrId) -: ErrorRegisterType(), scr(r), scr_rc(SUCCESS), rMap(rm), xNoErrorOnZeroScr(false), xScrId(scrId) +ErrorRegister::ErrorRegister( SCAN_COMM_REGISTER_CLASS & r, ResolutionMap & rm, + uint16_t scrId ) : + ErrorRegisterType(), scr(r), scr_rc(SUCCESS), rMap(rm), + xNoErrorOnZeroScr(false), xScrId(scrId) { - PRDF_ASSERT(&r != NULL); - PRDF_ASSERT(&rm != NULL); + PRDF_ASSERT( &r != NULL ); + PRDF_ASSERT( &rm != NULL ); } /*---------------------------------------------------------------------*/ int32_t ErrorRegister::Analyze(STEP_CODE_DATA_STRUCT & error) { - using namespace PRDF; - int32_t rc = SUCCESS; uint32_t l_savedErrSig = 0; // @pw01 @@ -132,7 +134,7 @@ int32_t ErrorRegister::Analyze(STEP_CODE_DATA_STRUCT & error) // Get Data from hardware const BIT_STRING_CLASS &bs = Read(error.service_data->GetCauseAttentionType()); // @pw02 - prdfBitKey bl; // null bit list has length 0 + BitKey bl; // null bit list has length 0 if (scr_rc == SUCCESS) { @@ -195,24 +197,24 @@ const BIT_STRING_CLASS & ErrorRegister::Read(ATTENTION_TYPE i_attn) /*---------------------------------------------------------------------*/ -prdfBitKey ErrorRegister::Filter +BitKey ErrorRegister::Filter (const BIT_STRING_CLASS & bs) { - prdfBitKey bit_list; + BitKey bit_list; bit_list = bs; return(bit_list); } /*---------------------------------------------------------------------*/ -int32_t ErrorRegister::Lookup(STEP_CODE_DATA_STRUCT & sdc, prdfBitKey & bl) // dg02c dg03c +int32_t ErrorRegister::Lookup(STEP_CODE_DATA_STRUCT & sdc, BitKey & bl) // dg02c dg03c { int32_t rc = SUCCESS; // if (bl.GetListLength() == 0) return(rMap.GetDefault()); /dg00d - prdfResolutionList rList; + ResolutionList rList; rMap.LookUp(rList,bl,sdc); // dg04c // SetErrorSignature(sdc,bl); // LookUp may have changed bl dg02a dg04d - for(prdfResolutionList::iterator i = rList.begin(); i != rList.end(); ++i) + for(ResolutionList::iterator i = rList.begin(); i != rList.end(); ++i) { rc |= (*i)->Resolve(sdc); } @@ -221,7 +223,10 @@ int32_t ErrorRegister::Lookup(STEP_CODE_DATA_STRUCT & sdc, prdfBitKey & bl) // d /*---------------------------------------------------------------------*/ -int32_t ErrorRegister::Reset(const prdfBitKey & bit_list, STEP_CODE_DATA_STRUCT & error) +int32_t ErrorRegister::Reset(const BitKey & bit_list, STEP_CODE_DATA_STRUCT & error) { return(SUCCESS); } + +} // end namespace PRDF + diff --git a/src/usr/diag/prdf/common/framework/register/prdfErrorRegisterMask.C b/src/usr/diag/prdf/common/framework/register/prdfErrorRegisterMask.C index 680dfde66..febc23d5e 100755 --- a/src/usr/diag/prdf/common/framework/register/prdfErrorRegisterMask.C +++ b/src/usr/diag/prdf/common/framework/register/prdfErrorRegisterMask.C @@ -42,6 +42,9 @@ #include <iipServiceDataCollector.h> #undef prdfErrorRegisterMask_C + +namespace PRDF +{ //---------------------------------------------------------------------- // User Types //---------------------------------------------------------------------- @@ -159,7 +162,7 @@ BIT_LIST_CLASS ErrorRegisterFilter::Filter return bit_list; } - +} //End namespace PRDF // Change Log ********************************************************* // diff --git a/src/usr/diag/prdf/common/framework/register/prdfOperatorRegister.H b/src/usr/diag/prdf/common/framework/register/prdfOperatorRegister.H index 266999f25..88aca651b 100755 --- a/src/usr/diag/prdf/common/framework/register/prdfOperatorRegister.H +++ b/src/usr/diag/prdf/common/framework/register/prdfOperatorRegister.H @@ -29,23 +29,26 @@ #include <iipscr.h> #include <prdrCommon.H> -class PrdfNotRegister : public SCAN_COMM_REGISTER_CLASS +namespace PRDF +{ + +class NotRegister : public SCAN_COMM_REGISTER_CLASS { public: - PrdfNotRegister() : + NotRegister() : SCAN_COMM_REGISTER_CLASS(0), iv_child(NULL), iv_iBS(0) { iv_bs = &iv_iBS; } - PrdfNotRegister(SCAN_COMM_REGISTER_CLASS & i_arg) : + NotRegister(SCAN_COMM_REGISTER_CLASS & i_arg) : SCAN_COMM_REGISTER_CLASS(0), iv_child(&i_arg), iv_iBS(i_arg.GetBitString()->GetLength()) { iv_bs = &iv_iBS; } - PrdfNotRegister & operator=(const PrdfNotRegister & r) + NotRegister & operator=(const NotRegister & r) { iv_child = r.iv_child; iv_iBS = r.iv_iBS; @@ -57,7 +60,7 @@ class PrdfNotRegister : public SCAN_COMM_REGISTER_CLASS virtual uint32_t Write() { return iv_child->Write(); } const BIT_STRING_CLASS * GetBitString( - ATTENTION_TYPE i_type = PRDF::INVALID_ATTENTION_TYPE) const + ATTENTION_TYPE i_type = INVALID_ATTENTION_TYPE) const { (*iv_bs) = ~(*iv_child->GetBitString(i_type)); return iv_bs; @@ -66,13 +69,13 @@ class PrdfNotRegister : public SCAN_COMM_REGISTER_CLASS virtual uint16_t GetId() const { return iv_child->GetId(); } virtual void SetId(uint16_t i_id) {} - bool operator==(const PrdfNotRegister & r) const + bool operator==(const NotRegister & r) const { return r.iv_child == iv_child; } - bool operator<(const PrdfNotRegister & r) const + bool operator<(const NotRegister & r) const { return iv_child < r.iv_child; } - bool operator>=(const PrdfNotRegister & r) const + bool operator>=(const NotRegister & r) const { return iv_child >= r.iv_child; } protected: @@ -82,27 +85,27 @@ class PrdfNotRegister : public SCAN_COMM_REGISTER_CLASS private: SCAN_COMM_REGISTER_CLASS * iv_child; - prdfBitStringBuffer * iv_bs; - prdfBitStringBuffer iv_iBS; + BitStringBuffer * iv_bs; + BitStringBuffer iv_iBS; }; -class PrdfLeftShiftRegister : public SCAN_COMM_REGISTER_CLASS +class LeftShiftRegister : public SCAN_COMM_REGISTER_CLASS { public: - PrdfLeftShiftRegister() : + LeftShiftRegister() : SCAN_COMM_REGISTER_CLASS(0), iv_child(NULL), iv_amount(0), iv_iBS(0) { iv_bs = &iv_iBS; } - PrdfLeftShiftRegister(SCAN_COMM_REGISTER_CLASS & i_arg, uint16_t i_amount) : + LeftShiftRegister(SCAN_COMM_REGISTER_CLASS & i_arg, uint16_t i_amount) : SCAN_COMM_REGISTER_CLASS(0), iv_child(&i_arg), iv_amount(i_amount), iv_iBS(i_arg.GetBitString()->GetLength()) { iv_bs = &iv_iBS; } - PrdfLeftShiftRegister & operator=(const PrdfLeftShiftRegister & r) + LeftShiftRegister & operator=(const LeftShiftRegister & r) { iv_child = r.iv_child; iv_amount = r.iv_amount; @@ -115,7 +118,7 @@ class PrdfLeftShiftRegister : public SCAN_COMM_REGISTER_CLASS virtual uint32_t Write() { return iv_child->Write(); } const BIT_STRING_CLASS * GetBitString( - ATTENTION_TYPE i_type = PRDF::INVALID_ATTENTION_TYPE) const + ATTENTION_TYPE i_type = INVALID_ATTENTION_TYPE) const { (*iv_bs) = (*iv_child->GetBitString(i_type)) << iv_amount; return iv_bs; @@ -124,17 +127,17 @@ class PrdfLeftShiftRegister : public SCAN_COMM_REGISTER_CLASS virtual uint16_t GetId() const { return iv_child->GetId(); } virtual void SetId(uint16_t i_id) {} - bool operator==(const PrdfLeftShiftRegister & r) const + bool operator==(const LeftShiftRegister & r) const { return (r.iv_child == iv_child) && (r.iv_amount == iv_amount); } - bool operator<(const PrdfLeftShiftRegister & r) const + bool operator<(const LeftShiftRegister & r) const { if (iv_child == r.iv_child) return iv_amount < r.iv_amount; return iv_child < r.iv_child; } - bool operator>=(const PrdfLeftShiftRegister & r) const + bool operator>=(const LeftShiftRegister & r) const { if (iv_child == r.iv_child) return iv_amount >= r.iv_amount; @@ -149,28 +152,27 @@ class PrdfLeftShiftRegister : public SCAN_COMM_REGISTER_CLASS SCAN_COMM_REGISTER_CLASS * iv_child; uint16_t iv_amount; - prdfBitStringBuffer * iv_bs; - prdfBitStringBuffer iv_iBS; + BitStringBuffer * iv_bs; + BitStringBuffer iv_iBS; }; -class PrdfRightShiftRegister : public SCAN_COMM_REGISTER_CLASS +class RightShiftRegister : public SCAN_COMM_REGISTER_CLASS { public: - PrdfRightShiftRegister() : + RightShiftRegister() : SCAN_COMM_REGISTER_CLASS(0), iv_child(NULL), iv_amount(0), iv_iBS(0) { iv_bs = &iv_iBS; } - PrdfRightShiftRegister(SCAN_COMM_REGISTER_CLASS & i_arg, - uint16_t i_amount) : + RightShiftRegister(SCAN_COMM_REGISTER_CLASS & i_arg, uint16_t i_amount) : SCAN_COMM_REGISTER_CLASS(0), iv_child(&i_arg), iv_amount(i_amount), iv_iBS(i_arg.GetBitString()->GetLength()) { iv_bs = &iv_iBS; } - PrdfRightShiftRegister & operator=(const PrdfRightShiftRegister & r) + RightShiftRegister & operator=(const RightShiftRegister & r) { iv_child = r.iv_child; iv_amount = r.iv_amount; @@ -183,7 +185,7 @@ class PrdfRightShiftRegister : public SCAN_COMM_REGISTER_CLASS virtual uint32_t Write() { return iv_child->Write(); } const BIT_STRING_CLASS * GetBitString( - ATTENTION_TYPE i_type = PRDF::INVALID_ATTENTION_TYPE) const + ATTENTION_TYPE i_type = INVALID_ATTENTION_TYPE) const { (*iv_bs) = (*iv_child->GetBitString(i_type)) >> iv_amount; return iv_bs; @@ -192,17 +194,17 @@ class PrdfRightShiftRegister : public SCAN_COMM_REGISTER_CLASS virtual uint16_t GetId() const { return iv_child->GetId(); } virtual void SetId(uint16_t i_id) {} - bool operator==(const PrdfRightShiftRegister & r) const + bool operator==(const RightShiftRegister & r) const { return (r.iv_child == iv_child) && (r.iv_amount == iv_amount); } - bool operator<(const PrdfRightShiftRegister & r) const + bool operator<(const RightShiftRegister & r) const { if (iv_child == r.iv_child) return iv_amount < r.iv_amount; return iv_child < r.iv_child; } - bool operator>=(const PrdfRightShiftRegister & r) const + bool operator>=(const RightShiftRegister & r) const { if (iv_child == r.iv_child) return iv_amount >= r.iv_amount; @@ -217,22 +219,22 @@ class PrdfRightShiftRegister : public SCAN_COMM_REGISTER_CLASS SCAN_COMM_REGISTER_CLASS * iv_child; uint16_t iv_amount; - prdfBitStringBuffer * iv_bs; - prdfBitStringBuffer iv_iBS; + BitStringBuffer * iv_bs; + BitStringBuffer iv_iBS; }; -class PrdfAndRegister : public SCAN_COMM_REGISTER_CLASS +class AndRegister : public SCAN_COMM_REGISTER_CLASS { public: - PrdfAndRegister() : + AndRegister() : SCAN_COMM_REGISTER_CLASS(0), iv_left(NULL), iv_right(NULL), iv_iBS(0) { iv_bs = &iv_iBS; } - PrdfAndRegister(SCAN_COMM_REGISTER_CLASS & i_left, - SCAN_COMM_REGISTER_CLASS & i_right) : + AndRegister( SCAN_COMM_REGISTER_CLASS & i_left, + SCAN_COMM_REGISTER_CLASS & i_right ) : SCAN_COMM_REGISTER_CLASS(0), iv_left(&i_left), iv_right(&i_right), iv_iBS(std::min(i_left.GetBitString()->GetLength(), i_right.GetBitString()->GetLength())) @@ -240,7 +242,7 @@ class PrdfAndRegister : public SCAN_COMM_REGISTER_CLASS iv_bs = &iv_iBS; } - PrdfAndRegister & operator=(const PrdfAndRegister & r) + AndRegister & operator=(const AndRegister & r) { iv_left = r.iv_left; iv_right = r.iv_right; @@ -259,7 +261,7 @@ class PrdfAndRegister : public SCAN_COMM_REGISTER_CLASS } const BIT_STRING_CLASS * GetBitString( - ATTENTION_TYPE i_type = PRDF::INVALID_ATTENTION_TYPE) const + ATTENTION_TYPE i_type = INVALID_ATTENTION_TYPE) const { (*iv_bs) = *iv_left->GetBitString(i_type); (*iv_bs) = (*iv_bs) & (*iv_right->GetBitString(i_type)); @@ -268,23 +270,23 @@ class PrdfAndRegister : public SCAN_COMM_REGISTER_CLASS virtual uint16_t GetId() const { - return Prdr::PrdrSignatureOp::combineSig(iv_left->GetId(), - iv_right->GetId()); + return Prdr::SignatureOp::combineSig(iv_left->GetId(), + iv_right->GetId()); } virtual void SetId(uint16_t i_id) {} - bool operator==(const PrdfAndRegister & r) const + bool operator==(const AndRegister & r) const { return (r.iv_left == iv_left) && (r.iv_right == iv_right); } - bool operator<(const PrdfAndRegister & r) const + bool operator<(const AndRegister & r) const { if (iv_left == r.iv_left) return iv_right < r.iv_right; return iv_left < r.iv_left; } - bool operator>=(const PrdfAndRegister & r) const + bool operator>=(const AndRegister & r) const { if (iv_left == r.iv_left) return iv_right >= r.iv_right; @@ -299,21 +301,22 @@ class PrdfAndRegister : public SCAN_COMM_REGISTER_CLASS SCAN_COMM_REGISTER_CLASS * iv_left; SCAN_COMM_REGISTER_CLASS * iv_right; - prdfBitStringBuffer * iv_bs; - prdfBitStringBuffer iv_iBS; + BitStringBuffer * iv_bs; + BitStringBuffer iv_iBS; }; -class PrdfOrRegister : public SCAN_COMM_REGISTER_CLASS +class OrRegister : public SCAN_COMM_REGISTER_CLASS { public: - PrdfOrRegister() : + + OrRegister() : SCAN_COMM_REGISTER_CLASS(0), iv_left(NULL), iv_right(NULL), iv_iBS(0) { iv_bs = &iv_iBS; } - PrdfOrRegister(SCAN_COMM_REGISTER_CLASS & i_left, - SCAN_COMM_REGISTER_CLASS & i_right) : + OrRegister( SCAN_COMM_REGISTER_CLASS & i_left, + SCAN_COMM_REGISTER_CLASS & i_right ) : SCAN_COMM_REGISTER_CLASS(0), iv_left(&i_left), iv_right(&i_right), iv_iBS(std::min(i_left.GetBitString()->GetLength(), i_right.GetBitString()->GetLength())) @@ -321,7 +324,7 @@ class PrdfOrRegister : public SCAN_COMM_REGISTER_CLASS iv_bs = &iv_iBS; } - PrdfOrRegister & operator=(const PrdfOrRegister & r) + OrRegister & operator=(const OrRegister & r) { iv_left = r.iv_left; iv_right = r.iv_right; @@ -334,13 +337,14 @@ class PrdfOrRegister : public SCAN_COMM_REGISTER_CLASS { return iv_left->Read() | iv_right->Read(); } + virtual uint32_t Write() { return iv_left->Write() | iv_right->Write(); } const BIT_STRING_CLASS * GetBitString( - ATTENTION_TYPE i_type = PRDF::INVALID_ATTENTION_TYPE) const + ATTENTION_TYPE i_type = INVALID_ATTENTION_TYPE ) const { (*iv_bs) = *iv_left->GetBitString(i_type); (*iv_bs) = (*iv_bs) | (*iv_right->GetBitString(i_type)); @@ -349,23 +353,23 @@ class PrdfOrRegister : public SCAN_COMM_REGISTER_CLASS virtual uint16_t GetId() const { - return Prdr::PrdrSignatureOp::combineSig(iv_left->GetId(), - iv_right->GetId()); + return Prdr::SignatureOp::combineSig( iv_left->GetId(), + iv_right->GetId() ); } virtual void SetId(uint16_t i_id) {} - bool operator==(const PrdfOrRegister & r) const + bool operator==(const OrRegister & r) const { return (r.iv_left == iv_left) && (r.iv_right == iv_right); } - bool operator<(const PrdfOrRegister & r) const + bool operator<(const OrRegister & r) const { if (iv_left == r.iv_left) return iv_right < r.iv_right; return iv_left < r.iv_left; } - bool operator>=(const PrdfOrRegister & r) const + bool operator>=(const OrRegister & r) const { if (iv_left == r.iv_left) return iv_right >= r.iv_right; @@ -380,18 +384,18 @@ class PrdfOrRegister : public SCAN_COMM_REGISTER_CLASS SCAN_COMM_REGISTER_CLASS * iv_left; SCAN_COMM_REGISTER_CLASS * iv_right; - prdfBitStringBuffer * iv_bs; - prdfBitStringBuffer iv_iBS; + BitStringBuffer * iv_bs; + BitStringBuffer iv_iBS; }; -class PrdfNullRegister : public SCAN_COMM_REGISTER_CLASS +class NullRegister : public SCAN_COMM_REGISTER_CLASS { public: - PrdfNullRegister(int size) : + NullRegister(int size) : SCAN_COMM_REGISTER_CLASS(0), iv_iBS(size) {} - PrdfNullRegister & operator=(const PrdfNullRegister & r) + NullRegister & operator=(const NullRegister & r) { iv_iBS = r.iv_iBS; return *this; @@ -401,7 +405,7 @@ class PrdfNullRegister : public SCAN_COMM_REGISTER_CLASS virtual uint32_t Write() { return 0; } const BIT_STRING_CLASS * GetBitString( - ATTENTION_TYPE i_type = PRDF::INVALID_ATTENTION_TYPE) const + ATTENTION_TYPE i_type = INVALID_ATTENTION_TYPE) const { return &iv_iBS; } @@ -411,29 +415,29 @@ class PrdfNullRegister : public SCAN_COMM_REGISTER_CLASS void SetBitString(const BIT_STRING_CLASS *) {} private: - prdfBitStringBuffer iv_iBS; + BitStringBuffer iv_iBS; virtual uint16_t GetId() const - { return Prdr::PrdrSignatureOp::DEFAULT_SIGNATURE; } + { return Prdr::SignatureOp::DEFAULT_SIGNATURE; } virtual void SetId(uint16_t i_id) {} }; -class PrdfAttnTypeRegister : public SCAN_COMM_REGISTER_CLASS +class AttnTypeRegister : public SCAN_COMM_REGISTER_CLASS { public: - PrdfAttnTypeRegister() : + AttnTypeRegister() : SCAN_COMM_REGISTER_CLASS(0), iv_check(&cv_null), iv_recov(&cv_null), iv_special(&cv_null), iv_proccs(&cv_null), iv_iBS(0) { iv_bs = &iv_iBS; } - PrdfAttnTypeRegister( SCAN_COMM_REGISTER_CLASS & i_check, - SCAN_COMM_REGISTER_CLASS & i_recov, - SCAN_COMM_REGISTER_CLASS & i_special, - SCAN_COMM_REGISTER_CLASS & i_proccs ) : + AttnTypeRegister( SCAN_COMM_REGISTER_CLASS & i_check, + SCAN_COMM_REGISTER_CLASS & i_recov, + SCAN_COMM_REGISTER_CLASS & i_special, + SCAN_COMM_REGISTER_CLASS & i_proccs ) : SCAN_COMM_REGISTER_CLASS(0), iv_check( NULL == &i_check ? &cv_null : &i_check), iv_recov( NULL == &i_recov ? &cv_null : &i_recov), @@ -446,17 +450,17 @@ class PrdfAttnTypeRegister : public SCAN_COMM_REGISTER_CLASS l_length = std::min(l_length, iv_recov->GetBitString()->GetLength()); l_length = std::min(l_length, iv_special->GetBitString()->GetLength()); l_length = std::min(l_length, iv_proccs->GetBitString()->GetLength()); - iv_iBS = prdfBitStringBuffer(l_length); + iv_iBS = BitStringBuffer(l_length); iv_bs = &iv_iBS; } - PrdfAttnTypeRegister & operator=(const PrdfAttnTypeRegister & r) + AttnTypeRegister & operator=(const AttnTypeRegister & r) { //iv_null = r.iv_null; <-- don't do this! - iv_check = (r.iv_check == &r.cv_null ? &cv_null : r.iv_check); - iv_recov = (r.iv_recov == &r.cv_null ? &cv_null : r.iv_recov); + iv_check = (r.iv_check == &r.cv_null ? &cv_null : r.iv_check); + iv_recov = (r.iv_recov == &r.cv_null ? &cv_null : r.iv_recov); iv_special = (r.iv_special == &r.cv_null ? &cv_null : r.iv_special); - iv_proccs = (r.iv_proccs == &r.cv_null ? &cv_null : r.iv_proccs); + iv_proccs = (r.iv_proccs == &r.cv_null ? &cv_null : r.iv_proccs); iv_iBS = r.iv_iBS; //iv_bs = r.iv_bs; <-- don't do this! return *this; @@ -475,9 +479,8 @@ class PrdfAttnTypeRegister : public SCAN_COMM_REGISTER_CLASS } const BIT_STRING_CLASS * GetBitString( - ATTENTION_TYPE i_type = PRDF::INVALID_ATTENTION_TYPE) const + ATTENTION_TYPE i_type = INVALID_ATTENTION_TYPE) const { - using namespace PRDF; switch (i_type) { case CHECK_STOP: @@ -506,20 +509,19 @@ class PrdfAttnTypeRegister : public SCAN_COMM_REGISTER_CLASS virtual uint16_t GetId() const { - using Prdr::PrdrSignatureOp; - uint16_t l_rc = PrdrSignatureOp::DEFAULT_SIGNATURE; - l_rc = PrdrSignatureOp::combineSig(l_rc, iv_check->GetId()); - l_rc = PrdrSignatureOp::combineSig(l_rc, iv_recov->GetId()); - l_rc = PrdrSignatureOp::combineSig(l_rc, iv_special->GetId()); - l_rc = PrdrSignatureOp::combineSig(l_rc, iv_proccs->GetId()); + uint16_t l_rc = Prdr::SignatureOp::DEFAULT_SIGNATURE; + l_rc = Prdr::SignatureOp::combineSig(l_rc, iv_check->GetId()); + l_rc = Prdr::SignatureOp::combineSig(l_rc, iv_recov->GetId()); + l_rc = Prdr::SignatureOp::combineSig(l_rc, iv_special->GetId()); + l_rc = Prdr::SignatureOp::combineSig(l_rc, iv_proccs->GetId()); return l_rc; } virtual void SetId(uint16_t i_id) {} - bool operator==(const PrdfAttnTypeRegister & r) const + bool operator==(const AttnTypeRegister & r) const { - return (r.iv_check == iv_check) && (r.iv_recov == iv_recov) && + return (r.iv_check == iv_check) && (r.iv_recov == iv_recov) && (r.iv_special == iv_special) && (r.iv_proccs == iv_proccs); } @@ -528,29 +530,29 @@ class PrdfAttnTypeRegister : public SCAN_COMM_REGISTER_CLASS void SetBitString(const BIT_STRING_CLASS *) {} private: - static PrdfNullRegister cv_null; + static NullRegister cv_null; SCAN_COMM_REGISTER_CLASS * iv_check; SCAN_COMM_REGISTER_CLASS * iv_recov; SCAN_COMM_REGISTER_CLASS * iv_special; SCAN_COMM_REGISTER_CLASS * iv_proccs; - prdfBitStringBuffer * iv_bs; - prdfBitStringBuffer iv_iBS; + BitStringBuffer * iv_bs; + BitStringBuffer iv_iBS; }; -class PrdfConstantRegister : public SCAN_COMM_REGISTER_CLASS +class ConstantRegister : public SCAN_COMM_REGISTER_CLASS { public: - PrdfConstantRegister() : + ConstantRegister() : SCAN_COMM_REGISTER_CLASS(0), iv_iBS(0) {} - PrdfConstantRegister(BIT_STRING_CLASS i_arg) : + ConstantRegister(BIT_STRING_CLASS i_arg) : SCAN_COMM_REGISTER_CLASS(0), iv_iBS(i_arg) {} - PrdfConstantRegister & operator=(const PrdfConstantRegister & r) + ConstantRegister & operator=(const ConstantRegister & r) { iv_iBS = r.iv_iBS; return *this; @@ -560,17 +562,17 @@ class PrdfConstantRegister : public SCAN_COMM_REGISTER_CLASS virtual uint32_t Write() { return SUCCESS; } const BIT_STRING_CLASS * GetBitString( - ATTENTION_TYPE i_type = PRDF::INVALID_ATTENTION_TYPE) const + ATTENTION_TYPE i_type = INVALID_ATTENTION_TYPE) const { return &iv_iBS; } virtual uint16_t GetId() const - { return Prdr::PrdrSignatureOp::DEFAULT_SIGNATURE; } + { return Prdr::SignatureOp::DEFAULT_SIGNATURE; } virtual void SetId(uint16_t i_id) {} - bool operator==(const PrdfConstantRegister & r) const + bool operator==(const ConstantRegister & r) const { return r.iv_iBS == iv_iBS; } protected: @@ -578,7 +580,9 @@ class PrdfConstantRegister : public SCAN_COMM_REGISTER_CLASS void SetBitString(const BIT_STRING_CLASS *) {} private: - prdfBitStringBuffer iv_iBS; + BitStringBuffer iv_iBS; }; +} // end namespace PRDF + #endif diff --git a/src/usr/diag/prdf/common/framework/register/prdfResetErrorRegister.C b/src/usr/diag/prdf/common/framework/register/prdfResetErrorRegister.C index 0f0a6deec..64e8a2e01 100755 --- a/src/usr/diag/prdf/common/framework/register/prdfResetErrorRegister.C +++ b/src/usr/diag/prdf/common/framework/register/prdfResetErrorRegister.C @@ -51,6 +51,9 @@ // User Types //---------------------------------------------------------------------- +namespace PRDF +{ + //---------------------------------------------------------------------- // Constants //---------------------------------------------------------------------- @@ -70,7 +73,7 @@ //--------------------------------------------------------------------- // Member Function Specifications //--------------------------------------------------------------------- -int32_t ResetErrorRegister::Reset(const prdfBitKey & bit_list, +int32_t ResetErrorRegister::Reset(const BitKey & bit_list, STEP_CODE_DATA_STRUCT & error) { #ifndef __HOSTBOOT_MODULE @@ -99,10 +102,9 @@ int32_t ResetErrorRegister::Reset(const prdfBitKey & bit_list, // Reset and Mask error registers. int32_t -ResetAndMaskErrorRegister::Reset(const prdfBitKey & bit_list, +ResetAndMaskErrorRegister::Reset(const BitKey & bit_list, STEP_CODE_DATA_STRUCT & error) { - using namespace PRDF; int32_t rc = SUCCESS; // Don't do reset on CS. if ((CHECK_STOP != error.service_data->GetAttentionType()) && //@pw01 @@ -141,7 +143,7 @@ ResetAndMaskErrorRegister::Reset(const prdfBitKey & bit_list, // ---------------------------------------------------------------------- -int32_t XorResetErrorRegister::Reset(const prdfBitKey & bit_list, +int32_t XorResetErrorRegister::Reset(const BitKey & bit_list, STEP_CODE_DATA_STRUCT & error) { #ifndef __HOSTBOOT_MODULE @@ -171,7 +173,7 @@ int32_t XorResetErrorRegister::Reset(const prdfBitKey & bit_list, // ----------------------------------------------------------------------- -int32_t AndResetErrorRegister::Reset(const prdfBitKey & bit_list, +int32_t AndResetErrorRegister::Reset(const BitKey & bit_list, STEP_CODE_DATA_STRUCT & error) { #ifndef __HOSTBOOT_MODULE @@ -197,3 +199,5 @@ int32_t AndResetErrorRegister::Reset(const prdfBitKey & bit_list, } return rc; } + +} //End namespace PRDF diff --git a/src/usr/diag/prdf/common/framework/register/prdfResetOperators.H b/src/usr/diag/prdf/common/framework/register/prdfResetOperators.H index cd6985831..1804f0b6b 100755 --- a/src/usr/diag/prdf/common/framework/register/prdfResetOperators.H +++ b/src/usr/diag/prdf/common/framework/register/prdfResetOperators.H @@ -36,6 +36,9 @@ #include <iipscr.h> #include <iipconst.h> +namespace PRDF +{ + /** * @class RegisterResetOperator * Interface class for reset operators. (pure virtual) @@ -315,16 +318,7 @@ class NotOperator : public RegisterResetOperator } }; +} // end namespace PRDF #endif -// Change Log ********************************************************* -// -// Flag Reason Vers Date Coder Description -// ---- -------- ---- -------- -------- ------------------------------- -// F510901 f300 07/15/05 iawillia Initial file creation. -// F523598 f300 10/04/05 iawillia Add AndOperator. Fix Or. -// F537132 f300 02/20/06 iawillia Add RMW mask register. -// F545881 f300 04/19/06 dgilbert Add #include <iipscr.h> -// zs01 D620028 f330 07/25/07 zshelle Support for mcp5 compiler -// End Change Log ***************************************************** diff --git a/src/usr/diag/prdf/common/framework/register/prdfScanFacility.C b/src/usr/diag/prdf/common/framework/register/prdfScanFacility.C index 5228f9a87..310d37a98 100755 --- a/src/usr/diag/prdf/common/framework/register/prdfScanFacility.C +++ b/src/usr/diag/prdf/common/framework/register/prdfScanFacility.C @@ -37,6 +37,9 @@ #undef prdfScanFacility_C +namespace PRDF +{ + //---------------------------------------------------------------------- // Constants //---------------------------------------------------------------------- @@ -71,8 +74,8 @@ bool operator<(const ScanCommRegisterChip & scrc1, const ScanCommRegisterChip & //---------------------------------------------------------------------- // Global Variables //---------------------------------------------------------------------- -PrdfNullRegister PrdfAttnTypeRegister::cv_null(1024); //@01 +NullRegister AttnTypeRegister::cv_null(1024); //--------------------------------------------------------------------- // Member Function Specifications @@ -86,23 +89,21 @@ ScanFacility & ScanFacility::Access(void) static ScanFacility sf; return sf; } -//------------------------------------------------------------------------------------------------- +//------------------------------------------------------------------------------ SCAN_COMM_REGISTER_CLASS & ScanFacility::GetScanCommRegister(TARGETING::TargetHandle_t i_ptargetHandle, uint64_t address, uint32_t bitLength) { - using namespace PRDF; HomRegisterAccessScom hraKey(i_ptargetHandle); HomRegisterAccessScom & hra = iv_scomAccessFw.get(hraKey); ScanCommRegisterChip scrKey(address,bitLength,hra); return iv_scomRegFw.get(scrKey); } -//------------------------------------------------------------------------------------------------- +//------------------------------------------------------------------------------ SCAN_COMM_REGISTER_CLASS & ScanFacility::GetScanRingRegister(TARGETING::TargetHandle_t i_ptargetHandle, - PRDF::ScanRingField * start, - PRDF::ScanRingField * end) + ScanRingField * start, + ScanRingField * end) { - using namespace PRDF; uint32_t bitLength = 0; for(ScanRingField * srf = start; srf != end; ++srf) { @@ -114,66 +115,68 @@ SCAN_COMM_REGISTER_CLASS & ScanFacility::GetScanRingRegister(TARGETING::TargetHa return iv_scomRegFw.get(scrKey); } -//------------------------------------------------------------------------------------------------- +//------------------------------------------------------------------------------ SCAN_COMM_REGISTER_CLASS & ScanFacility::GetNotRegister(SCAN_COMM_REGISTER_CLASS & i_arg) { - PrdfNotRegister r(i_arg); + NotRegister r(i_arg); return iv_notRegFw.get(r); } -//------------------------------------------------------------------------------------------------- +//------------------------------------------------------------------------------ SCAN_COMM_REGISTER_CLASS & ScanFacility::GetLeftShiftRegister(SCAN_COMM_REGISTER_CLASS & i_arg, uint16_t i_amount) { - PrdfLeftShiftRegister r(i_arg, i_amount); + LeftShiftRegister r(i_arg, i_amount); return iv_leftRegFw.get(r); } -//------------------------------------------------------------------------------------------------- +//------------------------------------------------------------------------------ SCAN_COMM_REGISTER_CLASS & ScanFacility::GetRightShiftRegister(SCAN_COMM_REGISTER_CLASS & i_arg, uint16_t i_amount) { - PrdfRightShiftRegister r(i_arg, i_amount); + RightShiftRegister r(i_arg, i_amount); return iv_rightRegFw.get(r); } -//------------------------------------------------------------------------------------------------- +//------------------------------------------------------------------------------ SCAN_COMM_REGISTER_CLASS & ScanFacility::GetAndRegister(SCAN_COMM_REGISTER_CLASS & i_left, SCAN_COMM_REGISTER_CLASS & i_right) { - PrdfAndRegister r(i_left,i_right); + AndRegister r(i_left,i_right); return iv_andRegFw.get(r); } -//------------------------------------------------------------------------------------------------- +//------------------------------------------------------------------------------ -SCAN_COMM_REGISTER_CLASS & ScanFacility::GetOrRegister(SCAN_COMM_REGISTER_CLASS & i_left, - SCAN_COMM_REGISTER_CLASS & i_right) +SCAN_COMM_REGISTER_CLASS & ScanFacility::GetOrRegister( + SCAN_COMM_REGISTER_CLASS & i_left, + SCAN_COMM_REGISTER_CLASS & i_right ) { - PrdfOrRegister r(i_left,i_right); - return iv_orRegFw.get(r); + OrRegister r(i_left, i_right); + return iv_orRegFw.get(r); } -//------------------------------------------------------------------------------------------------- +//------------------------------------------------------------------------------ SCAN_COMM_REGISTER_CLASS & ScanFacility::GetAttnTypeRegister(SCAN_COMM_REGISTER_CLASS & i_check, SCAN_COMM_REGISTER_CLASS & i_recov, SCAN_COMM_REGISTER_CLASS & i_special, SCAN_COMM_REGISTER_CLASS & i_proccs) { - PrdfAttnTypeRegister r(i_check,i_recov,i_special,i_proccs); + AttnTypeRegister r(i_check,i_recov,i_special,i_proccs); return iv_attnRegFw.get(r); } -//------------------------------------------------------------------------------------------------- +//------------------------------------------------------------------------------ SCAN_COMM_REGISTER_CLASS & ScanFacility::GetConstantRegister(BIT_STRING_CLASS i_val) { - PrdfConstantRegister r(i_val); + ConstantRegister r(i_val); return iv_constRegFw.get(r); } -//------------------------------------------------------------------------------------------------- +} // end namespace PRDF + diff --git a/src/usr/diag/prdf/common/framework/register/prdfScanFacility.H b/src/usr/diag/prdf/common/framework/register/prdfScanFacility.H index 58e711b08..8087b811c 100755 --- a/src/usr/diag/prdf/common/framework/register/prdfScanFacility.H +++ b/src/usr/diag/prdf/common/framework/register/prdfScanFacility.H @@ -41,6 +41,8 @@ #include <prdfOperatorRegister.H> #include <prdfPlatServices.H> +namespace PRDF +{ //-------------------------------------------------------------------- // Forward References //-------------------------------------------------------------------- @@ -97,8 +99,8 @@ public: attention type is CHECK_STOP. */ SCAN_COMM_REGISTER_CLASS & GetScanRingRegister(TARGETING::TargetHandle_t i_ptargetHandle, - PRDF::ScanRingField * start, - PRDF::ScanRingField * end); + ScanRingField * start, + ScanRingField * end); /** * Get a register that bitwise inverts the bitstring of a register when read or written to @@ -150,7 +152,7 @@ public: SCAN_COMM_REGISTER_CLASS & i_proccs); /** - * Get a PrdfConstantRegister + * Get a ConstantRegister * @param BIT_STRING_CLASS - the bit string constant to use. * @post only one instance of the register with this BIT_STRING value will * exist. @@ -173,31 +175,31 @@ private: // functions */ ScanFacility() {} - -private: // Data - typedef FlyWeight<PRDF::HomRegisterAccessScom,10> ScanCommAccess; - typedef std::vector<PRDF::HomRegisterAccessScan> ScanRingAccess; - typedef FlyWeightS<ScanCommRegisterChip,50> ScanCommRegisters; - typedef FlyWeight<PrdfAttnTypeRegister,50> AttnTypeRegisters; - typedef FlyWeightS<PrdfOrRegister,10> OrRegisters; - typedef FlyWeightS<PrdfAndRegister,50> AndRegisters; - typedef FlyWeightS<PrdfNotRegister,50> NotRegisters; - typedef FlyWeightS<PrdfLeftShiftRegister,10> LeftShiftRegisters; - typedef FlyWeightS<PrdfRightShiftRegister, 10> RightShiftRegisters; - typedef FlyWeight<PrdfConstantRegister, 10> ConstantRegisters; - - ScanCommAccess iv_scomAccessFw; - ScanRingAccess iv_scanAccessList; - ScanCommRegisters iv_scomRegFw; - NotRegisters iv_notRegFw; - LeftShiftRegisters iv_leftRegFw; - RightShiftRegisters iv_rightRegFw; - AndRegisters iv_andRegFw; - OrRegisters iv_orRegFw; - AttnTypeRegisters iv_attnRegFw; - ConstantRegisters iv_constRegFw; - + private: // Data + + typedef FlyWeight<HomRegisterAccessScom, 10> ScanCommAccess; + typedef std::vector<HomRegisterAccessScan> ScanRingAccess; + typedef FlyWeightS<ScanCommRegisterChip, 50> ScanCommRegisters; + typedef FlyWeight<AttnTypeRegister, 50> AttnTypeRegisters; + typedef FlyWeightS<AndRegister, 50> AndRegisters; + typedef FlyWeightS<OrRegister, 10> OrRegisters; + typedef FlyWeightS<NotRegister, 50> NotRegisters; + typedef FlyWeightS<LeftShiftRegister, 10> LeftShiftRegisters; + typedef FlyWeightS<RightShiftRegister, 10> RightShiftRegisters; + typedef FlyWeight<ConstantRegister, 10> ConstantRegisters; + + ScanCommAccess iv_scomAccessFw; + ScanRingAccess iv_scanAccessList; + ScanCommRegisters iv_scomRegFw; + AttnTypeRegisters iv_attnRegFw; + AndRegisters iv_andRegFw; + OrRegisters iv_orRegFw; + NotRegisters iv_notRegFw; + LeftShiftRegisters iv_leftRegFw; + RightShiftRegisters iv_rightRegFw; + ConstantRegisters iv_constRegFw; }; +} // end namespace PRDF #endif /* PRDFSCANFACILITY_H */ diff --git a/src/usr/diag/prdf/common/framework/register/xspprdAndResetErrorRegister.h b/src/usr/diag/prdf/common/framework/register/xspprdAndResetErrorRegister.h index fea03d7d2..38f7e863f 100755 --- a/src/usr/diag/prdf/common/framework/register/xspprdAndResetErrorRegister.h +++ b/src/usr/diag/prdf/common/framework/register/xspprdAndResetErrorRegister.h @@ -52,6 +52,9 @@ #include <iipErrorRegisterMask.h> #endif +namespace PRDF +{ + //-------------------------------------------------------------------- // Forward References //-------------------------------------------------------------------- @@ -169,13 +172,7 @@ inline AndResetErrorRegister::AndResetErrorRegister : ErrorRegisterMask(r,rm,scrId,r1), xAndResetScr(resetScr) {} +} // end namespace PRDF + #endif /* xspprdAndResetErrorRegister_h */ -// Change Log ********************************************************* -// -// Flag Reason Vers Date Coder Description -// ---- -------- ---- -------- -------- ------------------------------- -// v5r2 12/21/00 dgilbert Initial Creation -// 423599 fsp 10/27/03 dgilbert make scrid a bit16 -// -// End Change Log ***************************************************** diff --git a/src/usr/diag/prdf/common/framework/resolution/iipAnalyzeChipResolution.h b/src/usr/diag/prdf/common/framework/resolution/iipAnalyzeChipResolution.h index a35c7968e..8d5239cee 100755 --- a/src/usr/diag/prdf/common/framework/resolution/iipAnalyzeChipResolution.h +++ b/src/usr/diag/prdf/common/framework/resolution/iipAnalyzeChipResolution.h @@ -41,6 +41,9 @@ #include <iipResolution.h> #endif +namespace PRDF +{ + //-------------------------------------------------------------------- // Forward References //-------------------------------------------------------------------- @@ -100,6 +103,7 @@ private: // Data }; +} // end namespace PRDF #endif /* iipAnalyzeChipResolution_h */ diff --git a/src/usr/diag/prdf/common/framework/resolution/iipCallAttnResolution.h b/src/usr/diag/prdf/common/framework/resolution/iipCallAttnResolution.h index 3a2283e2b..dd5f277cf 100755 --- a/src/usr/diag/prdf/common/framework/resolution/iipCallAttnResolution.h +++ b/src/usr/diag/prdf/common/framework/resolution/iipCallAttnResolution.h @@ -41,6 +41,9 @@ #include <iipResolution.h> #endif +namespace PRDF +{ + //-------------------------------------------------------------------- // Forward References //-------------------------------------------------------------------- @@ -106,12 +109,7 @@ private: // Data //{ //} +} // end namespace PRDF + #endif /* iipCallAttnResolution_h */ -// Change Log ********************************************************* -// -// Flag Reason Vers Date Coder Description -// ---- -------- ---- -------- ----- ------------------------------- -// DRG Initial Creation -// -// End Change Log ***************************************************** diff --git a/src/usr/diag/prdf/common/framework/resolution/iipCallResolutionTemplate.h b/src/usr/diag/prdf/common/framework/resolution/iipCallResolutionTemplate.h index ac25b5f11..3e21ebeca 100755 --- a/src/usr/diag/prdf/common/framework/resolution/iipCallResolutionTemplate.h +++ b/src/usr/diag/prdf/common/framework/resolution/iipCallResolutionTemplate.h @@ -48,6 +48,9 @@ #include <iipResolution.h> #endif +namespace PRDF +{ + //-------------------------------------------------------------------- // Forward References //-------------------------------------------------------------------- @@ -103,6 +106,7 @@ private: // Data }; +} // end namespace PRDF #endif /* iipCallResolutionTemplate_h */ diff --git a/src/usr/diag/prdf/common/framework/resolution/iipCallout.h b/src/usr/diag/prdf/common/framework/resolution/iipCallout.h index e2d50a5bb..819a05e24 100755 --- a/src/usr/diag/prdf/common/framework/resolution/iipCallout.h +++ b/src/usr/diag/prdf/common/framework/resolution/iipCallout.h @@ -131,6 +131,8 @@ const PRD_FRU_AND_RC_LIMIT = 12; //#define MruCalloutDCL UINT16 /* How big a mru is in bits. */ +namespace PRDF +{ typedef enum { @@ -160,8 +162,7 @@ typedef enum { LAST_MRU, PRD_MAXMRUNUM = 0x7FFFFFFF} MruCallout; - - +} // end namespace PRDF #endif /* iipCallout_h */ diff --git a/src/usr/diag/prdf/common/framework/resolution/iipCalloutMap.h b/src/usr/diag/prdf/common/framework/resolution/iipCalloutMap.h index bbec65bac..3a22bed71 100755 --- a/src/usr/diag/prdf/common/framework/resolution/iipCalloutMap.h +++ b/src/usr/diag/prdf/common/framework/resolution/iipCalloutMap.h @@ -55,6 +55,9 @@ // Forward References //-------------------------------------------------------------------- +namespace PRDF +{ + /** Convert a chipid to a mru callout @author Douglas R. Gilbert @@ -137,6 +140,7 @@ private: // Data }; +} // end namespace PRDF #endif /* iipCalloutMap_h */ diff --git a/src/usr/diag/prdf/common/framework/resolution/iipCalloutResolution.h b/src/usr/diag/prdf/common/framework/resolution/iipCalloutResolution.h index 2c8ab7404..cec2d6f49 100755 --- a/src/usr/diag/prdf/common/framework/resolution/iipCalloutResolution.h +++ b/src/usr/diag/prdf/common/framework/resolution/iipCalloutResolution.h @@ -54,6 +54,9 @@ #include <iipResolution.h> #endif +namespace PRDF +{ + //-------------------------------------------------------------------- // Forward References //-------------------------------------------------------------------- @@ -142,7 +145,7 @@ CalloutResolution::CalloutResolution(PRDF::PRDcallout callout, inline CalloutResolution::CalloutResolution() : - xMruCallout(NULL), xPriority(PRDF::MRU_MED) + xMruCallout(NULL), xPriority(MRU_MED) {} inline @@ -150,4 +153,6 @@ CalloutResolution::CalloutResolution(const CalloutResolution & cr) : xMruCallout(cr.xMruCallout), xPriority(cr.xPriority) {} +} // end namespace PRDF + #endif /* iipCalloutResolution_h */ diff --git a/src/usr/diag/prdf/common/framework/resolution/iipCaptureResolution.h b/src/usr/diag/prdf/common/framework/resolution/iipCaptureResolution.h index 89829f651..49b0ee8e5 100755 --- a/src/usr/diag/prdf/common/framework/resolution/iipCaptureResolution.h +++ b/src/usr/diag/prdf/common/framework/resolution/iipCaptureResolution.h @@ -37,6 +37,9 @@ #include <iipCaptureData.h> #endif +namespace PRDF +{ + //-------------------------------------------------------------------- // Forward References //-------------------------------------------------------------------- @@ -120,19 +123,7 @@ xScr(scr), pos(p) {} +} // end namespace PRDF #endif /* iipCaptureResolution_h */ -// Change Log ********************************************************* -// -// Flag Reason Vers Date Coder Description -// ---- -------- ------ -------- ----- ------------------------------- -// d24758.1 v4r1m0 05/14/96 DRG Initial Creation -// d24758.1 v4r1m0 05/28/96 DRG Added new constructor for single scr -// d24758.1 v4r1m0 05/30/96 DRG Changed base class to Resolution -// Now only capture 1 reg/CaputureResolution -// d48127.9 v4r1m0 10/20/97 DRG Add interface for chipId + Address -// dg01 V4r3m0 05/13/99 DRG Add place to capture (FRONT or BACK) -// 359182 fips1 03/07/02 dgilbert fix up for FSP -// -// End Change Log ***************************************************** diff --git a/src/usr/diag/prdf/common/framework/resolution/iipEregResolution.h b/src/usr/diag/prdf/common/framework/resolution/iipEregResolution.h index 8042c2901..000b9dc10 100755 --- a/src/usr/diag/prdf/common/framework/resolution/iipEregResolution.h +++ b/src/usr/diag/prdf/common/framework/resolution/iipEregResolution.h @@ -51,6 +51,9 @@ #include <iipResolution.h> #endif +namespace PRDF +{ + //-------------------------------------------------------------------- // Forward References //-------------------------------------------------------------------- @@ -119,14 +122,7 @@ inline EregResolution::EregResolution() : errorRegister(NULL) {} +} // end namespace PRDF + #endif /* iipEregResolution_h */ -// Change Log ********************************************************* -// -// Flag Reason Vers Date Coder Description -// ---- ------- ---- -------- -------- ------------------------------- -// v4r1m0 05/13/96 DRG Initial Creation -// pw01 494911 f310 03/04/05 iawillia Use ErrorRegisterType instead of -// ErrorRegister. -// f522283 fips300 09/27/05 dgilbert Make class FlyWeight -able -// End Change Log ***************************************************** diff --git a/src/usr/diag/prdf/common/framework/resolution/iipResolution.C b/src/usr/diag/prdf/common/framework/resolution/iipResolution.C index c68c5190a..6e9cd1ba4 100755 --- a/src/usr/diag/prdf/common/framework/resolution/iipResolution.C +++ b/src/usr/diag/prdf/common/framework/resolution/iipResolution.C @@ -46,13 +46,10 @@ #include <iipEregResolution.h> #include <iipsdbug.h> #include <iipResolutionList.h> -//#include <iipThresholdResolution.h> #include <iipCallAttnResolution.h> #include <iipTerminateResolution.h> #include <iipAnalyzeChipResolution.h> #include <xspprdTryResolution.h> -//#include <prdfResetThresholdResolution.H> -//#include <prdfIntervalThresholdResolution.H> #include <iipchip.h> #include <prdfCalloutConnected.H> #include <prdfAnalyzeConnected.H> @@ -60,7 +57,8 @@ #undef iipResolution_C -using namespace PRDF; +namespace PRDF +{ //---------------------------------------------------------------------- // User Types @@ -203,7 +201,7 @@ int32_t TryResolution::Resolve(STEP_CODE_DATA_STRUCT & error) return rc; } -int32_t prdfCalloutConnected::Resolve(STEP_CODE_DATA_STRUCT & serviceData) +int32_t CalloutConnected::Resolve(STEP_CODE_DATA_STRUCT & serviceData) { using namespace TARGETING; @@ -253,10 +251,9 @@ int32_t prdfCalloutConnected::Resolve(STEP_CODE_DATA_STRUCT & serviceData) //-------------------------------------------------------------------- // AnalyzeConnected Member Functions //-------------------------------------------------------------------- -int32_t PrdfAnalyzeConnected::Resolve(STEP_CODE_DATA_STRUCT & serviceData) +int32_t AnalyzeConnected::Resolve(STEP_CODE_DATA_STRUCT & serviceData) { using namespace TARGETING; - using namespace PRDF; CHIP_CLASS * l_connChipObj = NULL; TARGETING::TargetHandle_t l_pconnChipTarget = NULL; @@ -304,54 +301,5 @@ int32_t PrdfAnalyzeConnected::Resolve(STEP_CODE_DATA_STRUCT & serviceData) return PRD_UNRESOLVED_CHIP_CONNECTION; } -//-------------------------------------------------------------------- -// ResetThresholdResolution Member Functions -//-------------------------------------------------------------------- - -#if defined(_OBSOLITE_) -int32_t ResetThresholdResolution::Resolve(STEP_CODE_DATA_STRUCT & error) -{ - ++count; - error.service_data->SetHits((uint16_t)count); - error.service_data->SetThreshold((uint16_t)threshold); - if((count == threshold) || (error.service_data->IsFlooding())) - { - error.service_data->SetThresholdMaskId(maskId); // threshold, degraded YES - count = 0; // Reset the counter when threshold is hit - } - int32_t rc = SUCCESS; - // if(xRes != NULL) rc = xRes->Resolve(error); - return rc; -} -//-------------------------------------------------------------------- -// IntervalThresholdResolution Member Functions -//-------------------------------------------------------------------- - -int32_t IntervalThresholdResolution::Resolve(STEP_CODE_DATA_STRUCT & error) -{ - PrdTimer curTime = error.service_data->GetTOE(); // get timestamp (Time Of Error) from SDC; - ++count; - if (count == 1) // The interval begins now at the first occurrence - intervalEndTime = curTime + intervalLength; // Project the end of interval (intervalLength is in seconds) - else - { - if (curTime > intervalEndTime) // See if we're already past the time window - { - count = 1; // Reset count as if it were the first - intervalEndTime = curTime + intervalLength; // Project the new end of interval (intervalLength is in seconds) - } - else if((count == threshold) || (error.service_data->IsFlooding())) // We've hit threshold within the interval - { - error.service_data->SetThresholdMaskId(maskId); // threshold, degraded YES - count = 0; // Reset the counter when threshold is hit - } - else ; // Nothing else--the count is already incremented - } - error.service_data->SetHits((uint16_t)count); - error.service_data->SetThreshold((uint16_t)threshold); +} // end namespace PRDF - int32_t rc = SUCCESS; - // if(xRes != NULL) rc = xRes->Resolve(error); - return rc; -} -#endif diff --git a/src/usr/diag/prdf/common/framework/resolution/iipResolution.h b/src/usr/diag/prdf/common/framework/resolution/iipResolution.h index 32123c585..c1b1df029 100755 --- a/src/usr/diag/prdf/common/framework/resolution/iipResolution.h +++ b/src/usr/diag/prdf/common/framework/resolution/iipResolution.h @@ -62,6 +62,9 @@ #include <iipstep.h> #endif +namespace PRDF +{ + //-------------------------------------------------------------------- // Forward References //-------------------------------------------------------------------- @@ -148,14 +151,7 @@ private: // Data }; +} // end namespace PRDF #endif /* iipResolution_h */ -// Change Log ********************************************************* -// -// Flag Reason Vers Date Coder Description -// ---- --------- ---- -------- -------- ------------------------------- -// v4r1 05/01/96 dgilbert Replaces ACTION_CLASS -// dg00 d49420.07 v5r2 11/09/00 dgilbert Add support for operator== -// -// End Change Log ***************************************************** diff --git a/src/usr/diag/prdf/common/framework/resolution/iipResolutionFactory.C b/src/usr/diag/prdf/common/framework/resolution/iipResolutionFactory.C index 158a5842e..9089c5db2 100755 --- a/src/usr/diag/prdf/common/framework/resolution/iipResolutionFactory.C +++ b/src/usr/diag/prdf/common/framework/resolution/iipResolutionFactory.C @@ -79,7 +79,8 @@ class DumpResolutionFW; // dg06a class GardResolutionFW; // dg06a */ -using namespace PRDF; +namespace PRDF +{ //--------------------------------------------------------------------- // Member Function Specifications @@ -137,7 +138,7 @@ MaskResolution & ResolutionFactory::GetThresholdResolution( uint32_t maskId, const ThresholdResolution::ThresholdPolicy & mfgPolicy ) { MaskResolution * r = NULL; - if ( !PRDF::PlatServices::mfgMode() ) + if ( !PlatServices::mfgMode() ) { r = &iv_thresholdResolutions.get(ThresholdResolution(maskId,policy)); } @@ -152,7 +153,7 @@ MaskResolution & ResolutionFactory::GetThresholdResolution( uint32_t maskId, const ThresholdResolution::ThresholdPolicy & policy ) { MaskResolution * r = NULL; - if ( !PRDF::PlatServices::mfgMode() && + if ( !PlatServices::mfgMode() && !(policy == ThresholdResolution::cv_mnfgDefault) ) { r = &iv_thresholdResolutions.get(ThresholdResolution(maskId,policy)); @@ -168,7 +169,7 @@ MaskResolution & ResolutionFactory::GetThresholdResolution( uint32_t maskId, MaskResolution & ResolutionFactory::GetThresholdResolution(uint32_t maskId) { MaskResolution * r = NULL; - if ( !PRDF::PlatServices::mfgMode() ) + if ( !PlatServices::mfgMode() ) { r = &iv_thresholdResolutions.get( ThresholdResolution(maskId, @@ -189,7 +190,7 @@ Resolution & ResolutionFactory::GetConnectedCalloutResolution( PRDpriority i_priority, Resolution * i_altResolution ) { - prdfCalloutConnected key( i_psourceHandle, + CalloutConnected key( i_psourceHandle, i_targetType, i_idx, i_priority, @@ -203,15 +204,15 @@ Resolution & ResolutionFactory::GetAnalyzeConnectedResolution( TARGETING::TYPE i_targetType, uint32_t i_idx ) { - PrdfAnalyzeConnected key( i_psourceHandle, i_targetType, i_idx ); + AnalyzeConnected key( i_psourceHandle, i_targetType, i_idx ); return iv_analyzeConnected.get(key); } Resolution & ResolutionFactory::GetPluginCallResolution( - PrdfExtensibleChip * i_chip, PrdfExtensibleChipFunction * i_function) + ExtensibleChip * i_chip, ExtensibleChipFunction * i_function) { - return iv_pluginCallFW.get(PrdfPluginCallResolution(i_chip,i_function)); + return iv_pluginCallFW.get(PluginCallResolution(i_chip,i_function)); } Resolution & ResolutionFactory::GetThresholdSigResolution( @@ -258,17 +259,17 @@ Resolution & ResolutionFactory::GetGardResolution(GardResolution::ErrorType et) } Resolution & ResolutionFactory::GetCaptureResolution - (PrdfExtensibleChip * i_chip, + (ExtensibleChip * i_chip, uint32_t i_group) { - return iv_captureResolutionFW.get(PrdfCaptureResolution(i_chip,i_group)); + return iv_captureResolutionFW.get(CaptureResolution(i_chip,i_group)); } Resolution & ResolutionFactory::GetClockResolution( TARGETING::TargetHandle_t i_pClockHandle, TARGETING::TYPE i_targetType ) { - return iv_clockResolutionFW.get( PrdfClockResolution(i_pClockHandle, + return iv_clockResolutionFW.get( ClockResolution(i_pClockHandle, i_targetType) ); } @@ -287,27 +288,6 @@ void ResolutionFactory::Reset() iv_clockResolutionFW.clear(); //jl01a } -// dg03a end -// Change Log ************************************************************************************* -// -// Flag Reason Vers Date Coder Description -// ---- --------- ---- -------- -------- --------------------------------------------------------- -// 02/28/97 DGILBERT Initial Creation -// D49274.11 v4r5 01/20/99 SERAFIN Increased MAX_CALLOUT_RESOLUTIONS and MAX_LINKS -// D49420.1 v5r2 07/17/00 mkobler Add interface which uses ChipEnums -// d49420.2 v5r2 09/20/00 dgilbert increase link vector size -// d49420.7 v5r2 11/10/00 dgilbert move GetCalloutResolution(CHIP_ID...) -// to xspprdCondorOnly.C -// d49420.7 v5r2 11/20/00 mkobler change default list/link size -// d49420.10 v5r2 01/16/00 mkobler change default callout list size -// dg00 p4907689 v5r2 02/22/01 dgilbert link/list size += 1000 -// csp 07/11/01 dgilbert rewrite to solve size problem -// dg01 fips 08/09/02 dgilbert rewrite using FlyWeight template -// dg02 400647 fips 03/24/03 dgilbert add GetThresholdResolution() -// dg04 493306 235 03/01/05 dgilbert Add prdfCalloutConnected -// 497866 235 03/29/05 dgilbert add idx & priority to prdfCalloutConnected -// dg05 498293 310 04/06/05 dgilbert add analyzeConnected -// pw01 F527129 f300 10/31/05 iawillia Move inlined code to .C so it compiles. -// ecdf F550548 f300 05/04/06 iawillia eClipz DUMP flags support. -// dg05 f310 05/18/07 dgilbert Clear iv_captureResolutoinFW to prevent memory leak. -// End Change Log ********************************************************************************* + +} // end namespace PRDF + diff --git a/src/usr/diag/prdf/common/framework/resolution/iipResolutionFactory.h b/src/usr/diag/prdf/common/framework/resolution/iipResolutionFactory.h index a37fdfa98..fe0c0febf 100755 --- a/src/usr/diag/prdf/common/framework/resolution/iipResolutionFactory.h +++ b/src/usr/diag/prdf/common/framework/resolution/iipResolutionFactory.h @@ -78,6 +78,9 @@ #include <prdfCaptureResolution.H> // pw01 #include <prdfClockResolution.H> // jl01a +namespace PRDF +{ + //-------------------------------------------------------------------- // Forward References //-------------------------------------------------------------------- @@ -137,8 +140,8 @@ public: <br><b>Note: </b> Do not call this method from a static object </ul><br> */ - Resolution & GetCalloutResolution( PRDF::PRDcallout callout, - PRDF::PRDpriority p = PRDF::MRU_MED); + Resolution & GetCalloutResolution( PRDcallout callout, + PRDpriority p = PRDF::MRU_MED); /** Get a threshold Resolution @@ -175,7 +178,7 @@ public: Resolution & GetConnectedCalloutResolution(TARGETING::TargetHandle_t i_psourceHandle, TARGETING::TYPE i_targetType, uint32_t i_idx = 0, - PRDF::PRDpriority i_priority = PRDF::MRU_MED, + PRDpriority i_priority = MRU_MED, Resolution * i_altResolution = NULL); // dg04a - end @@ -192,14 +195,14 @@ public: // dg05a - end // dg06a - start /** - * Get a PrdfPluginCallResolution - * @param ptr to PrdfExtensibleChip - * @param ptr to PrdfExtensibleFunction + * Get a PluginCallResolution + * @param ptr to ExtensibleChip + * @param ptr to ExtensibleFunction * @post one instance with these params will exist * @This flyweight is cleared by this->Reset() */ - Resolution & GetPluginCallResolution(PrdfExtensibleChip * i_chip, - PrdfExtensibleChipFunction * i_function); + Resolution & GetPluginCallResolution(ExtensibleChip * i_chip, + ExtensibleChipFunction * i_function); /** * Get a threshold signature resolution @@ -264,7 +267,7 @@ public: * @param i_group - The group to capture. * @post only one instance of this object with this param will exist */ - Resolution & GetCaptureResolution(PrdfExtensibleChip * i_chip, + Resolution & GetCaptureResolution(ExtensibleChip * i_chip, uint32_t i_group); /** @@ -391,17 +394,17 @@ private: // Data typedef FlyWeight< ThresholdResolution, 50 > ThresholdResolutionList; // dg02a typedef FlyWeight< MaskResolution, 50 > MaskResolutionFW; // dg02a - typedef FlyWeight< prdfCalloutConnected, 25 > ConnectedFW; // dg04a - typedef FlyWeight< PrdfAnalyzeConnected, 20 > AnalyzeCFW; // dg05a - typedef FlyWeight< PrdfPluginCallResolution, 10 > PluginCallFW; // dg06a + typedef FlyWeight< CalloutConnected, 25 > ConnectedFW; // dg04a + typedef FlyWeight< AnalyzeConnected, 20 > AnalyzeCFW; // dg05a + typedef FlyWeight< PluginCallResolution, 10 > PluginCallFW; // dg06a typedef FlyWeight< ThresholdSigResolution, 10 > ThresholdSigFW; // dg06a typedef FlyWeight< EregResolution, 50 > EregResolutionFW; // dg06a typedef FlyWeight< TryResolution, 20 > TryResolutionFW; // dg06a typedef FlyWeight< FlagResolution, 5 > FlagResolutionFW; // dg06a typedef FlyWeight< DumpResolution, 5 > DumpResolutionFW; // dg06a typedef FlyWeight< GardResolution, 5 > GardResolutionFW; // dg06a - typedef FlyWeight< PrdfCaptureResolution, 5> CaptureResolutionFW; // pw01 - typedef FlyWeight< PrdfClockResolution, 8 > ClockResolutionFW; // jl01a + typedef FlyWeight< CaptureResolution, 5> CaptureResolutionFW; // pw01 + typedef FlyWeight< ClockResolution, 8 > ClockResolutionFW; // jl01a CalloutFW iv_Callouts; // dg01a ResolutionLinkFW iv_Links; // dg01a @@ -450,4 +453,6 @@ Resolution & ResolutionFactory::LinkResolutions(Resolution &r1, return LinkResolutions(LinkResolutions(r1,r2),LinkResolutions(r3,r4,r5)); } +} // end namespace PRDF + #endif /* iipResolutionFactory_h */ diff --git a/src/usr/diag/prdf/common/framework/resolution/iipResolutionList.h b/src/usr/diag/prdf/common/framework/resolution/iipResolutionList.h index 61ceca97c..b774a87f0 100755 --- a/src/usr/diag/prdf/common/framework/resolution/iipResolutionList.h +++ b/src/usr/diag/prdf/common/framework/resolution/iipResolutionList.h @@ -52,6 +52,9 @@ #include <vector> +namespace PRDF +{ + //-------------------------------------------------------------------- // Forward References //-------------------------------------------------------------------- @@ -173,13 +176,7 @@ ResolutionList::ResolutionList(Resolution * r1,Resolution * r2, resolutionList.push_back(r6); } +} // end namespace PRDF #endif /* iipResolutionList_h */ -// Change Log ********************************************************* -// -// Flag Reason Vers Date Coder Description -// ---- -------- ---- -------- ----- ------------------------------- -// d24758.1 v4r1 05/30/96 DRG Initial Creation -// -// End Change Log ***************************************************** diff --git a/src/usr/diag/prdf/common/framework/resolution/iipTerminateResolution.h b/src/usr/diag/prdf/common/framework/resolution/iipTerminateResolution.h index 0e86c85d9..a5a29cb64 100755 --- a/src/usr/diag/prdf/common/framework/resolution/iipTerminateResolution.h +++ b/src/usr/diag/prdf/common/framework/resolution/iipTerminateResolution.h @@ -67,6 +67,9 @@ #include <iipResolution.h> #endif +namespace PRDF +{ + //-------------------------------------------------------------------- // Forward References //-------------------------------------------------------------------- @@ -128,12 +131,7 @@ private: // Data inline TerminateResolution::TerminateResolution(): Resolution() {} +} // end namespace PRDF + #endif /* iipResolution_h */ -// Change Log ********************************************************* -// -// Flag Reason Vers Date Coder Description -// ---- -------- ---- -------- ----- ------------------------------- -// V4R1 09/13/96 DRG Created -// -// End Change Log ***************************************************** diff --git a/src/usr/diag/prdf/common/framework/resolution/prdfAnalyzeConnected.H b/src/usr/diag/prdf/common/framework/resolution/prdfAnalyzeConnected.H index c8598f4a8..3c99cb052 100755 --- a/src/usr/diag/prdf/common/framework/resolution/prdfAnalyzeConnected.H +++ b/src/usr/diag/prdf/common/framework/resolution/prdfAnalyzeConnected.H @@ -37,6 +37,9 @@ #include <iipResolution.h> #include <prdfPlatServices.H> +namespace PRDF +{ + //-------------------------------------------------------------------- // Forward References //-------------------------------------------------------------------- @@ -51,13 +54,13 @@ struct STEP_CODE_DATA_STRUCT; dynamic failover and concurrent maintainance - without having to call PRD to re-build itself. */ -class PrdfAnalyzeConnected : public Resolution +class AnalyzeConnected : public Resolution { public: /** default ctor */ - PrdfAnalyzeConnected(void); + AnalyzeConnected(void); /** Constructor @@ -65,7 +68,7 @@ public: @param i_targetType i_targetType of desired unit that's connected to i_psourceHandle @param i_idx: index into getConnected list of chip. */ - PrdfAnalyzeConnected(TARGETING::TargetHandle_t i_psourceHandle , + AnalyzeConnected(TARGETING::TargetHandle_t i_psourceHandle , TARGETING::TYPE i_targetType, uint32_t i_idx =0xffffffff ); @@ -81,7 +84,7 @@ public: */ virtual int32_t Resolve(STEP_CODE_DATA_STRUCT & io_service_data); - virtual bool operator==(const PrdfAnalyzeConnected & r) const; + virtual bool operator==(const AnalyzeConnected & r) const; private: // functions private: // Data @@ -91,14 +94,14 @@ private: // Data uint32_t iv_idx; }; -inline PrdfAnalyzeConnected::PrdfAnalyzeConnected(void) +inline AnalyzeConnected::AnalyzeConnected(void) : iv_psourceHandle(NULL), iv_targetType(TARGETING::TYPE_NA), iv_idx(0xffffffff) { } -inline PrdfAnalyzeConnected::PrdfAnalyzeConnected( +inline AnalyzeConnected::AnalyzeConnected( TARGETING::TargetHandle_t i_psourceHandle, TARGETING::TYPE i_targetType, uint32_t i_idx) @@ -108,18 +111,14 @@ inline PrdfAnalyzeConnected::PrdfAnalyzeConnected( { } -inline bool PrdfAnalyzeConnected::operator==(const PrdfAnalyzeConnected & r) const +inline bool AnalyzeConnected::operator==(const AnalyzeConnected & r) const { return (iv_psourceHandle == r.iv_psourceHandle && iv_targetType == r.iv_targetType && iv_idx == r.iv_idx); } +} // end namespace PRDF + #endif /* PRDFANALYZECONNECTED_H */ -// Change Log ***************************************************************** -// -// Flag Reason Vers Date Coder Description -// ---- --------- ----- -------- -------- ------------------------------------ -// 498293 f310 03/31/05 iawillia Initial Creation -// End Change Log ************************************************************* diff --git a/src/usr/diag/prdf/common/framework/resolution/prdfCalloutConnected.H b/src/usr/diag/prdf/common/framework/resolution/prdfCalloutConnected.H index 3301daf7d..a92f80601 100755 --- a/src/usr/diag/prdf/common/framework/resolution/prdfCalloutConnected.H +++ b/src/usr/diag/prdf/common/framework/resolution/prdfCalloutConnected.H @@ -37,6 +37,9 @@ #include <prdfPlatServices.H> #include <prdfCallouts.H> +namespace PRDF +{ + //-------------------------------------------------------------------- // Forward References //-------------------------------------------------------------------- @@ -50,20 +53,20 @@ struct STEP_CODE_DATA_STRUCT; to determine whats connected. This allows for runtime GARD, dynamic failover and concurrent maintainance - without having to call PRD to re-build itself. @code - prdfCalloutConnected iv_callout(PROC, TYPE_MCS ....); + CalloutConnected iv_callout(PROC, TYPE_MCS ....); // ...... // This will add the MCSs thats connected to this PROC to the callout list iv_callout.Resolve(serviceData); @endcode @note Don't use this class to callout clocks - use prdfClockResolution */ -class prdfCalloutConnected : public Resolution +class CalloutConnected : public Resolution { public: /** default ctor */ - prdfCalloutConnected(void); + CalloutConnected(void); /** Constructor @@ -76,13 +79,13 @@ public: If NULL than source is called out @note Don't use this class to callout clocks - use prdfClockResolution */ - prdfCalloutConnected(TARGETING::TargetHandle_t i_psourceHandle, + CalloutConnected(TARGETING::TargetHandle_t i_psourceHandle, TARGETING::TYPE i_targetType, uint32_t i_idx =0xffffffff , - PRDF::PRDpriority i_priority = PRDF::MRU_MED, + PRDpriority i_priority = MRU_MED, Resolution * i_altResolution = NULL); - // ~prdfCalloutConnected(); default dtor is sufficient + // ~CalloutConnected(); default dtor is sufficient /** Determine callout for current connected unit and add to the service data @@ -95,7 +98,7 @@ public: */ virtual int32_t Resolve(STEP_CODE_DATA_STRUCT & io_service_data); - virtual bool operator==(const prdfCalloutConnected & r) const; + virtual bool operator==(const CalloutConnected & r) const; private: // functions private: // Data @@ -107,15 +110,15 @@ private: // Data Resolution * iv_altResolution; }; -inline prdfCalloutConnected::prdfCalloutConnected(void) +inline CalloutConnected::CalloutConnected(void) : iv_psourceHandle(NULL), iv_targetType(TARGETING::TYPE_NA), iv_idx(0xffffffff ), - iv_priority(PRDF::MRU_LOW), + iv_priority(MRU_LOW), iv_altResolution(NULL) {} -inline prdfCalloutConnected::prdfCalloutConnected(TARGETING::TargetHandle_t i_psourceHandle, +inline CalloutConnected::CalloutConnected(TARGETING::TargetHandle_t i_psourceHandle, TARGETING::TYPE i_targetType, uint32_t i_idx, PRDF::PRDpriority i_priority, @@ -127,7 +130,7 @@ inline prdfCalloutConnected::prdfCalloutConnected(TARGETING::TargetHandle_t i_ps iv_altResolution(i_altResolution) {} -inline bool prdfCalloutConnected::operator==(const prdfCalloutConnected & r) const +inline bool CalloutConnected::operator==(const CalloutConnected & r) const { return (iv_psourceHandle == r.iv_psourceHandle && iv_targetType == r.iv_targetType && @@ -136,4 +139,6 @@ inline bool prdfCalloutConnected::operator==(const prdfCalloutConnected & r) con (iv_altResolution == r.iv_altResolution || &iv_altResolution == &r.iv_altResolution)); } +} // end namespace PRDF + #endif /* PRDFCALLOUTCONNECTED_H */ diff --git a/src/usr/diag/prdf/common/framework/resolution/prdfCallouts.H b/src/usr/diag/prdf/common/framework/resolution/prdfCallouts.H index 183ffb0ad..d36123e40 100755 --- a/src/usr/diag/prdf/common/framework/resolution/prdfCallouts.H +++ b/src/usr/diag/prdf/common/framework/resolution/prdfCallouts.H @@ -193,6 +193,6 @@ class PRDcallout }; -}; // end namespace PRDF +} // end namespace PRDF #endif /* prdfCallouts_H */ diff --git a/src/usr/diag/prdf/common/framework/resolution/prdfCaptureResolution.C b/src/usr/diag/prdf/common/framework/resolution/prdfCaptureResolution.C index 183368389..63e4c942d 100755 --- a/src/usr/diag/prdf/common/framework/resolution/prdfCaptureResolution.C +++ b/src/usr/diag/prdf/common/framework/resolution/prdfCaptureResolution.C @@ -24,7 +24,10 @@ #include <prdfCaptureResolution.H> #include <iipServiceDataCollector.h> -int32_t PrdfCaptureResolution::Resolve(STEP_CODE_DATA_STRUCT & i_error) +namespace PRDF +{ + +int32_t CaptureResolution::Resolve(STEP_CODE_DATA_STRUCT & i_error) { if (NULL != iv_chip) return iv_chip->CaptureErrorData(i_error.service_data->GetCaptureData(), @@ -32,10 +35,5 @@ int32_t PrdfCaptureResolution::Resolve(STEP_CODE_DATA_STRUCT & i_error) return SUCCESS; }; -// Change Log ********************************************************* -// -// Flag Reason Vers Date Coder Description -// ---- -------- ---- -------- -------- ------------------------------- -// f310 08/31/06 iawillia Initial File Creation -// End Change Log ***************************************************** +} // end namespace PRDF diff --git a/src/usr/diag/prdf/common/framework/resolution/prdfCaptureResolution.H b/src/usr/diag/prdf/common/framework/resolution/prdfCaptureResolution.H index e00d1cd7b..c6f20394e 100755 --- a/src/usr/diag/prdf/common/framework/resolution/prdfCaptureResolution.H +++ b/src/usr/diag/prdf/common/framework/resolution/prdfCaptureResolution.H @@ -24,22 +24,25 @@ #include <iipResolution.h> #include <prdfExtensibleChip.H> +namespace PRDF +{ + /** - * @class PrdfCaptureResolution + * @class CaptureResolution * @brief Adds a capture-group to the capture data when hitting an error. */ -class PrdfCaptureResolution : public Resolution +class CaptureResolution : public Resolution { public: - PrdfCaptureResolution() : iv_chip(NULL), iv_captureGroup(0) {}; + CaptureResolution() : iv_chip(NULL), iv_captureGroup(0) {}; - /** @fn PrdfCaptureResolution + /** @fn CaptureResolution * @brief Typical constructor. * * @param i_chip - Extensible chip object to capture from. * @param i_group - Capture-group to gather. */ - PrdfCaptureResolution(PrdfExtensibleChip * i_chip, + CaptureResolution(ExtensibleChip * i_chip, uint32_t i_captureGroup) : iv_chip(i_chip), iv_captureGroup(i_captureGroup) {}; @@ -52,22 +55,18 @@ class PrdfCaptureResolution : public Resolution /** * Comparison operator to aid in ResolutionFactory. */ - bool operator==(const PrdfCaptureResolution & i_rhs) + bool operator==(const CaptureResolution & i_rhs) { return ((iv_chip == i_rhs.iv_chip) && (iv_captureGroup == i_rhs.iv_captureGroup)); }; private: /** The chip to capture from */ - PrdfExtensibleChip * iv_chip; + ExtensibleChip * iv_chip; /** The group id to capture */ uint32_t iv_captureGroup; }; -// Change Log ********************************************************* -// -// Flag Reason Vers Date Coder Description -// ---- -------- ---- -------- -------- ------------------------------- -// f310 08/31/06 iawillia Initial File Creation -// End Change Log ***************************************************** +} // end namespace PRDF + diff --git a/src/usr/diag/prdf/common/framework/resolution/prdfClockResolution.C b/src/usr/diag/prdf/common/framework/resolution/prdfClockResolution.C index e9590a995..73c3447f2 100755 --- a/src/usr/diag/prdf/common/framework/resolution/prdfClockResolution.C +++ b/src/usr/diag/prdf/common/framework/resolution/prdfClockResolution.C @@ -30,15 +30,17 @@ #include <prdfPlatServices.H> #undef prdfClockResolution_C +namespace PRDF +{ + //------------------------------------------------------------------------------ // Member Function Specifications //------------------------------------------------------------------------------ // Find the active clock source and blame it -int32_t PrdfClockResolution::Resolve(STEP_CODE_DATA_STRUCT & serviceData) +int32_t ClockResolution::Resolve(STEP_CODE_DATA_STRUCT & serviceData) { using namespace TARGETING; - using namespace PRDF; uint32_t l_rc = SUCCESS; // Use clock routines for CLOCK_CARD types. @@ -86,3 +88,4 @@ int32_t PrdfClockResolution::Resolve(STEP_CODE_DATA_STRUCT & serviceData) return(l_rc); } +} // end namespace PRDF diff --git a/src/usr/diag/prdf/common/framework/resolution/prdfClockResolution.H b/src/usr/diag/prdf/common/framework/resolution/prdfClockResolution.H index 995522197..0cd7e5879 100755 --- a/src/usr/diag/prdf/common/framework/resolution/prdfClockResolution.H +++ b/src/usr/diag/prdf/common/framework/resolution/prdfClockResolution.H @@ -41,6 +41,10 @@ #endif #include <prdfPlatServices.H> + +namespace PRDF +{ + //-------------------------------------------------------------------- // Forward References //-------------------------------------------------------------------- @@ -50,7 +54,7 @@ class ServiceDataCollector; Set dump information in the Service Data Collector @author Mike Kobler */ -class PrdfClockResolution : public Resolution +class ClockResolution : public Resolution { public: /** @@ -65,7 +69,7 @@ public: </ul><br> */ // FIXME: The default target type needs to be set to a PROC clock card. - PrdfClockResolution( TARGETING::TargetHandle_t i_pTargetHandle = NULL, + ClockResolution( TARGETING::TargetHandle_t i_pTargetHandle = NULL, TARGETING::TYPE i_targetType = TARGETING::TYPE_PROC ) : iv_ptargetClock(i_pTargetHandle), iv_targetType(i_targetType) @@ -88,7 +92,7 @@ public: * base class defines operator== so one is needed here * or the base class version will be used (bad) */ - bool operator==(const PrdfClockResolution & r) const + bool operator==(const ClockResolution & r) const { return ((iv_ptargetClock == r.iv_ptargetClock) && (iv_targetType == r.iv_targetType)); } @@ -100,12 +104,7 @@ private: // Data TARGETING::TYPE iv_targetType ; }; +} // end namespace PRDF #endif /* prdfClockResolution_H */ -// Change Log ********************************************************* -// -// Flag Reason Vers Date Coder Description -// ---- -------- ------ -------- ------- ---------------------------- -// D725180 fips720 09/30/09 lukas Initial file creation. -// End Change Log ***************************************************** diff --git a/src/usr/diag/prdf/common/framework/resolution/prdfErrorTypeResolution.H b/src/usr/diag/prdf/common/framework/resolution/prdfErrorTypeResolution.H index 2b917d9fc..570e94a19 100755 --- a/src/usr/diag/prdf/common/framework/resolution/prdfErrorTypeResolution.H +++ b/src/usr/diag/prdf/common/framework/resolution/prdfErrorTypeResolution.H @@ -21,8 +21,8 @@ /* */ /* IBM_PROLOG_END_TAG */ -#ifndef prdfErrorTypeResolution_H -#define prdfErrorTypeResolution_H +#ifndef ErrorTypeResolution_H +#define ErrorTypeResolution_H //-------------------------------------------------------------------- // Includes //-------------------------------------------------------------------- @@ -34,12 +34,15 @@ #include <iipServiceDataCollector.h> #endif +namespace PRDF +{ + /** - @file prdfErrorTypeResolution.H + @file ErrorTypeResolution.H @brief Set the appropiate error type in the SDC and flag for Gard if necessary. */ -class prdfErrorTypeResolution : public Resolution +class ErrorTypeResolution : public Resolution { public: @@ -63,7 +66,7 @@ public: <br><b>Notes: </b> </ul><br> */ - prdfErrorTypeResolution(ErrorType et) + ErrorTypeResolution(ErrorType et) : xErrorType(et) {} /* @@ -98,13 +101,7 @@ private: // Data }; +} // end namespace PRDF -#endif /* prdfErrorTypeResolution_H */ +#endif /* ErrorTypeResolution_H */ -// Change Log ********************************************************* -// -// Flag Reason Vers Date Coder Description -// ---- -------- ---- -------- ------- ------------------------------- -// 02/26/03 mkobler Initial Creation -// -// End Change Log ***************************************************** diff --git a/src/usr/diag/prdf/common/framework/resolution/prdfPluginCallResolution.H b/src/usr/diag/prdf/common/framework/resolution/prdfPluginCallResolution.H index 95c97fecf..8fe7973be 100755 --- a/src/usr/diag/prdf/common/framework/resolution/prdfPluginCallResolution.H +++ b/src/usr/diag/prdf/common/framework/resolution/prdfPluginCallResolution.H @@ -28,28 +28,31 @@ #include <prdfExtensibleChip.H> #include <prdfPluginDef.H> -class PrdfPluginCallResolution : public Resolution +namespace PRDF +{ + +class PluginCallResolution : public Resolution { private: - PrdfExtensibleChip * iv_chip; - PrdfExtensibleChipFunction * iv_function; + ExtensibleChip * iv_chip; + ExtensibleChipFunction * iv_function; public: - PrdfPluginCallResolution(void) + PluginCallResolution(void) : iv_chip(NULL), iv_function(NULL) {} - PrdfPluginCallResolution(PrdfExtensibleChip * i_chip, - PrdfExtensibleChipFunction * i_function) + PluginCallResolution(ExtensibleChip * i_chip, + ExtensibleChipFunction * i_function) : iv_chip(i_chip), iv_function(i_function) {}; - PrdfPluginCallResolution & operator=(const PrdfPluginCallResolution & r) + PluginCallResolution & operator=(const PluginCallResolution & r) { iv_chip = r.iv_chip; iv_function = r.iv_function; return *this; } - bool operator==(const PrdfPluginCallResolution & r) + bool operator==(const PluginCallResolution & r) { return (iv_chip == r.iv_chip)&&(iv_function == r.iv_function); } @@ -61,21 +64,14 @@ class PrdfPluginCallResolution : public Resolution return (*iv_function) (iv_chip, - PrdfPluginDef::bindParm<STEP_CODE_DATA_STRUCT&>(i_error) + PluginDef::bindParm<STEP_CODE_DATA_STRUCT&>(i_error) ); //@pw01 }; }; -#endif +} // end namespace PRDF -// Change Log ********************************************************* -// -// Flag Reason Vers Date Coder Description -// ---- -------- ---- -------- -------- ------------------------------- -// iawillia initial creation -// F522283 f300 09/27/05 dgilbert add defaut ctor, operator==, operator= -// pw01 F522638 f300 09/27/05 iawillia Fix possible object strip in bindParm. -// End Change Log ***************************************************** +#endif diff --git a/src/usr/diag/prdf/common/framework/resolution/prdfResolutionList.H b/src/usr/diag/prdf/common/framework/resolution/prdfResolutionList.H index 1436e341b..168346967 100755 --- a/src/usr/diag/prdf/common/framework/resolution/prdfResolutionList.H +++ b/src/usr/diag/prdf/common/framework/resolution/prdfResolutionList.H @@ -32,16 +32,12 @@ #include<list> -typedef std::list<Resolution *> prdfResolutionList; +namespace PRDF +{ -#define prdfResolution Resolution +typedef std::list<Resolution *> ResolutionList; + +} // end namespace PRDF #endif /* PRDFRESOLUTIONLIST_H */ -// Change Log ***************************************************************** -// -// Flag Reason Vers Date Coder Description -// ---- --------- ----- -------- -------- ------------------------------------ -// dgilbert Initial Creation -// -// End Change Log ************************************************************* diff --git a/src/usr/diag/prdf/common/framework/resolution/prdfResolutionMap.C b/src/usr/diag/prdf/common/framework/resolution/prdfResolutionMap.C index ced75c0e9..a3abbf2e4 100755 --- a/src/usr/diag/prdf/common/framework/resolution/prdfResolutionMap.C +++ b/src/usr/diag/prdf/common/framework/resolution/prdfResolutionMap.C @@ -29,8 +29,6 @@ // Includes //------------------------------------------------------------------------------ -#define prdfResolutionMap_C - #include <string.h> #include <prdfResolutionMap.H> @@ -39,17 +37,17 @@ #include <prdfErrorSignature.H> #include <prdfMain.H> -#undef prdfResolutionMap_C +namespace PRDF +{ //------------------------------------------------------------------------------ -void prdfResolutionMap::Add(uint8_t i_bitPos, - prdfResolution * i_res ) +void ResolutionMap::Add( uint8_t i_bitPos, Resolution * i_res ) { MapList::iterator i = iv_list.begin(); while(i != iv_list.end()) { - if (i->iv_blist == prdfBitKey()) // If empty bit string, skip. + if (i->iv_blist == BitKey()) // If empty bit string, skip. { } else if( (i->iv_res == i_res) || (*(i->iv_res) == *i_res)) @@ -71,8 +69,8 @@ void prdfResolutionMap::Add(uint8_t i_bitPos, //------------------------------------------------------------------------------ -void prdfResolutionMap::Add( uint8_t i_bitPos, prdfResolution * i_r1, - prdfResolution * i_r2 ) +void ResolutionMap::Add( uint8_t i_bitPos, Resolution * i_r1, + Resolution * i_r2 ) { Add(i_bitPos,i_r1); Add(i_bitPos,i_r2); @@ -80,10 +78,10 @@ void prdfResolutionMap::Add( uint8_t i_bitPos, prdfResolution * i_r1, //------------------------------------------------------------------------------ -void prdfResolutionMap::Add(uint8_t i_bitPos, - prdfResolution * i_r1, - prdfResolution * i_r2, - prdfResolution * i_r3) +void ResolutionMap::Add(uint8_t i_bitPos, + Resolution * i_r1, + Resolution * i_r2, + Resolution * i_r3) { Add(i_bitPos,i_r1,i_r2); Add(i_bitPos,i_r3); @@ -91,11 +89,11 @@ void prdfResolutionMap::Add(uint8_t i_bitPos, //------------------------------------------------------------------------------ -void prdfResolutionMap::Add(uint8_t i_bitPos, - prdfResolution * i_r1, - prdfResolution * i_r2, - prdfResolution * i_r3, - prdfResolution * i_r4) +void ResolutionMap::Add(uint8_t i_bitPos, + Resolution * i_r1, + Resolution * i_r2, + Resolution * i_r3, + Resolution * i_r4) { Add(i_bitPos,i_r1,i_r2); Add(i_bitPos,i_r3,i_r4); @@ -103,12 +101,12 @@ void prdfResolutionMap::Add(uint8_t i_bitPos, //------------------------------------------------------------------------------ -void prdfResolutionMap::Add(uint8_t i_bitPos, - prdfResolution * i_r1, - prdfResolution * i_r2, - prdfResolution * i_r3, - prdfResolution * i_r4, - prdfResolution * i_r5) +void ResolutionMap::Add(uint8_t i_bitPos, + Resolution * i_r1, + Resolution * i_r2, + Resolution * i_r3, + Resolution * i_r4, + Resolution * i_r5) { Add(i_bitPos,i_r1,i_r2,i_r3); Add(i_bitPos,i_r4,i_r5); @@ -116,13 +114,13 @@ void prdfResolutionMap::Add(uint8_t i_bitPos, //------------------------------------------------------------------------------ -void prdfResolutionMap::Add(uint8_t i_bitPos, - prdfResolution * i_r1, - prdfResolution * i_r2, - prdfResolution * i_r3, - prdfResolution * i_r4, - prdfResolution * i_r5, - prdfResolution * i_r6) +void ResolutionMap::Add(uint8_t i_bitPos, + Resolution * i_r1, + Resolution * i_r2, + Resolution * i_r3, + Resolution * i_r4, + Resolution * i_r5, + Resolution * i_r6) { Add(i_bitPos,i_r1,i_r2,i_r3); Add(i_bitPos,i_r4,i_r5,i_r6); @@ -130,14 +128,14 @@ void prdfResolutionMap::Add(uint8_t i_bitPos, //------------------------------------------------------------------------------ -void prdfResolutionMap::Add(uint8_t i_bitPos, - prdfResolution * i_r1, - prdfResolution * i_r2, - prdfResolution * i_r3, - prdfResolution * i_r4, - prdfResolution * i_r5, - prdfResolution * i_r6, - prdfResolution * i_r7) +void ResolutionMap::Add(uint8_t i_bitPos, + Resolution * i_r1, + Resolution * i_r2, + Resolution * i_r3, + Resolution * i_r4, + Resolution * i_r5, + Resolution * i_r6, + Resolution * i_r7) { Add(i_bitPos,i_r1,i_r2,i_r3); Add(i_bitPos,i_r4,i_r5,i_r6,i_r7); @@ -145,14 +143,14 @@ void prdfResolutionMap::Add(uint8_t i_bitPos, //------------------------------------------------------------------------------ -void prdfResolutionMap::Add( const uint8_t *i_ble, - uint8_t i_bleLen, - prdfResolution * i_res ) +void ResolutionMap::Add( const uint8_t *i_ble, + uint8_t i_bleLen, + Resolution * i_res ) { MapList::iterator i = iv_list.begin(); while(i != iv_list.end()) { - if ((i->iv_blist == prdfBitKey()) || (0 == i_bleLen)) + if ((i->iv_blist == BitKey()) || (0 == i_bleLen)) { // Empty bit string, skip. } @@ -184,10 +182,10 @@ void prdfResolutionMap::Add( const uint8_t *i_ble, //------------------------------------------------------------------------------ -void prdfResolutionMap::Add(const uint8_t *i_ble, +void ResolutionMap::Add(const uint8_t *i_ble, uint8_t i_bleLen, - prdfResolution * r1, - prdfResolution * r2) + Resolution * r1, + Resolution * r2) { Add(i_ble,i_bleLen,r1); Add(i_ble,i_bleLen,r2); @@ -195,11 +193,11 @@ void prdfResolutionMap::Add(const uint8_t *i_ble, //------------------------------------------------------------------------------ -void prdfResolutionMap::Add(const uint8_t *i_ble, +void ResolutionMap::Add(const uint8_t *i_ble, uint8_t i_bleLen, - prdfResolution * r1, - prdfResolution * r2, - prdfResolution * r3) + Resolution * r1, + Resolution * r2, + Resolution * r3) { Add(i_ble,i_bleLen,r1,r2); Add(i_ble,i_bleLen,r3); @@ -207,12 +205,12 @@ void prdfResolutionMap::Add(const uint8_t *i_ble, //------------------------------------------------------------------------------ -void prdfResolutionMap::Add(const uint8_t *i_ble, +void ResolutionMap::Add(const uint8_t *i_ble, uint8_t i_bleLen, - prdfResolution * r1, - prdfResolution * r2, - prdfResolution * r3, - prdfResolution * r4) + Resolution * r1, + Resolution * r2, + Resolution * r3, + Resolution * r4) { Add(i_ble,i_bleLen,r1,r2); Add(i_ble,i_bleLen,r3,r4); @@ -220,13 +218,13 @@ void prdfResolutionMap::Add(const uint8_t *i_ble, //------------------------------------------------------------------------------ -void prdfResolutionMap::Add(const uint8_t *i_ble, +void ResolutionMap::Add(const uint8_t *i_ble, uint8_t i_bleLen, - prdfResolution * r1, - prdfResolution * r2, - prdfResolution * r3, - prdfResolution * r4, - prdfResolution * r5) + Resolution * r1, + Resolution * r2, + Resolution * r3, + Resolution * r4, + Resolution * r5) { Add(i_ble,i_bleLen,r1,r2); Add(i_ble,i_bleLen,r3,r4,r5); @@ -234,14 +232,14 @@ void prdfResolutionMap::Add(const uint8_t *i_ble, //------------------------------------------------------------------------------ -void prdfResolutionMap::Add(const uint8_t *i_ble, +void ResolutionMap::Add(const uint8_t *i_ble, uint8_t i_bleLen, - prdfResolution * r1, - prdfResolution * r2, - prdfResolution * r3, - prdfResolution * r4, - prdfResolution * r5, - prdfResolution * r6) + Resolution * r1, + Resolution * r2, + Resolution * r3, + Resolution * r4, + Resolution * r5, + Resolution * r6) { Add(i_ble,i_bleLen,r1,r2,r3); Add(i_ble,i_bleLen,r4,r5,r6); @@ -249,11 +247,10 @@ void prdfResolutionMap::Add(const uint8_t *i_ble, //------------------------------------------------------------------------------ -void prdfResolutionMap::LookUp(prdfResolutionList & o_list, - prdfBitKey & io_bitList, - STEP_CODE_DATA_STRUCT & scd) +void ResolutionMap::LookUp( ResolutionList & o_list, + BitKey & io_bitList, + STEP_CODE_DATA_STRUCT & scd ) { - using namespace PRDF; uint32_t lsize = o_list.size(); if(iv_filter != NULL) @@ -299,8 +296,7 @@ void prdfResolutionMap::LookUp(prdfResolutionList & o_list, //------------------------------------------------------------------------------ -void prdfResolutionMap::Add( const char *i_ble, - prdfResolution * res ) +void ResolutionMap::Add( const char *i_ble, Resolution * res ) { uint8_t len = strlen(i_ble); uint8_t * bl = new uint8_t[len]; @@ -312,51 +308,39 @@ void prdfResolutionMap::Add( const char *i_ble, delete [] bl; } -void prdfResolutionMap::Add(const char *i_ble, - prdfResolution * r1, - prdfResolution * r2) +void ResolutionMap::Add( const char *i_ble, + Resolution * r1, Resolution * r2 ) { Add(i_ble,r1); Add(i_ble,r2); } -void prdfResolutionMap::Add(const char *i_ble, - prdfResolution * r1, - prdfResolution * r2, - prdfResolution * r3) +void ResolutionMap::Add( const char *i_ble, + Resolution * r1, Resolution * r2, Resolution * r3 ) { Add(i_ble,r1,r2); Add(i_ble,r3); } -void prdfResolutionMap::Add(const char *i_ble, - prdfResolution * r1, - prdfResolution * r2, - prdfResolution * r3, - prdfResolution * r4) +void ResolutionMap::Add( const char *i_ble, + Resolution * r1, Resolution * r2, Resolution * r3, + Resolution * r4 ) { Add(i_ble,r1,r2); Add(i_ble,r3,r4); } -void prdfResolutionMap::Add(const char *i_ble, - prdfResolution * r1, - prdfResolution * r2, - prdfResolution * r3, - prdfResolution * r4, - prdfResolution * r5) +void ResolutionMap::Add( const char *i_ble, + Resolution * r1, Resolution * r2, Resolution * r3, + Resolution * r4, Resolution * r5 ) { Add(i_ble,r1,r2); Add(i_ble,r3,r4,r5); } -void prdfResolutionMap::Add(const char *i_ble, - prdfResolution * r1, - prdfResolution * r2, - prdfResolution * r3, - prdfResolution * r4, - prdfResolution * r5, - prdfResolution * r6) +void ResolutionMap::Add( const char *i_ble, + Resolution * r1, Resolution * r2, Resolution * r3, + Resolution * r4, Resolution * r5, Resolution * r6 ) { Add(i_ble,r1,r2,r3); @@ -365,17 +349,15 @@ void prdfResolutionMap::Add(const char *i_ble, //------------------------------------------------------------------------------ -void prdfResolutionMap::Add(const char *i_ble, - prdfResolution * r1, - prdfResolution * r2, - prdfResolution * r3, - prdfResolution * r4, - prdfResolution * r5, - prdfResolution * r6, - prdfResolution * r7) +void ResolutionMap::Add( const char *i_ble, + Resolution * r1, Resolution * r2, Resolution * r3, + Resolution * r4, Resolution * r5, Resolution * r6, + Resolution * r7 ) { Add(i_ble,r1,r2,r3); Add(i_ble,r4,r5,r6,r7); } +} // end namespace PRDF + diff --git a/src/usr/diag/prdf/common/framework/resolution/prdfResolutionMap.H b/src/usr/diag/prdf/common/framework/resolution/prdfResolutionMap.H index 197a5f429..4c83a6fe7 100755 --- a/src/usr/diag/prdf/common/framework/resolution/prdfResolutionMap.H +++ b/src/usr/diag/prdf/common/framework/resolution/prdfResolutionMap.H @@ -24,8 +24,8 @@ /*! /file prdfResolutionMap.H * /brief Map Bit List encodings to Resolutions */ -#ifndef prdfResolutionMap_h -#define prdfResolutionMap_h +#ifndef ResolutionMap_h +#define ResolutionMap_h //-------------------------------------------------------------------- // Includes //-------------------------------------------------------------------- @@ -35,11 +35,14 @@ #include <prdfResolutionList.H> #include <prdfFilters.H> +namespace PRDF +{ + //-------------------------------------------------------------------- // Forward References //-------------------------------------------------------------------- struct STEP_CODE_DATA_STRUCT; //dg04c -//! prdfResolutionMap +//! ResolutionMap /*! This class prvodes mapping of a bitList key to a resolution list @code @@ -58,7 +61,7 @@ struct STEP_CODE_DATA_STRUCT; //dg04c } @endcode */ -class prdfResolutionMap +class ResolutionMap { public: /** @@ -69,12 +72,12 @@ public: @pre None @post Object created & space reserved */ - prdfResolutionMap(int32_t entryCount, prdfResolution &defaultResolution, prdfFilter * i_fltr = NULL); + ResolutionMap(int32_t entryCount, Resolution &defaultResolution, FilterClass * i_fltr = NULL); /* Destructor - compiler default is ok */ - //~prdfprdfResolutionMap(); + //~ResolutionMap(); // DRGDRG - Should we be returning a ResolutionList? or get rid of Default & use no bits on key??? /** @@ -83,13 +86,13 @@ public: @pre None @post None */ - prdfResolution & GetDefault(void) const; + Resolution & GetDefault(void) const; /** Replace the default Resolution @param Reference to new default resolution */ - void ReplaceDefaultWith(prdfResolution & r); + void ReplaceDefaultWith(Resolution & r); /** Add a key,Resolution pair @@ -97,106 +100,107 @@ public: @param 1 to 6 Resolutions */ void Add(uint8_t i_bitPos, - prdfResolution * i_res ); + Resolution * i_res ); void Add(uint8_t i_bitPos, - prdfResolution * i_r1, prdfResolution * i_r2); + Resolution * i_r1, Resolution * i_r2); void Add(uint8_t i_bitPos, - prdfResolution * i_r1, prdfResolution * i_r2, prdfResolution * i_r3); + Resolution * i_r1, Resolution * i_r2, Resolution * i_r3); void Add(uint8_t i_bitPos, - prdfResolution * i_r1, prdfResolution * i_r2, prdfResolution * i_r3, - prdfResolution * i_r4); + Resolution * i_r1, Resolution * i_r2, Resolution * i_r3, + Resolution * i_r4); void Add(uint8_t i_bitPos, - prdfResolution * i_r1, prdfResolution * i_r2, prdfResolution * i_r3, - prdfResolution * i_r4, prdfResolution * i_r5); + Resolution * i_r1, Resolution * i_r2, Resolution * i_r3, + Resolution * i_r4, Resolution * i_r5); void Add(uint8_t i_bitPos, - prdfResolution * i_r1, prdfResolution * i_r2, prdfResolution * i_r3, - prdfResolution * i_r4, prdfResolution * i_r5, prdfResolution * i_r6); + Resolution * i_r1, Resolution * i_r2, Resolution * i_r3, + Resolution * i_r4, Resolution * i_r5, Resolution * i_r6); void Add(uint8_t i_bitPos, - prdfResolution * i_r1, prdfResolution * i_r2, prdfResolution * i_r3, - prdfResolution * i_r4, prdfResolution * i_r5, prdfResolution * i_r6, - prdfResolution * i_r7); + Resolution * i_r1, Resolution * i_r2, Resolution * i_r3, + Resolution * i_r4, Resolution * i_r5, Resolution * i_r6, + Resolution * i_r7); /** - Add a key,prdfResolution pair + Add a key,Resolution pair @param i_ble - bit list encoding (array of bitPos) @param i_bleLen length of bit list - @param 1 to 6 prdfResolutions + @param 1 to 6 Resolutions */ void Add(const uint8_t *i_ble, uint8_t i_bleLen, - prdfResolution * res ); + Resolution * res ); void Add(const uint8_t *i_ble, uint8_t i_bleLen, - prdfResolution * r1, prdfResolution * r2); + Resolution * r1, Resolution * r2); void Add(const uint8_t *i_ble, uint8_t i_bleLen, - prdfResolution * r1, prdfResolution * r2, prdfResolution * r3); + Resolution * r1, Resolution * r2, Resolution * r3); void Add(const uint8_t *i_ble, uint8_t i_bleLen, - prdfResolution * r1, prdfResolution * r2, prdfResolution * r3, - prdfResolution * r4); + Resolution * r1, Resolution * r2, Resolution * r3, + Resolution * r4); void Add(const uint8_t *i_ble, uint8_t i_bleLen, - prdfResolution * r1, prdfResolution * r2, prdfResolution * r3, - prdfResolution * r4, prdfResolution * r5); + Resolution * r1, Resolution * r2, Resolution * r3, + Resolution * r4, Resolution * r5); void Add(const uint8_t *i_ble, uint8_t i_bleLen, - prdfResolution * r1, prdfResolution * r2, prdfResolution * r3, - prdfResolution * r4, prdfResolution * r5, prdfResolution * r6); + Resolution * r1, Resolution * r2, Resolution * r3, + Resolution * r4, Resolution * r5, Resolution * r6); //! Old Add interface /*! */ void Add(const char *i_ble, - prdfResolution * res ); + Resolution * res ); void Add(const char *i_ble, - prdfResolution * r1, prdfResolution * r2); + Resolution * r1, Resolution * r2); void Add(const char *i_ble, - prdfResolution * r1, prdfResolution * r2, prdfResolution * r3); + Resolution * r1, Resolution * r2, Resolution * r3); void Add(const char *i_ble, - prdfResolution * r1, prdfResolution * r2, prdfResolution * r3, - prdfResolution * r4); + Resolution * r1, Resolution * r2, Resolution * r3, + Resolution * r4); void Add(const char *i_ble, - prdfResolution * r1, prdfResolution * r2, prdfResolution * r3, - prdfResolution * r4, prdfResolution * r5); + Resolution * r1, Resolution * r2, Resolution * r3, + Resolution * r4, Resolution * r5); void Add(const char *i_ble, - prdfResolution * r1, prdfResolution * r2, prdfResolution * r3, - prdfResolution * r4, prdfResolution * r5, prdfResolution * r6); + Resolution * r1, Resolution * r2, Resolution * r3, + Resolution * r4, Resolution * r5, Resolution * r6); void Add(const char *i_ble, - prdfResolution * r1, prdfResolution * r2, prdfResolution * r3, - prdfResolution * r4, prdfResolution * r5, prdfResolution * r6, - prdfResolution * r7); + Resolution * r1, Resolution * r2, Resolution * r3, + Resolution * r4, Resolution * r5, Resolution * r6, + Resolution * r7); - void AddRange(const char *i_ble,prdfResolution * res ) { Add(i_ble,res); } - void AddRange(const char *i_ble,prdfResolution * r1, prdfResolution * r2) { Add(i_ble,r1,r2); } + void AddRange(const char *i_ble,Resolution * res ) { Add(i_ble,res); } + void AddRange(const char *i_ble,Resolution * r1, Resolution * r2) { Add(i_ble,r1,r2); } void AddRange(const char *i_ble, - prdfResolution * r1, prdfResolution * r2, prdfResolution * r3) { Add(i_ble,r1,r2,r3); } + Resolution * r1, Resolution * r2, Resolution * r3) { Add(i_ble,r1,r2,r3); } void AddRange(const char *i_ble, - prdfResolution * r1, prdfResolution * r2, prdfResolution * r3, - prdfResolution * r4) { Add(i_ble,r1,r2,r3,r4); } + Resolution * r1, Resolution * r2, Resolution * r3, + Resolution * r4) { Add(i_ble,r1,r2,r3,r4); } void AddRange(const char *i_ble, - prdfResolution * r1, prdfResolution * r2, prdfResolution * r3, - prdfResolution * r4, prdfResolution * r5) { Add(i_ble,r1,r2,r3,r4,r5); } + Resolution * r1, Resolution * r2, Resolution * r3, + Resolution * r4, Resolution * r5) { Add(i_ble,r1,r2,r3,r4,r5); } void AddRange(const char *i_ble, - prdfResolution * r1, prdfResolution * r2, prdfResolution * r3, - prdfResolution * r4, prdfResolution * r5, prdfResolution * r6) { Add(i_ble,r1,r2,r3,r4,r5,r6); } + Resolution * r1, Resolution * r2, Resolution * r3, + Resolution * r4, Resolution * r5, Resolution * r6) { Add(i_ble,r1,r2,r3,r4,r5,r6); } /** - Look up a prdfResolution for a bitlist + Look up a Resolution for a bitlist @param bitList - @returns List of all prdfResolutions that match + @returns List of all Resolutions that match @pre none - @post prdfResolution returned is only valid until the next call to LookUp or this object is destroyed. + @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 defaultprdfResolution is returned. + @notes if the bitList does not have a match then the defaultResolution is returned. */ - void LookUp(prdfResolutionList & o_list, prdfBitKey & io_bitList, STEP_CODE_DATA_STRUCT & scd); //dg04c + void LookUp( ResolutionList & o_list, BitKey & io_bitList, + STEP_CODE_DATA_STRUCT & scd ); /** * @brief Get the stored filter associated with this resolution map. * @returns Currently assigned filter. */ - prdfFilter * getFilter() { return iv_filter; }; + FilterClass * getFilter() { return iv_filter; }; /** * @brief Store a new filter with this resolution map. * @param i - Filter to store. */ - void setFilter(prdfFilter * i) { iv_filter = i; }; + void setFilter(FilterClass * i) { iv_filter = i; }; protected: // functions @@ -205,54 +209,45 @@ private: // functions /*! Copy prohibited */ - prdfResolutionMap(const prdfResolutionMap &); // Don't allow copy - No defn + ResolutionMap(const ResolutionMap &); // Don't allow copy - No defn /*! Assignment prohibited */ - const prdfResolutionMap &operator=(const prdfResolutionMap &); // Don't allow - no defn + const ResolutionMap &operator=(const ResolutionMap &); // Don't allow - no defn private: // Data struct RmPair { - prdfBitKey iv_blist; - prdfResolution * iv_res; - RmPair(uint8_t i_bitPos, prdfResolution *res) : iv_blist(i_bitPos), iv_res(res) {} + BitKey iv_blist; + Resolution * iv_res; + RmPair(uint8_t i_bitPos, Resolution *res) : iv_blist(i_bitPos), iv_res(res) {} RmPair(void) : iv_blist(), iv_res(NULL) {} }; typedef std::vector<RmPair> MapList; - prdfResolution * defaultRes; - prdfFilter * iv_filter; + Resolution * defaultRes; + FilterClass * iv_filter; MapList iv_list; // MapList iv_rangeList; }; -inline prdfResolutionMap::prdfResolutionMap(int32_t entryCount, - prdfResolution & defaultResolution, - prdfFilter * i_fltr) -: defaultRes(&defaultResolution), iv_filter(i_fltr), iv_list() +inline ResolutionMap::ResolutionMap( int32_t entryCount, + Resolution & defaultResolution, + FilterClass * i_fltr ) : + defaultRes(&defaultResolution), iv_filter(i_fltr), iv_list() { - iv_list.reserve(entryCount); + iv_list.reserve(entryCount); } -inline prdfResolution & prdfResolutionMap::GetDefault(void) const {return *defaultRes; } -inline void prdfResolutionMap::ReplaceDefaultWith(prdfResolution & r) { defaultRes = &r; } +inline Resolution & ResolutionMap::GetDefault(void) const {return *defaultRes; } +inline void ResolutionMap::ReplaceDefaultWith(Resolution & r) { defaultRes = &r; } + +} // end namespace PRDF -#endif /* prdfResolutionMap_h */ +#endif /* ResolutionMap_h */ -// Change Log ************************************************************************************* -// -// Flag Reason Vers Date Coder Description -// ---- -------- ------- -------- -------- ------------------------------------------------------- -// v4r1mo 05/02/96 DRG Initial Creation -// D49203.5 v4r3 07/30/97 DRG Add Add() for multiple resolutions -// fips 03/02/04 dgilbert Changes the way lookups are done -// 482244 fips225 11/04/04 dgilbert Add filter -// F544848 f300 04/03/06 iawillia Add multi-bit support for rule code -// dg04 568068 f310 08/29/06 dgilbert Add STEP_CODE_DATA_STRUCT to LookUp -// End Change Log ********************************************************************************* diff --git a/src/usr/diag/prdf/common/framework/resolution/prdfThresholdResolutions.C b/src/usr/diag/prdf/common/framework/resolution/prdfThresholdResolutions.C index f89adbbd2..0f59b51a2 100755 --- a/src/usr/diag/prdf/common/framework/resolution/prdfThresholdResolutions.C +++ b/src/usr/diag/prdf/common/framework/resolution/prdfThresholdResolutions.C @@ -45,6 +45,9 @@ // Global Variables //---------------------------------------------------------------------- +namespace PRDF +{ + // This is global varaible for stroring threshold policy instances. // It must be cleared in prdf uninitialize FlyWeight<ThresholdResolution::ThresholdPolicy, 10> g_thresholdPFW; @@ -73,7 +76,6 @@ const ThresholdResolution::ThresholdPolicy ThresholdResolution::cv_pllDefault // Internal Function Prototypes //---------------------------------------------------------------------- - //--------------------------------------------------------------------- // Member Function Specifications //--------------------------------------------------------------------- @@ -132,7 +134,7 @@ ThresholdResolution::ThresholdResolution( uint32_t maskId, int32_t ThresholdResolution::Resolve(STEP_CODE_DATA_STRUCT & error) { int32_t rc = SUCCESS; - PrdTimer curTime = error.service_data->GetTOE(); // get timestamp (Time Of Error) from SDC + Timer curTime = error.service_data->GetTOE(); // get timestamp (Time Of Error) from SDC ++iv_count; error.service_data->SetHits((uint8_t)iv_count); error.service_data->SetThreshold((uint8_t)iv_policy->threshold); @@ -215,7 +217,7 @@ int32_t ThresholdSigResolution::Resolve(STEP_CODE_DATA_STRUCT & error) { int32_t l_rc = SUCCESS; - PrdTimer l_curTime = error.service_data->GetTOE(); + Timer l_curTime = error.service_data->GetTOE(); ErrorSignature l_sig = *error.service_data->GetErrorSignature(); ThresholdCountAndTimer & l_countTime = iv_thresholds[l_sig]; @@ -257,3 +259,5 @@ int32_t ThresholdSigResolution::Resolve(STEP_CODE_DATA_STRUCT & error) return l_rc; } + +} // end namespace PRDF diff --git a/src/usr/diag/prdf/common/framework/resolution/prdfThresholdResolutions.H b/src/usr/diag/prdf/common/framework/resolution/prdfThresholdResolutions.H index 9d17a3879..1ea070b94 100755 --- a/src/usr/diag/prdf/common/framework/resolution/prdfThresholdResolutions.H +++ b/src/usr/diag/prdf/common/framework/resolution/prdfThresholdResolutions.H @@ -33,6 +33,10 @@ // Includes //-------------------------------------------------------------------- +#include <map> + +#include <prdfErrorSignature.H> + #if !defined(iipResolution_h) #include <iipResolution.h> #endif @@ -42,6 +46,9 @@ #include <prdfTimer.H> #endif +namespace PRDF +{ + //-------------------------------------------------------------------- // Forward References //-------------------------------------------------------------------- @@ -186,7 +193,7 @@ class ThresholdResolution : public MaskResolution //We take its value from global flyweight which will be freed in prd uninitialise const ThresholdPolicy * iv_policy; uint32_t iv_count; - PrdTimer iv_endTime; + Timer iv_endTime; }; @@ -198,8 +205,6 @@ class ThresholdResolution : public MaskResolution * ThresholdSigResolution class for each policy instead of one * ThresholdResolution for each error for each chip. */ -#include <map> -#include <prdfErrorSignature.H> class ThresholdSigResolution: public Resolution { public: @@ -248,7 +253,7 @@ class ThresholdSigResolution: public Resolution private: // Stores a count/timer pair. - typedef std::pair<uint32_t, PrdTimer> ThresholdCountAndTimer; + typedef std::pair<uint32_t, Timer> ThresholdCountAndTimer; // Policy for this object. // Though this is a pointer, we should never free it in destructor @@ -260,19 +265,7 @@ class ThresholdSigResolution: public Resolution }; +} // end namespace PRDF + #endif /* PRDFTHRESHOLDRESOLUTIONS_H */ -// Change Log ***************************************************************** -// -// Flag Reason Vers Date Coder Description -// ---- ------- ------- -------- -------- ------------------------------------ -// 400647 dgilbert Initial Creation -// wl01 406274 fips 06/27/03 lemmon add support for ThresholdResolution GetCount and ResetCount -// dg02 487035 fips222 12/10/04 dgilbert add operator== to MaskResolution -// 507223 fips310 06/03/05 iawillia Add ThresholdSigResolution -// D515833 fips300 09/19/05 iawillia Use VMap instead of Map. -// F522128 fips300 09/22/05 iawillia Add TwoPerDay policy. -// F523599 fips300 10/11/05 iawillia Add ThirtyThreePerHalfHour policy. -// F548507 fips300 04/21/06 iawillia Add FivePerDay policy. -// zs01 F565934 fips310 08/25/06 zshelle Add SixteenPerDay policy. -// End Change Log ************************************************************* diff --git a/src/usr/diag/prdf/common/framework/resolution/xspprdDumpResolution.C b/src/usr/diag/prdf/common/framework/resolution/xspprdDumpResolution.C index dc843396a..fceeb7193 100755 --- a/src/usr/diag/prdf/common/framework/resolution/xspprdDumpResolution.C +++ b/src/usr/diag/prdf/common/framework/resolution/xspprdDumpResolution.C @@ -37,6 +37,9 @@ #undef xspprdDumpResolution_C +namespace PRDF +{ + //--------------------------------------------------------------------- // Member Function Specifications //--------------------------------------------------------------------- @@ -53,3 +56,5 @@ int32_t DumpResolution::Resolve(STEP_CODE_DATA_STRUCT & error) return rc; } + +} // end namespace PRDF diff --git a/src/usr/diag/prdf/common/framework/resolution/xspprdDumpResolution.h b/src/usr/diag/prdf/common/framework/resolution/xspprdDumpResolution.h index 73400f2d8..caa93156c 100755 --- a/src/usr/diag/prdf/common/framework/resolution/xspprdDumpResolution.h +++ b/src/usr/diag/prdf/common/framework/resolution/xspprdDumpResolution.h @@ -48,6 +48,9 @@ #include <prdfPlatServices.H> +namespace PRDF +{ + //-------------------------------------------------------------------- // Forward References //-------------------------------------------------------------------- @@ -132,6 +135,7 @@ private: // Data TARGETING:: TargetHandle_t iv_pdumpHandle; }; +} // end namespace PRDF #endif /* xspprdDumpResolution_h */ diff --git a/src/usr/diag/prdf/common/framework/resolution/xspprdFlagResolution.C b/src/usr/diag/prdf/common/framework/resolution/xspprdFlagResolution.C index 16eb3572f..7549e964b 100755 --- a/src/usr/diag/prdf/common/framework/resolution/xspprdFlagResolution.C +++ b/src/usr/diag/prdf/common/framework/resolution/xspprdFlagResolution.C @@ -37,6 +37,9 @@ #undef xspprdFlagResolution_C +namespace PRDF +{ + //--------------------------------------------------------------------- // Member Function Specifications //--------------------------------------------------------------------- @@ -48,10 +51,5 @@ int32_t FlagResolution::Resolve(STEP_CODE_DATA_STRUCT & error) return rc; } -// Change Log ********************************************************* -// -// Flag Reason Vers Date Coder Description -// ---- -------- ---- -------- -------- ------------------------------ -// D49420.9 V5R2 12/04/00 mkobler Initial Creation -// -// End Change Log ***************************************************** +} // end namespace PRDF + diff --git a/src/usr/diag/prdf/common/framework/resolution/xspprdFlagResolution.h b/src/usr/diag/prdf/common/framework/resolution/xspprdFlagResolution.h index f1267b994..65f5c8b5b 100755 --- a/src/usr/diag/prdf/common/framework/resolution/xspprdFlagResolution.h +++ b/src/usr/diag/prdf/common/framework/resolution/xspprdFlagResolution.h @@ -45,6 +45,9 @@ #include <iipServiceDataCollector.h> #endif +namespace PRDF +{ + /** Set a Flag in the Service Data Collector @author Mike Kobler @@ -110,15 +113,7 @@ private: // Data }; +} // end namespace PRDF #endif /* xspprdFlagResolution_h */ -// Change Log ********************************************************* -// -// Flag Reason Vers Date Coder Description -// ---- -------- ---- -------- ------- ------------------------------- -// D49420.9 V5R2 12/04/00 mkobler Initial Creation -// f522283 300 09/27/05 dgilbert make FlyWeight-able -// D608564 f310 05/18/07 dgilbert add operator==() to fix mem leak -// -// End Change Log ***************************************************** diff --git a/src/usr/diag/prdf/common/framework/resolution/xspprdGardResolution.C b/src/usr/diag/prdf/common/framework/resolution/xspprdGardResolution.C index 88ea83333..8d6baed85 100755 --- a/src/usr/diag/prdf/common/framework/resolution/xspprdGardResolution.C +++ b/src/usr/diag/prdf/common/framework/resolution/xspprdGardResolution.C @@ -60,16 +60,14 @@ // Member Function Specifications //--------------------------------------------------------------------- +namespace PRDF +{ + int32_t GardResolution::Resolve(STEP_CODE_DATA_STRUCT & error) { error.service_data->Gard(xErrorType); return SUCCESS; } -// Change Log ********************************************************* -// -// Flag Reason Vers Date Coder Description -// ---- -------- ---- -------- -------- ------------------------------ -// DGILBERT Initial Creation -// -// End Change Log ***************************************************** +} // end namespace PRDF + diff --git a/src/usr/diag/prdf/common/framework/resolution/xspprdGardResolution.h b/src/usr/diag/prdf/common/framework/resolution/xspprdGardResolution.h index 4c1462f9a..74546aecc 100755 --- a/src/usr/diag/prdf/common/framework/resolution/xspprdGardResolution.h +++ b/src/usr/diag/prdf/common/framework/resolution/xspprdGardResolution.h @@ -43,6 +43,9 @@ #include <iipResolution.h> #endif +namespace PRDF +{ + //-------------------------------------------------------------------- // Forward References //-------------------------------------------------------------------- @@ -125,17 +128,7 @@ private: // Data }; +} // end namespace PRDF #endif /* xspprdGardResolution_h */ -// Change Log ********************************************************* -// -// Flag Reason Vers Date Coder Description -// ---- -------- ---- -------- ----- ------------------------------- -// 02/18/99 DRG Initial Creation -// D49420.8 v5r2 12/05/00 mak Change to use PRDcallout -// 05/18/07 drg add operator==() to prevent memory leak -// mp01 D672610 f320 08/28/08 plute Add CheckStopOnlyGard -// mp02 f710 08/06/08 plute Add DeconfigNoGard -// -// End Change Log ***************************************************** diff --git a/src/usr/diag/prdf/common/framework/resolution/xspprdTryResolution.h b/src/usr/diag/prdf/common/framework/resolution/xspprdTryResolution.h index 2dcf9cffc..753149ed8 100755 --- a/src/usr/diag/prdf/common/framework/resolution/xspprdTryResolution.h +++ b/src/usr/diag/prdf/common/framework/resolution/xspprdTryResolution.h @@ -42,6 +42,9 @@ #include <iipResolution.h> #endif +namespace PRDF +{ + //-------------------------------------------------------------------- // Forward References //-------------------------------------------------------------------- @@ -121,14 +124,7 @@ inline TryResolution::TryResolution() : xTryResolution(NULL), xDefaultResolution(NULL) {} +} // end namespace PRDF #endif /* xspprdTryResolution_h */ -// Change Log ********************************************************* -// -// Flag Reason Vers Date Coder Description -// ---- --------- ---- -------- -------- ------------------------------- -// d49274.xx v4r5 12/28/99 dgilbert Initial Creation -// f522283 300 09/27/05 dgilbert Make flyweight-able -// -// End Change Log ***************************************************** diff --git a/src/usr/diag/prdf/common/framework/rule/iipTemplates.C b/src/usr/diag/prdf/common/framework/rule/iipTemplates.C index 8d8572ca2..9653442f1 100755 --- a/src/usr/diag/prdf/common/framework/rule/iipTemplates.C +++ b/src/usr/diag/prdf/common/framework/rule/iipTemplates.C @@ -25,15 +25,10 @@ #include <iipDomainContainer.C> #include <prdfRuleChip.H> -template class DomainContainer<PrdfRuleChip>; +namespace PRDF +{ + +template class DomainContainer<RuleChip>; + +} // end namespace PRDF -// Change Log ********************************************************* -// -// Flag Reason Vers Date Coder Description -// ---- -------- ---- -------- -------- ------------------------------ -// DGILBERT Initial Creation -// F429488 fips 12/16/03 mkobler Added prdfMcChip template -// F494911 f310 03/04/05 iawillia Added PrdfRuleChip template. -// dg01 f300 04/05/06 dgilbert Added Domain of prdfExtensibleChip -// dg02 F557969 f310 07/05/06 dgilbert Remove obsolite parts -// End Change Log ***************************************************** diff --git a/src/usr/diag/prdf/common/framework/rule/prdfGroup.C b/src/usr/diag/prdf/common/framework/rule/prdfGroup.C index c80ab4aaa..bacbbe602 100755 --- a/src/usr/diag/prdf/common/framework/rule/prdfGroup.C +++ b/src/usr/diag/prdf/common/framework/rule/prdfGroup.C @@ -28,7 +28,10 @@ #include <prdfMain.H> #include <iipServiceDataCollector.h> -PrdfGroup::~PrdfGroup() +namespace PRDF +{ + +Group::~Group() { RegisterList_t::const_iterator l_errRegsEnd = cv_errRegs.end(); for (RegisterList_t::const_iterator i = cv_errRegs.begin(); @@ -56,9 +59,8 @@ PrdfGroup::~PrdfGroup() } } -int32_t PrdfGroup::Analyze(STEP_CODE_DATA_STRUCT & i_step) +int32_t Group::Analyze(STEP_CODE_DATA_STRUCT & i_step) { - using namespace PRDF; int32_t l_rc = -1; ServiceDataCollector l_backupStep(*i_step.service_data); int32_t l_tmpRC = SUCCESS; @@ -87,21 +89,21 @@ int32_t PrdfGroup::Analyze(STEP_CODE_DATA_STRUCT & i_step) return l_rc; }; -void PrdfGroup::Add(SCAN_COMM_REGISTER_CLASS * i_reg, +void Group::Add(SCAN_COMM_REGISTER_CLASS * i_reg, const uint8_t * i_bits, size_t i_bitSize, Resolution & i_action, - PrdfResetAndMaskPair & i_resets, + ResetAndMaskPair & i_resets, uint16_t i_scrID, bool i_reqTranspose) { - prdfFilter * l_transposeFilter = NULL; + FilterClass * l_transposeFilter = NULL; uint8_t l_bits[1] = { '\0' }; ResolutionMap * l_res = cv_resMaps[i_reg]; if (NULL == l_res) { - l_res = cv_resMaps[i_reg] = new prdfResolutionMap(1, cv_defaultRes); + l_res = cv_resMaps[i_reg] = new ResolutionMap(1, cv_defaultRes); ResetAndMaskErrorRegister * l_errReg = new ResetAndMaskErrorRegister(*i_reg, *l_res, i_scrID); cv_errRegs.push_back(l_errReg); @@ -137,8 +139,8 @@ void PrdfGroup::Add(SCAN_COMM_REGISTER_CLASS * i_reg, if (i_reqTranspose) { // Create key and transposition filter. Add to filter list. - prdfBitKey l_tmpKey(i_bits, i_bitSize); - l_transposeFilter = new prdfFilterTranspose(l_tmpKey, + BitKey l_tmpKey(i_bits, i_bitSize); + l_transposeFilter = new FilterTranspose(l_tmpKey, cv_nextBitForTranspose); cv_filters.push_back(l_transposeFilter); @@ -163,16 +165,16 @@ void PrdfGroup::Add(SCAN_COMM_REGISTER_CLASS * i_reg, l_res->Add(i_bits, i_bitSize, &i_action); }; -void PrdfGroup::Add(SCAN_COMM_REGISTER_CLASS * i_reg, +void Group::Add(SCAN_COMM_REGISTER_CLASS * i_reg, Resolution & i_action, - PrdfResetAndMaskPair & i_resets, + ResetAndMaskPair & i_resets, uint16_t i_scrID) { ResolutionMap * l_res = cv_resMaps[i_reg]; if (NULL == l_res) { - l_res = cv_resMaps[i_reg] = new prdfResolutionMap(1, cv_defaultRes); + l_res = cv_resMaps[i_reg] = new ResolutionMap(1, cv_defaultRes); ResetAndMaskErrorRegister * l_errReg = new ResetAndMaskErrorRegister(*i_reg, *l_res, i_scrID); cv_errRegs.push_back(l_errReg); @@ -208,7 +210,7 @@ void PrdfGroup::Add(SCAN_COMM_REGISTER_CLASS * i_reg, }; -void PrdfGroup::AddFilter(prdfFilter * i_filter) +void Group::AddFilter(FilterClass * i_filter) { // Add to filter list, for deallocation later. cv_filters.push_back(i_filter); @@ -219,7 +221,7 @@ void PrdfGroup::AddFilter(prdfFilter * i_filter) i++) { // Get old filter. - prdfFilter * l_filter = ((ResolutionMap *)(*i).second)->getFilter(); + FilterClass * l_filter = ((ResolutionMap *)(*i).second)->getFilter(); // Need new filter link? if (NULL != l_filter) @@ -243,37 +245,26 @@ void PrdfGroup::AddFilter(prdfFilter * i_filter) -const BIT_STRING_CLASS & PrdfGroup::Read(ATTENTION_TYPE i_attn) +const BIT_STRING_CLASS & Group::Read(ATTENTION_TYPE i_attn) { static BIT_STRING_BUFFER_CLASS a(64); return a; }; -BIT_LIST_CLASS PrdfGroup::Filter(const BIT_STRING_CLASS & i) +BIT_LIST_CLASS Group::Filter(const BIT_STRING_CLASS & i) { return BIT_LIST_CLASS(); }; -int32_t PrdfGroup::Lookup(STEP_CODE_DATA_STRUCT & i_step, BIT_LIST_CLASS & b) +int32_t Group::Lookup(STEP_CODE_DATA_STRUCT & i_step, BIT_LIST_CLASS & b) { return -1; }; -int32_t PrdfGroup::Reset(const BIT_LIST_CLASS & b, STEP_CODE_DATA_STRUCT & i_step) +int32_t Group::Reset(const BIT_LIST_CLASS & b, STEP_CODE_DATA_STRUCT & i_step) { return -1; }; -// Change Log ********************************************************* -// -// Flag Reason Vers Date Coder Description -// ---- -------- ---- -------- -------- ------------------------------- -// F494911 f310 03/04/05 iawillia Initial File Creation -// F510901 f300 07/15/05 iawillia Add support for resets/masks. -// D520844 f300 09/14/05 iawillia Add destructor to free memory. -// D515833 f300 09/19/05 iawillia Use VMap instead of Map. -// F544848 f300 04/03/06 iawillia Add multi-bit support. -// F548507 f300 04/21/06 iawillia Prevent multiple reset/masks. -// F557408 f310 06/16/06 iawillia Add single-bit filter support. -// pw01 D568068 f310 08/29/06 iawillia Fix filter order. -// End Change Log ***************************************************** +} // end namespace PRDF + diff --git a/src/usr/diag/prdf/common/framework/rule/prdfGroup.H b/src/usr/diag/prdf/common/framework/rule/prdfGroup.H index cad9822f2..9aa7fe2aa 100755 --- a/src/usr/diag/prdf/common/framework/rule/prdfGroup.H +++ b/src/usr/diag/prdf/common/framework/rule/prdfGroup.H @@ -32,6 +32,9 @@ #include <vector> #include <prdfFilters.H> +namespace PRDF +{ + // forward decls class Resolution; class ResolutionMap; @@ -41,20 +44,20 @@ class ErrorRegister; typedef std::pair<ResetAndMaskErrorRegister::ResetRegisterVector, ResetAndMaskErrorRegister::ResetRegisterVector> - PrdfResetAndMaskPair; + ResetAndMaskPair; -/*class PrdfResetAndMaskPair +/*class ResetAndMaskPair : public std::pair<ResetAndMaskErrorRegister::ResetRegisterVector, ResetAndMaskErrorRegister::ResetRegisterVector> {};*/ -class PrdfGroup : public ErrorRegisterType +class Group : public ErrorRegisterType { public: - PrdfGroup(Resolution & i_default) + Group(Resolution & i_default) : cv_nextBitForTranspose(64), cv_defaultRes(i_default) {}; - ~PrdfGroup(); + ~Group(); int32_t Analyze(STEP_CODE_DATA_STRUCT &); @@ -62,22 +65,22 @@ class PrdfGroup : public ErrorRegisterType const uint8_t *, size_t, Resolution &, - PrdfResetAndMaskPair &, + ResetAndMaskPair &, uint16_t, // SCRID. bool ); // add standard action. void Add(SCAN_COMM_REGISTER_CLASS * i_reg, Resolution & i_action, - PrdfResetAndMaskPair &, + ResetAndMaskPair &, uint16_t i_scrID); // add default action. - void AddFilter(prdfFilter * i_filter); + void AddFilter(FilterClass * i_filter); /** * No Filters applied by this Error Register - so undo is no-op */ - virtual bool FilterUndo(prdfBitKey & i_bit_list) { return false; } + virtual bool FilterUndo(BitKey & i_bit_list) { return false; } protected: const BIT_STRING_CLASS & Read(ATTENTION_TYPE i_attn); @@ -86,7 +89,7 @@ class PrdfGroup : public ErrorRegisterType int32_t Reset(const BIT_LIST_CLASS &, STEP_CODE_DATA_STRUCT &); typedef std::vector<ErrorRegister *> RegisterList_t; - typedef std::vector<prdfFilter *> FilterList_t; + typedef std::vector<FilterClass *> FilterList_t; typedef std::map<SCAN_COMM_REGISTER_CLASS *, ResolutionMap *> ResMaps_t; ResMaps_t cv_resMaps; @@ -97,17 +100,7 @@ class PrdfGroup : public ErrorRegisterType }; +} // end of namespace PRDF #endif -// Change Log ********************************************************* -// -// Flag Reason Vers Date Coder Description -// ---- -------- ---- -------- -------- ------------------------------- -// F494911 f310 03/04/05 iawillia Initial File Creation -// F510901 f300 07/15/05 iawillia Add support for resets/masks. -// D520844 f300 09/14/05 iawillia Add destructor to free memory. -// D515833 f300 09/19/05 iawillia Use VMap instead of Map. -// F544848 f300 04/03/06 iawillia Add multi-bit support. -// F557408 f310 06/16/06 iawillia Add single-bit filter support. -// End Change Log ***************************************************** diff --git a/src/usr/diag/prdf/common/framework/rule/prdfPluginDef.H b/src/usr/diag/prdf/common/framework/rule/prdfPluginDef.H index 16e198860..11e89e55d 100755 --- a/src/usr/diag/prdf/common/framework/rule/prdfPluginDef.H +++ b/src/usr/diag/prdf/common/framework/rule/prdfPluginDef.H @@ -32,7 +32,10 @@ #include <cstdlib> #endif -namespace PrdfPluginDef +namespace PRDF +{ + +namespace PluginDef { class ParameterList { @@ -119,40 +122,39 @@ namespace PrdfPluginDef }; -class PrdfExtensibleFunctionType +class ExtensibleFunctionType { public: - virtual ~PrdfExtensibleFunctionType() {}; + virtual ~ExtensibleFunctionType() {}; }; template <typename _ExtensibleObject> -class PrdfExtensibleFunction : public PrdfExtensibleFunctionType +class ExtensibleFunction : public ExtensibleFunctionType { public: - virtual ~PrdfExtensibleFunction() { } // zs01 + virtual ~ExtensibleFunction() { } // zs01 virtual int32_t operator()(_ExtensibleObject * A, - PrdfPluginDef::ParameterList * B) = 0; + PluginDef::ParameterList * B) = 0; }; -class PrdfExtensibleChip; -class PrdfExtensibleDomain; -typedef PrdfExtensibleFunction<PrdfExtensibleChip> PrdfExtensibleChipFunction; -typedef PrdfExtensibleFunction<PrdfExtensibleDomain> - PrdfExtensibleDomainFunction; - +class ExtensibleChip; +class ExtensibleDomain; +typedef ExtensibleFunction<ExtensibleChip> ExtensibleChipFunction; +typedef ExtensibleFunction<ExtensibleDomain> + ExtensibleDomainFunction; template <typename _ExtensibleObject> -class PrdfPlugin : public PrdfExtensibleFunction<_ExtensibleObject> +class Plugin : public ExtensibleFunction<_ExtensibleObject> { protected: - int32_t (*_func)(_ExtensibleObject *, PrdfPluginDef::ParameterList *); + int32_t (*_func)(_ExtensibleObject *, PluginDef::ParameterList *); public: - explicit PrdfPlugin(int32_t (*func)(_ExtensibleObject *, - PrdfPluginDef::ParameterList *)) + explicit Plugin(int32_t (*func)(_ExtensibleObject *, + PluginDef::ParameterList *)) : _func(func) {}; int32_t operator()(_ExtensibleObject * A, - PrdfPluginDef::ParameterList * B) + PluginDef::ParameterList * B) { int32_t i = 0; if (NULL != _func) @@ -165,16 +167,16 @@ class PrdfPlugin : public PrdfExtensibleFunction<_ExtensibleObject> }; template <typename _ExtensibleObject> -class PrdfPlugin_0arg : public PrdfExtensibleFunction<_ExtensibleObject> +class Plugin_0arg : public ExtensibleFunction<_ExtensibleObject> { protected: int32_t (*_func)(_ExtensibleObject *); public: - explicit PrdfPlugin_0arg(int32_t (*func)(_ExtensibleObject *)) + explicit Plugin_0arg(int32_t (*func)(_ExtensibleObject *)) : _func(func) {}; int32_t operator()(_ExtensibleObject * A, - PrdfPluginDef::ParameterList * B) + PluginDef::ParameterList * B) { int32_t i = _func(A); delete B; @@ -183,95 +185,95 @@ class PrdfPlugin_0arg : public PrdfExtensibleFunction<_ExtensibleObject> }; template <typename _ExtensibleObject> -inline PrdfPlugin_0arg<_ExtensibleObject> +inline Plugin_0arg<_ExtensibleObject> bind_plugin(int32_t (*func)(_ExtensibleObject *)) - { return PrdfPlugin_0arg<_ExtensibleObject>(func); }; + { return Plugin_0arg<_ExtensibleObject>(func); }; template <typename _ExtensibleObject> -inline PrdfPlugin_0arg<_ExtensibleObject> * +inline Plugin_0arg<_ExtensibleObject> * bind_plugin_ptr(int32_t (*func)(_ExtensibleObject *), void * ptr) - { return new (ptr) PrdfPlugin_0arg<_ExtensibleObject>(func); }; + { return new (ptr) Plugin_0arg<_ExtensibleObject>(func); }; template <typename _A, typename _ExtensibleObject> -class PrdfPlugin_1arg : public PrdfExtensibleFunction<_ExtensibleObject> +class Plugin_1arg : public ExtensibleFunction<_ExtensibleObject> { protected: int32_t (*_func)(_ExtensibleObject *, _A); public: - explicit PrdfPlugin_1arg(int32_t (*func)(_ExtensibleObject *, _A)) + explicit Plugin_1arg(int32_t (*func)(_ExtensibleObject *, _A)) : _func(func) {}; int32_t operator()(_ExtensibleObject * A, - PrdfPluginDef::ParameterList * B) + PluginDef::ParameterList * B) { int32_t i = _func(A, - (_A)static_cast<PrdfPluginDef::SingleParameter<_A> &>(*B)); + (_A)static_cast<PluginDef::SingleParameter<_A> &>(*B)); delete B; return i; }; }; template <typename _A, typename _ExtensibleObject> -inline PrdfPlugin_1arg<_A, _ExtensibleObject> +inline Plugin_1arg<_A, _ExtensibleObject> bind_plugin(int32_t (*func)(_ExtensibleObject *, _A)) - { return PrdfPlugin_1arg<_A, _ExtensibleObject>(func); }; + { return Plugin_1arg<_A, _ExtensibleObject>(func); }; template <typename _A, typename _ExtensibleObject> -inline PrdfPlugin_1arg<_A, _ExtensibleObject> * +inline Plugin_1arg<_A, _ExtensibleObject> * bind_plugin_ptr(int32_t (*func)(_ExtensibleObject *, _A), void * ptr) - { return new (ptr) PrdfPlugin_1arg<_A, _ExtensibleObject>(func); }; + { return new (ptr) Plugin_1arg<_A, _ExtensibleObject>(func); }; template <typename _A, typename _B, typename _ExtensibleObject> -class PrdfPlugin_2arg : public PrdfExtensibleFunction<_ExtensibleObject> +class Plugin_2arg : public ExtensibleFunction<_ExtensibleObject> { protected: int32_t (*_func)(_ExtensibleObject *, _A, _B); public: - explicit PrdfPlugin_2arg(int32_t (*func)(_ExtensibleObject *, _A, _B)) + explicit Plugin_2arg(int32_t (*func)(_ExtensibleObject *, _A, _B)) : _func(func) {}; int32_t operator()(_ExtensibleObject * A, - PrdfPluginDef::ParameterList * B) + PluginDef::ParameterList * B) { int32_t i = _func(A, - static_cast<PrdfPluginDef::TwoParameter<_A,_B> *>(B)->getA(), - static_cast<PrdfPluginDef::TwoParameter<_A,_B> *>(B)->getB()); + static_cast<PluginDef::TwoParameter<_A,_B> *>(B)->getA(), + static_cast<PluginDef::TwoParameter<_A,_B> *>(B)->getB()); delete B; return i; }; }; template <typename _A, typename _B, typename _ExtensibleObject> -inline PrdfPlugin_2arg<_A, _B, _ExtensibleObject> +inline Plugin_2arg<_A, _B, _ExtensibleObject> bind_plugin(int32_t (*func)(_ExtensibleObject *, _A, _B)) - { return PrdfPlugin_2arg<_A, _B, _ExtensibleObject>(func); }; + { return Plugin_2arg<_A, _B, _ExtensibleObject>(func); }; template <typename _A, typename _B, typename _ExtensibleObject> -inline PrdfPlugin_2arg<_A, _B, _ExtensibleObject> * +inline Plugin_2arg<_A, _B, _ExtensibleObject> * bind_plugin_ptr(int32_t (*func)(_ExtensibleObject *, _A, _B), void * ptr) - { return new (ptr) PrdfPlugin_2arg<_A, _B, _ExtensibleObject>(func); }; + { return new (ptr) Plugin_2arg<_A, _B, _ExtensibleObject>(func); }; template <typename _A, typename _B, typename _C, typename _ExtensibleObject> -class PrdfPlugin_3arg : public PrdfExtensibleFunction<_ExtensibleObject> +class Plugin_3arg : public ExtensibleFunction<_ExtensibleObject> { protected: int32_t (*_func)(_ExtensibleObject *, _A, _B, _C); public: - explicit PrdfPlugin_3arg(int32_t (*func) + explicit Plugin_3arg(int32_t (*func) (_ExtensibleObject *, _A, _B, _C)) : _func(func) {}; int32_t operator()(_ExtensibleObject * A, - PrdfPluginDef::ParameterList * B) + PluginDef::ParameterList * B) { int32_t i = _func(A, - static_cast<PrdfPluginDef::ThreeParameter<_A,_B,_C> *> + static_cast<PluginDef::ThreeParameter<_A,_B,_C> *> (B)->getA(), - static_cast<PrdfPluginDef::ThreeParameter<_A,_B,_C> *> + static_cast<PluginDef::ThreeParameter<_A,_B,_C> *> (B)->getB(), - static_cast<PrdfPluginDef::ThreeParameter<_A,_B,_C> *> + static_cast<PluginDef::ThreeParameter<_A,_B,_C> *> (B)->getC() ); delete B; @@ -280,39 +282,39 @@ class PrdfPlugin_3arg : public PrdfExtensibleFunction<_ExtensibleObject> }; template <typename _A, typename _B, typename _C, typename _ExtensibleObject> -inline PrdfPlugin_3arg<_A, _B, _C, _ExtensibleObject> +inline Plugin_3arg<_A, _B, _C, _ExtensibleObject> bind_plugin(int32_t (*func)(_ExtensibleObject *, _A, _B, _C)) - { return PrdfPlugin_3arg<_A, _B, _C, _ExtensibleObject>(func); }; + { return Plugin_3arg<_A, _B, _C, _ExtensibleObject>(func); }; template <typename _A, typename _B, typename _C, typename _ExtensibleObject> -inline PrdfPlugin_3arg<_A, _B, _C, _ExtensibleObject> * +inline Plugin_3arg<_A, _B, _C, _ExtensibleObject> * bind_plugin_ptr(int32_t (*func)(_ExtensibleObject *, _A, _B, _C), void * ptr) { return new (ptr) - PrdfPlugin_3arg<_A, _B, _C, _ExtensibleObject>(func); }; + Plugin_3arg<_A, _B, _C, _ExtensibleObject>(func); }; template <typename _A, typename _B, typename _C, typename _D, typename _ExtensibleObject> -class PrdfPlugin_4arg : public PrdfExtensibleFunction<_ExtensibleObject> +class Plugin_4arg : public ExtensibleFunction<_ExtensibleObject> { protected: int32_t (*_func)(_ExtensibleObject *, _A, _B, _C, _D); public: - explicit PrdfPlugin_4arg(int32_t (*func) + explicit Plugin_4arg(int32_t (*func) (_ExtensibleObject *, _A, _B, _C, _D)) : _func(func) {}; int32_t operator()(_ExtensibleObject * A, - PrdfPluginDef::ParameterList * B) + PluginDef::ParameterList * B) { int32_t i = _func(A, - static_cast<PrdfPluginDef::FourParameter<_A,_B,_C,_D> *> + static_cast<PluginDef::FourParameter<_A,_B,_C,_D> *> (B)->getA(), - static_cast<PrdfPluginDef::FourParameter<_A,_B,_C,_D> *> + static_cast<PluginDef::FourParameter<_A,_B,_C,_D> *> (B)->getB(), - static_cast<PrdfPluginDef::FourParameter<_A,_B,_C,_D> *> + static_cast<PluginDef::FourParameter<_A,_B,_C,_D> *> (B)->getC(), - static_cast<PrdfPluginDef::FourParameter<_A,_B,_C,_D> *> + static_cast<PluginDef::FourParameter<_A,_B,_C,_D> *> (B)->getD() ); delete B; @@ -322,47 +324,40 @@ class PrdfPlugin_4arg : public PrdfExtensibleFunction<_ExtensibleObject> template <typename _A, typename _B, typename _C, typename _D, typename _ExtensibleObject> -inline PrdfPlugin_4arg<_A, _B, _C, _D, _ExtensibleObject> +inline Plugin_4arg<_A, _B, _C, _D, _ExtensibleObject> bind_plugin(int32_t (*func)(_ExtensibleObject *, _A, _B, _C, _D)) - { return PrdfPlugin_4arg<_A, _B, _C, _D, _ExtensibleObject>(func); }; + { return Plugin_4arg<_A, _B, _C, _D, _ExtensibleObject>(func); }; template <typename _A, typename _B, typename _C, typename _D, typename _ExtensibleObject> -inline PrdfPlugin_4arg<_A, _B, _C, _D, _ExtensibleObject> * +inline Plugin_4arg<_A, _B, _C, _D, _ExtensibleObject> * bind_plugin_ptr(int32_t (*func)(_ExtensibleObject *, _A, _B, _C, _D), void * ptr) { return new (ptr) - PrdfPlugin_4arg<_A, _B, _C, _D, _ExtensibleObject>(func); }; + Plugin_4arg<_A, _B, _C, _D, _ExtensibleObject>(func); }; +} // end namespace PRDF #define __PRDF_PLUGIN_XYZ(X,Y,Z) X##Y##Z #define __PRDF_PLUGIN_MAKENAME(X,Y,Z) __PRDF_PLUGIN_XYZ(X,Y,Z) #define PRDF_PLUGIN_DEFINE(CHIP,PLUGIN_NAME) \ - class __PRDF_PLUGIN_MAKENAME(PrdfPlugin_Registration_,CHIP,PLUGIN_NAME) \ + class __PRDF_PLUGIN_MAKENAME(Plugin_Registration_,CHIP,PLUGIN_NAME) \ { \ private: \ - PrdfExtensibleFunctionType * cv_plugin; \ - PrdfPluginRegisterClass cv_registerClass; \ - char cv_plugin_space[sizeof(PrdfPlugin<PrdfExtensibleChip>)]; \ + ExtensibleFunctionType * cv_plugin; \ + PluginRegisterClass cv_registerClass; \ + char cv_plugin_space[sizeof(Plugin<ExtensibleChip>)]; \ public: \ - __PRDF_PLUGIN_MAKENAME(PrdfPlugin_Registration_,CHIP,PLUGIN_NAME)() : \ - cv_plugin( bind_plugin_ptr(&PRDF::CHIP::PLUGIN_NAME, \ + __PRDF_PLUGIN_MAKENAME(Plugin_Registration_,CHIP,PLUGIN_NAME)() : \ + cv_plugin( bind_plugin_ptr(&CHIP::PLUGIN_NAME, \ &cv_plugin_space) ), \ cv_registerClass(#CHIP,#PLUGIN_NAME,cv_plugin) \ {} \ }; \ - __PRDF_PLUGIN_MAKENAME(PrdfPlugin_Registration_,CHIP,PLUGIN_NAME) \ + __PRDF_PLUGIN_MAKENAME(Plugin_Registration_,CHIP,PLUGIN_NAME) \ __PRDF_PLUGIN_MAKENAME(g_PluginRegistration_,CHIP,PLUGIN_NAME) #endif #include <prdfPluginMap.H> -// Change Log ********************************************************* -// -// Flag Reason Vers Date Coder Description -// ---- -------- ---- -------- -------- ------------------------------- -// F494911 f310 03/04/05 iawillia Initial File Creation -// F522638 f300 09/27/05 iawillia Add 4 parm, fix possible obj strip. -// zs01 D620028 f330 07/25/07 zshelle Support for mcp5 compiler -// End Change Log ***************************************************** diff --git a/src/usr/diag/prdf/common/framework/rule/prdfPluginMap.C b/src/usr/diag/prdf/common/framework/rule/prdfPluginMap.C index 6a776d7e8..07edd6639 100755 --- a/src/usr/diag/prdf/common/framework/rule/prdfPluginMap.C +++ b/src/usr/diag/prdf/common/framework/rule/prdfPluginMap.C @@ -23,31 +23,36 @@ #include <prdfPluginMap.H> -PrdfPluginGlobalMap & prdfGetPluginGlobalMap() +namespace PRDF { - static PrdfPluginGlobalMap g_globalPluginMap; + +PluginGlobalMap & getPluginGlobalMap() +{ + static PluginGlobalMap g_globalPluginMap; return g_globalPluginMap; }; -void PrdfPluginGlobalMap::registerPlugin(const char * i_chipName, +void PluginGlobalMap::registerPlugin(const char * i_chipName, const char * i_pluginName, - PrdfExtensibleFunctionType * i_plugin) + ExtensibleFunctionType * i_plugin) { this->cv_globalMap[i_chipName][i_pluginName] = i_plugin; }; -PrdfPluginMap & PrdfPluginGlobalMap::getPlugins(const char * i_chipName) +PluginMap & PluginGlobalMap::getPlugins(const char * i_chipName) { return this->cv_globalMap[i_chipName]; }; -PrdfPluginRegisterClass::PrdfPluginRegisterClass( +PluginRegisterClass::PluginRegisterClass( const char * i_chipName, const char * i_pluginName, - PrdfExtensibleFunctionType * i_plugin) + ExtensibleFunctionType * i_plugin) { - prdfGetPluginGlobalMap().registerPlugin(i_chipName, + getPluginGlobalMap().registerPlugin(i_chipName, i_pluginName, i_plugin); }; +} // end namespace PRDF + diff --git a/src/usr/diag/prdf/common/framework/rule/prdfPluginMap.H b/src/usr/diag/prdf/common/framework/rule/prdfPluginMap.H index dea82cd97..8c348e471 100755 --- a/src/usr/diag/prdf/common/framework/rule/prdfPluginMap.H +++ b/src/usr/diag/prdf/common/framework/rule/prdfPluginMap.H @@ -29,13 +29,16 @@ #include <string.h> #include <functional> -class PrdfExtensibleChip; +namespace PRDF +{ + +class ExtensibleChip; /** * @brief custom comparison functor to pass to a map container * that uses char* as the key */ -struct PrdfStrCompare : public std::binary_function<const char*, const char*, bool> +struct StrCompare : public std::binary_function<const char*, const char*, bool> { public: bool operator() (const char* str1, const char* str2) const @@ -44,32 +47,34 @@ struct PrdfStrCompare : public std::binary_function<const char*, const char*, bo } }; -typedef std::map<const char *, PrdfExtensibleFunctionType *, PrdfStrCompare> PrdfPluginMap; +typedef std::map<const char *, ExtensibleFunctionType *, StrCompare> PluginMap; -class PrdfPluginGlobalMap; -PrdfPluginGlobalMap & prdfGetPluginGlobalMap(); +class PluginGlobalMap; +PluginGlobalMap & getPluginGlobalMap(); -class PrdfPluginGlobalMap +class PluginGlobalMap { private: - std::map<const char *, PrdfPluginMap, PrdfStrCompare> cv_globalMap; + std::map<const char *, PluginMap, StrCompare> cv_globalMap; public: - PrdfPluginGlobalMap() : cv_globalMap() {}; + PluginGlobalMap() : cv_globalMap() {}; void registerPlugin(const char * i_chipName, const char * i_pluginName, - PrdfExtensibleFunctionType * i_plugin); + ExtensibleFunctionType * i_plugin); - PrdfPluginMap & getPlugins(const char * i_chipName); + PluginMap & getPlugins(const char * i_chipName); }; -class PrdfPluginRegisterClass +class PluginRegisterClass { public: - PrdfPluginRegisterClass(const char * i_chipName, + PluginRegisterClass(const char * i_chipName, const char * i_pluginName, - PrdfExtensibleFunctionType * i_plugin); + ExtensibleFunctionType * i_plugin); }; +} // end namespace PRDF + #endif diff --git a/src/usr/diag/prdf/common/framework/rule/prdfRuleChip.C b/src/usr/diag/prdf/common/framework/rule/prdfRuleChip.C index 50d054122..a5f7e5ac1 100755 --- a/src/usr/diag/prdf/common/framework/rule/prdfRuleChip.C +++ b/src/usr/diag/prdf/common/framework/rule/prdfRuleChip.C @@ -46,7 +46,7 @@ #include <iipEregResolution.h> // for EregResolution #include <xspprdDumpResolution.h> // for DumpResolution #include <xspprdTryResolution.h> // for TryResolution -#include <prdfPluginCallResolution.H> // for PrdfPluginCallResolution +#include <prdfPluginCallResolution.H> // for PluginCallResolution #include <prdfAnalyzeConnected.H> // for prdfAnalyzeConnected #include <iipSystem.h> // for System #include <xspprdFlagResolution.h> @@ -61,9 +61,12 @@ #include <prdfResetOperators.H> #include <algorithm> +namespace PRDF +{ + template <bool Type> struct ResetAndMaskTransformer - : public std::unary_function<Prdr::PrdrRegister::ResetOrMaskStruct, + : public std::unary_function<Prdr::Register::ResetOrMaskStruct, ResetAndMaskErrorRegister::ResetRegisterStruct> { ResetAndMaskTransformer(ScanFacility & i_scanFactory, @@ -77,7 +80,7 @@ struct ResetAndMaskTransformer virtual ~ResetAndMaskTransformer() {}; // zs01 virtual ResetAndMaskErrorRegister::ResetRegisterStruct - operator()(const Prdr::PrdrRegister::ResetOrMaskStruct & i) + operator()(const Prdr::Register::ResetOrMaskStruct & i) { ResetAndMaskErrorRegister::ResetRegisterStruct o; @@ -121,14 +124,12 @@ struct ResetAndMaskTransformer }; -void PrdfRuleChip::loadRuleFile(ScanFacility & i_scanFactory, +void RuleChip::loadRuleFile(ScanFacility & i_scanFactory, ResolutionFactory & i_reslFactory) { - using namespace PRDF; - RegMap_t l_regMap; Reset_t l_resetMap; - PrdfResetAndMaskPair l_currentResets; + ResetAndMaskPair l_currentResets; uint32_t l_regMax = 0; uint32_t l_vregMax = 0; GroupMap_t l_groupMap; @@ -139,7 +140,7 @@ void PrdfRuleChip::loadRuleFile(ScanFacility & i_scanFactory, SharedThreshold_t l_sharedThresholds; - Prdr::PrdrChip * l_chip; + Prdr::Chip * l_chip; /* Initialize local data struct to pass to sub-functions */ RuleFileData l_localData = { l_regMap, l_groupMap, l_actionMap, @@ -204,10 +205,10 @@ void PrdfRuleChip::loadRuleFile(ScanFacility & i_scanFactory, // there is a capture type or requirement without a group statement in the rule file. bool l_group_is_created = false; // Copy into capture groups. - std::vector<Prdr::PrdrRegister::CaptureInfoStruct>::const_iterator + std::vector<Prdr::Register::CaptureInfoStruct>::const_iterator l_capturesEnd = l_chip->cv_registers[i].cv_captures.end(); //For each capture in this register save a Group Type or Requirement. - for(std::vector<Prdr::PrdrRegister::CaptureInfoStruct>::const_iterator + for(std::vector<Prdr::Register::CaptureInfoStruct>::const_iterator j = l_chip->cv_registers[i].cv_captures.begin(); j != l_capturesEnd; ++j) @@ -223,22 +224,22 @@ void PrdfRuleChip::loadRuleFile(ScanFacility & i_scanFactory, // i_group of 2 which is not called. else if('T' == (*j).op) { - //@jl06. d Deleted temporary declaration of PrdfCaptureType in + //@jl06. d Deleted temporary declaration of CaptureType in // favor of an anonymous declaration. Calls ctor twice. cv_hwCaptureType[l_regMap[l_id]] = - PrdfCaptureType((RegType)(*j).data[0]); //@jl06 c. + CaptureType((RegType)(*j).data[0]); //@jl06 c. } // @jl04 a Stop. else if ('f' == (*j).op) { - PrdfCaptureRequirement req; + CaptureRequirement req; req.cv_func = this->getExtensibleFunction(j->func); cv_hwCaptureReq[l_regMap[l_id]] = req; } else // 'C' { - PrdfCaptureRequirement req; + CaptureRequirement req; req.cv_TargetType = (*j).data[0]; req.cv_TargetIndex = (*j).data[1]; req.cv_func = NULL; @@ -264,7 +265,7 @@ void PrdfRuleChip::loadRuleFile(ScanFacility & i_scanFactory, continue; } - l_currentResets = PrdfResetAndMaskPair(); + l_currentResets = ResetAndMaskPair(); SCAN_COMM_REGISTER_CLASS * l_tmp = this->createVirtualRegister(&l_chip->cv_rules[i], l_localData); @@ -281,7 +282,7 @@ void PrdfRuleChip::loadRuleFile(ScanFacility & i_scanFactory, MRU_MED ); for (int i = 0; i < l_chip->cv_groupCount; i++) { - PrdfGroup * l_tmp = new PrdfGroup(l_defaultResolution); + Group * l_tmp = new Group(l_defaultResolution); l_groupMap[l_id] = l_tmp; l_groupMax = l_id++; }; @@ -302,27 +303,27 @@ void PrdfRuleChip::loadRuleFile(ScanFacility & i_scanFactory, for (int i = 0; i < l_chip->cv_groupCount; i++) { - this->createGroup((PrdfGroup *) l_groupMap[i+l_vregMax+1], + this->createGroup((Group *) l_groupMap[i+l_vregMax+1], i, l_localData); } - for (int i = 0; i < NUM_GROUP_ATTN; i++) // @jl02 UNIT_CS Changes. JL + for (int i = 0; i < Prdr::NUM_GROUP_ATTN; i++) cv_groupAttn[i] = l_groupMap[l_chip->cv_groupAttn[i]]; // Call initialize plugin. - PrdfExtensibleChipFunction * l_init = getExtensibleFunction("Initialize", true); + ExtensibleChipFunction * l_init = getExtensibleFunction("Initialize", true); if (NULL != l_init) { (*l_init) (this, - PrdfPluginDef::bindParm<void*>(NULL) + PluginDef::bindParm<void*>(NULL) ); } return; }; -PrdfRuleChip::~PrdfRuleChip() +RuleChip::~RuleChip() { if (NULL != cv_dataBundle) { @@ -331,10 +332,9 @@ PrdfRuleChip::~PrdfRuleChip() }; -int32_t PrdfRuleChip::Analyze(STEP_CODE_DATA_STRUCT & i_serviceData, +int32_t RuleChip::Analyze(STEP_CODE_DATA_STRUCT & i_serviceData, ATTENTION_TYPE i_attnType) { - using namespace PRDF; ServiceDataCollector & i_sdc = *(i_serviceData.service_data); ErrorSignature & l_errSig = *(i_sdc.GetErrorSignature()); CaptureData & capture = i_serviceData.service_data->GetCaptureData(); // @jl04 a Add this for Drop call. @@ -357,12 +357,12 @@ int32_t PrdfRuleChip::Analyze(STEP_CODE_DATA_STRUCT & i_serviceData, #endif // Get capture data for this chip. Allow override. - PrdfExtensibleChipFunction * l_ignoreCapture = + ExtensibleChipFunction * l_ignoreCapture = getExtensibleFunction("PreventDefaultCapture", true); bool l_shouldPreventDefaultCapture = false; (*l_ignoreCapture) - (this, PrdfPluginDef::bindParm<STEP_CODE_DATA_STRUCT&, bool&> + (this, PluginDef::bindParm<STEP_CODE_DATA_STRUCT&, bool&> (i_serviceData, l_shouldPreventDefaultCapture)); if (!l_shouldPreventDefaultCapture) @@ -398,11 +398,11 @@ int32_t PrdfRuleChip::Analyze(STEP_CODE_DATA_STRUCT & i_serviceData, if (NULL != l_errReg) { //mp02 a Start //Call any pre analysis functions - PrdfExtensibleChipFunction * l_preAnalysis = + ExtensibleChipFunction * l_preAnalysis = getExtensibleFunction("PreAnalysis", true); bool analyzed = false; (*l_preAnalysis)(this, - PrdfPluginDef::bindParm<STEP_CODE_DATA_STRUCT&,bool&> + PluginDef::bindParm<STEP_CODE_DATA_STRUCT&,bool&> (i_serviceData,analyzed)); if ( !analyzed) l_rc = l_errReg->Analyze(i_serviceData); @@ -420,37 +420,36 @@ int32_t PrdfRuleChip::Analyze(STEP_CODE_DATA_STRUCT & i_serviceData, // Call mask plugin. if (i_serviceData.service_data->IsAtThreshold()) { - PrdfExtensibleChipFunction * l_mask = + ExtensibleChipFunction * l_mask = getExtensibleFunction("MaskError", true); (*l_mask)(this, - PrdfPluginDef::bindParm<STEP_CODE_DATA_STRUCT&>(i_serviceData) + PluginDef::bindParm<STEP_CODE_DATA_STRUCT&>(i_serviceData) ); //@pw01 } // Call reset plugin. - PrdfExtensibleChipFunction * l_reset = + ExtensibleChipFunction * l_reset = getExtensibleFunction("ResetError", true); (*l_reset)(this, - PrdfPluginDef::bindParm<STEP_CODE_DATA_STRUCT&>(i_serviceData) + PluginDef::bindParm<STEP_CODE_DATA_STRUCT&>(i_serviceData) ); //@pw01 } // Call postanalysis plugin. // @jl02 JL Adding PostAnalysis plugin call. - PrdfExtensibleChipFunction * l_postanalysis = + ExtensibleChipFunction * l_postanalysis = getExtensibleFunction("PostAnalysis", true); // @jl02 the true above means that a plugin may not exist for this call. // @jl02 JL Adding call for post analysis. (*l_postanalysis)(this, - PrdfPluginDef::bindParm<STEP_CODE_DATA_STRUCT&>(i_serviceData)); + PluginDef::bindParm<STEP_CODE_DATA_STRUCT&>(i_serviceData)); return l_rc; }; -int32_t PrdfRuleChip::CaptureErrorData(CaptureData & i_cap, int i_group) +int32_t RuleChip::CaptureErrorData(CaptureData & i_cap, int i_group) { using namespace TARGETING; - using namespace PRDF; std::vector<SCAN_COMM_REGISTER_CLASS *>::const_iterator l_hwCaptureEnd = cv_hwCaptureGroups[i_group].end(); @@ -460,13 +459,13 @@ int32_t PrdfRuleChip::CaptureErrorData(CaptureData & i_cap, int i_group) ++i) { // Check that requirements are satisfied. - if (PrdfCaptureRequirement() != cv_hwCaptureReq[*i]) + if (CaptureRequirement() != cv_hwCaptureReq[*i]) { - PrdfCaptureRequirement req = cv_hwCaptureReq[*i]; + CaptureRequirement req = cv_hwCaptureReq[*i]; if (NULL != req.cv_func) { bool l_cap = true; - (*req.cv_func)(this, PrdfPluginDef::bindParm<bool &>(l_cap)); + (*req.cv_func)(this, PluginDef::bindParm<bool &>(l_cap)); if (!l_cap) continue; } @@ -500,20 +499,20 @@ int32_t PrdfRuleChip::CaptureErrorData(CaptureData & i_cap, int i_group) } // Call "PostCapture" plugin - PrdfExtensibleChipFunction * l_postCapture = + ExtensibleChipFunction * l_postCapture = getExtensibleFunction("PostCapture", true); (*l_postCapture) (this, - PrdfPluginDef::bindParm<CaptureData &, int>(i_cap, i_group) + PluginDef::bindParm<CaptureData &, int>(i_cap, i_group) ); return SUCCESS; } SCAN_COMM_REGISTER_CLASS * -PrdfRuleChip::createVirtualRegister( - Prdr::PrdrExpr * i_vReg, +RuleChip::createVirtualRegister( + Prdr::Expr * i_vReg, RuleFileData & i_data ) { @@ -618,9 +617,8 @@ PrdfRuleChip::createVirtualRegister( return l_rc; }; -Resolution * -PrdfRuleChip::createActionClass(uint32_t i_action, - PrdfRuleChip::RuleFileData & i_data) +Resolution * RuleChip::createActionClass( uint32_t i_action, + RuleChip::RuleFileData & i_data ) { if (NULL != i_data.cv_actionMap[i_action]) return i_data.cv_actionMap[i_action]; @@ -659,12 +657,9 @@ PrdfRuleChip::createActionClass(uint32_t i_action, return l_retRes; }; -Resolution * -PrdfRuleChip::createResolution(Prdr::PrdrExpr * i_action, - PrdfRuleChip::RuleFileData & i_data) +Resolution * RuleChip::createResolution( Prdr::Expr * i_action, + RuleChip::RuleFileData & i_data ) { - using namespace PRDF; - Resolution * l_rc = NULL; switch (i_action->cv_op) @@ -721,10 +716,10 @@ PrdfRuleChip::createResolution(Prdr::PrdrExpr * i_action, } else if(i_action->cv_value[4].i) { - // FIXME : need to uncomment PrdfMfgThresholdMgr after we figure it out + // FIXME : need to uncomment MfgThresholdMgr after we figure it out #ifndef __HOSTBOOT_MODULE l_rc = &i_data.cv_reslFactory.GetThresholdSigResolution( - *(PrdfMfgThresholdMgr::getInstance()-> + *(MfgThresholdMgr::getInstance()-> getThresholdP(i_action->cv_value[3].i))); #endif } @@ -738,7 +733,7 @@ PrdfRuleChip::createResolution(Prdr::PrdrExpr * i_action, else if (NULL == i_data.cv_sharedThresholds[i_action->cv_value[5].i]) { - if ( !PRDF::PlatServices::mfgMode() ) + if ( !PlatServices::mfgMode() ) { l_rc = &i_data.cv_reslFactory. GetThresholdResolution(i_action->cv_value[5].i, @@ -746,11 +741,11 @@ PrdfRuleChip::createResolution(Prdr::PrdrExpr * i_action, } else if(i_action->cv_value[4].i) { - // FIXME : need to uncomment PrdfMfgThresholdMgr after we figure it out + // FIXME : need to uncomment MfgThresholdMgr after we figure it out #ifndef __HOSTBOOT_MODULE l_rc = &i_data.cv_reslFactory. GetThresholdResolution(i_action->cv_value[5].i, - *(PrdfMfgThresholdMgr::getInstance()-> + *(MfgThresholdMgr::getInstance()-> getThresholdP(i_action->cv_value[3].i))); #endif } @@ -836,16 +831,16 @@ PrdfRuleChip::createResolution(Prdr::PrdrExpr * i_action, return l_rc; }; -void PrdfRuleChip::createGroup(PrdfGroup * i_group, +void RuleChip::createGroup(Group * i_group, uint32_t i_groupId, - PrdfRuleChip::RuleFileData & i_data) + RuleChip::RuleFileData & i_data) { // Internal class to collapse the bit string. class CreateBitString { public: static void execute(std::vector<uint8_t> & i_bits, - Prdr::PrdrExpr * i_expr) + Prdr::Expr * i_expr) { if (NULL == i_expr) return; @@ -870,7 +865,7 @@ void PrdfRuleChip::createGroup(PrdfGroup * i_group, // TODO : handle & transformations. // Get expression for group's line. - Prdr::PrdrExpr * l_expr = &i_data.cv_loadChip->cv_groups[i_groupId][i]; + Prdr::Expr * l_expr = &i_data.cv_loadChip->cv_groups[i_groupId][i]; // Execute internal (recursive) class to generate bit string. CreateBitString::execute(l_bits, l_expr->cv_value[1].p); @@ -898,7 +893,7 @@ void PrdfRuleChip::createGroup(PrdfGroup * i_group, CreateBitString::execute(l_bits, i_data.cv_loadChip->cv_groupPriorityBits[i_groupId]); - prdfFilter * l_filter = new PrioritySingleBitFilter(l_bits); + FilterClass * l_filter = new PrioritySingleBitFilter(l_bits); i_group->AddFilter(l_filter); } @@ -906,19 +901,19 @@ void PrdfRuleChip::createGroup(PrdfGroup * i_group, if (i_data.cv_loadChip->cv_groupFlags[i_groupId] & Prdr::PRDR_GROUP_FILTER_SINGLE_BIT) { - prdfFilter * l_filter = new SingleBitFilter(); + FilterClass * l_filter = new SingleBitFilter(); i_group->AddFilter(l_filter); } } -PrdfExtensibleChipFunction * - PrdfRuleChip::getExtensibleFunction(const char * i_func, bool i_expectNull) +ExtensibleChipFunction * + RuleChip::getExtensibleFunction(const char * i_func, bool i_expectNull) { - PrdfExtensibleFunctionType * plugin = - prdfGetPluginGlobalMap().getPlugins(cv_fileName)[i_func]; + ExtensibleFunctionType * plugin = + getPluginGlobalMap().getPlugins(cv_fileName)[i_func]; if (NULL == plugin) { - static PrdfPlugin<PrdfExtensibleChip> l_nullPlugin(NULL); + static Plugin<ExtensibleChip> l_nullPlugin(NULL); plugin = &l_nullPlugin; if (!i_expectNull) @@ -930,7 +925,7 @@ PrdfExtensibleChipFunction * ERRL_ETYPE_NOT_APPLICABLE, SRCI_ERR_INFO, SRCI_NO_ATTR, - PRDF_PRDFRULECHIP, + PRDF_RULECHIP, LIC_REFCODE, PRDF_CODE_FAIL, __LINE__, @@ -939,24 +934,24 @@ PrdfExtensibleChipFunction * PRDF_ADD_FFDC(l_errl, cv_fileName, strlen(cv_fileName), - prdfErrlVer1, - prdfErrlString); + ErrlVer1, + ErrlString); PRDF_ADD_FFDC(l_errl, i_func, strlen(i_func), - prdfErrlVer1, - prdfErrlString); + ErrlVer1, + ErrlString); PRDF_COMMIT_ERRL(l_errl, ERRL_ACTION_REPORT); } } - return (PrdfExtensibleChipFunction *) plugin; + return (ExtensibleChipFunction *) plugin; } -SCAN_COMM_REGISTER_CLASS * PrdfRuleChip::getRegister(const char * i_reg, +SCAN_COMM_REGISTER_CLASS * RuleChip::getRegister(const char * i_reg, bool i_expectNull) { uint16_t hashId = Util::hashString( i_reg ); @@ -965,7 +960,7 @@ SCAN_COMM_REGISTER_CLASS * PrdfRuleChip::getRegister(const char * i_reg, if (NULL == l_register) { - static PrdfNullRegister l_nullRegister(1024); + static NullRegister l_nullRegister(1024); l_register = &l_nullRegister; if (!i_expectNull) @@ -976,7 +971,7 @@ SCAN_COMM_REGISTER_CLASS * PrdfRuleChip::getRegister(const char * i_reg, ERRL_ETYPE_NOT_APPLICABLE, SRCI_ERR_INFO, SRCI_NO_ATTR, - PRDF_PRDFRULECHIP, + PRDF_RULECHIP, LIC_REFCODE, PRDF_CODE_FAIL, __LINE__, @@ -985,15 +980,15 @@ SCAN_COMM_REGISTER_CLASS * PrdfRuleChip::getRegister(const char * i_reg, PRDF_ADD_FFDC(l_errl, cv_fileName, strlen(cv_fileName), - prdfErrlVer1, - prdfErrlString); + ErrlVer1, + ErrlString); PRDF_ADD_FFDC(l_errl, i_reg, strlen(i_reg), - prdfErrlVer1, - prdfErrlString); + ErrlVer1, + ErrlString); PRDF_COMMIT_ERRL(l_errl, ERRL_ACTION_REPORT); } @@ -1001,3 +996,6 @@ SCAN_COMM_REGISTER_CLASS * PrdfRuleChip::getRegister(const char * i_reg, } return l_register; } + +} // end namespace PRDF + diff --git a/src/usr/diag/prdf/common/framework/rule/prdfRuleChip.H b/src/usr/diag/prdf/common/framework/rule/prdfRuleChip.H index 054a05971..e477d9ec5 100755 --- a/src/usr/diag/prdf/common/framework/rule/prdfRuleChip.H +++ b/src/usr/diag/prdf/common/framework/rule/prdfRuleChip.H @@ -39,6 +39,18 @@ #include <iipCaptureData.h> // @jl04 Added this for the RegType used for register = "PRIMARY" or "SECONDARY" //--------------------------------------- // Forward decls. + +namespace Prdr +{ + +class Chip; +class Expr; + +} // end namespace PRDR + +namespace PRDF +{ + class SCAN_COMM_REGISTER_CLASS; class ScanFacility; class ResolutionFactory; @@ -46,28 +58,24 @@ class STEP_CODE_DATA_STRUCT; class CaptureData; class ErrorRegisterType; class Resolution; -namespace Prdr -{ - class PrdrChip; - class PrdrExpr; -}; -class PrdfGroup; +class Group; + typedef std::pair<ResetAndMaskErrorRegister::ResetRegisterVector, ResetAndMaskErrorRegister::ResetRegisterVector> - PrdfResetAndMaskPair; + ResetAndMaskPair; // x86 compile wants this here - not forward declaired dgilbert -class PrdfCaptureRequirement +class CaptureRequirement { public: - PrdfCaptureRequirement() : + CaptureRequirement() : cv_TargetType(TARGETING::TYPE_NA), cv_TargetIndex(0), cv_func(NULL) { }; uint32_t cv_TargetType; uint32_t cv_TargetIndex; - PrdfExtensibleChipFunction * cv_func; + ExtensibleChipFunction * cv_func; - inline bool operator!=(const PrdfCaptureRequirement & r) + inline bool operator!=(const CaptureRequirement & r) { return ( (cv_TargetType != r.cv_TargetType) || (cv_TargetIndex != r.cv_TargetIndex) || @@ -78,26 +86,26 @@ class PrdfCaptureRequirement //-------------------------------------- // @jl04 a Start. // Adding capture requirement type for transporting data. -class PrdfCaptureType +class CaptureType { public: RegType cv_regType; // if (reg == 1) reg = PRIMARY; // if (reg == 2) reg = SECONDARY; - PrdfCaptureType(RegType reg = PRIMARY):cv_regType(reg){}; + CaptureType(RegType reg = PRIMARY):cv_regType(reg){}; }; // @jl04 a Stop. //-------------------------------------- -class PrdfRuleChip : public PrdfExtensibleChip +class RuleChip : public ExtensibleChip { public: typedef std::map<uint32_t, SCAN_COMM_REGISTER_CLASS *> RegMap_t; typedef std::map<uint32_t, ErrorRegisterType *> GroupMap_t; typedef std::map<uint32_t, Resolution *> ActionMap_t; - typedef std::map<uint32_t, PrdfResetAndMaskPair> Reset_t; + typedef std::map<uint32_t, ResetAndMaskPair> Reset_t; typedef std::map<uint32_t, Resolution *> SharedThreshold_t; struct RuleFileData @@ -110,10 +118,10 @@ class PrdfRuleChip : public PrdfExtensibleChip ResolutionFactory & cv_reslFactory; TARGETING::TargetHandle_t cv_chipHandle; - Prdr::PrdrChip *& cv_loadChip; // pw01 + Prdr::Chip *& cv_loadChip; // pw01 Reset_t & cv_resets; - PrdfResetAndMaskPair & cv_currentResets; + ResetAndMaskPair & cv_currentResets; SharedThreshold_t & cv_sharedThresholds; @@ -121,12 +129,12 @@ class PrdfRuleChip : public PrdfExtensibleChip public: // TODO : add parameter for parent domains, connected chip classes. - PrdfRuleChip(const char * i_fileName, + RuleChip(const char * i_fileName, TARGETING::TargetHandle_t i_pTargetHandle, ScanFacility & i_scanFactory, ResolutionFactory & i_reslFactory ) - : PrdfExtensibleChip(i_pTargetHandle), + : ExtensibleChip(i_pTargetHandle), cv_fileName(i_fileName), cv_dumpType(0), //@ecdf cv_dataBundle(NULL) @@ -134,22 +142,22 @@ class PrdfRuleChip : public PrdfExtensibleChip this->loadRuleFile(i_scanFactory, i_reslFactory); }; - ~PrdfRuleChip(); + ~RuleChip(); int32_t Analyze(STEP_CODE_DATA_STRUCT &, ATTENTION_TYPE); int32_t CaptureErrorData(CaptureData &, int i_group = 1); int32_t MaskError(uint32_t i) { return SUCCESS; }; - PrdfExtensibleChipFunction * + ExtensibleChipFunction * getExtensibleFunction(const char *, bool = false); SCAN_COMM_REGISTER_CLASS * getRegister(const char *, bool = false); - PrdfDataBundle *& getDataBundle() { return cv_dataBundle; }; + DataBundle *& getDataBundle() { return cv_dataBundle; }; uint32_t getSignatureOffset() const { return iv_sigOff; }; private: const char * cv_fileName; - PrdfErrlSmartPtr cv_errl; + ErrlSmartPtr cv_errl; uint32_t cv_dumpType; //@ecdf @@ -160,21 +168,21 @@ class PrdfRuleChip : public PrdfExtensibleChip typedef std::map<uint32_t, std::vector<SCAN_COMM_REGISTER_CLASS *> > HwCaptureGroup_t; HwCaptureGroup_t cv_hwCaptureGroups; - typedef std::map<SCAN_COMM_REGISTER_CLASS *, PrdfCaptureRequirement> HwCaptureReq_t; + typedef std::map<SCAN_COMM_REGISTER_CLASS *, CaptureRequirement> HwCaptureReq_t; HwCaptureReq_t cv_hwCaptureReq; //Adding another std::map for passing some data to capture stuff. - typedef std::map<SCAN_COMM_REGISTER_CLASS *, PrdfCaptureType> HwCaptureType_t; + typedef std::map<SCAN_COMM_REGISTER_CLASS *, CaptureType> HwCaptureType_t; HwCaptureType_t cv_hwCaptureType; - PrdfDataBundle * cv_dataBundle; - ErrorRegisterType * cv_groupAttn[NUM_GROUP_ATTN]; // @jl02 JL Changed from 3 to 4 with this const type. + DataBundle * cv_dataBundle; + ErrorRegisterType * cv_groupAttn[Prdr::NUM_GROUP_ATTN]; void loadRuleFile(ScanFacility &, ResolutionFactory &); SCAN_COMM_REGISTER_CLASS * - createVirtualRegister(Prdr::PrdrExpr *, + createVirtualRegister(Prdr::Expr *, RuleFileData &); Resolution * @@ -182,12 +190,14 @@ class PrdfRuleChip : public PrdfExtensibleChip RuleFileData &); Resolution * - createResolution(Prdr::PrdrExpr *, + createResolution(Prdr::Expr *, RuleFileData &); - void createGroup(PrdfGroup *, + void createGroup(Group *, uint32_t, RuleFileData &); }; +} // end namespace PRDF + #endif diff --git a/src/usr/diag/prdf/common/framework/rule/prdfRuleFiles.C b/src/usr/diag/prdf/common/framework/rule/prdfRuleFiles.C index 23e90e98d..2ffb46fa9 100755 --- a/src/usr/diag/prdf/common/framework/rule/prdfRuleFiles.C +++ b/src/usr/diag/prdf/common/framework/rule/prdfRuleFiles.C @@ -40,6 +40,6 @@ namespace PRDF const char * Membuf = "Membuf"; const char * Mba = "Mba"; -}; +} // end namespace PRDF #endif diff --git a/src/usr/diag/prdf/common/framework/rule/prdfRuleFiles.H b/src/usr/diag/prdf/common/framework/rule/prdfRuleFiles.H index 9f9777445..5c2158bf7 100755 --- a/src/usr/diag/prdf/common/framework/rule/prdfRuleFiles.H +++ b/src/usr/diag/prdf/common/framework/rule/prdfRuleFiles.H @@ -41,7 +41,7 @@ namespace PRDF extern const char * Membuf; extern const char * Mba; -}; +} // end namespace PRDF #endif diff --git a/src/usr/diag/prdf/common/framework/rule/prdrChip.H b/src/usr/diag/prdf/common/framework/rule/prdrChip.H index 51d90b23e..7855bba47 100755 --- a/src/usr/diag/prdf/common/framework/rule/prdrChip.H +++ b/src/usr/diag/prdf/common/framework/rule/prdrChip.H @@ -31,20 +31,23 @@ #include <prdrRegister.H> -class PrdrExtraSignature +namespace PRDR_COMPILER +{ + +class ExtraSignature { public: uint32_t iv_sig; std::string * iv_sname; std::string * iv_desc; - PrdrExtraSignature(uint32_t i_sig, + ExtraSignature(uint32_t i_sig, std::string * i_sname, std::string * i_desc) : iv_sig(i_sig), iv_sname(i_sname), iv_desc(i_desc) {}; - PrdrExtraSignature & operator=(const PrdrExtraSignature & l_rhs) + ExtraSignature & operator=(const ExtraSignature & l_rhs) { this->iv_sig = l_rhs.iv_sig; this->iv_sname = l_rhs.iv_sname; @@ -54,7 +57,7 @@ class PrdrExtraSignature }; }; -class PrdrChip +class Chip { public: std::string * cv_sname; @@ -63,14 +66,14 @@ class PrdrChip uint32_t cv_targetType; uint32_t cv_signatureOffset; uint32_t cv_dumptype; //@ecdf - PrdrRegisterList cv_reglist; - std::list<PrdrExtraSignature> cv_sigExtras; + RegisterList cv_reglist; + std::list<ExtraSignature> cv_sigExtras; uint16_t cv_scomlen; // Default Scom Address. std::string cv_name_default; - PrdrChip() : cv_sname(NULL), + Chip() : cv_sname(NULL), cv_name(&cv_name_default), cv_chipid(0), cv_targetType(0), @@ -80,7 +83,7 @@ class PrdrChip cv_sigExtras(), cv_scomlen(0) {}; - static void merge(PrdrChip * i_l, PrdrChip * i_r) + static void merge(Chip * i_l, Chip * i_r) { if (NULL != i_r->cv_sname) i_l->cv_sname = i_r->cv_sname; @@ -117,7 +120,7 @@ class PrdrChip cout << "\tDefault Dumptype: " << cv_dumptype << endl; //@ecdf cout << "\tDefault ScomLen: " << cv_scomlen << endl; cout << "\tRegisters: (" << cv_reglist.size() << ")" << endl; - for (PrdrRegisterList::iterator i = cv_reglist.begin(); + for (RegisterList::iterator i = cv_reglist.begin(); i != cv_reglist.end(); i++) { @@ -152,7 +155,7 @@ class PrdrChip l_temp16 = htons(cv_reglist.size()); fwrite(&l_temp16, sizeof(l_temp16), 1, l_file); - for (PrdrRegisterList::iterator i = cv_reglist.begin(); + for (RegisterList::iterator i = cv_reglist.begin(); i != cv_reglist.end(); i++) { @@ -167,7 +170,7 @@ class PrdrChip o_file << "( 0x" << std::hex << cv_targetType << ", 0x" << std::hex << cv_signatureOffset << " )" << std::endl; - for (PrdrRegisterList::iterator i = cv_reglist.begin(); + for (RegisterList::iterator i = cv_reglist.begin(); i != cv_reglist.end(); i++) { @@ -177,13 +180,7 @@ class PrdrChip }; }; +} // end namespace PRDR_COMPILER + #endif -// Change Log ********************************************************* -// -// Flag Reason Vers Date Coder Description -// ---- -------- ---- -------- -------- ------------------------------- -// F494911 f310 03/04/05 iawillia Initial File Creation -// ecdf F550548 f300 05/04/06 iawillia eClipz DUMP flags support. -// D586213 f310 02/19/07 iawillia Add extra signature support. -// End Change Log ***************************************************** diff --git a/src/usr/diag/prdf/common/framework/rule/prdrCommon.H b/src/usr/diag/prdf/common/framework/rule/prdrCommon.H index 47502a1be..70743f770 100755 --- a/src/usr/diag/prdf/common/framework/rule/prdrCommon.H +++ b/src/usr/diag/prdf/common/framework/rule/prdrCommon.H @@ -37,21 +37,20 @@ #include <string> #endif -// @jl02 JL adding a constant for the number of attention types. -enum PrdrNumberOfAttentions -{ - NUM_GROUP_ATTN = 4, -}; - - /** * @namespace Prdr * @brief Namespace to encapsulate Prdr specific enums, classes, and typedefs. */ namespace Prdr { + + enum NumberOfAttentions + { + NUM_GROUP_ATTN = 4, + }; + /** - * @enum PrdrRegisterFlags + * @enum RegisterFlags * @brief Flags for which register attributes are contained in a register * definition. * @@ -59,7 +58,7 @@ namespace Prdr * these flags that describe what attributes are non-default (and therefore * contained in the file). */ - enum PrdrRegisterFlags + enum RegisterFlags { /** Non-default scomlen */ PRDR_REGISTER_SCOMLEN = 0x1, @@ -72,7 +71,7 @@ namespace Prdr }; /** - * @enum PrdrGroupFlags + * @enum GroupFlags * @brief Flags for which group attributes are contained in a group * definition. * @@ -80,7 +79,7 @@ namespace Prdr * these flags that describe what attributes are non-default (and therefore * contained in the file). */ - enum PrdrGroupFlags + enum GroupFlags { /** Single Bit Filter */ PRDR_GROUP_FILTER_SINGLE_BIT = 0x1, @@ -89,13 +88,13 @@ namespace Prdr }; /** - * @enum PrdrTimeBaseFlags + * @enum TimeBaseFlags * @brief Enums for time base * * When reading rule file, these flags can be used to write in prf files * for time base values. */ - enum PrdrTimeBaseFlags + enum TimeBaseFlags { PRDR_TIME_BASE_SEC = 1, PRDR_TIME_BASE_MIN = PRDR_TIME_BASE_SEC * 60, @@ -104,12 +103,12 @@ namespace Prdr }; /** - * @enum PrdrExprOps + * @enum ExprOps * @brief Single char op's defined for .prf files. * * Needed for properly reading/writing .prf files. */ - enum PrdrExprOps + enum ExprOps { REF_RULE = 'r', REF_REG = 'e', @@ -141,7 +140,7 @@ namespace Prdr ACT_CAPT = 'C', }; - class PrdrSignatureOp + class SignatureOp { public: enum { DEFAULT_SIGNATURE = 0x0 }; @@ -160,19 +159,8 @@ namespace Prdr #ifdef __PRD_RULE_COMPILE typedef std::map<uint16_t, std::string> HashCollisionMap; #endif -}; -#endif +} // end namespace Prdr +#endif -// Change Log ********************************************************* -// -// Flag Reason Vers Date Coder Description -// ---- -------- ---- -------- -------- ------------------------------- -// D515833 f300 09/19/05 iawillia Add capture support. -// F526728 f300 10/25/05 iawillia Add >> and << operators to rules. -// F534311 f300 01/10/06 iawillia Add Bit string. -// F557408 f310 06/16/06 iawillia Add single-bit filter support. -// jl02 F605874 f330 07/31/07 lukas Add functions to PRD framework/Galaxy -// 2 code for unit CS. -// End Change Log ***************************************************** diff --git a/src/usr/diag/prdf/common/framework/rule/prdrCompile.C b/src/usr/diag/prdf/common/framework/rule/prdrCompile.C index b379e3f95..ff6fdf0eb 100755 --- a/src/usr/diag/prdf/common/framework/rule/prdrCompile.C +++ b/src/usr/diag/prdf/common/framework/rule/prdrCompile.C @@ -62,13 +62,18 @@ namespace TARGETING #include <prdrToken.H> #include <UtilHash.H> +using namespace PRDR_COMPILER; + int yyline; std::stack<std::pair<std::string, int> > yyincfiles; -PrdrChip * g_currentChip; // the current chip -std::map<std::string, PrdrExpr *> g_rules; // list of rules. -std::map<std::string, PrdrGroup *> g_groups; // list of bit groups -std::map<std::string, PrdrGroup *> g_actionclasses; // list of actions +namespace PRDR_COMPILER +{ + +Chip * g_currentChip; // the current chip +std::map<std::string, Expr *> g_rules; // list of rules. +std::map<std::string, Group *> g_groups; // list of bit groups +std::map<std::string, Group *> g_actionclasses; // list of actions std::map<std::string, std::string> g_attentionStartGroup; // Internal list of references, to make sure every reference resolved. @@ -81,6 +86,8 @@ Prdr::HashCollisionMap g_regsHashCollision; uint32_t g_nextAndBit; bool g_hadError; +} // end namespace PRDR_COMPILER + //-------------------------------------------- // main //-------------------------------------------- @@ -171,7 +178,7 @@ int main(int argc, char ** argv) // output rules. l_size = htons((uint16_t)g_rules.size()); fwrite(&l_size, sizeof(l_size), 1, l_prfFile); - for (std::map<std::string, PrdrExpr *>::iterator i = g_rules.begin(); + for (std::map<std::string, Expr *>::iterator i = g_rules.begin(); i != g_rules.end(); i++) { @@ -206,7 +213,7 @@ int main(int argc, char ** argv) #endif - for (std::map<std::string, PrdrGroup *>::iterator i = g_groups.begin(); + for (std::map<std::string, Group *>::iterator i = g_groups.begin(); i != g_groups.end(); i++, l_pos++) { @@ -214,7 +221,7 @@ int main(int argc, char ** argv) #ifndef __HOSTBOOT_MODULE (*i).second->generateDoxygen(l_htmlFile, (*i).first, l_errFile); #endif - }; + } // output action classes. l_size = htons((uint16_t)g_actionclasses.size()); @@ -231,7 +238,7 @@ int main(int argc, char ** argv) #endif - for (std::map<std::string, PrdrGroup *>::iterator i = + for (std::map<std::string, Group *>::iterator i = g_actionclasses.begin(); i != g_actionclasses.end(); i++) @@ -240,7 +247,7 @@ int main(int argc, char ** argv) #ifndef __HOSTBOOT_MODULE (*i).second->generateDoxygen(l_htmlFile, (*i).first); #endif - }; + } #ifndef __HOSTBOOT_MODULE l_htmlFile << "</TABLE>" << std::endl; @@ -256,7 +263,7 @@ int main(int argc, char ** argv) #ifndef __HOSTBOOT_MODULE // Add chip's extra signatures. l_errFile << "//---- Extra Signatures ----" << std::endl; - for (std::list<PrdrExtraSignature>::iterator i + for (std::list<ExtraSignature>::iterator i = g_currentChip->cv_sigExtras.begin(); i != g_currentChip->cv_sigExtras.end(); i++) @@ -279,6 +286,9 @@ int main(int argc, char ** argv) return (g_hadError ? -1 : 0); }; +namespace PRDR_COMPILER +{ + std::map<std::string, uint32_t> g_refId; std::map<std::string, char> g_refType; @@ -295,6 +305,7 @@ uint16_t prdrGetRefId(std::string * i_name) //fprintf(stderr, "%s: %08x\n", i_name->c_str(), l_refId); return l_refId; }; + char prdrGetRefType(std::string * i_name) { if (NULL == i_name) @@ -317,7 +328,7 @@ void prdrCheckReferences() if (NULL == g_currentChip) break; - for (PrdrRegisterList::iterator i = g_currentChip->cv_reglist.begin(); + for (RegisterList::iterator i = g_currentChip->cv_reglist.begin(); i != g_currentChip->cv_reglist.end(); i++) { @@ -325,7 +336,7 @@ void prdrCheckReferences() g_refType[*(*i)->cv_sname] = Prdr::REF_REG; } - for (std::map<std::string, PrdrExpr *>::iterator i = g_rules.begin(); + for (std::map<std::string, Expr *>::iterator i = g_rules.begin(); i != g_rules.end(); i++) { @@ -333,7 +344,7 @@ void prdrCheckReferences() g_refType[(*i).first] = Prdr::REF_RULE; } - for (std::map<std::string, PrdrGroup *>::iterator i = g_groups.begin(); + for (std::map<std::string, Group *>::iterator i = g_groups.begin(); i != g_groups.end(); i++) { @@ -341,7 +352,7 @@ void prdrCheckReferences() g_refType[(*i).first] = Prdr::REF_GRP; } - for (std::map<std::string, PrdrGroup *>::iterator i = + for (std::map<std::string, Group *>::iterator i = g_actionclasses.begin(); i != g_actionclasses.end(); i++) @@ -410,7 +421,7 @@ uint32_t prdrCaptureGroupMap( const std::string & i_arg ) } else { - uint16_t hash = Util::hashString( i_arg.c_str() ); + uint16_t hash = PRDF::Util::hashString( i_arg.c_str() ); Prdr::HashCollisionMap::iterator i = g_groupHashCollision.find(hash); if ( g_groupHashCollision.end() != i ) { @@ -441,13 +452,19 @@ uint32_t prdrCaptureTypeMap(const std::string & i_arg) return 1; } +} // end namespace PRDR_COMPILER + #include <prdfCalloutMap.H> // for enums #undef __prdfCalloutMap_H #define PRDF_RULE_COMPILER_ENUMS #include <prdfCalloutMap.H> // for string-to-enum arrays #undef PRDF_RULE_COMPILER_ENUMS +namespace PRDR_COMPILER +{ + std::map<std::string, uint32_t> g_ActionArgMap; + uint32_t prdrActionArgMap(const std::string & i_arg) { using namespace PRDF; @@ -546,3 +563,6 @@ uint32_t prdrActionArgMap(const std::string & i_arg) return g_ActionArgMap[i_arg]; } + +} // end namespace PRDR_COMPILER + diff --git a/src/usr/diag/prdf/common/framework/rule/prdrCompile.y b/src/usr/diag/prdf/common/framework/rule/prdrCompile.y index f5e98391e..65bbf88ea 100755 --- a/src/usr/diag/prdf/common/framework/rule/prdrCompile.y +++ b/src/usr/diag/prdf/common/framework/rule/prdrCompile.y @@ -51,6 +51,8 @@ #include <prdrRegister.H> // REVIEW NOTE: Move to token.h? +using namespace PRDR_COMPILER; + %} /* Union for the 'yylval' variable in lex or $$ variables in yacc code. Used @@ -70,21 +72,21 @@ /** string value from a token. */ std::string * str_ptr; /** Parsed list of registers. */ - PrdrRegisterList * reglist; + PRDR_COMPILER::RegisterList * reglist; /** A single parsed register. */ - PrdrRegister * reg; + PRDR_COMPILER::Register * reg; /** A structure for the reset / mask keywords. */ - PrdrResetOrMaskStruct * reg_mask; + PRDR_COMPILER::ResetOrMaskStruct * reg_mask; /** A chip object */ - PrdrChip * chip; + PRDR_COMPILER::Chip * chip; /** A sub-expression token. */ - PrdrExpr * expr; + PRDR_COMPILER::Expr * expr; /** A parsed group of bit-operation / action pairs */ - PrdrGroup * grp; + PRDR_COMPILER::Group * grp; /** A list of strings */ std::list<std::string *>* strlist; /** A list of filters */ - std::list<PrdrGroup_Filter *>* filterlist; + std::list<PRDR_COMPILER::Group_Filter *>* filterlist; } /* Indicates the name for the start symbol. (non-terminal) */ @@ -195,7 +197,7 @@ chip: PRDR_CHIP PRDR_ID '{' chiplines '}' ';' { // Create a default chip object is chiplines are empty. if (NULL == $4) - $4 = new PrdrChip(); + $4 = new Chip(); // Assign chip's shortname from ID. $4->cv_sname = $2; @@ -217,7 +219,7 @@ chiplines: { $$ = NULL; } // empty line. else { // Both are non-NULL, merge. - PrdrChip::merge($1, $2); + Chip::merge($1, $2); $$ = $1; delete $2; } @@ -237,43 +239,43 @@ chiplines: { $$ = NULL; } // empty line. chipline: { $$ = NULL; } // allow a free ;. | PRDR_CHIPID PRDR_INTEGER { - $$ = new PrdrChip(); + $$ = new Chip(); $$->cv_chipid = $2; } | PRDR_SIGNATURE_OFFSET PRDR_INTEGER { - $$ = new PrdrChip(); + $$ = new Chip(); $$->cv_signatureOffset = $2; } | PRDR_SIGNATURE_EXTRA '(' PRDR_ID ',' PRDR_INTEGER ',' PRDR_STRING ',' PRDR_STRING ')' { - $$ = new PrdrChip(); - $$->cv_sigExtras.push_back(PrdrExtraSignature($5, $7, $9)); + $$ = new Chip(); + $$->cv_sigExtras.push_back(ExtraSignature($5, $7, $9)); } | PRDR_TARGETTYPE PRDR_ID { - $$ = new PrdrChip(); + $$ = new Chip(); $$->cv_targetType = prdrActionArgMap(*$2); } | PRDR_NAME_KW PRDR_STRING { - $$ = new PrdrChip(); + $$ = new Chip(); $$->cv_name = $2; } | register // register non-terminal token. { - $$ = new PrdrChip(); + $$ = new Chip(); $$->cv_reglist.push_back($1); } | PRDR_SCOMLEN PRDR_INTEGER { - $$ = new PrdrChip(); + $$ = new Chip(); $$->cv_scomlen = $2; } | PRDR_ACT_DUMP PRDR_ID //@ecdf { - $$ = new PrdrChip(); + $$ = new Chip(); $$->cv_dumptype = prdrActionArgMap(*$2); } ; @@ -283,7 +285,7 @@ register: PRDR_REGISTER PRDR_ID '{' reglines '}' { // Create register object as needed. if (NULL == $4) - $$ = new PrdrRegister(); + $$ = new Register(); else $$ = $4; @@ -303,7 +305,7 @@ reglines: { $$ = NULL; } else { // Both are non-NULL, merge. - PrdrRegister::merge($1, $2); + Register::merge($1, $2); $$ = $1; delete $2; } @@ -322,22 +324,22 @@ reglines: { $$ = NULL; } regline: { $$ = NULL; } | PRDR_NAME_KW PRDR_STRING { - $$ = new PrdrRegister(); + $$ = new Register(); $$->cv_name = $2; } | PRDR_NAME_KW PRDR_ID { - $$ = new PrdrRegister(); + $$ = new Register(); $$->cv_name = $2; } | PRDR_SCOMADDR PRDR_INTEGER { - $$ = new PrdrRegister(); + $$ = new Register(); $$->cv_scomaddr = $2; } | PRDR_SCOMLEN PRDR_INTEGER { - $$ = new PrdrRegister(); + $$ = new Register(); $$->cv_scomlen = $2; // Indicate that the register contains a non-default scomlen. @@ -345,7 +347,7 @@ regline: { $$ = NULL; } } | PRDR_RESET_ADDR '(' register_mask ')' { - $$ = new PrdrRegister(); + $$ = new Register(); // Add reset register to list. $$->cv_resets.push_back(*$3); @@ -353,7 +355,7 @@ regline: { $$ = NULL; } } | PRDR_MASK_ADDR '(' register_mask ')' { - $$ = new PrdrRegister(); + $$ = new Register(); // Add mask register to list. $$->cv_masks.push_back(*$3); @@ -361,11 +363,11 @@ regline: { $$ = NULL; } } | PRDR_ACT_CAPTURE PRDR_GROUP PRDR_ID { - $$ = new PrdrRegister(); + $$ = new Register(); // Define capture group. - PrdrCaptureReqStruct tmp; - tmp.type = PrdrCaptureReqStruct::PRDR_CAPTURE_GROUPID; + CaptureReqStruct tmp; + tmp.type = CaptureReqStruct::PRDR_CAPTURE_GROUPID; tmp.data[0] = prdrCaptureGroupMap(*$3); $$->cv_captures.push_back(tmp); @@ -373,11 +375,11 @@ regline: { $$ = NULL; } //@jl04 Add a new capture "type" here for regsiters. | PRDR_ACT_CAPTURE PRDR_TYPE PRDR_ID { - $$ = new PrdrRegister(); + $$ = new Register(); // Define capture type. - PrdrCaptureReqStruct tmp; - tmp.type = PrdrCaptureReqStruct::PRDR_CAPTURE_TYPE; + CaptureReqStruct tmp; + tmp.type = CaptureReqStruct::PRDR_CAPTURE_TYPE; tmp.data[0] = prdrCaptureTypeMap(*$3); $$->cv_captures.push_back(tmp); } @@ -385,11 +387,11 @@ regline: { $$ = NULL; } | PRDR_ACT_CAPTURE PRDR_REQUIRED_KW PRDR_CONNECTED '(' PRDR_ID ')' { - $$ = new PrdrRegister(); + $$ = new Register(); // Define capture "connected" requirement. - PrdrCaptureReqStruct tmp; - tmp.type = PrdrCaptureReqStruct::PRDR_CAPTURE_CONN; + CaptureReqStruct tmp; + tmp.type = CaptureReqStruct::PRDR_CAPTURE_CONN; tmp.data[0] = prdrActionArgMap(*$5); tmp.data[1] = 0; @@ -397,11 +399,11 @@ regline: { $$ = NULL; } } | PRDR_ACT_CAPTURE PRDR_REQUIRED_KW PRDR_CONNECTED '(' PRDR_ID ',' PRDR_INTEGER ')' { - $$ = new PrdrRegister(); + $$ = new Register(); // Define capture "connected" requirement. - PrdrCaptureReqStruct tmp; - tmp.type = PrdrCaptureReqStruct::PRDR_CAPTURE_CONN; + CaptureReqStruct tmp; + tmp.type = CaptureReqStruct::PRDR_CAPTURE_CONN; tmp.data[0] = prdrActionArgMap(*$5); tmp.data[1] = $7; @@ -409,11 +411,11 @@ regline: { $$ = NULL; } } | PRDR_ACT_CAPTURE PRDR_REQUIRED_KW PRDR_ACT_FUNCCALL '(' PRDR_STRING ')' { - $$ = new PrdrRegister(); + $$ = new Register(); // Define funccall requirement. - PrdrCaptureReqStruct tmp; - tmp.type = PrdrCaptureReqStruct::PRDR_CAPTURE_FUNC; + CaptureReqStruct tmp; + tmp.type = CaptureReqStruct::PRDR_CAPTURE_FUNC; tmp.str = *$5; $$->cv_captures.push_back(tmp); @@ -423,56 +425,56 @@ regline: { $$ = NULL; } /* Define the possible reset/mask instructions. */ register_mask: '|' ',' PRDR_INTEGER { - $$ = new PrdrResetOrMaskStruct(); + $$ = new ResetOrMaskStruct(); $$->type = '|'; $$->addr_r = $3; $$->addr_w = $3; } | '|' ',' PRDR_INTEGER ',' PRDR_INTEGER { - $$ = new PrdrResetOrMaskStruct(); + $$ = new ResetOrMaskStruct(); $$->type = '|'; $$->addr_r = $3; $$->addr_w = $5; } | '&' ',' PRDR_INTEGER { - $$ = new PrdrResetOrMaskStruct(); + $$ = new ResetOrMaskStruct(); $$->type = '&'; $$->addr_r = $3; $$->addr_w = $3; } | '&' ',' PRDR_INTEGER ',' PRDR_INTEGER { - $$ = new PrdrResetOrMaskStruct(); + $$ = new ResetOrMaskStruct(); $$->type = '&'; $$->addr_r = $3; $$->addr_w = $5; } | '^' ',' PRDR_INTEGER { - $$ = new PrdrResetOrMaskStruct(); + $$ = new ResetOrMaskStruct(); $$->type = '^'; $$->addr_r = $3; $$->addr_w = $3; } | '^' ',' PRDR_INTEGER ',' PRDR_INTEGER { - $$ = new PrdrResetOrMaskStruct(); + $$ = new ResetOrMaskStruct(); $$->type = '^'; $$->addr_r = $3; $$->addr_w = $5; } | '~' ',' PRDR_INTEGER { - $$ = new PrdrResetOrMaskStruct(); + $$ = new ResetOrMaskStruct(); $$->type = '~'; $$->addr_r = $3; $$->addr_w = $3; } | '~' ',' PRDR_INTEGER ',' PRDR_INTEGER { - $$ = new PrdrResetOrMaskStruct(); + $$ = new ResetOrMaskStruct(); $$->type = '~'; $$->addr_r = $3; $$->addr_w = $5; @@ -500,7 +502,7 @@ group: PRDR_GROUP PRDR_ID grpattns grpfilters '{' grouplines '}' ';' // Add filters to group. if (NULL != $4) { - for (std::list<PrdrGroup_Filter *>::iterator i = $4->begin(); + for (std::list<Group_Filter *>::iterator i = $4->begin(); i != $4->end(); ++i) { @@ -551,55 +553,55 @@ grpfilt_items: grpfilt_items ',' grpfilt_item grpfilt_item: PRDR_FILTER_SINGLE_BIT { - $$ = new std::list<PrdrGroup_Filter *>; - $$->push_back(new PrdrGroup_Filter_SingleBit); + $$ = new std::list<Group_Filter *>; + $$->push_back(new Group_Filter_SingleBit); } ; grpfilt_item: PRDR_FILTER_PRIORITY '(' bitandlist ')' { - $$ = new std::list<PrdrGroup_Filter *>; - $$->push_back(new PrdrGroup_Filter_Priority($3)); + $$ = new std::list<Group_Filter *>; + $$->push_back(new Group_Filter_Priority($3)); } ; -grouplines: { $$ = new PrdrGroup(); } +grouplines: { $$ = new Group(); } | grouplines groupline ';' { - PrdrGroup::merge($1,$2); + Group::merge($1,$2); $$ = $1; delete $2; } | grouplines dox_comment groupline ';' { $3->setComment(*$2); - PrdrGroup::merge($1,$3); + Group::merge($1,$3); $$ = $1; delete $3; } ; -groupline: { $$ = new PrdrGroup(); } +groupline: { $$ = new Group(); } | '(' PRDR_ID ',' bitgroup ')' '?' PRDR_ID { - $$ = new PrdrGroup(); - $$->cv_rules.push_front(new PrdrExprRule($2,$4,$7)); - g_references.push_front(PrdrRefPair("r",*$2)); - g_references.push_front(PrdrRefPair("a",*$7)); + $$ = new Group(); + $$->cv_rules.push_front(new ExprRule($2,$4,$7)); + g_references.push_front(RefPair("r",*$2)); + g_references.push_front(RefPair("a",*$7)); } | '(' PRDR_ID ',' bitgroup ')' '?' action_analyse { - $$ = new PrdrGroup(); - $$->cv_rules.push_front(new PrdrExprRule($2,$4,static_cast<PrdrExprRef *>($7)->cv_name)); - g_references.push_front(PrdrRefPair("r",*$2)); - g_references.push_front(PrdrRefPair("g",*static_cast<PrdrExprRef *>($7)->cv_name)); + $$ = new Group(); + $$->cv_rules.push_front(new ExprRule($2,$4,static_cast<ExprRef *>($7)->cv_name)); + g_references.push_front(RefPair("r",*$2)); + g_references.push_front(RefPair("g",*static_cast<ExprRef *>($7)->cv_name)); } | PRDR_ID { - $$ = new PrdrGroup(); - $$->cv_rules.push_front(new PrdrExprRef($1)); - g_references.push_front(PrdrRefPair("g",*$1)); + $$ = new Group(); + $$->cv_rules.push_front(new ExprRef($1)); + g_references.push_front(RefPair("g",*$1)); } ; @@ -610,40 +612,40 @@ bitgroup: PRDR_BIT_KW '(' bitandlist ')' { $$ = $3; } // TODO: Change to & instead of , bitandlist: bitandlist ',' PRDR_INTEGER { - $$ = new PrdrExprOp2(Prdr::AND, + $$ = new ExprOp2(Prdr::AND, $1, - new PrdrExprInt($3, Prdr::INT_SHORT)); + new ExprInt($3, Prdr::INT_SHORT)); } | PRDR_INTEGER { - $$ = new PrdrExprInt($1, Prdr::INT_SHORT); + $$ = new ExprInt($1, Prdr::INT_SHORT); } ; bitorlist: bitorlist '|' PRDR_INTEGER { - $$ = new PrdrExprOp2(Prdr::OR, + $$ = new ExprOp2(Prdr::OR, $1, - new PrdrExprInt($3, Prdr::INT_SHORT)); + new ExprInt($3, Prdr::INT_SHORT)); } | PRDR_INTEGER '|' PRDR_INTEGER { - $$ = new PrdrExprOp2(Prdr::OR, - new PrdrExprInt($1, Prdr::INT_SHORT), - new PrdrExprInt($3, Prdr::INT_SHORT)); + $$ = new ExprOp2(Prdr::OR, + new ExprInt($1, Prdr::INT_SHORT), + new ExprInt($3, Prdr::INT_SHORT)); } ; // TODO: Merge attention types. rule: PRDR_RULE PRDR_ID '{' ruleexpr ';' '}' ';' { - g_rules[*$2] = new PrdrExprOp1(Prdr::RULE, $4); + g_rules[*$2] = new ExprOp1(Prdr::RULE, $4); delete $2; } | PRDR_RULE PRDR_ID '{' PRDR_ID ':' ruleexpr ';' '}' ';' { - g_rules[*$2] = new PrdrExprOp1(Prdr::RULE, - new PrdrExprAttnLink($4, $6, NULL, NULL, NULL, NULL, NULL, NULL)); + g_rules[*$2] = new ExprOp1(Prdr::RULE, + new ExprAttnLink($4, $6, NULL, NULL, NULL, NULL, NULL, NULL)); delete $2; delete $4; } @@ -651,8 +653,8 @@ rule: PRDR_RULE PRDR_ID '{' ruleexpr ';' '}' ';' PRDR_ID ':' ruleexpr ';' '}' ';' { - g_rules[*$2] = new PrdrExprOp1(Prdr::RULE, - new PrdrExprAttnLink($4, $6, $8, $10, NULL, NULL, NULL, NULL)); + g_rules[*$2] = new ExprOp1(Prdr::RULE, + new ExprAttnLink($4, $6, $8, $10, NULL, NULL, NULL, NULL)); delete $2; delete $4; delete $8; @@ -662,8 +664,8 @@ rule: PRDR_RULE PRDR_ID '{' ruleexpr ';' '}' ';' PRDR_ID ':' ruleexpr ';' '}' ';' { - g_rules[*$2] = new PrdrExprOp1(Prdr::RULE, - new PrdrExprAttnLink($4, $6, $8, $10, $12, $14, NULL, NULL)); + g_rules[*$2] = new ExprOp1(Prdr::RULE, + new ExprAttnLink($4, $6, $8, $10, $12, $14, NULL, NULL)); delete $2; delete $4; delete $8; @@ -675,8 +677,8 @@ rule: PRDR_RULE PRDR_ID '{' ruleexpr ';' '}' ';' PRDR_ID ':' ruleexpr ';' '}' ';' { - g_rules[*$2] = new PrdrExprOp1(Prdr::RULE, - new PrdrExprAttnLink($4, $6, $8, $10, $12, $14, $16, $18)); + g_rules[*$2] = new ExprOp1(Prdr::RULE, + new ExprAttnLink($4, $6, $8, $10, $12, $14, $16, $18)); delete $2; delete $4; delete $8; @@ -689,8 +691,8 @@ ruleexpr: ruleexpr_small { $$ = $1; } | ruleexpr_small ruleop2 ruleexpr { $$ = $2; - static_cast<PrdrExprOp2 *>($$)->cv_arg[0] = $1; - static_cast<PrdrExprOp2 *>($$)->cv_arg[1] = $3; + static_cast<ExprOp2 *>($$)->cv_arg[0] = $1; + static_cast<ExprOp2 *>($$)->cv_arg[1] = $3; } | ruleexpr_shift { $$ = $1; } ; @@ -698,53 +700,53 @@ ruleexpr: ruleexpr_small { $$ = $1; } ruleexpr_small: '(' ruleexpr ')' { $$ = $2; } | PRDR_ID { - $$ = new PrdrExprRef($1); - g_references.push_front(PrdrRefPair("re", *$1)); + $$ = new ExprRef($1); + g_references.push_front(RefPair("re", *$1)); } | ruleop1 ruleexpr_small { $$ = $1; - static_cast<PrdrExprOp1 *>($$)->cv_arg = $2; + static_cast<ExprOp1 *>($$)->cv_arg = $2; } | PRDR_BIT_STRING { - $$ = new PrdrExprBitString(*$1); + $$ = new ExprBitString(*$1); delete $1; } ; ruleexpr_shift: ruleexpr_small PRDR_OP_LEFTSHIFT PRDR_INTEGER { - $$ = new PrdrExprOp2(Prdr::LSHIFT, + $$ = new ExprOp2(Prdr::LSHIFT, $1, - new PrdrExprInt($3)); + new ExprInt($3)); } | ruleexpr_small PRDR_OP_RIGHTSHIFT PRDR_INTEGER { - $$ = new PrdrExprOp2(Prdr::RSHIFT, + $$ = new ExprOp2(Prdr::RSHIFT, $1, - new PrdrExprInt($3, Prdr::INT_SHORT)); + new ExprInt($3, Prdr::INT_SHORT)); } ; ruleop1: '~' { - $$ = new PrdrExprOp1(Prdr::NOT); + $$ = new ExprOp1(Prdr::NOT); } ; ruleop2: '|' { - $$ = new PrdrExprOp2(Prdr::OR); + $$ = new ExprOp2(Prdr::OR); } | '&' { - $$ = new PrdrExprOp2(Prdr::AND); + $$ = new ExprOp2(Prdr::AND); } | '^' { - $$ = new PrdrExprOp2(Prdr::XOR); + $$ = new ExprOp2(Prdr::XOR); } ; @@ -763,7 +765,7 @@ actionclass: PRDR_ACTIONCLASS PRDR_ID '{' actionlines '}' ';' actionlines: { - $$ = new PrdrGroup(Prdr::ACTION); + $$ = new Group(Prdr::ACTION); } | actionlines actionline ';' { @@ -779,8 +781,8 @@ actionline: } | PRDR_ID { - $$ = new PrdrExprRef($1); - g_references.push_front(PrdrRefPair("a", *$1)); + $$ = new ExprRef($1); + g_references.push_front(RefPair("a", *$1)); } | action_threshold { $$ = $1; } | action_shared_threshold { $$ = $1; } @@ -797,32 +799,32 @@ actionline: action_threshold: PRDR_ACT_THRESHOLD '(' ')' { - $$ = new PrdrExprAct_Thresh(); + $$ = new ExprAct_Thresh(); } | PRDR_ACT_THRESHOLD '(' PRDR_FLD_KW '(' PRDR_INTEGER time_units ')' ')' { - $$ = new PrdrExprAct_Thresh($5, $6); + $$ = new ExprAct_Thresh($5, $6); } | PRDR_ACT_THRESHOLD '(' PRDR_FLD_KW '(' PRDR_INTEGER time_units ')' ',' PRDR_MFG_KW '(' PRDR_INTEGER time_units ')' ')' { - $$ = new PrdrExprAct_Thresh($5, $6, $11, $12); + $$ = new ExprAct_Thresh($5, $6, $11, $12); } | PRDR_ACT_THRESHOLD '(' PRDR_FLD_KW '(' PRDR_INTEGER time_units ')' ',' PRDR_MFG_FILE_KW '(' PRDR_ID ')' ')' { - $$ = new PrdrExprAct_Thresh($5, $6, 0, NULL, $11); + $$ = new ExprAct_Thresh($5, $6, 0, NULL, $11); } ; action_shared_threshold: action_threshold PRDR_SHARED_KW '(' PRDR_INTEGER ')' { - static_cast<PrdrExprAct_Thresh *>($1)->cv_3 = $4; + static_cast<ExprAct_Thresh *>($1)->cv_3 = $4; $$ = $1; } ; time_units: { - $$ = new PrdrExprTime(0xffffffff, Prdr::PRDR_TIME_BASE_SEC); + $$ = new ExprTime(0xffffffff, Prdr::PRDR_TIME_BASE_SEC); } // FIXME: (RTC 51218) It is impossible to reach a theshold of 1000 per // second because PRD cannot respond to attentions that quickly (at @@ -830,93 +832,93 @@ time_units: // possible to based on the reaction type per attention ratio. | '/' PRDR_TIME_SEC { - $$ = new PrdrExprTime(1, Prdr::PRDR_TIME_BASE_SEC); + $$ = new ExprTime(1, Prdr::PRDR_TIME_BASE_SEC); } | '/' PRDR_TIME_MIN { - $$ = new PrdrExprTime(1, Prdr::PRDR_TIME_BASE_MIN); + $$ = new ExprTime(1, Prdr::PRDR_TIME_BASE_MIN); } | '/' PRDR_TIME_HOUR { - $$ = new PrdrExprTime(1, Prdr::PRDR_TIME_BASE_HOUR); + $$ = new ExprTime(1, Prdr::PRDR_TIME_BASE_HOUR); } | '/' PRDR_TIME_DAY { - $$ = new PrdrExprTime(1, Prdr::PRDR_TIME_BASE_DAY); + $$ = new ExprTime(1, Prdr::PRDR_TIME_BASE_DAY); } | '/' PRDR_INTEGER PRDR_TIME_SEC { - $$ = new PrdrExprTime($2, Prdr::PRDR_TIME_BASE_SEC); + $$ = new ExprTime($2, Prdr::PRDR_TIME_BASE_SEC); } | '/' PRDR_INTEGER PRDR_TIME_MIN { - $$ = new PrdrExprTime($2, Prdr::PRDR_TIME_BASE_MIN); + $$ = new ExprTime($2, Prdr::PRDR_TIME_BASE_MIN); } | '/' PRDR_INTEGER PRDR_TIME_HOUR { - $$ = new PrdrExprTime($2, Prdr::PRDR_TIME_BASE_HOUR); + $$ = new ExprTime($2, Prdr::PRDR_TIME_BASE_HOUR); } | '/' PRDR_INTEGER PRDR_TIME_DAY { - $$ = new PrdrExprTime($2, Prdr::PRDR_TIME_BASE_DAY); + $$ = new ExprTime($2, Prdr::PRDR_TIME_BASE_DAY); } ; action_analyse: PRDR_ACT_ANALYSE '(' PRDR_ID ')' { - $$ = new PrdrExprRef($3); - g_references.push_front(PrdrRefPair("g",*$3)); + $$ = new ExprRef($3); + g_references.push_front(RefPair("g",*$3)); } ; action_analyse_conn: PRDR_ACT_ANALYSE '(' PRDR_CONNECTED '(' PRDR_ID ')' ')' { - $$ = new PrdrExprAct_Analyse($5); + $$ = new ExprAct_Analyse($5); } ; action_analyse_conn: PRDR_ACT_ANALYSE '(' PRDR_CONNECTED '(' PRDR_ID ',' PRDR_INTEGER ')' ')' { - $$ = new PrdrExprAct_Analyse($5, $7); + $$ = new ExprAct_Analyse($5, $7); } ; action_try: PRDR_ACT_TRY '(' actionline ',' actionline ')' { - $$ = new PrdrExprAct_Try($3,$5); + $$ = new ExprAct_Try($3,$5); } ; action_dump: PRDR_ACT_DUMP '(' PRDR_ID ')' //@ecdf { - $$ = new PrdrExprAct_Dump($3); + $$ = new ExprAct_Dump($3); } // TODO: Allow Dump connected. ; action_gard: PRDR_ACT_GARD '(' PRDR_ID ')' { - $$ = new PrdrExprAct_Gard($3); + $$ = new ExprAct_Gard($3); } ; action_callout: PRDR_ACT_CALLOUT '(' PRDR_ID ')' { - $$ = new PrdrExprAct_Callout($3); + $$ = new ExprAct_Callout($3); } | PRDR_ACT_CALLOUT '(' PRDR_CONNECTED '(' PRDR_ID action_callout_alt ')' ',' PRDR_ID ')' { - $$ = new PrdrExprAct_Callout($9, $5, PrdrExprAct_Callout::CALLOUT_CHIP, 0xffffffff, $6); + $$ = new ExprAct_Callout($9, $5, ExprAct_Callout::CALLOUT_CHIP, 0xffffffff, $6); } | PRDR_ACT_CALLOUT '(' PRDR_CONNECTED '(' PRDR_ID ',' PRDR_INTEGER action_callout_alt ')' ',' PRDR_ID ')' { - $$ = new PrdrExprAct_Callout($11, $5, PrdrExprAct_Callout::CALLOUT_CHIP, $7, $8); + $$ = new ExprAct_Callout($11, $5, ExprAct_Callout::CALLOUT_CHIP, $7, $8); } | PRDR_ACT_CALLOUT '(' PRDR_PROCEDURE '(' PRDR_ID ')' ',' PRDR_ID ')' { - $$ = new PrdrExprAct_Callout($8, $5, PrdrExprAct_Callout::CALLOUT_PROC); + $$ = new ExprAct_Callout($8, $5, ExprAct_Callout::CALLOUT_PROC); } ; @@ -933,23 +935,23 @@ action_callout_alt: action_funccall: PRDR_ACT_FUNCCALL '(' PRDR_STRING ')' { - $$ = new PrdrExprAct_Funccall($3); + $$ = new ExprAct_Funccall($3); } | PRDR_ACT_FUNCCALL '(' PRDR_STRING ',' PRDR_ID ')' { - $$ = new PrdrExprAct_Funccall($3, $5); + $$ = new ExprAct_Funccall($3, $5); } ; action_flag: PRDR_ACT_FLAG '(' PRDR_ID ')' { - $$ = new PrdrExprAct_Flag($3); + $$ = new ExprAct_Flag($3); } ; action_capture: PRDR_ACT_CAPTURE '(' PRDR_ID ')' { - $$ = new PrdrExprAct_Capture($3); + $$ = new ExprAct_Capture($3); } ; diff --git a/src/usr/diag/prdf/common/framework/rule/prdrExpr.H b/src/usr/diag/prdf/common/framework/rule/prdrExpr.H index dd3748b9c..d3d12a738 100755 --- a/src/usr/diag/prdf/common/framework/rule/prdrExpr.H +++ b/src/usr/diag/prdf/common/framework/rule/prdrExpr.H @@ -34,26 +34,30 @@ #include <prdrCommon.H> // for enums. +using Prdr::SignatureOp; + +extern void yyerror(const char *); + +namespace PRDR_COMPILER +{ + // -- Forward defs // -class PrdrExpr; +class Expr; uint16_t prdrGetRefId(std::string *); char prdrGetRefType(std::string *); void prdrCheckReferences(); uint32_t prdrActionArgMap(const std::string &); uint32_t prdrCaptureGroupMap(const std::string &); -uint32_t prdrCaptureTypeMap(const std::string &); // @jl04 Type for registers. +uint32_t prdrCaptureTypeMap(const std::string &); std::list<std::string> prdrParseDoxygen(std::string & i_string); -class PrdrChip; -extern PrdrChip * g_currentChip; -extern std::map<std::string, PrdrExpr *> g_rules; -extern void yyerror(const char *); +class Chip; +extern Chip * g_currentChip; +extern std::map<std::string, Expr *> g_rules; extern uint32_t g_nextAndBit; extern bool g_hadError; // -- end Forward defs // -using Prdr::PrdrSignatureOp; - -class PrdrExpr +class Expr { public: @@ -71,23 +75,23 @@ class PrdrExpr { std::cerr << "def sig: " << typeid(*this).name() << std::endl; - return PrdrSignatureOp::DEFAULT_SIGNATURE; + return SignatureOp::DEFAULT_SIGNATURE; }; - PrdrExpr() : cv_doxcomment("") {}; - virtual ~PrdrExpr() {}; + Expr() : cv_doxcomment("") {}; + virtual ~Expr() {}; protected: std::string cv_doxcomment; }; -class PrdrExprRef : public PrdrExpr +class ExprRef : public Expr { public: std::string * cv_name; - PrdrExprRef(std::string * n) : cv_name(n) {}; + ExprRef(std::string * n) : cv_name(n) {}; int output(FILE * i_file) { @@ -112,17 +116,17 @@ class PrdrExprRef : public PrdrExpr { if (Prdr::REF_REG == prdrGetRefType(cv_name)) { - return Util::hashString(cv_name->c_str()); + return PRDF::Util::hashString(cv_name->c_str()); } else { - PrdrExpr * tmp = g_rules[*cv_name]; + Expr * tmp = g_rules[*cv_name]; if (NULL == tmp) { std::cerr << "NPE: " << *cv_name << std::endl; } return (NULL == tmp ? - PrdrSignatureOp::DEFAULT_SIGNATURE + SignatureOp::DEFAULT_SIGNATURE : tmp->getSignature() ); } @@ -130,14 +134,14 @@ class PrdrExprRef : public PrdrExpr }; -class PrdrExprInt : public PrdrExpr +class ExprInt : public Expr { public: uint32_t cv_value; char cv_op; - PrdrExprInt() : cv_op(Prdr::INTEGER) {}; - PrdrExprInt(uint32_t v, char o = Prdr::INTEGER) : cv_value(v), + ExprInt() : cv_op(Prdr::INTEGER) {}; + ExprInt(uint32_t v, char o = Prdr::INTEGER) : cv_value(v), cv_op(o) {}; int output(FILE * i_file) @@ -168,21 +172,21 @@ class PrdrExprInt : public PrdrExpr << cv_value; }; - uint16_t getSignature() { return PrdrSignatureOp::DEFAULT_SIGNATURE; }; + uint16_t getSignature() { return SignatureOp::DEFAULT_SIGNATURE; }; }; -class PrdrExprTime : public PrdrExpr +class ExprTime : public Expr { public: - uint32_t iv_units; - Prdr::PrdrTimeBaseFlags iv_base; + uint32_t iv_units; + Prdr::TimeBaseFlags iv_base; - PrdrExprTime() : + ExprTime() : iv_units(0xffffffff), iv_base(Prdr::PRDR_TIME_BASE_SEC) {} - PrdrExprTime( uint32_t units, Prdr::PrdrTimeBaseFlags base ) : + ExprTime( uint32_t units, Prdr::TimeBaseFlags base ) : iv_units(units), iv_base(base) {} @@ -214,14 +218,14 @@ class PrdrExprTime : public PrdrExpr } }; -class PrdrExprBitString : public PrdrExpr +class ExprBitString : public Expr { public: std::string cv_value; char cv_op; - PrdrExprBitString() : cv_value(), cv_op(Prdr::BIT_STR) {}; - PrdrExprBitString(std::string v, char o = Prdr::BIT_STR) : cv_value(v), + ExprBitString() : cv_value(), cv_op(Prdr::BIT_STR) {}; + ExprBitString(std::string v, char o = Prdr::BIT_STR) : cv_value(v), cv_op(o) {}; int output(FILE * i_file) @@ -277,18 +281,18 @@ class PrdrExprBitString : public PrdrExpr o_errFile << cv_value; }; - uint16_t getSignature() { return PrdrSignatureOp::DEFAULT_SIGNATURE; }; + uint16_t getSignature() { return SignatureOp::DEFAULT_SIGNATURE; }; }; -class PrdrExprOp1 : public PrdrExpr +class ExprOp1 : public Expr { public: char cv_op; - PrdrExpr * cv_arg; + Expr * cv_arg; - PrdrExprOp1(char o) : cv_op(o) {}; - PrdrExprOp1(char o, PrdrExpr * a) : cv_op(o), cv_arg(a) {}; + ExprOp1(char o) : cv_op(o) {}; + ExprOp1(char o, Expr * a) : cv_op(o), cv_arg(a) {}; int output(FILE * i_file) { @@ -310,21 +314,21 @@ class PrdrExprOp1 : public PrdrExpr uint16_t getSignature() { return (NULL == cv_arg ? - PrdrSignatureOp::DEFAULT_SIGNATURE + SignatureOp::DEFAULT_SIGNATURE : cv_arg->getSignature() ); } }; -class PrdrExprOp2 : public PrdrExpr +class ExprOp2 : public Expr { public: - PrdrExpr * cv_arg[2]; + Expr * cv_arg[2]; char cv_op; - PrdrExprOp2(char o) : cv_op(o) {}; - PrdrExprOp2(char o, PrdrExpr * a1, PrdrExpr * a2) : cv_op(o) + ExprOp2(char o) : cv_op(o) {}; + ExprOp2(char o, Expr * a1, Expr * a2) : cv_op(o) { cv_arg[0] = a1; cv_arg[1] = a2; }; @@ -352,29 +356,29 @@ class PrdrExprOp2 : public PrdrExpr uint16_t getSignature() { - return PrdrSignatureOp::combineSig( + return SignatureOp::combineSig( (NULL == cv_arg[0] ? - PrdrSignatureOp::DEFAULT_SIGNATURE + SignatureOp::DEFAULT_SIGNATURE : cv_arg[0]->getSignature() ), (NULL == cv_arg[1] ? - PrdrSignatureOp::DEFAULT_SIGNATURE + SignatureOp::DEFAULT_SIGNATURE : cv_arg[1]->getSignature() )); }; }; -class PrdrExprAttnLink : public PrdrExpr +class ExprAttnLink : public Expr { public: static const int MAX_ATTNS = 4; - PrdrExpr * cv_arg[MAX_ATTNS]; + Expr * cv_arg[MAX_ATTNS]; - PrdrExprAttnLink(std::string * attn1, PrdrExpr * exp1, - std::string * attn2, PrdrExpr * exp2, - std::string * attn3, PrdrExpr * exp3, - std::string * attn4, PrdrExpr * exp4) + ExprAttnLink(std::string * attn1, Expr * exp1, + std::string * attn2, Expr * exp2, + std::string * attn3, Expr * exp3, + std::string * attn4, Expr * exp4) { for (int i = 0; i < MAX_ATTNS; i++) cv_arg[i] = NULL; @@ -412,14 +416,14 @@ class PrdrExprAttnLink : public PrdrExpr uint16_t getSignature() { - uint16_t l_val = PrdrSignatureOp::DEFAULT_SIGNATURE; + uint16_t l_val = SignatureOp::DEFAULT_SIGNATURE; for (int i = 0; i < MAX_ATTNS; i++) if (NULL != cv_arg[i]) - l_val = PrdrSignatureOp::combineSig(l_val, + l_val = SignatureOp::combineSig(l_val, cv_arg[i]->getSignature()); else - l_val = PrdrSignatureOp::combineSig(l_val, - PrdrSignatureOp::DEFAULT_SIGNATURE); + l_val = SignatureOp::combineSig(l_val, + SignatureOp::DEFAULT_SIGNATURE); return l_val; }; @@ -463,14 +467,14 @@ class PrdrExprAttnLink : public PrdrExpr }; -class PrdrExprRule : public PrdrExpr +class ExprRule : public Expr { public: std::string * cv_rulename; - PrdrExpr * cv_bits; + Expr * cv_bits; std::string * cv_actionname; - PrdrExprRule(std::string * r, PrdrExpr * b, std::string * a) + ExprRule(std::string * r, Expr * b, std::string * a) : cv_rulename(r), cv_bits(b), cv_actionname(a) {}; int output(FILE * i_file) @@ -505,7 +509,7 @@ class PrdrExprRule : public PrdrExpr l_errFront << "\tPRDR_ERROR_SIGNATURE ( 0x" << std::setfill('0') << std::setw(4) << std::hex - << ( (PrdrExprRef(cv_rulename).getSignature() + << ( (ExprRef(cv_rulename).getSignature() + g_currentChip->cv_signatureOffset) & 0xffff ) << "00"; @@ -560,9 +564,9 @@ class PrdrExprRule : public PrdrExpr { o_errFile << l_errFront.str(); - if (typeid(*cv_bits).name() == typeid(PrdrExprOp2).name()) + if (typeid(*cv_bits).name() == typeid(ExprOp2).name()) { - if (static_cast<PrdrExprOp2 *>(cv_bits)->cv_op == Prdr::AND) + if (static_cast<ExprOp2 *>(cv_bits)->cv_op == Prdr::AND) { o_errFile << std::setfill('0') << std::setw(2) << std::hex; @@ -588,12 +592,12 @@ class PrdrExprRule : public PrdrExpr }; }; -class PrdrExprAct_Try : public PrdrExpr +class ExprAct_Try : public Expr { public: - PrdrExpr * cv_left, * cv_right; + Expr * cv_left, * cv_right; - PrdrExprAct_Try(PrdrExpr * l, PrdrExpr * r) : cv_left(l), + ExprAct_Try(Expr * l, Expr * r) : cv_left(l), cv_right(r) {}; int output(FILE * i_file) @@ -623,18 +627,18 @@ class PrdrExprAct_Try : public PrdrExpr }; -class PrdrExprAct_Thresh : public PrdrExpr +class ExprAct_Thresh : public Expr { public: - PrdrExpr* cv_thresholdTime[2]; + Expr* cv_thresholdTime[2]; //Maximum threshold value supported is 255 uint8_t cv_field; uint8_t cv_mfg; uint32_t cv_3; std::string * cv_mfg_file_thr; - PrdrExprAct_Thresh( uint8_t i_field = 0, PrdrExpr * i_fieldTime = NULL, - uint8_t i_mfg = 0, PrdrExpr * i_mfgTime = NULL, + ExprAct_Thresh( uint8_t i_field = 0, Expr * i_fieldTime = NULL, + uint8_t i_mfg = 0, Expr * i_mfgTime = NULL, std::string * i_mfg_file = NULL ) : cv_field(i_field), cv_mfg(i_mfg), cv_mfg_file_thr(i_mfg_file) { @@ -734,12 +738,12 @@ class PrdrExprAct_Thresh : public PrdrExpr }; -class PrdrExprAct_Dump : public PrdrExpr //@ecdf +class ExprAct_Dump : public Expr //@ecdf { public: std::string * cv_1; - PrdrExprAct_Dump(std::string * i_1) : cv_1(i_1) {}; + ExprAct_Dump(std::string * i_1) : cv_1(i_1) {}; int output(FILE * i_file) { @@ -769,12 +773,12 @@ class PrdrExprAct_Dump : public PrdrExpr //@ecdf }; -class PrdrExprAct_Gard : public PrdrExpr +class ExprAct_Gard : public Expr { public: std::string * cv_1; - PrdrExprAct_Gard(std::string * i_1) : cv_1(i_1) {}; + ExprAct_Gard(std::string * i_1) : cv_1(i_1) {}; int output(FILE * i_file) { @@ -798,13 +802,13 @@ class PrdrExprAct_Gard : public PrdrExpr }; -class PrdrExprAct_Analyse : public PrdrExpr +class ExprAct_Analyse : public Expr { public: std::string * cv_1; uint32_t cv_2; - PrdrExprAct_Analyse( std::string * i_1, uint32_t i_2 = 0xffffffff ) : + ExprAct_Analyse( std::string * i_1, uint32_t i_2 = 0xffffffff ) : cv_1(i_1), cv_2(i_2) {} @@ -835,13 +839,13 @@ class PrdrExprAct_Analyse : public PrdrExpr }; -class PrdrExprAct_Callout : public PrdrExpr +class ExprAct_Callout : public Expr { public: std::string * cv_1, * cv_2; uint32_t cv_3; - PrdrExpr * cv_alt; + Expr * cv_alt; enum Callout_type { @@ -852,11 +856,11 @@ class PrdrExprAct_Callout : public PrdrExpr Callout_type cv_type; - PrdrExprAct_Callout(std::string * i_1, + ExprAct_Callout(std::string * i_1, std::string * i_2 = NULL, Callout_type i_t = CALLOUT_SELF, uint32_t i_3 = 0xffffffff, - PrdrExpr * i_alt = NULL) : + Expr * i_alt = NULL) : cv_1(i_1), cv_2(i_2), cv_3(i_3), cv_alt(i_alt), cv_type(i_t) {} @@ -916,12 +920,12 @@ class PrdrExprAct_Callout : public PrdrExpr }; -class PrdrExprAct_Funccall : public PrdrExpr +class ExprAct_Funccall : public Expr { public: std::string * cv_1, * cv_2; - PrdrExprAct_Funccall(std::string * i_1, std::string * i_2 = NULL) : + ExprAct_Funccall(std::string * i_1, std::string * i_2 = NULL) : cv_1(i_1), cv_2(i_2) {}; int output(FILE * i_file) @@ -958,12 +962,12 @@ class PrdrExprAct_Funccall : public PrdrExpr }; -class PrdrExprAct_Flag : public PrdrExpr +class ExprAct_Flag : public Expr { public: std::string * cv_1; - PrdrExprAct_Flag(std::string * i_1) : cv_1(i_1) {}; + ExprAct_Flag(std::string * i_1) : cv_1(i_1) {}; int output(FILE * i_file) { @@ -988,12 +992,12 @@ class PrdrExprAct_Flag : public PrdrExpr }; -class PrdrExprAct_Capture : public PrdrExpr +class ExprAct_Capture : public Expr { public: std::string * cv_1; - PrdrExprAct_Capture(std::string * i_1) : cv_1(i_1) {}; + ExprAct_Capture(std::string * i_1) : cv_1(i_1) {}; int output(FILE * i_file) { @@ -1018,27 +1022,12 @@ class PrdrExprAct_Capture : public PrdrExpr }; +extern std::map<std::string, Expr *> g_rules; -extern std::map<std::string, PrdrExpr *> g_rules; +typedef std::pair<std::string, std::string> RefPair; +extern std::list<RefPair> g_references; -typedef std::pair<std::string, std::string> PrdrRefPair; -extern std::list<PrdrRefPair> g_references; +} // end namespace PRDR_COMPILER #endif -// Change Log ********************************************************* -// -// Flag Reason Vers Date Coder Description -// ---- -------- ---- -------- -------- ------------------------------- -// F494911 f310 03/04/05 iawillia Initial File Creation -// D515833 f300 09/19/05 iawillia Add capture support. -// F526728 f300 10/25/05 iawillia Add >> and << registers. -// F534311 f300 01/10/06 iawillia Add bit string expression. -// F544848 f300 04/03/06 iawillia Add multi-bit support. -// F549888 f300 05/01/06 iawillia Add Proc. CS attention. -// ecdf F550548 f300 05/04/06 iawillia eClipz DUMP flags support. -// D555348 f310 06/05/06 iawillia Update HTML generation. -// jl02 F605874 f330 07/31/07 lukas Add functions to PRD framework/Galaxy -// 2 code for unit CS. -// @jl04 F630836 f330 09/17/07 lukas Add error log Cap. type. -// End Change Log ***************************************************** diff --git a/src/usr/diag/prdf/common/framework/rule/prdrGroup.H b/src/usr/diag/prdf/common/framework/rule/prdrGroup.H index 5d310ba9b..f7450426a 100755 --- a/src/usr/diag/prdf/common/framework/rule/prdrGroup.H +++ b/src/usr/diag/prdf/common/framework/rule/prdrGroup.H @@ -31,33 +31,36 @@ #include <prdrExpr.H> #include <prdrCommon.H> -class PrdrChip; -extern PrdrChip * g_currentChip; +namespace PRDR_COMPILER +{ + +class Chip; +extern Chip * g_currentChip; extern uint32_t g_nextAndBit; -class PrdrGroup_Filter; +class Group_Filter; -class PrdrGroup +class Group { public: - std::list<PrdrExpr *> cv_rules; - PrdrExpr * cv_priorityList; + std::list<Expr *> cv_rules; + Expr * cv_priorityList; char cv_op; uint8_t cv_flags; std::string cv_doxcomment; - PrdrGroup() : + Group() : cv_priorityList(NULL), cv_op(Prdr::GROUP), cv_flags(0), cv_doxcomment() {}; - PrdrGroup(char o) : + Group(char o) : cv_priorityList(NULL), cv_op(o), cv_flags(0), cv_doxcomment() {}; - static void merge(PrdrGroup * i_l, PrdrGroup * i_r) + static void merge(Group * i_l, Group * i_r) { // Copy over rules. i_l->cv_rules.insert(i_l->cv_rules.end(), @@ -77,7 +80,7 @@ class PrdrGroup { if (Prdr::GROUP == cv_op) { - PrdrExpr * l_front = *(cv_rules.begin()); + Expr * l_front = *(cv_rules.begin()); if (NULL == l_front) { // ICE. @@ -133,7 +136,7 @@ class PrdrGroup o_stream << "<TD>" << std::endl; } - for (std::list<PrdrExpr *>::iterator i = cv_rules.begin(); + for (std::list<Expr *>::iterator i = cv_rules.begin(); i != cv_rules.end(); i++) { @@ -184,7 +187,7 @@ class PrdrGroup } - for (std::list<PrdrExpr *>::iterator i = cv_rules.begin(); + for (std::list<Expr *>::iterator i = cv_rules.begin(); i != cv_rules.end(); i++) { @@ -197,51 +200,42 @@ class PrdrGroup }; -extern std::map<std::string, PrdrGroup *> g_groups; -extern std::map<std::string, PrdrGroup *> g_actionclasses; +extern std::map<std::string, Group *> g_groups; +extern std::map<std::string, Group *> g_actionclasses; extern std::map<std::string, std::string> g_attentionStartGroup; -class PrdrGroup_Filter +class Group_Filter { public: - virtual ~PrdrGroup_Filter() { } // zs01 - virtual void AddFilter(PrdrGroup *) = 0; + virtual ~Group_Filter() { } // zs01 + virtual void AddFilter(Group *) = 0; }; -class PrdrGroup_Filter_SingleBit : public PrdrGroup_Filter +class Group_Filter_SingleBit : public Group_Filter { public: - void AddFilter(PrdrGroup * i_group) + void AddFilter(Group * i_group) { i_group->cv_flags |= Prdr::PRDR_GROUP_FILTER_SINGLE_BIT; }; }; -class PrdrGroup_Filter_Priority : public PrdrGroup_Filter +class Group_Filter_Priority : public Group_Filter { public: - PrdrGroup_Filter_Priority(PrdrExpr * i_list) : iv_list(i_list) {}; + Group_Filter_Priority(Expr * i_list) : iv_list(i_list) {}; - void AddFilter(PrdrGroup * i_group) + void AddFilter(Group * i_group) { i_group->cv_flags |= Prdr::PRDR_GROUP_FILTER_PRIORITY; i_group->cv_priorityList = iv_list; }; private: - PrdrExpr * iv_list; + Expr * iv_list; }; +} // end namespace PRDR_COMPILER #endif -// Change Log ********************************************************* -// -// Flag Reason Vers Date Coder Description -// ---- -------- ---- -------- -------- ------------------------------- -// F494911 f310 03/04/05 iawillia Initial File Creation -// F544848 f300 04/03/06 iawillia Add multi-bit support. -// D555348 f310 06/05/06 iawillia Update HTML generation. -// F557408 f310 06/16/06 iawillia Add single-bit filter support. -// zs01 D620028 f330 07/25/07 zshelle Support for mcp5 compiler -// End Change Log ***************************************************** diff --git a/src/usr/diag/prdf/common/framework/rule/prdrLoadChip.C b/src/usr/diag/prdf/common/framework/rule/prdrLoadChip.C index dd76a6234..076524b4f 100755 --- a/src/usr/diag/prdf/common/framework/rule/prdrLoadChip.C +++ b/src/usr/diag/prdf/common/framework/rule/prdrLoadChip.C @@ -39,10 +39,10 @@ namespace Prdr { -void prdrReadExpr(UtilStream & i_stream, PrdrExpr & o_expr); +void ReadExpr(UtilStream & i_stream, Expr & o_expr); // NOTE: caller must call delete[] to release the buffer -void prdrReadString(UtilStream & i_stream, char *& o_string) +void ReadString(UtilStream & i_stream, char *& o_string) { char l_pBuf[100]; memset(l_pBuf,'\0',100); @@ -82,7 +82,7 @@ void prdrReadBitString(UtilStream & i_stream, std::vector<uint64_t> & o_vector) } } -errlHndl_t prdrLoadChip(UtilStream & i_stream, PrdrChip & o_chip) +errlHndl_t LoadChip(UtilStream & i_stream, Chip & o_chip) { errlHndl_t l_errl = NULL; @@ -94,28 +94,28 @@ errlHndl_t prdrLoadChip(UtilStream & i_stream, PrdrChip & o_chip) i_stream >> l_temp; if (0 != memcmp(l_temp, "PRDRCHIP", 8)) { - PRDF_ERR("prdrLoadChip() bad chip file - l_temp: %s ", l_temp); + PRDF_ERR("LoadChip() bad chip file - l_temp: %s ", l_temp); // Bad chip file. /*@ * @errortype - * @refcode LIC_REFCODE - * @subsys EPUB_FIRMWARE_SP - * @reasoncode PRDF_CODE_FAIL + * @refcode LIC_REFCODE + * @subsys EPUB_FIRMWARE_SP + * @reasoncode PRDF_CODE_FAIL * - * @moduleid PRDF_PRDRLOADCHIP - * @userdata1 0x50524452 ("PRDR") - * @userdata2 0x43484950 ("CHIP") - * @devdesc Attempted to load chip rule file that lacked - * the proper header "PRDRCHIP". + * @moduleid PRDF_LOADCHIP + * @userdata1 0x50524452 ("PRDR") + * @userdata2 0x43484950 ("CHIP") + * @devdesc Attempted to load chip rule file that lacked + * the proper header "PRDRCHIP". */ PRDF_CREATE_ERRL(l_errl, ERRL_SEV_UNRECOVERABLE, ERRL_ETYPE_NOT_APPLICABLE, SRCI_ERR_INFO, SRCI_NO_ATTR, - PRDF_PRDRLOADCHIP, + PRDF::PRDF_LOADCHIP, LIC_REFCODE, - PRDF_CODE_FAIL, + PRDF::PRDF_CODE_FAIL, 0x50524452, // PRDR 0x43484950, // CHIP 0, 0); @@ -134,7 +134,7 @@ errlHndl_t prdrLoadChip(UtilStream & i_stream, PrdrChip & o_chip) if (o_chip.cv_regCount != 0) { - o_chip.cv_registers = new PrdrRegister[o_chip.cv_regCount]; + o_chip.cv_registers = new Register[o_chip.cv_regCount]; for (uint32_t i = 0; i < o_chip.cv_regCount; i++) { i_stream >> o_chip.cv_registers[i].cv_name; @@ -142,7 +142,7 @@ errlHndl_t prdrLoadChip(UtilStream & i_stream, PrdrChip & o_chip) i_stream >> o_chip.cv_registers[i].cv_scomAddr; if (o_chip.cv_registers[i].cv_flags & - Prdr::PRDR_REGISTER_SCOMLEN) + PRDR_REGISTER_SCOMLEN) { i_stream >> o_chip.cv_registers[i].cv_scomLen; } @@ -152,7 +152,7 @@ errlHndl_t prdrLoadChip(UtilStream & i_stream, PrdrChip & o_chip) } if (o_chip.cv_registers[i].cv_flags & - Prdr::PRDR_REGISTER_RESETS) + PRDR_REGISTER_RESETS) { // Read 'n' from stream. Read that many reset structs out // of the stream, insert into cv_resets for register. @@ -160,15 +160,15 @@ errlHndl_t prdrLoadChip(UtilStream & i_stream, PrdrChip & o_chip) std::back_inserter( o_chip.cv_registers[i].cv_resets ), - Util::unary_input<uint16_t, UtilStream>(i_stream)(), - Util::unary_input<PrdrRegister::ResetOrMaskStruct, + PRDF::Util::unary_input<uint16_t, UtilStream>(i_stream)(), + PRDF::Util::unary_input<Register::ResetOrMaskStruct, UtilStream> (i_stream) ); } if (o_chip.cv_registers[i].cv_flags & - Prdr::PRDR_REGISTER_MASKS) + PRDR_REGISTER_MASKS) { // Read 'n' from stream. Read that many mask structs out // of the stream, insert into cv_masks for register. @@ -176,15 +176,15 @@ errlHndl_t prdrLoadChip(UtilStream & i_stream, PrdrChip & o_chip) std::back_inserter( o_chip.cv_registers[i].cv_masks ), - Util::unary_input<uint16_t, UtilStream>(i_stream)(), - Util::unary_input<PrdrRegister::ResetOrMaskStruct, + PRDF::Util::unary_input<uint16_t, UtilStream>(i_stream)(), + PRDF::Util::unary_input<Register::ResetOrMaskStruct, UtilStream> (i_stream) ); } if (o_chip.cv_registers[i].cv_flags & - Prdr::PRDR_REGISTER_CAPTURE) + PRDR_REGISTER_CAPTURE) { // Read 'n' from stream. Read that many mask structs out // of the stream, insert into cv_masks for register. @@ -192,8 +192,8 @@ errlHndl_t prdrLoadChip(UtilStream & i_stream, PrdrChip & o_chip) std::back_inserter( o_chip.cv_registers[i].cv_captures ), - Util::unary_input<uint16_t, UtilStream>(i_stream)(), - Util::unary_input<PrdrRegister::CaptureInfoStruct, + PRDF::Util::unary_input<uint16_t, UtilStream>(i_stream)(), + PRDF::Util::unary_input<Register::CaptureInfoStruct, UtilStream> (i_stream) ); } @@ -204,11 +204,11 @@ errlHndl_t prdrLoadChip(UtilStream & i_stream, PrdrChip & o_chip) i_stream >> o_chip.cv_ruleCount; if (o_chip.cv_ruleCount != 0) { - o_chip.cv_rules = new PrdrExpr[o_chip.cv_ruleCount]; + o_chip.cv_rules = new Expr[o_chip.cv_ruleCount]; for (uint32_t i = 0; i < o_chip.cv_ruleCount; i++) { i_stream >> l_temp[0]; // should be 'R' - prdrReadExpr(i_stream, o_chip.cv_rules[i]); + ReadExpr(i_stream, o_chip.cv_rules[i]); } } @@ -218,19 +218,19 @@ errlHndl_t prdrLoadChip(UtilStream & i_stream, PrdrChip & o_chip) i_stream >> o_chip.cv_groupAttn[i]; if (o_chip.cv_groupCount != 0) { - o_chip.cv_groups = new PrdrExpr * [o_chip.cv_groupCount]; + o_chip.cv_groups = new Expr * [o_chip.cv_groupCount]; o_chip.cv_groupSize = new uint16_t[o_chip.cv_groupCount]; o_chip.cv_groupFlags = new uint8_t[o_chip.cv_groupCount]; - o_chip.cv_groupPriorityBits = new PrdrExpr * [o_chip.cv_groupCount]; + o_chip.cv_groupPriorityBits = new Expr * [o_chip.cv_groupCount]; for (uint32_t i = 0; i < o_chip.cv_groupCount; i++) { i_stream >> l_temp[0]; // should be 'G' i_stream >> o_chip.cv_groupSize[i]; i_stream >> o_chip.cv_groupFlags[i]; - if (Prdr::PRDR_GROUP_FILTER_PRIORITY & o_chip.cv_groupFlags[i]) + if (PRDR_GROUP_FILTER_PRIORITY & o_chip.cv_groupFlags[i]) { - o_chip.cv_groupPriorityBits[i] = new PrdrExpr(); - prdrReadExpr(i_stream, *o_chip.cv_groupPriorityBits[i]); + o_chip.cv_groupPriorityBits[i] = new Expr(); + ReadExpr(i_stream, *o_chip.cv_groupPriorityBits[i]); } else { @@ -238,19 +238,19 @@ errlHndl_t prdrLoadChip(UtilStream & i_stream, PrdrChip & o_chip) } if (0 != o_chip.cv_groupSize[i]) { - o_chip.cv_groups[i] = new PrdrExpr[o_chip.cv_groupSize[i]]; + o_chip.cv_groups[i] = new Expr[o_chip.cv_groupSize[i]]; for (uint32_t j = 0; j < o_chip.cv_groupSize[i]; j++) { - prdrReadExpr(i_stream, o_chip.cv_groups[i][j]); - if (Prdr::REF_RULE == o_chip.cv_groups[i][j].cv_op) + ReadExpr(i_stream, o_chip.cv_groups[i][j]); + if (REF_RULE == o_chip.cv_groups[i][j].cv_op) { for (int k = 1; k <= 2; k++) { o_chip.cv_groups[i][j].cv_value[k].p = - new PrdrExpr(); + new Expr(); o_chip.cv_groups[i][j].cv_deletePtr[k] = true; - prdrReadExpr(i_stream, + ReadExpr(i_stream, *o_chip.cv_groups[i][j].cv_value[k].p); } } @@ -258,7 +258,7 @@ errlHndl_t prdrLoadChip(UtilStream & i_stream, PrdrChip & o_chip) } else { - o_chip.cv_groups[i] = new PrdrExpr[0]; /*accessing beyond memory*/ + o_chip.cv_groups[i] = new Expr[0]; /*accessing beyond memory*/ // False error BEAM. }; } @@ -268,7 +268,7 @@ errlHndl_t prdrLoadChip(UtilStream & i_stream, PrdrChip & o_chip) i_stream >> o_chip.cv_actionCount; if (o_chip.cv_actionCount != 0) { - o_chip.cv_actions = new PrdrExpr * [o_chip.cv_actionCount]; + o_chip.cv_actions = new Expr * [o_chip.cv_actionCount]; o_chip.cv_actionSize = new uint16_t[o_chip.cv_actionCount]; for (uint32_t i = 0; i < o_chip.cv_actionCount; i++) { @@ -277,10 +277,10 @@ errlHndl_t prdrLoadChip(UtilStream & i_stream, PrdrChip & o_chip) if (0 != o_chip.cv_actionSize[i]) { o_chip.cv_actions[i] = - new PrdrExpr[o_chip.cv_actionSize[i]]; + new Expr[o_chip.cv_actionSize[i]]; for (uint32_t j = 0; j < o_chip.cv_actionSize[i]; j++) { - prdrReadExpr(i_stream, o_chip.cv_actions[i][j]); + ReadExpr(i_stream, o_chip.cv_actions[i][j]); } } else //@pw01 @@ -298,7 +298,7 @@ errlHndl_t prdrLoadChip(UtilStream & i_stream, PrdrChip & o_chip) return l_errl; } -void prdrReadExpr(UtilStream & i_stream, PrdrExpr & o_expr) +void ReadExpr(UtilStream & i_stream, Expr & o_expr) { unsigned char l_tmpChar; uint32_t l_tmp32; @@ -310,52 +310,52 @@ void prdrReadExpr(UtilStream & i_stream, PrdrExpr & o_expr) switch(o_expr.cv_op) { - case Prdr::AND: - case Prdr::OR: - case Prdr::XOR: - case Prdr::LSHIFT: - case Prdr::RSHIFT: - case Prdr::ACT_TRY: - o_expr.cv_value[0].p = new PrdrExpr(); + case AND: + case OR: + case XOR: + case LSHIFT: + case RSHIFT: + case ACT_TRY: + o_expr.cv_value[0].p = new Expr(); o_expr.cv_deletePtr[0] = true; - prdrReadExpr(i_stream, *o_expr.cv_value[0].p); + ReadExpr(i_stream, *o_expr.cv_value[0].p); - o_expr.cv_value[1].p = new PrdrExpr(); + o_expr.cv_value[1].p = new Expr(); o_expr.cv_deletePtr[1] = true; - prdrReadExpr(i_stream, *o_expr.cv_value[1].p); + ReadExpr(i_stream, *o_expr.cv_value[1].p); break; - case Prdr::NOT: - o_expr.cv_value[0].p = new PrdrExpr(); + case NOT: + o_expr.cv_value[0].p = new Expr(); o_expr.cv_deletePtr[0] = true; - prdrReadExpr(i_stream, *o_expr.cv_value[0].p); + ReadExpr(i_stream, *o_expr.cv_value[0].p); break; - case Prdr::INTEGER: - case Prdr::ACT_GARD: - case Prdr::ACT_FLAG: + case INTEGER: + case ACT_GARD: + case ACT_FLAG: i_stream >> o_expr.cv_value[0].i; break; - case Prdr::REF_RULE: - case Prdr::REF_REG: - case Prdr::REF_GRP: - case Prdr::REF_ACT: - case Prdr::INT_SHORT: + case REF_RULE: + case REF_REG: + case REF_GRP: + case REF_ACT: + case INT_SHORT: i_stream >> l_tmp16; o_expr.cv_value[0].i = l_tmp16; break; - case Prdr::BIT_STR: + case BIT_STR: o_expr.cv_bitStrVect.clear(); prdrReadBitString(i_stream, o_expr.cv_bitStrVect); break; - case Prdr::ACT_THRES: - o_expr.cv_value[0].i = ThresholdResolution::cv_fieldDefault.interval; - o_expr.cv_value[1].i = ThresholdResolution::cv_fieldDefault.threshold; - o_expr.cv_value[2].i = ThresholdResolution::cv_mnfgDefault.interval; - o_expr.cv_value[3].i = ThresholdResolution::cv_mnfgDefault.threshold; + case ACT_THRES: + o_expr.cv_value[0].i = PRDF::ThresholdResolution::cv_fieldDefault.interval; + o_expr.cv_value[1].i = PRDF::ThresholdResolution::cv_fieldDefault.threshold; + o_expr.cv_value[2].i = PRDF::ThresholdResolution::cv_mnfgDefault.interval; + o_expr.cv_value[3].i = PRDF::ThresholdResolution::cv_mnfgDefault.threshold; //The syntax of thresholds in rule file is // op field_threshold field_intervale //optional fields (mnfg_threshold, mnfg_interval } | mnfg_ilr_threshold | maskid @@ -385,19 +385,19 @@ void prdrReadExpr(UtilStream & i_stream, PrdrExpr & o_expr) i_stream >> o_expr.cv_value[5]; break; - case Prdr::ACT_ANALY: + case ACT_ANALY: i_stream >> o_expr.cv_value[0].i; i_stream >> o_expr.cv_value[1].i; break; - case Prdr::ACT_FUNC: + case ACT_FUNC: o_expr.cv_actFunc = NULL; - prdrReadString(i_stream, o_expr.cv_actFunc); + ReadString(i_stream, o_expr.cv_actFunc); i_stream >> o_expr.cv_value[1].i; break; - case Prdr::ACT_CALL: + case ACT_CALL: i_stream >> l_tmpChar; o_expr.cv_value[0].i = l_tmpChar; i_stream >> o_expr.cv_value[1].i; @@ -410,32 +410,32 @@ void prdrReadExpr(UtilStream & i_stream, PrdrExpr & o_expr) i_stream >> l_tmpChar; if (0 != l_tmpChar) { - o_expr.cv_value[4].p = new PrdrExpr(); + o_expr.cv_value[4].p = new Expr(); o_expr.cv_deletePtr[4] = true; - prdrReadExpr(i_stream, *o_expr.cv_value[4].p); + ReadExpr(i_stream, *o_expr.cv_value[4].p); } else o_expr.cv_value[4].p = NULL; } break; - case Prdr::ACT_DUMP: //@ecdf + case ACT_DUMP: //@ecdf i_stream >> o_expr.cv_value[0].i; break; - case Prdr::ATTNLINK: + case ATTNLINK: i_stream >> l_tmpChar; // get count l_tmp32 = l_tmpChar; for (size_t i = 0; i < l_tmp32; i++) { i_stream >> l_tmpChar; // get index - o_expr.cv_value[l_tmpChar].p = new PrdrExpr(); + o_expr.cv_value[l_tmpChar].p = new Expr(); o_expr.cv_deletePtr[l_tmpChar] = true; - prdrReadExpr(i_stream, *o_expr.cv_value[l_tmpChar].p); + ReadExpr(i_stream, *o_expr.cv_value[l_tmpChar].p); } break; - case Prdr::ACT_CAPT: + case ACT_CAPT: i_stream >> o_expr.cv_value[0].i; default: @@ -443,10 +443,10 @@ void prdrReadExpr(UtilStream & i_stream, PrdrExpr & o_expr) } } -PrdrRegister::PrdrRegister() : cv_name(0) +Register::Register() : cv_name(0) {} -PrdrRegister::~PrdrRegister() +Register::~Register() { for(std::vector<CaptureInfoStruct>::iterator j = cv_captures.begin(); @@ -461,7 +461,7 @@ PrdrRegister::~PrdrRegister() } } -PrdrExpr::PrdrExpr() +Expr::Expr() { cv_op = 0; cv_actFunc = NULL; @@ -473,21 +473,21 @@ PrdrExpr::PrdrExpr() } } -PrdrExpr::~PrdrExpr() +Expr::~Expr() { // Special things for certain operator types... switch (cv_op) { // On function call operator and bit string, // cv_value[0].p points to a string. - case Prdr::ACT_FUNC: + case ACT_FUNC: if(NULL != cv_actFunc) { delete[] cv_actFunc; cv_actFunc = NULL; } break; - case Prdr::BIT_STR: + case BIT_STR: cv_bitStrVect.clear(); break; @@ -502,4 +502,4 @@ PrdrExpr::~PrdrExpr() delete (cv_value[i].p); }; -} // end namespace. +} // end namespace Prdr diff --git a/src/usr/diag/prdf/common/framework/rule/prdrLoadChip.H b/src/usr/diag/prdf/common/framework/rule/prdrLoadChip.H index 4a54e5f1e..de5a28d75 100755 --- a/src/usr/diag/prdf/common/framework/rule/prdrLoadChip.H +++ b/src/usr/diag/prdf/common/framework/rule/prdrLoadChip.H @@ -56,13 +56,13 @@ namespace Prdr * @brief read string data out from the stream * @note caller must call delete[] to release the buffer */ - void prdrReadString(UtilStream & i_stream, char *& o_string); + void ReadString(UtilStream & i_stream, char *& o_string); /** - * @class PrdrRegister + * @class Register * @brief Holds data associated with a register. */ - class PrdrRegister + class Register { public: uint16_t cv_name; /** hash id of Register Short Name */ @@ -72,8 +72,8 @@ namespace Prdr uint64_t cv_scomAddr; /** Scom Address */ uint16_t cv_scomLen; /** Scom Length */ - PrdrRegister(); - ~PrdrRegister(); + Register(); + ~Register(); struct ResetOrMaskStruct { @@ -126,7 +126,7 @@ namespace Prdr i_right.func = NULL; if ('f' == i_right.op) { - prdrReadString(i_left, i_right.func); + ReadString(i_left, i_right.func); } return i_left; @@ -138,13 +138,13 @@ namespace Prdr }; /** - * @class PrdrExpr + * @class Expr * @brief Contains data for the basic rule object, the "expression". */ - class PrdrExpr + class Expr { public: - union value { uint32_t i; PrdrExpr * p; }; + union value { uint32_t i; Expr * p; }; /** Maximum number of entries a expression can have. */ static const uint32_t MAX_VALUES = 6; @@ -162,25 +162,25 @@ namespace Prdr std::vector<uint64_t> cv_bitStrVect; /** - * @func PrdrExpr() + * @func Expr() * @brief Default constructor. Clear entry arrays. */ - PrdrExpr(); + Expr(); /** - * @func ~PrdrExpr() + * @func ~Expr() * @brief Default destructor. Delete all attached pointers, as * requested. */ - ~PrdrExpr(); + ~Expr(); private: // Don't let us copy these things, we don't want to mess with the // pointer tree. - PrdrExpr(const PrdrExpr & i_copy) {}; + Expr(const Expr & i_copy) {}; }; - class PrdrChip + class Chip { public: uint32_t cv_chipId; @@ -189,20 +189,20 @@ namespace Prdr uint32_t cv_dumpType; // default dump content type. uint16_t cv_scomLen; // default scom length. uint16_t cv_regCount; - PrdrRegister * cv_registers; + Register * cv_registers; uint16_t cv_ruleCount; - PrdrExpr * cv_rules; + Expr * cv_rules; uint16_t cv_groupCount; uint16_t cv_groupAttn[NUM_GROUP_ATTN]; uint16_t * cv_groupSize; uint8_t * cv_groupFlags; - PrdrExpr ** cv_groupPriorityBits; - PrdrExpr ** cv_groups; + Expr ** cv_groupPriorityBits; + Expr ** cv_groups; uint16_t cv_actionCount; uint16_t * cv_actionSize; - PrdrExpr ** cv_actions; + Expr ** cv_actions; - PrdrChip() : cv_regCount(0), cv_registers(NULL), + Chip() : cv_regCount(0), cv_registers(NULL), cv_ruleCount(0), cv_rules(NULL), cv_groupCount(0), cv_groupSize(NULL), cv_groupFlags(NULL), cv_groupPriorityBits(NULL), @@ -212,7 +212,7 @@ namespace Prdr { }; - ~PrdrChip() + ~Chip() { if (NULL != cv_registers) delete[] cv_registers; if (NULL != cv_rules) delete[] cv_rules; @@ -234,7 +234,8 @@ namespace Prdr }; }; - errlHndl_t prdrLoadChip(UtilStream & i_stream, PrdrChip & o_chip); + errlHndl_t LoadChip(UtilStream & i_stream, Chip & o_chip); + +} // end namespace Prdr -}; #endif diff --git a/src/usr/diag/prdf/common/framework/rule/prdrLoadChipCache.C b/src/usr/diag/prdf/common/framework/rule/prdrLoadChipCache.C index a23e286aa..a7045b6dd 100755 --- a/src/usr/diag/prdf/common/framework/rule/prdrLoadChipCache.C +++ b/src/usr/diag/prdf/common/framework/rule/prdrLoadChipCache.C @@ -47,7 +47,7 @@ namespace Prdr ++i) { if (NULL != i->second) - delete (PrdrChip*)i->second; + delete (Chip*)i->second; } // Clear map. @@ -57,7 +57,7 @@ namespace Prdr //--------------------------------------------------------------------- errlHndl_t LoadChipCache::loadChip(const char * i_file, - PrdrChip ** o_chip) + Chip ** o_chip) { errlHndl_t l_errl = NULL; *o_chip = NULL; @@ -66,12 +66,12 @@ namespace Prdr if (cv_cache.end() != i) // Found object in cache. { - (*o_chip) = (PrdrChip*)(*i).second; + (*o_chip) = (Chip*)(*i).second; l_errl = NULL; } else { - (*o_chip) = new PrdrChip; + (*o_chip) = new Chip; do { @@ -145,7 +145,7 @@ namespace Prdr #endif // Load chip object. - l_errl = Prdr::prdrLoadChip(l_ruleFile, *(*o_chip)); + l_errl = LoadChip(l_ruleFile, *(*o_chip)); } while (0); @@ -167,4 +167,5 @@ namespace Prdr }; //--------------------------------------------------------------------- -} + +} // end namespace Prdr diff --git a/src/usr/diag/prdf/common/framework/rule/prdrLoadChipCache.H b/src/usr/diag/prdf/common/framework/rule/prdrLoadChipCache.H index 16ecb5762..e3ea98525 100755 --- a/src/usr/diag/prdf/common/framework/rule/prdrLoadChipCache.H +++ b/src/usr/diag/prdf/common/framework/rule/prdrLoadChipCache.H @@ -72,11 +72,12 @@ namespace Prdr * * @retuns errlHndl_t - In the event of a registry or file failure. */ - static errlHndl_t loadChip(const char * i_file, PrdrChip ** o_chip); + static errlHndl_t loadChip(const char * i_file, Chip ** o_chip); private: /** The file cache. */ - typedef std::map<const char *, PrdrChip *, PrdfStrCompare> Cache_t; + typedef std::map<const char *, Chip *, PRDF::StrCompare> Cache_t; static Cache_t cv_cache; }; -}; + +} // end namespace Prdr diff --git a/src/usr/diag/prdf/common/framework/rule/prdrRegister.H b/src/usr/diag/prdf/common/framework/rule/prdrRegister.H index ac005899b..3e00a01f5 100755 --- a/src/usr/diag/prdf/common/framework/rule/prdrRegister.H +++ b/src/usr/diag/prdf/common/framework/rule/prdrRegister.H @@ -49,10 +49,13 @@ #include <utilendian.H> #endif +namespace PRDR_COMPILER +{ + extern Prdr::HashCollisionMap g_regsHashCollision; extern bool g_hadError; -struct PrdrResetOrMaskStruct +struct ResetOrMaskStruct { uint8_t type; uint64_t addr_r; @@ -72,7 +75,7 @@ struct PrdrResetOrMaskStruct } }; -struct PrdrCaptureReqStruct +struct CaptureReqStruct { uint8_t type; uint32_t data[2]; @@ -123,7 +126,7 @@ struct PrdrCaptureReqStruct }; }; -class PrdrRegister +class Register { public: @@ -137,12 +140,12 @@ class PrdrRegister std::string cv_name_default; - std::list<PrdrResetOrMaskStruct> cv_resets; - std::list<PrdrResetOrMaskStruct> cv_masks; + std::list<ResetOrMaskStruct> cv_resets; + std::list<ResetOrMaskStruct> cv_masks; - std::list<PrdrCaptureReqStruct> cv_captures; + std::list<CaptureReqStruct> cv_captures; - PrdrRegister() : + Register() : cv_sname(NULL), cv_name(&cv_name_default), cv_flags(0), @@ -151,7 +154,7 @@ class PrdrRegister cv_resets(0), cv_masks(0), cv_captures(0) {}; - static void merge(PrdrRegister * i_l, PrdrRegister * i_r) + static void merge(Register * i_l, Register * i_r) { if (NULL != i_r->cv_sname) i_l->cv_sname = i_r->cv_sname; @@ -196,7 +199,7 @@ class PrdrRegister int output( FILE * l_file, uint16_t i_sigOff ) { // Check for hash collisions - uint16_t hash = Util::hashString( cv_sname->c_str() ) ^ i_sigOff; + uint16_t hash = PRDF::Util::hashString( cv_sname->c_str() ) ^ i_sigOff; Prdr::HashCollisionMap::iterator i = g_regsHashCollision.find(hash); if ( g_regsHashCollision.end() != i ) { @@ -228,7 +231,7 @@ class PrdrRegister uint32_t l_temp; uint16_t l_temp16; - l_temp16 = htons(Util::hashString( cv_sname->c_str() )); + l_temp16 = htons(PRDF::Util::hashString( cv_sname->c_str() )); fwrite(&l_temp16, sizeof(l_temp16), 1, l_file); l_temp = htonl(cv_flags); @@ -250,7 +253,7 @@ class PrdrRegister std::for_each( cv_resets.begin(), cv_resets.end(), std::bind2nd( - std::mem_fun_ref(&PrdrResetOrMaskStruct::output), + std::mem_fun_ref(&ResetOrMaskStruct::output), l_file) ); } @@ -261,7 +264,7 @@ class PrdrRegister std::for_each( cv_masks.begin(), cv_masks.end(), std::bind2nd( - std::mem_fun_ref(&PrdrResetOrMaskStruct::output), + std::mem_fun_ref(&ResetOrMaskStruct::output), l_file) ); } @@ -272,7 +275,7 @@ class PrdrRegister std::for_each( cv_captures.begin(), cv_captures.end(), std::bind2nd( - std::mem_fun_ref(&PrdrCaptureReqStruct::output), + std::mem_fun_ref(&CaptureReqStruct::output), l_file) ); } @@ -281,7 +284,7 @@ class PrdrRegister void outputRegisterFile(std::ostream & o_file, uint16_t i_sigOff) { - uint16_t hash = Util::hashString( cv_sname->c_str() ) ^ i_sigOff; + uint16_t hash = PRDF::Util::hashString( cv_sname->c_str() ) ^ i_sigOff; o_file << "\tPRDR_REGISTER_ID ( " << std::hex @@ -294,7 +297,9 @@ class PrdrRegister }; }; -typedef std::list<PrdrRegister *> PrdrRegisterList; +typedef std::list<Register *> RegisterList; + +} // end namespace PRDR_COMPILER #endif diff --git a/src/usr/diag/prdf/common/framework/rule/prdrToken.H b/src/usr/diag/prdf/common/framework/rule/prdrToken.H index 38e7bb061..4c1cffb01 100755 --- a/src/usr/diag/prdf/common/framework/rule/prdrToken.H +++ b/src/usr/diag/prdf/common/framework/rule/prdrToken.H @@ -53,14 +53,12 @@ extern void yyerror(const char *); extern int yyline; extern std::stack<std::pair<std::string, int> > yyincfiles; -extern PrdrChip * g_currentChip; +namespace PRDR_COMPILER +{ + +extern Chip * g_currentChip; + +} // end namespace PRDR_COMPILER #endif -// Change Log ********************************************************* -// -// Flag Reason Vers Date Coder Description -// ---- -------- ---- -------- -------- ------------------------------- -// F494911 f310 03/04/05 iawillia Initial File Creation -// -// End Change Log ***************************************************** diff --git a/src/usr/diag/prdf/common/framework/service/iipServiceDataCollector.h b/src/usr/diag/prdf/common/framework/service/iipServiceDataCollector.h index fd9083c3b..1cac60abf 100755 --- a/src/usr/diag/prdf/common/framework/service/iipServiceDataCollector.h +++ b/src/usr/diag/prdf/common/framework/service/iipServiceDataCollector.h @@ -84,13 +84,15 @@ #endif -// dg07 start +namespace PRDF +{ + struct SdcCallout { PRDF::PRDcallout callout; PRDF::PRDpriority priority; //bool gard; - SdcCallout() : callout(NULL), priority(PRDF::MRU_LOW) {} - SdcCallout(PRDF::PRDcallout & mru, PRDF::PRDpriority p) + SdcCallout() : callout(NULL), priority(MRU_LOW) {} + SdcCallout(PRDcallout & mru, PRDpriority p) : callout(mru), priority(p) {} SdcCallout(TARGETING::TargetHandle_t i_pcalloutHandle , PRDF::PRDpriority p) @@ -102,28 +104,28 @@ typedef std::vector<SdcCallout> SDC_MRU_LIST; #ifndef __HOSTBOOT_MODULE -struct PrdfHcdbChangeItem { +struct HcdbChangeItem { TARGETING::TargetHandle_t iv_phcdbtargetHandle ; hcdb::comp_subtype_t iv_compSubType; comp_id_t iv_compType; - PrdfHcdbChangeItem() : iv_phcdbtargetHandle(NULL), iv_compSubType(hcdb::LBST_ABIST) {} - PrdfHcdbChangeItem(TARGETING::TargetHandle_t i_pTargetHandle, hcdb::comp_subtype_t i_compSubType, comp_id_t i_compType) + HcdbChangeItem() : iv_phcdbtargetHandle(NULL), iv_compSubType(hcdb::LBST_ABIST) {} + HcdbChangeItem(TARGETING::TargetHandle_t i_pTargetHandle, hcdb::comp_subtype_t i_compSubType, comp_id_t i_compType) : iv_phcdbtargetHandle(i_pTargetHandle), iv_compSubType(i_compSubType), iv_compType(i_compType){} }; -typedef std::vector<PrdfHcdbChangeItem> HCDB_CHANGE_LIST; +typedef std::vector<HcdbChangeItem> HCDB_CHANGE_LIST; #endif -struct PrdfSignatureList { +struct SignatureList { TARGETING::TargetHandle_t iv_pSignatureHandle; uint32_t iv_signature; - PrdfSignatureList() : iv_pSignatureHandle(NULL), iv_signature(0) {} - PrdfSignatureList(TARGETING::TargetHandle_t i_pTargetHandle , uint32_t i_signature) + SignatureList() : iv_pSignatureHandle(NULL), iv_signature(0) {} + SignatureList(TARGETING::TargetHandle_t i_pTargetHandle , uint32_t i_signature) : iv_pSignatureHandle(i_pTargetHandle), iv_signature(i_signature){} }; -typedef std::vector<PrdfSignatureList> PRDF_SIGNATURES; +typedef std::vector<SignatureList> PRDF_SIGNATURES; //-------------------------------------------------------------------- // Forward References @@ -245,8 +247,7 @@ public: <br><b>Notes: </b> No implementation for Apache or Northstar </ul><br> */ - void SetCallout( PRDF::PRDcallout mru, - PRDF::PRDpriority priority = PRDF::MRU_MED ); + void SetCallout( PRDcallout mru, PRDpriority priority = MRU_MED ); /** Add a change to the prd signature List @@ -797,20 +798,20 @@ public: Get a PRD timer value based on the time of this error <ul> <br><b>Paramter: </b> None - <br><b>Returns: </b> PrdTimer + <br><b>Returns: </b> Timer <br><b>Requirments: </b> None. <br><b>Promises: </b> None. <br><b>Exceptions: </b> None. </ul><br> */ - PrdTimer GetTOE(void) { return ivCurrentEventTime; } + Timer GetTOE(void) { return ivCurrentEventTime; } /** Set Time of Error @parm set PRD timer value @returns nothing */ - void SetTOE(PrdTimer& theTime) { ivCurrentEventTime = theTime; } + void SetTOE(Timer& theTime) { ivCurrentEventTime = theTime; } /** Is this an MP Fatal error @@ -933,7 +934,7 @@ private: // Data TARGETING::TargetHandle_t startingPoint; // dg12d BIT_STRING_BUFFER_CLASS rbsVpd; GardResolution::ErrorType errorType; - PrdTimer ivCurrentEventTime; + Timer ivCurrentEventTime; TARGETING::TargetHandle_t ivpDumpRequestChipHandle; ATTENTION_TYPE causeAttentionType; // MCK,REC,SPCL @@ -1035,6 +1036,8 @@ public: }; +} // end namespace PRDF + #include "iipServiceDataCollector.inl" #endif // PRDF_SDC_FLAGS_MAP_ONLY diff --git a/src/usr/diag/prdf/common/framework/service/iipServiceDataCollector.inl b/src/usr/diag/prdf/common/framework/service/iipServiceDataCollector.inl index 3ea5f4989..3d97ba692 100755 --- a/src/usr/diag/prdf/common/framework/service/iipServiceDataCollector.inl +++ b/src/usr/diag/prdf/common/framework/service/iipServiceDataCollector.inl @@ -21,6 +21,9 @@ /* */ /* IBM_PROLOG_END_TAG */ +namespace PRDF +{ + inline ServiceDataCollector::ServiceDataCollector() : #ifndef __HOSTBOOT_MODULE @@ -30,7 +33,7 @@ ServiceDataCollector::ServiceDataCollector() : captureData(), xMruList(), maskId(0), - attentionType(PRDF::INVALID_ATTENTION_TYPE), + attentionType(INVALID_ATTENTION_TYPE), flags(TRACKIT | LOGIT), hitCount(0), threshold(0), @@ -38,10 +41,10 @@ ServiceDataCollector::ServiceDataCollector() : startingPoint(NULL), errorType(GardResolution::NoGard), ivpDumpRequestChipHandle(NULL), - causeAttentionType(PRDF::INVALID_ATTENTION_TYPE), + causeAttentionType(INVALID_ATTENTION_TYPE), ivpThermalChipHandle(NULL) { - PRDF::PlatServices::getCurrentTime(ivCurrentEventTime); + PlatServices::getCurrentTime(ivCurrentEventTime); } // --------------------------------------------------------------- @@ -50,7 +53,7 @@ inline void ServiceDataCollector::SetAttentionType( ATTENTION_TYPE attention ) { attentionType = attention; - if(attention == PRDF::MACHINE_CHECK) + if(attention == MACHINE_CHECK) { flags |= SERVICE_CALL; errorType = GardResolution::Fatal; @@ -148,3 +151,5 @@ void ServiceDataCollector::ClearHcdbList(void) } #endif + +} // end namespace PRDF diff --git a/src/usr/diag/prdf/common/framework/service/iipsdbug.h b/src/usr/diag/prdf/common/framework/service/iipsdbug.h index 4d83ecaf3..11e515623 100755 --- a/src/usr/diag/prdf/common/framework/service/iipsdbug.h +++ b/src/usr/diag/prdf/common/framework/service/iipsdbug.h @@ -54,6 +54,9 @@ #include <prdfMain.H> #include <targeting/common/target.H> +namespace PRDF +{ + /*--------------------------------------------------------------------*/ /* Forward References */ /*--------------------------------------------------------------------*/ @@ -134,7 +137,7 @@ public: <br><b>Exceptions: </b> None. </ul><br> */ - uint32_t Reinitialize(const PRDF::AttnList & i_attnList); + uint32_t Reinitialize(const AttnList & i_attnList); /** Indicates if an attention is active for a particular chip @@ -276,7 +279,8 @@ public: <br><b>Notes: </b> Available in PRD simulator only </ul><br> */ - void SetAttentionType(TARGETING::TargetHandle_t i_pTargetHandle ,PRDF::ATTENTION_VALUE_TYPE i_eAttentionType); + void SetAttentionType( TARGETING::TargetHandle_t i_pTargetHandle, + ATTENTION_VALUE_TYPE i_eAttentionType ); // SetGlobalAttentionType(uint8_t ga); // FIXME : remove this function when merge, no longer used @@ -288,11 +292,8 @@ private: SRCFILL_GROUP = 7 }; }; + +} // end namespace PRDF + #endif //IIPSDBUG_H -// Change Log ************************************************************************************* -// -// Flag Reason Vers Date Coder Description -// ---- ------- ----- -------- -------- ---------------------------------------------------------- -// jl02 605874 fips330 07/31/07 lukas Add functions to PRD framework/Galaxy 2 code for unit CS -// End Change Log ********************************************************************************* diff --git a/src/usr/diag/prdf/common/framework/service/iipstep.h b/src/usr/diag/prdf/common/framework/service/iipstep.h index 3a0ff6d60..7e296e9b1 100755 --- a/src/usr/diag/prdf/common/framework/service/iipstep.h +++ b/src/usr/diag/prdf/common/framework/service/iipstep.h @@ -57,6 +57,10 @@ /*--------------------------------------------------------------------*/ //class ERROR_OBJECT_CLASS; + +namespace PRDF +{ + class ServiceDataCollector; /*--------------------------------------------------------------------*/ @@ -108,7 +112,6 @@ struct STEP_CODE_DATA_STRUCT }; - - +} // end namespace PRDF #endif diff --git a/src/usr/diag/prdf/common/framework/service/prdfPfa5Data.h b/src/usr/diag/prdf/common/framework/service/prdfPfa5Data.h index ebeb22254..9184ae80c 100755 --- a/src/usr/diag/prdf/common/framework/service/prdfPfa5Data.h +++ b/src/usr/diag/prdf/common/framework/service/prdfPfa5Data.h @@ -31,10 +31,13 @@ #include <prdf_types.h> #include <utilstream.H> +namespace PRDF +{ + const uint32_t PFA5_Format = 0x50464135; -const uint32_t prdfMruListLIMIT = 8; -const uint32_t prdfHcdbListLIMIT = 8; -const uint32_t prdfSignatureListLIMIT = 8; +const uint32_t MruListLIMIT = 8; +const uint32_t HcdbListLIMIT = 8; +const uint32_t SignatureListLIMIT = 8; // Size of PRD Capture Data #ifdef __HOSTBOOT_MODULE @@ -44,36 +47,36 @@ const uint32_t CaptureDataSize = 2048; const uint32_t CaptureDataSize = 4096*2; #endif -enum prdfErrlVersion +enum ErrlVersion { - prdfErrlVer1 = 1, - prdfErrlVer2 = 2, + ErrlVer1 = 1, + ErrlVer2 = 2, }; -enum prdfErrlSubsect +enum ErrlSubsect { - prdfErrlSectPFA5_1 = 51, - prdfErrlSectPFA5_2 = 52, - prdfErrlCapData_1 = 1, - prdfErrlCapData_2 = 2, - prdfErrlAVPData_1 = 41, - prdfErrlAVPData_2 = 42, - prdfErrlString = 10, + ErrlSectPFA5_1 = 51, + ErrlSectPFA5_2 = 52, + ErrlCapData_1 = 1, + ErrlCapData_2 = 2, + ErrlAVPData_1 = 41, + ErrlAVPData_2 = 42, + ErrlString = 10, }; -struct prdfMsDumpStruct +struct MsDumpStruct { int32_t DumpContent; - PRDF::HUID DumpId; + HUID DumpId; - friend UtilStream& operator<<(UtilStream& i_left, prdfMsDumpStruct& i_right) + friend UtilStream& operator<<(UtilStream& i_left, MsDumpStruct& i_right) { i_left << i_right.DumpContent << i_right.DumpId; return i_left; }; - friend UtilStream& operator>>(UtilStream& i_left, prdfMsDumpStruct& i_right) + friend UtilStream& operator>>(UtilStream& i_left, MsDumpStruct& i_right) { i_left >> i_right.DumpContent >>i_right.DumpId; @@ -81,7 +84,7 @@ struct prdfMsDumpStruct }; }; -struct prdfPfaCalloutListStruct +struct PfaCalloutListStruct { uint32_t Callout; uint8_t MRUtype; // See enum PRDcallout::MruType @@ -96,7 +99,7 @@ struct prdfPfaCalloutListStruct uint8_t Reserved_4; friend UtilStream& operator<<(UtilStream& i_left, - prdfPfaCalloutListStruct& i_right) + PfaCalloutListStruct& i_right) { i_left << i_right.Callout << i_right.MRUtype << i_right.MRUpriority << i_right.Reserved_3 << i_right.Reserved_4; @@ -105,7 +108,7 @@ struct prdfPfaCalloutListStruct }; friend UtilStream& operator>>(UtilStream& i_left, - prdfPfaCalloutListStruct& i_right) + PfaCalloutListStruct& i_right) { i_left >> i_right.Callout >> i_right.MRUtype >> i_right.MRUpriority >> i_right.Reserved_3 >> i_right.Reserved_4; @@ -117,16 +120,16 @@ struct prdfPfaCalloutListStruct //NOTE: The addition of the hcdb data requires additonal PFA data and // error log parsing. This is triggered / indicated by a new // PFA data bit,HCDB_SUPPORT. Support is for fips720 and beyond. -struct prdfPfaHcdbListStruct +struct PfaHcdbListStruct { - PRDF::HUID hcdbId ; + HUID hcdbId ; uint32_t compSubType; uint32_t compType; uint32_t hcdbReserved1; uint32_t hcdbReserved2; friend UtilStream& operator<<(UtilStream& i_left, - prdfPfaHcdbListStruct& i_right) + PfaHcdbListStruct& i_right) { i_left << i_right.hcdbId << i_right.compSubType << i_right.compType << i_right.hcdbReserved1 << i_right.hcdbReserved2; @@ -134,7 +137,7 @@ struct prdfPfaHcdbListStruct }; friend UtilStream& operator>>(UtilStream& i_left, - prdfPfaHcdbListStruct& i_right) + PfaHcdbListStruct& i_right) { i_left >> i_right.hcdbId >> i_right.compSubType >> i_right.compType >> i_right.hcdbReserved1 >> i_right.hcdbReserved2; @@ -142,20 +145,20 @@ struct prdfPfaHcdbListStruct }; }; -struct prdfPfaSignatureListStruct +struct PfaSignatureListStruct { - PRDF::HUID chipId ; + HUID chipId ; uint32_t signature; friend UtilStream& operator<<(UtilStream& i_left, - prdfPfaSignatureListStruct& i_right) + PfaSignatureListStruct& i_right) { i_left << i_right.chipId << i_right.signature; return i_left; }; friend UtilStream& operator>>(UtilStream& i_left, - prdfPfaSignatureListStruct& i_right) + PfaSignatureListStruct& i_right) { i_left >> i_right.chipId >> i_right.signature; return i_left; @@ -166,11 +169,11 @@ struct prdfPfaSignatureListStruct * NOTE: the MsDumpLabel and its information must be first in this * structure. Attn handling is dependent on this ordering. **********************************************************************/ -struct prdfPfaData +struct PfaData { //0x0000 uint32_t MsDumpLabel[2]; - prdfMsDumpStruct MsDumpInfo; + MsDumpStruct MsDumpInfo; uint32_t PFA_errlActions :16,// Error Log Actions Parm // ERRL_ACTION_NONE = 0x0000 @@ -268,13 +271,13 @@ struct prdfPfaData reasonCode :16; //MP06 a uint32_t PfaCalloutCount; // The number of MRUs below. - prdfPfaCalloutListStruct PfaCalloutList[prdfMruListLIMIT]; //full list of MRUs and flags. + PfaCalloutListStruct PfaCalloutList[MruListLIMIT]; //full list of MRUs and flags. uint32_t hcdbListCount; //mp15 a - prdfPfaHcdbListStruct PfaHcdbList[prdfHcdbListLIMIT]; //mp15 a + PfaHcdbListStruct PfaHcdbList[HcdbListLIMIT]; uint32_t signatureCount; - prdfPfaSignatureListStruct PfaSignatureList[prdfSignatureListLIMIT]; + PfaSignatureListStruct PfaSignatureList[SignatureListLIMIT]; //pw01 - friend UtilStream& operator<<(UtilStream& i_left, prdfPfaData& i_right) + friend UtilStream& operator<<(UtilStream& i_left, PfaData& i_right) { i_left << i_right.MsDumpLabel[0] << i_right.MsDumpLabel[1] << i_right.MsDumpInfo @@ -350,7 +353,7 @@ struct prdfPfaData return i_left; }; - friend UtilStream& operator>>(UtilStream& i_left, prdfPfaData& i_right) + friend UtilStream& operator>>(UtilStream& i_left, PfaData& i_right) { uint32_t l_tmp[6]; i_left >> i_right.MsDumpLabel[0] >> i_right.MsDumpLabel[1] @@ -422,7 +425,7 @@ struct prdfPfaData //--pw01 }; -struct prdfCaptureData +struct CaptureDataClass { uint32_t CaptureData_Label; // Label to show start of Capture data. uint32_t PfaCaptureDataSize; @@ -430,4 +433,6 @@ struct prdfCaptureData uint32_t EndLabel[2];// Label to show End of Capture Data }; -#endif //end prdfPfa5Data.h +} // end namespace PRDF + +#endif // prdfPfa5Data_h diff --git a/src/usr/diag/prdf/common/framework/service/prdfPlatServices.C b/src/usr/diag/prdf/common/framework/service/prdfPlatServices.C index 9c6173c51..11785dbfe 100755 --- a/src/usr/diag/prdf/common/framework/service/prdfPlatServices.C +++ b/src/usr/diag/prdf/common/framework/service/prdfPlatServices.C @@ -170,7 +170,7 @@ void getECIDString(TARGETING::TargetHandle_t i_pGivenTarget, const char *o_ecidS //------------------------------------------------------------------------------ -void getCurrentTime( PrdTimer & o_timer ) +void getCurrentTime( Timer & o_timer ) { #ifdef __HOSTBOOT_MODULE @@ -190,7 +190,7 @@ void getCurrentTime( PrdTimer & o_timer ) struct tm * l_curEventTime = localtime(&thetime); // record the detailed time struct - PrdTimer::prdftm_t l_tm(l_curEventTime->tm_sec, + Timer::prdftm_t l_tm(l_curEventTime->tm_sec, l_curEventTime->tm_min, l_curEventTime->tm_hour, l_curEventTime->tm_wday, diff --git a/src/usr/diag/prdf/common/framework/service/prdfPlatServices.H b/src/usr/diag/prdf/common/framework/service/prdfPlatServices.H index 50f21c9aa..d63700ab2 100755 --- a/src/usr/diag/prdf/common/framework/service/prdfPlatServices.H +++ b/src/usr/diag/prdf/common/framework/service/prdfPlatServices.H @@ -99,9 +99,9 @@ void getECIDString( TARGETING::TargetHandle_t i_pGivenHandle, const char *o_ecid /** * @brief Get a PRD timer value based on the current time. - * @param o_timer The returned PrdTimer + * @param o_timer The returned Timer */ -void getCurrentTime( PrdTimer & o_timer ); +void getCurrentTime( Timer & o_timer ); /** * @brief synch the file with rmgr diff --git a/src/usr/diag/prdf/common/framework/service/prdfServiceDataCollector.C b/src/usr/diag/prdf/common/framework/service/prdfServiceDataCollector.C index 6aa984cf6..ad7e542d6 100755 --- a/src/usr/diag/prdf/common/framework/service/prdfServiceDataCollector.C +++ b/src/usr/diag/prdf/common/framework/service/prdfServiceDataCollector.C @@ -57,6 +57,9 @@ using namespace PRDF; //------------------------------------------------------------------------------ #ifndef __HOSTBOOT_MODULE +namespace PRDF +{ + inline void buffer_append(uint8_t *&ptr, uint32_t value) { uint32_t l_tmp32 = htonl(value); @@ -184,7 +187,7 @@ void ServiceDataCollector::AddSignatureList(TARGETING::TargetHandle_t i_pTargetH } if(found == false) { - iv_SignatureList.push_back(PrdfSignatureList(i_pTargetHandle, i_signature)); + iv_SignatureList.push_back(SignatureList(i_pTargetHandle, i_signature)); } } @@ -196,13 +199,13 @@ uint32_t ServiceDataCollector::Flatten(uint8_t * i_buffer, uint32_t & io_size) c { uint32_t max_size = io_size; uint32_t rc = SUCCESS; - //getting the actual size of prdfHcdbChangeItem and PrdfSignatureList that gets saved in memory. since + //getting the actual size of prdfHcdbChangeItem and SignatureList that gets saved in memory. since //instead of handle we save the entity path - uint32_t l_sizeHcdbChange = iv_HcdbChangeList.size() * sizeof(PrdfHcdbChangeItem); - uint32_t l_sizeSignList = iv_SignatureList.size() * sizeof(PrdfSignatureList); + uint32_t l_sizeHcdbChange = iv_HcdbChangeList.size() * sizeof(HcdbChangeItem); + uint32_t l_sizeSignList = iv_SignatureList.size() * sizeof(SignatureList); uint32_t l_sizeMruList = xMruList.size() * sizeof(SdcCallout); // approximate space needed for essentials. This estimate is slightly higher than actual - const uint32_t MIN_FLAT_SIZE = sizeof(ServiceDataCollector) + sizeof(struct PrdTimer::prdftm_t) + const uint32_t MIN_FLAT_SIZE = sizeof(ServiceDataCollector) + sizeof(struct Timer::prdftm_t) + l_sizeMruList + l_sizeHcdbChange + l_sizeSignList; uint8_t * current_ptr = i_buffer; @@ -248,8 +251,8 @@ uint32_t ServiceDataCollector::Flatten(uint8_t * i_buffer, uint32_t & io_size) c //@ecdf - Removed ivDumpRequestType. buffer_append(current_ptr,ivDumpRequestContent); buffer_append(current_ptr,ivpDumpRequestChipHandle); - PrdTimer::prdftm_t l_tm = ivCurrentEventTime.gettm(); - const uint32_t PRDFTM_SIZE = sizeof(struct PrdTimer::prdftm_t); + Timer::prdftm_t l_tm = ivCurrentEventTime.gettm(); + const uint32_t PRDFTM_SIZE = sizeof(struct Timer::prdftm_t); memcpy(current_ptr,&l_tm,PRDFTM_SIZE); current_ptr += PRDFTM_SIZE; buffer_append(current_ptr,(uint32_t)causeAttentionType); @@ -303,7 +306,7 @@ ServiceDataCollector & ServiceDataCollector::operator=( comp_id_t l_compType = (comp_id_t)buffer_get32(i_flatdata); if(NULL !=l_pChipHandle) { - PrdfHcdbChangeItem l_item(l_pChipHandle, l_compSubType, l_compType); + HcdbChangeItem l_item(l_pChipHandle, l_compSubType, l_compType); iv_HcdbChangeList.push_back(l_item); } @@ -316,7 +319,7 @@ ServiceDataCollector & ServiceDataCollector::operator=( uint32_t l_signature = (uint32_t) buffer_get32(i_flatdata); if(NULL !=l_pChipHandle) { - PrdfSignatureList l_item(l_pChipHandle, l_signature); + SignatureList l_item(l_pChipHandle, l_signature); iv_SignatureList.push_back(l_item); } } @@ -332,8 +335,8 @@ ServiceDataCollector & ServiceDataCollector::operator=( ivDumpRequestContent = (hwTableContent) buffer_get32(i_flatdata); //@ecdf ivpDumpRequestChipHandle = buffer_getTarget(i_flatdata); - PrdTimer::prdftm_t l_tm; - const uint32_t PRDFTM_SIZE = sizeof(struct PrdTimer::prdftm_t); + Timer::prdftm_t l_tm; + const uint32_t PRDFTM_SIZE = sizeof(struct Timer::prdftm_t); memcpy(&l_tm,i_flatdata,PRDFTM_SIZE); i_flatdata += PRDFTM_SIZE; ivCurrentEventTime.settm(l_tm); @@ -377,9 +380,12 @@ void ServiceDataCollector::AddChangeForHcdb(TARGETING::TargetHandle_t i_pTargetH } if(found == false) { - iv_HcdbChangeList.push_back( PrdfHcdbChangeItem(i_pTargetHandle, i_testType, i_compType)); + iv_HcdbChangeList.push_back( HcdbChangeItem(i_pTargetHandle, i_testType, + i_compType) ); } } +} // end namespace PRDF + #endif diff --git a/src/usr/diag/prdf/common/framework/service/prdfTargetServices.H b/src/usr/diag/prdf/common/framework/service/prdfTargetServices.H index 5513e69cc..3a30b7802 100755 --- a/src/usr/diag/prdf/common/framework/service/prdfTargetServices.H +++ b/src/usr/diag/prdf/common/framework/service/prdfTargetServices.H @@ -232,7 +232,7 @@ bool checkLastFuncCore( TARGETING::TargetHandle_t i_coreTarget ); * @brief Returns the position of the given target. * @param i_target Any target. * @return The position or index of the given target relative to its container. - * Can compare against enums in PRDF::PositionBounds for validity. + * Can compare against enums in PositionBounds for validity. */ uint32_t getTargetPosition( TARGETING::TargetHandle_t i_target ); diff --git a/src/usr/diag/prdf/common/framework/service/prdfWorkarounds.H b/src/usr/diag/prdf/common/framework/service/prdfWorkarounds.H index bcea1a744..bb4012cae 100755 --- a/src/usr/diag/prdf/common/framework/service/prdfWorkarounds.H +++ b/src/usr/diag/prdf/common/framework/service/prdfWorkarounds.H @@ -35,10 +35,15 @@ #include <iipstep.h> +namespace PRDF +{ + /** - * @fn prdfPostAnalysisWorkarounds + * @fn PostAnalysisWorkarounds * @brief Apply workarounds after "system" analysis, but prior to RAS Services. */ -void prdfPostAnalysisWorkarounds(STEP_CODE_DATA_STRUCT & i_sdc); +void PostAnalysisWorkarounds(STEP_CODE_DATA_STRUCT & i_sdc); + +} // end namespace PRDF #endif diff --git a/src/usr/diag/prdf/common/framework/service/prdf_ras_services.C b/src/usr/diag/prdf/common/framework/service/prdf_ras_services.C index 7831575e1..7d9707fa2 100755 --- a/src/usr/diag/prdf/common/framework/service/prdf_ras_services.C +++ b/src/usr/diag/prdf/common/framework/service/prdf_ras_services.C @@ -94,10 +94,10 @@ char * ThermalFilename = NULL; #endif -prdfPfaData PfaData; +PfaData pfaData; bool ErrDataService::terminateOnCheckstop = true; bool previousWasRecovered = false; -PrdTimer previousEventTime; +Timer previousEventTime; const double LATENT_MCK_WINDOW = 2; // two seconds to determin latency RasServices thisServiceGenerator; @@ -168,7 +168,7 @@ void ErrDataService::SetErrorTod(ATTENTION_TYPE the_attention, *is_latent = false; latentMachineCheck = false; - PrdTimer l_curEventTime; + Timer l_curEventTime; PlatServices::getCurrentTime(l_curEventTime); if(previousWasRecovered && (MACHINE_CHECK == the_attention)) @@ -602,7 +602,7 @@ errlHndl_t ErrDataService::GenerateSrcPfa(ATTENTION_TYPE attn_type, PrdfMemoryMru memMru = thiscallout.getMemMru(); SrcWord9 = memMru.toUint32(); // Get MemMru value -/* FIXME: Add support after refactoring PrdfMemoryMru +/* FIXME: RTC 47288 Add support after refactoring PrdfMemoryMru TargetHandleList partList = memMru.getCalloutList(); uint32_t partCount = partList.size(); @@ -670,25 +670,27 @@ errlHndl_t ErrDataService::GenerateSrcPfa(ATTENTION_TYPE attn_type, //Set the PRD Reason Code based on the flags set in the above callout loop. //////////////////////////////////////////////////////////////// uint16_t SDC_Reason_Code = sdc.GetReasonCode(); - if (SDC_Reason_Code == 0) //If the analysis code has not set its own Reason Code. + if (SDC_Reason_Code == 0) // If the analysis code has not set its own + // Reason Code. { if (HW == true && SW == true) { - if (SW_High == true) - PRD_Reason_Code = PRDF_DETECTED_FAIL_SOFTWARE_PROBABLE; - else - PRD_Reason_Code = PRDF_DETECTED_FAIL_HARDWARE_PROBABLE; + if (SW_High == true) + PRD_Reason_Code = PRDF_DETECTED_FAIL_SOFTWARE_PROBABLE; + else + PRD_Reason_Code = PRDF_DETECTED_FAIL_HARDWARE_PROBABLE; } else if (HW == true && SW == false && SecondLevel == true) - PRD_Reason_Code = PRDF_DETECTED_FAIL_HARDWARE_PROBABLE; + PRD_Reason_Code = PRDF_DETECTED_FAIL_HARDWARE_PROBABLE; else if (HW == true && SW == false && SecondLevel == false) - PRD_Reason_Code = PRDF_DETECTED_FAIL_HARDWARE; + PRD_Reason_Code = PRDF_DETECTED_FAIL_HARDWARE; else if (HW == false && SW == true) - PRD_Reason_Code = PRDF_DETECTED_FAIL_SOFTWARE; + PRD_Reason_Code = PRDF_DETECTED_FAIL_SOFTWARE; else { - //If we get here both HW and SW flags were false. Callout may be Second Level - //Support only, or a procedure not checked in the SW flag code. + // If we get here both HW and SW flags were false. Callout may be + // Second Level Support only, or a procedure not checked in the SW + // flag code. PRD_Reason_Code = PRDF_DETECTED_FAIL_HARDWARE_PROBABLE; } } @@ -748,7 +750,7 @@ errlHndl_t ErrDataService::GenerateSrcPfa(ATTENTION_TYPE attn_type, //************************************************************** // Add SDC Capture data to Error Log User Data here only if // there are 4 or more callouts, - // (including Dimm callouts in the MemoryMru). + // (including Dimm callouts in the PrdfMemoryMru). //************************************************************** bool capDataAdded = false; if (calloutsPlusDimms > 3) @@ -810,7 +812,7 @@ errlHndl_t ErrDataService::GenerateSrcPfa(ATTENTION_TYPE attn_type, } else if ( PRDcallout::TYPE_MEMMRU == thiscallout.getType() ) { - // FIXME: PrdfMemoryMru will need refactor later + // FIXME: RTC 47288 PrdfMemoryMru will need refactor later PrdfMemoryMru memMru = thiscallout.getMemMru(); PRDF_HW_ADD_MEMMRU_CALLOUT(ForceTerminate, @@ -895,8 +897,8 @@ errlHndl_t ErrDataService::GenerateSrcPfa(ATTENTION_TYPE attn_type, // Build Dump Flags and PFA5 data //************************************************************** //MP01 a Start - PfaData.MsDumpLabel[0] = 0x4D532020; //start of MS Dump flags - PfaData.MsDumpLabel[1] = 0x44554D50; // 'MS DUMP' + pfaData.MsDumpLabel[0] = 0x4D532020; //start of MS Dump flags + pfaData.MsDumpLabel[1] = 0x44554D50; // 'MS DUMP' TargetHandle_t l_dumpHandle = NULL; #ifdef __HOSTBOOT_MODULE @@ -906,70 +908,70 @@ errlHndl_t ErrDataService::GenerateSrcPfa(ATTENTION_TYPE attn_type, sdc.GetDumpRequest( l_dumpRequestContent, l_dumpHandle ); #endif - PfaData.MsDumpInfo.DumpId = PlatServices::getHuid(l_dumpHandle); + pfaData.MsDumpInfo.DumpId = PlatServices::getHuid(l_dumpHandle); TYPE l_targetType = PlatServices::getTargetType(l_dumpHandle); if (i_sdc.IsMpDumpReq()) { - PfaData.MP_DUMP_REQ = 1; + pfaData.MP_DUMP_REQ = 1; } else { - PfaData.MP_DUMP_REQ = 0; + pfaData.MP_DUMP_REQ = 0; } if (i_sdc.IsMpResetReq()) { - PfaData.MP_RESET_REQ = 1; + pfaData.MP_RESET_REQ = 1; } else { - PfaData.MP_RESET_REQ = 0; + pfaData.MP_RESET_REQ = 0; } //Pass Error Log Action Flag to attn handling, so it know what actions to commit - PfaData.MP_FATAL = (i_sdc.IsMpFatal()==true)? 1:0; - - PfaData.PFA_errlActions = actionFlag; - PfaData.PFA_errlSeverity = severityParm; - - PfaData.REBOOT_MSG = 0; // Not supported?? - PfaData.DUMP = (sdc.IsDump()==true)? 1:0; - PfaData.UERE = (sdc.IsUERE()==true)? 1:0; - PfaData.SUE = (sdc.IsSUE()==true)? 1:0; - PfaData.CRUMB = (sdc.MaybeCrumb()==true)? 1:0; - PfaData.AT_THRESHOLD = (sdc.IsAtThreshold()==true)? 1:0; - PfaData.DEGRADED = (sdc.IsDegraded()==true)? 1:0; - PfaData.SERVICE_CALL = (sdc.IsServiceCall()==true)? 1:0; - PfaData.TRACKIT = (sdc.IsMfgTracking()==true)? 1:0; - PfaData.TERMINATE = (sdc.Terminate()==true)? 1:0; - PfaData.LOGIT = (sdc.IsLogging()==true)? 1:0; - PfaData.MEMORY_STEERED = (sdc.IsMemorySteered()==true)? 1:0; - PfaData.FLOODING = (sdc.IsFlooding()==true)? 1:0; - - PfaData.ErrorCount = sdc.GetHits(); - PfaData.PRDServiceActionCounter = serviceActionCounter; - PfaData.Threshold = sdc.GetThreshold(); - PfaData.ErrorType = prdGardErrType; - PfaData.homGardState = gardState; - PfaData.PRD_AttnTypes = attn_type; - PfaData.PRD_SecondAttnTypes = i_sdc.GetCauseAttentionType(); - PfaData.THERMAL_EVENT = (sdc.IsThermalEvent()==true)? 1:0; - PfaData.UNIT_CHECKSTOP = (sdc.IsUnitCS()==true)? 1:0; - PfaData.USING_SAVED_SDC = (sdc.IsUsingSavedSdc()==true)? 1:0; - PfaData.FORCE_LATENT_CS = (i_sdc.IsForceLatentCS()==true)? 1:0; - PfaData.DEFER_DECONFIG_MASTER = (iplDiagMode==true)? 1:0; - PfaData.DEFER_DECONFIG = (deferDeconfig==true)? 1:0; - PfaData.CM_MODE = 0; //FIXME Need to change this initialization - PfaData.TERMINATE_ON_CS = (terminateOnCheckstop==true)? 1:0; - PfaData.reasonCode = sdc.GetReasonCode(); - PfaData.PfaCalloutCount = calloutcount; + pfaData.MP_FATAL = (i_sdc.IsMpFatal()==true)? 1:0; + + pfaData.PFA_errlActions = actionFlag; + pfaData.PFA_errlSeverity = severityParm; + + pfaData.REBOOT_MSG = 0; // Not supported?? + pfaData.DUMP = (sdc.IsDump()==true)? 1:0; + pfaData.UERE = (sdc.IsUERE()==true)? 1:0; + pfaData.SUE = (sdc.IsSUE()==true)? 1:0; + pfaData.CRUMB = (sdc.MaybeCrumb()==true)? 1:0; + pfaData.AT_THRESHOLD = (sdc.IsAtThreshold()==true)? 1:0; + pfaData.DEGRADED = (sdc.IsDegraded()==true)? 1:0; + pfaData.SERVICE_CALL = (sdc.IsServiceCall()==true)? 1:0; + pfaData.TRACKIT = (sdc.IsMfgTracking()==true)? 1:0; + pfaData.TERMINATE = (sdc.Terminate()==true)? 1:0; + pfaData.LOGIT = (sdc.IsLogging()==true)? 1:0; + pfaData.MEMORY_STEERED = (sdc.IsMemorySteered()==true)? 1:0; + pfaData.FLOODING = (sdc.IsFlooding()==true)? 1:0; + + pfaData.ErrorCount = sdc.GetHits(); + pfaData.PRDServiceActionCounter = serviceActionCounter; + pfaData.Threshold = sdc.GetThreshold(); + pfaData.ErrorType = prdGardErrType; + pfaData.homGardState = gardState; + pfaData.PRD_AttnTypes = attn_type; + pfaData.PRD_SecondAttnTypes = i_sdc.GetCauseAttentionType(); + pfaData.THERMAL_EVENT = (sdc.IsThermalEvent()==true)? 1:0; + pfaData.UNIT_CHECKSTOP = (sdc.IsUnitCS()==true)? 1:0; + pfaData.USING_SAVED_SDC = (sdc.IsUsingSavedSdc()==true)? 1:0; + pfaData.FORCE_LATENT_CS = (i_sdc.IsForceLatentCS()==true)? 1:0; + pfaData.DEFER_DECONFIG_MASTER = (iplDiagMode==true)? 1:0; + pfaData.DEFER_DECONFIG = (deferDeconfig==true)? 1:0; + pfaData.CM_MODE = 0; //FIXME Need to change this initialization + pfaData.TERMINATE_ON_CS = (terminateOnCheckstop==true)? 1:0; + pfaData.reasonCode = sdc.GetReasonCode(); + pfaData.PfaCalloutCount = calloutcount; // First clear out the PFA Callout list from previous SRC - for (uint32_t j = 0; j < prdfMruListLIMIT; ++j) + for (uint32_t j = 0; j < MruListLIMIT; ++j) { - PfaData.PfaCalloutList[j].Callout = 0; - PfaData.PfaCalloutList[j].MRUtype = 0; - PfaData.PfaCalloutList[j].MRUpriority = 0; + pfaData.PfaCalloutList[j].Callout = 0; + pfaData.PfaCalloutList[j].MRUtype = 0; + pfaData.PfaCalloutList[j].MRUpriority = 0; } // Build the mru list into PFA data Callout list @@ -978,11 +980,11 @@ errlHndl_t ErrDataService::GenerateSrcPfa(ATTENTION_TYPE attn_type, for ( SDC_MRU_LIST::iterator i = fspmrulist.begin(); i < fspmrulist.end(); ++i ) { - if ( n < prdfMruListLIMIT ) + if ( n < MruListLIMIT ) { - PfaData.PfaCalloutList[n].MRUpriority = (uint8_t)(*i).priority; - PfaData.PfaCalloutList[n].Callout = i->callout.flatten(); - PfaData.PfaCalloutList[n].MRUtype = i->callout.getType(); + pfaData.PfaCalloutList[n].MRUpriority = (uint8_t)(*i).priority; + pfaData.PfaCalloutList[n].Callout = i->callout.flatten(); + pfaData.PfaCalloutList[n].MRUtype = i->callout.getType(); ++n; } @@ -991,83 +993,83 @@ errlHndl_t ErrDataService::GenerateSrcPfa(ATTENTION_TYPE attn_type, #ifndef __HOSTBOOT_MODULE // FIXME: need to investigate whether or not we need to add HCDB support in Hostboot // First clear out the HCDB from previous SRC - for (uint32_t j = 0; j < prdfHcdbListLIMIT; ++j) + for (uint32_t j = 0; j < HcdbListLIMIT; ++j) { - PfaData.PfaHcdbList[j].hcdbId = 0;//Resetting entity path - PfaData.PfaHcdbList[j].compSubType = 0; - PfaData.PfaHcdbList[j].compType = 0; - PfaData.PfaHcdbList[j].hcdbReserved1 = 0; - PfaData.PfaHcdbList[j].hcdbReserved2 = 0; + pfaData.PfaHcdbList[j].hcdbId = 0;//Resetting entity path + pfaData.PfaHcdbList[j].compSubType = 0; + pfaData.PfaHcdbList[j].compType = 0; + pfaData.PfaHcdbList[j].hcdbReserved1 = 0; + pfaData.PfaHcdbList[j].hcdbReserved2 = 0; } // Build the HCDB list into PFA data n = 0; hcdbList = sdc.GetHcdbList(); - PfaData.hcdbListCount = hcdbList.size(); + pfaData.hcdbListCount = hcdbList.size(); for (HCDB_CHANGE_LIST::iterator i = hcdbList.begin(); i < hcdbList.end(); ++i) { - if (n < prdfHcdbListLIMIT) + if (n < HcdbListLIMIT) { - PfaData.PfaHcdbList[n].hcdbId = PlatServices::getHuid((*i).iv_phcdbtargetHandle); - PfaData.PfaHcdbList[n].compSubType = (*i).iv_compSubType; - PfaData.PfaHcdbList[n].compType = (*i).iv_compType; + pfaData.PfaHcdbList[n].hcdbId = PlatServices::getHuid((*i).iv_phcdbtargetHandle); + pfaData.PfaHcdbList[n].compSubType = (*i).iv_compSubType; + pfaData.PfaHcdbList[n].compType = (*i).iv_compType; ++n; } else break; } // Set flag so we know to parse the hcdb data - PfaData.HCDB_SUPPORT = 1; + pfaData.HCDB_SUPPORT = 1; #endif // if not __HOSTBOOT_MODULE PRDF_SIGNATURES signatureList = sdc.GetSignatureList(); // First clear out the HCDB from previous SRC - for (uint32_t j = 0; j < prdfSignatureListLIMIT; ++j) + for (uint32_t j = 0; j < SignatureListLIMIT; ++j) { - PfaData.PfaSignatureList[j].chipId = 0;//Resetting the chipPath - PfaData.PfaSignatureList[j].signature = 0; + pfaData.PfaSignatureList[j].chipId = 0;//Resetting the chipPath + pfaData.PfaSignatureList[j].signature = 0; } // Build the signature list into PFA data n = 0; signatureList = sdc.GetSignatureList(); - PfaData.signatureCount = signatureList.size(); + pfaData.signatureCount = signatureList.size(); for (PRDF_SIGNATURES::iterator i = signatureList.begin(); i < signatureList.end(); ++i) { - if (n < prdfSignatureListLIMIT) + if (n < SignatureListLIMIT) { - PfaData.PfaSignatureList[n].chipId = PlatServices::getHuid((*i).iv_pSignatureHandle); - PfaData.PfaSignatureList[n].signature = (*i).iv_signature; + pfaData.PfaSignatureList[n].chipId = PlatServices::getHuid((*i).iv_pSignatureHandle); + pfaData.PfaSignatureList[n].signature = (*i).iv_signature; ++n; } else break; } // Set flag so we know to parse the hcdb data - PfaData.SIGNATURE_SUPPORT = 1; + pfaData.SIGNATURE_SUPPORT = 1; //************************************************************** // Check for Unit CheckStop. // Check for Last Functional Core. // PFA data updates for these item. //************************************************************** - PfaData.LAST_CORE_TERMINATE = false; + pfaData.LAST_CORE_TERMINATE = false; // Now the check is for Unit Check Stop and Dump ID for Processor // Skip the termination on Last Core if this is a Saved SDC if (sdc.IsUnitCS() && (!sdc.IsUsingSavedSdc() ) ) { PRDF_TRAC( PRDF_FUNC"Unit CS, Func HUID: %x, TargetType: %x", - PfaData.MsDumpInfo.DumpId, l_targetType ); - if (TYPE_CORE ==l_targetType) + pfaData.MsDumpInfo.DumpId, l_targetType ); + if (TYPE_CORE == l_targetType) { //Check if this is last functional core if ( PlatServices::checkLastFuncCore(l_dumpHandle) ) { PRDF_TRAC( PRDF_FUNC"Last Func Core from Gard was true." ); ForceTerminate = true; - PfaData.LAST_CORE_TERMINATE = true; + pfaData.LAST_CORE_TERMINATE = true; errLog->setSev(ERRL_SEV_UNRECOVERABLE); //Update Errl Severity - PfaData.PFA_errlSeverity = ERRL_SEV_UNRECOVERABLE; //Update PFA data + pfaData.PFA_errlSeverity = ERRL_SEV_UNRECOVERABLE; //Update PFA data } } } @@ -1119,7 +1121,7 @@ errlHndl_t ErrDataService::GenerateSrcPfa(ATTENTION_TYPE attn_type, { //For Manufacturing Mode terminate, change the action flags for Thermal Event. actionFlag = (ERRL_ACTION_SA | ERRL_ACTION_REPORT | ERRL_ACTION_CALL_HOME); } - PfaData.PFA_errlActions = actionFlag; + pfaData.PFA_errlActions = actionFlag; } @@ -1130,9 +1132,9 @@ errlHndl_t ErrDataService::GenerateSrcPfa(ATTENTION_TYPE attn_type, // Add the PFA data to Error Log User Data //************************************************************** UtilMem l_membuf; - l_membuf << PfaData; + l_membuf << pfaData; PRDF_ADD_FFDC( errLog, (const char*)l_membuf.base(), l_membuf.size(), - prdfErrlVer1, prdfErrlSectPFA5_1 ); + ErrlVer1, ErrlSectPFA5_1 ); //************************************************************** // Check for Manufacturing AVP mode @@ -1160,7 +1162,7 @@ will also be removed. Need to confirm if this code is required anymore. //Add Test Case Number to Error Log User Data UtilMem l_membuf; l_membuf << avpTCNumber; - errLog->addUsrDtls(l_membuf.base(),l_membuf.size(),PRDF_COMP_ID,prdfErrlVer1,prdfErrlAVPData_1); + errLog->addUsrDtls(l_membuf.base(),l_membuf.size(),PRDF_COMP_ID,ErrlVer1,ErrlAVPData_1); } } */ @@ -1189,7 +1191,7 @@ will also be removed. Need to confirm if this code is required anymore. memcpy(&usrDtlsTCData[8], &avpTCData[37], 1); memcpy(&usrDtlsTCData[9], &avpTCData[44], 20); PRDF_ADD_FFDC( errLog, (const char*)usrDtlsTCData, sz_usrDtlsTCData, - prdfErrlVer1, prdfErrlAVPData_2 ); + ErrlVer1, ErrlAVPData_2 ); } } #endif // if not __HOSTBOOT_MODULE @@ -1254,7 +1256,7 @@ will also be removed. Need to confirm if this code is required anymore. else { PRDF_HWUDUMP(dumpErrl, errLog, CONTENT_HWNXLCL, - PfaData.MsDumpInfo.DumpId); + pfaData.MsDumpInfo.DumpId); if (dumpErrl != NULL) { PRDF_COMMIT_ERRL(dumpErrl, ERRL_ACTION_REPORT); @@ -1274,7 +1276,7 @@ will also be removed. Need to confirm if this code is required anymore. if (TYPE_CORE == l_targetType) { PRDF_HWUDUMP(dumpErrl, errLog, CONTENT_SINGLE_CORE_CHECKSTOP, - PfaData.MsDumpInfo.DumpId); + pfaData.MsDumpInfo.DumpId); } // remove dump CONTENT_HWGAL2LCL since no IOHUB dump // is supported in P8 @@ -1282,7 +1284,7 @@ will also be removed. Need to confirm if this code is required anymore. else { //This is not Proc ..ie. it is Galaxy 2 PRDF_ERR( PRDF_FUNC"Unsupported dump for DumpId: %x, TargetType: %x", - PfaData.MsDumpInfo.DumpId, l_targetType ); + pfaData.MsDumpInfo.DumpId, l_targetType ); } } if (dumpErrl != NULL) @@ -1525,16 +1527,16 @@ void RasServices::MnfgTrace(ErrorSignature * l_esig ) // Write chip ECID data char ecidString[1024]; - l_ptempHandle = PlatServices::getTarget(PfaData.PfaCalloutList[0].Callout); + l_ptempHandle = PlatServices::getTarget(pfaData.PfaCalloutList[0].Callout); //TODO TargetHandle conversion - not sure we need it now PlatServices::getECIDString(l_ptempHandle , ecidString); l_mfgFile.write(ecidString, strlen(ecidString)); // Write MRU list uint32_t n = 0; - while ( (n < prdfMruListLIMIT ) && (n < PfaData.PfaCalloutCount) ) + while ( (n < MruListLIMIT ) && (n < pfaData.PfaCalloutCount) ) { - snprintf(l_array2, 16, ", %08x", PfaData.PfaCalloutList[n].Callout); + snprintf(l_array2, 16, ", %08x", pfaData.PfaCalloutList[n].Callout); l_mfgFile.write(l_array2, 9); ++n; } @@ -1569,7 +1571,7 @@ void ErrDataService::AddCapData(ServiceDataCollector & i_sdc, errlHndl_t i_errHd // plugins. If that behavior changes, we must use htonl() // to fix the endianness on them. - prdfCaptureData * l_CapDataBuf = new prdfCaptureData; + CaptureDataClass * l_CapDataBuf = new CaptureDataClass; for(uint32_t ii = 0; ii < CaptureDataSize; ++ii) { @@ -1589,7 +1591,7 @@ void ErrDataService::AddCapData(ServiceDataCollector & i_sdc, errlHndl_t i_errHd //Compress the Capture data size_t l_compressBufSize = - PrdfCompressBuffer::compressedBufferMax(thisCapDataSize); + PrdfCompressBuffer::compressedBufferMax(thisCapDataSize); const size_t sz_compressCapBuf = l_compressBufSize + 4; uint8_t * l_compressCapBuf = new uint8_t[sz_compressCapBuf]; @@ -1601,7 +1603,7 @@ void ErrDataService::AddCapData(ServiceDataCollector & i_sdc, errlHndl_t i_errHd //Add the Compressed Capture data to Error Log User Data PRDF_ADD_FFDC( i_errHdl, (const char*)l_compressCapBuf, - sz_compressCapBuf, prdfErrlVer2, prdfErrlCapData_1 ); + sz_compressCapBuf, ErrlVer2, ErrlCapData_1 ); delete [] l_compressCapBuf; delete l_CapDataBuf; } @@ -1745,43 +1747,6 @@ bool ErrDataService::SdcRetrieve(sdcSaveFlagsEnum i_saveFlag, void * o_buffer) /*@ * @errortype - * @reasoncode PRDF_HARDWARE_FAIL - * @subsys EPUB_PROCESSOR_SUBSYS - * @subsys EPUB_PROCESSOR_FRU - * @subsys EPUB_PROCESSOR_CHIP_CACHE - * @subsys EPUB_PROCESSOR_UNIT - * @subsys EPUB_PROCESSOR_BUS_CTL - * @subsys EPUB_MEMORY_SUBSYS - * @subsys EPUB_MEMORY_CONTROLLER - * @subsys EPUB_MEMORY_DIMM - * @subsys EPUB_MEMORY_FRU - * @subsys EPUB_EXTERNAL_CACHE - * @subsys EPUB_CEC_HDW_SUBSYS - * @subsys EPUB_CEC_HDW_CLK_CTL - * @subsys EPUB_CEC_HDW_TOD_HDW - * @subsys EPUB_CEC_HDW_SP_PHYP_INTF - * @subsys EPUB_MISC_SUBSYS - * @subsys EPUB_MISC_UNKNOWN - * @subsys EPUB_MISC_INFORMATIONAL - * @subsys EPUB_FIRMWARE_SUBSYS - * @subsys EPUB_FIRMWARE_SP - * @subsys EPUB_FIRMWARE_PHYP - * @subsys EPUB_FIRMWARE_HMC - * @subsys EPUB_EXT_ENVIRO_USER - * @moduleid PRDF_MAIN - * @userdata1 PRD Chip Signature - * @userdata2 PRD Attention Type and Cause Attention Type - * @userdata3 PRD Signature - * @devdesc CEC hardware failure detected - * @procedure EPUB_PRC_SP_CODE - * @procedure EPUB_PRC_PHYP_CODE - * @procedure EPUB_PRC_LVL_SUPP - * @procedure EPUB_PRC_ALL_PROCS - * @procedure EPUB_PRC_REBOOT - */ - - /*@ - * @errortype * @reasoncode PRDF_DETECTED_FAIL_HARDWARE * @subsys EPUB_PROCESSOR_SUBSYS * @subsys EPUB_PROCESSOR_FRU diff --git a/src/usr/diag/prdf/common/framework/service/prdf_ras_services.H b/src/usr/diag/prdf/common/framework/service/prdf_ras_services.H index 50d8c8f12..fb0d071b2 100755 --- a/src/usr/diag/prdf/common/framework/service/prdf_ras_services.H +++ b/src/usr/diag/prdf/common/framework/service/prdf_ras_services.H @@ -34,7 +34,7 @@ #ifndef __HOSTBOOT_MODULE #include <tmgt.H> - #include <prdfPfa5Data.h> //for prdfPfaCalloutListStruct + #include <prdfPfa5Data.h> //for PfaCalloutListStruct #endif namespace PRDF diff --git a/src/usr/diag/prdf/common/framework/service/xspprdService.h b/src/usr/diag/prdf/common/framework/service/xspprdService.h index 4c985ca39..30ab4db9f 100755 --- a/src/usr/diag/prdf/common/framework/service/xspprdService.h +++ b/src/usr/diag/prdf/common/framework/service/xspprdService.h @@ -63,14 +63,14 @@ #include <errlentry.H> //for errlHndl_t //mp01 a -//-------------------------------------------------------------------- -// Forward References -//-------------------------------------------------------------------- -class ServiceDataCollector; namespace PRDF { +//-------------------------------------------------------------------- +// Forward References +//-------------------------------------------------------------------- +class ServiceDataCollector; class ErrDataService; diff --git a/src/usr/diag/prdf/common/framework/service/xspprdsdbug.C b/src/usr/diag/prdf/common/framework/service/xspprdsdbug.C index 8b52aecca..f51d802b1 100755 --- a/src/usr/diag/prdf/common/framework/service/xspprdsdbug.C +++ b/src/usr/diag/prdf/common/framework/service/xspprdsdbug.C @@ -56,7 +56,8 @@ #undef xspprdsdbug_C -using namespace PRDF; +namespace PRDF +{ //---------------------------------------------------------------------- // User Types @@ -90,15 +91,16 @@ SYSTEM_DEBUG_CLASS::SYSTEM_DEBUG_CLASS(void) { } -uint32_t SYSTEM_DEBUG_CLASS::Reinitialize(const PRDF::AttnList & i_attnList) +uint32_t SYSTEM_DEBUG_CLASS::Reinitialize(const AttnList & i_attnList) { uint32_t l_rc = 0; do { - if( i_attnList.empty() ) + if ( i_attnList.empty() ) { - PRDF_ERR( "SYSTEM_DEBUG_CLASS::Reinitialize() input AttnList is empty" ); + PRDF_ERR( "SYSTEM_DEBUG_CLASS::Reinitialize() input AttnList is " + "empty" ); /*@ * @errortype * @subsys EPUB_FIRMWARE_SP @@ -111,21 +113,21 @@ uint32_t SYSTEM_DEBUG_CLASS::Reinitialize(const PRDF::AttnList & i_attnList) * @devdesc input AttnList is empty. * @procedure EPUB_PRC_SP_CODE */ - PRDF_CREATE_ERRL(g_prd_errlHndl, - ERRL_SEV_DIAGNOSTIC_ERROR1, // error on diagnostic - ERRL_ETYPE_NOT_APPLICABLE, - SRCI_MACH_CHECK, - SRCI_NO_ATTR, - PRDF_SDBUG_INIT, // module id - FSP_DEFAULT_REFCODE, - PRDF_CODE_FAIL, // Reason code - 0, // user data word 1 - 0, // user data word 2 - 0, // user data word 3 - 0 // user data word 4 - ); - - PRDF_ADD_PROCEDURE_CALLOUT(g_prd_errlHndl, SRCI_PRIORITY_MED, EPUB_PRC_SP_CODE); + PRDF_CREATE_ERRL( g_prd_errlHndl, + ERRL_SEV_DIAGNOSTIC_ERROR1, // error on diagnostic + ERRL_ETYPE_NOT_APPLICABLE, + SRCI_MACH_CHECK, + SRCI_NO_ATTR, + PRDF_SDBUG_INIT, // module id + FSP_DEFAULT_REFCODE, + PRDF_CODE_FAIL, // Reason code + 0, // user data word 1 + 0, // user data word 2 + 0, // user data word 3 + 0 ); // user data word 4 + + PRDF_ADD_PROCEDURE_CALLOUT( g_prd_errlHndl, SRCI_PRIORITY_MED, + EPUB_PRC_SP_CODE ); l_rc = PRD_ATTN_DATA_ACCESS_FAILED; break; @@ -205,7 +207,7 @@ void SYSTEM_DEBUG_CLASS::CalloutThoseAtAttention(STEP_CODE_DATA_STRUCT & service { sdc->SetCallout((*i).targetHndl); AttnData ad(*i); - prdfBitString cbs(sizeof(AttnData)*8,(CPU_WORD *)&ad); + BitString cbs(sizeof(AttnData)*8,(CPU_WORD *)&ad); capture.Add(PlatServices::getSystemTarget(),0,cbs); } @@ -236,3 +238,5 @@ void SYSTEM_DEBUG_CLASS::SetAttentionType(TARGETING::TargetHandle_t i_pTargetHan } } } + +} // end namespace PRDF diff --git a/src/usr/diag/prdf/common/iipconst.h b/src/usr/diag/prdf/common/iipconst.h index 00fafb0fe..d9877b12b 100755 --- a/src/usr/diag/prdf/common/iipconst.h +++ b/src/usr/diag/prdf/common/iipconst.h @@ -52,7 +52,6 @@ namespace PRDF // FIXME - These may be replaced by something that is globally available. typedef uint32_t HUID; enum { INVALID_HUID = 0 }; -} // end namespace PRDF /*--------------------------------------------------------------------*/ /* Constants */ @@ -85,6 +84,6 @@ enum DOMAIN_ID END_DOMAIN_ID }; - +} // end namespace PRDF #endif diff --git a/src/usr/diag/prdf/common/iipglobl.h b/src/usr/diag/prdf/common/iipglobl.h index f9b7e64f2..b0ad52cdb 100755 --- a/src/usr/diag/prdf/common/iipglobl.h +++ b/src/usr/diag/prdf/common/iipglobl.h @@ -52,6 +52,8 @@ #include <prdf_types.h> #include <prdfErrlSmartPtr.H> +namespace PRDF +{ /*--------------------------------------------------------------------*/ /* Forward References */ /*--------------------------------------------------------------------*/ @@ -62,11 +64,10 @@ class System; /* Global Variables */ /*--------------------------------------------------------------------*/ -namespace PRDF -{ extern System * systemPtr; - extern PrdfErrlSmartPtr g_prd_errlHndl; -} + extern ErrlSmartPtr g_prd_errlHndl; + +} //End namespace PRDF /*--------------------------------------------------------------------*/ /* Singleton macros common to both FSP and Hostboot */ diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfCalloutUtil.H b/src/usr/diag/prdf/common/plat/pegasus/prdfCalloutUtil.H index e74c102bc..0e46ad613 100644 --- a/src/usr/diag/prdf/common/plat/pegasus/prdfCalloutUtil.H +++ b/src/usr/diag/prdf/common/plat/pegasus/prdfCalloutUtil.H @@ -28,10 +28,11 @@ * @brief Utility functions for common, non-trivial callouts. */ -struct STEP_CODE_DATA_STRUCT; - namespace PRDF { + +struct STEP_CODE_DATA_STRUCT; + namespace CalloutUtil { diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMba.C b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMba.C index f332030a2..2250845ff 100755 --- a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMba.C +++ b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMba.C @@ -50,7 +50,7 @@ namespace Mba * @param i_mbaChip A Centaur MBA chip. * @return SUCCESS */ -int32_t Initialize( PrdfExtensibleChip * i_mbaChip ) +int32_t Initialize( ExtensibleChip * i_mbaChip ) { i_mbaChip->getDataBundle() = new CenMbaDataBundle( i_mbaChip ); return SUCCESS; @@ -68,7 +68,7 @@ PRDF_PLUGIN_DEFINE( Mba, Initialize ); * done after the framework clears the FIR bits that were at attention. * @return SUCCESS. */ -int32_t PostAnalysis( PrdfExtensibleChip * i_mbaChip, +int32_t PostAnalysis( ExtensibleChip * i_mbaChip, STEP_CODE_DATA_STRUCT & i_sc ) { #ifdef __HOSTBOOT_MODULE @@ -110,7 +110,7 @@ PRDF_PLUGIN_DEFINE( Mba, PostAnalysis ); * @param i_sc The step code data struct. * @return SUCCESS */ -int32_t MaintCmdComplete( PrdfExtensibleChip * i_mbaChip, +int32_t MaintCmdComplete( ExtensibleChip * i_mbaChip, STEP_CODE_DATA_STRUCT & i_sc ) { using namespace TARGETING; @@ -150,7 +150,7 @@ PRDF_PLUGIN_DEFINE( Mba, MaintCmdComplete ); * @return SUCCESS */ // FIXME: Story 51702 will implement this -int32_t SkipMbaMsg( PrdfExtensibleChip * i_chip, +int32_t SkipMbaMsg( ExtensibleChip * i_chip, STEP_CODE_DATA_STRUCT & i_sc ) { using namespace TARGETING; diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaDataBundle.H b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaDataBundle.H index 9fd12de20..68492268d 100644 --- a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaDataBundle.H +++ b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMbaDataBundle.H @@ -38,7 +38,7 @@ namespace PRDF /** * @brief The P7 Centaur MBA data bundle. */ -class CenMbaDataBundle : public PrdfDataBundle +class CenMbaDataBundle : public DataBundle { public: // functions @@ -46,7 +46,7 @@ class CenMbaDataBundle : public PrdfDataBundle * @brief Constructor. * @param i_mbaChip The MBA chip. */ - explicit CenMbaDataBundle( PrdfExtensibleChip * i_mbaChip ) : + explicit CenMbaDataBundle( ExtensibleChip * i_mbaChip ) : iv_sendCmdCompleteMsg(false) {} @@ -75,7 +75,7 @@ class CenMbaDataBundle : public PrdfDataBundle * @param i_mbaChip The MBA chip. * @return This MBA's data bundle. */ -inline CenMbaDataBundle * getMbaDataBundle( PrdfExtensibleChip * i_mbaChip ) +inline CenMbaDataBundle * getMbaDataBundle( ExtensibleChip * i_mbaChip ) { return static_cast<CenMbaDataBundle *>(i_mbaChip->getDataBundle()); } diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMembuf.C b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMembuf.C index 8282bf55a..ace843f21 100755 --- a/src/usr/diag/prdf/common/plat/pegasus/prdfCenMembuf.C +++ b/src/usr/diag/prdf/common/plat/pegasus/prdfCenMembuf.C @@ -49,7 +49,7 @@ namespace Membuf * @param i_mbaChip A Centaur Membuf chip. * @return SUCCESS */ -int32_t Initialize( PrdfExtensibleChip * i_mbaChip ) +int32_t Initialize( ExtensibleChip * i_mbaChip ) { // FIXME: need to implement return SUCCESS; @@ -63,7 +63,7 @@ PRDF_PLUGIN_DEFINE( Membuf, Initialize ); * @brief Used when the chip has a CHECK_STOP attention to check for the * presence of recovered errors. */ -int32_t CheckForRecovered(PrdfExtensibleChip * i_chip, +int32_t CheckForRecovered(ExtensibleChip * i_chip, bool & o_hasRecovered) { //FIXME: need to fully implement for Membuf @@ -87,7 +87,7 @@ int32_t CheckForRecovered(PrdfExtensibleChip * i_chip, * done after the framework clears the FIR bits that were at attention. * @return SUCCESS. */ -int32_t PostAnalysis( PrdfExtensibleChip * i_membufChip, +int32_t PostAnalysis( ExtensibleChip * i_membufChip, STEP_CODE_DATA_STRUCT & i_sc ) { //FIXME: need to implement diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfCenPll.C b/src/usr/diag/prdf/common/plat/pegasus/prdfCenPll.C index 4beda7535..4fa8ae3c7 100755 --- a/src/usr/diag/prdf/common/plat/pegasus/prdfCenPll.C +++ b/src/usr/diag/prdf/common/plat/pegasus/prdfCenPll.C @@ -55,7 +55,7 @@ enum * @returns Failure or Success of query. * @note */ -int32_t QueryPll( PrdfExtensibleChip * i_chip, +int32_t QueryPll( ExtensibleChip * i_chip, bool & o_result) { int32_t rc = SUCCESS; @@ -94,7 +94,7 @@ PRDF_PLUGIN_DEFINE( Membuf, QueryPll ); * @returns Failure or Success of query. * @note */ -int32_t ClearPll( PrdfExtensibleChip * i_chip, +int32_t ClearPll( ExtensibleChip * i_chip, STEP_CODE_DATA_STRUCT & i_sc) { int32_t rc = SUCCESS; @@ -120,7 +120,7 @@ PRDF_PLUGIN_DEFINE( Membuf, ClearPll ); * @returns Failure or Success of query. * @note */ -int32_t MaskPll( PrdfExtensibleChip * i_chip,void * unused) +int32_t MaskPll( ExtensibleChip * i_chip,void * unused) { int32_t rc = SUCCESS; @@ -146,7 +146,7 @@ PRDF_PLUGIN_DEFINE( Membuf, MaskPll ); * @param i_sc The step code data struct. * @return SUCCESS. */ -int32_t CalloutPll( PrdfExtensibleChip * i_chip, +int32_t CalloutPll( ExtensibleChip * i_chip, STEP_CODE_DATA_STRUCT & i_sc ) { // FIXME: RTC: 51628 will address clock target issue @@ -164,7 +164,7 @@ PRDF_PLUGIN_DEFINE( Membuf, CalloutPll ); @returns Failure Or Success of message call. @note */ -int32_t PllPostAnalysis( PrdfExtensibleChip * i_chip, +int32_t PllPostAnalysis( ExtensibleChip * i_chip, STEP_CODE_DATA_STRUCT & i_sc ) { using namespace TARGETING; @@ -189,7 +189,7 @@ int32_t PllPostAnalysis( PrdfExtensibleChip * i_chip, for (TargetHandleList::iterator mbaIt = list.begin(); mbaIt != list.end(); ++mbaIt) { // Get the extensible chip for this mba - PrdfExtensibleChip *l_mbaChip = (PrdfExtensibleChip *)systemPtr->GetChip(*mbaIt); + ExtensibleChip *l_mbaChip = (ExtensibleChip *)systemPtr->GetChip(*mbaIt); //Check to make sure we are at threshold and have something garded. if( (NULL != l_mbaChip) && @@ -197,13 +197,13 @@ int32_t PllPostAnalysis( PrdfExtensibleChip * i_chip, (i_sc.service_data->QueryGard() != GardResolution::NoGard) ) { //Call the Skip Maintanence Command on this mba - PrdfExtensibleChipFunction * l_skipMbaMsg = + ExtensibleChipFunction * l_skipMbaMsg = l_mbaChip->getExtensibleFunction("SkipMbaMsg", true); // This call will return an error if it doesn't complete. // Don't fail on error. keep going. l_rc |= (*l_skipMbaMsg)(l_mbaChip, - PrdfPluginDef::bindParm<STEP_CODE_DATA_STRUCT &>(i_sc)); + PluginDef::bindParm<STEP_CODE_DATA_STRUCT &>(i_sc)); } } diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfDramRepairs.C b/src/usr/diag/prdf/common/plat/pegasus/prdfDramRepairs.C index 7d5820656..9131dd9e7 100644 --- a/src/usr/diag/prdf/common/plat/pegasus/prdfDramRepairs.C +++ b/src/usr/diag/prdf/common/plat/pegasus/prdfDramRepairs.C @@ -446,4 +446,6 @@ int32_t restoreDramRepairs(TargetHandle_t i_mba) return calloutMade ? FAIL : SUCCESS; } -} + +} // end namespace PRDF + diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfMemUtil.C b/src/usr/diag/prdf/common/plat/pegasus/prdfMemUtil.C index 46f3486f0..b29217102 100644 --- a/src/usr/diag/prdf/common/plat/pegasus/prdfMemUtil.C +++ b/src/usr/diag/prdf/common/plat/pegasus/prdfMemUtil.C @@ -39,7 +39,7 @@ namespace MemUtil #ifdef __HOSTBOOT_MODULE -int32_t clearHostAttns( PrdfExtensibleChip * i_memChip, +int32_t clearHostAttns( ExtensibleChip * i_memChip, STEP_CODE_DATA_STRUCT & i_sc ) { using namespace TARGETING; @@ -51,13 +51,13 @@ int32_t clearHostAttns( PrdfExtensibleChip * i_memChip, do { // Get the attached MCS chip. - PrdfExtensibleChip * mcsChip = i_memChip; + ExtensibleChip * mcsChip = i_memChip; if ( TYPE_MCS != PlatServices::getTargetType(memHandle) ) { TargetHandleList list = PlatServices::getConnected( memHandle, TYPE_MCS ); if ( 1 == list.size() ) - mcsChip = (PrdfExtensibleChip *)systemPtr->GetChip( list[0] ); + mcsChip = (ExtensibleChip *)systemPtr->GetChip( list[0] ); else { PRDF_ERR( "[MemUtil::clearHostAttns] getConnected() failed" ); diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfMemUtil.H b/src/usr/diag/prdf/common/plat/pegasus/prdfMemUtil.H index 03b25ce95..e4c1dcd16 100644 --- a/src/usr/diag/prdf/common/plat/pegasus/prdfMemUtil.H +++ b/src/usr/diag/prdf/common/plat/pegasus/prdfMemUtil.H @@ -30,11 +30,12 @@ #include <iipconst.h> -class PrdfExtensibleChip; -struct STEP_CODE_DATA_STRUCT; - namespace PRDF { + +class ExtensibleChip; +struct STEP_CODE_DATA_STRUCT; + namespace MemUtil { @@ -47,7 +48,7 @@ namespace MemUtil * @param i_sc The step code data struct. * @return Non-SUCCESS for internal errors, SUCCESS otherwise. */ -int32_t clearHostAttns( PrdfExtensibleChip * i_memChip, +int32_t clearHostAttns( ExtensibleChip * i_memChip, STEP_CODE_DATA_STRUCT & i_sc ); //#endif // __HOSTBOOT_MODULE diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfP8Mcs.C b/src/usr/diag/prdf/common/plat/pegasus/prdfP8Mcs.C index a43ae8ea6..3f7b724df 100755 --- a/src/usr/diag/prdf/common/plat/pegasus/prdfP8Mcs.C +++ b/src/usr/diag/prdf/common/plat/pegasus/prdfP8Mcs.C @@ -45,7 +45,7 @@ namespace Mcs * @param i_mcsChip An MCS chip. * @return SUCCESS */ -int32_t Initialize( PrdfExtensibleChip * i_mcsChip ) +int32_t Initialize( ExtensibleChip * i_mcsChip ) { // FIXME: Add proper initialization as per requirement return SUCCESS; diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfP8Pll.C b/src/usr/diag/prdf/common/plat/pegasus/prdfP8Pll.C index b89cae099..04bcc8f14 100755 --- a/src/usr/diag/prdf/common/plat/pegasus/prdfP8Pll.C +++ b/src/usr/diag/prdf/common/plat/pegasus/prdfP8Pll.C @@ -52,7 +52,7 @@ enum * @returns Failure or Success of query. * @note */ -int32_t QueryPll( PrdfExtensibleChip * i_chip, +int32_t QueryPll( ExtensibleChip * i_chip, bool & o_result) { int32_t rc = SUCCESS; @@ -89,7 +89,7 @@ PRDF_PLUGIN_DEFINE( Proc, QueryPll ); * @returns Failure or Success of query. * @note */ -int32_t ClearPll( PrdfExtensibleChip * i_chip, +int32_t ClearPll( ExtensibleChip * i_chip, STEP_CODE_DATA_STRUCT & i_sc) { int32_t rc = SUCCESS; @@ -114,7 +114,7 @@ PRDF_PLUGIN_DEFINE( Proc, ClearPll ); * @returns Failure or Success of query. * @note */ -int32_t MaskPll( PrdfExtensibleChip * i_chip,void * unused) +int32_t MaskPll( ExtensibleChip * i_chip,void * unused) { int32_t rc = SUCCESS; SCAN_COMM_REGISTER_CLASS * tpmask_or = i_chip->getRegister("TP_LFIR_MASK_OR"); @@ -132,7 +132,7 @@ PRDF_PLUGIN_DEFINE( Proc, MaskPll ); * @param i_sc The step code data struct. * @return SUCCESS. */ -int32_t CalloutPll( PrdfExtensibleChip * i_chip, +int32_t CalloutPll( ExtensibleChip * i_chip, STEP_CODE_DATA_STRUCT & i_sc ) { // FIXME: RTC: 51628 will address clock target issue diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfP8Proc.C b/src/usr/diag/prdf/common/plat/pegasus/prdfP8Proc.C index 961b1785a..e4fbc0c32 100755 --- a/src/usr/diag/prdf/common/plat/pegasus/prdfP8Proc.C +++ b/src/usr/diag/prdf/common/plat/pegasus/prdfP8Proc.C @@ -46,7 +46,7 @@ namespace Proc * @param i_chip P8 chip. * @return SUCCESS */ -int32_t Initialize( PrdfExtensibleChip * i_chip ) +int32_t Initialize( ExtensibleChip * i_chip ) { // FIXME: Add proper initialization as per requirement return SUCCESS; @@ -113,7 +113,7 @@ static inline bool OnlyMcOrExtCS (SCAN_COMM_REGISTER_CLASS * i_glcs, * @param o_hasRecovered - true if chip has a recovered that we want to analyze * @return SUCCESS */ -int32_t CheckForRecovered(PrdfExtensibleChip * i_chip, +int32_t CheckForRecovered(ExtensibleChip * i_chip, bool & o_hasRecovered) { o_hasRecovered = false; @@ -192,7 +192,7 @@ int32_t CheckForRecovered(PrdfExtensibleChip * i_chip, * @return SUCCESS * */ -int32_t CheckForRecoveredSev(PrdfExtensibleChip * i_chip, +int32_t CheckForRecoveredSev(ExtensibleChip * i_chip, uint32_t & o_sev) { SCAN_COMM_REGISTER_CLASS * l_rer = NULL; @@ -257,7 +257,7 @@ int32_t CheckForRecoveredSev(PrdfExtensibleChip * i_chip, * @param o_externalChips - List of external fabrics driving checkstop. * @param o_wofValue - Current WOF value (unused for now). */ -int32_t GetCheckstopInfo(PrdfExtensibleChip * i_chip, +int32_t GetCheckstopInfo(ExtensibleChip * i_chip, bool & o_wasInternal, TARGETING::TargetHandleList & o_externalChips, uint64_t & o_wofValue) @@ -342,7 +342,7 @@ int32_t GetCheckstopInfo(PrdfExtensibleChip * i_chip, } PRDF_PLUGIN_DEFINE( Proc, GetCheckstopInfo ); -int32_t CoreConfigured(PrdfExtensibleChip * i_chip, +int32_t CoreConfigured(ExtensibleChip * i_chip, bool & o_isCoreConfigured) { using namespace TARGETING; diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfP8SystemSpecific.C b/src/usr/diag/prdf/common/plat/pegasus/prdfP8SystemSpecific.C index 090770545..8149192f9 100644 --- a/src/usr/diag/prdf/common/plat/pegasus/prdfP8SystemSpecific.C +++ b/src/usr/diag/prdf/common/plat/pegasus/prdfP8SystemSpecific.C @@ -28,8 +28,10 @@ #include <prdfPegasusConfigurator.H> #include <prdfPlatServices.H> +namespace PRDF +{ -namespace PrdfSystemSpecific +namespace SystemSpecific { PRDF::Configurator * getConfiguratorPtr() { @@ -41,3 +43,5 @@ namespace PrdfSystemSpecific return; } }; + +} // end namespace PRDF diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfPegasusConfigurator.C b/src/usr/diag/prdf/common/plat/pegasus/prdfPegasusConfigurator.C index ea0fb5dd3..ace249424 100644 --- a/src/usr/diag/prdf/common/plat/pegasus/prdfPegasusConfigurator.C +++ b/src/usr/diag/prdf/common/plat/pegasus/prdfPegasusConfigurator.C @@ -103,11 +103,11 @@ System * PegasusConfigurator::build() System * l_system = new System(noAttnResolution); // Create domains. - FabricDomain * l_procDomain = new FabricDomain( FABRIC_DOMAIN ); - PrdfExDomain * l_exDomain = new PrdfExDomain( EX_DOMAIN ); - PrdfMcsDomain * l_mcsDomain = new PrdfMcsDomain( MCS_DOMAIN ); - PrdfMembufDomain * l_membufDomain = new PrdfMembufDomain( MEMBUF_DOMAIN ); - PrdfMbaDomain * l_mbaDomain = new PrdfMbaDomain( MBA_DOMAIN ); + FabricDomain * l_procDomain = new FabricDomain( FABRIC_DOMAIN ); + ExDomain * l_exDomain = new ExDomain( EX_DOMAIN ); + McsDomain * l_mcsDomain = new McsDomain( MCS_DOMAIN ); + MembufDomain * l_membufDomain = new MembufDomain( MEMBUF_DOMAIN ); + MbaDomain * l_mbaDomain = new MbaDomain( MBA_DOMAIN ); uint32_t l_maxNodeCount = _getMaxNumNodes(); @@ -148,9 +148,9 @@ System * PegasusConfigurator::build() //------------------------------------------------------------------------------ -void PegasusConfigurator::addDomainChips( TARGETING::TYPE i_type, - PrdfRuleChipDomain * io_domain, - PllDomainList * io_pllDomains ) +void PegasusConfigurator::addDomainChips( TARGETING::TYPE i_type, + RuleChipDomain * io_domain, + PllDomainList * io_pllDomains ) { using namespace TARGETING; @@ -164,11 +164,11 @@ void PegasusConfigurator::addDomainChips( TARGETING::TYPE i_type, const char * fileName = ""; switch ( i_type ) { - case TYPE_PROC: fileName = PRDF::Proc; break; - case TYPE_EX: fileName = PRDF::Ex; break; - case TYPE_MCS: fileName = PRDF::Mcs; break; - case TYPE_MEMBUF: fileName = PRDF::Membuf; break; - case TYPE_MBA: fileName = PRDF::Mba; break; + case TYPE_PROC: fileName = Proc; break; + case TYPE_EX: fileName = Ex; break; + case TYPE_MCS: fileName = Mcs; break; + case TYPE_MEMBUF: fileName = Membuf; break; + case TYPE_MBA: fileName = Mba; break; default: // Print a trace statement, but do not fail the build. @@ -185,8 +185,8 @@ void PegasusConfigurator::addDomainChips( TARGETING::TYPE i_type, { if ( NULL == *itr ) continue; - PrdfRuleChip * chip = new PrdfRuleChip( fileName, *itr, - scanFac, resFac ); + RuleChip * chip = new RuleChip( fileName, *itr, + scanFac, resFac ); sysChipLst.push_back( chip ); io_domain->AddChip( chip ); @@ -223,7 +223,7 @@ void PegasusConfigurator::addDomainChips( TARGETING::TYPE i_type, void PegasusConfigurator::addChipsToPllDomain( DOMAIN_ID i_domainId, PllDomainList * io_pllDomains, - PrdfRuleChip * i_chip, + RuleChip * i_chip, TARGETING::TargetHandle_t i_pTarget, ScanFacility & i_scanFac, ResolutionFactory & i_resFac) @@ -295,4 +295,4 @@ void PegasusConfigurator::addPllDomainsToSystem( } } -} // End namespace PRDF +} // end namespace PRDF diff --git a/src/usr/diag/prdf/common/plat/pegasus/prdfPegasusConfigurator.H b/src/usr/diag/prdf/common/plat/pegasus/prdfPegasusConfigurator.H index 4d442993b..4b788ee8b 100644 --- a/src/usr/diag/prdf/common/plat/pegasus/prdfPegasusConfigurator.H +++ b/src/usr/diag/prdf/common/plat/pegasus/prdfPegasusConfigurator.H @@ -32,11 +32,11 @@ #include <iipCallAttnResolution.h> // For CallAttnResolution #include <prdfPllDomain.H> -class PrdfRuleChipDomain; - namespace PRDF { +class RuleChipDomain; + typedef std::vector< PRDF::PllDomain *> PllDomainList; typedef std::vector< CHIP_CLASS *> PllChipList; @@ -49,8 +49,8 @@ class PegasusConfigurator : public Configurator * @brief Constructor */ PegasusConfigurator() : - Configurator( PrdfRuleChipDomain::TOTAL_CHIPS, - PrdfRuleChipDomain::TOTAL_DOMAINS ) + Configurator( RuleChipDomain::TOTAL_CHIPS, + RuleChipDomain::TOTAL_DOMAINS ) {} /** @@ -83,9 +83,9 @@ class PegasusConfigurator : public Configurator * @parm io_domain The associated domain. * @parm io_pllDomains The associated PLL domain (optional for some) */ - void addDomainChips( TARGETING::TYPE i_type, - PrdfRuleChipDomain * io_domain, - PllDomainList * io_pllDomains = NULL ); + void addDomainChips( TARGETING::TYPE i_type, + RuleChipDomain * io_domain, + PllDomainList * io_pllDomains = NULL ); /** * @brief Add chip to its Pll Domain. @@ -99,7 +99,7 @@ class PegasusConfigurator : public Configurator void addChipsToPllDomain( DOMAIN_ID i_domainId, PllDomainList * io_fabricPllDomains, - PrdfRuleChip * i_chip, + RuleChip * i_chip, TARGETING::TargetHandle_t i_pTarget, ScanFacility & i_scanFac, ResolutionFactory & i_resFac); @@ -111,7 +111,7 @@ class PegasusConfigurator : public Configurator */ void addPllDomainsToSystem( PllDomainList & i_fabricPllDomains, - PllDomainList & i_membPllDomains); + PllDomainList & i_membPllDomains ); private: // data @@ -119,6 +119,6 @@ class PegasusConfigurator : public Configurator }; -} // End namespace PRDF +} // end namespace PRDF #endif diff --git a/src/usr/diag/prdf/common/plat/prdfL3Table.C b/src/usr/diag/prdf/common/plat/prdfL3Table.C index 5bacecb2b..db44dee0e 100755 --- a/src/usr/diag/prdf/common/plat/prdfL3Table.C +++ b/src/usr/diag/prdf/common/plat/prdfL3Table.C @@ -41,9 +41,12 @@ // Member Function Specifications //------------------------------------------------------------------------------------------------- +namespace PRDF +{ + //------------------------------------------------------------------------------------------------- -int32_t prdfL3TableAdd(TARGETING::TargetHandle_t i_pl3targetHandle, uint32_t address) +int32_t L3TableAdd(TARGETING::TargetHandle_t i_pl3targetHandle, uint32_t address) { int32_t rc = 0; return rc; @@ -51,7 +54,7 @@ int32_t prdfL3TableAdd(TARGETING::TargetHandle_t i_pl3targetHandle, uint32_t add //------------------------------------------------------------------------------------------------- -void prdfL3TableGet(TARGETING::TargetHandle_t i_pl3targetHandle, uint32_t table[LineDeleteTableSize]) +void L3TableGet(TARGETING::TargetHandle_t i_pl3targetHandle, uint32_t table[LineDeleteTableSize]) { } @@ -70,12 +73,5 @@ errlHndl_t prdfL3LineDelete(TARGETING::TargetHandle_t i_pl3targetHandle, uint32_ return NULL; } -//------------------------------------------------------------------------------------------------- +} // end namespace PRDF -// Change Log ************************************************************************************* -// -// Flag Reason Vers Date Coder Description -// ---- ------ ------- -------- -------- ------------------------------------------------------- -// 485074 fips310 12/14/04 dgilbert Initial Creation -// -// End Change Log ********************************************************************************* diff --git a/src/usr/diag/prdf/common/plat/prdfL3Table.H b/src/usr/diag/prdf/common/plat/prdfL3Table.H index 6414f82b5..4fbf0fe2a 100755 --- a/src/usr/diag/prdf/common/plat/prdfL3Table.H +++ b/src/usr/diag/prdf/common/plat/prdfL3Table.H @@ -37,6 +37,9 @@ #include <targeting/common/target.H> #include <errlentry.H> +namespace PRDF +{ + //-------------------------------------------------------------------- // Forward References //-------------------------------------------------------------------- @@ -60,7 +63,7 @@ enum l3TableEnum <br><b>Notes: </b> </ul><br> */ -extern int32_t prdfL3TableAdd(TARGETING::TargetHandle_t i_pl3targetHandle, uint32_t address); +extern int32_t L3TableAdd(TARGETING::TargetHandle_t i_pl3targetHandle, uint32_t address); /** Copies the line delete table to memory address passed in @@ -73,7 +76,7 @@ extern int32_t prdfL3TableAdd(TARGETING::TargetHandle_t i_pl3targetHandle, uint3 <br><b>Notes: </b> </ul><br> */ -extern void prdfL3TableGet(TARGETING::TargetHandle_t i_pl3targetHandle, uint32_t table[LineDeleteTableSize]); +extern void L3TableGet(TARGETING::TargetHandle_t i_pl3targetHandle, uint32_t table[LineDeleteTableSize]); /** Get the count of line deletes in the table @@ -101,13 +104,7 @@ extern int32_t prdfL3TableCount(TARGETING::TargetHandle_t i_pl3targetHandle); */ extern errlHndl_t prdfL3LineDelete(TARGETING::TargetHandle_t i_pl3targetHandle, uint32_t address); +} // end namespace PRDF #endif /* PRDFL3TABLE_H */ -// Change Log ***************************************************************** -// -// Flag Reason Vers Date Coder Description -// ---- ------ -------- -------- -------- ------------------------------------ -// 485074 fips310 12/14/04 dgilbert Initial Creation from prdfGrL3Table.H -// -// End Change Log ************************************************************* diff --git a/src/usr/diag/prdf/common/plat/prdfLineDelete.C b/src/usr/diag/prdf/common/plat/prdfLineDelete.C index a3f669918..8b23e1425 100755 --- a/src/usr/diag/prdf/common/plat/prdfLineDelete.C +++ b/src/usr/diag/prdf/common/plat/prdfLineDelete.C @@ -31,8 +31,11 @@ #include <iipServiceDataCollector.h> #include <prdfBitString.H> +namespace PRDF +{ + // See prdfLineDelete.H for full function documentation. -namespace PrdfLineDelete +namespace LineDelete { /* PrdfCacheCETable::addAddress @@ -42,7 +45,7 @@ namespace PrdfLineDelete STEP_CODE_DATA_STRUCT & i_sdc ) { // Get the time of the current error. - PrdTimer timeOfError = i_sdc.service_data->GetTOE(); + Timer timeOfError = i_sdc.service_data->GetTOE(); // Check if time interval has elapsed. If so, flush the table. if ( (timeOfError > cv_flushTimer) || !cv_flushTimerInited ) @@ -233,17 +236,5 @@ namespace PrdfLineDelete } }; +} // end namespace PRDF - -// Change Log ****************************************************************** -// -// Flag Reason Vers Date Coder Description -// ---- ------- ---- -------- -------- ----------------------------------------- -// F522128 f300 09/22/05 iawillia Initial File Creation -// zs01 F565934 f310 09/06/06 zshelle Adding getTotalCount() -// zs02 d573288 f310 10/05/06 zshelle Adding addToCaptureData() -// zs03 588751 f310 03/12/07 zshelle Adding getLargestEntry() -// zs04 633659 f340 04/11/08 zshelle Add getEntryCount() and getTableSize() -// mp26 F750906 f720 plute Add getCRCAnalysisEntries -// -// End Change Log ************************************************************** diff --git a/src/usr/diag/prdf/common/plat/prdfLineDelete.H b/src/usr/diag/prdf/common/plat/prdfLineDelete.H index 8c7d3c80c..1e3f500db 100755 --- a/src/usr/diag/prdf/common/plat/prdfLineDelete.H +++ b/src/usr/diag/prdf/common/plat/prdfLineDelete.H @@ -34,16 +34,19 @@ #include <iipstep.h> #include <iipCaptureData.h> -/** @namespace PrdfLineDelete +namespace PRDF +{ + +/** @namespace LineDelete * Namespace to encapsulate all of the LineDelete specific classes and enums. */ -namespace PrdfLineDelete +namespace LineDelete { - /** @enum PrdfCacheType + /** @enum CacheType * Used to express where a cache error occured. */ - enum PrdfCacheType + enum CacheType { L3 = 0, L3_DIR = 1, @@ -56,10 +59,10 @@ namespace PrdfLineDelete SLICE_MASK = SLICE_A | SLICE_B }; - /** @enum PrdfCacheErrorType + /** @enum CacheErrorType * Used to express the types of cache errors that can occur. */ - enum PrdfCacheErrorType + enum CacheErrorType { UE, CE }; @@ -168,24 +171,15 @@ namespace PrdfLineDelete const ThresholdResolution::ThresholdPolicy iv_thPolicy; PrdfCacheAddressTable cv_ceTable; - PrdTimer cv_flushTimer; + Timer cv_flushTimer; bool cv_flushTimerInited; uint32_t cv_total; //zs01 }; }; + +} // end namespace PRDF + #endif -// Change Log ********************************************************* -// -// Flag Reason Vers Date Coder Description -// ---- -------- ---- -------- -------- ------------------------------- -// F522128 f300 09/22/05 iawillia Initial File Creation -// zs01 F565934 f310 09/06/06 zshelle Adding getTotalCount() -// zs02 d573288 f310 10/05/06 zshelle Adding addToCaptureData() -// zs03 588751 f310 03/12/07 zshelle Adding getLargestEntry() -// zs04 633659 f340 04/11/08 zshelle Add getEntryCount() and getTableSize() -// mp26 F750906 f720 plute Add getCRCAnalysisEntries -// -// End Change Log ***************************************************** diff --git a/src/usr/diag/prdf/common/plat/prdfMemoryMru.H b/src/usr/diag/prdf/common/plat/prdfMemoryMru.H index c501e0939..0ab0e4e5e 100755 --- a/src/usr/diag/prdf/common/plat/prdfMemoryMru.H +++ b/src/usr/diag/prdf/common/plat/prdfMemoryMru.H @@ -33,6 +33,9 @@ #include <targeting/common/target.H> #endif +// FIXME: RTC 47288 Will need to wrap this in PRDF namespace once external +// interfaces are removed/modified. + class PrdfMemoryMru { public: diff --git a/src/usr/diag/prdf/common/plat/prdfTOD.H b/src/usr/diag/prdf/common/plat/prdfTOD.H index de1875d5b..4ae2c4408 100755 --- a/src/usr/diag/prdf/common/plat/prdfTOD.H +++ b/src/usr/diag/prdf/common/plat/prdfTOD.H @@ -24,6 +24,8 @@ #ifndef PRDFTOD_H #define PRDFTOD_H +namespace PRDF +{ /** @struct PrdfTodFaultData * TOD Fault isolation information from a chip. @@ -37,21 +39,14 @@ struct PrdfTodFaultData TARGETING::TargetHandle_t topo_fault_chip[2]; }; -int32_t prdfTorrent_TodCaptureRegisters(STEP_CODE_DATA_STRUCT & i_stepcode); -int32_t prdfTorrent_TodCleanUpErrors(STEP_CODE_DATA_STRUCT & i_stepcode); -int32_t prdfTorrent_TodCollectFaultDataSys(vector<PrdfTodFaultData> & o_faults, - STEP_CODE_DATA_STRUCT & i_stepcode); -int32_t prdfTorrent_TodCollectFaultDataChip(PrdfExtensibleChip * i_chip, - vector<PrdfTodFaultData> & o_faults, - STEP_CODE_DATA_STRUCT & i_stepcode); - - int32_t prdfP7_TodCaptureRegisters(STEP_CODE_DATA_STRUCT & i_stepcode); int32_t prdfP7_TodCleanUpErrors(STEP_CODE_DATA_STRUCT & i_stepcode); int32_t prdfP7_TodCollectFaultDataSys(vector<PrdfTodFaultData> & o_faults, STEP_CODE_DATA_STRUCT & i_stepcode); -int32_t prdfP7_TodCollectFaultDataChip(PrdfExtensibleChip * i_chip, +int32_t prdfP7_TodCollectFaultDataChip(ExtensibleChip * i_chip, vector<PrdfTodFaultData> & o_faults, STEP_CODE_DATA_STRUCT & i_stepcode); +} // end namespace PRDF + #endif //PRDFTOD_H diff --git a/src/usr/diag/prdf/common/prdfMain.C b/src/usr/diag/prdf/common/prdfMain.C index f785134cf..77224326e 100755 --- a/src/usr/diag/prdf/common/prdfMain.C +++ b/src/usr/diag/prdf/common/prdfMain.C @@ -74,7 +74,7 @@ namespace PRDF //------------------------------------------------------------------------------ System * systemPtr = NULL; -PrdfErrlSmartPtr g_prd_errlHndl; // inited to NULL in ctor. +ErrlSmartPtr g_prd_errlHndl; // inited to NULL in ctor. bool g_initialized = false; //------------------------------------------------------------------------------ @@ -93,7 +93,7 @@ void unInitialize(void) #ifndef __HOSTBOOT_MODULE // clear the MfgThresholdMgr - PrdfMfgThresholdMgr::getInstance()->reset(); + MfgThresholdMgr::getInstance()->reset(); #endif PRDF_EXIT( "PRDF::unInitialize()" ); @@ -145,27 +145,27 @@ errlHndl_t initialize() // Clear out old chip persistency (for CCM). TARGETING::TargetHandleList l_oldChips; - for(PrdfChipPersist::iterator i = PrdfChipPersist::getInstance()->begin(); - i != PrdfChipPersist::getInstance()->end(); + for(ChipPersist::iterator i = ChipPersist::getInstance()->begin(); + i != ChipPersist::getInstance()->end(); ++i) { if (!PlatServices::isFunctional(*i)) l_oldChips.push_back(*i); } // This must be done afterwards otherwise the delete operation destroys - // the PrdfChipPersist::iterator. + // the ChipPersist::iterator. for(TARGETING::TargetHandleList::iterator i = l_oldChips.begin(); i != l_oldChips.end(); ++i) { - PrdfChipPersist::getInstance()->deleteEntry(*i); + ChipPersist::getInstance()->deleteEntry(*i); }; // -- finished clearing out old chip persistency (for CCM). #endif CcAutoDeletePointer<Configurator> configuratorPtr - (PrdfSystemSpecific::getConfiguratorPtr()); + (SystemSpecific::getConfiguratorPtr()); systemPtr = configuratorPtr->build(); // build PRD system model if(systemPtr != NULL) @@ -204,7 +204,7 @@ errlHndl_t main(ATTENTION_VALUE_TYPE i_attentionType, const AttnList & i_attnLis if(g_prd_errlHndl != NULL) rc = PRD_NOT_INITIALIZED; } //FIXME enterCCMMode ,isInCCM function not available in wrapper - // if (PrdfSystemData::getInstance()->isInCCM()) + // if (SystemData::getInstance()->isInCCM()) // PlatServices::enterCCMMode(); bool latent_check_stop = false; @@ -264,7 +264,7 @@ errlHndl_t main(ATTENTION_VALUE_TYPE i_attentionType, const AttnList & i_attnLis if (!latent_check_stop) { int32_t analyzeRc = systemPtr->Analyze(sdc, i_attentionType); - PrdfSystemSpecific::postAnalysisWorkarounds(sdc); + SystemSpecific::postAnalysisWorkarounds(sdc); if(analyzeRc != SUCCESS && g_prd_errlHndl == NULL) { // We have a bad RC, but no error log - Fill out SDC and have service generator make one @@ -314,7 +314,7 @@ void iplCleanup() #ifndef __HOSTBOOT_MODULE - PrdfChipPersist::getInstance()->clearData(); + ChipPersist::getInstance()->clearData(); if(PlatServices::isMasterFSP()) //only write registry key on primary { diff --git a/src/usr/diag/prdf/common/prdfTrace.C b/src/usr/diag/prdf/common/prdfTrace.C index 39bebe5ae..a774972d3 100755 --- a/src/usr/diag/prdf/common/prdfTrace.C +++ b/src/usr/diag/prdf/common/prdfTrace.C @@ -32,5 +32,5 @@ namespace PRDF { tracDesc_t traceDesc = 0; TRAC_INIT( &traceDesc, PRDF_COMP_NAME, 4096 ); -} +} //End namespace PRDF diff --git a/src/usr/diag/prdf/common/prdfTrace.H b/src/usr/diag/prdf/common/prdfTrace.H index 1a67febf2..4e9fb39e3 100755 --- a/src/usr/diag/prdf/common/prdfTrace.H +++ b/src/usr/diag/prdf/common/prdfTrace.H @@ -34,13 +34,8 @@ namespace PRDF #endif extern tracDesc_t traceDesc; -} -#ifdef __HOSTBOOT_MODULE - // FIXME: Will need to make a change in hbotcompid.H later. - #define PRDF_COMP_ID HBPRDF_COMP_ID - #define PRDF_COMP_NAME HBPRDF_COMP_NAME -#endif +} // end namespace PRDF // field traces ------------------- diff --git a/src/usr/diag/prdf/common/prdf_types.h b/src/usr/diag/prdf/common/prdf_types.h index ce103e61a..33d19ca9e 100755 --- a/src/usr/diag/prdf/common/prdf_types.h +++ b/src/usr/diag/prdf/common/prdf_types.h @@ -29,12 +29,15 @@ #undef NULL #define NULL 0 -#define BIT_LIST_CLASS prdfBitKey -#define BIT_STRING_CLASS prdfBitString -#define BIT_STRING_ADDRESS_CLASS prdfBitStringOffset -#define BIT_STRING_BUFFER_CLASS prdfBitStringBuffer -#define ResolutionMap prdfResolutionMap -#define FILTER_PRIORITY_CLASS prdfFilterPriority -#define FILTER_CLASS prdfFilter +namespace PRDF +{ + +#define BIT_LIST_CLASS BitKey +#define BIT_STRING_CLASS BitString +#define BIT_STRING_ADDRESS_CLASS BitStringOffset +#define BIT_STRING_BUFFER_CLASS BitStringBuffer +#define FILTER_CLASS FilterClass + +} // end namespace PRDF #endif /* prdf_types_h */ diff --git a/src/usr/diag/prdf/common/util/CcAutoDeletePointer.h b/src/usr/diag/prdf/common/util/CcAutoDeletePointer.h index 22560e0fb..9e20415ef 100755 --- a/src/usr/diag/prdf/common/util/CcAutoDeletePointer.h +++ b/src/usr/diag/prdf/common/util/CcAutoDeletePointer.h @@ -76,6 +76,9 @@ // Includes +namespace PRDF +{ + template <class T> class CcAutoDeletePointer { @@ -293,15 +296,10 @@ class CcAutoDeletePointerVector T * pointer; }; -#include <CcAutoDeletePointer.inl> -// Change Log ********************************************************** -// -// Flag PTR/DCR# Userid Date Description -// ---- -------- -------- -------- ----------- -// n/a n/a JST 09/12/95 Created. -// -// End Change Log ****************************************************** +} // end namespace PRDF + +#include <CcAutoDeletePointer.inl> #endif diff --git a/src/usr/diag/prdf/common/util/CcAutoDeletePointer.inl b/src/usr/diag/prdf/common/util/CcAutoDeletePointer.inl index d8b5c656e..7f7241e07 100755 --- a/src/usr/diag/prdf/common/util/CcAutoDeletePointer.inl +++ b/src/usr/diag/prdf/common/util/CcAutoDeletePointer.inl @@ -26,6 +26,9 @@ // Includes +namespace PRDF +{ + template<class T> inline CcAutoDeletePointer<T>::CcAutoDeletePointer(T * ptr) : @@ -75,13 +78,7 @@ T * CcAutoDeletePointerVector<T>::operator()(void) const return(pointer); } -// Change Log ********************************************************** -// -// Flag PTR/DCR# Userid Date Description -// ---- -------- -------- -------- ----------- -// n/a n/a JST 09/12/95 Created. -// -// End Change Log ****************************************************** +} // end namespace PRDF #endif diff --git a/src/usr/diag/prdf/common/util/CcSynch.h b/src/usr/diag/prdf/common/util/CcSynch.h index 8be57bb65..c37c68836 100755 --- a/src/usr/diag/prdf/common/util/CcSynch.h +++ b/src/usr/diag/prdf/common/util/CcSynch.h @@ -83,6 +83,8 @@ // Includes +namespace PRDF +{ template <class STEP_TYPE, class ID> class CcSynch @@ -187,16 +189,9 @@ class CcSynch StepType myStep; }; -#include "CcSynch.inl" +} // end namespace PRDF -// Change Log ********************************************************** -// -// Flag PTR/DCR# Userid Date Description -// ---- -------- -------- -------- ----------- -// n/a n/a JST 04/06/95 Created. -// D24747.4 JFP 02/23/96 Added #ifndef BOOL_H -// -// End Change Log ****************************************************** +#include "CcSynch.inl" #endif diff --git a/src/usr/diag/prdf/common/util/CcSynch.inl b/src/usr/diag/prdf/common/util/CcSynch.inl index 09371b95d..15e620cc7 100755 --- a/src/usr/diag/prdf/common/util/CcSynch.inl +++ b/src/usr/diag/prdf/common/util/CcSynch.inl @@ -26,6 +26,9 @@ // Includes +namespace PRDF +{ + template <class STEP_TYPE, class ID> inline void CcSynch<STEP_TYPE, ID>::Advance(void) @@ -50,13 +53,7 @@ bool CcSynch<STEP_TYPE, ID>::IsCurrent(void) return(rc); } -// Change Log ********************************************************** -// -// Flag PTR/DCR# Userid Date Description -// ---- -------- -------- -------- ----------- -// n/a n/a JST 04/06/95 Created. -// -// End Change Log ****************************************************** +} // end namespace PRDF #endif diff --git a/src/usr/diag/prdf/common/util/UtilFunct.H b/src/usr/diag/prdf/common/util/UtilFunct.H index 07e113326..f6687746e 100755 --- a/src/usr/diag/prdf/common/util/UtilFunct.H +++ b/src/usr/diag/prdf/common/util/UtilFunct.H @@ -30,6 +30,9 @@ #include <functional> +namespace PRDF +{ + namespace Util { /** @@ -141,13 +144,7 @@ namespace Util }; +} // end namespace PRDF #endif -// Change Log ********************************************************* -// -// Flag Reason Vers Date Coder Description -// ---- -------- ---- -------- -------- ------------------------------- -// F510901 f300 07/15/05 iawillia Initial file creation. -// End Change Log ***************************************************** - diff --git a/src/usr/diag/prdf/common/util/UtilHash.H b/src/usr/diag/prdf/common/util/UtilHash.H index da03cf2d9..7e0dee5dc 100755 --- a/src/usr/diag/prdf/common/util/UtilHash.H +++ b/src/usr/diag/prdf/common/util/UtilHash.H @@ -26,6 +26,9 @@ #include <stdint.h> +namespace PRDF +{ + namespace Util { inline uint32_t hashString(const char * i_str) @@ -95,5 +98,7 @@ namespace Util }; }; +} // end namespace PRDF + #endif diff --git a/src/usr/diag/prdf/common/util/UtilMapX.H b/src/usr/diag/prdf/common/util/UtilMapX.H index 208d7f784..bc34a6886 100755 --- a/src/usr/diag/prdf/common/util/UtilMapX.H +++ b/src/usr/diag/prdf/common/util/UtilMapX.H @@ -27,6 +27,9 @@ #include "UtilTree.H" #include <algorithm> +namespace PRDF +{ + template <class _A, class _B> class UtilMapX { @@ -186,12 +189,7 @@ _B & UtilMapX<_A, _B>::operator[] (const _A & a) return l_node->second; }; +} // end namespace PRDF + #endif -// Change Log ********************************************************* -// -// Flag Reason Vers Date Coder Description -// ---- -------- ---- -------- -------- ------------------------------- -// F494911 f310 03/04/05 iawillia Initial File Creation -// -// End Change Log ***************************************************** diff --git a/src/usr/diag/prdf/common/util/UtilSMap.H b/src/usr/diag/prdf/common/util/UtilSMap.H index c47f36c19..042394f09 100755 --- a/src/usr/diag/prdf/common/util/UtilSMap.H +++ b/src/usr/diag/prdf/common/util/UtilSMap.H @@ -32,6 +32,9 @@ #include <stddef.h> #include <stdlib.h> +namespace PRDF +{ + template <typename _First, typename _Second> class UtilSMap_Iterator; template <typename _First, typename _Second> UtilSMap_Iterator<_First, _Second> operator+(UtilSMap_Iterator<_First,_Second>& l, size_t i); @@ -177,5 +180,6 @@ UtilSMap_Iterator<_First,_Second> UtilSMap<_First,_Second>::cv_blockSize * i]); }; +} // end namespace PRDF #endif diff --git a/src/usr/diag/prdf/common/util/UtilTree.C b/src/usr/diag/prdf/common/util/UtilTree.C index 5eeaf3e43..464ec6557 100755 --- a/src/usr/diag/prdf/common/util/UtilTree.C +++ b/src/usr/diag/prdf/common/util/UtilTree.C @@ -22,6 +22,10 @@ /* IBM_PROLOG_END_TAG */ #include "UtilTree.H" + +namespace PRDF +{ + UtilTree::defaultComparator UtilTree::defComparator; UtilTree::defaultCleanup UtilTree::defCleanup; UtilTree::defaultCopier UtilTree::defCopy; @@ -335,10 +339,5 @@ UtilTree::iterator UtilTree::begin() const return iterator(tmp, this); }; -// Change Log ********************************************************* -// -// Flag Reason Vers Date Coder Description -// ---- -------- ---- -------- -------- ------------------------------- -// F494911 f310 03/04/05 iawillia Initial File Creation -// -// End Change Log ***************************************************** +} // end namespace PRDF + diff --git a/src/usr/diag/prdf/common/util/UtilTree.H b/src/usr/diag/prdf/common/util/UtilTree.H index b8c18e67e..90dce80f8 100755 --- a/src/usr/diag/prdf/common/util/UtilTree.H +++ b/src/usr/diag/prdf/common/util/UtilTree.H @@ -31,6 +31,9 @@ #include <iostream> +namespace PRDF +{ + namespace UtilTreeSTD { template <class _A, class _B> @@ -170,12 +173,7 @@ class UtilTree iterator begin() const; }; +} // end namespace PRDF + #endif -// Change Log ********************************************************* -// -// Flag Reason Vers Date Coder Description -// ---- -------- ---- -------- -------- ------------------------------- -// F494911 f310 03/04/05 iawillia Initial File Creation -// -// End Change Log ***************************************************** diff --git a/src/usr/diag/prdf/common/util/UtilTreeX.H b/src/usr/diag/prdf/common/util/UtilTreeX.H index 820adf251..7fa33211f 100755 --- a/src/usr/diag/prdf/common/util/UtilTreeX.H +++ b/src/usr/diag/prdf/common/util/UtilTreeX.H @@ -26,6 +26,9 @@ #include "UtilTree.H" +namespace PRDF +{ + template <class _T> class UtilTreeX { @@ -159,13 +162,7 @@ const _T & UtilTreeX<_T>::peek() return *static_cast<const _T *>(tmp); }; +} // end namespace PRDF #endif -// Change Log ********************************************************* -// -// Flag Reason Vers Date Coder Description -// ---- -------- ---- -------- -------- ------------------------------- -// F494911 f310 03/04/05 iawillia Initial File Creation -// -// End Change Log ***************************************************** diff --git a/src/usr/diag/prdf/common/util/iipdgtb.C b/src/usr/diag/prdf/common/util/iipdgtb.C index c405c9adb..65b6938b0 100755 --- a/src/usr/diag/prdf/common/util/iipdgtb.C +++ b/src/usr/diag/prdf/common/util/iipdgtb.C @@ -54,6 +54,9 @@ #include <string.h> // for memcpy #include <iipdgtb.h> +namespace PRDF +{ + /*--------------------------------------------------------------------*/ /* User Types */ /*--------------------------------------------------------------------*/ @@ -291,4 +294,6 @@ void DIGIT_STRING_BYTE_CLASS::SetValue xbuffer[offset] = value; } +} // end namespace PRDF + #undef IIPDGTB_CPP diff --git a/src/usr/diag/prdf/common/util/iipdgtb.h b/src/usr/diag/prdf/common/util/iipdgtb.h index 94aaa6c56..11e3ff06b 100755 --- a/src/usr/diag/prdf/common/util/iipdgtb.h +++ b/src/usr/diag/prdf/common/util/iipdgtb.h @@ -52,6 +52,8 @@ #include <iipdigit.h> +namespace PRDF +{ /*--------------------------------------------------------------------*/ /* Forward References */ /*--------------------------------------------------------------------*/ @@ -320,5 +322,5 @@ class DIGIT_STRING_BYTE_CLASS : public DIGIT_STRING_CLASS }; - +} //End namespace PRDF #endif diff --git a/src/usr/diag/prdf/common/util/iipdigit.C b/src/usr/diag/prdf/common/util/iipdigit.C index 5fc676844..56cb1823c 100755 --- a/src/usr/diag/prdf/common/util/iipdigit.C +++ b/src/usr/diag/prdf/common/util/iipdigit.C @@ -53,6 +53,8 @@ #include <iipdigit.h> +namespace PRDF +{ /*--------------------------------------------------------------------*/ /* User Types */ /*--------------------------------------------------------------------*/ @@ -177,5 +179,5 @@ bool DIGIT_STRING_CLASS::operator== return(rc); } - +} //End namespace PRDF #undef IIPDIGIT_CPP diff --git a/src/usr/diag/prdf/common/util/iipdigit.h b/src/usr/diag/prdf/common/util/iipdigit.h index b81d2e1a9..ebf0cc50a 100755 --- a/src/usr/diag/prdf/common/util/iipdigit.h +++ b/src/usr/diag/prdf/common/util/iipdigit.h @@ -52,7 +52,8 @@ /*--------------------------------------------------------------------*/ #include <prdf_types.h> - +namespace PRDF +{ /*--------------------------------------------------------------------*/ /* Forward References */ /*--------------------------------------------------------------------*/ @@ -473,5 +474,5 @@ class DIGIT_STRING_CLASS }; - +} //End namespace PRDF #endif diff --git a/src/usr/diag/prdf/common/util/prdfAssert.C b/src/usr/diag/prdf/common/util/prdfAssert.C index 4762e11da..fcbecff98 100755 --- a/src/usr/diag/prdf/common/util/prdfAssert.C +++ b/src/usr/diag/prdf/common/util/prdfAssert.C @@ -43,8 +43,8 @@ #undef prdfAssert_C -using namespace PRDF; - +namespace PRDF +{ //--------------------------------------------------------------------- // Member Function Specifications //--------------------------------------------------------------------- @@ -101,3 +101,6 @@ void prdfAssert( const char * i_exp, const char * i_file, int i_line ) #endif } + +} // end namespace PRDF + diff --git a/src/usr/diag/prdf/common/util/prdfAssert.h b/src/usr/diag/prdf/common/util/prdfAssert.h index 5e5b83e15..ed05cf37e 100755 --- a/src/usr/diag/prdf/common/util/prdfAssert.h +++ b/src/usr/diag/prdf/common/util/prdfAssert.h @@ -28,6 +28,9 @@ * @file prdfAssert.h */ +namespace PRDF +{ + #define PRDF_ASSERT(x) { if(!(x)) { prdfAssert(#x,__FILE__,__LINE__); } } /** @@ -38,4 +41,6 @@ */ void prdfAssert( const char * i_exp, const char * i_file, int i_line ); +} // end namespace PRDF + #endif /* PRDFASSERT_H */ diff --git a/src/usr/diag/prdf/common/util/prdfBitKey.C b/src/usr/diag/prdf/common/util/prdfBitKey.C index 0245d26b3..8a2bcc9a4 100755 --- a/src/usr/diag/prdf/common/util/prdfBitKey.C +++ b/src/usr/diag/prdf/common/util/prdfBitKey.C @@ -24,15 +24,17 @@ //---------------------------------------------------------------------- // Includes //---------------------------------------------------------------------- -#define prdfBitKey_C +#define BitKey_C //#include <prdfAssert.h> #include <prdfBitKey.H> #include <prdfBitString.H> #include <string.h> -#undef prdfBitKey_C +#undef BitKey_C +namespace PRDF +{ //------------------------------------------------------------------------------------------------- // Local //------------------------------------------------------------------------------------------------- @@ -45,7 +47,7 @@ inline uint32_t getWordSize(uint32_t bitCount) // # of bit32's needed for this b // member function definitions //------------------------------------------------------------------------------------------------- -prdfBitKey::prdfBitKey(void) +BitKey::BitKey(void) : iv_Capacity(0), iv_storage1(0) { iv_rep.storage2 = 0; @@ -53,7 +55,7 @@ prdfBitKey::prdfBitKey(void) //------------------------------------------------------------------------------------------------- -prdfBitKey::prdfBitKey(uint32_t i_bitPos) +BitKey::BitKey(uint32_t i_bitPos) : iv_Capacity(0), iv_storage1(0) { iv_rep.storage2 = 0; @@ -62,7 +64,7 @@ prdfBitKey::prdfBitKey(uint32_t i_bitPos) //------------------------------------------------------------------------------------------------- -prdfBitKey::prdfBitKey(const uint8_t * i_array,uint8_t i_size) +BitKey::BitKey(const uint8_t * i_array,uint8_t i_size) : iv_Capacity(0), iv_storage1(0) { iv_rep.storage2 = 0; @@ -76,7 +78,7 @@ prdfBitKey::prdfBitKey(const uint8_t * i_array,uint8_t i_size) //------------------------------------------------------------------------------------------------- -prdfBitKey::prdfBitKey(const char * i_ble) +BitKey::BitKey(const char * i_ble) : iv_Capacity(0), iv_storage1(0) { iv_rep.storage2 = 0; @@ -89,14 +91,14 @@ prdfBitKey::prdfBitKey(const char * i_ble) //------------------------------------------------------------------------------------------------- -prdfBitKey::~prdfBitKey(void) +BitKey::~BitKey(void) { if(!IsDirect()) delete [] iv_rep.buffer; } //------------------------------------------------------------------------------------------------- -prdfBitKey::prdfBitKey (const prdfBitKey & bit_list) +BitKey::BitKey (const BitKey & bit_list) : iv_Capacity(bit_list.iv_Capacity), iv_storage1(bit_list.iv_storage1) { if(IsDirect()) @@ -113,11 +115,11 @@ prdfBitKey::prdfBitKey (const prdfBitKey & bit_list) //------------------------------------------------------------------------------------------------- -prdfBitKey & prdfBitKey::operator=(const prdfBitKey & bit_list) +BitKey & BitKey::operator=(const BitKey & bit_list) { if(iv_Capacity) { - prdfBitString bs(iv_Capacity,DataPtr()); + BitString bs(iv_Capacity,DataPtr()); bs.Pattern(0x00000000); } ReAllocate(bit_list.iv_Capacity); @@ -143,26 +145,26 @@ prdfBitKey & prdfBitKey::operator=(const prdfBitKey & bit_list) //------------------------------------------------------------------------------------------------- -prdfBitKey & prdfBitKey::operator=(const prdfBitString & bit_string) +BitKey & BitKey::operator=(const BitString & bit_string) { if(iv_Capacity) { - prdfBitString bs(iv_Capacity,DataPtr()); + BitString bs(iv_Capacity,DataPtr()); bs.Pattern(0x00000000); } ReAllocate(bit_string.GetLength()); - prdfBitString dbs(iv_Capacity,DataPtr()); + BitString dbs(iv_Capacity,DataPtr()); dbs.SetBits(bit_string); return(*this); } //------------------------------------------------------------------------------------------------- -prdfBitKey & prdfBitKey::operator=(const char * string_ptr) +BitKey & BitKey::operator=(const char * string_ptr) { if(iv_Capacity) { - prdfBitString bs(iv_Capacity,DataPtr()); + BitString bs(iv_Capacity,DataPtr()); bs.Pattern(0x00000000); } @@ -177,7 +179,7 @@ prdfBitKey & prdfBitKey::operator=(const char * string_ptr) //------------------------------------------------------------------------------------------------- -bool prdfBitKey::operator==(const prdfBitKey & that) const +bool BitKey::operator==(const BitKey & that) const { bool result = true; const uint32_t * mydata = cDataPtr(); @@ -213,7 +215,7 @@ bool prdfBitKey::operator==(const prdfBitKey & that) const //------------------------------------------------------------------------------------------------- // Candidate funciton for bs class -bool prdfBitKey::isSubset(const prdfBitKey & that) const +bool BitKey::isSubset(const BitKey & that) const { bool result = true; const uint32_t * mydata = cDataPtr(); @@ -222,7 +224,7 @@ bool prdfBitKey::isSubset(const prdfBitKey & that) const uint32_t yosize = getWordSize(that.iv_Capacity); uint32_t smsize = (yosize < mysize)? yosize : mysize; // size can be non-zero with no bits on - so if that has no bits than use operator== - prdfBitKey zero; + BitKey zero; if(that == zero) result = operator==(that); // only true if both are empty - eg not bits on" // if yosize <= mysize than just match smallest amount of data // if yozize > mysize than extra yodata must be zero @@ -244,13 +246,13 @@ bool prdfBitKey::isSubset(const prdfBitKey & that) const //------------------------------------------------------------------------------------------------- // get bit position of nth bit that is set -uint32_t prdfBitKey::getListValue(uint32_t n) const +uint32_t BitKey::getListValue(uint32_t n) const { ++n; uint32_t setCount = 0; uint32_t bitPos = 0xffffffff; - prdfBitString bs(iv_Capacity,(CPU_WORD *)cDataPtr()); + BitString bs(iv_Capacity,(CPU_WORD *)cDataPtr()); for(uint32_t i = 0; i < iv_Capacity; ++i) { if(bs.IsSet(i)) ++setCount; @@ -265,28 +267,28 @@ uint32_t prdfBitKey::getListValue(uint32_t n) const //------------------------------------------------------------------------------------------------- -uint32_t prdfBitKey::size(void) const +uint32_t BitKey::size(void) const { - const prdfBitString bs(iv_Capacity,(CPU_WORD *)cDataPtr()); + const BitString bs(iv_Capacity,(CPU_WORD *)cDataPtr()); return bs.GetSetCount(); } //------------------------------------------------------------------------------------------------- -void prdfBitKey::removeBit(uint32_t n) +void BitKey::removeBit(uint32_t n) { if(n < size()) { - prdfBitString bs(iv_Capacity,DataPtr()); + BitString bs(iv_Capacity,DataPtr()); bs.Clear(getListValue(n)); } } //------------------------------------------------------------------------------------------------- -void prdfBitKey::removeBit(void) +void BitKey::removeBit(void) { - prdfBitString bs(iv_Capacity,DataPtr()); + BitString bs(iv_Capacity,DataPtr()); uint32_t i = iv_Capacity; while(i != 0) { @@ -301,28 +303,28 @@ void prdfBitKey::removeBit(void) //------------------------------------------------------------------------------------------------- -void prdfBitKey::removeBits(const prdfBitKey & i_bk) +void BitKey::removeBits(const BitKey & i_bk) { - prdfBitString mybs(iv_Capacity,(CPU_WORD *)DataPtr()); - const prdfBitString yobs(i_bk.iv_Capacity,(CPU_WORD *)i_bk.cDataPtr()); + BitString mybs(iv_Capacity,(CPU_WORD *)DataPtr()); + const BitString yobs(i_bk.iv_Capacity,(CPU_WORD *)i_bk.cDataPtr()); mybs.Mask(yobs); } //------------------------------------------------------------------------------------------------- -void prdfBitKey::setBit(uint32_t i_bitValue) +void BitKey::setBit(uint32_t i_bitValue) { if(i_bitValue >= iv_Capacity) { ReAllocate(i_bitValue+1); } - prdfBitString bs(iv_Capacity,DataPtr()); + BitString bs(iv_Capacity,DataPtr()); bs.Set(i_bitValue); } //------------------------------------------------------------------------------------------------- -void prdfBitKey::ReAllocate(uint32_t i_len) +void BitKey::ReAllocate(uint32_t i_len) { if(i_len > iv_Capacity) // never shrink { @@ -338,9 +340,9 @@ void prdfBitKey::ReAllocate(uint32_t i_len) if(!isDirect) // to indirect { uint32_t * newBuffer = new uint32_t[wordsize]; - prdfBitString dbs(iv_Capacity,newBuffer); + BitString dbs(iv_Capacity,newBuffer); dbs.Pattern(0x00000000); - prdfBitString sbs(oldSize,oldPtr); + BitString sbs(oldSize,oldPtr); dbs.SetBits(sbs); iv_storage1 = 0; if(!wasDirect) // from indirect @@ -352,11 +354,5 @@ void prdfBitKey::ReAllocate(uint32_t i_len) } } +} // end namespace PRDF -// Change Log ************************************************************************************* -// -// Flag Reason Vers Date Coder Description -// ---- -------- ---- -------- -------- --------------------------------------------------------- -// dgilbert Initial Creation -// -// End Change Log ********************************************************************************* diff --git a/src/usr/diag/prdf/common/util/prdfBitKey.H b/src/usr/diag/prdf/common/util/prdfBitKey.H index de2f4b8e9..34dd7c954 100755 --- a/src/usr/diag/prdf/common/util/prdfBitKey.H +++ b/src/usr/diag/prdf/common/util/prdfBitKey.H @@ -22,7 +22,7 @@ /* IBM_PROLOG_END_TAG */ /*! /file prdfBitKey.H - * /brief prdfBitKey class Declairation + * /brief BitKey class Declairation * */ #ifndef PRDFBITLKEY_H @@ -30,15 +30,18 @@ #include <prdf_types.h> +namespace PRDF +{ + /*--------------------------------------------------------------------*/ /* Forward References */ /*--------------------------------------------------------------------*/ -class prdfBitString; +class BitString; -//! prdfBitKey +//! BitKey /*! - prdfBitKey provides the representation of bit positions that are + BitKey provides the representation of bit positions that are set ('1') In a string of bits. It has the same iterface as the prdfBitList or BIT_LIST_CLASS. \remarks The object this class creates is meant to be used as a key in a map or table and @@ -92,9 +95,9 @@ class prdfBitString; K + Mn where K and M are constants and n is the number of bit psotions in the list -\sa prdfBitString +\sa BitString */ -class prdfBitKey +class BitKey { public: @@ -102,13 +105,13 @@ class prdfBitKey /*! This function initializes the string to NULL (empty bit list) */ - prdfBitKey(void); + BitKey(void); //! Constructor /*! This function initializes the bit list with one value; */ - prdfBitKey(uint32_t i_bitPos); + BitKey(uint32_t i_bitPos); //! Constructor /*! @@ -116,33 +119,33 @@ class prdfBitKey \param i_array ptr to array of bit list values \param i_size size of the array */ - prdfBitKey(const uint8_t * i_array,uint8_t i_size); + BitKey(const uint8_t * i_array,uint8_t i_size); /*! Constructor - from a bit list encoding \param i_ble ptr to Bit list encoding */ - prdfBitKey(const char * i_ble); + BitKey(const char * i_ble); //! Copy Constructor - prdfBitKey (const prdfBitKey & bit_list); + BitKey (const BitKey & bit_list); //! Destructor - ~prdfBitKey(void); + ~BitKey(void); - //! Assignment operator from prdfBitKey + //! Assignment operator from BitKey /*! \post *this == bit_list */ - prdfBitKey & operator=(const prdfBitKey & bit_list); + BitKey & operator=(const BitKey & bit_list); - //! Assignment operator from prdfBitString + //! Assignment operator from BitString /*! This function assigns the specified Bit String bit positions to this Bit List. Bit positions are set from left to right. */ - prdfBitKey & operator=(const prdfBitString & bit_string); + BitKey & operator=(const BitString & bit_string); //! Assignment operator from c string (char *) /*! @@ -152,7 +155,7 @@ class prdfBitKey and thus a valid bit position, each character value is decremented to obtain the actual bit position. */ - prdfBitKey & operator=(const char * string_ptr); + BitKey & operator=(const char * string_ptr); //! Equality operator /*! @@ -163,7 +166,7 @@ class prdfBitKey positions. If both Bit Lists are empty, they are considered equal. */ - bool operator==(const prdfBitKey & bit_list) const; + bool operator==(const BitKey & bit_list) const; //! Is Subset /*! @@ -183,7 +186,7 @@ class prdfBitKey A non-empty list is NOT as subset of an empty list \endverbatim */ - bool isSubset(const prdfBitKey & bit_list) const; + bool isSubset(const BitKey & bit_list) const; //! Get Bit List Value /*! @@ -221,7 +224,7 @@ class prdfBitKey \pre none \post bit list may be modified */ - void removeBits(const prdfBitKey & i_bk); + void removeBits(const BitKey & i_bk); /*! @@ -290,12 +293,7 @@ class prdfBitKey }; +} // end namespace PRDF + #endif -// Change Log ************************************************************************************* -// -// Flag Reason Vers Date Coder Description -// ---- -------- ---- -------- -------- --------------------------------------------------------- -// dgilbert Initial Creation -// -// End Change Log ********************************************************************************* diff --git a/src/usr/diag/prdf/common/util/prdfBitString.C b/src/usr/diag/prdf/common/util/prdfBitString.C index bc9fa8907..c4a8e600b 100755 --- a/src/usr/diag/prdf/common/util/prdfBitString.C +++ b/src/usr/diag/prdf/common/util/prdfBitString.C @@ -21,8 +21,8 @@ /* */ /* IBM_PROLOG_END_TAG */ -/** @file prdfBitString.C - * @brief prdfBitString and prdfBitStringBuffer class Definitions +/** @file BitString.C + * @brief BitString and BitStringBuffer class Definitions */ /*--------------------------------------------------------------------*/ @@ -37,6 +37,9 @@ #include <algorithm> +namespace PRDF +{ + /*--------------------------------------------------------------------*/ /* User Types */ /*--------------------------------------------------------------------*/ @@ -62,13 +65,13 @@ /*--------------------------------------------------------------------*/ -prdfBitString::~prdfBitString(void) +BitString::~BitString(void) { } // ------------------------------------------------------------------------------------------------ -uint32_t prdfBitString::GetSetCount(uint32_t bit_position, +uint32_t BitString::GetSetCount(uint32_t bit_position, uint32_t leng ) const { @@ -93,7 +96,7 @@ uint32_t prdfBitString::GetSetCount(uint32_t bit_position, // ------------------------------------------------------------------------------------------------ -CPU_WORD prdfBitString::GetField +CPU_WORD BitString::GetField ( uint32_t iBitPos, uint32_t iLen @@ -123,7 +126,7 @@ CPU_WORD prdfBitString::GetField // ------------------------------------------------------------------------------------------------ -CPU_WORD prdfBitString::GetFieldJustify +CPU_WORD BitString::GetFieldJustify ( uint32_t bit_position, uint32_t length @@ -138,7 +141,7 @@ CPU_WORD prdfBitString::GetFieldJustify // ------------------------------------------------------------------------------------------------ -void prdfBitString::SetField +void BitString::SetField ( uint32_t bit_position, uint32_t iLen, @@ -171,7 +174,7 @@ void prdfBitString::SetField // ------------------------------------------------------------------------------------------------ -void prdfBitString::SetFieldJustify +void BitString::SetFieldJustify ( uint32_t bit_position, uint32_t length, @@ -185,15 +188,15 @@ void prdfBitString::SetFieldJustify // ------------------------------------------------------------------------------------------------ -void prdfBitString::SetBits +void BitString::SetBits ( - const prdfBitString & string, // source string + const BitString & string, // source string unsigned int iPos, // source start pos unsigned int iLen, // length unsigned int iDpos // dest start pos ) { - const prdfBitString * source = &string; + const BitString * source = &string; bool copyforward = true; // How Much to really move @@ -277,7 +280,7 @@ void prdfBitString::SetBits // // End Function Specification ////////////////////////////////////// -void prdfBitString::Pattern +void BitString::Pattern ( uint32_t o, uint32_t l, @@ -323,7 +326,7 @@ void prdfBitString::Pattern // // End Function Specification ////////////////////////////////////// -bool prdfBitString::IsSet +bool BitString::IsSet ( uint32_t bit_position ) const @@ -344,7 +347,7 @@ bool prdfBitString::IsSet // // End Function Specification ////////////////////////////////////////// -void prdfBitString::Set +void BitString::Set ( uint32_t bit_position ) @@ -365,7 +368,7 @@ void prdfBitString::Set // // End Function Specification ////////////////////////////////////////// -void prdfBitString::Clear +void BitString::Clear ( uint32_t bit_position ) @@ -390,9 +393,9 @@ void prdfBitString::Clear // // End Function Specification ////////////////////////////////////// -bool prdfBitString::IsEqual +bool BitString::IsEqual ( - const prdfBitString& string + const BitString& string ) const { uint32_t o; @@ -441,7 +444,7 @@ bool prdfBitString::IsEqual // // End Function Specification ////////////////////////////////////// -bool prdfBitString::IsZero(void) const +bool BitString::IsZero(void) const { uint32_t o = 0; uint32_t l = ivLength; @@ -503,9 +506,9 @@ bool prdfBitString::IsZero(void) const // // End Function Specification ////////////////////////////////////// -void prdfBitString::Mask +void BitString::Mask ( - const prdfBitString & string + const BitString & string ) { CPU_WORD value, string_value; @@ -541,7 +544,7 @@ void prdfBitString::Mask //------------------------------------------------------------------------------------------------- -CPU_WORD * prdfBitString::GetRelativePosition(uint32_t & oBitOffset, uint32_t iBitPos) const +CPU_WORD * BitString::GetRelativePosition(uint32_t & oBitOffset, uint32_t iBitPos) const { PRDF_ASSERT(ivBuffer != NULL); oBitOffset = iBitPos % WORD_BIT_LENGTH; @@ -550,7 +553,7 @@ CPU_WORD * prdfBitString::GetRelativePosition(uint32_t & oBitOffset, uint32_t iB //------------------------------------------------------------------------------------------------- // dg02a - start -CPU_WORD * prdfBitStringBuffer::GetRelativePositionAlloc(uint32_t & oBitOffset, uint32_t iBitPos) +CPU_WORD * BitStringBuffer::GetRelativePositionAlloc(uint32_t & oBitOffset, uint32_t iBitPos) { // The non-constant version of GetRelativePostion if(GetMemoryAddress() == NULL) SetBuffer(); // alocate memory @@ -559,38 +562,38 @@ CPU_WORD * prdfBitStringBuffer::GetRelativePositionAlloc(uint32_t & oBitOffset, // dg02a - end //------------------------------------------------------------------------------------------------- -CPU_WORD * prdfBitStringOffset::GetRelativePosition(uint32_t & oBitOffset, uint32_t iBitPos) const +CPU_WORD * BitStringOffset::GetRelativePosition(uint32_t & oBitOffset, uint32_t iBitPos) const { iBitPos += ivOffset; - return prdfBitString::GetRelativePosition(oBitOffset,iBitPos); + return BitString::GetRelativePosition(oBitOffset,iBitPos); } //dg04a -start -CPU_WORD * prdfBitStringOffset::GetRelativePositionAlloc(uint32_t & oBitOffset, uint32_t iBitPos) +CPU_WORD * BitStringOffset::GetRelativePositionAlloc(uint32_t & oBitOffset, uint32_t iBitPos) { iBitPos += ivOffset; - return prdfBitString::GetRelativePosition(oBitOffset, iBitPos); + return BitString::GetRelativePosition(oBitOffset, iBitPos); } //dg04a - end //------------------------------------------------------------------------------------------------- -prdfBitStringOffset::~prdfBitStringOffset(void) {} +BitStringOffset::~BitStringOffset(void) {} //------------------------------------------------------------------------------------------------- -prdfBitStringOffset & prdfBitStringOffset::operator=(const prdfBitStringOffset & i_bs) +BitStringOffset & BitStringOffset::operator=(const BitStringOffset & i_bs) { - prdfBitString::operator=(i_bs); + BitString::operator=(i_bs); ivOffset = i_bs.ivOffset; return *this; } //------------------------------------------------------------------------------------------------- -prdfBitStringOffset & prdfBitStringOffset::operator=(const prdfBitString & i_bs) +BitStringOffset & BitStringOffset::operator=(const BitString & i_bs) { - prdfBitString::operator=(i_bs); + BitString::operator=(i_bs); ivOffset = 0; return *this; } @@ -609,13 +612,13 @@ prdfBitStringOffset & prdfBitStringOffset::operator=(const prdfBitString & i_bs) // // End Function Specification ////////////////////////////////////// -prdfBitStringBuffer operator~(const prdfBitString & bs) +BitStringBuffer operator~(const BitString & bs) { - prdfBitStringBuffer bsb(bs); - for(uint32_t pos = 0; pos < bsb.GetLength(); pos += prdfBitString::WORD_BIT_LENGTH) + BitStringBuffer bsb(bs); + for(uint32_t pos = 0; pos < bsb.GetLength(); pos += BitString::WORD_BIT_LENGTH) { uint32_t len = bsb.GetLength() - pos; - len = std::min(len,(uint32_t)prdfBitString::WORD_BIT_LENGTH); + len = std::min(len,(uint32_t)BitString::WORD_BIT_LENGTH); CPU_WORD value = ~(bsb.GetField(pos,len)); bsb.SetField(pos,len,value); } @@ -625,15 +628,15 @@ prdfBitStringBuffer operator~(const prdfBitString & bs) //------------------------------------------------------------------------------------------------- -prdfBitStringBuffer prdfBitString::operator&(const prdfBitString & bs) const +BitStringBuffer BitString::operator&(const BitString & bs) const { - prdfBitStringBuffer bsb(std::min(this->GetLength(), bs.GetLength())); + BitStringBuffer bsb(std::min(this->GetLength(), bs.GetLength())); for(uint32_t pos = 0; pos < std::min(this->GetLength(), bs.GetLength()); - pos += prdfBitString::WORD_BIT_LENGTH) + pos += BitString::WORD_BIT_LENGTH) { uint32_t len = std::min(this->GetLength(), bs.GetLength()) - pos; - len = std::min(len,(uint32_t)prdfBitStringBuffer::WORD_BIT_LENGTH); + len = std::min(len,(uint32_t)BitStringBuffer::WORD_BIT_LENGTH); CPU_WORD value = this->GetField(pos,len) & bs.GetField(pos,len); bsb.SetField(pos,len,value); } @@ -643,15 +646,15 @@ prdfBitStringBuffer prdfBitString::operator&(const prdfBitString & bs) const //------------------------------------------------------------------------------------------------- -prdfBitStringBuffer prdfBitString::operator|(const prdfBitString & bs) const +BitStringBuffer BitString::operator|(const BitString & bs) const { - prdfBitStringBuffer bsb(std::min(this->GetLength(), bs.GetLength())); + BitStringBuffer bsb(std::min(this->GetLength(), bs.GetLength())); for(uint32_t pos = 0; pos < std::min(this->GetLength(), bs.GetLength()); - pos += prdfBitString::WORD_BIT_LENGTH) + pos += BitString::WORD_BIT_LENGTH) { uint32_t len = std::min(this->GetLength(), bs.GetLength()) - pos; - len = std::min(len,(uint32_t)prdfBitStringBuffer::WORD_BIT_LENGTH); + len = std::min(len,(uint32_t)BitStringBuffer::WORD_BIT_LENGTH); CPU_WORD value = this->GetField(pos,len) | bs.GetField(pos,len); bsb.SetField(pos,len,value); } @@ -661,16 +664,16 @@ prdfBitStringBuffer prdfBitString::operator|(const prdfBitString & bs) const //------------------------------------------------------------------------------------------------- -prdfBitStringBuffer prdfBitString::operator>>(uint32_t count) const +BitStringBuffer BitString::operator>>(uint32_t count) const { - prdfBitStringBuffer l_bsb(this->GetLength()); - prdfBitString * l_bsbp = &l_bsb; // dg03a - stupid trick to get to GetRelativePositionAlloc() + BitStringBuffer l_bsb(this->GetLength()); + BitString * l_bsbp = &l_bsb; // dg03a - stupid trick to get to GetRelativePositionAlloc() // l_bsb.Clear(); if(count < this->GetLength()) { //bso overlays bsb at offset = count uint32_t l_dummy; - prdfBitStringOffset bso(count,l_bsb.GetLength() - count, + BitStringOffset bso(count,l_bsb.GetLength() - count, l_bsbp->GetRelativePositionAlloc(l_dummy,0)); //dg03c bso.SetBits(*this); } @@ -679,14 +682,14 @@ prdfBitStringBuffer prdfBitString::operator>>(uint32_t count) const //------------------------------------------------------------------------------------------------- -prdfBitStringBuffer prdfBitString::operator<<(uint32_t count) const +BitStringBuffer BitString::operator<<(uint32_t count) const { - prdfBitStringBuffer l_bsb(this->GetLength()); + BitStringBuffer l_bsb(this->GetLength()); // l_bsb.Clear(); if(count < this->GetLength()) { // bso overlays *this at offset = count - prdfBitStringOffset bso(count,this->GetLength() - count,this->GetMemoryAddress()); + BitStringOffset bso(count,this->GetLength() - count,this->GetMemoryAddress()); l_bsb.SetBits(bso); } return l_bsb; @@ -694,7 +697,7 @@ prdfBitStringBuffer prdfBitString::operator<<(uint32_t count) const // Function Specification ////////////////////////////////////////// // -// Title: prdfBitStringBuffer (Constructor) +// Title: BitStringBuffer (Constructor) // // Purpose: This constuctor initializes the data members. // @@ -706,13 +709,13 @@ prdfBitStringBuffer prdfBitString::operator<<(uint32_t count) const // // End Function Specification ////////////////////////////////////// -prdfBitStringBuffer::prdfBitStringBuffer +BitStringBuffer::BitStringBuffer ( uint32_t iLen, unsigned int ibc ) : -prdfBitString(iLen, NULL), +BitString(iLen, NULL), ivByteCapacity(ibc) { // SetBuffer(); //dg02d @@ -720,7 +723,7 @@ ivByteCapacity(ibc) // Function Specification /////////////////////////////////////////// // -// Title: prdfBitStringBuffer (Copy constructor) +// Title: BitStringBuffer (Copy constructor) // // Purpose: This constuctor initializes the data members. This copy // constructor uses a "deep" copy. This constructor will @@ -736,9 +739,9 @@ ivByteCapacity(ibc) // // End Function Specification ////////////////////////////////////// -prdfBitStringBuffer::prdfBitStringBuffer(const prdfBitString & string) +BitStringBuffer::BitStringBuffer(const BitString & string) : -prdfBitString(string.GetLength(),NULL), +BitString(string.GetLength(),NULL), ivByteCapacity(0) { if(!string.IsZero()) //dg02a - only allocate if bits are on @@ -749,9 +752,9 @@ ivByteCapacity(0) } // The True copy constructor mk00a -prdfBitStringBuffer::prdfBitStringBuffer(const prdfBitStringBuffer & string) +BitStringBuffer::BitStringBuffer(const BitStringBuffer & string) : -prdfBitString(string.GetLength(),NULL), +BitString(string.GetLength(),NULL), ivByteCapacity(string.ivByteCapacity) { if(!string.IsZero()) //dg02a - only allocate if bits are on @@ -763,7 +766,7 @@ ivByteCapacity(string.ivByteCapacity) // Function Specification /////////////////////////////////////////// // -// Title: ~prdfBitStringBuffer (Virtual Destructor) +// Title: ~BitStringBuffer (Virtual Destructor) // // Purpose: This destructor deallocates the buffer memory. // @@ -773,7 +776,7 @@ ivByteCapacity(string.ivByteCapacity) // // End Function Specification ////////////////////////////////////// -prdfBitStringBuffer::~prdfBitStringBuffer(void) +BitStringBuffer::~BitStringBuffer(void) { delete [] GetMemoryAddress(); } @@ -795,9 +798,9 @@ prdfBitStringBuffer::~prdfBitStringBuffer(void) // // End Function Specification ////////////////////////////////////// -prdfBitStringBuffer & prdfBitStringBuffer::operator= +BitStringBuffer & BitStringBuffer::operator= ( - const prdfBitStringBuffer & string + const BitStringBuffer & string ) { // Check for assignment to self @@ -805,7 +808,7 @@ prdfBitStringBuffer & prdfBitStringBuffer::operator= { delete[] GetMemoryAddress(); // Assign base class part - prdfBitString::operator=(string); + BitString::operator=(string); SetMemoryAddress(NULL); // Assign derived class part @@ -822,12 +825,12 @@ prdfBitStringBuffer & prdfBitStringBuffer::operator= return(*this); } -prdfBitStringBuffer & prdfBitStringBuffer::operator=(const prdfBitString & string) +BitStringBuffer & BitStringBuffer::operator=(const BitString & string) { delete [] GetMemoryAddress(); // Assign base class part - prdfBitString::operator=(string); //copy it to this + BitString::operator=(string); //copy it to this SetMemoryAddress(NULL); // Assign derived class part @@ -857,7 +860,7 @@ prdfBitStringBuffer & prdfBitStringBuffer::operator=(const prdfBitString & strin // // End Function Specification ////////////////////////////////////// -void prdfBitStringBuffer::SetBuffer(void) +void BitStringBuffer::SetBuffer(void) { uint32_t byte_count = GetLength() / (sizeof(CPU_WORD) * 8); @@ -880,7 +883,7 @@ void prdfBitStringBuffer::SetBuffer(void) #ifdef _USE_IOSTREAMS_ std::ostream & operator<<(std::ostream & out, - const prdfBitString & bit_string ) + const BitString & bit_string ) { const uint32_t bit_field_length = sizeof(CPU_WORD) * 8; out << std::hex; @@ -897,3 +900,5 @@ std::ostream & operator<<(std::ostream & out, #endif +} // end namespace PRDF + diff --git a/src/usr/diag/prdf/common/util/prdfBitString.H b/src/usr/diag/prdf/common/util/prdfBitString.H index 4062f0e8a..723c73144 100755 --- a/src/usr/diag/prdf/common/util/prdfBitString.H +++ b/src/usr/diag/prdf/common/util/prdfBitString.H @@ -25,7 +25,7 @@ #define PRDFBITSTRING_H /** @file prdBitString.H - * @brief prdfBitString and prdfBitStringBuffer class declarations + * @brief BitString and BitStringBuffer class declarations */ /*--------------------------------------------------------------------*/ @@ -93,26 +93,30 @@ typedef uint32_t CPU_WORD; //-------------------------------------------------------------------- // Forward References //-------------------------------------------------------------------- -class prdfBitStringBuffer; + +namespace PRDF +{ + +class BitStringBuffer; /*--------------------------------------------------------------------*/ /* Function Prototypes */ /*--------------------------------------------------------------------*/ -//! prdfBitString +//! BitString /*! - prdfBitString is general purpose class providing access to a bit string in memory. + BitString is general purpose class providing access to a bit string in memory. \remarks The Bit String models a contiguous sequence of bits in memory from 0 to n. - In the prdfBitString class the start of the string is aligned with the memory - address provided. The prdfBitStringOffset class allows the starting bit string + In the BitString class the start of the string is aligned with the memory + address provided. The BitStringOffset class allows the starting bit string to occur on any bit in memory. The length of the bit string may be any length up to - the value a uint32_t can hold. ( the prdfBitStringOffset limits the length such that + the value a uint32_t can hold. ( the BitStringOffset limits the length such that the start bit offset + length must not exceed the max value of a uint32_t). - The prdfBitString and prdfBitStringOffset classes do not own the memory storage used to hold + The BitString and BitStringOffset classes do not own the memory storage used to hold the bitstring data, it only accesses and manipulate the bits in the range specified. - The prdfBitStringBuffer is a version of the bits string class that manages its' own storage. + The BitStringBuffer is a version of the bits string class that manages its' own storage. Operations are performed on the Bit String using either a single bit or a field. The CPU_WORD type is used internally to reference memory @@ -168,7 +172,7 @@ class prdfBitStringBuffer; of memory that contains the bits and the representation of length (16-bits). */ -class prdfBitString +class BitString { public: @@ -179,7 +183,7 @@ public: \pre None. \post None. */ - prdfBitString(uint32_t i_length, CPU_WORD * i_address) + BitString(uint32_t i_length, CPU_WORD * i_address) : ivLength(i_length), ivBuffer(i_address) @@ -191,13 +195,13 @@ public: \notes This destructor does nothing. It is requred for proper desctruction of derived classes. */ - virtual ~prdfBitString(void); + virtual ~BitString(void); /*! Comparison \remarks The bitstrings must be the same length and have the same bits set to be equal */ - int operator==(const prdfBitString & string) const + int operator==(const BitString & string) const { return(IsEqual(string)); } @@ -281,7 +285,7 @@ public: if source len < this len than extra bits in this are uneffected Bit strings may specify overlapping memory */ - void SetBits(const prdfBitString & string); + void SetBits(const BitString & string); /*! Set bits in this string based on provided string @@ -294,7 +298,7 @@ public: given than space in this string than the extra source bit are ignored. Bit strings may specify overlapping memory. */ - void SetBits(const prdfBitString & string, + void SetBits(const BitString & string, unsigned int pos, unsigned int len, unsigned int dpos = 0); @@ -370,7 +374,7 @@ public: \returns [true | false] \notes Both strings must be of equal length and have same values to be equal */ - bool IsEqual( const prdfBitString & string) const; + bool IsEqual( const BitString & string) const; /*! Query state of no bits set(1) @@ -400,7 +404,7 @@ public: \endverbatim */ - void Mask(const prdfBitString & string); + void Mask(const BitString & string); /*! Utility to Right justify a "Left-justified" value @@ -425,9 +429,9 @@ public: \returns a bit-wise inverted copy of the specified bit string */ - friend prdfBitStringBuffer operator~(const prdfBitString & bs); - prdfBitStringBuffer operator&(const prdfBitString & bs) const; - prdfBitStringBuffer operator|(const prdfBitString & bs) const; + friend BitStringBuffer operator~(const BitString & bs); + BitStringBuffer operator&(const BitString & bs) const; + BitStringBuffer operator|(const BitString & bs) const; /*! Left shift @@ -449,7 +453,7 @@ public: \endverbatim */ - prdfBitStringBuffer operator>>(uint32_t count) const; + BitStringBuffer operator>>(uint32_t count) const; /*! Right shift @@ -470,7 +474,7 @@ public: \endverbatim */ - prdfBitStringBuffer operator<<(uint32_t count) const; + BitStringBuffer operator<<(uint32_t count) const; protected: @@ -479,7 +483,7 @@ protected: Assignment operator \param string Reference bit string */ - virtual prdfBitString & operator=(const prdfBitString & string); + virtual BitString & operator=(const BitString & string); /*! Gets the CPU_WORD bounded memory address and the relative bit offset within the CPU_WORD @@ -526,9 +530,9 @@ private: }; -//! prdfBitStringBuffer +//! BitStringBuffer /*! - prdfBitStringBuffer provides a Bit String in an associated buffer in memory. + BitStringBuffer provides a Bit String in an associated buffer in memory. \remarks The Bit String Buffer provides all of the functionality of the base class along with the maintenance of memory @@ -540,7 +544,7 @@ private: necessary for the assignment. A byte capacity value is also maintained. The internal buffer is always guaranteed to have this capacity of bytes. */ -class prdfBitStringBuffer : public prdfBitString +class BitStringBuffer : public BitString { public: @@ -551,37 +555,37 @@ public: \notes If iByteCapcity is zero or too small than the storage size is calculated from iLen, rounded up to the nearest CPU_WORD. */ - prdfBitStringBuffer(uint32_t iLen, + BitStringBuffer(uint32_t iLen, unsigned int iByteCapacity = 0); /*! Copy Constructor \param reference bits string */ - prdfBitStringBuffer(const prdfBitString & string); + BitStringBuffer(const BitString & string); /*! Copy Constructor \param reference bits string */ - prdfBitStringBuffer (const prdfBitStringBuffer & string); + BitStringBuffer (const BitStringBuffer & string); /*! Destructor */ - virtual ~prdfBitStringBuffer(void); + virtual ~BitStringBuffer(void); /*! Assignment \param reference bit string */ - prdfBitStringBuffer & operator=(const prdfBitStringBuffer & string); + BitStringBuffer & operator=(const BitStringBuffer & string); /*! Assignment \param reference bit string */ - virtual prdfBitStringBuffer & operator=(const prdfBitString & string); + virtual BitStringBuffer & operator=(const BitString & string); protected: // functions dg02a @@ -600,16 +604,16 @@ private: // data }; -//! prdfBitStringOffset +//! BitStringOffset /*! - prdfBitStringOffset provides a Bit String that allows a starting position that + BitStringOffset provides a Bit String that allows a starting position that is not limited to a memory alligned boundary. \remarks The Bit String Offset provides the ability to specify a start bit offset from the address provided as the start position of the bit string. The class will not modify memory outside the bit string range. */ -class prdfBitStringOffset:public prdfBitString +class BitStringOffset:public BitString { public: /*! @@ -618,28 +622,28 @@ public: \param i_len The number of bits in the bitstring \param i_address The memory address to base the bitstring on */ - prdfBitStringOffset(uint32_t i_offset, uint32_t i_len, CPU_WORD * i_address) - : prdfBitString(i_len,i_address), ivOffset(i_offset) {} + BitStringOffset(uint32_t i_offset, uint32_t i_len, CPU_WORD * i_address) + : BitString(i_len,i_address), ivOffset(i_offset) {} /*! Destructor - this class does not own it's storage */ - virtual ~prdfBitStringOffset(void); + virtual ~BitStringOffset(void); /*! Copy Constructor */ - prdfBitStringOffset(const prdfBitStringOffset &i_bs); + BitStringOffset(const BitStringOffset &i_bs); /*! Assignment */ - prdfBitStringOffset & operator=(const prdfBitStringOffset & i_bs); + BitStringOffset & operator=(const BitStringOffset & i_bs); /*! Assignment */ - virtual prdfBitStringOffset & operator=(const prdfBitString & i_bs); + virtual BitStringOffset & operator=(const BitString & i_bs); protected: // functions @@ -667,7 +671,7 @@ private: // data std::ostream & operator<<( std::ostream & out, - const prdfBitString & bit_string); + const BitString & bit_string); #endif @@ -692,7 +696,7 @@ std::ostream & operator<<( std::ostream & out, // End Function Specification ////////////////////////////////////// inline -CPU_WORD prdfBitString::RIGHT_SHIFT +CPU_WORD BitString::RIGHT_SHIFT ( uint32_t l, /*!i Length of bit field */ @@ -723,7 +727,7 @@ CPU_WORD prdfBitString::RIGHT_SHIFT // End Function Specification ////////////////////////////////////// inline -CPU_WORD prdfBitString::LEFT_SHIFT +CPU_WORD BitString::LEFT_SHIFT ( uint32_t l, CPU_WORD value @@ -733,9 +737,9 @@ CPU_WORD prdfBitString::LEFT_SHIFT } inline -prdfBitString & prdfBitString::operator= +BitString & BitString::operator= ( - const prdfBitString & string + const BitString & string ) { ivLength = string.ivLength; @@ -744,9 +748,9 @@ prdfBitString & prdfBitString::operator= } inline -CPU_WORD * prdfBitString::GetRelativePositionAlloc(uint32_t & oBitOffset, uint32_t iBitPos) +CPU_WORD * BitString::GetRelativePositionAlloc(uint32_t & oBitOffset, uint32_t iBitPos) { - return prdfBitString::GetRelativePosition(oBitOffset,iBitPos); + return BitString::GetRelativePosition(oBitOffset,iBitPos); } // Function Specification ////////////////////////////////////////// @@ -769,28 +773,29 @@ CPU_WORD * prdfBitString::GetRelativePositionAlloc(uint32_t & oBitOffset, uint32 // End Function Specification ////////////////////////////////////// inline -void prdfBitString::Pattern(CPU_WORD pattern,uint32_t pattern_bit_length) +void BitString::Pattern(CPU_WORD pattern,uint32_t pattern_bit_length) { Pattern(0, GetLength(), pattern, pattern_bit_length); } inline -void prdfBitString::Pattern(CPU_WORD pattern) +void BitString::Pattern(CPU_WORD pattern) { Pattern(0, GetLength(), pattern, sizeof(CPU_WORD)); } -inline uint32_t prdfBitString::GetSetCount(void) const +inline uint32_t BitString::GetSetCount(void) const { return(GetSetCount(0, GetLength())); } -inline void prdfBitString::SetBits(const prdfBitString & string) +inline void BitString::SetBits(const BitString & string) { SetBits(string, 0, string.GetLength()); } +} // end namespace PRDF #endif diff --git a/src/usr/diag/prdf/common/util/prdfErrlSmartPtr.C b/src/usr/diag/prdf/common/util/prdfErrlSmartPtr.C index 8a6e74cff..050dcc7f5 100755 --- a/src/usr/diag/prdf/common/util/prdfErrlSmartPtr.C +++ b/src/usr/diag/prdf/common/util/prdfErrlSmartPtr.C @@ -24,24 +24,28 @@ #include <prdfErrlSmartPtr.H> #include <iipglobl.h> +namespace PRDF +{ + /* void add_src() * Add special SRC to error log specifying commited from smart * pointer. */ -void PrdfErrlSmartPtr::add_src() +void ErrlSmartPtr::add_src() { if (iv_errl) { - PRDF_ADD_SW_ERR(iv_errl, 0, PRDF_ERRLSMARTPTR, __LINE__); - PRDF_ADD_PROCEDURE_CALLOUT(iv_errl, SRCI_PRIORITY_MED, EPUB_PRC_SP_CODE); + PRDF_ADD_SW_ERR( iv_errl, 0, PRDF_ERRLSMARTPTR, __LINE__ ); + PRDF_ADD_PROCEDURE_CALLOUT( iv_errl, SRCI_PRIORITY_MED, + EPUB_PRC_SP_CODE ); } -}; +} /* void commit_errl() * Commit error log and delete. */ -void PrdfErrlSmartPtr::commit_errl() +void ErrlSmartPtr::commit_errl() { if (iv_errl) { @@ -49,5 +53,7 @@ void PrdfErrlSmartPtr::commit_errl() PRDF_COMMIT_ERRL(iv_errl, ERRL_ACTION_REPORT); } -}; +} + +} // end namespace PRDF diff --git a/src/usr/diag/prdf/common/util/prdfErrlSmartPtr.H b/src/usr/diag/prdf/common/util/prdfErrlSmartPtr.H index 51782117c..fb847e845 100755 --- a/src/usr/diag/prdf/common/util/prdfErrlSmartPtr.H +++ b/src/usr/diag/prdf/common/util/prdfErrlSmartPtr.H @@ -27,28 +27,30 @@ #include <errlentry.H> #include <prdf_service_codes.H> +namespace PRDF +{ /** - * @class PrdfErrlSmartPtr + * @class ErrlSmartPtr * This is a smart pointer class for errlHndl_t objects, especially for * the g_prd_errl variable. Currently, programmers can accidentially * overwrite g_prd_errl and we leak a error log. This class will keep * track of the error logs and commit/delete it if it goes out of context. */ -class PrdfErrlSmartPtr +class ErrlSmartPtr { public: class INVALID_TYPE_CONVERSION___SEE_COMMENTS_FOR_RELEASE_FUNCTION {}; /* ctor - Initialize ptr to NULL */ - PrdfErrlSmartPtr() : iv_errl(NULL) {}; + ErrlSmartPtr() : iv_errl(NULL) {}; /* dtor - Commit remaining error log */ - ~PrdfErrlSmartPtr() { commit_errl(); }; + ~ErrlSmartPtr() { commit_errl(); }; /* operator = * Someone attempted to overwrite the error log, commit if needed. */ - PrdfErrlSmartPtr & operator=(errlHndl_t i_errl) + ErrlSmartPtr & operator=(errlHndl_t i_errl) { this->commit_errl(); iv_errl = i_errl; @@ -100,7 +102,7 @@ class PrdfErrlSmartPtr * if (NULL == errl) */ friend bool operator==(const errlHndl_t i_errl, - const PrdfErrlSmartPtr & i_smrtptr) + const ErrlSmartPtr & i_smrtptr) { return i_smrtptr == i_errl; }; @@ -110,7 +112,7 @@ class PrdfErrlSmartPtr * if (NULL =! errl) */ friend bool operator!=(const errlHndl_t i_errl, - const PrdfErrlSmartPtr & i_smrtptr) + const ErrlSmartPtr & i_smrtptr) { return i_smrtptr != i_errl; }; @@ -164,4 +166,6 @@ class PrdfErrlSmartPtr }; +} // end namespace PRDF + #endif diff --git a/src/usr/diag/prdf/common/util/prdfErrorSignature.H b/src/usr/diag/prdf/common/util/prdfErrorSignature.H index a0bf1bb19..2fb2cc877 100755 --- a/src/usr/diag/prdf/common/util/prdfErrorSignature.H +++ b/src/usr/diag/prdf/common/util/prdfErrorSignature.H @@ -31,8 +31,8 @@ #include <iipconst.h> #include <prdfTrace.H> -// FIXME - Should this class be scoped in PRDF namspace? - +namespace PRDF +{ /** @class ErrorSignature * * A complete error signature is a 64-bit number where: @@ -170,6 +170,6 @@ class ErrorSignature uint16_t iv_regId; ///< 16-bit register ID uint16_t iv_errCode; ///< 16-bit error code }; - +} //End namespace PRDF #endif diff --git a/src/usr/diag/prdf/common/util/prdfFilters.C b/src/usr/diag/prdf/common/util/prdfFilters.C index ae5b294e7..aa8c55c8e 100755 --- a/src/usr/diag/prdf/common/util/prdfFilters.C +++ b/src/usr/diag/prdf/common/util/prdfFilters.C @@ -39,6 +39,9 @@ //#include <xspprdFilterLink.h> #undef iipFilters_C + +namespace PRDF +{ //---------------------------------------------------------------------- // User Types //---------------------------------------------------------------------- @@ -63,12 +66,12 @@ // Member Function Specifications //---------------------------------------------------------------------- -prdfFilter::~prdfFilter(void) +FilterClass::~FilterClass(void) {} //------------------------------------------------------------------------------------------------- -bool prdfFilterPriority::Apply(prdfBitKey & ioBitList) +bool FilterPriority::Apply(BitKey & ioBitList) { bool modified = false; if(ioBitList.isSubset(ivBitKey)) @@ -82,7 +85,7 @@ bool prdfFilterPriority::Apply(prdfBitKey & ioBitList) //------------------------------------------------------------------------------------------------- -bool SingleBitFilter::Apply(prdfBitKey & bit_list) +bool SingleBitFilter::Apply(BitKey & bit_list) { bool rc = false; uint32_t list_length = bit_list.size(); @@ -100,14 +103,14 @@ bool SingleBitFilter::Apply(prdfBitKey & bit_list) //------------------------------------------------------------------------------------------------- -bool PrioritySingleBitFilter::Apply(prdfBitKey & bit_list) +bool PrioritySingleBitFilter::Apply(BitKey & bit_list) { bool l_modified = false; // Do priority bit. for (size_t i = 0; i < iv_bitList.size(); i++) { - prdfBitKey l_key = iv_bitList[i]; + BitKey l_key = iv_bitList[i]; if (bit_list.isSubset(l_key)) { l_modified = true; @@ -129,22 +132,22 @@ bool PrioritySingleBitFilter::Apply(prdfBitKey & bit_list) //------------------------------------------------------------------------------------------------- -bool prdfFilterTranspose::Apply(prdfBitKey & iBitList) +bool FilterTranspose::Apply(BitKey & iBitList) { bool result = false; if(iBitList == ivBitKey) { - prdfBitKey bk(ivSingleBitPos); + BitKey bk(ivSingleBitPos); iBitList = bk; result = true; } return result; } -bool prdfFilterTranspose::Undo(prdfBitKey & iBitList) +bool FilterTranspose::Undo(BitKey & iBitList) { bool result = false; - prdfBitKey testbl(ivSingleBitPos); + BitKey testbl(ivSingleBitPos); if(iBitList.isSubset(testbl)) { iBitList = ivBitKey; @@ -156,14 +159,14 @@ bool prdfFilterTranspose::Undo(prdfBitKey & iBitList) //------------------------------------------------------------------------------------------------- -bool FilterLink::Apply(prdfBitKey & bit_list) +bool FilterLink::Apply(BitKey & bit_list) { bool rc = xFilter1.Apply(bit_list); rc = rc || xFilter2.Apply(bit_list); return rc; } -bool FilterLink::Undo(prdfBitKey & bit_list) +bool FilterLink::Undo(BitKey & bit_list) { bool rc = xFilter1.Undo(bit_list); rc = rc || xFilter2.Undo(bit_list); @@ -172,14 +175,14 @@ bool FilterLink::Undo(prdfBitKey & bit_list) //------------------------------------------------------------------------------------------------- -bool ScanCommFilter::Apply(prdfBitKey & bitList) +bool ScanCommFilter::Apply(BitKey & bitList) { // Read HW register scr.Read(); // local copy of bit string from scan comm register BIT_STRING_BUFFER_CLASS bsb(*scr.GetBitString()); - prdfBitKey bl; + BitKey bl; bool rc = false; // Invert if necessary @@ -199,6 +202,7 @@ bool ScanCommFilter::Apply(prdfBitKey & bitList) return(rc); } +} //End namespace PRDF // Change Log ************************************************************************************* // @@ -210,8 +214,8 @@ bool ScanCommFilter::Apply(prdfBitKey & bitList) // mk01 P4904712 v4r5 10/21/99 mkobler really fix PrioritySingleBitFilter // 490420.x v5r2 07/06/00 mkobler Add ScanCommFilter // 490420.x v5r2 07/06/00 dgilbert added FilterLink -// fips 03/19/04 dgilbert rename to prdfFilters.C;rewrote PrioritySingleBitFilter -// changed to use prdfBitKey +// fips 03/19/04 dgilbert rename to Filters.C;rewrote PrioritySingleBitFilter +// changed to use BitKey // 558003 fips310 06/21/06 dgilbert Add Undo() // 582595 fips310 12/12/06 iawillia Update priority sb filter to maintain bit order. // diff --git a/src/usr/diag/prdf/common/util/prdfFilters.H b/src/usr/diag/prdf/common/util/prdfFilters.H index 3fd5da02d..4e2fe7cca 100755 --- a/src/usr/diag/prdf/common/util/prdfFilters.H +++ b/src/usr/diag/prdf/common/util/prdfFilters.H @@ -25,8 +25,8 @@ #define PRDFFILTER_H /** - @file prdfFilter.H - @brief FILTER_CLASSes selectivly remove bits from a prdfBitKey type object + @file Filter.H + @brief FILTER_CLASSes selectivly remove bits from a BitKey type object */ /*--------------------------------------------------------------------*/ @@ -39,22 +39,24 @@ #include <vector> +namespace PRDF +{ /*--------------------------------------------------------------------*/ /* Forward References */ /*--------------------------------------------------------------------*/ -class prdfBitKey; +class BitKey; /*--------------------------------------------------------------------*/ /* User Types */ /*--------------------------------------------------------------------*/ /** - prdfFilter Specifies and interface for removing unwanted bits from a prdfBitKey. + FilterClass Specifies and interface for removing unwanted bits from a BitKey. Abstract base class - @see prdfBitKey + @see BitKey */ -class prdfFilter +class FilterClass { public: @@ -62,15 +64,15 @@ public: /** Destructor. This implementation does nothing */ - virtual ~prdfFilter(void); + virtual ~FilterClass(void); /** - Apply filter to the prdfBitKey. + Apply filter to the BitKey. @post bit_list may be modified @return true if bit_list was modified, otherwise false */ - virtual bool Apply(prdfBitKey & io_bit_list) = 0; + virtual bool Apply(BitKey & io_bit_list) = 0; /** * Undo the filter effect (if possible) @@ -81,7 +83,7 @@ public: * to reset the error register (eg. moves a bit to a new postition) than the Undo() function * should put the bit_list back into a state that can be used to reset an error register. */ - virtual bool Undo(prdfBitKey & io_bit_list) { return false; } + virtual bool Undo(BitKey & io_bit_list) { return false; } protected: @@ -90,13 +92,13 @@ protected: @note The default compiler generated copy constructor and assignment operator are adaquate. */ - prdfFilter(void) {} + FilterClass(void) {} }; -//! prdfFilterPriority +//! FilterPriority /*! - prdfFilterPriority maintains a "subset" BitKey or a "priority" set of bits. + FilterPriority maintains a "subset" BitKey or a "priority" set of bits. When this filter is applied to a BitKey, If the "priority" BitKey is a subset of the BitKey than the BitKey becomes the priorty BitKey. (The non-priority bits are turned off); Otherwise the BitKey remains unchanged. @@ -120,7 +122,7 @@ protected: Filtered BitKey: ("2", "7") \endverbatim */ -class prdfFilterPriority : public prdfFilter +class FilterPriority : public FilterClass { public: @@ -128,7 +130,7 @@ public: Constructor \param i_bld ptr bit list string encoding */ - prdfFilterPriority(const char * i_ble) + FilterPriority(const char * i_ble) : ivBitKey(i_ble) {} @@ -137,7 +139,7 @@ public: Constructor \param iBitList BitKey */ - prdfFilterPriority(const prdfBitKey & iBitList) + FilterPriority(const BitKey & iBitList) : ivBitKey(iBitList) {} @@ -146,18 +148,18 @@ public: \param ioBitList to apply filter to \returns true if iBitList modified otherwise false */ - virtual bool Apply(prdfBitKey & ioBitList); + virtual bool Apply(BitKey & ioBitList); protected: - prdfBitKey ivBitKey; + BitKey ivBitKey; }; //! PrioritySingleBitFilter /*! - PrioritySingleBitFilter removes all but one bit from a prdfBitKey object. + PrioritySingleBitFilter removes all but one bit from a BitKey object. Priority (to not be removed) is given to the bits specified and in the order specified. @par Example @@ -177,14 +179,14 @@ protected: // and finally any remaining bits @endcode @par functionality - - if no priority bits exist in prdfBitKey object then + - if no priority bits exist in BitKey object then - eliminate all but first entry in list - else if priority bits exist then - eliminate all non-priority bit entries - if multiple priority bit entries exist then elminate all but one, favoring the first qualified entry found in the list. */ -class PrioritySingleBitFilter : public prdfFilter +class PrioritySingleBitFilter : public FilterClass { public: @@ -222,7 +224,7 @@ public: @return true of bit list was modified otherwise false @note If the bit list is empty then it will be left empty. */ - virtual bool Apply(prdfBitKey & bit_list); + virtual bool Apply(BitKey & bit_list); private: // functions private: // Data @@ -231,12 +233,12 @@ private: // Data }; -//! prdfFilterTranspose +//! FilterTranspose /*! - prdfFilterTranspose transposes an exactly matching key to a single bit. If there is not an + FilterTranspose transposes an exactly matching key to a single bit. If there is not an exact match, the key is not modified. */ -class prdfFilterTranspose : public prdfFilterPriority +class FilterTranspose : public FilterPriority { public: @@ -245,8 +247,8 @@ public: \param i_bitKey bit list key \param iBitPos bit to set if i_bitKey matches target. */ - prdfFilterTranspose(const prdfBitKey &i_bitKey,uint32_t iBitPos) - : prdfFilterPriority(i_bitKey),ivSingleBitPos(iBitPos) + FilterTranspose(const BitKey &i_bitKey,uint32_t iBitPos) + : FilterPriority(i_bitKey),ivSingleBitPos(iBitPos) {} /** @@ -257,7 +259,7 @@ public: bitlist is modified such that all bits are cleared and ivSingleBitPos is set. \return true of bit list was modified otherwise false */ - virtual bool Apply(prdfBitKey & iBitList); + virtual bool Apply(BitKey & iBitList); /** * Undo the filter Apply() @@ -265,7 +267,7 @@ public: * @Return true if bit_list was modified, otherwise false * @Note This function will only Undo the transposition if the transposed result bit is on */ - virtual bool Undo(prdfBitKey & iBitList); + virtual bool Undo(BitKey & iBitList); private: // functions private: // Data @@ -290,20 +292,20 @@ private: // Data // ereg will apply filter before analyzing the error \endcode */ -class SingleBitFilter: public prdfFilter +class SingleBitFilter: public FilterClass { public: /*! Constructor */ - SingleBitFilter(): prdfFilter() {} + SingleBitFilter(): FilterClass() {} /*! Remove all but one bit from bit_list \param ioBitList Target bit list \returns true if ioBitList was modified otherwise false */ - virtual bool Apply(prdfBitKey & ioBitList); + virtual bool Apply(BitKey & ioBitList); private: // functions private: // Data @@ -314,30 +316,30 @@ private: // Data //! FilterLink /*! FilterLink links two FILTER_CLASS types together allowing two filters - to act on a single prdfBitKey object. + to act on a single BitKey object. @code - prdfFilter * foo(prdfFilter & f1, prdfFilter & f2) + Filter * foo(Filter & f1, Filter & f2) { - prdfFilter * joint = new FilterLink(f1,f2); + Filter * joint = new FilterLink(f1,f2); return joint; } @endcode */ -class FilterLink: public prdfFilter +class FilterLink: public FilterClass { public: /** Constructor <ul> - <br><b>Parameters: </b> Two Filters to be linked + <br><b>Parameters: </b> Two FilterClasss to be linked <br><b>Requirements:</b> parm filters objects must exist and be valid <br><b>Promises: </b> Object created <br><b>Exceptions: </b> N/A <br><b>Notes: </b> </ul><br> */ - FilterLink(prdfFilter & f1, prdfFilter & f2); + FilterLink(FilterClass & f1, FilterClass & f2); /* Destructor @@ -363,21 +365,21 @@ public: <br><b>Notes: </b> calls all the other associated filters </ul><br> */ - virtual bool Apply ( prdfBitKey & bit_list ); + virtual bool Apply ( BitKey & bit_list ); /** * Undo the filter Apply() * @post bit_list may be modified * @Return true if bit_list was modified, otherwise false */ - virtual bool Undo(prdfBitKey & iBitList); + virtual bool Undo(BitKey & iBitList); private: // functions private: // Data // may be extended to use a vector if needed - prdfFilter & xFilter1; - prdfFilter & xFilter2; + FilterClass & xFilter1; + FilterClass & xFilter2; }; @@ -386,8 +388,8 @@ class SCAN_COMM_REGISTER_CLASS; //! ScanCommFilter /*! ScanCommFilter reads a HW scom register to determin which bits to - removes bits from a prdfBitKey object - @par Base class prdfFilter + removes bits from a BitKey object + @par Base class Filter @code // This class is useful for Error registers whose bits can be // configured to report different ways depending on another @@ -405,7 +407,7 @@ class SCAN_COMM_REGISTER_CLASS; // ereg will apply filter @endcode */ -class ScanCommFilter: public prdfFilter +class ScanCommFilter: public FilterClass { public: @@ -422,7 +424,7 @@ public: */ ScanCommFilter(SCAN_COMM_REGISTER_CLASS & i_r, InvertValue invert = NONINVERT) : - prdfFilter(), + FilterClass(), scr(i_r), xInvert(invert) { } @@ -432,7 +434,7 @@ public: @post bit_list may be modified @return true if bit_list was modified, otherwise false */ - virtual bool Apply(prdfBitKey & bit_list); + virtual bool Apply(BitKey & bit_list); private: // functions private: // Data @@ -441,19 +443,10 @@ private: // Data }; -inline FilterLink::FilterLink(prdfFilter & f1, prdfFilter & f2) +inline FilterLink::FilterLink(FilterClass & f1, FilterClass & f2) : xFilter1(f1), xFilter2(f2) {} +} //End namespace PRDF #endif -// Change Log ************************************************************************************* -// -// Flag Reason Vers Date Coder Description -// ---- -------- ------- -------- -------- ------------------------------------------------------- -// V400 09/12/94 JST Initial Creation -// fips 03/19/04 dgilbert Rename to prdfFilter.H added doxygen comments -// 558003 fips310 06/21/06 dgilbert Add Undo() to filter -// 582595 fips310 12/12/06 iawillia Update priority sb filter to maintain bit order. -// End Change Log ******************************************************************************** - diff --git a/src/usr/diag/prdf/common/util/prdfFlyWeight.C b/src/usr/diag/prdf/common/util/prdfFlyWeight.C index 1df6f46f5..364e2e7db 100755 --- a/src/usr/diag/prdf/common/util/prdfFlyWeight.C +++ b/src/usr/diag/prdf/common/util/prdfFlyWeight.C @@ -57,7 +57,8 @@ //---------------------------------------------------------------------- // Global Variables //---------------------------------------------------------------------- - +namespace PRDF +{ //--------------------------------------------------------------------- // Member Function Specifications //--------------------------------------------------------------------- @@ -135,17 +136,20 @@ T & FlyWeight<T,S>::get(const T & key) } return *result; } - +} //End namespace PRDF #if defined(ESW_SIM_COMPILE) #include <iostream> #include <iomanip> //FlyWeightBase::FlyWeightList FlyWeightBase::cv_fwlist; //mp01d - +namespace PRDF +{ template < class T , uint32_t S > void FlyWeight<T,S>::printStats(void) { using namespace std; cout << "FlyWeight Memory allowcated = " << (iv_heap.size() * sizeof(T) * RoundBucketSize<T,S>::value) << endl; } +} //End namespace PRDF #endif + diff --git a/src/usr/diag/prdf/common/util/prdfFlyWeight.H b/src/usr/diag/prdf/common/util/prdfFlyWeight.H index ec9eae1a6..64573dda2 100755 --- a/src/usr/diag/prdf/common/util/prdfFlyWeight.H +++ b/src/usr/diag/prdf/common/util/prdfFlyWeight.H @@ -41,7 +41,8 @@ //-------------------------------------------------------------------- // // - +namespace PRDF +{ #if defined(ESW_SIM_COMPILE) class FlyWeightBase { @@ -125,7 +126,7 @@ private: // Data T * iv_nextOpen; }; - +} //End namespace PRDF #endif /* PRDFFLYWEIGHT_H */ // Change Log ***************************************************************** diff --git a/src/usr/diag/prdf/common/util/prdfFlyWeightS.C b/src/usr/diag/prdf/common/util/prdfFlyWeightS.C index 76e001d25..d1ef67050 100755 --- a/src/usr/diag/prdf/common/util/prdfFlyWeightS.C +++ b/src/usr/diag/prdf/common/util/prdfFlyWeightS.C @@ -25,6 +25,8 @@ #include <algorithm> #include <prdfHeapBucketSize.H> +namespace PRDF +{ //--------------------------------------------------------------------- // Member Function Specifications //--------------------------------------------------------------------- @@ -304,3 +306,4 @@ void FlyWeightS<T,S>::print() } */ +} //End namespace PRDF diff --git a/src/usr/diag/prdf/common/util/prdfFlyWeightS.H b/src/usr/diag/prdf/common/util/prdfFlyWeightS.H index 3a571e95d..f6949cadf 100755 --- a/src/usr/diag/prdf/common/util/prdfFlyWeightS.H +++ b/src/usr/diag/prdf/common/util/prdfFlyWeightS.H @@ -27,6 +27,8 @@ #include <stdint.h> #include <vector> +namespace PRDF +{ template<class T, uint32_t S> class FlyWeightS { @@ -71,5 +73,5 @@ class FlyWeightS void increaseSize(); }; - +} //End namespace PRDF #endif diff --git a/src/usr/diag/prdf/common/util/prdfHeapBucketSize.H b/src/usr/diag/prdf/common/util/prdfHeapBucketSize.H index cd66d0f72..4073b67ba 100755 --- a/src/usr/diag/prdf/common/util/prdfHeapBucketSize.H +++ b/src/usr/diag/prdf/common/util/prdfHeapBucketSize.H @@ -24,7 +24,8 @@ #ifndef PRDFHEAPBUCKETSIZE_H #define PRDFHEAPBUCKETSIZE_H - +namespace PRDF +{ //-------------------------------------------------------------------- // Includes //-------------------------------------------------------------------- @@ -77,5 +78,5 @@ struct RoundBucketSize }; #endif - +} //End namespace PRDF #endif // define PRDFHEAPBUCKETSIZE_H diff --git a/src/usr/diag/prdf/common/util/prdfRegisterData.C b/src/usr/diag/prdf/common/util/prdfRegisterData.C index 04aaa6208..e33ba1340 100755 --- a/src/usr/diag/prdf/common/util/prdfRegisterData.C +++ b/src/usr/diag/prdf/common/util/prdfRegisterData.C @@ -23,15 +23,17 @@ #include <prdfRegisterData.H> -PrdrRegIdTable & prdfGetRegisterIdTable() +namespace PRDF +{ +PrdrRegIdTable & GetRegisterIdTable() { static PrdrRegIdTable l_idTable = PrdrRegIdTable(); return l_idTable; } -PrdrErrSigTable & prdfGetErrorSigTable() +PrdrErrSigTable & GetErrorSigTable() { static PrdrErrSigTable l_sigTable = PrdrErrSigTable(); return l_sigTable; } - +} //End namespace PRDF diff --git a/src/usr/diag/prdf/common/util/prdfRegisterData.H b/src/usr/diag/prdf/common/util/prdfRegisterData.H index 80f073384..4322f5b19 100755 --- a/src/usr/diag/prdf/common/util/prdfRegisterData.H +++ b/src/usr/diag/prdf/common/util/prdfRegisterData.H @@ -24,6 +24,12 @@ #ifndef __PRDRERRLPLUGINSUPT_H #define __PRDRERRLPLUGINSUPT_H +#include <map> +#include <stdint.h> + +namespace PRDF +{ + #define __PRDR_PLUGIN_HOMTYPE uint32_t #define __PRDR_PLUGIN_IDTYPE uint32_t @@ -56,9 +62,9 @@ __table_struct * l_tablePtr = cv_table; \ while (NULL != l_tablePtr->name) \ { \ - prdfGetRegisterIdTable()[l_homtype][l_tablePtr->id].name = \ + GetRegisterIdTable()[l_homtype][l_tablePtr->id].name = \ l_tablePtr->name; \ - prdfGetRegisterIdTable()[l_homtype][l_tablePtr->id].addr = \ + GetRegisterIdTable()[l_homtype][l_tablePtr->id].addr = \ l_tablePtr->address; \ l_tablePtr++; \ } \ @@ -77,21 +83,20 @@ }; #endif -#include <map> -#include <stdint.h> - typedef std::map<__PRDR_PLUGIN_IDTYPE, const char *> PrdrErrSigEntries; typedef std::map<__PRDR_PLUGIN_HOMTYPE, PrdrErrSigEntries> PrdrErrSigTable; -struct PrdrRegIdStruct +struct RegIdStruct { const char * name; uint32_t addr; }; -typedef std::map<__PRDR_PLUGIN_IDTYPE, PrdrRegIdStruct> PrdrRegIdEntries; +typedef std::map<__PRDR_PLUGIN_IDTYPE, RegIdStruct> PrdrRegIdEntries; typedef std::map<__PRDR_PLUGIN_HOMTYPE, PrdrRegIdEntries> PrdrRegIdTable; -PrdrRegIdTable & prdfGetRegisterIdTable(); +PrdrRegIdTable & GetRegisterIdTable(); + +} // end namespace PRDF #endif diff --git a/src/usr/diag/prdf/common/util/prdfTimer.H b/src/usr/diag/prdf/common/util/prdfTimer.H index 30b369e7f..9ed4daff8 100755 --- a/src/usr/diag/prdf/common/util/prdfTimer.H +++ b/src/usr/diag/prdf/common/util/prdfTimer.H @@ -47,18 +47,19 @@ #endif - +namespace PRDF +{ //-------------------------------------------------------------------- // Forward References //-------------------------------------------------------------------- /** - PrdTimer + Timer @author Doug Gilbert - @par A PrdTimer holds the number of seconds since the beginning + @par A Timer holds the number of seconds since the beginning of the year */ -class PrdTimer +class Timer { public: enum @@ -93,7 +94,7 @@ public: /** Default Constructor */ - PrdTimer() :xSec(0),ivTm() + Timer() :xSec(0),ivTm() { } @@ -104,7 +105,7 @@ public: @note If seconds > seconds_in_year then reduced by seconds_in_year until seconds < seconds_in_year */ - PrdTimer(unsigned int seconds) + Timer(unsigned int seconds) : xSec(seconds % YEAR) {} #if !defined(__GNUC__) @@ -112,7 +113,7 @@ public: Constructor from a BIN_TIME_TYPE @see xsptodtypes.h */ - PrdTimer(const BIN_TIME_TYPE & b) + Timer(const BIN_TIME_TYPE & b) :xSec( b.seconds + (b.minutes * 60) + (b.hours * 3600) + @@ -126,12 +127,12 @@ public: /** Copy Constructor */ - PrdTimer(const PrdTimer & t) : xSec(t.xSec), ivTm(t.ivTm) {} + Timer(const Timer & t) : xSec(t.xSec), ivTm(t.ivTm) {} /** Assignment from another PrdTime object */ - const PrdTimer & operator=(const PrdTimer & t) + const Timer & operator=(const Timer & t) { xSec = t.xSec; ivTm = t.ivTm; return *this; } #if !defined(__GNUC__) @@ -139,7 +140,7 @@ public: Assignment from a BIN_TIME_TYPE. @see xsptodtypes.h */ - const PrdTimer & operator=(const BIN_TIME_TYPE & b) + const Timer & operator=(const BIN_TIME_TYPE & b) { xSec = b.seconds + (b.minutes * 60) + (b.hours * 3600) + (b.day_of_month*SEC_IN_DAY) + month_base[b.month]; @@ -151,7 +152,7 @@ public: If seconds > seconds_in_year then reduced by seconds_in_year until seconds < seconds_in_year */ - const PrdTimer & operator=(const uint64_t & b) + const Timer & operator=(const uint64_t & b) { xSec = b % YEAR; return *this; @@ -159,7 +160,7 @@ public: #endif /// equivalancy - bool operator==(const PrdTimer & t) const + bool operator==(const Timer & t) const { return (xSec == t.xSec); } @@ -171,7 +172,7 @@ public: OR this < t2 and t2 - xSec > HALF_YEAR (timer wrapped) otherwise false */ - bool operator>(const PrdTimer & t2) const + bool operator>(const Timer & t2) const { return ( ((xSec > t2.xSec) && (xSec - t2.xSec < HALF_YEAR)) || ((xSec < t2.xSec) && (t2.xSec - xSec > HALF_YEAR))); @@ -182,7 +183,7 @@ public: Add seconds to the timer. Internal timer value is wraped as needed */ - PrdTimer operator+(unsigned int seconds) const + Timer operator+(unsigned int seconds) const { seconds = seconds % YEAR; seconds += xSec; @@ -191,7 +192,7 @@ public: } // diff time - unsigned int operator-(const PrdTimer & t) const { return (xSec - t.xSec); } + unsigned int operator-(const Timer & t) const { return (xSec - t.xSec); } // get seconds since the beginning of the year unsigned int getSec() const { return xSec; } @@ -222,7 +223,7 @@ static uint32_t month_base[12]; // # of seconds since start of year at start o #if !defined(__GNUC__) #if defined(iipResolution_C) -uint32_t PrdTimer::month_base[12] = +uint32_t Timer::month_base[12] = { 0, SEC_IN_DAY * 31, @@ -240,5 +241,5 @@ uint32_t PrdTimer::month_base[12] = #endif #endif - +} //End namespace PRDF #endif /* PRDFTIME_H */ |