P9 CFAM register override procedure
This new procedure will allow users to
provide P9 CFAM register overrides
before the P9 SBE is started.
Change-Id: If3658f9a6ede9a3682c4ed7888e9acb328c67709
Signed-off-by: Michael Tritz <mtritz@us.ibm.com>
diff --git a/targeting.cpp b/targeting.cpp
index 635c8bb..c5118c1 100644
--- a/targeting.cpp
+++ b/targeting.cpp
@@ -37,6 +37,24 @@
return cfamFD->get();
}
+std::unique_ptr<Target>& Targeting::getTarget(size_t pos)
+{
+ auto search = [pos](const auto& t)
+ {
+ return t->getPos() == pos;
+ };
+
+ auto target = find_if(targets.begin(), targets.end(), search);
+ if (target == targets.end())
+ {
+ throw std::runtime_error("Target not found: " + std::to_string(pos));
+ }
+ else
+ {
+ return *target;
+ }
+}
+
Targeting::Targeting(const std::string& fsiMasterDev,
const std::string& fsiSlaveDir) :