From f1e85e20a1a6e97e27737b5883a8aa6a63c79b22 Mon Sep 17 00:00:00 2001 From: Matt Spinler Date: Fri, 1 Nov 2019 11:31:31 -0500 Subject: PEL: Validate the Action Flags field According to the PEL spec, the Action Flags and Event Type fields in the User Header section must be in agreement with the Severity field. So, when a PEL is being created from an OpenBMC event log, check those values for correctness and fix them up if required. In addition, as those fields are optional in the message registry, this code will also just set these two fields to valid values if they were left out. The rules being followed are documented in the PEL readme. Signed-off-by: Matt Spinler Change-Id: Iad88de5080ba79a9ff31f962ef99bfc11994b9ed --- extensions/openpower-pels/pel_types.hpp | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'extensions/openpower-pels/pel_types.hpp') diff --git a/extensions/openpower-pels/pel_types.hpp b/extensions/openpower-pels/pel_types.hpp index d19c875..ae886eb 100644 --- a/extensions/openpower-pels/pel_types.hpp +++ b/extensions/openpower-pels/pel_types.hpp @@ -79,7 +79,9 @@ enum class EventScope */ enum class EventType { - notApplicable = 0x00 + notApplicable = 0x00, + miscInformational = 0x01, + tracing = 0x02 }; /** @@ -97,5 +99,25 @@ enum class SeverityType symptom = 0x70 }; +/** + * @brief The Action Flags values with the bit + * numbering needed by std::bitset. + * + * Not an enum class so that casting isn't needed + * by the bitset operations. + */ +enum ActionFlagsBits +{ + serviceActionFlagBit = 15, // 0x8000 + hiddenFlagBit = 14, // 0x4000 + reportFlagBit = 13, // 0x2000 + dontReportToHostFlagBit = 12, // 0x1000 + callHomeFlagBit = 11, // 0x0800 + isolationIncompleteFlagBit = 10, // 0x0400 + spCallHomeFlagBit = 8, // 0x0100 + osSWErrorBit = 7, // 0x0080 + osHWErrorBit = 6 // 0x0040 +}; + } // namespace pels } // namespace openpower -- cgit v1.2.1