int32_t ErrorRegister::SetErrorSignature( STEP_CODE_DATA_STRUCT & error, BitKey & bl ) { int32_t rc = SUCCESS; ErrorSignature * esig = error.service_data->GetErrorSignature(); uint32_t blen = bl.size(); switch( blen ) { case 0: esig->setErrCode( PRD_SCAN_COMM_REGISTER_ZERO ); if( error.service_data->isPrimaryPass() ) { rc = PRD_SCAN_COMM_REGISTER_ZERO; } else if( !xNoErrorOnZeroScr ) { rc = PRD_SCAN_COMM_REGISTER_ZERO; } break; case 1: esig->setErrCode(bl.getListValue(0)); break; default: for( uint32_t index = 0; index < blen; ++index ) { esig->setErrCode(bl.getListValue(index)); } esig->setErrCode(PRD_MULTIPLE_ERRORS); }; return rc; }
//--------------------------------------------------------------------- // Member Function Specifications //--------------------------------------------------------------------- int32_t ResetErrorRegister::Reset(const BitKey & bit_list, STEP_CODE_DATA_STRUCT & error) { #ifndef __HOSTBOOT_MODULE ServiceDataCollector & sdc = *(error.service_data); SyncAnalysis (sdc); //Add call to Sync SDC #endif int32_t rc = ErrorRegisterMask::Reset(bit_list,error); // set mask bits & undo filters uint32_t bl_length = bit_list.size(); if(bl_length != 0) // Check for bits to reset { if(&scr != resetScr) // reset different then ereg scr - move bits { resetScr->SetBitString(scr.GetBitString()); } uint32_t i; for(i = 0; i < bl_length; ++i) // Turn off all bits specified { resetScr->ClearBit(bit_list.getListValue(i)); } rc = resetScr->Write(); // Write hardware } return rc; }
int32_t XorResetErrorRegister::Reset(const BitKey & bit_list, STEP_CODE_DATA_STRUCT & error) { #ifndef __HOSTBOOT_MODULE ServiceDataCollector & sdc = *(error.service_data); SyncAnalysis (sdc); #endif int32_t rc = ErrorRegisterMask::Reset(bit_list,error); // set mask bits and undo filters uint32_t bl_length = bit_list.size(); if(bl_length != 0) // Check for bits to reset { scr.clearAllBits(); // Turn on all bits to be reset // We acted on all bits in bit_list so they should all be on // in the hdw register uint32_t i; for(i = 0; i < bl_length; ++i) // Turn on bits to be reset { scr.SetBit(bit_list.getListValue(i)); } rc = scr.Write(); // Write hardware } return rc; }
int32_t AndResetErrorRegister::Reset(const BitKey & bit_list, STEP_CODE_DATA_STRUCT & error) { #ifndef __HOSTBOOT_MODULE ServiceDataCollector & sdc = *(error.service_data); SyncAnalysis (sdc); #endif // set internal mask bits if threshold int32_t rc = ErrorRegisterMask::Reset(bit_list,error); // set mask bits and undo filters uint32_t bl_length = bit_list.size(); if(bl_length !=0) { BIT_STRING_BUFFER_CLASS bs(xAndResetScr.GetBitLength()); bs.Pattern(0xffffffff,32); // set to all ones uint32_t i; for(i = 0; i < bl_length; ++i) // Turn off all bits used to isolate problem { bs.Clear(bit_list.getListValue(i)); } xAndResetScr.SetBitString(&bs); // copy bs to SCR bit string rc = xAndResetScr.Write(); // Write hardware (result = Hareware value ANDed with bs) } return rc; }
bool PrioritySingleBitFilter::Apply( BitKey & bit_list, STEP_CODE_DATA_STRUCT & io_sdc ) { bool l_modified = false; // Do priority bit. for ( size_t i = 0; i < iv_bitList.size(); i++ ) { BitKey l_key = iv_bitList[i]; if ( bit_list.isSubset(l_key) ) { l_modified = true; bit_list = l_key; break; } } // Do single bit filter portion. if ( !l_modified ) { while ( 1 < bit_list.size() ) { l_modified = true; bit_list.removeBit(); } } return l_modified; }
bool SingleBitFilter::Apply( BitKey & bit_list, STEP_CODE_DATA_STRUCT & io_sdc ) { bool rc = false; uint32_t list_length = bit_list.size(); if( list_length > 1 ) { rc = true; while( --list_length ) { bit_list.removeBit(); } } return( rc ); }
// Candidate funciton for bs class bool BitKey::isSubset(const BitKey & that) const { bool result = true; const uint32_t * mydata = cDataPtr(); const uint32_t * yodata = that.cDataPtr(); uint32_t mysize = getWordSize(iv_Capacity); uint32_t yosize = getWordSize(that.iv_Capacity); uint32_t smsize = (yosize < mysize)? yosize : mysize; // size can be non-zero with no bits on - so if that has no bits than use // operator== BitKey zero; // only true if both are empty - eg not bits on" if(that == zero) result = operator==(that); // if yosize <= mysize than just match smallest amount of data // if yozize > mysize than extra yodata must be zero for(uint32_t i = 0; (i < smsize) && (result == true); ++i,++mydata,++yodata) { result = (*mydata & *yodata) == *yodata; } if(result && (yosize > mysize)) { for(yosize -= mysize; yosize != 0 && result; --yosize, ++yodata) { result = *yodata == 0x00000000; } } return result; }
bool BitKey::operator==(const BitKey & that) const { bool result = true; const uint32_t * mydata = cDataPtr(); const uint32_t * yodata = that.cDataPtr(); uint32_t mysize = getWordSize(iv_Capacity); uint32_t yosize = getWordSize(that.iv_Capacity); uint32_t smsize = (yosize < mysize)? yosize : mysize; // If size is different than the extra must be zero for(uint32_t i = 0; (i < smsize) && (result == true); ++i,++mydata,++yodata) { result = (*mydata == *yodata); } if(result && (yosize > mysize)) { for(yosize -= mysize; yosize != 0 && result; --yosize, ++yodata) { result = *yodata == 0x00000000; } } else if (result && (mysize > yosize)) { for(mysize -= yosize; mysize != 0 && result; --mysize, ++mydata) { result = *mydata == 0x00000000; } } return result; }
bool FilterPriority::Apply( BitKey & ioBitList, STEP_CODE_DATA_STRUCT & io_sdc ) { bool modified = false; if( ioBitList.isSubset(ivBitKey) ) { ioBitList = ivBitKey; modified = true; } return modified; }
bool FilterTranspose::Undo(BitKey & iBitList) { bool result = false; BitKey testbl(ivSingleBitPos); if(iBitList.isSubset(testbl)) { iBitList = ivBitKey; result = true; } return result; }
bool SecondaryBitsFilter::Apply( BitKey & io_bitList, STEP_CODE_DATA_STRUCT & io_sdc ) { #define PRDF_FUNC "[SecondaryBitsFilter::Apply] " bool l_modified = false; do { // This filter should only be applied on the primary passs. if ( !io_sdc.service_data->isPrimaryPass() ) break; // This filter should only be applied if the primary attention type is // CHECK_STOP. if ( CHECK_STOP != io_sdc.service_data->GetAttentionType() ) break; // This filter should only be applied if the the secondary attention // type is RECOVERABLE. if ( RECOVERABLE != io_sdc.service_data->GetCauseAttentionType()) break; //if there is no secondary bit position to flip or if no bit is set in //bit key then let us skip this apply. if( ( 0 == iv_secBitList.size() ) || ( 0 == io_bitList.size()) ) break; BitKey l_key ( iv_secBitList ); io_bitList.removeBits( l_key ); l_modified = true; if( 0 == io_bitList.size() ) { // So, we have no primary bits on. We have one or more secondary bit // on. io_sdc.service_data->setSecondaryErrFlag(); } }while(0); return l_modified; #undef PRDF_FUNC }
void BitKey::removeBits(const BitKey & i_bk) { BitString mybs(iv_Capacity,(CPU_WORD *)DataPtr()); const BitString yobs(i_bk.iv_Capacity,(CPU_WORD *)i_bk.cDataPtr()); mybs.Mask(yobs); }