Refined guard type in HardwareCalloutResolution
A resolution guard type needs to be evaluated during the resolve()
function and not when the resolution is created.
Signed-off-by: Zane Shelley <zshelle@us.ibm.com>
Change-Id: Ia597ed93567b27c2cd9423f6fb0f7e75158fc315
diff --git a/analyzer/resolution.cpp b/analyzer/resolution.cpp
index 14842ad..9ad7502 100644
--- a/analyzer/resolution.cpp
+++ b/analyzer/resolution.cpp
@@ -43,7 +43,13 @@
}
else
{
- io_sd.addGuard(std::make_shared<Guard>(entityPath, iv_guard));
+ Guard::Type guard = Guard::NONE;
+ if (iv_guard)
+ {
+ guard = io_sd.queryCheckstop() ? Guard::FATAL : Guard::NON_FATAL;
+ }
+
+ io_sd.addGuard(std::make_shared<Guard>(entityPath, guard));
}
}
diff --git a/analyzer/resolution.hpp b/analyzer/resolution.hpp
index 32aee24..62afd76 100644
--- a/analyzer/resolution.hpp
+++ b/analyzer/resolution.hpp
@@ -33,11 +33,10 @@
* @param i_path The devtree path of a guardable unit relative to a
* chip. An empty string refers to the chip itself.
* @param i_priority The callout priority.
- * @param i_guard The guard type for this callout.
+ * @param i_guard True, if guard is required. False, otherwise.
*/
HardwareCalloutResolution(const std::string& i_path,
- Callout::Priority i_priority,
- Guard::Type i_guard) :
+ Callout::Priority i_priority, bool i_guard) :
iv_path(i_path),
iv_priority(i_priority), iv_guard(i_guard)
{}
@@ -50,8 +49,8 @@
/** The callout priority. */
const Callout::Priority iv_priority;
- /** The guard type for this callout. */
- const Guard::Type iv_guard;
+ /** True, if guard is required. False, otherwise. */
+ const bool iv_guard;
public:
void resolve(ServiceData& io_sd) const override;