From d6dcd0125e002508ea665a5b71eb2019a0274c91 Mon Sep 17 00:00:00 2001 From: Santosh Puranik Date: Tue, 13 Sep 2016 11:31:46 -0500 Subject: FAPI Plat Cleanup - III -- Move completely to using FAPI from src/import Change-Id: Ifd27a900fea45ef0e7d6bd4a62192e50812b99ac Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/29581 Tested-by: Jenkins Server Reviewed-by: Sachin Gupta Tested-by: FSP CI Jenkins Reviewed-by: Shakeeb A. Pasha B K Reviewed-by: Santosh S. Puranik --- src/tools/scripts/ppeCreateAttrGetSetMacros.pl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/tools/scripts/ppeCreateAttrGetSetMacros.pl') diff --git a/src/tools/scripts/ppeCreateAttrGetSetMacros.pl b/src/tools/scripts/ppeCreateAttrGetSetMacros.pl index 990a394a..a0004f39 100755 --- a/src/tools/scripts/ppeCreateAttrGetSetMacros.pl +++ b/src/tools/scripts/ppeCreateAttrGetSetMacros.pl @@ -120,7 +120,7 @@ while () { } elsif (m/\s*#define\s+(\w+)_SETMACRO\(ID\,\sPTARGET\,\sVAL\)\s(.+)/) { $setMacros{$1} = $2; if ($DEBUG) { print "DEBUG:: attribute = $1 : SETMACRO = $2\n"; } - } elsif (m/\s*const\s*TargetType\s+(\w+)_TargetTypes\s*=\s*(\S+)\s*;\s*/) { + } elsif (m/\s*const\s*fapi2::TargetType\s+(\w+)_TargetType\s*=\s*(\S+)\s*;\s*/) { $targetMacros{$1} = $2; # print "DEBUG:: attribute = $1 : TARGET = $2\n"; if ($DEBUG) { print "DEBUG:: attribute = $1 : TARGET = $2\n"; } @@ -181,7 +181,7 @@ while () { } elsif (m/\s*#define\s+(\w+)_SETMACRO\s+(\S+)\s*/) { $setMacros{$1} = $2; if ($DEBUG) { print "DEBUG:: attribute = $1 : SETMACRO = $2\n"; } - } elsif (m/\s*const\s*TargetType\s+(\w+)_TargetTypes\s*=\s*(\S+)\s*;\s*/) { + } elsif (m/\s*const\s*fapi2::TargetType\s+(\w+)_TargetType\s*=\s*(\S+)\s*;\s*/) { $targetMacros{$1} = $2; if ($DEBUG) { print "DEBUG:: attribute = $1 : TARGET = $2\n"; } } @@ -302,7 +302,7 @@ for my $attribute (sort keys %{$enums{AttributeId}}) { }\n"; } else { -$targetImplementation .= "\n" . $targetFunction . "\n{\n uint32_t index = i_ptarget.getTargetNumber();\n *o_pvalue = object->fapi2attr::${macroTarget}::${attribute}[index];\n}\n" +$targetImplementation .= "\n" . $targetFunction . "\n{\n uint32_t index = static_cast(i_ptarget.get()).getTargetInstance();\n *o_pvalue = object->fapi2attr::${macroTarget}::${attribute}[index];\n}\n" } push(@newTargetImplementations, $targetImplementation); } @@ -323,7 +323,7 @@ $targetImplementation .= "\n" . $targetFunction . "\n{\n uint32_t index = i_pt $targetImplementation = "\n" . $targetFunction . "\n{\n object->fapi2attr::${macroTarget}::${attribute} = i_pvalue;\n}\n"; } else { - $targetImplementation = "\n" . $targetFunction . "\n{\n uint32_t index = i_ptarget.getTargetNumber();\n object->fapi2attr::${macroTarget}::${attribute}[index] = i_pvalue;\n}\n"; + $targetImplementation = "\n" . $targetFunction . "\n{\n uint32_t index = static_cast(i_ptarget.get()).getTargetInstance();\n object->fapi2attr::${macroTarget}::${attribute}[index] = i_pvalue;\n}\n"; } push(@newTargetImplementations, $targetImplementation); @@ -366,16 +366,16 @@ if (@newAttributeDefines != 0) { print OUTFILE " __attribute__((always_inline)) inline uint32_t getPervAttrIndex(const fapi2::Target &i_target) { - uint32_t l_index = i_target.getTargetNumber(); - if(PPE_TARGET_TYPE_EQ & i_target.getTargetType()) + uint32_t l_index = static_cast(i_target.get()).getTargetInstance(); + if(PPE_TARGET_TYPE_EQ & static_cast(i_target.get()).getTargetType()) { l_index += (EQ_TARGET_OFFSET); } - else if(PPE_TARGET_TYPE_CORE & i_target.getTargetType()) + else if(PPE_TARGET_TYPE_CORE & static_cast(i_target.get()).getTargetType()) { l_index += (CORE_TARGET_OFFSET); } - else if(PPE_TARGET_TYPE_MCBIST & i_target.getTargetType()) + else if(PPE_TARGET_TYPE_MCBIST & static_cast(i_target.get()).getTargetType()) { l_index += (MCBIST_TARGET_OFFSET); } -- cgit v1.2.1