summaryrefslogtreecommitdiffstats
path: root/src/usr/diag/mdia
diff options
context:
space:
mode:
authorBrad Bishop <bradleyb@us.ibm.com>2012-09-11 10:13:49 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2012-09-16 14:47:56 -0500
commit2a66f783f18d627788922e8a22502af9aff0abc9 (patch)
tree1c95f2cb9cb35d6e1a472c974a493fdd2bd10f4c /src/usr/diag/mdia
parentd529059e6f21842c7ee74edd91c7abb33ca1eb35 (diff)
downloadtalos-hostboot-2a66f783f18d627788922e8a22502af9aff0abc9.tar.gz
talos-hostboot-2a66f783f18d627788922e8a22502af9aff0abc9.zip
MDIA interface for PRD to determine MDIA is running.
Change-Id: I3d23b584fb28a66eb2c92cb7c272b5fde59983f4 RTC: 45395 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/1718 Tested-by: Jenkins Server Reviewed-by: Zane Shelley <zshelle@us.ibm.com> Reviewed-by: Christopher T. Phan <cphan@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/diag/mdia')
-rw-r--r--src/usr/diag/mdia/mdia.C4
-rw-r--r--src/usr/diag/mdia/mdiasm.C9
-rw-r--r--src/usr/diag/mdia/mdiasm.H51
-rw-r--r--src/usr/diag/mdia/test/mdiatestsm.H99
4 files changed, 116 insertions, 47 deletions
diff --git a/src/usr/diag/mdia/mdia.C b/src/usr/diag/mdia/mdia.C
index 9237c1d85..4c356c60d 100644
--- a/src/usr/diag/mdia/mdia.C
+++ b/src/usr/diag/mdia/mdia.C
@@ -109,8 +109,6 @@ errlHndl_t processEvent(MaintCommandEvent & i_event)
void waitingForMaintCmdEvents(bool & o_waiting)
{
- // TODO unstub RTC 45395
-
- o_waiting = true;
+ Singleton<StateMachine>::instance().running(o_waiting);
}
}
diff --git a/src/usr/diag/mdia/mdiasm.C b/src/usr/diag/mdia/mdiasm.C
index cafeaff0a..9598fbd6c 100644
--- a/src/usr/diag/mdia/mdiasm.C
+++ b/src/usr/diag/mdia/mdiasm.C
@@ -45,6 +45,15 @@ using namespace fapi;
namespace MDIA
{
+void StateMachine::running(bool & o_running)
+{
+ mutex_lock(&iv_mutex);
+
+ o_running = !iv_done;
+
+ mutex_unlock(&iv_mutex);
+}
+
errlHndl_t StateMachine::run(const WorkFlowAssocMap & i_list)
{
// load the workflow properties
diff --git a/src/usr/diag/mdia/mdiasm.H b/src/usr/diag/mdia/mdiasm.H
index 58668d7a3..60abe14b1 100644
--- a/src/usr/diag/mdia/mdiasm.H
+++ b/src/usr/diag/mdia/mdiasm.H
@@ -1,25 +1,25 @@
-// IBM_PROLOG_BEGIN_TAG
-// This is an automatically generated prolog.
-//
-// $Source: src/usr/diag/mdia/mdiasm.H $
-//
-// IBM CONFIDENTIAL
-//
-// COPYRIGHT International Business Machines Corp. 2012
-//
-// p1
-//
-// Object Code Only (OCO) source materials
-// Licensed Internal Code Source Materials
-// IBM HostBoot Licensed Internal Code
-//
-// The source code for this program is not published or other-
-// wise divested of its trade secrets, irrespective of what has
-// been deposited with the U.S. Copyright Office.
-//
-// Origin: 30
-//
-// IBM_PROLOG_END
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/diag/mdia/mdiasm.H $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2012 */
+/* */
+/* p1 */
+/* */
+/* Object Code Only (OCO) source materials */
+/* Licensed Internal Code Source Materials */
+/* IBM HostBoot Licensed Internal Code */
+/* */
+/* The source code for this program is not published or otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* Origin: 30 */
+/* */
+/* IBM_PROLOG_END_TAG */
#ifndef __MDIA_MDIASM_H
#define __MDIA_MDIASM_H
@@ -44,6 +44,13 @@ class StateMachine
public:
/**
+ * @brief running State machine in progress indicator.
+ *
+ * @param[out] o_running In progress indicator.
+ */
+ void running(bool & o_running);
+
+ /**
* @brief used by Maint cmd monitor to notify that
* maint cmd timed out - called in monitor thread context
*
diff --git a/src/usr/diag/mdia/test/mdiatestsm.H b/src/usr/diag/mdia/test/mdiatestsm.H
index dcfd04085..5d95975c0 100644
--- a/src/usr/diag/mdia/test/mdiatestsm.H
+++ b/src/usr/diag/mdia/test/mdiatestsm.H
@@ -1,25 +1,25 @@
-// IBM_PROLOG_BEGIN_TAG
-// This is an automatically generated prolog.
-//
-// $Source: src/usr/diag/mdia/test/mdiatestsm.H $
-//
-// IBM CONFIDENTIAL
-//
-// COPYRIGHT International Business Machines Corp. 2012
-//
-// p1
-//
-// Object Code Only (OCO) source materials
-// Licensed Internal Code Source Materials
-// IBM HostBoot Licensed Internal Code
-//
-// The source code for this program is not published or other-
-// wise divested of its trade secrets, irrespective of what has
-// been deposited with the U.S. Copyright Office.
-//
-// Origin: 30
-//
-// IBM_PROLOG_END
+/* IBM_PROLOG_BEGIN_TAG */
+/* This is an automatically generated prolog. */
+/* */
+/* $Source: src/usr/diag/mdia/test/mdiatestsm.H $ */
+/* */
+/* IBM CONFIDENTIAL */
+/* */
+/* COPYRIGHT International Business Machines Corp. 2012 */
+/* */
+/* p1 */
+/* */
+/* Object Code Only (OCO) source materials */
+/* Licensed Internal Code Source Materials */
+/* IBM HostBoot Licensed Internal Code */
+/* */
+/* The source code for this program is not published or otherwise */
+/* divested of its trade secrets, irrespective of what has been */
+/* deposited with the U.S. Copyright Office. */
+/* */
+/* Origin: 30 */
+/* */
+/* IBM_PROLOG_END_TAG */
#ifndef __TEST_MDIATESTSM_H
#define __TEST_MDIATESTSM_H
@@ -34,6 +34,9 @@
#include "../mdiasmimpl.H"
#include <diag/mdia/mdiamevent.H>
+using namespace MDIA;
+using namespace TARGETING;
+
class MdiaSmTest : public CxxTest::TestSuite
{
private:
@@ -630,5 +633,57 @@ class MdiaSmTest : public CxxTest::TestSuite
TS_TRACE(EXIT_MRK "testSmDoMaintCommand");
}
+
+ void testSmRunning(void)
+ {
+ TS_TRACE(ENTER_MRK "testSmRunning");
+
+ StateMachine s;
+
+ bool running = false;
+
+ do {
+
+ s.running(running);
+
+ if(running)
+ {
+ TS_FAIL("unexpected result calling running (1)");
+ break;
+ }
+
+ WorkFlowAssocMap wkFlentries;
+
+ TargetHandleList targets;
+ getTargets(1, targets);
+
+ wkFlentries[targets[0]].push_back(START_SCRUB);
+
+ s.setup(wkFlentries);
+
+ s.running(running);
+
+ if(!running)
+ {
+ TS_FAIL("unexpected result calling running (2)");
+ break;
+ }
+
+ s.reset();
+
+ s.run(wkFlentries);
+
+ s.running(running);
+
+ if(running)
+ {
+ TS_FAIL("unexpected result calling running (3)");
+ break;
+ }
+
+ } while(0);
+
+ TS_TRACE(EXIT_MRK "testSmRunning");
+ }
};
#endif
OpenPOWER on IntegriCloud