diff options
author | Mike Jones <mjjones@us.ibm.com> | 2014-04-04 18:52:27 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2014-04-05 10:28:47 -0500 |
commit | 57d3aca70243a1bd42467e204e90e7e528a7a514 (patch) | |
tree | ca51b5b936c8fe28bfaddfee6ffc4a38708203e8 /src/usr/targeting/common | |
parent | 51122a9be84c74006c73009c706d726664c79cd8 (diff) | |
download | talos-hostboot-57d3aca70243a1bd42467e204e90e7e528a7a514.tar.gz talos-hostboot-57d3aca70243a1bd42467e204e90e7e528a7a514.zip |
Handle strings in Targeting XML <default> fields appropriately
Change-Id: I1acafe4f7623b5220a2f1dad11f8570af4bd44ca
CQ: SW255643
Backport: release-fips810
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/10162
Tested-by: Jenkins Server
Reviewed-by: Andrew J. Geissler <andrewg@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/targeting/common')
-rwxr-xr-x | src/usr/targeting/common/genHwsvMrwXml.pl | 2 | ||||
-rw-r--r-- | src/usr/targeting/common/xmltohb/attribute_types.xml | 3 | ||||
-rwxr-xr-x | src/usr/targeting/common/xmltohb/xmltohb.pl | 22 |
3 files changed, 24 insertions, 3 deletions
diff --git a/src/usr/targeting/common/genHwsvMrwXml.pl b/src/usr/targeting/common/genHwsvMrwXml.pl index fd07be2e8..587e76136 100755 --- a/src/usr/targeting/common/genHwsvMrwXml.pl +++ b/src/usr/targeting/common/genHwsvMrwXml.pl @@ -2935,7 +2935,7 @@ sub generate_capp <id>MRU_ID</id>"; # TODO RTC: 97477 print " - <default>TO_BE_ADDED</default> + <default>0</default> </attribute> <attribute> <id>AFFINITY_PATH</id> diff --git a/src/usr/targeting/common/xmltohb/attribute_types.xml b/src/usr/targeting/common/xmltohb/attribute_types.xml index dd0411228..780c9419f 100644 --- a/src/usr/targeting/common/xmltohb/attribute_types.xml +++ b/src/usr/targeting/common/xmltohb/attribute_types.xml @@ -12762,14 +12762,13 @@ firmware notes: Platforms should initialize this attribute to AUTO (0)</descript <default>NOT_MASTER</default> </enumerationType> -<!-- TODO RTC 91689 Support enum in default --> <attribute> <id>PROC_MASTER_TYPE</id> <description>Type of Master, ACTING_MASTER or MASTER_CANDIDATE or NOT_MASTER</description> <simpleType> <uint8_t> - <default>2</default> + <default>NOT_MASTER</default> </uint8_t> </simpleType> <persistency>non-volatile</persistency> diff --git a/src/usr/targeting/common/xmltohb/xmltohb.pl b/src/usr/targeting/common/xmltohb/xmltohb.pl index 695ade7f5..843bdd0eb 100755 --- a/src/usr/targeting/common/xmltohb/xmltohb.pl +++ b/src/usr/targeting/common/xmltohb/xmltohb.pl @@ -4517,6 +4517,28 @@ sub packSingleSimpleTypeAttribute { $simpleTypeProperties->{$typeName}{specialPolicies}->($$attributeRef, $value); + if ($value eq 'true') + { + $value = 1; + } + elsif ($value eq 'false') + { + $value = 0; + } + + if( ($simpleTypeProperties->{$typeName}{complexTypeSupport}) && + ($value =~ m/[^0-9]/) ) + { + # This is a type that supports complex types - i.e. an integer and + # the value is a string. Look for an enumeration named after the + # attribute id, if one is not found then one of the function calls + # below will exit with error + my $enumeration = getEnumerationType($$attributesRef, + $$attributeRef->{id}); + + $value = enumNameToValue($enumeration, $value); + } + if(ref ($simpleTypeProperties->{$typeName}{packfmt}) eq "CODE") { $$binaryDataRef .= $simpleTypeProperties->{$typeName}{packfmt}-> |