diff options
author | Prachi Gupta <pragupta@us.ibm.com> | 2015-02-12 10:38:38 -0600 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2015-02-16 15:13:24 -0600 |
commit | 0b03c03b42b899fbad17c3aa2f0b0b55c21bd60b (patch) | |
tree | 87475a6e0da8cfced8a7b97359624c1b44346dbf /src/usr/util | |
parent | a827e0c3348022cfd8bdae4591f2f98c0641f66d (diff) | |
download | talos-hostboot-0b03c03b42b899fbad17c3aa2f0b0b55c21bd60b.tar.gz talos-hostboot-0b03c03b42b899fbad17c3aa2f0b0b55c21bd60b.zip |
fixed how we loadlid in utillidmgr_rt
Change-Id: I1c1bd2e181a838f62daad21be3f34971b9e409a5
CQ:SW294469
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/15685
Tested-by: Jenkins Server
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Reviewed-by: STEPHEN M. CPREK <smcprek@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/util')
-rw-r--r-- | src/usr/util/runtime/utillidmgr_rt.C | 72 |
1 files changed, 44 insertions, 28 deletions
diff --git a/src/usr/util/runtime/utillidmgr_rt.C b/src/usr/util/runtime/utillidmgr_rt.C index 6c433200e..44f1ce81f 100644 --- a/src/usr/util/runtime/utillidmgr_rt.C +++ b/src/usr/util/runtime/utillidmgr_rt.C @@ -91,21 +91,28 @@ errlHndl_t UtilLidMgr::loadLid() size_t l_size = 0; errlHndl_t l_errl = NULL; - if(iv_isLidInPnor) + do { - iv_lidSize = iv_lidPnorInfo.size; - iv_lidBuffer = reinterpret_cast<char *>(iv_lidPnorInfo.vaddr); - } - else if (iv_isLidInVFS) - { - l_errl = VFS::module_address(iv_lidFileName, l_addr, l_size); - if (l_errl) + if(iv_isLidInVFS) { - delete l_errl; - l_errl = NULL; - int rc = - g_hostInterfaces->lid_load(iv_lidId, &iv_lidBuffer, &iv_lidSize); - + l_errl = VFS::module_address(iv_lidFileName, l_addr, l_size); + if (l_errl) + { + break; + } + iv_lidBuffer = const_cast<void*>(reinterpret_cast<const void*> + (l_addr)); + iv_lidSize = l_size; + } + else if (iv_isLidInPnor) + { + iv_lidSize = iv_lidPnorInfo.size; + iv_lidBuffer = reinterpret_cast<char *>(iv_lidPnorInfo.vaddr); + } + else + { + int rc = g_hostInterfaces->lid_load(iv_lidId, &iv_lidBuffer, + &iv_lidSize); if (0 != rc) { /*@ @@ -121,30 +128,39 @@ errlHndl_t UtilLidMgr::loadLid() Util::UTIL_LIDMGR_RC_FAIL, rc); } - } - - else - { - iv_isLidInVFS = true; - iv_lidBuffer = const_cast<void*>(reinterpret_cast<const void*> - (l_addr)); - iv_lidSize = l_size; - } - } + } + } while (0); return l_errl; } errlHndl_t UtilLidMgr::cleanup() { - if ((iv_isLidInVFS) && (NULL != iv_lidBuffer)) + errlHndl_t l_err = NULL; + if ((!iv_isLidInVFS) && (!iv_isLidInPnor) && (NULL != iv_lidBuffer)) { - g_hostInterfaces->lid_unload(iv_lidBuffer); + int l_rc = g_hostInterfaces->lid_unload(iv_lidBuffer); + if (l_rc) + { + /*@ + * @errortype ERRL_SEV_INFORMATIONAL + * @moduleid Util::UTIL_LIDMGR_RT + * @reasoncode Util::UTIL_LIDMGR_UNLOAD_RC_FAIL + * @userdata1 Return code from lid_unload call. + * @devdesc Unable to unload LID via host interface. + */ + l_err = new ERRORLOG::ErrlEntry( + ERRORLOG::ERRL_SEV_INFORMATIONAL, + Util::UTIL_LIDMGR_RT, + Util::UTIL_LIDMGR_UNLOAD_RC_FAIL, + l_rc); + } } - iv_lidBuffer = NULL; - iv_lidSize = 0; + iv_lidBuffer = NULL; + iv_lidSize = 0; iv_isLidInPnor = false; - return NULL; + iv_isLidInVFS = false; + return l_err; } void UtilLidMgr::updateLid(uint32_t i_lidId) |