summaryrefslogtreecommitdiffstats
path: root/src/import/chips/p9
diff options
context:
space:
mode:
authorJoe McGill <jmcgill@us.ibm.com>2016-04-05 21:22:33 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2016-05-04 13:58:29 -0400
commit80f89b80ed4779e562ad9ed5fb07836ae0e01dad (patch)
tree1e353ac866deb48dff7fabda9f4c4f877bd8831b /src/import/chips/p9
parentba94835f46dc0725f68425b1e5013f0267412574 (diff)
downloadtalos-hostboot-80f89b80ed4779e562ad9ed5fb07836ae0e01dad.tar.gz
talos-hostboot-80f89b80ed4779e562ad9ed5fb07836ae0e01dad.zip
p9_mss_setup_bars L2 -- use vector in place of map
Use vector in place of map to workaround ECMD 14.2 segfault Change-Id: I8094022f488bc9bf818de5cece8eb9e10379c495 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/22925 Tested-by: Jenkins Server Tested-by: Hostboot CI Reviewed-by: CHRISTINA L. GRAVES <clgraves@us.ibm.com> Reviewed-by: Thi N. Tran <thi@us.ibm.com> Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/22949 Tested-by: FSP CI Jenkins Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/import/chips/p9')
-rw-r--r--src/import/chips/p9/procedures/hwp/nest/p9_mss_setup_bars.C29
1 files changed, 11 insertions, 18 deletions
diff --git a/src/import/chips/p9/procedures/hwp/nest/p9_mss_setup_bars.C b/src/import/chips/p9/procedures/hwp/nest/p9_mss_setup_bars.C
index 60bbb8a88..9e310682f 100644
--- a/src/import/chips/p9/procedures/hwp/nest/p9_mss_setup_bars.C
+++ b/src/import/chips/p9/procedures/hwp/nest/p9_mss_setup_bars.C
@@ -710,25 +710,22 @@ template<fapi2::TargetType T>
fapi2::ReturnCode buildMCBarData(
const std::vector< fapi2::Target<T> >& i_mcTargets,
const uint32_t i_groupData[DATA_GROUPS][DATA_ELEMENTS],
- std::map<fapi2::Target<T>, mcsBarData_t>& o_mcBarDataPair);
+ std::vector<std::pair<fapi2::Target<T>, mcsBarData_t>>& o_mcBarDataPair);
template<> // TARGET_TYPE_MCS
fapi2::ReturnCode buildMCBarData(
const std::vector< fapi2::Target<fapi2::TARGET_TYPE_MCS> >& i_mcTargets,
const uint32_t i_groupData[DATA_GROUPS][DATA_ELEMENTS],
- std::map<fapi2::Target<fapi2::TARGET_TYPE_MCS>, mcsBarData_t>& o_mcBarDataPair)
+ std::vector<std::pair<fapi2::Target<fapi2::TARGET_TYPE_MCS>, mcsBarData_t>>& o_mcBarDataPair)
{
FAPI_DBG("Entering");
fapi2::ReturnCode l_rc;
- mcsPortGroupInfo_t l_portInfo[MAX_MC_PORTS_PER_MCS];
- mcsBarData_t l_mcsBarData;
char l_targetStr[fapi2::MAX_ECMD_STRING_LEN];
for (auto l_mcs : i_mcTargets)
{
-
- // Initialize
- memset(&l_mcsBarData, 0, sizeof(l_mcsBarData));
+ mcsBarData_t l_mcsBarData;
+ mcsPortGroupInfo_t l_portInfo[MAX_MC_PORTS_PER_MCS];
// Get this MCS unit position
uint8_t l_unitPos = 0;
@@ -739,9 +736,6 @@ fapi2::ReturnCode buildMCBarData(
fapi2::toString(l_mcs, l_targetStr, sizeof(l_targetStr));
FAPI_INF("Build BAR data for MCS target: %s, UnitPos %u ", l_targetStr, l_unitPos);
- // ---- Fill in group info for each port in this MCS ----
- memset(l_portInfo, 0, sizeof(l_portInfo));
-
// Loop thru non-mirror groups (0-7)
for (uint8_t l_group = 0; l_group < (DATA_GROUPS / 2); l_group++)
{
@@ -802,8 +796,7 @@ fapi2::ReturnCode buildMCBarData(
displayMCBarData(l_mcs, l_mcsBarData);
// Add to output pair
- o_mcBarDataPair.insert(std::pair<fapi2::Target<fapi2::TARGET_TYPE_MCS>, mcsBarData_t>
- (l_mcs, l_mcsBarData));
+ o_mcBarDataPair.push_back(std::make_pair(l_mcs, l_mcsBarData));
}
else
{
@@ -822,7 +815,7 @@ template<> // TARGET_TYPE_MI
fapi2::ReturnCode buildMCBarData(
const std::vector< fapi2::Target<fapi2::TARGET_TYPE_MI> >& i_mcTargets,
const uint32_t i_groupData[DATA_GROUPS][DATA_ELEMENTS],
- std::map<fapi2::Target<fapi2::TARGET_TYPE_MI>, mcsBarData_t>& o_mcBarDataPair)
+ std::vector<std::pair<fapi2::Target<fapi2::TARGET_TYPE_MI>, mcsBarData_t>>& o_mcBarDataPair)
{
FAPI_DBG("Entering");
fapi2::ReturnCode l_rc;
@@ -843,11 +836,11 @@ fapi2::ReturnCode buildMCBarData(
///
template<fapi2::TargetType T>
fapi2::ReturnCode writeMCBarData(
- const std::map<fapi2::Target<T>, mcsBarData_t> i_mcBarDataPair);
+ const std::vector<std::pair<fapi2::Target<T>, mcsBarData_t>>& i_mcBarDataPair);
template<> // TARGET_TYPE_MCS
fapi2::ReturnCode writeMCBarData(
- const std::map<fapi2::Target<fapi2::TARGET_TYPE_MCS>, mcsBarData_t> i_mcBarDataPair)
+ const std::vector<std::pair<fapi2::Target<fapi2::TARGET_TYPE_MCS>, mcsBarData_t>>& i_mcBarDataPair)
{
FAPI_DBG("Entering");
fapi2::ReturnCode l_rc;
@@ -1021,7 +1014,7 @@ fapi_try_exit:
template<> // TARGET_TYPE_MI
fapi2::ReturnCode writeMCBarData(
- const std::map<fapi2::Target<fapi2::TARGET_TYPE_MI>, mcsBarData_t> i_mcBarDataPair)
+ const std::vector<std::pair<fapi2::Target<fapi2::TARGET_TYPE_MI>, mcsBarData_t>>& i_mcBarDataPair)
{
FAPI_DBG("Entering");
fapi2::ReturnCode l_rc;
@@ -1047,9 +1040,9 @@ fapi2::ReturnCode p9_mss_setup_bars(
// Stores data read from ATTR_MSS_MCS_GROUP_32
uint32_t l_groupData[DATA_GROUPS][DATA_ELEMENTS];
// std_pair<MCS target, MCS data>
- std::map<fapi2::Target<fapi2::TARGET_TYPE_MCS>, mcsBarData_t> l_mcsBarDataPair;
+ std::vector<std::pair<fapi2::Target<fapi2::TARGET_TYPE_MCS>, mcsBarData_t>> l_mcsBarDataPair;
// std_pair<MI target, MI data>
- std::map<fapi2::Target<fapi2::TARGET_TYPE_MI>, mcsBarData_t> l_miBarDataPair;
+ std::vector<std::pair<fapi2::Target<fapi2::TARGET_TYPE_MI>, mcsBarData_t>> l_miBarDataPair;
// Get functional MCS chiplets, should be none for Cumulus
auto l_mcsChiplets = i_target.getChildren<fapi2::TARGET_TYPE_MCS>();
OpenPOWER on IntegriCloud