From d87aceae2d5e5cb66201af5f897b06fa1471d90e Mon Sep 17 00:00:00 2001 From: Stephen Cprek Date: Mon, 20 Mar 2017 13:07:42 -0500 Subject: Add PNOR SectionIdToString to replace direct access to cv_EYECATCHER This catches if the const array size does not match the number of pnor sections and out of range index errors Also it adds genErrlParsing for bootloader files Change-Id: I0a90816a7620022dec16bc7358a68ffbdade0083 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/38159 Reviewed-by: Martin Gloff Tested-by: Jenkins Server Tested-by: FSP CI Jenkins Tested-by: Jenkins OP Build CI Reviewed-by: Michael Baiocchi Reviewed-by: Nicholas E. Bofferding Reviewed-by: William G. Hoffa --- src/usr/pnor/runtime/rt_pnor.C | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/usr/pnor/runtime') diff --git a/src/usr/pnor/runtime/rt_pnor.C b/src/usr/pnor/runtime/rt_pnor.C index dc5adb7f7..484d47e7d 100644 --- a/src/usr/pnor/runtime/rt_pnor.C +++ b/src/usr/pnor/runtime/rt_pnor.C @@ -42,11 +42,6 @@ // Trace definition extern trace_desc_t* g_trac_pnor; -/** - * Eyecatcher strings for PNOR TOC entries - */ -extern const char* cv_EYECATCHER[]; - /** * @brief set up _start() task entry procedure for PNOR daemon */ @@ -214,7 +209,7 @@ errlHndl_t RtPnor::getSectionInfo(PNOR::SectionId i_section, } //return the data in the struct o_info.id = i_section; - o_info.name = cv_EYECATCHER[i_section]; + o_info.name = SectionIdToString(i_section); o_info.vaddr = (uint64_t)l_pWorking; o_info.flashAddr = iv_TOC[i_section].flashAddr; o_info.size = l_sizeBytes; @@ -365,7 +360,7 @@ errlHndl_t RtPnor::readFromDevice (uint64_t i_procId, do { - const char* l_partitionName = cv_EYECATCHER[i_section]; + const char* l_partitionName = SectionIdToString(i_section); void* l_dataToRead = o_data; size_t l_readSize = i_size; size_t l_readSizePlusECC = (i_size * 9)/8; @@ -581,7 +576,7 @@ errlHndl_t RtPnor::writeToDevice( uint64_t i_procId, l_offset = (i_offset * 9)/8; } - const char* l_partitionName = cv_EYECATCHER[i_section]; + const char* l_partitionName = SectionIdToString(i_section); if (g_hostInterfaces && g_hostInterfaces->pnor_write) { //make call into opal to write the data -- cgit v1.2.1