summaryrefslogtreecommitdiffstats
path: root/extensions/openpower-pels/callouts.cpp
diff options
context:
space:
mode:
authorMatt Spinler <spinler@us.ibm.com>2019-10-09 12:48:25 -0500
committerMatt Spinler <spinler@us.ibm.com>2019-10-22 14:09:56 +0000
commit32f13c915fa4b27520ca0aea476804c37f5516b9 (patch)
tree87e6af31872b305f86d37f83670fa94524b95d99 /extensions/openpower-pels/callouts.cpp
parent6c9662c9a269a3fcf6e6ccee51b2ab76b1679fb0 (diff)
downloadphosphor-logging-32f13c915fa4b27520ca0aea476804c37f5516b9.tar.gz
phosphor-logging-32f13c915fa4b27520ca0aea476804c37f5516b9.zip
PEL: SRC callouts subsection object
This Callouts class represents the optional subsection of an SRC PEL section that contains FRU callouts. It is only present in the SRC when there are callouts, and it comes at the end of the section. It is basically just a container for the Callout objects that represent the actual callouts. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I1d4d95b82f9b4943728d7939e3bf89e4a7bcbb75
Diffstat (limited to 'extensions/openpower-pels/callouts.cpp')
-rw-r--r--extensions/openpower-pels/callouts.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/extensions/openpower-pels/callouts.cpp b/extensions/openpower-pels/callouts.cpp
new file mode 100644
index 0000000..8a519e2
--- /dev/null
+++ b/extensions/openpower-pels/callouts.cpp
@@ -0,0 +1,36 @@
+#include "callouts.hpp"
+
+namespace openpower
+{
+namespace pels
+{
+namespace src
+{
+
+Callouts::Callouts(Stream& pel)
+{
+ pel >> _subsectionID >> _subsectionFlags >> _subsectionWordLength;
+
+ size_t currentLength = sizeof(_subsectionID) + sizeof(_subsectionFlags) +
+ sizeof(_subsectionWordLength);
+
+ while ((_subsectionWordLength * 4) > currentLength)
+ {
+ _callouts.emplace_back(new Callout(pel));
+ currentLength += _callouts.back()->flattenedSize();
+ }
+}
+
+void Callouts::flatten(Stream& pel)
+{
+ pel << _subsectionID << _subsectionFlags << _subsectionWordLength;
+
+ for (auto& callout : _callouts)
+ {
+ callout->flatten(pel);
+ }
+}
+
+} // namespace src
+} // namespace pels
+} // namespace openpower
OpenPOWER on IntegriCloud