summaryrefslogtreecommitdiffstats
path: root/src/usr/errl/errlsrc.C
diff options
context:
space:
mode:
authorDoug Gilbert <dgilbert@us.ibm.com>2013-10-17 18:06:05 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2013-10-18 10:55:10 -0500
commit2352fc5219ab644c3cd2052aeffc67deef6e0eba (patch)
tree693f63298f37be91cbc072ca873147f374f84e5c /src/usr/errl/errlsrc.C
parentf295d04afe1f94651f8c7f583419cbba5bca0e72 (diff)
downloadtalos-hostboot-2352fc5219ab644c3cd2052aeffc67deef6e0eba.tar.gz
talos-hostboot-2352fc5219ab644c3cd2052aeffc67deef6e0eba.zip
HB and HBRT errl unflatten fixes
Change-Id: I7734d9d99fa5b4148c94e0334c5545e09ab46e9b Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/6738 Tested-by: Jenkins Server Reviewed-by: Brian H. Horton <brianh@linux.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.C29
1 files changed, 25 insertions, 4 deletions
diff --git a/src/usr/errl/errlsrc.C b/src/usr/errl/errlsrc.C
index 41df75b27..b9552680f 100644
--- a/src/usr/errl/errlsrc.C
+++ b/src/usr/errl/errlsrc.C
@@ -158,7 +158,7 @@ uint64_t ErrlSrc::flatten( void * o_pBuffer, const uint64_t i_cbBuffer )
l_u32 = (iv_srcType<< 24)|(iv_ssid<<16)| iv_reasonCode;
char l_tmpString[ 20 ];
- uint64_t cb = sprintf( l_tmpString, "%X", l_u32 );
+ uint64_t cb = sprintf( l_tmpString, "%08X", l_u32 );
memcpy( psrc->srcString, l_tmpString, cb );
l_rc = flatSize();
@@ -184,14 +184,35 @@ uint64_t ErrlSrc::unflatten( const void * i_buf)
iv_user1 = p->word6;
iv_user2 = p->word8;
+ if(p->word5 & 0x02000000) // deconfigure - bit 6
+ {
+ iv_deconfig = true;
+ }
+ if(p->word5 & 0x01000000) // GARD - bit 7
+ {
+ iv_gard = true;
+ }
+
return flatSize();
}
+// Quick hexdigit to binary converter.
+// Hopefull someday to replaced by strtoul
uint64_t ErrlSrc::aschex2bin(char c)
{
- if(c >= 'a') c = c + 10 - 'a';
- else if (c >= 'A') c = c + 10 - 'A';
- else c -= '0';
+ if(c >= 'a' && c <= 'f')
+ {
+ c = c + 10 - 'a';
+ }
+ else if (c >= 'A' && c <= 'F')
+ {
+ c = c + 10 - 'A';
+ }
+ else if (c >= '0' && c <= '9')
+ {
+ c -= '0';
+ }
+ // else it's not a hex digit, ignore
return c;
}
OpenPOWER on IntegriCloud