From f4d566d7f5e11db454b4ff4487425dd991095ed9 Mon Sep 17 00:00:00 2001 From: Stephen Cprek Date: Mon, 17 Feb 2014 11:20:25 -0600 Subject: FspOnly Targets with Common P0 attributes to Sm table Uploaded this change at the request of Raja Das. FSP Gerrit review is 8550. Change-Id: I18f2815a8c4fe7a976adfbe8bba7fd10ff6bc5a1 CQ: SW245110 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/8823 Tested-by: Jenkins Server Reviewed-by: STEPHEN M. CPREK Reviewed-by: Brian H. Horton Reviewed-by: A. Patrick Williams III --- src/usr/targeting/common/xmltohb/xmltohb.pl | 57 +++++++++++++++++++++++++---- 1 file changed, 49 insertions(+), 8 deletions(-) (limited to 'src/usr/targeting/common/xmltohb/xmltohb.pl') diff --git a/src/usr/targeting/common/xmltohb/xmltohb.pl b/src/usr/targeting/common/xmltohb/xmltohb.pl index acd2fef97..695ade7f5 100755 --- a/src/usr/targeting/common/xmltohb/xmltohb.pl +++ b/src/usr/targeting/common/xmltohb/xmltohb.pl @@ -320,6 +320,8 @@ use constant ATTRID => 0; use constant HUID => 1; use constant DATA => 2; use constant SECTION => 3; +use constant TARGET => 4; +use constant ATTRNAME => 5; my @attrDataforSM = (); if( !($cfgImgOutputDir =~ "none") ) { @@ -5320,9 +5322,24 @@ sub generateTargetingImage { fatal("Attribute $attributeId is not found."); } + my $ifFspOnlyTargetWithCommonAttr = "false"; + # Need to separate out the Fsp only target's common attributes + if( ($fspTarget) && (!exists $attributeDef->{fspOnly}) && + (!exists $attributeDef->{hbOnly})) + { + if( $attributeDef->{persistency} eq "volatile-zeroed" ) + { + $ifFspOnlyTargetWithCommonAttr = "true"; + } + elsif( $attributeDef->{persistency} eq "volatile" ) + { + $ifFspOnlyTargetWithCommonAttr = "true"; + } + } + my $section; # Split "fsp" into more sections later - if( (exists $attributeDef->{fspOnly}) + if( (exists $attributeDef->{fspOnly}) || ($fspTarget)) { if( $attributeDef->{persistency} eq "volatile-zeroed" ) @@ -5435,7 +5452,8 @@ sub generateTargetingImage { #", $attrhash{$attributeId}->{default}," \n"; my $hex = unpack ("H*",$rwdata); - push @attrDataforSM, [$attrValue, $huidValue, $hex, $section]; + push @attrDataforSM, [$attrValue, $huidValue, + $hex, $section, $targetInstance->{id}, $attributeId]; # Align the data as necessary my $pads = ($alignment - ($rwOffset % $alignment)) @@ -5458,7 +5476,8 @@ sub generateTargetingImage { $attributeDef,$attrhash{$attributeId}->{default}); my $hex = unpack ("H*",$heapZeroInitData); - push @attrDataforSM, [$attrValue, $huidValue, $hex, $section]; + push @attrDataforSM, [$attrValue, $huidValue, + $hex, $section, $targetInstance->{id}, $attributeId]; # Align the data as necessary my $pads = ($alignment - ($heapZeroInitOffset @@ -5481,7 +5500,8 @@ sub generateTargetingImage { $attributeDef,$attrhash{$attributeId}->{default}); my $hex = unpack ("H*",$heapPnorInitData); - push @attrDataforSM, [$attrValue, $huidValue, $hex, $section]; + push @attrDataforSM, [$attrValue, $huidValue, + $hex, $section, $targetInstance->{id}, $attributeId]; # Align the data as necessary my $pads = ($alignment - ($heapPnorInitOffset % $alignment)) % $alignment; @@ -5502,6 +5522,14 @@ sub generateTargetingImage { $attributes, $attributeDef,$attrhash{$attributeId}->{default}); + if($ifFspOnlyTargetWithCommonAttr eq "true") + { + my $hex = unpack ("H*",$fspP0ZeroData); + push @attrDataforSM, [$attrValue, $huidValue, + $hex, $section, $targetInstance->{id}, $attributeId]; + $ifFspOnlyTargetWithCommonAttr = "false"; + } + # Align the data as necessary my $pads = ($alignment - ($fspP0DefaultedFromZeroOffset % $alignment)) % $alignment; @@ -5521,6 +5549,14 @@ sub generateTargetingImage { $attributes, $attributeDef,$attrhash{$attributeId}->{default}); + if($ifFspOnlyTargetWithCommonAttr eq "true") + { + my $hex = unpack ("H*",$fspP0FlashData); + push @attrDataforSM, [$attrValue, $huidValue, + $hex, $section, $targetInstance->{id}, $attributeId]; + $ifFspOnlyTargetWithCommonAttr = "false"; + } + # Align the data as necessary my $pads = ($alignment - ($fspP0DefaultedFromP3Offset % $alignment)) % $alignment; @@ -5561,7 +5597,8 @@ sub generateTargetingImage { my $hex = unpack ("H*",$fspP3RwData); - push @attrDataforSM, [$attrValue, $huidValue, $hex, $section]; + push @attrDataforSM, [$attrValue, $huidValue, + $hex, $section, $targetInstance->{id}, $attributeId]; # Align the data as necessary my $pads = ($alignment - ($fspP3RwOffset @@ -5584,7 +5621,8 @@ sub generateTargetingImage { my $hex = unpack ("H*",$fspP1ZeroData); - push @attrDataforSM, [$attrValue, $huidValue, $hex, $section]; + push @attrDataforSM, [$attrValue, $huidValue, + $hex, $section, $targetInstance->{id}, $attributeId]; # Align the data as necessary my $pads = ($alignment - ($fspP1DefaultedFromZeroOffset @@ -5607,7 +5645,8 @@ sub generateTargetingImage { my $hex = unpack ("H*",$fspP1FlashData); - push @attrDataforSM, [$attrValue, $huidValue, $hex, $section]; + push @attrDataforSM, [$attrValue, $huidValue, + $hex, $section, $targetInstance->{id}, $attributeId]; # Align the data as necessary my $pads = ($alignment - ($fspP1DefaultedFromP3Offset @@ -5900,7 +5939,9 @@ print SM_TARGET_FILE " 0x$attrDataforSM[$i][ATTRID] $attrDataforSM[$i][HUID] 0x$attrDataforSM[$i][DATA] -
$attrDataforSM[$i][SECTION]
"; +
$attrDataforSM[$i][SECTION]
+ $attrDataforSM[$i][TARGET] + $attrDataforSM[$i][ATTRNAME]"; print SM_TARGET_FILE "\n\n"; } -- cgit v1.2.1