diff options
-rw-r--r-- | src/include/usr/runtime/runtime.H | 31 | ||||
-rw-r--r-- | src/usr/dump/dumpCollect.C | 3 | ||||
-rw-r--r-- | src/usr/hwpf/hwp/start_payload/start_payload.C | 2 | ||||
-rw-r--r-- | src/usr/runtime/hdatservice.C | 35 | ||||
-rw-r--r-- | src/usr/runtime/hdatservice.H | 38 |
5 files changed, 61 insertions, 48 deletions
diff --git a/src/include/usr/runtime/runtime.H b/src/include/usr/runtime/runtime.H index d98e1451e..8103b4fb5 100644 --- a/src/include/usr/runtime/runtime.H +++ b/src/include/usr/runtime/runtime.H @@ -64,7 +64,8 @@ errlHndl_t load_host_data( void ); */ enum SectionId { - HSVC_NODE_DATA, //< HostServices Node Attributes + FIRST_SECTION, //< Placeholder for arrays + HSVC_NODE_DATA = FIRST_SECTION, //< HostServices Node Attributes HSVC_SYSTEM_DATA, //< HostServices System Attributes IPLPARMS_SYSTEM, //< IPL Parms MS_DUMP_SRC_TBL, //< MDST: Memory Dump Source Table @@ -74,6 +75,7 @@ enum SectionId SPIRA_H, //< SPIRA-H SPIRA_L, //< Legacy SPIRA NACA, //< NACA + LAST_SECTION = NACA //< Placeholder for arrays }; /** @@ -97,32 +99,23 @@ errlHndl_t get_host_data_section( SectionId i_section, const size_t DATA_SIZE_UNKNOWN = 0xFFFFFFFFFFFFFFFF; /** - * @brief Update the actual count of section. Only supported for - * memory dump results table + * @brief Store the actual count of a section in local memory. * - * @param[in] i_section Chunk of data to find - * @param[out] i_count Actual countPhysical memory address of data + * @param[in] i_section Chunk of data to update + * @param[in] i_count Actual number of entries * - * @return errlHndl_t NULL on success */ -errlHndl_t update_host_data_section_actual( SectionId i_section, - uint16_t i_count ); +void saveActualCount( RUNTIME::SectionId i_id, + uint16_t i_count ); /** - * @brief This function updates the actual count for the MDRT - * May be called at anytime, but the actual value is updated - * to the SPIRA during populate_attributes + * @brief Write the stored actual count to SPIRA * - */ -void update_MDRT_Count(uint16_t i_count); - -/** - * @brief This function writes the stored count for the MDRT - * out to the SPIRA + * @param[in] i_section Chunk of data to update * - * @return errlHndl_t + * @return errlHndl_t NULL on success */ -errlHndl_t write_MDRT_Count(void); +errlHndl_t writeActualCount( RUNTIME::SectionId i_id ); /* * @brief Retrieve and log FFDC data relevant to a given section of diff --git a/src/usr/dump/dumpCollect.C b/src/usr/dump/dumpCollect.C index f0089311c..28cfb60eb 100644 --- a/src/usr/dump/dumpCollect.C +++ b/src/usr/dump/dumpCollect.C @@ -566,7 +566,8 @@ errlHndl_t doDumpCollect(void) } //Update actual count in RUNTIME - RUNTIME::update_MDRT_Count(l_resultCount); + RUNTIME::saveActualCount(RUNTIME::MS_DUMP_RESULTS_TBL, + l_resultCount); }while(0);// end of do-while loop // Got an errorlog back from get_host_data_sections diff --git a/src/usr/hwpf/hwp/start_payload/start_payload.C b/src/usr/hwpf/hwp/start_payload/start_payload.C index c56e59a9e..b913ab62c 100644 --- a/src/usr/hwpf/hwp/start_payload/start_payload.C +++ b/src/usr/hwpf/hwp/start_payload/start_payload.C @@ -299,7 +299,7 @@ void* call_host_runtime_setup( void *io_pArgs ) } //Update the MDRT value (for MS Dump) - l_err = RUNTIME::write_MDRT_Count(); + l_err = RUNTIME::writeActualCount(RUNTIME::MS_DUMP_RESULTS_TBL); if(l_err != NULL) { TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, 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; } |