Skip to content

Commit

Permalink
PRD: Add asserts for invalid symbol
Browse files Browse the repository at this point in the history
Change-Id: I56f8e75e4cc5368ad34c8ad18f444dc57dd06e41
CQ: SW390567
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/41320
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Caleb N. Palmer <cnpalmer@us.ibm.com>
Reviewed-by: Brian J. Stegmiller <bjs@us.ibm.com>
Reviewed-by: Zane C. Shelley <zshelle@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/41568
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
  • Loading branch information
bweisenb authored and zane131 committed Jun 9, 2017
1 parent 80275ee commit 6953366
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/usr/diag/prdf/common/plat/mem/prdfMemSymbol.C
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ MemSymbol MemSymbol::fromGalois( TargetHandle_t i_trgt, const MemRank & i_rank,
}
}

PRDF_ASSERT( symbol < SYMBOLS_PER_RANK );

// Get pins from mask.
uint8_t pins = NO_SYMBOL_DQS;
if ( TYPE_MBA == getTargetType(i_trgt) )
Expand Down
4 changes: 4 additions & 0 deletions src/usr/diag/prdf/common/plat/mem/prdfMemUtils.C
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ int32_t collectCeStats<TYPE_MCA>( ExtensibleChip * i_chip,
if ( 0 == count ) continue; // nothing to do

uint8_t sym = baseSymbol + i;
PRDF_ASSERT( sym < SYMBOLS_PER_RANK );

uint8_t dram = isX4 ? symbol2Nibble<TYPE_MCA>( sym )
: symbol2Byte <TYPE_MCA>( sym );

Expand Down Expand Up @@ -186,6 +188,8 @@ int32_t collectCeStats<TYPE_MCA>( ExtensibleChip * i_chip,
{
uint8_t sym = isX4 ? nibble2Symbol<TYPE_MCA>( highestDram )
: byte2Symbol <TYPE_MCA>( highestDram );
PRDF_ASSERT( sym < SYMBOLS_PER_RANK );

o_chipMark = MemSymbol::fromSymbol( mcaTrgt, i_rank, sym );
}

Expand Down

0 comments on commit 6953366

Please sign in to comment.