diff options
author | Dan Crowell <dcrowell@us.ibm.com> | 2013-10-21 16:01:11 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2013-10-22 15:09:31 -0500 |
commit | ac8821ff2a84fcbb18b7c8e296c0ae3905117271 (patch) | |
tree | 752929eefe1405ef394d38496e9e305bdfca14d8 /src/usr | |
parent | ccbf5badca27be9189a58c34913bab174fe9b100 (diff) | |
download | talos-hostboot-ac8821ff2a84fcbb18b7c8e296c0ae3905117271.tar.gz talos-hostboot-ac8821ff2a84fcbb18b7c8e296c0ae3905117271.zip |
Fix error checking in hdatservice
While debugging an issue with the new SPIRA-S format I discovered
that my header check was wrong. Also fixed a couple of other
minor bugs related to detecting invalid SPIRA layouts.
Change-Id: I5e308223f127fa9dd7b6208812456f839d22acde
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/6773
Tested-by: Jenkins Server
Reviewed-by: Michael Baiocchi <baiocchi@us.ibm.com>
Reviewed-by: Douglas R. Gilbert <dgilbert@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr')
-rw-r--r-- | src/usr/runtime/hdatservice.C | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/usr/runtime/hdatservice.C b/src/usr/runtime/hdatservice.C index 5044da7be..63a6b977a 100644 --- a/src/usr/runtime/hdatservice.C +++ b/src/usr/runtime/hdatservice.C @@ -167,12 +167,19 @@ errlHndl_t hdatService::check_header( hdatHDIF_t* i_header, sizeof(hdatHDIF_t) ); if( errhdl ) { break; } + // Check version number but don't fail, this lets + // us handle minor changes more smoothly. A major + // change should probably see a fail later on. + if( i_header->hdatVersion != i_exp.version ) + { + TRACFCOMP( g_trac_runtime, ERR_MRK "RUNTIME::check_header> Version not as expected for %s, continuing anyway. Act=%.4X, Exp=%.4X", i_exp.name, i_header->hdatVersion, i_exp.version ); + } + // Check the ID, Version and Name if( (i_header->hdatStructId != i_exp.id) - && (i_header->hdatVersion != i_exp.version) - && !memcmp(i_header->hdatStructName,i_exp.name,6) ) + || memcmp(i_header->hdatStructName,i_exp.name,6) ) { - TRACFCOMP( g_trac_runtime, ERR_MRK "RUNTIME::check_header> HDAT Header data not as expected (id:version:name). Act=%.4X:%.4X:%s, Exp=%.4X:%.4X :%s", i_header->hdatStructId, i_header->hdatVersion, i_header->hdatStructName, i_exp.id, i_exp.version, i_exp.name ); + TRACFCOMP( g_trac_runtime, ERR_MRK "RUNTIME::check_header> HDAT Header data not as expected (id:version:name). Act=%.4X:%.4X:%s, Exp=%.4X:%.4X:%s", i_header->hdatStructId, i_header->hdatVersion, i_header->hdatStructName, i_exp.id, i_exp.version, i_exp.name ); hdatHeaderExp_t actual; actual.id = i_header->hdatStructId; actual.version = i_header->hdatVersion; @@ -1095,7 +1102,7 @@ errlHndl_t hdatService::findSpira( void ) TRACFCOMP( g_trac_runtime, "SPIRA-S=%p", iv_spiraS ); // Check the headers and version info - errhdl_s = check_header( &(iv_spiraH->hdatHDIF), + errhdl_s = check_header( &(iv_spiraS->hdatHDIF), SPIRAS_HEADER ); if( errhdl_s ) { |