summaryrefslogtreecommitdiffstats
path: root/src/usr/runtime
diff options
context:
space:
mode:
authorDan Crowell <dcrowell@us.ibm.com>2013-11-19 15:01:57 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2013-12-03 13:46:55 -0600
commit73f53442ca13fdfef1225fa0e761e066c3623454 (patch)
treef871b9b9349485375571c8be7cb7afbad4258c1a /src/usr/runtime
parent80a4cd4e48d52cac3dc3a8a93bc4c243aec8777c (diff)
downloadtalos-hostboot-73f53442ca13fdfef1225fa0e761e066c3623454.tar.gz
talos-hostboot-73f53442ca13fdfef1225fa0e761e066c3623454.zip
Return actual size of MDRT in message to DUMP
Change-Id: I813b9853e765f91c777e265600d08be44c9aad52 CQ: SW235398 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/7339 Tested-by: Jenkins Server Reviewed-by: Michael Baiocchi <baiocchi@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/runtime')
-rw-r--r--src/usr/runtime/hdatservice.C35
-rw-r--r--src/usr/runtime/hdatservice.H38
2 files changed, 46 insertions, 27 deletions
diff --git a/src/usr/runtime/hdatservice.C b/src/usr/runtime/hdatservice.C
index 63a6b977a..9d9366e32 100644
--- a/src/usr/runtime/hdatservice.C
+++ b/src/usr/runtime/hdatservice.C
@@ -315,8 +315,13 @@ hdatService::hdatService(void)
:iv_spiraL(NULL)
,iv_spiraH(NULL)
,iv_spiraS(NULL)
-,iv_mdrtCnt(0)
{
+ for( RUNTIME::SectionId id = RUNTIME::FIRST_SECTION;
+ id <= RUNTIME::LAST_SECTION;
+ id = (RUNTIME::SectionId)(id+1) )
+ {
+ iv_actuals[id] = ACTUAL_NOT_SET;
+ }
}
hdatService::~hdatService(void)
@@ -563,6 +568,9 @@ errlHndl_t hdatService::getHostDataSection( SectionId i_section,
break;
}
+ //Store record size for later
+ size_t record_size = 0;
+
TARGETING::Target * sys = NULL;
TARGETING::targetService().getTopLevelTarget( sys );
assert(sys != NULL);
@@ -895,6 +903,7 @@ errlHndl_t hdatService::getHostDataSection( SectionId i_section,
//Note - there is no header for the MDST
o_dataSize = tuple->hdatActualCnt * tuple->hdatActualSize;
+ record_size = tuple->hdatActualSize;
errhdl = getSpiraTupleVA(tuple, o_dataAddr);
if( errhdl ) { break; }
}
@@ -922,6 +931,7 @@ errlHndl_t hdatService::getHostDataSection( SectionId i_section,
//Note - there is no header for the MDDT
o_dataSize = tuple->hdatActualCnt * tuple->hdatActualSize;
+ record_size = tuple->hdatActualSize;
errhdl = getSpiraTupleVA(tuple, o_dataAddr);
if( errhdl ) { break; }
}
@@ -950,6 +960,7 @@ errlHndl_t hdatService::getHostDataSection( SectionId i_section,
//Note - there is no header for the MDRT
//return the total allocated size since it is empty at first
o_dataSize = tuple->hdatAllocSize * tuple->hdatAllocCnt;
+ record_size = tuple->hdatAllocSize;
errhdl = getSpiraTupleVA(tuple, o_dataAddr);
if( errhdl ) { break; }
@@ -981,6 +992,12 @@ errlHndl_t hdatService::getHostDataSection( SectionId i_section,
o_dataSize );
if( errhdl ) { break; }
+ // Override the data size value if we've got a stored actual
+ if( iv_actuals[i_section] != ACTUAL_NOT_SET )
+ {
+ TRACFCOMP( g_trac_runtime, "getHostDataSection> Data size overridden from %d->%d", o_dataSize, iv_actuals[i_section] );
+ o_dataSize = iv_actuals[i_section] * record_size;
+ }
} while(0);
TRACFCOMP( g_trac_runtime, "getHostDataSection> o_dataAddr=0x%X, o_dataSize=%d", o_dataAddr, o_dataSize );
@@ -1415,21 +1432,15 @@ errlHndl_t get_host_data_section( SectionId i_section,
getHostDataSection(i_section,i_instance, o_dataAddr, o_dataSize);
}
-errlHndl_t update_host_data_section_actual( SectionId i_section,
- uint16_t i_count )
-{
- return Singleton<hdatService>::instance().
- updateHostDataSectionActual(i_section,i_count);
-}
-
-void update_MDRT_Count(uint16_t i_count )
+void saveActualCount( RUNTIME::SectionId i_id,
+ uint16_t i_count )
{
- Singleton<hdatService>::instance().updateMdrtCount(i_count);
+ Singleton<hdatService>::instance().saveActualCount(i_id,i_count);
}
-errlHndl_t write_MDRT_Count( void )
+errlHndl_t writeActualCount( RUNTIME::SectionId i_id )
{
- return Singleton<hdatService>::instance().writeMdrtCount();
+ return Singleton<hdatService>::instance().writeActualCount(i_id);
}
/**
diff --git a/src/usr/runtime/hdatservice.H b/src/usr/runtime/hdatservice.H
index 4743f0da1..78bd55fff 100644
--- a/src/usr/runtime/hdatservice.H
+++ b/src/usr/runtime/hdatservice.H
@@ -244,38 +244,46 @@ namespace RUNTIME
hdatSpira_t* iv_spiraS;
/**
- * Count of number of MDRT entries present
- * on MPIPL/Dump. A value of 0 implies it
- * doesn't need to be written
+ * Save the actual count value for sections
+ * -Used to keep track of things across HDAT writes
+ * from FSP
*/
- uint16_t iv_mdrtCnt;
+ uint16_t iv_actuals[RUNTIME::LAST_SECTION+1];
- public:
/**
- * @brief Update the actual count of MDRT. Called by dump
- * and needs to be saved away till populate_attributes. Can't
- * be directly written by dump since FSP will load new value over
+ * Dummy value for unassigned actual
+ */
+ enum {
+ ACTUAL_NOT_SET = 0xFFFF
+ };
+ public:
+ /**
+ * @brief Store the actual count of a section.
+ *
+ * @param[in] i_section Chunk of data to update
* @param[in] i_count Actual count for MDRT entries
*
*/
- void updateMdrtCount( uint16_t i_count )
+ void saveActualCount( RUNTIME::SectionId i_id,
+ uint16_t i_count )
{
- iv_mdrtCnt = i_count;
+ iv_actuals[i_id] = i_count;
}
/**
- * @brief Write the MDRT stored value to SPIRA
+ * @brief Write the stored actual count to SPIRA
+ *
+ * @param[in] i_section Chunk of data to update
*
* @return errlHndl_t NULL on success
*/
- errlHndl_t writeMdrtCount( void )
+ errlHndl_t writeActualCount( RUNTIME::SectionId i_id )
{
errlHndl_t l_err = NULL;
- if(iv_mdrtCnt)
+ if(iv_actuals[i_id] != ACTUAL_NOT_SET)
{
- l_err = updateHostDataSectionActual(
- MS_DUMP_RESULTS_TBL,iv_mdrtCnt);
+ l_err = updateHostDataSectionActual( i_id, iv_actuals[i_id] );
}
return l_err;
}
OpenPOWER on IntegriCloud