From fe372b80a09ce301e02dcc0bf0059f057a042be1 Mon Sep 17 00:00:00 2001 From: Santosh Puranik Date: Thu, 18 Feb 2016 06:30:40 -0600 Subject: Some changes to reduce image size 1) Force get/put scom plat functions to be inline 2) Inline ATTR get/set functions 3) FAPI RC is now 32-bit 4) Enable selective trace levels RTC: 141492 Change-Id: Ie8a5bce597751b5484b2e9c89d614999a555f366 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/21023 Tested-by: Jenkins Server Reviewed-by: Sachin Gupta Reviewed-by: AMIT J. TENDOLKAR Reviewed-by: Gregory S. Still --- tools/scripts/ppeCreateAttrGetSetMacros.pl | 82 ++++++++++++------------------ 1 file changed, 32 insertions(+), 50 deletions(-) (limited to 'tools') 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 ( const fapi2::Target& i_ptarget, const fapi2attr::$macroTarget* object, const fapi2::AttributeId attrid, $type* o_pvalue )"; + my $targetFunction = "template<> inline void __get ( const fapi2::Target& 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 ( const fapi2::Target& i_ptarget, fapi2attr::$macroTarget* object, const fapi2::AttributeId attrid, const $type& i_pvalue )"; + my $targetFunction = "template<> inline void __set ( const fapi2::Target& i_ptarget, fapi2attr::$macroTarget* object, const fapi2::AttributeId attrid, const $type& i_pvalue )"; push(@newTargetDefines, $targetFunction . ";"); my $targetImplementation = ""; @@ -339,6 +338,36 @@ if (@newAttributeDefines != 0) { foreach my $targetDefine (@newTargetDefines) { 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 &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 \n"; - print OUTFILE "#include \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 &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); } -- cgit v1.2.1