summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Jones <mjjones@us.ibm.com>2012-08-08 11:01:06 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2012-08-15 12:13:01 -0500
commit1d72de9b758ef67192924bfb4a0d3aac119fa3b4 (patch)
treedcf30454dcb1fd1c0823802a9b7f84067e01f221
parentff9e6f81cdccee3f26ac682255131c5628b35211 (diff)
downloadtalos-hostboot-1d72de9b758ef67192924bfb4a0d3aac119fa3b4.tar.gz
talos-hostboot-1d72de9b758ef67192924bfb4a0d3aac119fa3b4.zip
HWPF: Generated fapiAttributeIds.H file: Output target-types and if platInit
The fapiParseAttributeInfo.pl FAPI script generates (amongst other files) fapiAttributeIds.H. This file enumerates the HWPF Attribute IDs and gives other information about attributes, such as their type and if privileged. John Farrugia (Cronus) requested that fapiAttributeIds.H also contain information giving the target type(s) that an attribute is associated with and if the attribute is initialized by the platform, these will be used by Cronus for extra checking during attribute get/set. RTC: 46570 Change-Id: Iaf9d201ae0d7c9a591430db0648ce3384f66e7a0 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/1497 Tested-by: Jenkins Server Reviewed-by: CAMVAN T. NGUYEN <ctnguyen@us.ibm.com> Reviewed-by: Van H. Lee <vanlee@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
-rwxr-xr-xsrc/usr/hwpf/fapi/fapiParseAttributeInfo.pl45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/usr/hwpf/fapi/fapiParseAttributeInfo.pl b/src/usr/hwpf/fapi/fapiParseAttributeInfo.pl
index 1ee4119e9..4e092f90f 100755
--- a/src/usr/hwpf/fapi/fapiParseAttributeInfo.pl
+++ b/src/usr/hwpf/fapi/fapiParseAttributeInfo.pl
@@ -60,6 +60,7 @@
# mjjones 05/21/12 Ignore newlines and whitespace when
# parsing enumerations
# mjjones 06/12/12 Add new include file to fapiChipEcFeature.C
+# mjjones 08/08/12 Output target types and if PlatInit
#
# End Change Log ******************************************************
@@ -128,6 +129,7 @@ print AIFILE "// fapiAttributeIds.H\n";
print AIFILE "// This file is generated by perl script fapiParseAttributeInfo.pl\n\n";
print AIFILE "#ifndef FAPIATTRIBUTEIDS_H_\n";
print AIFILE "#define FAPIATTRIBUTEIDS_H_\n\n";
+print AIFILE "#include <fapiTarget.H>\n\n";
print AIFILE "namespace fapi\n";
print AIFILE "{\n\n";
print AIFILE "\/**\n";
@@ -378,6 +380,49 @@ foreach my $argnum (1 .. $#ARGV)
}
#----------------------------------------------------------------------
+ # Print the target type(s) that the attribute is associated with
+ #----------------------------------------------------------------------
+ if (! exists $attr->{targetType})
+ {
+ print ("fapiParseAttributeInfo.pl ERROR. Att 'targetType' missing\n");
+ exit(1);
+ }
+
+ print AIFILE "const TargetTypes_t $attr->{id}_TargetTypes = ";
+
+ # Split on commas
+ my @targTypes = split(',', $attr->{targetType});
+
+ my $targTypeCount = 0;
+ foreach my $targType (@targTypes)
+ {
+ # Remove newlines and leading/trailing whitespace
+ $targType =~ s/\n//;
+ $targType =~ s/^\s+//;
+ $targType =~ s/\s+$//;
+
+ if ($targTypeCount != 0)
+ {
+ print AIFILE " | ";
+ }
+ print AIFILE "$targType";
+ $targTypeCount++;
+ }
+ print AIFILE ";\n";
+
+ #----------------------------------------------------------------------
+ # Print if the attribute is a platInit attribute
+ #----------------------------------------------------------------------
+ if (exists $attr->{platInit})
+ {
+ print AIFILE "const bool $attr->{id}_PlatInit = true;\n";
+ }
+ else
+ {
+ print AIFILE "const bool $attr->{id}_PlatInit = false;\n";
+ }
+
+ #----------------------------------------------------------------------
# Print the value enumeration (if specified) to fapiAttributeIds.H
#----------------------------------------------------------------------
if (exists $attr->{enum})
OpenPOWER on IntegriCloud