diff options
author | Stephen Cprek <smcprek@us.ibm.com> | 2017-03-23 17:04:01 -0500 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2017-04-06 11:49:50 -0400 |
commit | a37daa7eab139979f822e8af1b1509245a095377 (patch) | |
tree | d4fe9cc6885e619a05dce7ddc9401ed76c407518 /src/usr/pnor | |
parent | 2d98932ebfff3cbf8dbe63252dcb22c32acfe85b (diff) | |
download | talos-hostboot-a37daa7eab139979f822e8af1b1509245a095377.tar.gz talos-hostboot-a37daa7eab139979f822e8af1b1509245a095377.zip |
Switch bootloader assert to do a bl_terminate
Also provide options to provide a bootloader trace byte or return code
Change-Id: Id1ae0fdd349258aa16f43dd25b787b005d8661d6
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/38389
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Martin Gloff <mgloff@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Reviewed-by: Michael Baiocchi <mbaiocch@us.ibm.com>
Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/pnor')
-rw-r--r-- | src/usr/pnor/pnor_utils.C | 49 |
1 files changed, 12 insertions, 37 deletions
diff --git a/src/usr/pnor/pnor_utils.C b/src/usr/pnor/pnor_utils.C index d6e1ffad0..fc68fef6f 100644 --- a/src/usr/pnor/pnor_utils.C +++ b/src/usr/pnor/pnor_utils.C @@ -426,55 +426,30 @@ const char * PNOR::SectionIdToString( uint32_t i_secIdIndex ) static_assert (numEntries == (PNOR::NUM_SECTIONS), "Mismatch between number of SectionIds and correlating strings"); - // Bootloader does not support asserts + // Assert if accessing index out of array. + assert(i_secIdIndex < (PNOR::NUM_SECTIONS), #ifdef BOOTLOADER - if(i_secIdIndex >= (PNOR::NUM_SECTIONS)) - { - PNOR_UTIL_TRACE(BTLDR_TRC_UTILS_PNOR_SECID_OUT_OF_RANGE); - /*@ - * @errortype - * @moduleid Bootloader::MOD_BOOTLOADER_PNOR_SECID_TO_STR - * @reasoncode Bootloader::RC_PNOR_SECID_OUT_OF_RANGE - * @userdata1 Section ID requested - * @userdata2 Max index of Section id to string array - * @devdesc No String associated with PNOR section ID - * @custdesc A problem occurred while running processor - * boot code. - */ - bl_terminate(Bootloader::MOD_BOOTLOADER_PNOR_SECID_TO_STR, - Bootloader::RC_PNOR_SECID_OUT_OF_RANGE, - i_secIdIndex, - numEntries); - } + BTLDR_TRC_UTILS_PNOR_SECID_OUT_OF_RANGE, + Bootloader::RC_PNOR_SECID_OUT_OF_RANGE #else - // Assert if accessing index out of array. - assert(i_secIdIndex < (PNOR::NUM_SECTIONS), "SectionIdToString PNOR section id out of range"); + "SectionIdToString PNOR section id out of range" #endif + ); return SectionIdToStringArr[i_secIdIndex]; } bool PNOR::cmpSecurebootMagicNumber(const uint8_t* i_vaddr) { - // Bootloader does not support asserts + // Assert if accessing index out of array. + assert(i_vaddr != nullptr, #ifdef BOOTLOADER - if(i_vaddr == nullptr) - { - PNOR_UTIL_TRACE(BTLDR_TRC_UTILS_CMP_MAGIC_NUM_NULLPTR); - /*@ - * @errortype - * @moduleid Bootloader::MOD_BOOTLOADER_PNOR_CMP_MAGIC_NUM - * @reasoncode Bootloader::RC_PNOR_NULLPTR - * @devdesc Requested address to compare is a nullptr - * @custdesc A problem occurred while running processor - * boot code. - */ - bl_terminate(Bootloader::MOD_BOOTLOADER_PNOR_CMP_MAGIC_NUM, - Bootloader::RC_PNOR_NULLPTR); - } + BTLDR_TRC_UTILS_CMP_MAGIC_NUM_NULLPTR, + Bootloader::RC_PNOR_NULLPTR #else - assert(i_vaddr != nullptr, "cmpSecurebootMagicNumber requested address to compare is a nullptr "); + "cmpSecurebootMagicNumber requested address to compare is a nullptr" #endif + ); return memcmp(&ROM_MAGIC_NUMBER, i_vaddr, sizeof(ROM_MAGIC_NUMBER))==0; } |