diff options
author | Brian Horton <brianh@linux.ibm.com> | 2012-06-26 16:30:33 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2012-08-13 12:25:09 -0500 |
commit | 11c8a7dc6e0ec3c31f081d1e30a04a6e7038f918 (patch) | |
tree | c1e8babefc8a5447d606a4d13a43f914c50bce95 /src/include/usr/errl | |
parent | 99f217daf307b3cd963bcbce8eb7b025d58f734e (diff) | |
download | talos-hostboot-11c8a7dc6e0ec3c31f081d1e30a04a6e7038f918.tar.gz talos-hostboot-11c8a7dc6e0ec3c31f081d1e30a04a6e7038f918.zip |
ERRL: Hardware Callouts
Support for HW and Procedure Callouts, including GARD and
deconfigure information.
. Add errl functions to get the information;
. Add errlog userdetail code to package callout data;
. Add to errlog commit function to find callout user-detail
sections and call a HWAS:common function to process
the callout.
. Remove gardLevel from Targeting hwasState field
Change-Id: I01c7c3721e6fd843a0ba2ad4df8399f6db68b590
RTC: 41276
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/1266
Tested-by: Jenkins Server
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/include/usr/errl')
-rw-r--r-- | src/include/usr/errl/errlentry.H | 171 | ||||
-rw-r--r-- | src/include/usr/errl/errlmanager.H | 87 | ||||
-rw-r--r-- | src/include/usr/errl/errlreasoncodes.H | 46 | ||||
-rw-r--r-- | src/include/usr/errl/errludcallout.H | 159 | ||||
-rw-r--r-- | src/include/usr/errl/errludparserfactoryerrl.H | 46 | ||||
-rw-r--r-- | src/include/usr/errl/hberrltypes.H | 46 |
6 files changed, 373 insertions, 182 deletions
diff --git a/src/include/usr/errl/errlentry.H b/src/include/usr/errl/errlentry.H index 32f9c2fe7..b3255a55b 100644 --- a/src/include/usr/errl/errlentry.H +++ b/src/include/usr/errl/errlentry.H @@ -1,25 +1,26 @@ -// IBM_PROLOG_BEGIN_TAG -// This is an automatically generated prolog. -// -// $Source: src/include/usr/errl/errlentry.H $ -// -// IBM CONFIDENTIAL -// -// COPYRIGHT International Business Machines Corp. 2011 -// -// p1 -// -// Object Code Only (OCO) source materials -// Licensed Internal Code Source Materials -// IBM HostBoot Licensed Internal Code -// -// The source code for this program is not published or other- -// wise divested of its trade secrets, irrespective of what has -// been deposited with the U.S. Copyright Office. -// -// Origin: 30 -// -// IBM_PROLOG_END +/* IBM_PROLOG_BEGIN_TAG + * This is an automatically generated prolog. + * + * $Source: src/include/usr/errl/errlentry.H $ + * + * IBM CONFIDENTIAL + * + * COPYRIGHT International Business Machines Corp. 2011-2012 + * + * p1 + * + * Object Code Only (OCO) source materials + * Licensed Internal Code Source Materials + * IBM HostBoot Licensed Internal Code + * + * The source code for this program is not published or other- + * wise divested of its trade secrets, irrespective of what has + * been deposited with the U.S. Copyright Office. + * + * Origin: 30 + * + * IBM_PROLOG_END_TAG + */ #ifndef ERRLENTRY_H #define ERRLENTRY_H /** @@ -54,7 +55,8 @@ #include <errl/errlsrc.H> #include <errl/errlud.H> #include <hbotcompid.H> - +#include <targeting/common/target.H> +#include <hwas/common/hwasCallout.H> namespace ERRORLOG { @@ -359,85 +361,40 @@ public: */ void removeBackTrace(); -private: - /** - * @brief The ErrlManager will call here to ask the - * ErrlEntry to assign the time of commit, and to assign - * the commiter's comp ID. - * The ErrlManager is the primary user of this call. - * - */ - void commit( compId_t i_commiterComp ); - - - - /** - * @brief Compute the flattened size of an error log. It is typical - * to call this function for the size of buffer required, then - * allocate a buffer, then call flatten(). - * The ErrlManager is the primary user of this call. - * - * @return Size in bytes of the flattened data. - */ - uint64_t flattenedSize(); - - - /** - * @brief Flatten the data to caller's buffer. The resulting flat - * data will be in PEL (platform event log) format. - * The ErrlManager is the primary user of this call. - * - * @param[in,out] o_buffer Points to data block to be filled - * @param[in] i_cbBuffer Count of bytes in buffer supplied - * - * @return Count of bytes copied to caller's - * buffer or else zero if it does not fit. - */ - uint64_t flatten( void * o_buffer, const uint64_t i_cbBuffer ); - - - /** - * @brief Disabled copy constructor and assignment operator - */ - ErrlEntry(const ErrlEntry& i_right); - ErrlEntry& operator=(const ErrlEntry& i_right); - - - -#if 0 - - //@todo - The interfaces in this block still need support in order - // to have code written. - - - //@todo: Need to set EPUB_Sub system based on highest - // priority call out FRU /** - * @brief Add a hardware ( FRU ) callout + * @brief Add a hardware callout * - * @param[in] i_resourceId The resource identifier for the part * @param[in] i_target The hardware target + * @param[in] i_priority Priority of the callout + * @param [in] i_deconfigState Enum indicating whether the failing part + * should be deconfigured. + * @param [in] i_gardErrorType to indicate what type of failure occured * * @return void */ - void addFruCallout(const target_t i_target, - const callOutPriority_t i_priority); - + void addHwCallout(const TARGETING::Target *i_target, + const HWAS::callOutPriority i_priority, + const HWAS::DeconfigEnum i_deconfigState, + const HWAS::GARD_ErrorType i_gardErrorType); - //@todo: Need to set EPUB_Sub system based on highest - // priority procedure call out /** * @brief Add a procedure ( software ) callout * Adds the given service procedure to the list * of callouts for the log * - * @param[in] i_priority Priority of the callout * @param[in] i_procedure Procedure identifier. + * @param[in] i_priority Priority of the callout * * @return void */ - void addProcedureCallout(const epubProcedureId_t i_procedure, - const callOutPriority_t i_priority); + void addProcedureCallout(const HWAS::epubProcedureID i_procedure, + const HWAS::callOutPriority i_priority); + +private: + +#if 0 + //@todo: Need to set EPUB_Sub system based on highest + // priority call out FRU /** * @brief Adds a software section to the log which is @@ -465,6 +422,48 @@ private: #endif + + /** + * @brief The ErrlManager will call here to ask the + * ErrlEntry to assign the time of commit, and to assign + * the commiter's comp ID. + * The ErrlManager is the primary user of this call. + * + */ + void commit( compId_t i_commiterComp ); + + + /** + * @brief Compute the flattened size of an error log. It is typical + * to call this function for the size of buffer required, then + * allocate a buffer, then call flatten(). + * The ErrlManager is the primary user of this call. + * + * @return Size in bytes of the flattened data. + */ + uint64_t flattenedSize(); + + + /** + * @brief Flatten the data to caller's buffer. The resulting flat + * data will be in PEL (platform event log) format. + * The ErrlManager is the primary user of this call. + * + * @param[in,out] o_buffer Points to data block to be filled + * @param[in] i_cbBuffer Count of bytes in buffer supplied + * + * @return Count of bytes copied to caller's + * buffer or else zero if it does not fit. + */ + uint64_t flatten( void * o_buffer, const uint64_t i_cbBuffer ); + + + /** + * @brief Disabled copy constructor and assignment operator + */ + ErrlEntry(const ErrlEntry& i_right); + ErrlEntry& operator=(const ErrlEntry& i_right); + private: // Data Members ErrlPrvt iv_Private; // private header object diff --git a/src/include/usr/errl/errlmanager.H b/src/include/usr/errl/errlmanager.H index 7d41c0ea1..3dc21b895 100644 --- a/src/include/usr/errl/errlmanager.H +++ b/src/include/usr/errl/errlmanager.H @@ -1,25 +1,26 @@ -// IBM_PROLOG_BEGIN_TAG -// This is an automatically generated prolog. -// -// $Source: src/include/usr/errl/errlmanager.H $ -// -// IBM CONFIDENTIAL -// -// COPYRIGHT International Business Machines Corp. 2011 -// -// p1 -// -// Object Code Only (OCO) source materials -// Licensed Internal Code Source Materials -// IBM HostBoot Licensed Internal Code -// -// The source code for this program is not published or other- -// wise divested of its trade secrets, irrespective of what has -// been deposited with the U.S. Copyright Office. -// -// Origin: 30 -// -// IBM_PROLOG_END +/* IBM_PROLOG_BEGIN_TAG + * This is an automatically generated prolog. + * + * $Source: src/include/usr/errl/errlmanager.H $ + * + * IBM CONFIDENTIAL + * + * COPYRIGHT International Business Machines Corp. 2011-2012 + * + * p1 + * + * Object Code Only (OCO) source materials + * Licensed Internal Code Source Materials + * IBM HostBoot Licensed Internal Code + * + * The source code for this program is not published or other- + * wise divested of its trade secrets, irrespective of what has + * been deposited with the U.S. Copyright Office. + * + * Origin: 30 + * + * IBM_PROLOG_END_TAG + */ #ifndef ERRLMANAGER_H #define ERRLMANAGER_H /** @@ -40,15 +41,11 @@ #include <vector> #include <kernel/timemgr.H> #include <hbotcompid.H> - - - +#include <hwas/common/hwasCallout.H> namespace ERRORLOG { - - /** * @brief Global function to log an error * Writes the log to PNOR where committed logs are kept. @@ -68,8 +65,6 @@ namespace ERRORLOG * * @return None */ - -// TODO Work item 4104 to make comitter comp required, no default. void errlCommit(errlHndl_t& io_err, compId_t i_committerComp ); /*****************************************************************************/ @@ -119,6 +114,29 @@ public: */ uint32_t getUniqueErrId(); + /** + * @brief Sets the HWAS ProcessCallout function pointer + * + * This is called by HWAS to inform errlmanager that HWAS is loaded and + * therefore it can call HWAS to process callout information in an errlog + * + * It is a static function because a module cannot call an interface on a + * singleton in another module + */ + static void setHwasProcessCalloutFn(HWAS::processCalloutFn i_fn); + + /** + * @brief Returns the HWAS ProcessCallout function pointer + * + * This is called by ErrlEntry::commit to get the HWAS ProcessCallout + * function pointer, this is called to process callout information in an + * errlog, if NULL is returned then the function cannot be called (because + * the HWAS module is not loaded) + * + * @return HWAS::processCalloutFn function pointer + */ + HWAS::processCalloutFn getHwasProcessCalloutFn() const; + protected: /** * @brief Destructor @@ -166,8 +184,17 @@ private: /** * @brief Serialization for error log commits. */ - mutex_t iv_mutex; + mutex_t iv_commitMutex; + /** + * @brief Pointer to the HWAS processCallout function + */ + HWAS::processCalloutFn iv_hwasProcessCalloutFn; + + /** + * @brief Serialization for accessing iv_hwasProcessCalloutFn + */ + mutable mutex_t iv_hwasMutex; }; } // End namespace diff --git a/src/include/usr/errl/errlreasoncodes.H b/src/include/usr/errl/errlreasoncodes.H index fda12fcf9..bf10908b6 100644 --- a/src/include/usr/errl/errlreasoncodes.H +++ b/src/include/usr/errl/errlreasoncodes.H @@ -1,25 +1,26 @@ -// IBM_PROLOG_BEGIN_TAG -// This is an automatically generated prolog. -// -// $Source: src/include/usr/errl/errlreasoncodes.H $ -// -// IBM CONFIDENTIAL -// -// COPYRIGHT International Business Machines Corp. 2011 -// -// p1 -// -// Object Code Only (OCO) source materials -// Licensed Internal Code Source Materials -// IBM HostBoot Licensed Internal Code -// -// The source code for this program is not published or other- -// wise divested of its trade secrets, irrespective of what has -// been deposited with the U.S. Copyright Office. -// -// Origin: 30 -// -// IBM_PROLOG_END +/* IBM_PROLOG_BEGIN_TAG + * This is an automatically generated prolog. + * + * $Source: src/include/usr/errl/errlreasoncodes.H $ + * + * IBM CONFIDENTIAL + * + * COPYRIGHT International Business Machines Corp. 2011-2012 + * + * p1 + * + * Object Code Only (OCO) source materials + * Licensed Internal Code Source Materials + * IBM HostBoot Licensed Internal Code + * + * The source code for this program is not published or other- + * wise divested of its trade secrets, irrespective of what has + * been deposited with the U.S. Copyright Office. + * + * Origin: 30 + * + * IBM_PROLOG_END_TAG + */ #ifndef __ERRL_REASON_CODES_H #define __ERRL_REASON_CODES_H @@ -50,6 +51,7 @@ enum errlReasonCode HBERRL_TEST_REASON_CODE = HBERRL_COMP_ID | 0x03, HBERRL_TEST_ATTRIBUTE_UD = HBERRL_COMP_ID | 0x04, HBERRL_TEST_LOGREGISTER_UD = HBERRL_COMP_ID | 0x05, + HBERRL_TEST_CALLOUT_UD = HBERRL_COMP_ID | 0x06, //........ HBERRL_LAST_ERR = HBERRL_COMP_ID | 0xFF }; diff --git a/src/include/usr/errl/errludcallout.H b/src/include/usr/errl/errludcallout.H new file mode 100644 index 000000000..ce0fb6cec --- /dev/null +++ b/src/include/usr/errl/errludcallout.H @@ -0,0 +1,159 @@ +/* IBM_PROLOG_BEGIN_TAG + * This is an automatically generated prolog. + * + * $Source: src/include/usr/errl/errludcallout.H $ + * + * IBM CONFIDENTIAL + * + * COPYRIGHT International Business Machines Corp. 2012 + * + * p1 + * + * Object Code Only (OCO) source materials + * Licensed Internal Code Source Materials + * IBM HostBoot Licensed Internal Code + * + * The source code for this program is not published or other- + * wise divested of its trade secrets, irrespective of what has + * been deposited with the U.S. Copyright Office. + * + * Origin: 30 + * + * IBM_PROLOG_END_TAG + */ +#ifndef ERRL_UDCALLOU_H +#define ERRL_UDCALLOU_H + +/** + * @file errludcallout.H + * + * Defines the following classes: + * + * ErrlUserDetailsCallout: Adds register FFDC to an error log as + * user detail data + * ErrlUserDetailsParserCallout: Parses register FFDC user detail in + * an error log +*/ + +#include <errl/errluserdetails.H> + +#ifndef PARSER + +// Forward reference +namespace TARGETING +{ + class Target; +} + +#include <hwas/common/hwasCallout.H> + +namespace ERRORLOG +{ + +/** + * @class ErrlUserDetailsCallout + * + * Adds Callout FFDC to an error log as user detail data + */ +class ErrlUserDetailsCallout : public ErrlUserDetails +{ +public: + + /** + * @brief Construct a hardware callout user detail + * + * @param[in] i_pTargetData The hardware target data + * @param[in] i_targetDataLength length of i_pTargetData + * @param[in] i_priority Priority of the callout + * @param [in] i_deconfigState Enum indicating whether the failing part + * should be deconfigured. + * @param [in] i_gardErrorType to indicate what type of failure occured + * + * @return void + */ + ErrlUserDetailsCallout( + const void *i_pTargetData, + uint32_t i_targetDataLength, + const HWAS::callOutPriority i_priority, + const HWAS::DeconfigEnum i_deconfigState, + const HWAS::GARD_ErrorType i_gardErrorType); + + /** + * @brief Add a procedure ( software ) callout + * Adds the given service procedure to the list + * of callouts for the log + * + * @param[in] i_procedure Procedure identifier. + * @param[in] i_priority Priority of the callout + * + * @return void + */ + ErrlUserDetailsCallout(const HWAS::epubProcedureID i_procedure, + const HWAS::callOutPriority i_priority); + /** + * @brief Destructor + */ + virtual ~ErrlUserDetailsCallout() { }; + +private: + // Disabled + ErrlUserDetailsCallout(const ErrlUserDetailsCallout &); + ErrlUserDetailsCallout & operator=(const ErrlUserDetailsCallout &); + +}; + +} + +#else // (if PARSER defined) + +namespace ERRORLOG +{ + +/** + * @class ErrlUserDetailsCallout + * + * Parses Callout user detail in an error log +*/ +class ErrlUserDetailsParserCallout : public ErrlUserDetailsParser +{ +public: + /** + * @brief Constructor + */ + ErrlUserDetailsParserCallout() {} + + /** + * @brief Destructor + */ + virtual ~ErrlUserDetailsParserCallout() {} + + /** + * @brief Parses callout user detail data from an error log + * + * @param i_version Version of the data + * @param i_parse ErrlUsrParser object for outputting information + * @param i_pBuffer Pointer to buffer containing detail data + * @param i_buflen Length of the buffer + */ + virtual void parse(errlver_t i_version, + ErrlUsrParser & i_parser, + void * i_pBuffer, + const uint32_t i_buflen) const + { + // TODO fix when parser fixed + // RTC 41707 + } + +private: + // Disabled + ErrlUserDetailsParserCallout(const ErrlUserDetailsParserCallout &); + ErrlUserDetailsParserCallout & operator=( + const ErrlUserDetailsParserCallout &); +}; + +} + +#endif + +#endif + diff --git a/src/include/usr/errl/errludparserfactoryerrl.H b/src/include/usr/errl/errludparserfactoryerrl.H index b38059465..5f5e7ad9b 100644 --- a/src/include/usr/errl/errludparserfactoryerrl.H +++ b/src/include/usr/errl/errludparserfactoryerrl.H @@ -1,25 +1,26 @@ -// IBM_PROLOG_BEGIN_TAG -// This is an automatically generated prolog. -// -// $Source: src/include/usr/errl/errludparserfactoryerrl.H $ -// -// IBM CONFIDENTIAL -// -// COPYRIGHT International Business Machines Corp. 2012 -// -// p1 -// -// Object Code Only (OCO) source materials -// Licensed Internal Code Source Materials -// IBM HostBoot Licensed Internal Code -// -// The source code for this program is not published or other- -// wise divested of its trade secrets, irrespective of what has -// been deposited with the U.S. Copyright Office. -// -// Origin: 30 -// -// IBM_PROLOG_END +/* IBM_PROLOG_BEGIN_TAG + * This is an automatically generated prolog. + * + * $Source: src/include/usr/errl/errludparserfactoryerrl.H $ + * + * IBM CONFIDENTIAL + * + * COPYRIGHT International Business Machines Corp. 2012 + * + * p1 + * + * Object Code Only (OCO) source materials + * Licensed Internal Code Source Materials + * IBM HostBoot Licensed Internal Code + * + * The source code for this program is not published or other- + * wise divested of its trade secrets, irrespective of what has + * been deposited with the U.S. Copyright Office. + * + * Origin: 30 + * + * IBM_PROLOG_END_TAG + */ #ifndef ERRL_UDPARSERFACTORYERRL_H #define ERRL_UDPARSERFACTORYERRL_H @@ -60,6 +61,7 @@ public: registerParser<ErrlUserDetailsParserBackTrace>(HBERRL_UDT_BACKTRACE); registerParser<ErrlUserDetailsParserAttribute>(HBERRL_UDT_ATTRIBUTE); registerParser<ErrlUserDetailsParserLogRegister>(HBERRL_UDT_LOGREGISTER); + registerParser<ErrlUserDetailsParserCallout>(HBERRL_UDT_CALLOUT); } private: diff --git a/src/include/usr/errl/hberrltypes.H b/src/include/usr/errl/hberrltypes.H index b9727a694..bea8b8345 100644 --- a/src/include/usr/errl/hberrltypes.H +++ b/src/include/usr/errl/hberrltypes.H @@ -1,25 +1,26 @@ -// IBM_PROLOG_BEGIN_TAG -// This is an automatically generated prolog. -// -// $Source: src/include/usr/errl/hberrltypes.H $ -// -// IBM CONFIDENTIAL -// -// COPYRIGHT International Business Machines Corp. 2011 -// -// p1 -// -// Object Code Only (OCO) source materials -// Licensed Internal Code Source Materials -// IBM HostBoot Licensed Internal Code -// -// The source code for this program is not published or other- -// wise divested of its trade secrets, irrespective of what has -// been deposited with the U.S. Copyright Office. -// -// Origin: 30 -// -// IBM_PROLOG_END +/* IBM_PROLOG_BEGIN_TAG + * This is an automatically generated prolog. + * + * $Source: src/include/usr/errl/hberrltypes.H $ + * + * IBM CONFIDENTIAL + * + * COPYRIGHT International Business Machines Corp. 2011-2012 + * + * p1 + * + * Object Code Only (OCO) source materials + * Licensed Internal Code Source Materials + * IBM HostBoot Licensed Internal Code + * + * The source code for this program is not published or other- + * wise divested of its trade secrets, irrespective of what has + * been deposited with the U.S. Copyright Office. + * + * Origin: 30 + * + * IBM_PROLOG_END_TAG + */ #ifndef HBERRLTYPES_H #define HBERRLTYPES_H /** @@ -52,6 +53,7 @@ enum errlUserDataType_t HBERRL_UDT_BACKTRACE = 3, HBERRL_UDT_ATTRIBUTE = 4, HBERRL_UDT_LOGREGISTER = 5, + HBERRL_UDT_CALLOUT = 6, }; |