PEL: Let Callouts class have a Callout added
Add an addCallout() function to the Callouts class to add a new Callout
object to it.
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: Ib2a352b3b10e2948c4e847d29a456b8de9cb3559
diff --git a/extensions/openpower-pels/callouts.cpp b/extensions/openpower-pels/callouts.cpp
index 17f5bdd..2440621 100644
--- a/extensions/openpower-pels/callouts.cpp
+++ b/extensions/openpower-pels/callouts.cpp
@@ -15,6 +15,8 @@
*/
#include "callouts.hpp"
+#include <phosphor-logging/log.hpp>
+
namespace openpower
{
namespace pels
@@ -46,6 +48,20 @@
}
}
+void Callouts::addCallout(std::unique_ptr<Callout> callout)
+{
+ if (_callouts.size() < maxNumberOfCallouts)
+ {
+ _callouts.push_back(std::move(callout));
+
+ _subsectionWordLength += _callouts.back()->flattenedSize() / 4;
+ }
+ else
+ {
+ using namespace phosphor::logging;
+ log<level::INFO>("Dropping PEL callout because at max");
+ }
+}
} // namespace src
} // namespace pels
} // namespace openpower