diff options
author | Matt Derksen <mderkse1@us.ibm.com> | 2018-01-17 13:36:03 -0600 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2018-01-29 16:05:00 -0500 |
commit | 27cbbc4cc87d179fd09a84100b1cc4b8adf6b3c8 (patch) | |
tree | 9496f3a368d65720e9330b4ed4f1f4a7597862d9 /src/usr | |
parent | 8c18b32b0a59ade827ec3a40a394f8d924f40d1b (diff) | |
download | talos-hostboot-27cbbc4cc87d179fd09a84100b1cc4b8adf6b3c8.tar.gz talos-hostboot-27cbbc4cc87d179fd09a84100b1cc4b8adf6b3c8.zip |
Update int64_t attributes in attributeenums.H to LL
This is to match what the attributes are in fapi2AttrOverrideEnums.H
Change-Id: I16d3e7a7a37d0b5b1de17f884bfd02db7020e065
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/52119
Reviewed-by: Martin Gloff <mgloff@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr')
-rwxr-xr-x | src/usr/targeting/common/xmltohb/xmltohb.pl | 53 |
1 files changed, 49 insertions, 4 deletions
diff --git a/src/usr/targeting/common/xmltohb/xmltohb.pl b/src/usr/targeting/common/xmltohb/xmltohb.pl index fc1392e5f..be87ad0f5 100755 --- a/src/usr/targeting/common/xmltohb/xmltohb.pl +++ b/src/usr/targeting/common/xmltohb/xmltohb.pl @@ -6,7 +6,7 @@ # # OpenPOWER HostBoot Project # -# Contributors Listed Below - COPYRIGHT 2012,2017 +# Contributors Listed Below - COPYRIGHT 2012,2018 # [+] International Business Machines Corp. # # @@ -51,6 +51,7 @@ use POSIX; use Env; use XML::LibXML; + # Provides object deep copy capability to support virtual # attribute removal use Storable 'dclone'; @@ -2117,11 +2118,22 @@ sub writeEnumFileAttrEnums { $enumHexValue = enumNameToValue($enumerationType,$enumerator->{name}); - #If the enum is bigger than 0xFFFFFFFF, then we need to append 'ULL' - #to it to prevent compiler errors. + + #If the enum is bigger than 0xFFFFFFFF, then we need to append 'LL' + #or 'ULL' to it to prevent compiler errors. if($enumHexValue > $MAX_4_BYTE_VALUE) { - $enumHex = sprintf "0x%08XULL", $enumHexValue; + # find type + my $simpleType = getAttributeType($enumerationType->{id}, + $attributes); + if (exists $simpleType->{'uint64_t'}) + { + $enumHex = sprintf "0x%08XULL", $enumHexValue; + } + else + { + $enumHex = sprintf "0x%08XLL", $enumHexValue; + } } else { @@ -4687,6 +4699,39 @@ sub simpleTypeProperties { } ################################################################################ +# Get attribute type +################################################################################ +sub getAttributeType { + my($attributeId,$attributes) = @_; + my $attrType; + + foreach my $attribute (@{$attributes->{attribute}}) + { + if ($attribute->{id} eq $attributeId) + { + if(exists $attribute->{simpleType}) + { + $attrType = $attribute->{simpleType}; + } + elsif (exists $attribute->{complexType}) + { + $attrType = $attribute->{complexType}; + } + elsif (exists $attribute->{nativeType}) + { + $attrType = $attribute->{nativeType}; + } + else + { + $attrType = "unknown type"; + } + last; + } + } + return $attrType; +} + +################################################################################ # Get attribute default ################################################################################ |