summaryrefslogtreecommitdiffstats
path: root/src/include/usr
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/usr')
-rw-r--r--src/include/usr/errl/errlentry.H14
-rw-r--r--src/include/usr/errl/errlreasoncodes.H3
-rw-r--r--src/include/usr/errl/errltypes.H34
-rwxr-xr-xsrc/include/usr/errl/errluserdetails.H257
4 files changed, 296 insertions, 12 deletions
diff --git a/src/include/usr/errl/errlentry.H b/src/include/usr/errl/errlentry.H
index 51a0df843..5046cd1c6 100644
--- a/src/include/usr/errl/errlentry.H
+++ b/src/include/usr/errl/errlentry.H
@@ -31,6 +31,16 @@
* is used to log errors from all firmware running in Host Boot environment.
*
*/
+/**
+ * @page errlog Error Log
+ *
+ * @section Base Error Log
+ * See Host Boot Error Logging LLDD, Version 0.7 09/01/2011
+ *
+ * @section Adding User-Defined error blocks
+ *
+ *
+ */
/*****************************************************************************/
// I n c l u d e s
@@ -45,6 +55,7 @@
#include <errl/errlud.H>
#include <hbotcompid.H>
+
namespace ERRORLOG
{
@@ -278,7 +289,7 @@ public:
/**
- * @brief Allows the caller to add a chunk of data in a log
+ * @brief Allows the caller to add a chunk of FFDC data in a log
*
* @param[in] i_compId Component Id of the caller
* @param[in] i_dataPtr Pointer to FFDC data
@@ -316,7 +327,6 @@ public:
const uint32_t i_dataLen);
-
/**
* @brief Collect component trace
* The given component's trace is collected (if possible)
diff --git a/src/include/usr/errl/errlreasoncodes.H b/src/include/usr/errl/errlreasoncodes.H
index 241fb2a4e..346f563c7 100644
--- a/src/include/usr/errl/errlreasoncodes.H
+++ b/src/include/usr/errl/errlreasoncodes.H
@@ -36,6 +36,7 @@
enum
{
ERRL_FIRST_MODULE_ID = 0x00,
+ ERRL_USERDETAILS_MODULE_ID,
//........
ERRL_LAST_MODULE_ID = 0xFF
};
@@ -44,6 +45,8 @@ enum
enum errlReasonCode
{
ERRL_FIRST_ERR = ERRL_COMP_ID | 0x01,
+ ERRL_ADDTOLOG_FAIL = ERRL_COMP_ID | 0x02,
+ ERRL_APPENDTOLOG_FAIL = ERRL_COMP_ID | 0x03,
//........
ERRL_LAST_ERR = ERRL_COMP_ID | 0xFF
};
diff --git a/src/include/usr/errl/errltypes.H b/src/include/usr/errl/errltypes.H
index af5067ea4..e3435eef5 100644
--- a/src/include/usr/errl/errltypes.H
+++ b/src/include/usr/errl/errltypes.H
@@ -34,6 +34,7 @@
* on pool machines, so the stuff in here needs to be generic.
*
*/
+#include <hbotcompid.H> // compId_t
/**
* @brief Pointer to an ErrlEntry object
@@ -83,7 +84,7 @@ namespace ERRORLOG
/**
* @brief Scope is found in user header section.
-
+
*/
enum errlScope_t
{
@@ -157,10 +158,10 @@ enum errlSectionId_t
/**
* @brief Enumeration of error log severity.
* Needs to fit into 1 byte for flattening purposes.
- *
+ *
* Severity resides in the user header of the PEL log.
- *
- * Refer to this ErrlEntry setter:
+ *
+ * Refer to this ErrlEntry setter:
* void ErrlEntry::setSev(const errlSeverity_t i_sev)
*/
enum errlSeverity_t
@@ -177,9 +178,9 @@ enum errlSeverity_t
/**
* @brief Event (error) type
* Needs to fit into 1 byte for flattening purposes.
- *
+ *
* Event type resides in user header of PEL log.
- *
+ *
* Refer to this ErrlEntry setter:
* void ErrlEntry::setEventType(const errlEventType_t i_eventType)
*/
@@ -200,10 +201,10 @@ enum errlEventType_t
/**
* @brief SRC type definitions
* Needs to fit into 1 byte for flattening purposes.
- *
+ *
* This represents the byte in an SRC in position
* XX...... such as B1 in B181F00B.
- *
+ *
* Refer to errlentry.H and this setter:
* void ErrlEntry::setSrcType(const srcType_t i_srcType)
*
@@ -224,8 +225,8 @@ enum srcType_t
* Needs to fit into 1 byte for flattening purposes.
* This represents the byte in an SRC in position
* ..XX.... such as 81 in B181F00B.
- *
- * Refer to errentry.H and this setter:
+ *
+ * Refer to errentry.H and this setter:
* void ErrlEntry::setSubSys(const epubSubSystem_t i_subSys);
*/
enum epubSubSystem_t
@@ -297,9 +298,22 @@ enum errlUserDataVersion
*/
const uint32_t ERRL_STORAGE_SIZE = 65536;
+/**
+ *
+ * @typedef version number
+ * version number of the user data
+ */
+typedef uint8_t errlver_t;
+
+/**
+ * @typedef errlsubsec_t
+ * errorlog subsection id of the user data
+ */
+typedef uint8_t errlsubsec_t;
/**
+
* @brief The RAM storage for committed error logs starts with this
* header. This structure is org'ed at &g_ErrlStorage[0]. All
* offsets are based from &g_achErrlStorage[0], so the first
diff --git a/src/include/usr/errl/errluserdetails.H b/src/include/usr/errl/errluserdetails.H
new file mode 100755
index 000000000..af7e004d1
--- /dev/null
+++ b/src/include/usr/errl/errluserdetails.H
@@ -0,0 +1,257 @@
+// IBM_PROLOG_BEGIN_TAG
+// This is an automatically generated prolog.
+//
+// $Source: src/include/usr/errl/errluserdetails.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
+#ifndef ERRL_ERRLUSERDETAILS_H
+#define ERRL_ERRLUSERDETAILS_H
+
+/**
+ * @file errluserdetails.H
+ *
+ * Error Log User Detail Data Helper
+ *
+ * Framework defining how User Detail Data sections of error logs should
+ * be created and parsed.
+ *
+ * Creation methods will show up when the PARSER macro is NOT defined.
+ * These will compile and run under HostBoot.
+ *
+ * Parsing methods will show up when the PARSER macro IS defined.
+ * These will compile and run in the errl tool.
+ *
+*/
+
+//
+// @page ErrlUserDetails Error Log User Details
+//
+//
+
+
+/*****************************************************************************/
+// I n c l u d e s
+/*****************************************************************************/
+#include <hbotcompid.H> // list of compid's supported
+
+#include <errl/errltypes.H> // errlver_t, errlsubsec_t
+#include <errl/errlentry.H> // addFFDC, appendFFDC
+
+
+
+/*****************************************************************************/
+// Typedefs
+/*****************************************************************************/
+
+
+namespace ERRORLOG
+{
+
+#ifndef PARSER
+
+/**
+ * @brief ERRL User Data Details
+ *
+ * HostBoot Support - base class for Errorlog User Details.
+ *
+ *
+*/
+class ErrlUserDetails
+{
+public:
+
+ /**
+ * @brief Constructor
+ *
+ * Sets up instance variables. A derived class should set up the instance
+ * variables to reflect a specific format of user detail data
+ *
+ */
+ ErrlUserDetails();
+
+ /**
+ * @brief Destructor
+ *
+ * Performs any necessary cleanup
+ *
+ */
+ virtual ~ErrlUserDetails();
+
+ /**
+ * @brief Adds or appends more user detail data to error log
+ *
+ * Adds or appends user detail data stored in the internal buffer to
+ * the error log
+ * Subclasses should override if the detail data is not stored in the
+ * internal buffer.
+ *
+ * @param i_errl
+ * Error log handle to add detail data to.
+ * This will call appendFFDC() in the errorlog.
+ *
+ * @param i_pappendBuf
+ * pointer to the new data buffer to append.
+ *
+ * @param i_pappendBufLen
+ * length of the new data buffer to append in bytes.
+ *
+ * @return None
+ *
+ */
+ virtual void addToLog(
+ errlHndl_t i_errl,
+ const void *i_paddBuf=NULL,
+ const uint32_t i_addBufLen=0 );
+
+protected:
+
+ /**
+ * @brief Allocates the internal data buffer for storing detail data
+ *
+ * If the internal buffer is already allocated then it is freed. The
+ * data buffer is allocated with the specified size.
+ *
+ * @param i_size
+ * Size of buffer
+ *
+ * @return uint8_t*
+ * Pointer to the data buffer
+ *
+ */
+ uint8_t * allocUsrBuf(const uint32_t i_size);
+
+ /**
+ * @brief Returns the size of the internal data buffer
+ *
+ * @return uint32_t
+ * Size of the internal data buffer
+ *
+ */
+ uint32_t getUsrBufSize() const;
+
+ /**
+ * Protected Data: ID of component adding user details
+ */
+ compId_t iv_CompId;
+
+ /**
+ * Protected Data: Version number of the user details
+ */
+ errlver_t iv_Version;
+
+ /**
+ * Protected Data: Subsection number of the user details
+ */
+ errlsubsec_t iv_SubSection;
+
+ /**
+ * Pointer to the ErrlFFDC passed back by addFFDC()
+ */
+ ErrlFFDC *iv_pErrlFFDC;
+
+private:
+
+ // Disabled
+ ErrlUserDetails(const ErrlUserDetails &);
+ ErrlUserDetails & operator=(const ErrlUserDetails &);
+
+ /**
+ * Private Data members (the internal buffer should be accessed through
+ * public member functions)
+ */
+ uint8_t * iv_pBuffer; // Pointer to internal buffer
+ uint32_t iv_BufLen; // Length of internal buffer
+
+};
+
+#else // (if PARSER defined)
+
+/**
+ *
+ * @brief Error Log User Detail Data Helper
+ *
+ * Framework defining how User Detail Data sections of error logs should
+ * be created and parsed.
+ *
+ * Creation methods will show up when the PARSER macro is NOT defined.
+ * These will compile and run under HostBoot.
+ *
+ * Parsing methods will show up when the PARSER macro IS defined.
+ * These will compile and run in the errl tool.
+ *
+*/
+class ErrlUserDetails
+{
+public:
+
+ /**
+ * @brief Constructor
+ *
+ */
+ ErrlUserDetails()
+ {
+ }
+
+ /**
+ * @brief Destructor
+ *
+ */
+ virtual ~ErrlUserDetails()
+ {
+ }
+
+ /**
+ * @brief Parses user detail data from an error log
+ *
+ * Parses the supplied user detail data and outputs info to i_parser. This
+ * is a pure virtual function that must be overridden by a concrete derived
+ * class that is specific to a particular component, version and subsection
+ *
+ * @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
+ *
+ * @return None
+ *
+ */
+ virtual void parse(errlver_t i_version,
+ ErrlUsrParser & i_parser,
+ const void * i_pBuffer,
+ const uint32_t i_buflen) const = 0;
+
+private:
+
+ // Disabled
+ ErrlUserDetails(const ErrlUserDetails &);
+ ErrlUserDetails & operator=(const ErrlUserDetails &);
+};
+
+#endif //PARSER
+
+} // end namespace
+
+#endif
OpenPOWER on IntegriCloud