diff options
author | Ilya Smirnov <ismirno@us.ibm.com> | 2017-09-26 17:28:07 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2017-09-29 13:23:22 -0400 |
commit | 7ca7ca7fc1aea76ef66ea9472a3e2e6bc6b605b4 (patch) | |
tree | 7ba2e1e604d27699c7086cd35fc809612b1f5059 /src/usr/targeting | |
parent | 020bcf3046cd8b1afb476cd48de3777f9b3413b3 (diff) | |
download | talos-hostboot-7ca7ca7fc1aea76ef66ea9472a3e2e6bc6b605b4.tar.gz talos-hostboot-7ca7ca7fc1aea76ef66ea9472a3e2e6bc6b605b4.zip |
Append 'ULL' to Attributes Larger Than 0xFFFFFFFF
Change-Id: Ie1027e1d9af3b112aa5d09f878ea868c49ed1d5e
CQ:SW400361
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/46770
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Reviewed-by: Prachi Gupta <pragupta@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/targeting')
-rwxr-xr-x | src/usr/targeting/common/xmltohb/xmltohb.pl | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/usr/targeting/common/xmltohb/xmltohb.pl b/src/usr/targeting/common/xmltohb/xmltohb.pl index ba3f6e67d..fc45c0280 100755 --- a/src/usr/targeting/common/xmltohb/xmltohb.pl +++ b/src/usr/targeting/common/xmltohb/xmltohb.pl @@ -86,6 +86,8 @@ my $cfgBiosXmlFile = undef; my $cfgBiosSchemaFile = undef; my $cfgBiosOutputFile = undef; +my $MAX_4_BYTE_VALUE = 0xFFFFFFFF; + GetOptions("hb-xml-file:s" => \$cfgHbXmlFile, "src-output-dir:s" => \$cfgSrcOutputDir, "img-output-dir:s" => \$cfgImgOutputDir, @@ -2090,11 +2092,12 @@ sub writeEnumFileAttrEnums { my $enumName = ""; my $enumHex = ""; + my $enumHexValue = 0; # Format below intentionally > 80 chars for clarity format ENUMFORMAT = - @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< = @<<<<<<<<<<<<<<<<<< + @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< = @<<<<<<<<<<<<<<<<<<<<< $enumName, $enumHex ."," . select($outFile); @@ -2106,12 +2109,24 @@ sub writeEnumFileAttrEnums { print $outFile wrapBrief( $enumerationType->{description} ); print $outFile " */\n"; print $outFile "enum ", $enumerationType->{id}, "\n"; + print $outFile "{\n"; foreach my $enumerator (@{$enumerationType->{enumerator}}) { - $enumHex = sprintf "0x%08X", - enumNameToValue($enumerationType,$enumerator->{name}); + $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($enumHexValue > $MAX_4_BYTE_VALUE) + { + $enumHex = sprintf "0x%08XULL", $enumHexValue; + } + else + { + $enumHex = sprintf "0x%08X", $enumHexValue; + } $enumName = $enumerationType->{id} . "_" . $enumerator->{name}; write; } |