summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/scripts/ppeCreateAttrGetSetMacros.pl82
1 files changed, 32 insertions, 50 deletions
diff --git a/tools/scripts/ppeCreateAttrGetSetMacros.pl b/tools/scripts/ppeCreateAttrGetSetMacros.pl
index 7ac64372..c5f4a61f 100755
--- a/tools/scripts/ppeCreateAttrGetSetMacros.pl
+++ b/tools/scripts/ppeCreateAttrGetSetMacros.pl
@@ -33,7 +33,6 @@ my %targetMacros;
my $fapiAttributeIdsFile = "fapi2AttributeIds.H";
my $fapiPlatAttributeServiceFile= "fapi2PlatAttributeService.H";
-my $fapiPlatAttributeServiceImpl= "fapi2PlatAttributeService.C";
my $includePath = "./";
@@ -263,7 +262,7 @@ for my $attribute (sort keys %{$enums{AttributeId}}) {
if(defined $targetMacro) {
- my $targetFunction = "template<> void __get<fapi2::$targetMacro, fapi2attr::$macroTarget, $type, fapi2::${attribute}> ( const fapi2::Target<fapi2::$targetMacro>& i_ptarget, const fapi2attr::$macroTarget* object, const fapi2::AttributeId attrid, $type* o_pvalue )";
+ my $targetFunction = "template<> inline void __get<fapi2::$targetMacro, fapi2attr::$macroTarget, $type, fapi2::${attribute}> ( const fapi2::Target<fapi2::$targetMacro>& i_ptarget, const fapi2attr::$macroTarget* object, const fapi2::AttributeId attrid, $type* o_pvalue )";
push(@newTargetDefines, $targetFunction . ";");
my $targetImplementation = "";
@@ -291,7 +290,7 @@ $targetImplementation .= "\n" . $targetFunction . "\n{\n uint32_t index = i_pt
if(defined $targetMacro) {
- my $targetFunction = "template<> void __set<fapi2::$targetMacro, fapi2attr::$macroTarget, $type, fapi2::${attribute}> ( const fapi2::Target<fapi2::$targetMacro>& i_ptarget, fapi2attr::$macroTarget* object, const fapi2::AttributeId attrid, const $type& i_pvalue )";
+ my $targetFunction = "template<> inline void __set<fapi2::$targetMacro, fapi2attr::$macroTarget, $type, fapi2::${attribute}> ( const fapi2::Target<fapi2::$targetMacro>& i_ptarget, fapi2attr::$macroTarget* object, const fapi2::AttributeId attrid, const $type& i_pvalue )";
push(@newTargetDefines, $targetFunction . ";");
my $targetImplementation = "";
@@ -340,6 +339,36 @@ if (@newAttributeDefines != 0) {
print OUTFILE "$targetDefine\n";
if ($VERBOSE) { print "INFO:: adding getter setter method\n"; }
}
+ print OUTFILE "
+ __attribute__((always_inline)) inline uint32_t getPervAttrIndex(const fapi2::Target<TARGET_TYPE_PERV> &i_target)
+ {
+ uint32_t l_index = i_target.getTargetNumber();
+ if(TARGET_TYPE_EQ & i_target.getTargetType())
+ {
+ l_index += (EQ_TARGET_OFFSET);
+ }
+ else if(TARGET_TYPE_CORE & i_target.getTargetType())
+ {
+ l_index += (CORE_TARGET_OFFSET);
+ }
+ else if(TARGET_TYPE_MCS & i_target.getTargetType())
+ {
+ l_index += (MCS_TARGET_OFFSET);
+ }
+ else
+ {
+ l_index += (NEST_GROUP1_TARGET_OFFSET);
+ }
+ return (l_index - NEST_GROUP1_TARGET_OFFSET);
+ }
+ ";
+
+
+ foreach my $impl (@newTargetImplementations) {
+
+ print OUTFILE $impl;
+
+ }
}
@@ -355,53 +384,6 @@ if (@newAttributeDefines != 0) {
# copy new file over the old one
system("mv $updatedFapiPlatAttributeServiceFile $includePath/$fapiPlatAttributeServiceFile");
}
-
-
- my $updatedFapiPlatAttributeServiceImpl = $srcPath . "/" . $fapiPlatAttributeServiceImpl;
- open (OUTFILE, ">$updatedFapiPlatAttributeServiceImpl") or die "ERROR:: could not open $updatedFapiPlatAttributeServiceImpl\n";
-
- print OUTFILE "// $fapiPlatAttributeServiceImpl\n";
- print OUTFILE "// This file is generated by perl script ppeCreateAttrGetSetMacros.pl\n\n";
-
- print OUTFILE "#include <fapi2.H>\n";
- print OUTFILE "#include <fapi2PlatAttributeService.H>\n";
- print OUTFILE "#include \"proc_sbe_fixed.H\"\n";
- print OUTFILE "#include \"plat_target_parms.H\"\n\n";
- print OUTFILE "namespace fapi2 {\n";
- print OUTFILE "
-uint32_t getPervAttrIndex(const fapi2::Target<TARGET_TYPE_PERV> &i_target)
-{
- uint32_t l_index = i_target.getTargetNumber();
- if(TARGET_TYPE_EQ & i_target.getTargetType())
- {
- l_index += (EQ_TARGET_OFFSET);
- }
- else if(TARGET_TYPE_CORE & i_target.getTargetType())
- {
- l_index += (CORE_TARGET_OFFSET);
- }
- else if(TARGET_TYPE_MCS & i_target.getTargetType())
- {
- l_index += (MCS_TARGET_OFFSET);
- }
- else
- {
- l_index += (NEST_GROUP1_TARGET_OFFSET);
- }
- return (l_index - NEST_GROUP1_TARGET_OFFSET);
-}
-";
-
- foreach my $impl (@newTargetImplementations) {
-
- print OUTFILE $impl;
-
- }
-
- print OUTFILE "\n} // namespace fapi2\n";
-
-
- close (OUTFILE);
}
OpenPOWER on IntegriCloud