diff options
Diffstat (limited to 'src/include/usr/util')
-rw-r--r-- | src/include/usr/util/impl/threadpool.H | 14 | ||||
-rw-r--r-- | src/include/usr/util/runtime/rt_fwnotify.H | 45 | ||||
-rw-r--r-- | src/include/usr/util/threadpool.H | 20 | ||||
-rw-r--r-- | src/include/usr/util/util_reasoncodes.H | 2 | ||||
-rw-r--r-- | src/include/usr/util/utillidmgr.H | 4 |
5 files changed, 78 insertions, 7 deletions
diff --git a/src/include/usr/util/impl/threadpool.H b/src/include/usr/util/impl/threadpool.H index 84ee9afd7..5ad530057 100644 --- a/src/include/usr/util/impl/threadpool.H +++ b/src/include/usr/util/impl/threadpool.H @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2012,2014 */ +/* Contributors Listed Below - COPYRIGHT 2012,2019 */ +/* [+] International Business Machines Corp. */ +/* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ @@ -38,6 +40,7 @@ #include <algorithm> #include <sys/sync.h> #include <sys/task.h> +#include <errl/errlentry.H> namespace Util { @@ -82,7 +85,11 @@ namespace __Util_ThreadPool_Impl /** Simple constructor, call __init to avoid the in-charge and * not-in-charge construction costs. */ - ThreadPoolImpl() { __init(); }; + ThreadPoolImpl(bool i_checkChildRc = true) : + iv_checkChildRc(i_checkChildRc) + { + __init(); + }; protected: /** Initialize the object. */ @@ -105,7 +112,7 @@ namespace __Util_ThreadPool_Impl */ void __start(start_fn_t fn, void* instance); /** Stop the thread-pool. */ - void __shutdown(); + errlHndl_t __shutdown(); /** Outstanding work-list. */ worklist_t iv_worklist; @@ -119,6 +126,7 @@ namespace __Util_ThreadPool_Impl std::list<tid_t> iv_children; /** State of object. */ bool iv_shutdown; + bool iv_checkChildRc; }; diff --git a/src/include/usr/util/runtime/rt_fwnotify.H b/src/include/usr/util/runtime/rt_fwnotify.H new file mode 100644 index 000000000..1f6bc7efb --- /dev/null +++ b/src/include/usr/util/runtime/rt_fwnotify.H @@ -0,0 +1,45 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/include/usr/util/runtime/rt_fwnotify.H $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2010,2019 */ +/* [+] International Business Machines Corp. */ +/* */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ +#ifndef __RUNTIME_FWNOTIFY_H +#define __RUNTIME_FWNOTIFY_H + +#include <runtime/interface.h> + +/** + * @brief Perform an NVDIMM operation + * @param[in] nvDimmOp - A struct that contains the operation(s) to perform + * and a flag indicating whether to perform operation + * on all processors or a given single processor. + * @Note The operations below are in the order of which they should be + * performed. If a new operation is added, make sure it inserted in the + * correct order. + * The current order is: disarm -> disable encryption -> remove keys -> + * enable encryption -> arm + **/ +int doNvDimmOperation(const hostInterfaces::nvdimm_operation_t& nvDimmOp); + + + +#endif // __RUNTIME_FWNOTIFY_H diff --git a/src/include/usr/util/threadpool.H b/src/include/usr/util/threadpool.H index f96e0b916..43fdeba7a 100644 --- a/src/include/usr/util/threadpool.H +++ b/src/include/usr/util/threadpool.H @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2012,2015 */ +/* Contributors Listed Below - COPYRIGHT 2012,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -58,6 +58,7 @@ #include <stdint.h> #include <util/traits/has_lessthan.H> #include <util/impl/threadpool.H> +#include <errl/errlentry.H> namespace Util { @@ -87,7 +88,10 @@ class ThreadPool : public Util::__Util_ThreadPool_Impl::ThreadPoolImpl { public: /** Basic Constructor. Initialize ThreadPool. */ - ThreadPool() : Util::__Util_ThreadPool_Impl::ThreadPoolImpl() { }; + ThreadPool(bool i_checkChildRc = true) : + Util::__Util_ThreadPool_Impl::ThreadPoolImpl(i_checkChildRc) + { + }; /** Basic Destructor. Ensures pool is properly shut down. */ ~ThreadPool() { shutdown(); }; @@ -98,12 +102,20 @@ class ThreadPool : public Util::__Util_ThreadPool_Impl::ThreadPoolImpl __start(reinterpret_cast<start_fn_t>(&run), this); }; /** @brief Completes outstanding work and destroys worker threads. + * Returns an error log when any child task crashes when + * iv_checkChildRc is set. * * @note This function will block until all work is completed and * worker threads are destroyed. + * + * @return nullptr if all child tasks finished (child status + * checking disabled); + * nullptr if all child tasks finished successfully, or a + * pointer to error log otherwise (child status checking + * enabled). */ - void shutdown() - { __shutdown(); }; + errlHndl_t shutdown() + { return __shutdown(); }; /** @brief Insert a work item onto the thread-pool's queue. * diff --git a/src/include/usr/util/util_reasoncodes.H b/src/include/usr/util/util_reasoncodes.H index 17ea0edfc..1f8146baf 100644 --- a/src/include/usr/util/util_reasoncodes.H +++ b/src/include/usr/util/util_reasoncodes.H @@ -53,6 +53,7 @@ namespace Util UTIL_MOD_GET_OBUS_PLL_BUCKET = 0x14, // UtilCommonAttr::getObusPllBucket UTIL_LIDMGR_CSTOR = 0x15, // UtilLidMgr::UtilLidMgr UTIL_MCL_PROCESS_SINGLE_COMP = 0x16, // UtilLidMgr::processSingleComponent + UTIL_MOD_TP_SHUTDOWN = 0x17, // Util::__Util_ThreadPool_Impl::ThreadPoolImpl::__shutdown }; enum ReasonCode @@ -85,6 +86,7 @@ namespace Util UTIL_ERC_NO_MATCHING_FREQ = UTIL_COMP_ID | 0x1B, UTIL_LIDMGR_INVAL_LID_REQUEST = UTIL_COMP_ID | 0x1C, UTIL_LIDMGR_INVAL_COMP = UTIL_COMP_ID | 0x1D, + UTIL_RC_CHILD_TASK_FAILED = UTIL_COMP_ID | 0x1E, }; }; diff --git a/src/include/usr/util/utillidmgr.H b/src/include/usr/util/utillidmgr.H index e78eba133..bd1c587c0 100644 --- a/src/include/usr/util/utillidmgr.H +++ b/src/include/usr/util/utillidmgr.H @@ -63,6 +63,10 @@ enum LidId TARGETING_BINARY_LIDID = 0x81e00630, NVDIMM_16GB_LIDID = 0x81e00640, NVDIMM_32GB_LIDID = 0x81e00641, + NVDIMM_16GB_BPM_FW_LIDID = 0x81e00642, + NVDIMM_32GB_BPM_FW_LIDID = 0x81e00643, + NVDIMM_16GB_BPM_CONFIG_LIDID = 0x81e00644, + NVDIMM_32GB_BPM_CONFIG_LIDID = 0x81e00645, UCD_LIDID = 0x81e00650, INVALID_LIDID = 0xFFFFFFFF |