diff options
Diffstat (limited to 'src/usr')
-rwxr-xr-x | src/usr/hwpf/fapi/fapiParseAttributeInfo.pl | 25 | ||||
-rwxr-xr-x | src/usr/hwpf/fapi/fapiParseErrorInfo.pl | 12 | ||||
-rw-r--r-- | src/usr/hwpf/hwp/scratch_attributes.xml | 4 |
3 files changed, 37 insertions, 4 deletions
diff --git a/src/usr/hwpf/fapi/fapiParseAttributeInfo.pl b/src/usr/hwpf/fapi/fapiParseAttributeInfo.pl index 988bb208e..f1783e8a8 100755 --- a/src/usr/hwpf/fapi/fapiParseAttributeInfo.pl +++ b/src/usr/hwpf/fapi/fapiParseAttributeInfo.pl @@ -54,6 +54,8 @@ # mjjones 02/08/12 Handle attribute files with 1 entry # mjjones 03/22/12 Generate hash values for enums # mjjones 04/10/12 Process Chip EC Feature attributes +# mjjones 05/15/12 Detect duplicate attr ids and append +# ULL after 64bit enumerator # # End Change Log ****************************************************** @@ -192,6 +194,7 @@ foreach my $argnum (1 .. $#ARGV) { my $infile = $ARGV[$argnum]; my %enumHash; + my %attrIdHash; # read XML file. The ForceArray option ensures that there is an array of # elements even if there is only one such element in the file @@ -222,6 +225,16 @@ foreach my $argnum (1 .. $#ARGV) exit(1); } + if (exists($attrIdHash{$attr->{id}})) + { + # Two different attributes with the same id! + print ("fapiParseAttributeInfo.pl ERROR. Duplicate attr id ", + $attr->{id}, "\n"); + exit(1); + } + + $attrIdHash{$attr->{id}} = 1; + # Calculate a 28 bit hash value. my $attrHash128Bit = md5_hex($attr->{id}); my $attrHash28Bit = substr($attrHash128Bit, 0, 7); @@ -230,7 +243,8 @@ foreach my $argnum (1 .. $#ARGV) if (exists($enumHash{$attrHash28Bit})) { # Two different attributes generate the same hash-value! - print ("fapiParseAttributeInfo.pl ERROR. Duplicate attr id hash value\n"); + print ("fapiParseAttributeInfo.pl ERROR. Duplicate attr id hash value for ", + $attr->{id}, "\n"); exit(1); } @@ -371,7 +385,14 @@ foreach my $argnum (1 .. $#ARGV) { # Remove leading spaces $val =~ s/^\s+//; - print AIFILE " ENUM_$attr->{id}_${val},\n"; + print AIFILE " ENUM_$attr->{id}_${val}"; + + if ($attr->{valueType} eq 'uint64') + { + print AIFILE "ULL"; + } + + print AIFILE ",\n"; } print AIFILE "};\n"; diff --git a/src/usr/hwpf/fapi/fapiParseErrorInfo.pl b/src/usr/hwpf/fapi/fapiParseErrorInfo.pl index 87a4cd12d..02f3354b1 100755 --- a/src/usr/hwpf/fapi/fapiParseErrorInfo.pl +++ b/src/usr/hwpf/fapi/fapiParseErrorInfo.pl @@ -46,6 +46,7 @@ # mjjones 12/16/11 Improved usage statement # mjjones 02/10/12 Allow err file with one element # mjjones 03/22/12 Generate hash values for enums +# mjjones 05/15/12 Detect duplicate error rcs # # End Change Log ****************************************************** @@ -176,6 +177,7 @@ foreach my $argnum (1 .. $#ARGV) my $infile = $ARGV[$argnum]; my $count = 0; my %enumHash; + my %errorRcHash; #-------------------------------------------------------------------------- # Read XML file. The ForceArray option ensures that there is an array of @@ -201,6 +203,16 @@ foreach my $argnum (1 .. $#ARGV) exit(1); } + if (exists($errorRcHash{$err->{rc}})) + { + # Two different errors with the same rc! + print ("fapiParseErrorInfo.pl ERROR. Duplicate error rc ", + $err->{rc}, "\n"); + exit(1); + } + + $errorRcHash{$err->{rc}} = 1; + if (! exists $err->{description}) { print ("fapiParseErrorInfo.pl ERROR. description missing\n"); diff --git a/src/usr/hwpf/hwp/scratch_attributes.xml b/src/usr/hwpf/hwp/scratch_attributes.xml index b6905911d..0337a7263 100644 --- a/src/usr/hwpf/hwp/scratch_attributes.xml +++ b/src/usr/hwpf/hwp/scratch_attributes.xml @@ -92,7 +92,7 @@ Can be used by HWPs for testing. </description> <valueType>uint64</valueType> - <enum>VAL_A = 3, VAL_B = 5, VAL_C = 0x23</enum> + <enum>VAL_A = 0, VAL_B = 5, VAL_C = 0xffffffffffffffff</enum> <writeable/> </attribute> <!-- ********************************************************************* --> @@ -165,7 +165,7 @@ </description> <valueType>uint64</valueType> <array> 2, 2 </array> - <enum>VAL_A, VAL_B, VAL_C</enum> + <enum>VAL_A = 0x0123456789abcdef, VAL_B = 0, VAL_C = 0xffffffffffffffff</enum> <writeable/> </attribute> <!-- ********************************************************************* --> |