diff options
author | Doug Gilbert <dgilbert@us.ibm.com> | 2013-09-18 16:15:48 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2013-10-17 11:26:14 -0500 |
commit | 25a68ad9643b83001dbe80120f854221e65e9585 (patch) | |
tree | e635de6c5c07e2f99a309256c8bcf69ca495034d /src/usr/errl/errlsrc.C | |
parent | 63245d62a4ffe99ad2eaf6b4f1a88862065ceedf (diff) | |
download | talos-hostboot-25a68ad9643b83001dbe80120f854221e65e9585.tar.gz talos-hostboot-25a68ad9643b83001dbe80120f854221e65e9585.zip |
Hostboot runtime errl support
RTC: 79415
Change-Id: I2fd60b48046425692fb3921b46ac21b57e1dba96
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/6349
Tested-by: Jenkins Server
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/errl/errlsrc.C')
-rw-r--r-- | src/usr/errl/errlsrc.C | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/usr/errl/errlsrc.C b/src/usr/errl/errlsrc.C index 69d29e18a..41df75b27 100644 --- a/src/usr/errl/errlsrc.C +++ b/src/usr/errl/errlsrc.C @@ -168,6 +168,33 @@ uint64_t ErrlSrc::flatten( void * o_pBuffer, const uint64_t i_cbBuffer ) return l_rc; } +uint64_t ErrlSrc::unflatten( const void * i_buf) +{ + const pelSRCSection_t * p = + static_cast<const pelSRCSection_t *>(i_buf); + + iv_header.unflatten(&(p->sectionheader)); + + iv_srcType = (srcType_t)((16 * aschex2bin(p->srcString[0])) + + aschex2bin(p->srcString[1])); + iv_modId = p->moduleId; + iv_reasonCode = p->reserved1; + iv_ssid = (epubSubSystem_t)((16 * aschex2bin(p->srcString[2])) + + aschex2bin(p->srcString[3])); + iv_user1 = p->word6; + iv_user2 = p->word8; + + return flatSize(); +} + +uint64_t ErrlSrc::aschex2bin(char c) +{ + if(c >= 'a') c = c + 10 - 'a'; + else if (c >= 'A') c = c + 10 - 'A'; + else c -= '0'; + + return c; +} } // namespace |