summaryrefslogtreecommitdiffstats
path: root/src/include/usr/errl/errlmanager.H
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/usr/errl/errlmanager.H')
-rw-r--r--src/include/usr/errl/errlmanager.H65
1 files changed, 64 insertions, 1 deletions
diff --git a/src/include/usr/errl/errlmanager.H b/src/include/usr/errl/errlmanager.H
index f7407d8c4..5bd2aa196 100644
--- a/src/include/usr/errl/errlmanager.H
+++ b/src/include/usr/errl/errlmanager.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2011,2018 */
+/* Contributors Listed Below - COPYRIGHT 2011,2019 */
/* [+] Google Inc. */
/* [+] International Business Machines Corp. */
/* */
@@ -82,6 +82,32 @@ void errlCommit(errlHndl_t& io_err, compId_t i_committerComp );
uint8_t getHiddenLogsEnable();
/**
+ * @brief Returns the cached VERSION partition, if any. Makes a call to
+ * ErrlManager::getCachedVersionPartition
+ * @return uint8_t* The pointer to the binary contents of the VERSION
+ * partition; nullptr will be returned if VERSION hasn't been
+ * cached yet of if there was an error during caching
+ */
+const uint8_t* getCachedVersionPartition();
+
+/**
+ * @brief Returns the size of the cached VERSION partition. Makes a call
+ * to ErrlManager::getCachedVersionPartitionSize
+ * @return size_t The size of the cached VERSION partition. A 0 will be
+ * returned if VERSION hasn't been cached yet or if there was an
+ * error during caching
+ */
+size_t getCachedVersionPartitionSize();
+
+/*
+ * @brief Call to ErrlManager to cache the VERSION PNOR partition into an
+ * internal buffer.
+ *
+ * @return errlHndl_t nullptr on success; non-nullptr on error.
+ */
+errlHndl_t cacheVersionPartition();
+
+/**
* @brief Global enums used by static errlResourceReady function
*/
enum errlManagerNeeds
@@ -209,6 +235,34 @@ public:
*/
static bool errlCommittedThisBoot();
+ /**
+ * @brief Returns the cached VERSION partition, if any
+ * @return uint8_t* The pointer to the binary contents of the VERSION
+ * partition
+ */
+ const uint8_t* getCachedVersionPartition() const;
+
+ /**
+ * @brief Returns the size of the cached VERSION partition
+ * @return size_t The size of the cached VERSION partition
+ */
+ size_t getCachedVersionPartitionSize() const;
+
+ /**
+ * @brief Cache the VERSION PNOR partition into a member buffer. The
+ * buffer is dynamically allocated here to hold the contents of the
+ * partition. If any error occurs during the execution, the buffer
+ * is deleted and the error is returned. This function is not
+ * supposed to be called within ErrlManager message handler, since
+ * the function itself makes synchronous calls to various message
+ * handlers. Note that once the partition is cached, the cache is
+ * never purged to make sure all possible error logs receive the
+ * VERSION field. No-op on FSP systems.
+ *
+ * @return errlHndl_t nullptr on success; non-nullptr on error.
+ */
+ errlHndl_t cacheVersionPartition();
+
/**
* @brief Value to determine what logs are to be skipped. Mirrors
@@ -634,6 +688,15 @@ private:
bool allowCallHomeEselsToBmc(void);
#endif
+ const uint8_t* iv_versionPartitionCache; // The bin contents of the VERSION
+ // partition; once cached, the
+ // constents are never removed
+
+ size_t iv_versionPartitionCacheSize; // The size of the VERSION partition
+
+ bool iv_isVersionPartitionCached; // Whether the caching of the VERSION
+ // partition has been attempted
+
};
OpenPOWER on IntegriCloud