diff options
-rwxr-xr-x | src/usr/hwpf/fapi/fapiParseErrorInfo.pl | 14 | ||||
-rw-r--r-- | src/usr/hwpf/hwp/dimmBadDqBitmapFuncs.C | 74 | ||||
-rw-r--r-- | src/usr/hwpf/hwp/dram_training/hbVddrMsg.C | 15 | ||||
-rw-r--r-- | src/usr/hwpf/plat/fapiPlatSystemConfig.C | 18 | ||||
-rw-r--r-- | src/usr/targeting/attrrp.C | 23 | ||||
-rw-r--r-- | src/usr/targeting/common/predicates/predicatepostfixexpr.C | 55 | ||||
-rw-r--r-- | src/usr/targeting/common/targetservice.C | 22 | ||||
-rw-r--r-- | src/usr/targeting/namedtarget.C | 52 |
8 files changed, 150 insertions, 123 deletions
diff --git a/src/usr/hwpf/fapi/fapiParseErrorInfo.pl b/src/usr/hwpf/fapi/fapiParseErrorInfo.pl index f148a33f2..2ddc8c1a8 100755 --- a/src/usr/hwpf/fapi/fapiParseErrorInfo.pl +++ b/src/usr/hwpf/fapi/fapiParseErrorInfo.pl @@ -636,13 +636,14 @@ print CRFILE " return;\n"; print CRFILE " }\n\n"; print CRFILE " uint8_t * l_pBuf = new uint8_t[l_ffdcSize];\n"; print CRFILE " uint8_t * l_pData = l_pBuf;\n\n"; -print CRFILE " for (uint32_t i = 0; i < l_cfamAddresses.size(); i++)\n"; +print CRFILE " for (std::vector<uint32_t>::const_iterator cfamIter = l_cfamAddresses.begin();\n"; +print CRFILE " cfamIter != l_cfamAddresses.end(); ++cfamIter)\n"; print CRFILE " {\n"; -print CRFILE " l_rc = fapiGetCfamRegister(i_target, l_cfamAddresses[i], l_buf);\n"; +print CRFILE " l_rc = fapiGetCfamRegister(i_target, *cfamIter, l_buf);\n"; print CRFILE " if (l_rc)\n"; print CRFILE " {\n"; print CRFILE " FAPI_ERR(\"fapiCollectRegFfdc.C: CFAM error for 0x%x\","; -print CRFILE "l_cfamAddresses[i]);\n"; +print CRFILE "*cfamIter);\n"; print CRFILE " l_cfamData = 0xbaddbadd;\n"; print CRFILE " }\n"; print CRFILE " else\n"; @@ -652,13 +653,14 @@ print CRFILE " }\n"; print CRFILE " *(reinterpret_cast<uint32_t *>(l_pData)) = l_cfamData;\n"; print CRFILE " l_pData += sizeof(l_cfamData);\n"; print CRFILE " }\n\n"; -print CRFILE " for (uint32_t i = 0; i < l_scomAddresses.size(); i++)\n"; +print CRFILE " for (std::vector<uint64_t>::const_iterator scomIter = l_scomAddresses.begin();\n"; +print CRFILE " scomIter != l_scomAddresses.end(); ++scomIter)\n"; print CRFILE " {\n"; -print CRFILE " l_rc = fapiGetScom(i_target, l_scomAddresses[i], l_buf);\n"; +print CRFILE " l_rc = fapiGetScom(i_target, *scomIter, l_buf);\n"; print CRFILE " if (l_rc)\n"; print CRFILE " {\n"; print CRFILE " FAPI_ERR(\"fapiCollectRegFfdc.C: SCOM error for 0x%llx\","; -print CRFILE "l_scomAddresses[i]);\n"; +print CRFILE "*scomIter);\n"; print CRFILE " l_scomData = 0xbaddbaddbaddbaddULL;\n"; print CRFILE " }\n"; print CRFILE " else\n"; diff --git a/src/usr/hwpf/hwp/dimmBadDqBitmapFuncs.C b/src/usr/hwpf/hwp/dimmBadDqBitmapFuncs.C index e9d413adc..788ee3223 100644 --- a/src/usr/hwpf/hwp/dimmBadDqBitmapFuncs.C +++ b/src/usr/hwpf/hwp/dimmBadDqBitmapFuncs.C @@ -1,25 +1,25 @@ -// IBM_PROLOG_BEGIN_TAG -// This is an automatically generated prolog. -// -// $Source: src/usr/hwpf/hwp/dimmBadDqBitmapFuncs.C $ -// -// IBM CONFIDENTIAL -// -// COPYRIGHT International Business Machines Corp. 2012 -// -// p1 -// -// Object Code Only (OCO) source materials -// Licensed Internal Code Source Materials -// IBM HostBoot Licensed Internal Code -// -// The source code for this program is not published or other- -// wise divested of its trade secrets, irrespective of what has -// been deposited with the U.S. Copyright Office. -// -// Origin: 30 -// -// IBM_PROLOG_END +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/hwpf/hwp/dimmBadDqBitmapFuncs.C $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2012,2013 */ +/* */ +/* p1 */ +/* */ +/* Object Code Only (OCO) source materials */ +/* Licensed Internal Code Source Materials */ +/* IBM HostBoot Licensed Internal Code */ +/* */ +/* The source code for this program is not published or otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ /** * @file dimmBadDqBitmapFuncs.C * @@ -65,8 +65,8 @@ fapi::ReturnCode dimmBadDqCheckParamFindDimm(const fapi::Target & i_mba, (i_dimm >= DIMM_DQ_MAX_MBAPORT_DIMMS) || (i_rank >= DIMM_DQ_MAX_DIMM_RANKS)) { - FAPI_ERR("dimmBadDqCheckParams: Bad parameter. %d:%d:%d", i_port, - i_dimm, i_rank); + FAPI_ERR("dimmBadDqCheckParamFindDimm: Bad parameter. %d:%d:%d", + i_port, i_dimm, i_rank); const uint8_t & FFDC_PORT = i_port; const uint8_t & FFDC_DIMM = i_dimm; const uint8_t & FFDC_RANK = i_rank; @@ -81,36 +81,41 @@ fapi::ReturnCode dimmBadDqCheckParamFindDimm(const fapi::Target & i_mba, if (l_rc) { - FAPI_ERR("dimmBadDqFindDimm: Error from fapiGetAssociatedDimms"); + FAPI_ERR("dimmBadDqCheckParamFindDimm: " + "Error from fapiGetAssociatedDimms"); } else { // Find the DIMM with the correct MBA port/dimm - uint8_t i = 0; uint8_t l_port = 0; uint8_t l_dimm = 0; + std::vector<fapi::Target>::const_iterator dimmIter; - for (; i < l_dimms.size(); i++) + for (dimmIter = l_dimms.begin(); + dimmIter != l_dimms.end(); + ++dimmIter) { - l_rc = FAPI_ATTR_GET(ATTR_MBA_PORT, &(l_dimms[i]), l_port); + l_rc = FAPI_ATTR_GET(ATTR_MBA_PORT, &(*dimmIter), l_port); if (l_rc) { - FAPI_ERR("dimmBadDqFindDimm: Error getting ATTR_MBA_PORT for dimm"); + FAPI_ERR("dimmBadDqCheckParamFindDimm: " + "Error getting ATTR_MBA_PORT for dimm"); break; } else if (l_port == i_port) { - l_rc = FAPI_ATTR_GET(ATTR_MBA_DIMM, &(l_dimms[i]), l_dimm); + l_rc = FAPI_ATTR_GET(ATTR_MBA_DIMM, &(*dimmIter), l_dimm); if (l_rc) { - FAPI_ERR("dimmBadDqFindDimm: Error getting ATTR_MBA_DIMM for dimm"); + FAPI_ERR("dimmBadDqCheckParamFindDimm: " + "Error getting ATTR_MBA_DIMM for dimm"); break; } else if (l_dimm == i_dimm) { - o_dimm = l_dimms[i]; + o_dimm = *dimmIter; break; } } @@ -118,9 +123,10 @@ fapi::ReturnCode dimmBadDqCheckParamFindDimm(const fapi::Target & i_mba, if (!l_rc) { - if (i == l_dimms.size()) + if (dimmIter == l_dimms.end()) { - FAPI_ERR("dimmBadDqFindDimm: Did not find DIMM for %s:%d:%d", + FAPI_ERR("dimmBadDqCheckParamFindDimm: " + "Did not find DIMM for %s:%d:%d", i_mba.toEcmdString(), i_port, i_dimm); const fapi::Target & FFDC_MBA_TARGET = i_mba; const uint8_t & FFDC_PORT = i_port; diff --git a/src/usr/hwpf/hwp/dram_training/hbVddrMsg.C b/src/usr/hwpf/hwp/dram_training/hbVddrMsg.C index f98c86ee8..411192288 100644 --- a/src/usr/hwpf/hwp/dram_training/hbVddrMsg.C +++ b/src/usr/hwpf/hwp/dram_training/hbVddrMsg.C @@ -106,9 +106,12 @@ void HBVddrMsg::createVddrData( hwsvPowrVmemRequest_t l_entry; - for ( size_t i = 0; i < l_membufTargetList.size(); i++ ) + for (TARGETING::TargetHandleList::const_iterator + membufIter = l_membufTargetList.begin(); + membufIter != l_membufTargetList.end(); + ++membufIter) { - l_Target=l_membufTargetList[i]; + l_Target = *membufIter; TARGETING::ATTR_VMEM_ID_type l_VmemId= l_Target->getAttr<TARGETING::ATTR_VMEM_ID>(); @@ -123,8 +126,8 @@ void HBVddrMsg::createVddrData( if (l_membufTargetList.size() >1) { - //take out the duplicates Voltage IDs in io_request by first sorting and - //then removing the duplicates + //take out the duplicates Voltage IDs in io_request by first sorting + //and then removing the duplicates std::sort(io_request.begin(), io_request.end(), compareVids); @@ -206,7 +209,7 @@ errlHndl_t HBVddrMsg::sendMsg(uint32_t i_msgType) const hwsvPowrVmemRequest_t* l_ptr = reinterpret_cast<hwsvPowrVmemRequest_t*>(l_data); - for (size_t j =0; j<l_dataCount; j++) + for (size_t j =0; j<l_dataCount; ++j) { l_ptr->VmemId=l_request.at(j).VmemId; l_ptr->Voltage=l_request.at(j).Voltage; @@ -299,7 +302,7 @@ errlHndl_t HBVddrMsg::processVDDRmsg(msg_t* i_recvMsg) const const hwsvPowrVmemReply_t* l_ptr= reinterpret_cast<const hwsvPowrVmemReply_t*>(l_extraData); - for (size_t i=0; i<l_elementCount; i++) + for (size_t i=0; i<l_elementCount; ++i) { l_VmemId = l_ptr->VmemId; l_errPlid = l_ptr->plid; diff --git a/src/usr/hwpf/plat/fapiPlatSystemConfig.C b/src/usr/hwpf/plat/fapiPlatSystemConfig.C index 6551ca6e1..a94766cbf 100644 --- a/src/usr/hwpf/plat/fapiPlatSystemConfig.C +++ b/src/usr/hwpf/plat/fapiPlatSystemConfig.C @@ -313,10 +313,13 @@ fapi::ReturnCode fapiGetChildChiplets( false); // Return fapi::Targets to the caller - for (uint32_t i = 0; i < l_chipletList.size(); i++) + for (TARGETING::TargetHandleList::const_iterator + chipletIter = l_chipletList.begin(); + chipletIter != l_chipletList.end(); + ++chipletIter) { TARGETING::HwasState l_state = - l_chipletList[i]->getAttr<TARGETING::ATTR_HWAS_STATE>(); + (*chipletIter)->getAttr<TARGETING::ATTR_HWAS_STATE>(); if ((fapi::TARGET_STATE_PRESENT == i_state) && !l_state.present) @@ -330,7 +333,7 @@ fapi::ReturnCode fapiGetChildChiplets( } fapi::Target l_chiplet(i_chipletType, - reinterpret_cast<void *>(l_chipletList[i])); + reinterpret_cast<void *>(*chipletIter)); o_chiplets.push_back(l_chiplet); } } @@ -388,10 +391,13 @@ fapi::ReturnCode fapiGetAssociatedDimms( TARGETING::TargetService::ALL, &l_predicate); // Return fapi::Targets to the caller - for (uint32_t i = 0; i < l_dimmList.size(); i++) + for (TARGETING::TargetHandleList::const_iterator + dimmIter = l_dimmList.begin(); + dimmIter != l_dimmList.end(); + ++dimmIter) { TARGETING::HwasState l_state = - l_dimmList[i]->getAttr<TARGETING::ATTR_HWAS_STATE>(); + (*dimmIter)->getAttr<TARGETING::ATTR_HWAS_STATE>(); if ((fapi::TARGET_STATE_PRESENT == i_state) && !l_state.present) { @@ -404,7 +410,7 @@ fapi::ReturnCode fapiGetAssociatedDimms( } fapi::Target l_dimm(fapi::TARGET_TYPE_DIMM, - reinterpret_cast<void *>(l_dimmList[i])); + reinterpret_cast<void *>(*dimmIter)); o_dimms.push_back(l_dimm); } } diff --git a/src/usr/targeting/attrrp.C b/src/usr/targeting/attrrp.C index 7c6c9e55f..b5ae745ef 100644 --- a/src/usr/targeting/attrrp.C +++ b/src/usr/targeting/attrrp.C @@ -154,7 +154,7 @@ namespace TARGETING // Locate corresponding attribute section for message. ssize_t section = -1; - for (size_t i = 0; i < iv_sectionCount; i++) + for (size_t i = 0; i < iv_sectionCount; ++i) { if ((vAddr >= iv_sections[i].vmmAddress) && (vAddr < iv_sections[i].vmmAddress + iv_sections[i].size)) @@ -338,7 +338,7 @@ namespace TARGETING ); // Parse each section. - for (size_t i = 0; i < iv_sectionCount; i++, l_section++) + for (size_t i = 0; i < iv_sectionCount; i++, ++l_section) { iv_sections[i].type = l_section->sectionType; @@ -379,7 +379,7 @@ namespace TARGETING iv_msgQ = msg_q_create(); // Create VMM block for each section, assign permissions. - for (size_t i = 0; i < iv_sectionCount; i++) + for (size_t i = 0; i < iv_sectionCount; ++i) { uint64_t l_perm = 0; switch(iv_sections[i].type) @@ -515,12 +515,15 @@ namespace TARGETING bool l_rc = true; // true if write to section is successful // for each page - for ( size_t i = 0; (i < i_pages.size()) && (true == l_rc); i++ ) + for (std::vector<TARGETING::sectionRefData>::const_iterator + pageIter = i_pages.begin(); + (pageIter != i_pages.end()) && (true == l_rc); + ++pageIter) { // search for the section we need - for ( size_t j = 0; j < iv_sectionCount; j++ ) + for ( size_t j = 0; j < iv_sectionCount; ++j ) { - if ( iv_sections[j].type == i_pages[i].sectionId ) + if ( iv_sections[j].type == (*pageIter).sectionId ) { // found it.. TARG_DBG( "Writing Attribute Section: ID: %u, " @@ -528,10 +531,10 @@ namespace TARGETING iv_sections[j].type, iv_sections[j].vmmAddress, iv_sections[j].size, - i_pages[i].pageNumber); + (*pageIter).pageNumber); // check that page number is within range - uint64_t l_pageOffset = i_pages[i].pageNumber * PAGESIZE; + uint64_t l_pageOffset = (*pageIter).pageNumber * PAGESIZE; if ( iv_sections[j].size < (l_pageOffset + PAGESIZE) ) { TARG_ERR("page offset 0x%lx is greater than " @@ -549,7 +552,7 @@ namespace TARGETING reinterpret_cast<uint8_t *> (iv_sections[j].vmmAddress) + l_pageOffset; - memcpy( l_dataPtr, i_pages[i].dataPtr, PAGESIZE ); + memcpy( l_dataPtr, (*pageIter).dataPtr, PAGESIZE ); break; } } @@ -573,7 +576,7 @@ namespace TARGETING uint16_t pages = 0; // search for the section we need - for (size_t i = 0; i < iv_sectionCount; i++ ) + for (size_t i = 0; i < iv_sectionCount; ++i ) { if ( iv_sections[i].type == i_sectionId ) { diff --git a/src/usr/targeting/common/predicates/predicatepostfixexpr.C b/src/usr/targeting/common/predicates/predicatepostfixexpr.C index babebfb1f..c38814a11 100644 --- a/src/usr/targeting/common/predicates/predicatepostfixexpr.C +++ b/src/usr/targeting/common/predicates/predicatepostfixexpr.C @@ -1,25 +1,25 @@ -// IBM_PROLOG_BEGIN_TAG -// This is an automatically generated prolog. -// -// $Source: src/usr/targeting/predicates/predicatepostfixexpr.C $ -// -// IBM CONFIDENTIAL -// -// COPYRIGHT International Business Machines Corp. 2011 -// -// p1 -// -// Object Code Only (OCO) source materials -// Licensed Internal Code Source Materials -// IBM HostBoot Licensed Internal Code -// -// The source code for this program is not published or other- -// wise divested of its trade secrets, irrespective of what has -// been deposited with the U.S. Copyright Office. -// -// Origin: 30 -// -// IBM_PROLOG_END +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/targeting/common/predicates/predicatepostfixexpr.C $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2011,2013 */ +/* */ +/* p1 */ +/* */ +/* Object Code Only (OCO) source materials */ +/* Licensed Internal Code Source Materials */ +/* IBM HostBoot Licensed Internal Code */ +/* */ +/* The source code for this program is not published or otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ /** * @file targeting/common/predicates/predicatepostfixexpr.C @@ -154,12 +154,15 @@ bool PredicatePostfixExpr::operator()( std::vector<bool> l_stack; bool l_result = false; - for(uint32_t i=0; i<iv_ops.size(); ++i) + for (std::vector<Operation>::const_iterator + opsIter = iv_ops.begin(); + opsIter != iv_ops.end(); + ++opsIter) { - switch(iv_ops[i].logicalOp) + switch((*opsIter).logicalOp) { case EVAL: - l_stack.push_back((*iv_ops[i].pPredicate)(i_pTarget)); + l_stack.push_back((*(*opsIter).pPredicate)(i_pTarget)); break; case AND: TARG_ASSERT(l_stack.size() >= 2, @@ -187,7 +190,7 @@ bool PredicatePostfixExpr::operator()( TARG_ASSERT(0, TARG_LOC "Attempted to evaluate unsupported " "logical operation %d", - iv_ops[i].logicalOp); + (*opsIter).logicalOp); break; } } diff --git a/src/usr/targeting/common/targetservice.C b/src/usr/targeting/common/targetservice.C index 390396ba6..f476e6fee 100644 --- a/src/usr/targeting/common/targetservice.C +++ b/src/usr/targeting/common/targetservice.C @@ -418,34 +418,36 @@ void TargetService::getAssociated( o_list.clear(); // Figure out which attribute to look up - for (uint32_t i = 0; i < iv_associationMappings.size(); ++i) + for (AssociationMappings_t::const_iterator + assocIter = iv_associationMappings.begin(); + assocIter != iv_associationMappings.end(); + ++assocIter) { - if (i_type == iv_associationMappings[i].associationType) + if (i_type == (*assocIter).associationType) { EntityPath l_entityPath; - bool l_exist = tryGetPath(iv_associationMappings[i].attr, + bool l_exist = tryGetPath((*assocIter).attr, i_pTarget, l_entityPath); if (l_exist) { - if (iv_associationMappings[i].associationDir == INWARDS) + if ((*assocIter).associationDir == INWARDS) { - (void) _getInwards(iv_associationMappings[i].attr, + (void) _getInwards((*assocIter).attr, i_recursionLevel, l_entityPath, i_pPredicate, o_list); } - else if (iv_associationMappings[i].associationDir - == OUTWARDS) + else if ((*assocIter).associationDir == OUTWARDS) { - (void) _getOutwards(iv_associationMappings[i].attr, + (void) _getOutwards((*assocIter).attr, i_recursionLevel, l_entityPath, i_pPredicate, o_list); } else { TARG_ASSERT(0, TARG_LOC - "iv_associationMappings[i].associationDir " + "(*assocIter).associationDir " "= 0x%X not supported", - iv_associationMappings[i].associationDir); + (*assocIter).associationDir); } } break; diff --git a/src/usr/targeting/namedtarget.C b/src/usr/targeting/namedtarget.C index 5de1d2dc7..df67777f8 100644 --- a/src/usr/targeting/namedtarget.C +++ b/src/usr/targeting/namedtarget.C @@ -1,26 +1,25 @@ -/* IBM_PROLOG_BEGIN_TAG - * This is an automatically generated prolog. - * - * $Source: src/usr/targeting/hbutil/namedtarget.C $ - * - * IBM CONFIDENTIAL - * - * COPYRIGHT International Business Machines Corp. 2012 - * - * p1 - * - * Object Code Only (OCO) source materials - * Licensed Internal Code Source Materials - * IBM HostBoot Licensed Internal Code - * - * The source code for this program is not published or other- - * wise divested of its trade secrets, irrespective of what has - * been deposited with the U.S. Copyright Office. - * - * Origin: 30 - * - * IBM_PROLOG_END_TAG - */ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/targeting/namedtarget.C $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2012,2013 */ +/* */ +/* p1 */ +/* */ +/* Object Code Only (OCO) source materials */ +/* Licensed Internal Code Source Materials */ +/* IBM HostBoot Licensed Internal Code */ +/* */ +/* The source code for this program is not published or otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ /** * @file namedtarget.C * @@ -74,9 +73,12 @@ const TARGETING::Target * getMasterCore( ) "getMasterCore: found %d cores on master proc", l_cores.size() ); - for ( uint8_t l_coreNum=0; l_coreNum < l_cores.size(); l_coreNum++ ) + for (TARGETING::TargetHandleList::const_iterator + coreIter = l_cores.begin(); + coreIter != l_cores.end(); + ++coreIter) { - TARGETING::Target * l_core = l_cores[ l_coreNum ] ; + TARGETING::Target * l_core = *coreIter; CHIP_UNIT_ATTR l_coreId = l_core->getAttr<TARGETING::ATTR_CHIP_UNIT>(); |