diff options
author | Stephen Cprek <smcprek@us.ibm.com> | 2015-07-13 12:10:07 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2015-08-14 08:38:24 -0500 |
commit | 0c2727ce73f283950bf8e95251c304a903a7d016 (patch) | |
tree | 6a98e9883881195492f8a873efef5a48019310b9 /src | |
parent | 6e0eea061a5b8463c593a56c09accf1824fd9818 (diff) | |
download | blackbird-hostboot-0c2727ce73f283950bf8e95251c304a903a7d016.tar.gz blackbird-hostboot-0c2727ce73f283950bf8e95251c304a903a7d016.zip |
Add ATTR_PERM support to attoverride tool
Change-Id: Ia6ac71a4e71679d9b7b5dc023393a2b975a24b7e
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/19071
Tested-by: Jenkins Server
Tested-by: Jenkins OP Build CI
Tested-by: Jenkins OP HW
Reviewed-by: ANDRES A. LUGO-REYES <aalugore@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src')
-rwxr-xr-x | src/usr/targeting/attroverride/attrTextToBinaryBlob.C | 26 | ||||
-rwxr-xr-x | src/usr/targeting/attroverride/attrTextToBinaryBlob.H | 3 |
2 files changed, 26 insertions, 3 deletions
diff --git a/src/usr/targeting/attroverride/attrTextToBinaryBlob.C b/src/usr/targeting/attroverride/attrTextToBinaryBlob.C index 735c5b58c..ead58ea7f 100755 --- a/src/usr/targeting/attroverride/attrTextToBinaryBlob.C +++ b/src/usr/targeting/attroverride/attrTextToBinaryBlob.C @@ -158,6 +158,9 @@ const T* findAttribute(const T* array, //global to allow debug logs bool g_showDebugLogs = false; +//global to indicate if tool is generated permanent overrides +bool g_permOverride = false; + using namespace AttrOverrideSyncConstants; @@ -1016,6 +1019,22 @@ bool AttrTextToBinaryBlob::getAttrDataFromMap(const char * i_attrString, o_tankLayer = AttributeTank::TANK_LAYER_FAPI; } + // If generating a permanent override, set tank layer accordingly + if (g_permOverride) + { + if (o_tankLayer == AttributeTank::TANK_LAYER_FAPI) + { + printf("Cannot create a permanent override for FAPI attributes - attr = %s\n", + i_attrString); + l_success = false; + break; + } + else + { + o_tankLayer = AttributeTank::TANK_LAYER_PERM; + } + } + if (NULL == currentAttr) { printf("Attribute data not present for the attribute %s!\n", @@ -1072,7 +1091,7 @@ int main(int argc, char *argv[]) const char * l_attributeString; int opt; - while((opt = getopt(argc, argv, "dfht")) != -1) + while((opt = getopt(argc, argv, "dfhtp")) != -1) { switch (opt) { @@ -1086,7 +1105,9 @@ int main(int argc, char *argv[]) case 't': l_injectECC = true; break; - + case 'p': + g_permOverride = true; + break; case 'h': printf("%s [options] <file>:\n", argv[0]); printf("\nExpected args:\n\t Attribute text file of the " @@ -1114,6 +1135,7 @@ int main(int argc, char *argv[]) "\t\t'-h' - display help text.\n" "\t\t'-f' - prevent ECC bytes from being inserted.\n" "\t\t'-t' - allow ECC bytes to be inserted.\n" + "\t\t'-p' - permanent override. [FAPI attributes not allowed]\n" "\t\tno option - same as 't' option.\n\n"); return 0; diff --git a/src/usr/targeting/attroverride/attrTextToBinaryBlob.H b/src/usr/targeting/attroverride/attrTextToBinaryBlob.H index 6494bbebc..287116a86 100755 --- a/src/usr/targeting/attroverride/attrTextToBinaryBlob.H +++ b/src/usr/targeting/attroverride/attrTextToBinaryBlob.H @@ -259,11 +259,12 @@ static bool getAttrEnumDataFromMap(const char * i_attrString, * binary blob of attribute data * * @param[in] i_file Ref to File containing Overrides/Syncs + * @param[in] i_injectECC Indicates whether to inject ECC * * @return bool - True if there was an error, False otherwise */ static bool attrTextToBinaryBlob( std::ifstream& i_file, - bool i_injectECC ); + bool i_injectECC); }; |