summaryrefslogtreecommitdiffstats
path: root/src/include/usr
diff options
context:
space:
mode:
authorMike Jones <mjjones@us.ibm.com>2011-10-06 15:30:27 -0500
committerMIKE J. JONES <mjjones@us.ibm.com>2011-10-11 16:24:46 -0500
commit17f630f5c2fabea998708dc2b2cb33120c388079 (patch)
tree148f26d81d8d33600a25eeda969a8169565978c8 /src/include/usr
parent8c062af8b6bd50a59823c7ec430ec5fc019052d2 (diff)
downloadblackbird-hostboot-17f630f5c2fabea998708dc2b2cb33120c388079.tar.gz
blackbird-hostboot-17f630f5c2fabea998708dc2b2cb33120c388079.zip
HWPF: Error Information Updates
Change-Id: I9857638a35f21489e32448af3bf95e0155954b29 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/425 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com> Reviewed-by: CAMVAN T. NGUYEN <ctnguyen@us.ibm.com>
Diffstat (limited to 'src/include/usr')
-rw-r--r--src/include/usr/hwpf/fapi/fapi.H2
-rw-r--r--src/include/usr/hwpf/fapi/fapiAttributeService.H10
-rw-r--r--src/include/usr/hwpf/fapi/fapiCollectFfdc.H72
-rw-r--r--src/include/usr/hwpf/fapi/fapiErrorInfo.H275
-rw-r--r--src/include/usr/hwpf/fapi/fapiErrorInfoMem.H109
-rw-r--r--src/include/usr/hwpf/fapi/fapiHwpExecutor.H15
-rw-r--r--src/include/usr/hwpf/fapi/fapiReturnCode.H324
-rw-r--r--src/include/usr/hwpf/fapi/fapiReturnCodeDataRef.H147
-rw-r--r--src/include/usr/hwpf/fapi/fapiReturnCodes.H2
-rw-r--r--src/include/usr/hwpf/fapi/fapiUtil.H9
-rw-r--r--src/include/usr/hwpf/hwp/fapiFfdcHwpData.H54
-rw-r--r--src/include/usr/hwpf/hwp/fapiTestHwpFfdc.H7
-rw-r--r--src/include/usr/hwpf/plat/fapiPlatHwpExecutor.H7
-rw-r--r--src/include/usr/hwpf/plat/fapiPlatHwpInvoker.H9
14 files changed, 431 insertions, 611 deletions
diff --git a/src/include/usr/hwpf/fapi/fapi.H b/src/include/usr/hwpf/fapi/fapi.H
index a5246ea78..b88440f0b 100644
--- a/src/include/usr/hwpf/fapi/fapi.H
+++ b/src/include/usr/hwpf/fapi/fapi.H
@@ -33,6 +33,7 @@
* mjjones 04/13/2011 Created.
* mjjones 06/07/2011 Added new includes.
* mjjones 08/08/2011 Updated Executor include
+ * mjjones 09/23/2011 Added fapiHwpErrorInfo.H
*
*/
@@ -48,6 +49,7 @@
#include <fapiHwpExecutor.H>
#include <fapiAttributeService.H>
#include <fapiHwpReturnCodes.H> // Generated file
+#include <fapiHwpErrorInfo.H> // Generated file
#include <fapiAttributeIds.H> // Generated file
#include <ecmdDataBuffer.H>
diff --git a/src/include/usr/hwpf/fapi/fapiAttributeService.H b/src/include/usr/hwpf/fapi/fapiAttributeService.H
index a627e429b..2fe5ba517 100644
--- a/src/include/usr/hwpf/fapi/fapiAttributeService.H
+++ b/src/include/usr/hwpf/fapi/fapiAttributeService.H
@@ -35,6 +35,7 @@
* mjjones 06/06/2011 Created.
* mjjones 06/22/2011 Major updates
* mjjones 09/06/2011 Remove support for strings
+ * mjjones 09/22/2011 Fixed example
*/
#ifndef FAPIATTRIBUTESERVICE_H_
@@ -49,17 +50,16 @@
* Code must have a pointer to a Target and an attribute ID (from XML file):
* fapi::ReturnCode l_rc;
* fapi::Target * l_pTarget = ????;
- * AttributeId l_id = ????;
*
* To get a copy of an integer attribute and set the attribute
* uint64_t l_val = 0;
- * l_rc = FAPI_ATTR_GET(l_id, l_pTarget, l_val);
- * l_rc = FAPI_ATTR_SET(l_id, l_pTarget, l_val);
+ * l_rc = FAPI_ATTR_GET(<ID>, l_pTarget, l_val);
+ * l_rc = FAPI_ATTR_SET(<ID>, l_pTarget, l_val);
*
* To get a copy of an integer array attribute and set the attribute
* uint32_t l_pVal[4] = {0};
- * l_rc = FAPI_ATTR_GET(l_id, l_pTarget, l_pVal);
- * l_rc = FAPI_ATTR_SET(l_id, l_pTarget, l_pVal);
+ * l_rc = FAPI_ATTR_GET(<ID>, l_pTarget, l_pVal);
+ * l_rc = FAPI_ATTR_SET(<ID>, l_pTarget, l_pVal);
*
* The first part of these macros is a call to checkIdType that will cause a
* compile failure if the ID or VAL parameters are incorrect.
diff --git a/src/include/usr/hwpf/fapi/fapiCollectFfdc.H b/src/include/usr/hwpf/fapi/fapiCollectFfdc.H
deleted file mode 100644
index d0a085ff0..000000000
--- a/src/include/usr/hwpf/fapi/fapiCollectFfdc.H
+++ /dev/null
@@ -1,72 +0,0 @@
-// IBM_PROLOG_BEGIN_TAG
-// This is an automatically generated prolog.
-//
-// $Source: src/include/usr/hwpf/fapi/fapiCollectFfdc.H $
-//
-// IBM CONFIDENTIAL
-//
-// COPYRIGHT International Business Machines Corp. 2011
-//
-// p1
-//
-// Object Code Only (OCO) source materials
-// Licensed Internal Code Source Materials
-// IBM HostBoot Licensed Internal Code
-//
-// The source code for this program is not published or other-
-// wise divested of its trade secrets, irrespective of what has
-// been deposited with the U.S. Copyright Office.
-//
-// Origin: 30
-//
-// IBM_PROLOG_END
-/**
- * @file fapiCollectFfdc.H
- *
- * @brief Defines the fapiCollectFfdc function
- */
-
-/*
- * Change Log ******************************************************************
- * Flag Defect/Feature User Date Description
- * ------ -------------- ---------- ----------- ----------------------------
- * mjjones 08/09/2011 Created.
- */
-
-#ifndef FAPICOLLECTFFDC_H_
-#define FAPICOLLECTFFDC_H_
-
-#include <stdint.h>
-#include <fapiReturnCode.H>
-
-namespace fapi
-{
-
-/**
- * @brief Collect FFDC
- *
- * Collect FFDC. This function should be called by PLAT when it is processing
- * a ReturnCode generated by a HWP and the ErrorInfoRepository contains a record
- * for the error indicating that FFDC should be collected. This function is
- * implemented in the generated fapiCollectFfdc.C file (generated using data
- * from the Error Information XML file)
- *
- * @param[in] i_token FFDC HWP token (retrieved from ErrorInfoRepository)
- * @param[in] i_target Reference to Target to collect FFDC from
- * @param[out] o_pFfdc Reference to uint8_t pointer. Set to point to a newly
- * allocated array containing FFDC data
- * @param[out] o_size Reference to uint32_t. Set to the size of the FFDC
- * data
- *
- * @return ReturnCode
- *
- * @note Caller must delete the data with "delete [] o_pFfdc"
- */
-ReturnCode fapiCollectFfdc(const FfdcHwpToken i_token,
- const Target & i_target,
- uint8_t * & o_pFfdc,
- uint32_t & o_size);
-
-}
-
-#endif // FAPICOLLECTFFDC_H_
diff --git a/src/include/usr/hwpf/fapi/fapiErrorInfo.H b/src/include/usr/hwpf/fapi/fapiErrorInfo.H
index 110b48632..59f9d8b28 100644
--- a/src/include/usr/hwpf/fapi/fapiErrorInfo.H
+++ b/src/include/usr/hwpf/fapi/fapiErrorInfo.H
@@ -23,8 +23,7 @@
/**
* @file fapiErrorInfo.H
*
- * @brief Defines the ErrorInfoRepository, ErrorInfoRecord and associated
- * classes.
+ * @brief Defines the Error Information structures and classes
*/
/*
@@ -33,242 +32,178 @@
* ------ -------------- ---------- ----------- ----------------------------
* mjjones 08/09/2011 Created.
* mjjones 08/24/2011 Added ErrorInfoGard.
+ * mjjones 09/22/2011 Major updates
*/
#ifndef FAPIERRORINFO_H_
#define FAPIERRORINFO_H_
#include <stdint.h>
-#include <fapiTarget.H>
-#include <fapiReturnCode.H>
-#include <fapiHwpReturnCodes.H>
#include <vector>
+#include <fapiTarget.H>
namespace fapi
{
/**
+ * @class ErrorInfoFfdc
+ *
+ * This class contains a copy of some FFDC data
+ */
+class ErrorInfoFfdc
+{
+public:
+ /**
+ * @brief Constructor
+ *
+ * @param[in] i_pFfdc Pointer to the FFDC to copy
+ * @param[in] i_size Size of the FFDC to copy
+ */
+ ErrorInfoFfdc(const void * i_pFfdc,
+ const uint32_t i_size);
+
+ /**
+ * @brief Copy Constructor
+ *
+ * @param[in] i_right Reference to ErrorInfoFfdc to copy from
+ */
+ ErrorInfoFfdc(const ErrorInfoFfdc & i_right);
+
+ /**
+ * @brief Destructor
+ */
+ ~ErrorInfoFfdc();
+
+ /**
+ * @brief Assignment Operator
+ *
+ * @param[in] i_right Reference to ErrorInfoFfdc to assign from
+ *
+ * @return ErrorInfoFfdc &. Reference to this ErrorInfoFfdc
+ */
+ ErrorInfoFfdc & operator=(const ErrorInfoFfdc & i_right);
+
+ /**
+ * @brief Get a pointer to the FfdcData
+ *
+ * @param[out] o_size Reference to uint32_t that is filled in with the FFDC
+ * size
+ *
+ * @return void *. Pointer to the FFDC
+ */
+ const void * getData(uint32_t & o_size) const;
+
+private:
+
+ // Pointer to the FFDC
+ uint8_t * iv_pFfdc;
+
+ // Size of the FFDC
+ uint32_t iv_size;
+};
+
+/**
* @enum CalloutPriority
*
* This enumeration defines the possible callout priorities
*/
enum CalloutPriority
{
- HIGH = 1,
- MEDIUM = 2,
- LOW = 3,
+ PRI_HIGH = 1,
+ PRI_MEDIUM = 2,
+ PRI_LOW = 3,
};
/**
* @struct ErrorInfoCallout
*
- * This struct defines a target callout. An ErrorInfoRecord can contain a number
- * of these.
+ * This struct contains a target to callout
*/
struct ErrorInfoCallout
{
/**
* @brief Constructor.
*
- * @param[in] i_targetType The type of the target to callout. If the same as
- * the target of the HWP that generated the error
- * then that is the target
- * @param[in] i_targetPos The position of the target to callout. Relative
- * to the target of the HWP that generated the error
- * @param[in] i_priority The priority of the callout
+ * @param[in] i_target Reference to the target to callout
+ * @param[in] i_priority The priority of the callout
*/
- ErrorInfoCallout(const TargetType i_targetType,
- const uint32_t i_targetPos,
+ ErrorInfoCallout(const Target & i_target,
const CalloutPriority i_priority);
- // The type of the target to call out. See ctor for details
- TargetType iv_targetType;
-
- // The position of the target to call out. See ctor for details
- uint32_t iv_targetPos;
+ // The target to call out
+ Target iv_target;
// The priority of the callout
CalloutPriority iv_priority;
};
/**
- * @struct ErrorInfoGard
+ * @struct ErrorInfoDeconfig
*
- * This struct defines a target gard request. An ErrorInfoRecord can contain a
- * number of these.
+ * This struct contains a target to deconfigure
*/
-struct ErrorInfoGard
+struct ErrorInfoDeconfig
{
/**
* @brief Constructor.
*
- * @param[in] i_targetType The type of the target to gard. If the same as
- * the target of the HWP that generated the error
- * then that is the target
- * @param[in] i_targetPos The position of the target to gard. Relative to
- * the target of the HWP that generated the error
+ * @param[in] i_target Reference to the target to deconfigure
*/
- ErrorInfoGard(const TargetType i_targetType,
- const uint32_t i_targetPos);
-
- // The type of the target to gard. See ctor for details
- TargetType iv_targetType;
+ ErrorInfoDeconfig(const Target & i_target);
- // The position of the target to gard. See ctor for details
- uint32_t iv_targetPos;
+ // The target to deconfigure
+ Target iv_target;
};
/**
- * @struct ErrorInfoFfdc
+ * @struct ErrorInfoGard
*
- * This struct defines FFDC collection information. An ErrorInfoRecord can
- * contain a number of these.
+ * This struct contains a target to create a GARD record for
*/
-struct ErrorInfoFfdc
+struct ErrorInfoGard
{
/**
* @brief Constructor.
*
- * @param[in] i_targetType The type of the target to collect FFDC from. If
- * the same as the target of the HWP that
- * generated the error then that is the target
- * @param[in] i_targetPos The position of the target to collect FFDC
- * from. Relative to the target of the HWP that
- * generated the error
- * @param[in] i_ffdcHwpToken The token used to identify the HWP to call to
- * collect FFDC
+ * @param[in] i_target Reference to the target to create a GARD record for
*/
- ErrorInfoFfdc(const TargetType i_targetType,
- const uint32_t i_targetPos,
- const FfdcHwpToken i_ffdcHwpToken);
-
- // The type of the target to collect FFDC from. See ctor for details
- TargetType iv_targetType;
+ ErrorInfoGard(const Target & i_target);
- // The position of the target to collect FFDC from. See ctor for details
- uint32_t iv_targetPos;
-
- // The token used to identify the HWP to call to collect FFDC
- FfdcHwpToken iv_ffdcHwpToken;
+ // The target to create a GARD record for
+ Target iv_target;
};
/**
- * @struct ErrorInfoRecord
+ * @struct ErrorInfo
*
- * This struct defines the error information record. This gives information
- * about a specific HWP generated ReturnCode value.
+ * This struct defines the error information
*/
-struct ErrorInfoRecord
+struct ErrorInfo
{
/**
- * @brief Default constructor.
- */
- ErrorInfoRecord();
-
- /**
- * @brief Copy constructor.
- *
- * @param[in] i_right Reference to ErrorInfoRecord to copy
- */
- ErrorInfoRecord(const ErrorInfoRecord & i_right);
-
- /**
- * @brief Destructor
- */
- ~ErrorInfoRecord();
-
- /**
- * @brief Assignment operator
- *
- * @param[in] i_right Reference to ErrorInfoRecord to copy
- *
- * @return Reference to 'this' ErrorInfoRecord
+ * @brief Destructor.
*/
- ErrorInfoRecord & operator=(const ErrorInfoRecord & i_right);
+ ~ErrorInfo();
- /**
- * @brief Set Description function
- *
- * @param[in] i_pDesc Pointer to C string that is copied
- */
- void setDescription(const char * i_pDescription);
-
- /**
- * @brief Get Description function
- *
- * @return pointer to description (NULL if no description set)
- */
- const char * getDescription();
-
- // The Return Code value
- uint32_t iv_rc;
+ // Vector of FFDC Data
+ std::vector<ErrorInfoFfdc *> iv_ffdcs;
+ typedef std::vector<ErrorInfoFfdc *>::iterator ErrorInfoFfdcItr_t;
+ typedef std::vector<ErrorInfoFfdc *>::const_iterator ErrorInfoFfdcCItr_t;
// Vector of targets to callout
- std::vector<ErrorInfoCallout> iv_callouts;
- typedef std::vector<ErrorInfoCallout>::iterator ErrorInfoCalloutItr_t;
-
- // Vector of targets to gard
- std::vector<ErrorInfoGard> iv_gards;
- typedef std::vector<ErrorInfoGard>::iterator ErrorInfoGardItr_t;
-
- // Vector of FFDC collection information
- std::vector<ErrorInfoFfdc> iv_ffdcs;
- typedef std::vector<ErrorInfoFfdc>::iterator ErrorInfoFfdcItr_t;
-
-private:
- // C-String containing the description of the error
- char * iv_pDescription;
-};
-
-/**
- * @class ErrorInfoRepository
- *
- * This class defines the error information repository. It provides an
- * ErrorInfoRecord given a ReturnCode value. This is an abstract class that a
- * concrete class must derive from.
- */
-class ErrorInfoRepository
-{
-public:
-
- /**
- * @brief Get the singleton instance.
- *
- * This function must be implemented by a concrete derived class
- */
- static ErrorInfoRepository& Instance();
-
- /**
- * @brief Default constructor.
- */
- ErrorInfoRepository();
-
- /**
- * @brief Destructor
- */
- virtual ~ErrorInfoRepository();
-
- /**
- * @brief Find Error Information Record for given ReturnCode value
- *
- * This is a pure virtual function that must be implemented by a concrete
- * derived class
- *
- * @param[in] i_rc The ReturnCode value. User can pass in a ReturnCode
- * object and it will be implicitly converted to a
- * uint32_t using the ReturnCode conversion operator
- * @param[out] o_record Reference to a ErrorInfoRecord. If the record is
- * found then it is assigned to o_record, else it is
- * not. User should pass an ErrorInfoRecord with a good
- * ReturnCode value and then look to see if the value
- * was changed to the ReturnCode value to figure out if
- * the record was found.
- *
- * @return ReturnCode. Zero on success else error accessing the repository
- */
- virtual ReturnCode find(const uint32_t i_rc,
- ErrorInfoRecord & o_record) = 0;
-
+ std::vector<ErrorInfoCallout *> iv_callouts;
+ typedef std::vector<ErrorInfoCallout *>::iterator ErrorInfoCalloutItr_t;
+ typedef std::vector<ErrorInfoCallout *>::const_iterator ErrorInfoCalloutCItr_t;
+
+ // Vector of targets to deconfigure
+ std::vector<ErrorInfoDeconfig *> iv_deconfigs;
+ typedef std::vector<ErrorInfoDeconfig *>::iterator ErrorInfoDeconfigItr_t;
+ typedef std::vector<ErrorInfoDeconfig *>::const_iterator ErrorInfoDeconfigCItr_t;
+
+ // Vector of targets to create a GARD record for
+ std::vector<ErrorInfoGard *> iv_gards;
+ typedef std::vector<ErrorInfoGard *>::iterator ErrorInfoGardItr_t;
+ typedef std::vector<ErrorInfoGard *>::const_iterator ErrorInfoGardCItr_t;
};
}
diff --git a/src/include/usr/hwpf/fapi/fapiErrorInfoMem.H b/src/include/usr/hwpf/fapi/fapiErrorInfoMem.H
deleted file mode 100644
index 9689766fe..000000000
--- a/src/include/usr/hwpf/fapi/fapiErrorInfoMem.H
+++ /dev/null
@@ -1,109 +0,0 @@
-// IBM_PROLOG_BEGIN_TAG
-// This is an automatically generated prolog.
-//
-// $Source: src/include/usr/hwpf/fapi/fapiErrorInfoMem.H $
-//
-// IBM CONFIDENTIAL
-//
-// COPYRIGHT International Business Machines Corp. 2011
-//
-// p1
-//
-// Object Code Only (OCO) source materials
-// Licensed Internal Code Source Materials
-// IBM HostBoot Licensed Internal Code
-//
-// The source code for this program is not published or other-
-// wise divested of its trade secrets, irrespective of what has
-// been deposited with the U.S. Copyright Office.
-//
-// Origin: 30
-//
-// IBM_PROLOG_END
-/**
- * @file fapiErrorInfoMem.H
- *
- * @brief Defines the ErrorInfoRepositoryMem class.
- *
- * ErrorInfoRepositoryMem is a concrete Error Info repository that stores
- * ErrorInfoRecords in heap based memory. A particular platform may choose to
- * implement a different repository (in which case it would not compile this
- * file)
- */
-
-/*
- * Change Log ******************************************************************
- * Flag Defect/Feature User Date Description
- * ------ -------------- ---------- ----------- ----------------------------
- * mjjones 08/08/2011 Created.
- */
-
-#ifndef FAPIERRORINFOMEM_H_
-#define FAPIERRORINFOMEM_H_
-
-#include <stdint.h>
-#include <fapiReturnCode.H>
-#include <fapiErrorInfo.H>
-#include <vector>
-
-namespace fapi
-{
-
-/**
- * @class ErrorInfoRepositoryMem
- *
- * This class defines a concrete error information repository. ErrorInfoRecords
- * are stored in heap based memory.
- */
-class ErrorInfoRepositoryMem : public ErrorInfoRepository
-{
-public:
-
- /**
- * @brief Default constructor.
- */
- ErrorInfoRepositoryMem();
-
- /**
- * @brief Destructor
- */
- virtual ~ErrorInfoRepositoryMem();
-
- /**
- * @brief Find Error Information Record for given ReturnCode value
- *
- * Implementation of pure virtual function in base ErrorInfoRepository class
- *
- * @param[in] i_rc The ReturnCode value. User can pass in a ReturnCode
- * object and it will be implicitly converted to a
- * uint32_t using the ReturnCode conversion operator
- * @param[out] o_record Reference to a ErrorInfoRecord. If the record is
- * found then it is assigned to o_record, else it is
- * not. User should pass an ErrorInfoRecord with a good
- * ReturnCode value and then look to see if the value
- * was changed to the ReturnCode value to figure out if
- * the record was found.
- *
- * @return ReturnCode. Always success.
- */
- virtual ReturnCode find(const uint32_t i_rc,
- ErrorInfoRecord & o_record);
-
-private:
-
- /**
- * @brief Initialize the repository with ErrorInfoRecords
- *
- * This function is implemented in the generated fapiErrorInfoMemInit.C file
- * (generated using data from the Error Information XML file)
- */
- void init();
-
- // Vector of ErrorInfoRecords
- std::vector<ErrorInfoRecord> iv_errorInfoRecords;
- typedef std::vector<ErrorInfoRecord>::iterator ErrorInfoRecordItr_t;
-};
-
-}
-
-#endif // FAPIERRORINFOMEM_H_
diff --git a/src/include/usr/hwpf/fapi/fapiHwpExecutor.H b/src/include/usr/hwpf/fapi/fapiHwpExecutor.H
index b2cad6247..d3876945e 100644
--- a/src/include/usr/hwpf/fapi/fapiHwpExecutor.H
+++ b/src/include/usr/hwpf/fapi/fapiHwpExecutor.H
@@ -29,6 +29,13 @@
* wants to execute a HWP.
*/
+/*
+ * Change Log ******************************************************************
+ * Flag Defect/Feature User Date Description
+ * ------ -------------- ---------- ----------- ----------------------------
+ * mjjones 09/22/2011 Removed mandatory target
+ * parameter from FAPI_EXEC_HWP
+ */
#ifndef FAPIHWPEXECUTOR_H_
#define FAPIHWPEXECUTOR_H_
@@ -38,11 +45,9 @@
* @brief HWP Executor macro
*
* This macro calls a PLAT macro which will do any platform specific work to
- * execute the HWP (e.g. dlopening a shared library) and then calls a function
- * on the ReturnCode to store the error target if there is an error
+ * execute the HWP (e.g. dlopening a shared library)
*/
-#define FAPI_EXEC_HWP(RC, FUNC, TARGET, _args_...) \
- FAPI_PLAT_EXEC_HWP(RC, FUNC, TARGET, ##_args_); \
- RC.setErrTarget(TARGET)
+#define FAPI_EXEC_HWP(RC, FUNC, _args_...) \
+ FAPI_PLAT_EXEC_HWP(RC, FUNC, ##_args_)
#endif // FAPIHWPEXECUTOR_H_
diff --git a/src/include/usr/hwpf/fapi/fapiReturnCode.H b/src/include/usr/hwpf/fapi/fapiReturnCode.H
index fb218e560..9100f47b1 100644
--- a/src/include/usr/hwpf/fapi/fapiReturnCode.H
+++ b/src/include/usr/hwpf/fapi/fapiReturnCode.H
@@ -36,6 +36,7 @@
* Error Target
* camvanng 09/06/2011 Added function template for
* setHwpFfdc
+ * mjjones 09/22/2011 Added ErrorInfo Support
*/
#ifndef FAPIRETURNCODE_H_
@@ -43,15 +44,31 @@
#include <stdint.h>
#include <stddef.h>
+#include <ecmdDataBuffer.H>
#include <fapiTarget.H>
#include <fapiReturnCodes.H>
+#include <fapiErrorInfo.H>
+#include <fapiHwpErrorInfo.H>
+#include <fapiPlatTrace.H>
+
+/**
+ * @brief Set HWP Error macro
+ *
+ * This macro should be used by a HWP to set an error code if there is
+ * associated Error Information (in the Error Information XML file) that
+ * needs to be processed
+ */
+#define FAPI_SET_HWP_ERROR(RC, ERROR) \
+ RC.resetError(fapi::ERROR); \
+ ERROR##_CALL_FUNC_TO_ANALYZE_ERROR(RC); \
+ ERROR##_CALL_FUNCS_TO_COLLECT_FFDC(RC); \
+ ERROR##_ADD_ERROR_INFO(RC)
namespace fapi
{
// Forward declarations
-class ReturnCodePlatDataRef;
-class ReturnCodeHwpFfdcRef;
+class ReturnCodeDataRef;
/**
* @class ReturnCode
@@ -62,17 +79,14 @@ class ReturnCodeHwpFfdcRef;
*
* FAPI, PLAT and HWP code can all create a ReturnCode.
* PLAT can associate PlatData to it (use-case is an error log).
- * HWP can add HwpFfdc to it.
- * FAPI can add an error target to it (use-case is to record which target was
- * the subject of a HWP that generated an error)
+ * HWPs can add ErrorInfo to it (via FAPI_SET_HWP_ERROR macro).
+ * FFDC HWPs can add FFDC ErrorInfo to it (via addEIFfdc member function)
*
* A ReturnCode is copyable and assignable. Therefore, it cannot be subclassed.
*
- * When a ReturnCode is copied, any PlatData or HwpFfdc is not copied because it
- * may be heavyweight. Both ReturnCodes will refer to the same data. Data is
- * only deleted when the last ReturnCode with a reference to it is deleted. It
- * is possible for PLAT to get a pointer to the PlatData and to optionally
- * release the data (ReturnCode no longer responsible for deleting).
+ * When a ReturnCode is copied, any PlatData or ErrorInfo is not copied
+ * because it may be heavyweight. Both ReturnCodes will refer to the same data.
+ * this is achieved with the ReturnCodeDataRef class.
*
* A ReturnCode object is not thread safe, multiple threads must not use the
* same ReturnCode object concurrently.
@@ -82,16 +96,6 @@ class ReturnCode
public:
/**
- * @brief Enumeration of return code creators
- */
- enum returnCodeCreator
- {
- CREATOR_FAPI = 1,
- CREATOR_PLAT = 2,
- CREATOR_HWP = 3,
- };
-
- /**
* @brief Default constructor. Sets rcValue to success
*/
ReturnCode();
@@ -133,13 +137,22 @@ public:
/**
* @brief Assignment Operator.
*
- * @param[in] i_rc Reference to rcValue to assign
+ * @param[in] i_rc rcValue to assign
+ *
+ * If FAPI_RC_SUCCESS (zero) is assigned then any associated data is deleted
*
* @return Reference to 'this' ReturnCode
*/
ReturnCode & operator=(const uint32_t i_rcValue);
/**
+ * @brief Any associated data is deleted and the specified rcValue is set
+ *
+ * @param[in] i_rc rcValue to set
+ */
+ void resetError(const uint32_t i_rcValue);
+
+ /**
* @brief Returns if the return code indicates success
*
* @return bool. True if ok, else false
@@ -156,12 +169,25 @@ public:
operator uint32_t() const;
/**
+ * @brief Associates heap based PlatData with the ReturnCode. The ReturnCode
+ * object takes responsibility for deleting the data (platform code
+ * actually implements the delete function and must know the type and
+ * how to delete it). Any existing PlatData is deleted.
+ *
+ * This is called by PLAT. The expected use-case is to associate a platform
+ * error log with the ReturnCode.
+ *
+ * @param[in] i_pData Pointer to PlatData (on the heap)
+ */
+ void setPlatData(void * i_pData);
+
+ /**
* @brief Get a pointer to any PlatData. ReturnCode is still responsible for
* deletion of the data. The caller must not delete
*
- * The data pointed to is only meaningful to platform code. The data pointer
- * should be used immediately in the same thread because it may be deleted
- * in the future.
+ * This is called by PLAT. The expected use-case is to get a pointer to a
+ * platform error log. The data pointer should be used immediately in the
+ * same thread.
*
* @return void *. Pointer to any PlatData. If NULL then no data
*/
@@ -171,59 +197,93 @@ public:
* @brief Get a pointer to any PlatData and release ownership from
* ReturnCode. The caller is responsible for deletion.
*
- * The data pointed to is only meaningful to platform code.
+ * This is called by PLAT. The expected use-case is to retrieve a platform
+ * error log.
*
* @return void *. Pointer to any PlatData. If NULL then no data
*/
void * releasePlatData();
/**
- * @brief Associates heap based PlatData with the ReturnCode. The ReturnCode
- * object takes responsibility for deleting the data (platform code
- * actually implements the delete function and must know the type and
- * how to delete it).
- *
- * The data pointed to is only meaningful to platform code. This is expected
- * to be used to associate a platform error log with the ReturnCode.
- *
- * param[in] i_pData Pointer to PlatData (on the heap)
+ * @brief Enumeration of ErrorInfo types
*/
- void setPlatData(void * i_pData);
+ enum ErrorInfoType
+ {
+ EI_TYPE_FFDC = 1,
+ EI_TYPE_CALLOUT = 2,
+ EI_TYPE_DECONF = 3,
+ EI_TYPE_GARD = 4,
+ };
/**
- * @brief Get a pointer to any stored HwpFfdc.
+ * @brief Structure representing a single ErrorInfo entry.
*
- * The data pointer should be used immediately in the same thread because it
- * is a pointer to internal object data.
+ * An array of these is passed to the addErrorInfo function when a HWP
+ * generates an error by calling the FAPI_SET_HWP_ERROR macro
+ */
+ struct ErrorInfoEntry
+ {
+ uint8_t iv_type : 3; // The type of ErrorInfo (from ErrorInfoType enum)
+ uint8_t iv_object: 5; // Which object in the i_pObjects array passed to
+ // addErrorInfo the ErrorInfoEntry is for
+ int16_t iv_data1; // EI_TYPE_FFDC : Size of FFDC
+ // EI_TYPE_CALLOUT: CalloutPriority
+ };
+
+ /**
+ * @brief Add ErrorInfo
*
- * param[out] o_size Size of the FFDC data in bytes.
+ * This is called by the FAPI_SET_HWP_ERROR macro to add ErrorInfo to the
+ * ReturnCode when a HWP generates an error. The function is designed to add
+ * all the ErrorInfo at once rather than the FAPI_SET_HWP_ERROR macro making
+ * multiple function calls to add each piece of ErrorInfo individually in
+ * order to minimize code size
*
- * @return void *. Pointer to any HwpFfdc. If NULL then no data
+ * @param[in] i_pObjects Pointer to array of const pointers to const objects
+ * that are referred to by ErrorInfoEntry objects
+ * (object type is dependent on ErrorInfoEntry type)
+ * @param[in] i_pEntries Pointer to array of ErrorInfoEntry objects defining
+ * the ErrorInfo that needs to be added
+ * @param[in] i_count Number of ErrorInfoEntry structures
*/
- const void * getHwpFfdc(uint32_t & o_size) const;
+ void addErrorInfo(const void * const * i_pObjects,
+ const ErrorInfoEntry * i_pEntries,
+ const uint8_t i_count);
/**
- * @brief Stores a copy of the provided HwpFfdc
+ * @brief Add a copy of FFDC to the ErrorInfo
+ *
+ * This is called by:
+ * - addErrorInfo
+ * - ReturnCodeFfdc::addEIFfdc (function template)
+ * - FFDC HWPs (HWPs written to collect FFDC)
+ *
+ * Use ReturnCodeFfdc::addEIFfdc to add FFDC data using the data identifier
*
- * param[in] i_pFfdc Pointer to HwpFfdc
- * param[in] i_size Size of the FFDC data in bytes
+ * @param[in] i_pFfdc Pointer to the FFDC to copy
+ * @param[in] i_size Size of the FFDC to copy
*/
- void setHwpFfdc(const void * i_pFfdc, const uint32_t i_size);
+ void addEIFfdc(const void * i_pFfdc,
+ const uint32_t i_size);
/**
- * @brief Stores a copy of the provided HwpFfdc
+ * @brief Get a pointer to any ErrorInfo
*
- * param[in] i_data FFDC data, which can be any type
+ * This is called by PLAT to find information about an error
*
- * Example usage:
- * uint32_t l_data = 0x12345678;
- * fapi::ReturnCode l_rc;
- * l_rc.setHwpFfdc(l_data);
+ * @return ErrorInfo *. Pointer to any ErrorInfo. If NULL then no info
*/
- template<class T> void setHwpFfdc(const T & i_data)
+ const ErrorInfo * getErrorInfo() const;
+
+ /**
+ * @brief Enumeration of return code creators
+ */
+ enum returnCodeCreator
{
- setHwpFfdc(&i_data, sizeof(T));
- }
+ CREATOR_FAPI = 1,
+ CREATOR_PLAT = 2,
+ CREATOR_HWP = 3,
+ };
/**
* @brief Gets the creator of the return code
@@ -232,48 +292,158 @@ public:
*/
returnCodeCreator getCreator() const;
+private:
+
/**
- * @brief Stores a copy of the provided Target if there is an error and no
- * Target is already stored
- *
- * This is intended to be used by FAPI_EXEC_HWP to record which target was
- * the subject of a HWP that generated an error.
- *
- * param[in] i_target Reference to Target
+ * @brief If iv_pDataRef is NULL then a new ReturnCodeDataRef is created
*/
- void setErrTarget(const Target & i_target);
+ void ensureDataRefExists();
/**
- * @brief Gets the error target
+ * @brief Forgets about any associated data (PlatData and ErrorInfo)
*
- * @return Target *. Pointer to Target. If NULL then no error Target
+ * If this is the only ReturnCode pointing to the data then the data is
+ * deleted
*/
- Target * getErrTarget() const;
+ void forgetData();
-private:
+ /**
+ * @brief Add a target to callout to the ErrorInfo
+ *
+ * This is called by addErrorInfo
+ *
+ * @param[in] i_target Reference to the target to callout.
+ * @param[in] i_priority The priority of the callout
+ */
+ void addEICallout(const Target & i_target,
+ const CalloutPriority i_priority);
/**
- * @brief Removes interest in pointed to ReturnCodePlatDataRef
+ * @brief Add a target to deconfigure to the ErrorInfo
+ *
+ * This is called by addErrorInfo
+ *
+ * @param[in] i_target Reference to the target to deconfigure.
*/
- void removePlatData();
+ void addEIDeconfigure(const Target & i_target);
/**
- * @brief Removes interest in pointed to ReturnCodeHwpFfdcRef
+ * @brief Add a target to create a GARD record for to the ErrorInfo
+ *
+ * This is called by addErrorInfo
+ *
+ * @param[in] i_target Reference to the target to create a GARD record for
*/
- void removeHwpFfdc();
+ void addEIGard(const Target & i_target);
// The rcValue
uint32_t iv_rcValue;
- // Pointer to ReturnCodePlatDataRef
- ReturnCodePlatDataRef * iv_pPlatDataRef;
+ // Pointer to ReturnCodeDataRef (manages associated data)
+ ReturnCodeDataRef * iv_pDataRef;
+};
+
+/**
+ * @namespace ReturnCodeFfdc
+ *
+ * This namespace contains a template functions for adding FFDC data to a
+ * ReturnCode. They cannot be a ReturnCode member functions because a function
+ * template cannot be specialized within a class
+ */
+namespace ReturnCodeFfdc
+{
+ /**
+ * @brief Enumeration of ErrorInfo FFDC sizes that are used to indicate a
+ * special type that cannot simply be memcopied
+ */
+ enum ErrorInfoFfdcSize
+ {
+ EI_FFDC_SIZE_ECMDDB = -1, // ecmdDataBufferBase
+ };
- // Pointer to ReturnCodeHwpFfdcRef
- ReturnCodeHwpFfdcRef * iv_pHwpFfdcRef;
+ /**
+ * @brief Get FFDC Size
+ *
+ * This is called by the FAPI_SET_HWP_ERROR macro to find out the size of
+ * FFDC data. If the data is of a special type that is handled differently
+ * than types that are simply memcopied then it is handled by a template
+ * specialization
+ *
+ * @return int8_t. Size of the FFDC data
+ */
+ template<typename T>
+ int16_t getErrorInfoFfdcSize(const T &)
+ {
+ return sizeof(T);
+ }
- // Pointer to error Target
- Target * iv_pErrTarget;
-};
+ /**
+ * @brief Get FFDC Size specialization for ecmdDataBufferBase
+ */
+ template<>
+ inline int16_t getErrorInfoFfdcSize<ecmdDataBufferBase>(
+ const ecmdDataBufferBase &)
+ {
+ return EI_FFDC_SIZE_ECMDDB;
+ }
+
+ /**
+ * @brief Compile error if caller tries to get the FFDC size of a pointer
+ *
+ * If this function template is instantiated, the compile will fail due to
+ * the construction of an undefined class.
+ */
+ class Error_PtrPassedToGetErrorInfoFfdcSize;
+ template<typename T>
+ int16_t getErrorInfoFfdcSize(const T *)
+ {
+ Error_PtrPassedToGetErrorInfoFfdcSize();
+ return 0;
+ }
+
+ /**
+ * @brief Add a copy of FFDC to the ErrorInfo in a ReturnCode
+ *
+ * This is called by FFDC HWPs
+ *
+ * @param[out] o_rc Reference to ReturnCode to copy FFDC to
+ * @param[in] i_ffdc Reference to FFDC to copy
+ */
+ template<typename T>
+ void addEIFfdc(ReturnCode & o_rc,
+ const T & i_ffdc)
+ {
+ o_rc.addEIFfdc(&i_ffdc, sizeof(T));
+ }
+
+ /**
+ * @brief Specialization of addEIFfdc for ecmdDataBufferBase
+ *
+ * @param[out] o_rc Reference to ReturnCode to copy FFDC to
+ * @param[in] i_ffdc Reference to ecmdDataBufferBase to copy
+ */
+ template<>
+ inline void addEIFfdc<ecmdDataBufferBase>(ReturnCode & o_rc,
+ const ecmdDataBufferBase & i_ffdc)
+ {
+ // TODO. When real ecmdDataBufferBase is available
+ FAPI_ERR("Adding ecmdDataBufferBase as FFDC TBD");
+ }
+
+ /**
+ * @brief Compile error if caller tries to add a pointer as FFDC
+ *
+ * If this function template is instantiated, the compile will fail due to
+ * the construction of an undefined class.
+ */
+ class Error_PtrPassedToAddEIFfdc;
+ template<typename T>
+ void addEIFfdc(ReturnCode &,
+ const T *)
+ {
+ Error_PtrPassedToAddEIFfdc();
+ }
+}
}
diff --git a/src/include/usr/hwpf/fapi/fapiReturnCodeDataRef.H b/src/include/usr/hwpf/fapi/fapiReturnCodeDataRef.H
index 866dc0737..f0a6b5146 100644
--- a/src/include/usr/hwpf/fapi/fapiReturnCodeDataRef.H
+++ b/src/include/usr/hwpf/fapi/fapiReturnCodeDataRef.H
@@ -23,8 +23,8 @@
/**
* @file fapiReturnCodeDataRef.H
*
- * @brief Defines the ReturnCodeDataRef class that provides a pointer and a
- * reference count to a platform specific ReturnCodeData object.
+ * @brief Defines the ReturnCodeDataRef class that manages the data associated
+ * with a ReturnCode
*/
/*
@@ -34,6 +34,7 @@
* mjjones 04/13/2011 Created.
* mjjones 07/05/2011. Removed const from data
* mjjones 07/25/2011 Added support for FFDC
+ * mjjones 09/22/2100 Added support for Error Info
*/
#ifndef FAPIRETURNCODEDATAREF_H_
@@ -41,6 +42,7 @@
#include <stdint.h>
#include <stddef.h>
+#include <fapiErrorInfo.H>
namespace fapi
{
@@ -48,9 +50,13 @@ namespace fapi
/**
* @class ReturnCodeDataRef
*
- * This class is a simple reference counter. Derived classes are used by a
- * ReturnCode object in order to maintain a count of how many ReturnCode objects
- * have a reference to the object.
+ * This class manages the data associated with a ReturnCode. A ReturnCode
+ * contains a pointer to a ReturnCodeDataRef. When a ReturnCode is copied or
+ * assigned, both ReturnCodes point to the same ReturnCodeDataRef (the data is
+ * not copied) and the ReturnCodeDataRef reference count is incremented. When a
+ * ReturnCode is destructed, the ReturnCodeDataRef reference count is
+ * decremented and if zero, the ReturnCodeDataRef is deleted which deletes the
+ * the data
*
* A ReturnCodeDataRef object is not thread safe, multiple threads must not use
* the same ReturnCodeDataRef object concurrently.
@@ -81,58 +87,24 @@ public:
*/
bool decRefCountCheckZero();
-private:
-
- // Copy constructor and assignment operator disabled
- ReturnCodeDataRef(const ReturnCodeDataRef & i_right);
- ReturnCodeDataRef & operator=(const ReturnCodeDataRef & i_right);
-
- // The reference count (how many ReturnCodes are pointing to this object)
- uint32_t iv_refCount;
-};
-
-/**
- * @class ReturnCodePlatDataRef
- *
- * This class contains a pointer to PlatData and inherits from ReturnCodeDataRef
- * for a reference count recording how many ReturnCodes have a pointer to it.
- *
- * It is used exclusively by the ReturnCode class. Multiple copies of a
- * ReturnCode will all point to the same ReturnCodePlatDataRef. The ReturnCodes
- * maintain the reference count, the last ReturnCode to remove its reference
- * will delete the ReturnCodePlatDataRef which in turn deletes the PlatData.
- * The PlatData pointer is maintained in this class so that releasing the data
- * releases it from all ReturnCode copies.
- *
- * A ReturnCodePlatDataRef object is not thread safe, multiple threads must not
- * use the same ReturnCodePlatDataRef object concurrently.
- */
-class ReturnCodePlatDataRef : public ReturnCodeDataRef
-{
-public:
-
/**
- * @brief Constructor
+ * @brief Associate heap based PlatData (use-case is platform error log)
*
- * @param[in] i_pData Pointer to PlatData to associate
- */
- explicit ReturnCodePlatDataRef(void * i_pData);
-
- /**
- * @brief Destructor
+ * Any existing PlatData is deleted
+ *
+ * @param[in] i_pPlatData Pointer to PlatData to associate
*/
- virtual ~ReturnCodePlatDataRef();
+ void setPlatData(void * i_pPlatData);
/**
- * @brief Get a pointer to any PlatData. ReturnCodePlatDataRef is still
+ * @brief Get a pointer to any PlatData. ReturnCodeDataRef is still
* responsible for deletion of the data. The caller must not delete
*
* The pointer is only meaningful to platform code.
*
- * @return void *. Pointer to PlatData. If NULL then no data (must have been
- * released)
+ * @return void *. Pointer to PlatData. If NULL then no data
*/
- void * getData() const;
+ void * getPlatData() const;
/**
* @brief Get a pointer to any PlatData and release ownership from
@@ -140,82 +112,45 @@ public:
*
* The pointer is only meaningful to platform code.
*
- * @return void *. Pointer to PlatData. If NULL then no data (must have been
- * released)
+ * @return void *. Pointer to PlatData. If NULL then no data
*/
- void * releaseData();
-
-private:
-
- // Copy constructor and assignment operator disabled
- ReturnCodePlatDataRef(const ReturnCodePlatDataRef & i_right);
- ReturnCodePlatDataRef & operator=(const ReturnCodePlatDataRef & i_right);
+ void * releasePlatData();
/**
- * @brief Deletes the PlatData
+ * @brief Get a pointer to any ErrorInfo
*
- * @note Implemented by platform code because only platform code knows the
- * type of the data and how to delete it.
+ * @return ErrorInfo *. Pointer to ErrorInfo. If NULL then no info
*/
- void deleteData();
-
- // Pointer to PlatData
- void * iv_pData;
-};
-
-/**
- * @class ReturnCodeHwpFfdcRef
- *
- * This class contains HwpFfdc and inherits from ReturnCodeDataRef for a
- * reference count recording how many ReturnCodes have a pointer to it.
- *
- * It is used exclusively by the ReturnCode class. Multiple copies of a
- * ReturnCode will all point to the same ReturnCodeHwpFfdcRef. The ReturnCodes
- * maintain the reference count, the last ReturnCode to remove its reference
- * will delete the ReturnCodeHwpFfdcRef which in turn deletes the contained
- * HwpFfdc.
- *
- * A ReturnCodeHwpFfdcRef object is not thread safe, multiple threads must not
- * use the same ReturnCodeHwpFfdcRef object concurrently.
- */
-class ReturnCodeHwpFfdcRef : public ReturnCodeDataRef
-{
-public:
+ ErrorInfo * getErrorInfo();
/**
- * @brief Constructor
+ * @brief Get a reference to the ErrorInfo. If there is no info then
+ * it is created (empty)
*
- * @param[in] i_pFfdc Pointer to the FFDC to copy
- * @param[in] i_size Size of the FFDC to copy
+ * @return ErrorInfo &. Reference to ErrorInfo.
*/
- ReturnCodeHwpFfdcRef(const void * i_pFfdc,
- const uint32_t i_size);
+ ErrorInfo & getCreateErrorInfo();
- /**
- * @brief Destructor
- */
- virtual ~ReturnCodeHwpFfdcRef();
+private:
/**
- * @brief Get a pointer to the HwpFfdc.
- *
- * @param[out] o_size Size of the FFDC data in bytes.
- *
- * @return void *. Pointer to HwpFfdc.
+ * @brief Delete any associated PlatData. Implemented by platform code
+ * because only platform code knows the type of the data.
*/
- const void * getData(uint32_t & o_size) const;
-
-private:
+ void deletePlatData();
// Copy constructor and assignment operator disabled
- ReturnCodeHwpFfdcRef(const ReturnCodeHwpFfdcRef & i_right);
- ReturnCodeHwpFfdcRef & operator=(const ReturnCodeHwpFfdcRef & i_right);
+ ReturnCodeDataRef(const ReturnCodeDataRef & i_right);
+ ReturnCodeDataRef & operator=(const ReturnCodeDataRef & i_right);
+
+ // The reference count (how many ReturnCodes are pointing to this object)
+ uint32_t iv_refCount;
- // Pointer to HwpFfdc
- uint8_t * iv_pFfdc;
+ // Pointer to associated PlatData
+ void * iv_pPlatData;
- // Size of HwpFfdc
- uint32_t iv_size;
+ // Pointer to HWP Error Information
+ ErrorInfo * iv_pErrorInfo;
};
}
diff --git a/src/include/usr/hwpf/fapi/fapiReturnCodes.H b/src/include/usr/hwpf/fapi/fapiReturnCodes.H
index 525ec0a32..3c31a72c0 100644
--- a/src/include/usr/hwpf/fapi/fapiReturnCodes.H
+++ b/src/include/usr/hwpf/fapi/fapiReturnCodes.H
@@ -34,6 +34,7 @@
* mjjones 06/07/2011 Add FAPI_RC_NOT_IMPLEMENTED
* mjjones 06/30/2011 Add FAPI_RC_ATTR_UNIT_TEST_FAIL
* mjjones 08/10/2011 Add FAPI_RC_FFDC_HWP_NOT_FOUND
+ * mjjones 09/23/2011 Remove FAPI_RC_FFDC_HWP_NOT_FOUND
*
*/
@@ -61,7 +62,6 @@ enum
// FAPI generated return codes
FAPI_RC_NOT_IMPLEMENTED = FAPI_RC_FAPI_MASK | 0x01,
FAPI_RC_ATTR_UNIT_TEST_FAIL = FAPI_RC_FAPI_MASK | 0x02,
- FAPI_RC_FFDC_HWP_NOT_FOUND = FAPI_RC_FAPI_MASK | 0x03,
// PLAT generated return codes
FAPI_RC_PLAT_ERR_SEE_DATA = FAPI_RC_PLAT_MASK | 0x01,
diff --git a/src/include/usr/hwpf/fapi/fapiUtil.H b/src/include/usr/hwpf/fapi/fapiUtil.H
index 0a7ced618..3c2978ff3 100644
--- a/src/include/usr/hwpf/fapi/fapiUtil.H
+++ b/src/include/usr/hwpf/fapi/fapiUtil.H
@@ -36,6 +36,7 @@
* mjjones 07/05/2011 Removed rogue tab
* camvanng 09/06/2011 Added fapiLogError
* mjjones 09/14/2011 Prepended fapi to delay
+ * mjjones 10/05/2011 Added fapiCheckType
*
*/
@@ -124,6 +125,14 @@ bool platIsScanTraceEnabled();
*/
void platSetScanTrace( bool i_enable );
+/**
+ * @brief Check the type of a variable
+ *
+ * This function can be called to check that a variable type is as expected
+ */
+template<typename T>
+void fapiCheckType(const T &) {}
+
}
#endif // FAPIUTIL_H_
diff --git a/src/include/usr/hwpf/hwp/fapiFfdcHwpData.H b/src/include/usr/hwpf/hwp/fapiFfdcHwpData.H
deleted file mode 100644
index 2ce8cf5ff..000000000
--- a/src/include/usr/hwpf/hwp/fapiFfdcHwpData.H
+++ /dev/null
@@ -1,54 +0,0 @@
-// IBM_PROLOG_BEGIN_TAG
-// This is an automatically generated prolog.
-//
-// $Source: src/include/usr/hwpf/hwp/fapiFfdcHwpData.H $
-//
-// IBM CONFIDENTIAL
-//
-// COPYRIGHT International Business Machines Corp. 2011
-//
-// p1
-//
-// Object Code Only (OCO) source materials
-// Licensed Internal Code Source Materials
-// IBM HostBoot Licensed Internal Code
-//
-// The source code for this program is not published or other-
-// wise divested of its trade secrets, irrespective of what has
-// been deposited with the U.S. Copyright Office.
-//
-// Origin: 30
-//
-// IBM_PROLOG_END
-/**
- * @file fapiFfdcHwpData.H
- *
- * @brief Defines all FFDC data that can be returned by FFDC HWPs
- */
-
-/*
- * Change Log ******************************************************************
- * Flag Defect/Feature User Date Description
- * ------ -------------- ---------- ----------- ----------------------------
- * mjjones 08/08/2011 Created.
- *
- */
-
-#ifndef FAPIFFDCHWPDATA_H_
-#define FAPIFFDCHWPDATA_H_
-
-namespace fapi
-{
-
-/**
- * @brief An FFDC structure contining a single uint64_t of data
- */
-struct TestFfdc1
-{
- uint64_t iv_data;
-};
-
-}
-
-#endif // FAPIFFDCHWPDATA_H_
-
diff --git a/src/include/usr/hwpf/hwp/fapiTestHwpFfdc.H b/src/include/usr/hwpf/hwp/fapiTestHwpFfdc.H
index 0ae24f4e2..84620b133 100644
--- a/src/include/usr/hwpf/hwp/fapiTestHwpFfdc.H
+++ b/src/include/usr/hwpf/hwp/fapiTestHwpFfdc.H
@@ -38,7 +38,6 @@
#define FAPITESTHWPFFDC_H_
#include <fapi.H>
-#include <fapiFfdcHwpData.H>
// HWPs are defined as C functions because platforms may wish to package them
// in linux shared libraries which are DL-Opened
@@ -48,13 +47,13 @@ extern "C"
/**
* @brief Simple FFDC HWP that collects TestFfdc1 data
*
- * @param[in] i_target Reference to target (unused by HWP)
- * @param[out] o_ffdc Reference to TestFfdc1 that is filled in with FFDC
+ * @param[in] i_target Reference to target (unused by this HWP)
+ * @param[out] o_rc Reference to ReturnCode that is updated with FFDC
*
* @return ReturnCode
*/
fapi::ReturnCode hwpTestFfdc1(const fapi::Target & i_target,
- fapi::TestFfdc1 & o_ffdc);
+ fapi::ReturnCode & o_rc);
} // extern "C"
diff --git a/src/include/usr/hwpf/plat/fapiPlatHwpExecutor.H b/src/include/usr/hwpf/plat/fapiPlatHwpExecutor.H
index f751ffaf2..69e904e23 100644
--- a/src/include/usr/hwpf/plat/fapiPlatHwpExecutor.H
+++ b/src/include/usr/hwpf/plat/fapiPlatHwpExecutor.H
@@ -42,10 +42,9 @@
/**
* @brief HWP Executor macro
*
- * By default, this macro just calls the HWP directly. If this cannot be done
- * then the platform needs to modify
+ * Call the HWP directly.
*/
-#define FAPI_PLAT_EXEC_HWP(RC, FUNC, TARGET, _args_...) \
- RC = FUNC(TARGET, ##_args_)
+#define FAPI_PLAT_EXEC_HWP(RC, FUNC, _args_...) \
+ RC = FUNC(_args_)
#endif // FAPIPLATHWPEXECUTOR_H_
diff --git a/src/include/usr/hwpf/plat/fapiPlatHwpInvoker.H b/src/include/usr/hwpf/plat/fapiPlatHwpInvoker.H
index f3bacfc99..3f9c78777 100644
--- a/src/include/usr/hwpf/plat/fapiPlatHwpInvoker.H
+++ b/src/include/usr/hwpf/plat/fapiPlatHwpInvoker.H
@@ -44,13 +44,14 @@
*
* ERRHNDL - errlHndl_t
* FUNC - HWP function name
- * FAPITARGET - fapi::Target (first parameter of all HWPs)
* _args_... - Any additional arguments that the HWP requires
*/
-#define FAPI_INVOKE_HWP(ERRHNDL, FUNC, FAPITARGET, _args_...) \
+#define FAPI_INVOKE_HWP(ERRHNDL, FUNC, _args_...) \
+ {\
fapi::ReturnCode l_rc; \
- FAPI_EXEC_HWP(l_rc, FUNC, FAPITARGET, ##_args_); \
- ERRHNDL = fapi::fapiRcToErrl(l_rc)
+ FAPI_EXEC_HWP(l_rc, FUNC, ##_args_); \
+ ERRHNDL = fapi::fapiRcToErrl(l_rc); \
+ }
namespace fapi
{
OpenPOWER on IntegriCloud