diff options
author | Mike Jones <mjjones@us.ibm.com> | 2011-10-17 14:24:16 -0500 |
---|---|---|
committer | MIKE J. JONES <mjjones@us.ibm.com> | 2011-10-17 14:43:20 -0500 |
commit | ed476565dd6a2881c3823e92372e2fdee672478c (patch) | |
tree | 175da8a8efc3e818d57107cae979489d8b391e3b /src | |
parent | c728faf93232e211ebd59ce830ed54bea1698917 (diff) | |
download | talos-hostboot-ed476565dd6a2881c3823e92372e2fdee672478c.tar.gz talos-hostboot-ed476565dd6a2881c3823e92372e2fdee672478c.zip |
HWPF: Add function pointer to HWP header files
Change-Id: I61cd4ac09b19ce585769b52a0657bb19de65ad3c
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/438
Tested-by: Jenkins Server
Reviewed-by: MIKE J. JONES <mjjones@us.ibm.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/include/usr/hwpf/hwp/fapiTestHwp.H | 16 | ||||
-rw-r--r-- | src/include/usr/hwpf/hwp/fapiTestHwpAnalyzeError.H | 59 | ||||
-rwxr-xr-x | src/include/usr/hwpf/hwp/fapiTestHwpAttr.H | 9 | ||||
-rw-r--r-- | src/include/usr/hwpf/hwp/fapiTestHwpConfig.H | 8 | ||||
-rw-r--r-- | src/include/usr/hwpf/hwp/fapiTestHwpError.H | 10 | ||||
-rw-r--r-- | src/include/usr/hwpf/hwp/fapiTestHwpFfdc.H | 10 | ||||
-rw-r--r-- | src/include/usr/hwpf/plat/fapiPlatHwpExecutor.H | 1 | ||||
-rw-r--r-- | src/usr/hwpf/hwp/fapiTestHwpAnalyzeError.C | 67 | ||||
-rw-r--r-- | src/usr/hwpf/hwp/fapiTestHwpError.C | 30 | ||||
-rw-r--r-- | src/usr/hwpf/hwp/makefile | 1 |
10 files changed, 157 insertions, 54 deletions
diff --git a/src/include/usr/hwpf/hwp/fapiTestHwp.H b/src/include/usr/hwpf/hwp/fapiTestHwp.H index eb7e47cda..12349e737 100644 --- a/src/include/usr/hwpf/hwp/fapiTestHwp.H +++ b/src/include/usr/hwpf/hwp/fapiTestHwp.H @@ -33,16 +33,16 @@ * mjjones 04/21/2011 Created. * mjjones 06/28/2011 Updated comment * mjjones 08/11/2011 Removed Clock HWP - * + * mjjones 10/17/2011 Added func pointer */ -#ifndef FAPITESTHWPROC_H_ -#define FAPITESTHWPROC_H_ +#ifndef FAPITESTHW_H_ +#define FAPITESTHW_H_ #include <fapi.H> -// HWPs are defined as C functions because platforms may wish to package them -// in linux shared libraries which are DL-Opened +typedef fapi::ReturnCode (*hwpInitialTest_FP_t)(const fapi::Target &); + extern "C" { @@ -55,8 +55,6 @@ extern "C" */ fapi::ReturnCode hwpInitialTest(const fapi::Target & i_chip); +} - -} // extern "C" - -#endif // FAPITESTHWPROC_H_ +#endif diff --git a/src/include/usr/hwpf/hwp/fapiTestHwpAnalyzeError.H b/src/include/usr/hwpf/hwp/fapiTestHwpAnalyzeError.H new file mode 100644 index 000000000..85bb19975 --- /dev/null +++ b/src/include/usr/hwpf/hwp/fapiTestHwpAnalyzeError.H @@ -0,0 +1,59 @@ +// IBM_PROLOG_BEGIN_TAG +// This is an automatically generated prolog. +// +// $Source: src/include/usr/hwpf/hwp/fapiTestHwpAnalyzeError.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 fapiTestHwpAnalyzeError.H + * + * @brief Defines a simple test Hardware Procedure that returns an error + */ + +/* + * Change Log ****************************************************************** + * Flag Defect/Feature User Date Description + * ------ -------------- ---------- ----------- ---------------------------- + * mjjones 08/08/2011 Created. Moved from other file + * + */ + +#ifndef FAPITESTHWPANALYZEERROR_H_ +#define FAPITESTHWPANALYZEERROR_H_ + +#include <fapi.H> + +typedef fapi::ReturnCode (*hwpTestAnalyzeError_FP_t)(const fapi::Target &); + +extern "C" +{ + +/** + * @brief Simple HWP that analyzes an error and returns an error describing the + * problem (RC_TEST_ERROR_B) + * + * @param[in] i_target Reference to target (unused by HWP) + * + * @return ReturnCode + */ +fapi::ReturnCode hwpTestAnalyzeError(const fapi::Target & i_target); + +} + +#endif diff --git a/src/include/usr/hwpf/hwp/fapiTestHwpAttr.H b/src/include/usr/hwpf/hwp/fapiTestHwpAttr.H index cdf7e6afb..1bb9481b6 100755 --- a/src/include/usr/hwpf/hwp/fapiTestHwpAttr.H +++ b/src/include/usr/hwpf/hwp/fapiTestHwpAttr.H @@ -32,6 +32,7 @@ * ------ -------------- ---------- ----------- ---------------------------- * mjjones 06/30/2011 Created. * mjjones 10/07/2011 Removed target param + * mjjones 10/17/2011 Added func pointer */ #ifndef FAPITESTHWPATTR_H_ @@ -39,8 +40,8 @@ #include <fapi.H> -// HWPs are defined as C functions because platforms may wish to package them -// in linux shared libraries which are DL-Opened +typedef fapi::ReturnCode (*hwpTestAttributes_FP_t)(); + extern "C" { @@ -51,6 +52,6 @@ extern "C" */ fapi::ReturnCode hwpTestAttributes(); -} // extern "C" +} -#endif // FAPITESTHWPATTR_H_ +#endif diff --git a/src/include/usr/hwpf/hwp/fapiTestHwpConfig.H b/src/include/usr/hwpf/hwp/fapiTestHwpConfig.H index 4faec30ef..fd2fb4be2 100644 --- a/src/include/usr/hwpf/hwp/fapiTestHwpConfig.H +++ b/src/include/usr/hwpf/hwp/fapiTestHwpConfig.H @@ -32,7 +32,7 @@ * Flag Defect/Feature User Date Description * ------ -------------- ---------- ----------- ---------------------------- * mjjones 09/12/2011 Created. - * + * mjjones 10/17/2011 Added func pointer */ #ifndef FAPITESTHWCONFIG_H_ @@ -40,8 +40,8 @@ #include <fapi.H> -// HWPs are defined as C functions because platforms may wish to package them -// in linux shared libraries which are DL-Opened +typedef fapi::ReturnCode (*hwpTestConfig_FP_t)(const fapi::Target &); + extern "C" { @@ -54,6 +54,6 @@ extern "C" */ fapi::ReturnCode hwpTestConfig(const fapi::Target & i_chip); -} // extern "C" +} #endif diff --git a/src/include/usr/hwpf/hwp/fapiTestHwpError.H b/src/include/usr/hwpf/hwp/fapiTestHwpError.H index 4a6bcdd2e..2c18ba0ec 100644 --- a/src/include/usr/hwpf/hwp/fapiTestHwpError.H +++ b/src/include/usr/hwpf/hwp/fapiTestHwpError.H @@ -31,7 +31,7 @@ * Flag Defect/Feature User Date Description * ------ -------------- ---------- ----------- ---------------------------- * mjjones 08/08/2011 Created. - * + * mjjones 10/17/2011 Added func pointer */ #ifndef FAPITESTHWPERROR_H_ @@ -39,8 +39,8 @@ #include <fapi.H> -// HWPs are defined as C functions because platforms may wish to package them -// in linux shared libraries which are DL-Opened +typedef fapi::ReturnCode (*hwpTestError_FP_t)(const fapi::Target &); + extern "C" { @@ -53,6 +53,6 @@ extern "C" */ fapi::ReturnCode hwpTestError(const fapi::Target & i_target); -} // extern "C" +} -#endif // FAPITESTHWPERROR_H_ +#endif diff --git a/src/include/usr/hwpf/hwp/fapiTestHwpFfdc.H b/src/include/usr/hwpf/hwp/fapiTestHwpFfdc.H index 84620b133..cde3042b7 100644 --- a/src/include/usr/hwpf/hwp/fapiTestHwpFfdc.H +++ b/src/include/usr/hwpf/hwp/fapiTestHwpFfdc.H @@ -31,7 +31,7 @@ * Flag Defect/Feature User Date Description * ------ -------------- ---------- ----------- ---------------------------- * mjjones 08/08/2011 Created. - * + * mjjones 10/17/2011 Added func pointer */ #ifndef FAPITESTHWPFFDC_H_ @@ -39,8 +39,8 @@ #include <fapi.H> -// HWPs are defined as C functions because platforms may wish to package them -// in linux shared libraries which are DL-Opened +typedef fapi::ReturnCode (*hwpTestFfdc1_FP_t)(const fapi::Target &, fapi::ReturnCode &); + extern "C" { @@ -55,6 +55,6 @@ extern "C" fapi::ReturnCode hwpTestFfdc1(const fapi::Target & i_target, fapi::ReturnCode & o_rc); -} // extern "C" +} -#endif // FAPITESTHWPFFDC_H_ +#endif diff --git a/src/include/usr/hwpf/plat/fapiPlatHwpExecutor.H b/src/include/usr/hwpf/plat/fapiPlatHwpExecutor.H index aeef2a485..b3441ea9b 100644 --- a/src/include/usr/hwpf/plat/fapiPlatHwpExecutor.H +++ b/src/include/usr/hwpf/plat/fapiPlatHwpExecutor.H @@ -36,6 +36,7 @@ #include <fapiTestHwp.H> #include <fapiTestHwpError.H> +#include <fapiTestHwpAnalyzeError.H> #include <fapiTestHwpFfdc.H> #include <fapiTestHwpConfig.H> #include <fapiTestHwpAttr.H> diff --git a/src/usr/hwpf/hwp/fapiTestHwpAnalyzeError.C b/src/usr/hwpf/hwp/fapiTestHwpAnalyzeError.C new file mode 100644 index 000000000..397fe5c5a --- /dev/null +++ b/src/usr/hwpf/hwp/fapiTestHwpAnalyzeError.C @@ -0,0 +1,67 @@ +// IBM_PROLOG_BEGIN_TAG +// This is an automatically generated prolog. +// +// $Source: src/usr/hwpf/hwp/fapiTestHwpAnalyzeError.C $ +// +// 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 fapiTestHwpAnalyzeError.C + * + * @brief Implements a simple test Hardware Procedure that analyzes an error + */ + +/* + * Change Log ****************************************************************** + * Flag Defect/Feature User Date Description + * ------ -------------- ---------- ----------- ---------------------------- + * mjjones 10/17/2011 Created (moved from other file) + */ + +#include <fapiTestHwpAnalyzeError.H> + +extern "C" +{ + +//****************************************************************************** +// hwpTestAnalyzeError function +//****************************************************************************** +fapi::ReturnCode hwpTestAnalyzeError(const fapi::Target & i_target) +{ + FAPI_INF("hwpTestAnalyzeError: Start HWP (analysis HWP)"); + + // This HWP analyses an error condition to decide what the error actually is + // In real life, this HWP may look at chip error registers + fapi::ReturnCode l_rc; + + // Local FFDC that needs to be captured + uint32_t l_ffdc = 0x12345678; + + // Analysis reveals that the error is RC_TEST_ERROR_A + FAPI_ERR("hwpTestAnalyzeError: Generating RC_TEST_ERROR_A"); + + // Generate error + const fapi::Target & MASTER_CHIP = i_target; + uint32_t & FFDC_DATA_1 = l_ffdc; + FAPI_SET_HWP_ERROR(l_rc, RC_TEST_ERROR_A); + + FAPI_INF("hwpTestAnalyzeError: End HWP"); + return l_rc; +} + +} diff --git a/src/usr/hwpf/hwp/fapiTestHwpError.C b/src/usr/hwpf/hwp/fapiTestHwpError.C index e0d2ef6da..bf0779ad9 100644 --- a/src/usr/hwpf/hwp/fapiTestHwpError.C +++ b/src/usr/hwpf/hwp/fapiTestHwpError.C @@ -35,6 +35,7 @@ * fapiLogError * mjjones 10/06/2011 Major updates due to new * ErrorInfo design + * mjjones 10/17/2011 Moved AnalyzeError to new file * */ @@ -44,31 +45,6 @@ extern "C" { //****************************************************************************** -// hwpTestAnalyzeError function -//****************************************************************************** -fapi::ReturnCode hwpTestAnalyzeError(const fapi::Target & i_target) -{ - FAPI_INF("hwpTestAnalyzeError: Start HWP (analysis HWP)"); - - // This HWP analyses an error condition to decide what the error actually is - // In real life, this HWP may look at chip error registers - fapi::ReturnCode l_rc; - - // Local FFDC that needs to be captured - uint32_t l_ffdc = 0x12345678; - - // Analysis reveals that the error is RC_TEST_ERROR_A - FAPI_ERR("hwpTestAnalyzeError: Generating RC_TEST_ERROR_A"); - - const fapi::Target & MASTER_CHIP = i_target; - uint32_t & FFDC_DATA_1 = l_ffdc; - FAPI_SET_HWP_ERROR(l_rc, RC_TEST_ERROR_A); - - FAPI_INF("hwpTestAnalyzeError: End HWP"); - return l_rc; -} - -//****************************************************************************** // hwpTestError function //****************************************************************************** fapi::ReturnCode hwpTestError(const fapi::Target & i_target) @@ -93,7 +69,7 @@ fapi::ReturnCode hwpTestError(const fapi::Target & i_target) "expected success", static_cast<uint32_t>(l_rc)); } - // Reset the return code + // Generate the same error again FAPI_ERR("hwpTestError: Generating RC_TEST_ERROR_B"); FAPI_SET_HWP_ERROR(l_rc, RC_TEST_ERROR_B); @@ -101,4 +77,4 @@ fapi::ReturnCode hwpTestError(const fapi::Target & i_target) return l_rc; } -} // extern "C" +} diff --git a/src/usr/hwpf/hwp/makefile b/src/usr/hwpf/hwp/makefile index 25ed0e18d..f2401f2d5 100644 --- a/src/usr/hwpf/hwp/makefile +++ b/src/usr/hwpf/hwp/makefile @@ -30,6 +30,7 @@ EXTRAINCDIR += ${ROOTPATH}/src/include/usr/hwpf/plat OBJS = fapiTestHwp.o \ fapiTestHwpError.o \ + fapiTestHwpAnalyzeError.o \ fapiTestHwpFfdc.o \ fapiTestHwpConfig.o \ fapiTestHwpAttr.o |