summaryrefslogtreecommitdiffstats
path: root/extensions/openpower-pels/user_header.hpp
diff options
context:
space:
mode:
authorMatt Spinler <spinler@us.ibm.com>2019-11-07 13:05:36 -0600
committerMatt Spinler <spinler@us.ibm.com>2019-12-09 13:47:57 -0600
commiteb111447c755eabec4d89e4ccf74cc0c7887dedb (patch)
tree178220bd0cf45a2f9ab64f6f41c1e3a7e968d822 /extensions/openpower-pels/user_header.hpp
parentc148935174a27faaae4f5a4fedaf4ff2705916ec (diff)
downloadphosphor-logging-eb111447c755eabec4d89e4ccf74cc0c7887dedb.tar.gz
phosphor-logging-eb111447c755eabec4d89e4ccf74cc0c7887dedb.zip
PEL: Store transmission states in UserHeader
Use a reserved word in the UserHeader section to store some PEL states: * Host Transmission State: - States involving the progression of a PEL being sent to the operating system. * HMC Transmission State: - States involving the progression of a PEL being sent to the hardware management console, if there is one attached. - Usually, an HMC refers to a specific set of hardware and software sold by IBM that connects to OpenPower systems which has specific software to deal with receiving PELs. It is possible that there is an implementation that won't need to send PELs to either of these entities, in which case these states will just be unused and left at zero. This is the same location that other service processor implementations have stored transmission states. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I6a2bfee15336dbd564aeaded88effa55ede0d6c4
Diffstat (limited to 'extensions/openpower-pels/user_header.hpp')
-rw-r--r--extensions/openpower-pels/user_header.hpp57
1 files changed, 54 insertions, 3 deletions
diff --git a/extensions/openpower-pels/user_header.hpp b/extensions/openpower-pels/user_header.hpp
index 14407dc..f1fc66d 100644
--- a/extensions/openpower-pels/user_header.hpp
+++ b/extensions/openpower-pels/user_header.hpp
@@ -153,6 +153,51 @@ class UserHeader : public Section
}
/**
+ * @brief Returns the host transmission state
+ *
+ * @return uint8_t - the host transmission state
+ */
+ uint8_t hostTransmissionState() const
+ {
+ return _states & 0xFF;
+ }
+
+ /**
+ * @brief Sets the host transmission state
+ *
+ * @param[in] state - the new state
+ */
+ void setHostTransmissionState(uint8_t state)
+ {
+ _states &= 0xFFFFFF00;
+ _states |= state;
+ }
+
+ /**
+ * @brief Returns the HMC transmission state
+ *
+ * (HMC = Hardware Management Console)
+ *
+ * @return uint8_t - the HMC transmission state
+ */
+ uint8_t hmcTransmissionState() const
+ {
+ return (_states & 0x0000FF00) >> 8;
+ }
+
+ /**
+ * @brief Sets the HMC transmission state
+ *
+ * @param[in] state - the new state
+ */
+ void setHMCTransmissionState(uint8_t state)
+ {
+ uint32_t newState = state << 8;
+ _states &= 0xFFFF00FF;
+ _states |= newState;
+ }
+
+ /**
* @brief Returns the size of this section when flattened into a PEL
*
* @return size_t - the size of the section
@@ -163,7 +208,7 @@ class UserHeader : public Section
sizeof(_eventScope) + sizeof(_eventSeverity) +
sizeof(_eventType) + sizeof(_reserved4Byte1) +
sizeof(_problemDomain) + sizeof(_problemVector) +
- sizeof(_actionFlags) + sizeof(_reserved4Byte2);
+ sizeof(_actionFlags) + sizeof(_states);
}
/**
@@ -228,9 +273,15 @@ class UserHeader : public Section
uint16_t _actionFlags;
/**
- * @brief The second reserved word placeholder.
+ * @brief The second reserved word that we are
+ * using for storing state information.
+ *
+ * 0x0000AABB
+ * Where:
+ * 0xAA = HMC transmission state
+ * 0xBB = Host transmission state
*/
- uint32_t _reserved4Byte2;
+ uint32_t _states;
};
} // namespace pels
OpenPOWER on IntegriCloud