diff options
| author | Mike Jones <mjjones@us.ibm.com> | 2011-08-12 11:03:30 -0500 |
|---|---|---|
| committer | Nicholas E. Bofferding <bofferdn@us.ibm.com> | 2011-08-19 15:08:51 -0500 |
| commit | 2935ed01dae82a91c1bb4c181fd36cc42b2efaf9 (patch) | |
| tree | edbde05a7cf666342b704b2eb069e6dfbcbd96c5 /src/usr/hwpf/fapi/fapiErrorInfoMem.C | |
| parent | 02991f3ecb7356dc989148710e7ca40df0f7437c (diff) | |
| download | blackbird-hostboot-2935ed01dae82a91c1bb4c181fd36cc42b2efaf9.tar.gz blackbird-hostboot-2935ed01dae82a91c1bb4c181fd36cc42b2efaf9.zip | |
HWPF Error Info Support
Change-Id: Ib060599a4b64e768cbc75184a050e851c0a39c4e
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/250
Tested-by: Jenkins Server
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com>
Diffstat (limited to 'src/usr/hwpf/fapi/fapiErrorInfoMem.C')
| -rw-r--r-- | src/usr/hwpf/fapi/fapiErrorInfoMem.C | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/src/usr/hwpf/fapi/fapiErrorInfoMem.C b/src/usr/hwpf/fapi/fapiErrorInfoMem.C new file mode 100644 index 000000000..0803eea96 --- /dev/null +++ b/src/usr/hwpf/fapi/fapiErrorInfoMem.C @@ -0,0 +1,76 @@ +/** + * @file fapiErrorInfoMem.C + * + * @brief Implements the ErrorInfoRepositoryMem class + */ + +/* + * Change Log ****************************************************************** + * Flag Defect/Feature User Date Description + * ------ -------------- ---------- ----------- ---------------------------- + * mjjones 08/08/2011 Created + */ + +#include <fapiErrorInfoMem.H> +#include <fapiPlatTrace.H> + +namespace fapi +{ + +//****************************************************************************** +// ErrorInfoRepository Instance function +//****************************************************************************** +ErrorInfoRepository& ErrorInfoRepository::Instance() +{ + // Use a static function variable. The ErrorInfoRepositoryMem singleton will + // be constructed on the first call to this function. + static ErrorInfoRepositoryMem instance; + return instance; +} + +//****************************************************************************** +// ErrorInfoRepositoryMem Default Constructor +//****************************************************************************** +ErrorInfoRepositoryMem::ErrorInfoRepositoryMem() +{ + // Initialize the repository with records + init(); +} + +//****************************************************************************** +// ErrorInfoRepositoryMem Destructor +//****************************************************************************** +ErrorInfoRepositoryMem::~ErrorInfoRepositoryMem() +{ + // Does nothing +} + +//****************************************************************************** +// ErrorInfoRepositoryMem find function +//****************************************************************************** +ReturnCode ErrorInfoRepositoryMem::find(const uint32_t i_rc, + ErrorInfoRecord & o_record) +{ + // Iterate over vector of tables, until the correct one is found + ErrorInfoRecordItr_t l_it; + + for (l_it = iv_errorInfoRecords.begin(); l_it != iv_errorInfoRecords.end(); + ++l_it) + { + if ((*l_it).iv_rc == i_rc) + { + FAPI_INF("ErrorInfoRepositoryMem: Found record, rc: 0x%x", i_rc); + o_record = *l_it; + break; + } + } + + if (l_it == iv_errorInfoRecords.end()) + { + FAPI_ERR("ErrorInfoRepositoryMem: Not found record, rc: 0x%x", i_rc); + } + + return FAPI_RC_SUCCESS; +} + +} |

