summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarty Gloff <mgloff@us.ibm.com>2018-03-29 08:49:39 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2018-04-04 14:56:54 -0400
commitfef105cbd664203857cb4ff11585202a6cee29b1 (patch)
treecfe0319090724d0e6d33a07d57a4f48b8b1ee803
parente3bff0327790672a3f84b0677624fe7dbe13ccd4 (diff)
downloadtalos-hostboot-fef105cbd664203857cb4ff11585202a6cee29b1.tar.gz
talos-hostboot-fef105cbd664203857cb4ff11585202a6cee29b1.zip
Resolve NodeInfo Naming Conflict
Both TargetService and AttrRP have variables and typedefs with various forms of 'NodeInfo' in their names. To reduce confusion and possible conflicts, names in TargetService are being changed. Change-Id: Iab1dd624a0e9c1f80e8dbcdf500e25b51f02a48a RTC: 142908 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/56454 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Prachi Gupta <pragupta@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
-rw-r--r--src/include/usr/targeting/common/targetservice.H12
-rw-r--r--src/usr/targeting/common/iterators/targetiterator.C12
-rw-r--r--src/usr/targeting/common/targetservice.C108
3 files changed, 67 insertions, 65 deletions
diff --git a/src/include/usr/targeting/common/targetservice.H b/src/include/usr/targeting/common/targetservice.H
index 2c8133ae8..04bcc8657 100644
--- a/src/include/usr/targeting/common/targetservice.H
+++ b/src/include/usr/targeting/common/targetservice.H
@@ -823,7 +823,7 @@ class TargetService
/**
* @brief Node Specific information container
*/
- typedef std::vector< NodeSpecificInfo > NodeInfo_t;
+ typedef std::vector< NodeSpecificInfo > NodeData_t;
/**
* @brief Returns the first Target from the first initialized node
@@ -867,7 +867,7 @@ class TargetService
* on the PNOR (or override) image, and updates the target service to
* point to the start of the target array, wherever it may reside
*
- * @param[in] i_nodeInfoContainer, struct to contain all node
+ * @param[in] i_nodeContainer, struct to contain all node
* specific information of the type NodeSpecificInfo. May refer to
* structure definition
*
@@ -878,7 +878,7 @@ class TargetService
*
* @post Target service target pool configured for access
*/
- void _configureTargetPool(NodeSpecificInfo& i_nodeInfoContainer,
+ void _configureTargetPool(NodeSpecificInfo& i_nodeContainer,
AttrRP *i_attrRP = NULL);
/**
@@ -888,7 +888,7 @@ class TargetService
* Computes the maximum number of targets possible based on the PNOR
* (or override) image and returns it to the caller
*
- * @param[in/out] io_nodeInfoContainer, struct to contain all node
+ * @param[in/out] io_nodeContainer, struct to contain all node
* specific information of the type NodeSpecificInfo. May refer to
* structure definition
*
@@ -901,7 +901,7 @@ class TargetService
* nodeContainer.
*
*/
- void _maxTargets(NodeSpecificInfo & io_nodeInfoContainer,
+ void _maxTargets(NodeSpecificInfo & io_nodeContainer,
AttrRP *i_attrRP = NULL);
@@ -971,7 +971,7 @@ class TargetService
bool iv_initialized; ///< Is service initialized or not
Target * iv_pSys; // Top Level Target
- NodeInfo_t iv_nodeInfo;
+ NodeData_t iv_nodeData;
// Disable copy constructor / assignment operator
diff --git a/src/usr/targeting/common/iterators/targetiterator.C b/src/usr/targeting/common/iterators/targetiterator.C
index 34daa0887..9da1c415a 100644
--- a/src/usr/targeting/common/iterators/targetiterator.C
+++ b/src/usr/targeting/common/iterators/targetiterator.C
@@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* COPYRIGHT International Business Machines Corp. 2011,2014 */
+/* Contributors Listed Below - COPYRIGHT 2011,2018 */
+/* [+] International Business Machines Corp. */
+/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
@@ -76,14 +78,14 @@ void _TargetIterator<T>::advance()
// iterator performance path that assumes only one node's worth of data
if(!PLAT::PROPERTIES::MULTINODE_AWARE)
{
- if ( likely( (!l_targetService.iv_nodeInfo.empty()) )
- && likely( (l_targetService.iv_nodeInfo[0].maxTargets > 0) ) )
+ if ( likely( (!l_targetService.iv_nodeData.empty()) )
+ && likely( (l_targetService.iv_nodeData[0].maxTargets > 0) ) )
{
// If at or past last element, advance to end() else advance
if(unlikely (
iv_pCurrent >=
- &(*(l_targetService.iv_nodeInfo[0]).targets)
- [l_targetService.iv_nodeInfo[0].maxTargets-1]
+ &(*(l_targetService.iv_nodeData[0]).targets)
+ [l_targetService.iv_nodeData[0].maxTargets-1]
))
{
iv_pCurrent = NULL;
diff --git a/src/usr/targeting/common/targetservice.C b/src/usr/targeting/common/targetservice.C
index c6de5a1dd..fec17026c 100644
--- a/src/usr/targeting/common/targetservice.C
+++ b/src/usr/targeting/common/targetservice.C
@@ -72,9 +72,9 @@ namespace TARGETING
#define TARG_CLASS "targetService"
// It is defined here to limit the scope
-#define MAX_NODE_ID iv_nodeInfo.size()
+#define MAX_NODE_ID iv_nodeData.size()
-#define MAX_ENABLED_NODE_ID iv_nodeInfo.size()
+#define MAX_ENABLED_NODE_ID iv_nodeData.size()
//******************************************************************************
// targetService
@@ -159,8 +159,8 @@ void TargetService::init(const size_t i_maxNodes)
for(uint8_t l_nodeCnt=0; l_nodeCnt<i_maxNodes; l_nodeCnt++)
{
- NodeSpecificInfo l_nodeInfo;
- l_nodeInfo.nodeId = static_cast<NODE_ID>(l_nodeCnt);
+ NodeSpecificInfo l_nodeData;
+ l_nodeData.nodeId = static_cast<NODE_ID>(l_nodeCnt);
// Cache location of RO section containing all the attribute
// metadata
@@ -182,21 +182,21 @@ void TargetService::init(const size_t i_maxNodes)
"expected 0x%08X but got 0x%08X",
PNOR_TARG_EYE_CATCHER,l_pHdr->eyeCatcher);
- l_nodeInfo.pPnor = reinterpret_cast<uint32_t*>(
+ l_nodeData.pPnor = reinterpret_cast<uint32_t*>(
(reinterpret_cast<char*>(l_pHdr) + l_pHdr->headerSize));
- (void)_configureTargetPool(l_nodeInfo);
+ (void)_configureTargetPool(l_nodeData);
- l_nodeInfo.initialized = true;
+ l_nodeData.initialized = true;
}
- Target* l_pFirstTarget = &(*(l_nodeInfo.targets))[0];
+ Target* l_pFirstTarget = &(*(l_nodeData.targets))[0];
TARG_INF("TargetService::init: Pushing info for node %d with first "
"target huid 0x%.8x and %d total targets",
- l_nodeInfo.nodeId,
+ l_nodeData.nodeId,
get_huid(l_pFirstTarget),
- l_nodeInfo.maxTargets);
- iv_nodeInfo.push_back(l_nodeInfo);
+ l_nodeData.maxTargets);
+ iv_nodeData.push_back(l_nodeData);
}
bool masterNodeCapable = false;
@@ -250,15 +250,15 @@ void TargetService::_getFirstTargetForIterators(Target*& o_firstTargetPtr) const
{
/* This will come inside for initialized node only.. Just for safety we
* are checking for maxTargets & whether it is initialized or not */
- if((iv_nodeInfo[l_nodeCnt].initialized == true) &&
- (iv_nodeInfo[l_nodeCnt].maxTargets > 0))
+ if((iv_nodeData[l_nodeCnt].initialized == true) &&
+ (iv_nodeData[l_nodeCnt].maxTargets > 0))
{
/* Assumption -
* Here we are assuming that the first target of any binary is not
* the system target, to make sure this ithe binary compiler needs
* to compile the binary in this specific order.
*/
- o_firstTargetPtr = &(*(iv_nodeInfo[l_nodeCnt].targets))[0];
+ o_firstTargetPtr = &(*(iv_nodeData[l_nodeCnt].targets))[0];
TARG_ASSERT(o_firstTargetPtr != NULL, TARG_ERR_LOC
"FATAL: Could not find any targets");
@@ -283,15 +283,15 @@ void TargetService::_getFirstTargetForIterators(Target*& o_firstTargetPtr,
/* This will come inside for initialized node only.. Just for safety we
* are checking for maxTargets & whether it is initialized or not */
if( (i_nodeId < MAX_NODE_ID) &&
- (iv_nodeInfo[i_nodeId].initialized == true) &&
- (iv_nodeInfo[i_nodeId].maxTargets > 0))
+ (iv_nodeData[i_nodeId].initialized == true) &&
+ (iv_nodeData[i_nodeId].maxTargets > 0))
{
/* Assumption -
* Here we are assuming that the first target of any binary is not
* the system target, to make sure this ithe binary compiler needs
* to compile the binary in this specific order.
*/
- o_firstTargetPtr = &(*(iv_nodeInfo[i_nodeId].targets))[0];
+ o_firstTargetPtr = &(*(iv_nodeData[i_nodeId].targets))[0];
TARG_ASSERT(o_firstTargetPtr != NULL, TARG_ERR_LOC
"FATAL: Could not find any targets");
@@ -481,8 +481,8 @@ uint8_t TargetService::getNextInitializedNode(const NODE_ID i_node) const
{
for(l_nodeCnt=(i_node +1); l_nodeCnt<MAX_NODE_ID; ++l_nodeCnt)
{
- if((iv_nodeInfo[l_nodeCnt].initialized) &&
- (iv_nodeInfo[l_nodeCnt].maxTargets > 0))
+ if((iv_nodeData[l_nodeCnt].initialized) &&
+ (iv_nodeData[l_nodeCnt].maxTargets > 0))
{
l_foundNode = true;
break;
@@ -511,13 +511,13 @@ Target* TargetService::getNextTarget(const Target* i_pTarget) const
{
for(uint8_t i_node=0; i_node<MAX_NODE_ID; ++i_node)
{
- if((iv_nodeInfo[i_node].initialized) &&
- (iv_nodeInfo[i_node].maxTargets > 0) &&
- ((l_pTarget >= &(*(iv_nodeInfo[i_node]).targets)[0]) &&
- (l_pTarget <= &(*(iv_nodeInfo[i_node]).targets)[
- iv_nodeInfo[i_node].maxTargets - 1])))
+ if((iv_nodeData[i_node].initialized) &&
+ (iv_nodeData[i_node].maxTargets > 0) &&
+ ((l_pTarget >= &(*(iv_nodeData[i_node]).targets)[0]) &&
+ (l_pTarget <= &(*(iv_nodeData[i_node]).targets)[
+ iv_nodeData[i_node].maxTargets - 1])))
{
- if( l_pTarget == &(*(iv_nodeInfo[i_node]).targets)[iv_nodeInfo[
+ if( l_pTarget == &(*(iv_nodeData[i_node]).targets)[iv_nodeData[
i_node].maxTargets - 1] )
{
// Go for next node
@@ -525,7 +525,7 @@ Target* TargetService::getNextTarget(const Target* i_pTarget) const
static_cast<NODE_ID>(i_node));
if(l_nextNode != MAX_NODE_ID)
{
- l_pTarget = &(*(iv_nodeInfo[l_nextNode].targets))[0];
+ l_pTarget = &(*(iv_nodeData[l_nextNode].targets))[0];
l_targetFound = true;
break;
}
@@ -1154,7 +1154,7 @@ void TargetService::readSectionData(
//******************************************************************************
void TargetService::_configureTargetPool(
- NodeSpecificInfo& i_nodeInfoContainer,
+ NodeSpecificInfo& i_nodeContainer,
AttrRP *i_attrRP)
{
#define TARG_FN "_configureTargetPool(...)"
@@ -1164,21 +1164,21 @@ void TargetService::_configureTargetPool(
AttrRP *l_attrRP = (i_attrRP == NULL)
? &TARG_GET_SINGLETON(TARGETING::theAttrRP) : i_attrRP;
- _maxTargets(i_nodeInfoContainer);
+ _maxTargets(i_nodeContainer);
// iv_pPnor--> points to uint32_t* --> points to --> uint32_t, targets[]
// (uint32_t*)+1 --> points to ------------> targets[]
const AbstractPointer<uint32_t>* ppNumTargets
= static_cast<const AbstractPointer<uint32_t>*>(
- i_nodeInfoContainer.pPnor);
+ i_nodeContainer.pPnor);
- i_nodeInfoContainer.targets =
+ i_nodeContainer.targets =
reinterpret_cast< Target(*)[] > (
(TARG_TO_PLAT_PTR_AND_INC(*ppNumTargets,1)));
- TARG_ASSERT(i_nodeInfoContainer.targets, TARG_ERR_LOC
+ TARG_ASSERT(i_nodeContainer.targets, TARG_ERR_LOC
"FATAL: Could not determine location of targets");
- TARG_INF("i_nodeInfoContainer.targets = %p", i_nodeInfoContainer.targets);
+ TARG_INF("i_nodeContainer.targets = %p", i_nodeContainer.targets);
// Only translate addresses on platforms where addresses are 4 bytes wide
// (FSP). The compiler should perform dead code elimination of this path on
@@ -1186,14 +1186,14 @@ void TargetService::_configureTargetPool(
// can be statically computed at compile time.
if(TARG_ADDR_TRANSLATION_REQUIRED)
{
- i_nodeInfoContainer.targets = static_cast<Target(*)[]>(
+ i_nodeContainer.targets = static_cast<Target(*)[]>(
l_attrRP->translateAddr(
- i_nodeInfoContainer.targets, i_nodeInfoContainer.nodeId));
- TARG_ASSERT(i_nodeInfoContainer.targets, TARG_ERR_LOC
+ i_nodeContainer.targets, i_nodeContainer.nodeId));
+ TARG_ASSERT(i_nodeContainer.targets, TARG_ERR_LOC
"FATAL: Could not determine location of targets after "
"address translation");
- TARG_INF("i_nodeInfoContainer.targets after translation = %p",
- i_nodeInfoContainer.targets);
+ TARG_INF("i_nodeContainer.targets after translation = %p",
+ i_nodeContainer.targets);
}
TARG_EXIT();
@@ -1205,7 +1205,7 @@ void TargetService::_configureTargetPool(
// TargetService::_maxTargets
//******************************************************************************
-void TargetService::_maxTargets(NodeSpecificInfo& io_nodeInfoContainer,
+void TargetService::_maxTargets(NodeSpecificInfo& io_nodeContainer,
AttrRP *i_attrRP)
{
#define TARG_FN "_maxTargets(...)"
@@ -1217,7 +1217,7 @@ void TargetService::_maxTargets(NodeSpecificInfo& io_nodeInfoContainer,
// pointer.
const AbstractPointer<uint32_t>* pNumTargetsPtr
= static_cast<const AbstractPointer<uint32_t>*>(
- io_nodeInfoContainer.pPnor);
+ io_nodeContainer.pPnor);
uint32_t* pNumTargets = TARG_TO_PLAT_PTR(*pNumTargetsPtr);
// Only translate addresses on platforms where addresses are 4 bytes wide
@@ -1228,16 +1228,16 @@ void TargetService::_maxTargets(NodeSpecificInfo& io_nodeInfoContainer,
{
pNumTargets =
static_cast<uint32_t*>(l_attrRP->translateAddr(
- pNumTargets, io_nodeInfoContainer.nodeId));
+ pNumTargets, io_nodeContainer.nodeId));
}
TARG_ASSERT(pNumTargets, TARG_ERR_LOC
"FATAL: Could not determine location of targets after "
"address translation");
- io_nodeInfoContainer.maxTargets = *pNumTargets;
+ io_nodeContainer.maxTargets = *pNumTargets;
- TARG_INF("Max targets = %d", io_nodeInfoContainer.maxTargets);
+ TARG_INF("Max targets = %d", io_nodeContainer.maxTargets);
#undef TARG_FN
}
@@ -1348,20 +1348,20 @@ void TargetService::initDefaultMasterNode()
// over.
for(uint8_t l_nodeCnt=0; l_nodeCnt<MAX_NODE_ID; ++l_nodeCnt)
{
- if((iv_nodeInfo[l_nodeCnt].initialized) &&
- (iv_nodeInfo[l_nodeCnt].maxTargets > 0))
+ if((iv_nodeData[l_nodeCnt].initialized) &&
+ (iv_nodeData[l_nodeCnt].maxTargets > 0))
{
for(uint32_t l_targetCnt=0;
- l_targetCnt<iv_nodeInfo[l_nodeCnt].maxTargets;
+ l_targetCnt<iv_nodeData[l_nodeCnt].maxTargets;
++l_targetCnt)
{
- if(((*(iv_nodeInfo[l_nodeCnt].targets))[
+ if(((*(iv_nodeData[l_nodeCnt].targets))[
l_targetCnt].getAttr<ATTR_CLASS>() == CLASS_ENC) &&
- ((*(iv_nodeInfo[l_nodeCnt].targets))[
+ ((*(iv_nodeData[l_nodeCnt].targets))[
l_targetCnt].getAttr<ATTR_TYPE>() == TYPE_NODE))
{
if(UTIL::isThisMasterNodeTarget(
- &((*(iv_nodeInfo[l_nodeCnt].targets))[l_targetCnt])))
+ &((*(iv_nodeData[l_nodeCnt].targets))[l_targetCnt])))
{
// We have found a previous instance of master node
// target, no need for sync here, since it would
@@ -1385,25 +1385,25 @@ void TargetService::initDefaultMasterNode()
TARG_INF("No previous master node found.. Setting a default one");
for(uint8_t l_nodeCnt=0; l_nodeCnt<MAX_NODE_ID; ++l_nodeCnt)
{
- if((iv_nodeInfo[l_nodeCnt].initialized) &&
- (iv_nodeInfo[l_nodeCnt].maxTargets > 0))
+ if((iv_nodeData[l_nodeCnt].initialized) &&
+ (iv_nodeData[l_nodeCnt].maxTargets > 0))
{
// Need to go over each target to search for Node, cannot
// use rangefilter here since targeting is yet not
// initialized.
for(uint32_t l_targetCnt=0;
- l_targetCnt<iv_nodeInfo[l_nodeCnt].maxTargets;
+ l_targetCnt<iv_nodeData[l_nodeCnt].maxTargets;
++l_targetCnt)
{
- if(((*(iv_nodeInfo[l_nodeCnt].targets))[
+ if(((*(iv_nodeData[l_nodeCnt].targets))[
l_targetCnt].getAttr<ATTR_CLASS>() == CLASS_ENC) &&
- ((*(iv_nodeInfo[l_nodeCnt].targets))[
+ ((*(iv_nodeData[l_nodeCnt].targets))[
l_targetCnt].getAttr<ATTR_TYPE>() == TYPE_NODE))
{
// Just do bare minimum stuff i.e. just set the
// Master Node Attribute
pError = UTIL::setDefaultMasterNodeWithoutSync(
- &((*(iv_nodeInfo[l_nodeCnt].targets))[
+ &((*(iv_nodeData[l_nodeCnt].targets))[
l_targetCnt]));
if(pError)
{
OpenPOWER on IntegriCloud