summaryrefslogtreecommitdiffstats
path: root/src/build/buildpnor/PnorUtils.pm
diff options
context:
space:
mode:
authorZach Clark <zach@ibm.com>2019-05-01 11:18:13 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2019-05-13 09:10:45 -0500
commit6a2bedba84d0cc0b4a8837341e516a491218b729 (patch)
tree97b465ab89b43692408a5d2329ff7fdb6a65f185 /src/build/buildpnor/PnorUtils.pm
parent06d0a08aa27fa9e28cc300fbd2814fd9b84d59cf (diff)
downloadtalos-hostboot-6a2bedba84d0cc0b4a8837341e516a491218b729.tar.gz
talos-hostboot-6a2bedba84d0cc0b4a8837341e516a491218b729.zip
Developer Improvement: Get code coverage tool working with Hostboot
This commit fixes GCOV code coverage for P9 with GCC 4.9.2 Change-Id: Ie1e7c35f67414531dbd6e7a771ac1529a9ebd59d RTC: 208351 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/76812 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com> Reviewed-by: Ilya Smirnov <ismirno@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/build/buildpnor/PnorUtils.pm')
-rw-r--r--src/build/buildpnor/PnorUtils.pm43
1 files changed, 20 insertions, 23 deletions
diff --git a/src/build/buildpnor/PnorUtils.pm b/src/build/buildpnor/PnorUtils.pm
index 9cae4360b..d6faac42d 100644
--- a/src/build/buildpnor/PnorUtils.pm
+++ b/src/build/buildpnor/PnorUtils.pm
@@ -374,10 +374,11 @@ sub checkSpaceConstraints
{
# If this is a test run increase HBI size by PAGE_SIZE until all test
# cases fit
- if ($testRun && $eyeCatch eq "HBI")
+ if ($eyeCatch eq "HBI")
{
- print "$this_func: Adjusting HBI size - ran out of space for test cases\n";
- adjustHbiPhysSize(\%sectionHash, $layoutKey, $filesize);
+ print "Adjusting HBI size - ran out of space for test cases\n";
+ my $stopKey = findLayoutKeyByEyeCatch("TEST", \%$i_pnorLayoutRef);
+ adjustSecPhysSize(\%sectionHash, $layoutKey, $filesize, $stopKey);
}
else
{
@@ -390,39 +391,35 @@ sub checkSpaceConstraints
###############################################################################
-# adjustHbiPhysSize - Adjust HBI physical size when running test cases and fix
-# up physical offsets of partitions after it
+# adjustSecPhysSize - Adjust section physical size when running test cases
+# and fix up physical offsets between partitions
+# (for example HBI and TEST)
################################################################################
-sub adjustHbiPhysSize
+sub adjustSecPhysSize
{
- my ($i_sectionHashRef, $i_hbiKey, $i_filesize) = @_;
- my $this_func = (caller(0))[3];
+ my ($i_sectionHashRef, $i_secKey, $i_filesize, $i_stopKey) = @_;
my %sectionHash = %$i_sectionHashRef;
# Increment HBI physical size by PAGE_SIZE until the HBI file can fit
- my $hbi_old = $sectionHash{$i_hbiKey}{physicalRegionSize};
- while ($i_filesize > $sectionHash{$i_hbiKey}{physicalRegionSize})
+ my $sec_old = $sectionHash{$i_secKey}{physicalRegionSize};
+ while ($i_filesize > $sectionHash{$i_secKey}{physicalRegionSize})
{
- $sectionHash{$i_hbiKey}{physicalRegionSize} += PAGE_SIZE;
+ $sectionHash{$i_secKey}{physicalRegionSize} += PAGE_SIZE;
}
- my $hbi_move = $sectionHash{$i_hbiKey}{physicalRegionSize} - $hbi_old;
- my $hbi_end = $sectionHash{$i_hbiKey}{physicalRegionSize} + $hbi_move;
+ my $sec_move = $sectionHash{$i_secKey}{physicalRegionSize} - $sec_old;
+ my $sec_end = $sectionHash{$i_secKey}{physicalRegionSize} + $sec_move;
# Fix up physical offset affected by HBI size change
foreach my $section (keys %sectionHash)
{
- # Only fix partitions after HBI
- if ( $sectionHash{$section}{physicalOffset} >
- $sectionHash{$i_hbiKey}{physicalOffset} )
- {
- my $origoffset = $sectionHash{$section}{physicalOffset};
- $sectionHash{$section}{physicalOffset} += $hbi_move;
- trace(3, "$this_func: Section $sectionHash{$section}{eyeCatch} : " . sprintf("%X",$origoffset) . " --> " . sprintf("%X",$sectionHash{$section}{physicalOffset}));
- }
- else
+ # Only fix partitions after HBI and before $i_stopKey
+ if ($sectionHash{$section}{physicalOffset} > $sectionHash{$i_secKey}{physicalOffset}
+ && $sectionHash{$section}{physicalOffset} < $sectionHash{$i_stopKey}{physicalOffset})
{
- printf "$this_func: Section $sectionHash{$section}{eyeCatch} : unchanged";
+ my $new_location = $sectionHash{$section}{physicalOffset} + $sec_move;
+ print "Moving section $sectionHash{$section}{eyeCatch} forward by $sec_move bytes to $new_location\n";
+ $sectionHash{$section}{physicalOffset} = $new_location;
}
}
}
OpenPOWER on IntegriCloud