From 57d3aca70243a1bd42467e204e90e7e528a7a514 Mon Sep 17 00:00:00 2001 From: Mike Jones Date: Fri, 4 Apr 2014 18:52:27 -0500 Subject: Handle strings in Targeting XML 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 Reviewed-by: A. Patrick Williams III --- src/usr/targeting/common/genHwsvMrwXml.pl | 2 +- .../targeting/common/xmltohb/attribute_types.xml | 3 +-- src/usr/targeting/common/xmltohb/xmltohb.pl | 22 ++++++++++++++++++++++ 3 files changed, 24 insertions(+), 3 deletions(-) (limited to 'src/usr/targeting/common') 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 MRU_ID"; # TODO RTC: 97477 print " - TO_BE_ADDED + 0 AFFINITY_PATH 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)NOT_MASTER - PROC_MASTER_TYPE Type of Master, ACTING_MASTER or MASTER_CANDIDATE or NOT_MASTER - 2 + NOT_MASTER non-volatile 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}-> -- cgit v1.2.1