summaryrefslogtreecommitdiffstats
path: root/src/include/usr/hwas
diff options
context:
space:
mode:
authorBrian Horton <brianh@linux.ibm.com>2013-06-25 16:43:53 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2013-09-12 14:03:33 -0500
commitd8fdb9f6399d602c3314fe8a0a6578364e886120 (patch)
treef4cf27fee9911626b62fbee5f9d7744520cd0f07 /src/include/usr/hwas
parent23c61636fe51145db2d7554ea8022aa4d58179b6 (diff)
downloadtalos-hostboot-d8fdb9f6399d602c3314fe8a0a6578364e886120.tar.gz
talos-hostboot-d8fdb9f6399d602c3314fe8a0a6578364e886120.zip
rework gard interfaces to handle new hwsv functions
the FSP gard records will now be stored in the system model, so the gard functions change to support new platform specific functions. Change-Id: I9a847a3defa7e613d128b1077763640e124360a8 RTC: 73818 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/5806 Tested-by: Jenkins Server Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: SHELDON R. BAILEY <baileysh@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/include/usr/hwas')
-rw-r--r--src/include/usr/hwas/common/deconfigGard.H195
-rw-r--r--src/include/usr/hwas/hwasPlatDeconfigGard.H12
2 files changed, 53 insertions, 154 deletions
diff --git a/src/include/usr/hwas/common/deconfigGard.H b/src/include/usr/hwas/common/deconfigGard.H
index 147686037..eddd7d7cf 100644
--- a/src/include/usr/hwas/common/deconfigGard.H
+++ b/src/include/usr/hwas/common/deconfigGard.H
@@ -79,9 +79,6 @@ DeconfigGard & theDeconfigGard();
class DeconfigGard
{
- // allow GardAddress to access private methods.
- friend class GardAddress;
-
public:
enum
@@ -237,34 +234,33 @@ public:
*
* Any error creating the GARD Record will be returned to the user.
*
- * @param[in] i_target Reference to Target to create GARD Record for.
+ * @param[in] i_pTarget Pointer to Target to create GARD Record for.
* @param[in] i_errlPlid Error log PLID to store in GARD Record.
* @param[in] i_errorType error type of the GARD Record.
*
* @return errlHndl_t. Error log handle.
*/
- errlHndl_t createGardRecord(const TARGETING::Target & i_target,
+ errlHndl_t createGardRecord(const TARGETING::Target * const i_pTarget,
const uint32_t i_errlPlid,
const GARD_ErrorType i_errorType);
/**
- * @brief Clears the specified GARD Records.
- *
- * Called by an administrator to clear GARD records manually.
- *
- * If the specified record does not exist then no error is returned. The
- * only errors returned are usage errors and errors accessing the GARD
- * Records.
+ * @brief Platform specific function that
+ * Creates a GARD Record for a Target.
*
- * @param[in] i_recordId RecordId to clear. If zero (CLEAR_ALL_GARD_RECORDS)
- * then all GARD Records cleared.
+ * @param[in] i_pTarget Pointer to Target to create GARD Record for.
+ * @param[in] i_errlPlid Error log PLID to store in GARD Record.
+ * @param[in] i_errorType error type of the GARD Record.
*
* @return errlHndl_t. Error log handle.
*/
- errlHndl_t clearGardRecords(const uint32_t i_recordId);
+ errlHndl_t platCreateGardRecord(const TARGETING::Target * const i_pTarget,
+ const uint32_t i_errlPlid,
+ const GARD_ErrorType i_errorType);
/**
- * @brief Clears all GARD Records for the specified Target.
+ * @brief Clears GARD Record for the specified Target, or ALL GARD
+ * records.
*
* Called by an administrator to clear GARD records manually.
*
@@ -272,47 +268,53 @@ public:
* only errors returned are usage errors and errors accessing the GARD
* Records.
*
- * @param[in] i_targetId Reference to Target ID to clear GARD Records for.
+ * @param[in] i_pTarget Pointer to Target to clear GARD record for.
+ * If NULL, then ALL GARD Records will be cleared.
+ *
+ * @return errlHndl_t. Error log handle.
+ */
+ errlHndl_t clearGardRecords(const TARGETING::Target * const i_pTarget);
+
+ /**
+ * @brief Platform specific function that
+ * Clears Record for the specified Target.
+ *
+ * @param[in] i_pTarget Pointer to Target to clear GARD record for.
+ * If NULL, then ALL GARD Records will be cleared.
*
* @return errlHndl_t. Error log handle.
*/
- errlHndl_t clearGardRecords(const TARGETING::EntityPath & i_targetId);
+ errlHndl_t platClearGardRecords(const TARGETING::Target * const i_pTarget);
/**
- * @brief Gets the specified GARD Records.
+ * @brief Gets all GARD Records for the specified Target.
*
* Called by an administrator to view GARD Records.
*
- * If the specified record does not exist then no error is returned. The
+ * If no GARD Records exist for the Target then no error is returned. The
* only errors returned are usage errors and errors accessing the GARD
* Records.
*
- * @param[in] i_recordId RecordId to get. If zero then all GARD Records are
- * retrieved.
+ * @param[in] i_pTarget Pointer to Sys or Node Target
* @param[out] o_records Reference to vector of GardRecords that is cleared
* then filled in with records.
*
* @return errlHndl_t. Error log handle.
*/
- errlHndl_t getGardRecords(const uint32_t i_recordId,
+ errlHndl_t getGardRecords(const TARGETING::Target * const i_pTarget,
GardRecords_t & o_records);
/**
- * @brief Gets all GARD Records for the specified Target.
- *
- * Called by an administrator to view GARD Records.
- *
- * If no GARD Records exist for the Target then no error is returned. The
- * only errors returned are usage errors and errors accessing the GARD
- * Records.
+ * @brief Platform specific function that
+ * Gets all GARD Records for the specified Target.
*
- * @param[in] i_targetId Reference to Target ID to get GARD Records for.
+ * @param[in] i_pTarget Pointer to Sys or Node Target
* @param[out] o_records Reference to vector of GardRecords that is cleared
* then filled in with records.
*
* @return errlHndl_t. Error log handle.
*/
- errlHndl_t getGardRecords(const TARGETING::EntityPath & i_targetId,
+ errlHndl_t platGetGardRecords(const TARGETING::Target * const i_pTarget,
GardRecords_t & o_records);
protected:
@@ -390,7 +392,7 @@ public:
*
* @return errlHndl_t. Error log handle.
*/
- errlHndl_t _getDeconfigureRecords(const TARGETING::Target * i_pTarget,
+ errlHndl_t _getDeconfigureRecords(const TARGETING::Target * const i_pTarget,
DeconfigureRecords_t & o_records);
/**
@@ -400,7 +402,7 @@ public:
* Records for. If NULL then all Deconfigure Records
* are cleared.
*/
- void clearDeconfigureRecords(const TARGETING::Target * i_pTarget);
+ void clearDeconfigureRecords(const TARGETING::Target * const i_pTarget);
/**
@@ -414,135 +416,20 @@ public:
private:
- /**
- * @brief Creates a GARD Record for a Target.
- *
- * @param[in] i_target Reference to Target to create GARD Record for.
- * @param[in] i_errlPlid Error log PLID to store in GARD Record.
- * @param[in] i_errorType Error Type of the GARD Record.
- *
- * @return errlHndl_t. Error log handle.
- */
- errlHndl_t _createGardRecord(const TARGETING::Target & i_target,
- const uint32_t i_errlPlid,
- const GARD_ErrorType i_errorType);
-
- /**
- * @brief Clears the specified GARD Records.
- *
- * @param[in] i_recordId RecordId to clear. If CLEAR_ALL_GARD_RECORDS
- * then all GARD Records cleared.
- *
- * @return errlHndl_t. Error log handle.
- */
- errlHndl_t _clearGardRecords(const uint32_t i_recordId);
-
- /**
- * @brief Clears all GARD Records for the specified Target.
- *
- * @param[in] i_targetId Reference to Target ID to clear GARD Records for.
- *
- * @return errlHndl_t. Error log handle.
- */
- errlHndl_t _clearGardRecords(const TARGETING::EntityPath & i_targetId);
-
- /**
- * @brief Gets the specified GARD Records.
- *
- * @param[in] i_recordId RecordId to get. If zero then all GARD Records are
- * retrieved.
- * @param[out] o_records Reference to vector of GardRecords that is cleared
- * then filled in with records.
- *
- * @return errlHndl_t. Error log handle.
- */
- errlHndl_t _getGardRecords(const uint32_t i_recordId,
- GardRecords_t & o_records);
-
- /**
- * @brief Gets all GARD Records for the specified Target.
- *
- *
- * @param[in] i_targetId Reference to Target ID to get GARD Records for.
- * @param[out] o_records Reference to vector of GardRecords that is cleared
- * then filled in with records.
- *
- * @return errlHndl_t. Error log handle.
- */
- errlHndl_t _getGardRecords(const TARGETING::EntityPath & i_targetId,
- GardRecords_t & o_records);
-
- /**
- * @brief sets the maxGardRecords and nextGardRecordId variables
- *
- * @param[in] i_size size of GARD area in PNOR/memory
- */
- void _GardRecordIdSetup(uint32_t i_size);
-
// Mutex for thread safety
HWAS_MUTEX_TYPE iv_mutex;
- // GARD Record Data
- uint32_t iv_nextGardRecordId; // Next GARD Record ID to use
- uint32_t iv_maxGardRecords; // Maximum number of GARD Records
- GardRecord * iv_pGardRecords; // Pointer to the GARD Records in PNOR
-
// The Deconfigure Records
DeconfigureRecords_t iv_deconfigureRecords;
+ // pointer to plat specific data
+ // platform functions can malloc space here if needed;
+ // deconfigGard dtor will free()
+ void *iv_platDeconfigGard;
+
}; // DeconfigGard
HWAS_DECLARE_SINGLETON(HWAS::DeconfigGard,theDeconfigGardSingleton);
-// The HWAS Common code needs to allow for the fact that the platforms
-// may need to know when the DeconfigGard functions are done using the
-// PNOR area for GARD record access. To this end, GardAddress is an
-// object that the common code will create when it needs to use the
-// address to the GARD records data (iv_pGardRecords). When this object
-// goes out of scope, the destructor will get called, and the platform
-// code will know that access to the PNOR area is complete.
-class GardAddress
-{
-public:
-
- /**
- * @brief Constructor.
- * PLATFORM must implement this function
- *
- * @param[in] o_errl errlHndl_t set if there was an error
- */
- GardAddress(errlHndl_t &o_errl);
-
- /**
- * @brief Destructor.
- * PLATFORM must implement this function
- */
- ~GardAddress();
-
- /**
- * @brief flush. flush all of the waiting addresses out
- *
- */
- void flush();
-
- /**
- * @brief writeRecord. Add the indicated address to a vector, so
- * that the destructor knows which GARD records were updated.
- *
- * @param[in] i_addr address of GARD record that was updated.
- */
- void writeRecord(void *i_addr)
- {
- if (i_addr !=NULL)
- {
- iv_addr.push_back(i_addr);
- }
- }
-
-protected:
-
- std::vector<void *>iv_addr;
-
-}; // GardAddress
}
#endif
diff --git a/src/include/usr/hwas/hwasPlatDeconfigGard.H b/src/include/usr/hwas/hwasPlatDeconfigGard.H
index 2f229c164..098e2c08b 100644
--- a/src/include/usr/hwas/hwasPlatDeconfigGard.H
+++ b/src/include/usr/hwas/hwasPlatDeconfigGard.H
@@ -53,5 +53,17 @@
#define HWAS_GET_SINGLETON(__TYPE__) \
__TYPE__::instance()
+namespace HWAS
+{
+
+struct HBDeconfigGard
+{
+ // GARD Record Data
+ uint32_t iv_nextGardRecordId; // Next GARD Record ID to use
+ uint32_t iv_maxGardRecords; // Maximum number of GARD Records
+ void *iv_pGardRecords; // Pointer to the GARD Records in PNOR
+};
+
+} // namespace HWAS
#endif // HWASPLATDECONFIGGARD_H_
OpenPOWER on IntegriCloud