diff options
author | Andres Lugo-Reyes <aalugore@us.ibm.com> | 2016-05-16 17:03:04 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2016-05-18 18:35:44 -0400 |
commit | 163963f9c80111373daa1bdc23e26d299a0aa950 (patch) | |
tree | e79209062ffb83ba56cde4f80dc8727a301c76fc /src/usr/targeting/attroverride/attrTextToBinaryBlob.C | |
parent | cf404df3bf9c76674a05b8abb902114ac40ec978 (diff) | |
download | talos-hostboot-163963f9c80111373daa1bdc23e26d299a0aa950.tar.gz talos-hostboot-163963f9c80111373daa1bdc23e26d299a0aa950.zip |
fix attribute override target string parsing
This change allows the attribute override tool to
process target strings that begin with both
"target = " and "target="
Change-Id: I2f32d6956207a52d0c62bad35843f40a844c9ef6
ForwardPort:yes
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/24633
Reviewed-by: Prachi Gupta <pragupta@us.ibm.com>
Reviewed-by: Stephen M. Cprek <smcprek@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/24670
Reviewed-by: Andres A. Lugo-Reyes <aalugore@us.ibm.com>
Tested-by: Jenkins Server
Tested-by: FSP CI Jenkins
Diffstat (limited to 'src/usr/targeting/attroverride/attrTextToBinaryBlob.C')
-rwxr-xr-x | src/usr/targeting/attroverride/attrTextToBinaryBlob.C | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/usr/targeting/attroverride/attrTextToBinaryBlob.C b/src/usr/targeting/attroverride/attrTextToBinaryBlob.C index 26522e8da..ff6f80e04 100755 --- a/src/usr/targeting/attroverride/attrTextToBinaryBlob.C +++ b/src/usr/targeting/attroverride/attrTextToBinaryBlob.C @@ -1,11 +1,11 @@ /* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ -/* $Source: src/exttools/attroverride/attrTextToBinaryBlob.C $ */ +/* $Source: src/usr/targeting/attroverride/attrTextToBinaryBlob.C $ */ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2014,2015 */ +/* Contributors Listed Below - COPYRIGHT 2014,2016 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -76,7 +76,7 @@ const size_t ATTRIBUTE_HEADER_SIZE = 16; //****************************************************************************** const char * const ATTR_FILE_ATTR_START_STR = "ATTR_"; const char * const ATTR_FILE_TARGET_HEADER_STR = "target"; -const char * const ATTR_FILE_TARGET_EXT_HEADER_STR = "target = k0"; +const char * const ATTR_CAGE_NUMBER = "k0"; const char * const ATTR_FILE_TARGET_EXT_FOOTER_STR = ":s0:"; const char * const ATTR_CONST = "CONST"; const char * const TARGET_NODE_HEADER_STR = ":n"; @@ -493,11 +493,12 @@ void AttrTextToBinaryBlob::attrFileTargetLineToData( o_targetUnitPos = AttributeTank::ATTR_UNIT_POS_NA; // Find the node, target type, pos and unit-pos - if (0 == i_line.find(ATTR_FILE_TARGET_EXT_HEADER_STR)) + int l_cageIndex = i_line.find(ATTR_CAGE_NUMBER); + if(l_cageIndex != std::string::npos ) { // Create a local string and remove the target header std::string l_line = - i_line.substr(strlen(ATTR_FILE_TARGET_EXT_HEADER_STR)); + i_line.substr(l_cageIndex + strlen(ATTR_CAGE_NUMBER)); // Figure out the node number if (0 == l_line.find(TARGET_NODE_HEADER_STR)) @@ -597,7 +598,7 @@ void AttrTextToBinaryBlob::attrFileTargetLineToData( } } } - } + } // else, the "k0" string was not found. Process as system target // System targets must have an NA node if (l_sysTarget) |