PEL: Create SRC section from message registry

This adds the ability to create an SRC PEL section based on the message
registry entry for an OpenBMC event log.

The event log's AdditionalData property is used as a source for the user
defined data words of the SRC, while the other fields in the SRC's data
words are filled in either from the message registry fields or from
current system state or configuration.

The ASCII string field of the SRC is filled in based on the message
registry entry.

This commit doesn't fill in every system status field, as many aren't
even available anywhere yet.  Also, this commit doesn't support adding
callouts to an SRC, that will also be handled in the future.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I67fe44e07e4eda6bdeedb4af2eacfc197deb6eb3
diff --git a/test/openpower-pels/pel_test.cpp b/test/openpower-pels/pel_test.cpp
index b744432..1f9917a 100644
--- a/test/openpower-pels/pel_test.cpp
+++ b/test/openpower-pels/pel_test.cpp
@@ -117,13 +117,21 @@
     regEntry.name = "test";
     regEntry.subsystem = 5;
     regEntry.actionFlags = 0xC000;
+    regEntry.src.type = 0xBD;
+    regEntry.src.reasonCode = 0x1234;
 
-    PEL pel{regEntry, 42, timestamp, phosphor::logging::Entry::Level::Error};
+    AdditionalData ad;
+
+    PEL pel{regEntry, 42, timestamp, phosphor::logging::Entry::Level::Error,
+            ad};
 
     EXPECT_TRUE(pel.valid());
     EXPECT_EQ(pel.privateHeader()->obmcLogID(), 42);
     EXPECT_EQ(pel.userHeader()->severity(), 0x40);
 
+    EXPECT_EQ(pel.primarySRC().value()->asciiString(),
+              "BD051234                        ");
+
     // Add more checks as more sections are added
 }