Add support for Get TI Info chipop
Use the Get TI Info chipop to determine if a special attention was
due to a TI or a breakpoint.
Signed-off-by: Ben Tyner <ben.tyner@ibm.com>
Change-Id: I256dcf1171c27e851032353226c174307105cd0a
diff --git a/attn/ti_handler.cpp b/attn/ti_handler.cpp
index 4801f2c..f1354aa 100644
--- a/attn/ti_handler.cpp
+++ b/attn/ti_handler.cpp
@@ -1,27 +1,36 @@
+#include <attn_handler.hpp>
#include <attn_logging.hpp>
#include <sdbusplus/bus.hpp>
+#include <ti_handler.hpp>
namespace attn
{
/** @brief Start host diagnostic mode systemd unit */
-void tiHandler()
+int tiHandler(TiDataArea* i_tiDataArea)
{
- // trace message
- trace<level::INFO>("start host diagnostic mode service");
+ int rc = RC_NOT_HANDLED; // assume TI not handled
- // Use the systemd service manager object interface to call the start unit
- // method with the obmc-host-diagnostic-mode target.
- auto bus = sdbusplus::bus::new_system();
- auto method = bus.new_method_call(
- "org.freedesktop.systemd1", "/org/freedesktop/systemd1",
- "org.freedesktop.systemd1.Manager", "StartUnit");
+ if (0xa1 == i_tiDataArea->command)
+ {
+ // trace message
+ trace<level::INFO>("start host diagnostic mode service");
- method.append("obmc-host-diagnostic-mode@0.target"); // unit to activate
- method.append("replace"); // mode = replace conflicting queued jobs
- bus.call_noreply(method); // start the service
+ // Use the systemd service manager object interface to call the start
+ // unit method with the obmc-host-diagnostic-mode target.
+ auto bus = sdbusplus::bus::new_system();
+ auto method = bus.new_method_call(
+ "org.freedesktop.systemd1", "/org/freedesktop/systemd1",
+ "org.freedesktop.systemd1.Manager", "StartUnit");
- return;
+ method.append("obmc-host-diagnostic-mode@0.target"); // unit to activate
+ method.append("replace"); // mode = replace conflicting queued jobs
+ bus.call_noreply(method); // start the service
+
+ rc = RC_SUCCESS;
+ }
+
+ return rc;
}
} // namespace attn