summaryrefslogtreecommitdiffstats
path: root/src/usr
diff options
context:
space:
mode:
authorZane Shelley <zshelle@us.ibm.com>2014-07-21 11:13:57 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2014-09-17 11:18:52 -0500
commit754f596ca241911bd69790a550f618a5f879f9d4 (patch)
tree1e9c47924a31ae781105f182347622c8370e6e9f /src/usr
parent714d99c2991338cb15b5a5aa83990f5e27877b3c (diff)
downloadtalos-hostboot-754f596ca241911bd69790a550f618a5f879f9d4.tar.gz
talos-hostboot-754f596ca241911bd69790a550f618a5f879f9d4.zip
PRD: Cleaned up RasServices class
Change-Id: Id7d40ff079a34bf7ebfc3a6eea7c33a9d92f37b7 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/12401 Tested-by: Jenkins Server Reviewed-by: Christopher T. Phan <cphan@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com> Reviewed-by: Zane Shelley <zshelle@us.ibm.com> Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/13426
Diffstat (limited to 'src/usr')
-rw-r--r--src/usr/diag/prdf/common/framework/service/prdfRasServices_common.C131
-rw-r--r--src/usr/diag/prdf/common/framework/service/prdfRasServices_common.H96
-rwxr-xr-xsrc/usr/diag/prdf/common/framework/service/xspprdService.h82
-rwxr-xr-xsrc/usr/diag/prdf/test/prdfsimRasServices.C21
-rwxr-xr-xsrc/usr/diag/prdf/test/prdfsimRasServices.H26
5 files changed, 148 insertions, 208 deletions
diff --git a/src/usr/diag/prdf/common/framework/service/prdfRasServices_common.C b/src/usr/diag/prdf/common/framework/service/prdfRasServices_common.C
index 28b5198e0..a4ebb05a9 100644
--- a/src/usr/diag/prdf/common/framework/service/prdfRasServices_common.C
+++ b/src/usr/diag/prdf/common/framework/service/prdfRasServices_common.C
@@ -72,8 +72,6 @@ using namespace PlatServices;
RasServices thisServiceGenerator;
//------------------------------------------------------------------------------
-// Member Functions
-//------------------------------------------------------------------------------
ServiceGeneratorClass & ServiceGeneratorClass::ThisServiceGenerator(void)
{
@@ -82,69 +80,11 @@ ServiceGeneratorClass & ServiceGeneratorClass::ThisServiceGenerator(void)
//------------------------------------------------------------------------------
-RasServices::RasServices() :
- iv_ErrDataService(NULL)
-{
- //PRDF_DTRAC("RasServices() initializing default iv_ErrDataService");
- iv_ErrDataService = new ErrDataService();
-}
-
-//------------------------------------------------------------------------------
-RasServices::~RasServices()
-{
- if(NULL != iv_ErrDataService)
- {
- PRDF_DTRAC("~RasServices() deleting iv_ErrDataService");
- delete iv_ErrDataService;
- iv_ErrDataService = NULL;
- }
-}
-
-//------------------------------------------------------------------------------
-
void ErrDataService::Initialize()
{
iv_serviceActionCounter = 0;
}
-void RasServices::Initialize()
-{
- iv_ErrDataService->Initialize();
-}
-
-//------------------------------------------------------------------------------
-
-void RasServices::setErrDataService(ErrDataService & i_ErrDataService)
-{
- PRDF_TRAC("RasServices::setErrDataService() setting new ErrDataService");
-
- if(NULL != iv_ErrDataService)
- {
- PRDF_DTRAC("RasServices::setErrDataService() deleting old iv_ErrDataService");
- delete iv_ErrDataService;
- iv_ErrDataService = NULL;
- }
-
- iv_ErrDataService = &i_ErrDataService;
-}
-
-//------------------------------------------------------------------------------
-
-errlHndl_t RasServices::GenerateSrcPfa( ATTENTION_TYPE i_attnType,
- ServiceDataCollector & i_sdc,
- bool & o_initiateHwudump,
- TargetHandle_t & o_dumpTrgt,
- errlHndl_t & o_dumpErrl,
- uint32_t & o_dumpErrlActions)
-
-{
- return iv_ErrDataService->GenerateSrcPfa( i_attnType, i_sdc,
- o_initiateHwudump,
- o_dumpTrgt,
- o_dumpErrl,
- o_dumpErrlActions);
-}
-
//------------------------------------------------------------------------------
errlHndl_t ErrDataService::GenerateSrcPfa( ATTENTION_TYPE i_attnType,
@@ -1182,7 +1122,76 @@ bool ErrDataService::SdcRetrieve(sdcSaveFlagsEnum i_saveFlag, void * o_buffer)
#endif // if not __HOSTBOOT_MODULE
-} // End namespace PRDF
+//------------------------------------------------------------------------------
+// RasServices class
+//------------------------------------------------------------------------------
+
+RasServices::RasServices() :
+ iv_eds(NULL)
+{
+ iv_eds = new ErrDataService();
+}
+
+//------------------------------------------------------------------------------
+
+RasServices::~RasServices()
+{
+ if ( NULL != iv_eds )
+ {
+ delete iv_eds;
+ iv_eds = NULL;
+ }
+}
+
+//------------------------------------------------------------------------------
+
+void RasServices::Initialize()
+{
+ iv_eds->Initialize();
+}
+
+//------------------------------------------------------------------------------
+
+void RasServices::setErrDataService( ErrDataService & i_eds )
+{
+ if ( NULL != iv_eds )
+ {
+ delete iv_eds;
+ iv_eds = NULL;
+ }
+
+ iv_eds = &i_eds;
+}
+
+//------------------------------------------------------------------------------
+
+errlHndl_t RasServices::GenerateSrcPfa( ATTENTION_TYPE i_attnType,
+ ServiceDataCollector & i_sdc,
+ bool & o_initiateHwudump,
+ TargetHandle_t & o_dumpTrgt,
+ errlHndl_t & o_dumpErrl,
+ uint32_t & o_dumpErrlActions )
+
+{
+ return iv_eds->GenerateSrcPfa( i_attnType, i_sdc, o_initiateHwudump,
+ o_dumpTrgt, o_dumpErrl, o_dumpErrlActions );
+}
+
+//------------------------------------------------------------------------------
+
+void RasServices::createInitialErrl( ATTENTION_TYPE i_attnType )
+{
+ iv_eds->createInitialErrl( i_attnType );
+}
+
+//------------------------------------------------------------------------------
+
+errlHndl_t RasServices::getErrl() const
+{
+ return iv_eds->getErrl();
+}
+
+} // end namespace PRDF
/******************************************************************************/
// Servicability tags for PRDF Ras Services.
diff --git a/src/usr/diag/prdf/common/framework/service/prdfRasServices_common.H b/src/usr/diag/prdf/common/framework/service/prdfRasServices_common.H
index e1c650e98..de953dd2e 100644
--- a/src/usr/diag/prdf/common/framework/service/prdfRasServices_common.H
+++ b/src/usr/diag/prdf/common/framework/service/prdfRasServices_common.H
@@ -54,22 +54,16 @@ class ErrDataService
{
public:
- /**
- * @brief ctor
- */
- inline ErrDataService() :
+ /** @brief Constructor */
+ ErrDataService() :
iv_serviceActionCounter(0),
iv_errl(NULL)
{}
- /**
- * @brief dtor
- */
- inline virtual ~ErrDataService() {}
+ /** @brief Destructor */
+ virtual ~ErrDataService() {}
- /**
- * @brief initializer
- */
+ /** @brief Initializer */
virtual void Initialize();
/**
@@ -110,8 +104,8 @@ class ErrDataService
void MnfgTrace( ErrorSignature * i_esig, const PfaData & i_pfaData );
/**
- * @brief Create initial error log for analyze( attn analysis) code flow.
- * @param i_attnType attention type.
+ * @brief Creates the initial error log for PRDF::main() analysis path.
+ * @param i_attnType Analysis attention type.
*/
void createInitialErrl( ATTENTION_TYPE i_attnType );
@@ -129,20 +123,18 @@ class ErrDataService
/**
* @brief Return error log associated with current analysis flow.
- * @return error log handle.
+ * @note For normal analysis paths only. Will return NULL if
+ createInitialErrl() has not been called in PRDF::main().
+ * @return An error log.
*/
- errlHndl_t getErrl() { return iv_errl; };
+ errlHndl_t getErrl() const { return iv_errl; }
private:
- /**
- * @brief disable copy
- */
+ /** @brief Disable copy. */
ErrDataService(const ErrDataService &);
- /**
- * @brief disable assignment
- */
+ /** @brief Disable assignment. */
ErrDataService & operator=(const ErrDataService &);
#ifndef __HOSTBOOT_MODULE
@@ -265,33 +257,25 @@ class ErrDataService
};
-/**
- Interface to RAS services provided to PRD
-*/
-class RasServices: public ServiceGeneratorClass
+/** Interface to RAS services provided to PRD */
+class RasServices : public ServiceGeneratorClass
{
-public:
-
- /**
- @brief Default ctor
- */
- RasServices(void);
+ public:
- /**
- @brief Default dtor
- */
- ~RasServices();
+ /** @brief Constructor */
+ RasServices();
- // Compiler generated dtor is sufficient
+ /** @brief Destructor */
+ ~RasServices();
- virtual void Initialize();
+ /** @brief Initializer */
+ virtual void Initialize();
- /**
- * @brief set the err data service to be used
- *
- * @param[in] i_ErrDataService new err data service
- */
- virtual void setErrDataService(ErrDataService & i_ErrDataService);
+ /**
+ * @brief Sets the ErrDataService to be used.
+ * @param i_eds Target ErrDataService.
+ */
+ virtual void setErrDataService( ErrDataService & i_eds );
/**
* @brief Creates an SRC, PFA data, and error log from the SDC provided.
@@ -313,26 +297,22 @@ public:
uint32_t & o_dumpErrlActions );
/**
- * @brief Create initial error log for analyze( attn analysis) code flow.
- * @param i_attnType attention type.
+ * @brief Creates the initial error log for PRDF::main() analysis path.
+ * @param i_attnType Analysis attention type.
*/
- void createInitialErrl( ATTENTION_TYPE i_attnType )
- {
- iv_ErrDataService->createInitialErrl( i_attnType );
- }
+ virtual void createInitialErrl( ATTENTION_TYPE i_attnType );
/**
* @brief Return error log associated with current analysis flow.
- * @return error log handle.
+ * @note For normal analysis paths only. Will return NULL if
+ createInitialErrl() has not been called in PRDF::main().
+ * @return An error log.
*/
- virtual errlHndl_t getErrl()
- {
- return iv_ErrDataService->getErrl();
- };
-
-private: // Data
- // actual or sim err data service
- ErrDataService * iv_ErrDataService;
+ virtual errlHndl_t getErrl() const;
+
+ private: // instance variables
+
+ ErrDataService * iv_eds; ///< Actual or simulated ErrDataService.
};
diff --git a/src/usr/diag/prdf/common/framework/service/xspprdService.h b/src/usr/diag/prdf/common/framework/service/xspprdService.h
index ba8d45dd7..b3b48a9a9 100755
--- a/src/usr/diag/prdf/common/framework/service/xspprdService.h
+++ b/src/usr/diag/prdf/common/framework/service/xspprdService.h
@@ -69,56 +69,25 @@ class ErrDataService;
*/
class ServiceGeneratorClass
{
-public:
-
- // dg00 start
- /**
- Access the current concrete service generator
- <ul>
- <br><b>Paramters: </b> None
- <br><b>Returns: </b> Reference to active ServiceGenerator
- <br><b>Requirements:</b> None
- <br><b>Promises: </b> ServiceGenerator
- <br><b>Notes: </b> The definition of this function should exist
- in the *.C of the derived class
- </ul><br>
- */
- static ServiceGeneratorClass & ThisServiceGenerator(void);
- // dg00 end
-
- /**
- Constructor
- <ul>
- <br><b>Parameters: </b> None
- <br><b>Returns: </b> Nothing
- <br><b>Requirements:</b> None
- <br><b>Promises: </b> Object created
- <br><b>Exceptions: </b> None
- </ul><br>
- */
- ServiceGeneratorClass(void){}
-
- /*
- Destructor
- <ul>
- <br><b>Parameters: </b> None.
- <br><b>Returns: </b> No value returned
- <br><b>Requirements:</b> None.
- <br><b>Promises: </b> None.
- <br><b>Exceptions: </b> None.
- <br><b>Notes: </b> Compiler default is sufficient
- </ul><br>
- */
- virtual ~ServiceGeneratorClass(void) {};
-
-
- virtual void Initialize()=0;
-
- /**
- * @brief set the err data service to be used
- * @param[in] i_errDataService new err data service
- */
- virtual void setErrDataService(ErrDataService & i_errDataService)=0;
+ public:
+
+ /** Access the current service generator */
+ static ServiceGeneratorClass & ThisServiceGenerator();
+
+ /** @brief Constructor */
+ ServiceGeneratorClass() {}
+
+ /** @brief Destructor */
+ virtual ~ServiceGeneratorClass() {}
+
+ /** @brief Initializer */
+ virtual void Initialize() = 0;
+
+ /**
+ * @brief Sets the ErrDataService to be used.
+ * @param i_eds Target ErrDataService.
+ */
+ virtual void setErrDataService( ErrDataService & i_eds ) = 0;
/**
* @brief Creates an SRC, PFA data, and error log from the SDC provided.
@@ -140,19 +109,18 @@ public:
uint32_t & o_dumpErrlActions ) = 0;
/**
- * @brief Create initial error log for analyze( attn analysis) code flow.
- * @param i_attnType attention type.
+ * @brief Creates the initial error log for PRDF::main() analysis path.
+ * @param i_attnType Analysis attention type.
*/
virtual void createInitialErrl( ATTENTION_TYPE i_attnType ) = 0;
/**
* @brief Return error log associated with current analysis flow.
- * @return error log handle.
+ * @note For normal analysis paths only. Will return NULL if
+ createInitialErrl() has not been called in PRDF::main().
+ * @return An error log.
*/
- virtual errlHndl_t getErrl() = 0;
-
-private:
-
+ virtual errlHndl_t getErrl() const = 0;
};
diff --git a/src/usr/diag/prdf/test/prdfsimRasServices.C b/src/usr/diag/prdf/test/prdfsimRasServices.C
index 11472859b..ef7fea494 100755
--- a/src/usr/diag/prdf/test/prdfsimRasServices.C
+++ b/src/usr/diag/prdf/test/prdfsimRasServices.C
@@ -33,13 +33,12 @@ using namespace TARGETING;
namespace PRDF
{
-errlHndl_t SimErrDataService::GenerateSrcPfa(ATTENTION_TYPE attn_type,
- ServiceDataCollector & i_sdc,
- bool & o_initiateHwudump,
- TargetHandle_t & o_dumpTrgt,
- errlHndl_t & o_dumpErrl,
- uint32_t & o_dumpErrlActions )
-
+errlHndl_t SimErrDataService::GenerateSrcPfa( ATTENTION_TYPE i_attnType,
+ ServiceDataCollector & i_sdc,
+ bool & o_initiateHwudump,
+ TargetHandle_t & o_dumpTrgt,
+ errlHndl_t & o_dumpErrl,
+ uint32_t & o_dumpErrlActions )
{
using namespace TARGETING;
using namespace PlatServices;
@@ -48,11 +47,9 @@ errlHndl_t SimErrDataService::GenerateSrcPfa(ATTENTION_TYPE attn_type,
errlHndl_t errLog = NULL;
// call the actual ras services function
- errLog = ErrDataService::GenerateSrcPfa(attn_type, i_sdc,
- o_initiateHwudump,
- o_dumpTrgt,
- o_dumpErrl,
- o_dumpErrlActions);
+ errLog = ErrDataService::GenerateSrcPfa( i_attnType, i_sdc,
+ o_initiateHwudump, o_dumpTrgt,
+ o_dumpErrl, o_dumpErrlActions );
ErrorSignature * esig = i_sdc.GetErrorSignature();
diff --git a/src/usr/diag/prdf/test/prdfsimRasServices.H b/src/usr/diag/prdf/test/prdfsimRasServices.H
index 4c4257831..1b36b2ea5 100755
--- a/src/usr/diag/prdf/test/prdfsimRasServices.H
+++ b/src/usr/diag/prdf/test/prdfsimRasServices.H
@@ -33,23 +33,16 @@
namespace PRDF
{
-/**
- Interface to RAS services provided to PRD
-*/
-class SimErrDataService: public ErrDataService
+/** Interface to RAS services provided to PRD */
+class SimErrDataService : public ErrDataService
{
-
public:
- /**
- Default ctor
- */
- inline SimErrDataService() {}
+ /** @brief Constructor */
+ inline SimErrDataService() {}
- /**
- Default dtor
- */
- inline virtual ~SimErrDataService() {}
+ /** @brief Destructor */
+ inline virtual ~SimErrDataService() {}
/**
* @brief Creates an SRC, PFA data, and error log from the SDC provided.
@@ -70,13 +63,6 @@ class SimErrDataService: public ErrDataService
errlHndl_t & o_dumpErrl,
uint32_t & o_dumpErrlActions );
-private: // functions
-
-
-private: // Data
-
-
-
};
} // End namespace PRDF
OpenPOWER on IntegriCloud