diff options
| author | Donald Washburn <dwashbur@us.ibm.com> | 2017-06-02 09:37:28 -0500 |
|---|---|---|
| committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2017-06-09 14:23:21 -0400 |
| commit | 6988e53d4cdcb55fadce30c4e2c29fd09098bf32 (patch) | |
| tree | 2ba05467aaba5fc91cffa6c3162bae241d1185cd /src/usr/fapi2/test/rcSupport.C | |
| parent | 88eb1def152e5171451da346df9dd5738f15d7de (diff) | |
| download | talos-hostboot-6988e53d4cdcb55fadce30c4e2c29fd09098bf32.tar.gz talos-hostboot-6988e53d4cdcb55fadce30c4e2c29fd09098bf32.zip | |
Verify buffer support for error log.
Added Unit Tests to verify that a caller buffer is propageted
to the error log through an FAPI_INVOKE_HWP call. The Unit Tests
use both a fapi2::buffer<uin64_t> and a fapi2::variable_buffer types.
Presently, support for using fapi2::variable_buffer is disabled in
the code base. The unit tests for the variable_buffer is also disabled.
To enable fapi2::variable buffer support the parseErrorInfo.pl script
must be invoked with the --use_variable_buffers option. This can be
done by adding the --use_variable_buffers option to the
parseErrorInfo_RUN macro located in
import/hwpf/fapi2/tools/parseErrorInfo.mk.
RTC: 161195
Change-Id: I0e372dc72e749f635517eb1752e3ca1ec4d2195b
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/41310
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Reviewed-by: Prachi Gupta <pragupta@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/fapi2/test/rcSupport.C')
| -rw-r--r-- | src/usr/fapi2/test/rcSupport.C | 91 |
1 files changed, 89 insertions, 2 deletions
diff --git a/src/usr/fapi2/test/rcSupport.C b/src/usr/fapi2/test/rcSupport.C index f0ebed58d..537f8567f 100644 --- a/src/usr/fapi2/test/rcSupport.C +++ b/src/usr/fapi2/test/rcSupport.C @@ -34,6 +34,19 @@ #include <rcSupport.H> #include <plat_hwp_invoker.H> +#include <hwp_error_info.H> +#include <hwp_ffdc_classes.H> + +const uint64_t FAPI2_TEST_BUFFER_VALUE = 0x123456789ABCDEF; +const uint32_t FAPI2_TEST_VARIABLE_BUFFER_VALUE[] = + { + 0x12345678, + 0x9ABCDEF + }; +const uint32_t VARIABLE_BUFFER_ELEMENTS = + sizeof(FAPI2_TEST_VARIABLE_BUFFER_VALUE)/ + sizeof(FAPI2_TEST_VARIABLE_BUFFER_VALUE[0]); + //****************************************************************************** // p9_ffdc_fail. Returns a fapi2::ReturnCode with an ffdc entry @@ -65,10 +78,9 @@ fapi2::ReturnCode p9_registerFfdc_fail( FAPI_ASSERT(0, fapi2::TEST_ERROR_A().set_TARGET(i_proc_target)); - fapi_try_exit: +fapi_try_exit: FAPI_INF("Exiting p9_registerFfdc_fail..."); - return fapi2::current_err; } @@ -167,3 +179,78 @@ fapi2::ReturnCode p9_hwCallout( return fapi2::current_err; } + +//**************************************************************************** +// p9ErrorWithBuffer +// Force an error that will use a caller populated fapi2::buffer<> +//**************************************************************************** +fapi2::ReturnCode p9ErrorWithBuffer( + fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target) +{ + FAPI_INF("Entering p9ErrorWithBuffer"); + + fapi2::buffer<uint64_t> l_userBuffer{FAPI2_TEST_BUFFER_VALUE}; + + //Parameter type for the p9_collect_some_ffdc function. + //Can be 0x01 or 0x02. Has relevence for ErrorInfo objects + //not related to this test. + uint32_t l_paramValue = 0x01; + + fapi2::current_err = fapi2::FAPI2_RC_INVALID_PARAMETER; + + FAPI_ASSERT(false, + fapi2::PROC_EXAMPLE_ERROR().set_BUFFER(l_userBuffer) + .set_parm1(l_paramValue) + .set_UNIT_TEST_CHIP_TARGET(i_target), + "p9ErrorWithBuffer Unit Test" + ); + +fapi_try_exit: + FAPI_INF("Exiting p9ErrorWithBuffer"); + return fapi2::current_err; +} + +#if 0 +//The generated classes in hwp_ffdc_classes.H are not produced to support +//fapi2::variable_buffer.In order to enable the following function the +//parseErrorInfo.pl script must be configured to use variable buffers. +//To enable variable buffer support ensure that the parseErrorInfo_RUN +//macro in import/hwpf/fapi2/tools/parseErrorInfo.mk is defined to +//include the --use-variable-buffers option as shown below. +//$(C1) $$< --use-variable-buffers --output-dir=$$($(GENERATED)_PATH) ... +// +//**************************************************************************** +// p9ErrorWithVariableBuffer +// Force an error that will use a caller populated fapi2::variable_buffer +//**************************************************************************** +fapi2::ReturnCode p9ErrorWithVariableBuffer( + fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP>& i_target) +{ + FAPI_INF("Entering p9ErrorWithVariableBuffer"); + + fapi2::variable_buffer l_userBuffer(FAPI2_TEST_VARIABLE_BUFFER_VALUE, + VARIABLE_BUFFER_ELEMENTS, + VARIABLE_BUFFER_ELEMENTS*32 + ); + + //Parameter type for the p9_collect_some_ffdc function. + //Can be 0x01 or 0x02. Has relevence for ErrorInfo objects + //not related to this test + uint32_t l_paramValue = 0x01; + + fapi2::current_err = fapi2::FAPI2_RC_INVALID_PARAMETER; + + FAPI_ASSERT(false, + fapi2::PROC_EXAMPLE_ERROR().set_BUFFER(l_userBuffer) + .set_parm1(l_paramValue) + .set_UNIT_TEST_CHIP_TARGET(i_target), + "p9ErrorWithVariableBuffer Unit Test" + ); + +fapi_try_exit: + FAPI_INF("Exiting p9ErrorWithVariableBuffer"); + return fapi2::current_err; +} +#endif + + |

