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 <spinler@us.ibm.com>
Change-Id: Iad88de5080ba79a9ff31f962ef99bfc11994b9ed
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 EventType
 {
-    notApplicable = 0x00
+    notApplicable = 0x00,
+    miscInformational = 0x01,
+    tracing = 0x02
 };
 
 /**
@@ -97,5 +99,25 @@
     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