summaryrefslogtreecommitdiffstats
path: root/src/usr/initservice/istepdispatcher
diff options
context:
space:
mode:
Diffstat (limited to 'src/usr/initservice/istepdispatcher')
-rw-r--r--src/usr/initservice/istepdispatcher/istepdispatcher.C70
-rw-r--r--src/usr/initservice/istepdispatcher/istepdispatcher.H52
-rw-r--r--src/usr/initservice/istepdispatcher/isteplist.H24
3 files changed, 116 insertions, 30 deletions
diff --git a/src/usr/initservice/istepdispatcher/istepdispatcher.C b/src/usr/initservice/istepdispatcher/istepdispatcher.C
index cb3634c9b..057cde2f9 100644
--- a/src/usr/initservice/istepdispatcher/istepdispatcher.C
+++ b/src/usr/initservice/istepdispatcher/istepdispatcher.C
@@ -1,3 +1,20 @@
+/****************************************************************************
+ * $IBMCopyrightBlock:
+ *
+ * IBM Confidential
+ *
+ * Licensed Internal Code Source Materials
+ *
+ * IBM HostBoot Licensed Internal Code
+ *
+ * (C) Copyright IBM Corp. 2011
+ *
+ * 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.
+ * $
+****************************************************************************/
+
/**
* @file istepdispatcher.C
*
@@ -20,6 +37,7 @@
#include "istepdispatcher.H"
#include "isteplist.H"
+
namespace INITSERVICE
{
@@ -29,28 +47,26 @@ namespace INITSERVICE
extern trace_desc_t *g_trac_initsvc;
/**
- * @brief set up _start() task entry procedure
- *
+ * @brief set up _start() task entry procedure using the macro
*/
TASK_ENTRY_MACRO( IStepDispatcher::getTheInstance().init );
IStepDispatcher::IStepDispatcher()
-:
- iv_istepmodeflag(false),
- iv_nextistep( 0 ),
- iv_cancontinueflag(false)
+: iv_istepmodeflag(false),
+ iv_nextistep( 0 ),
+ iv_cancontinueflag(false)
{
}
+
IStepDispatcher::~IStepDispatcher()
{
}
-
IStepDispatcher& IStepDispatcher::getTheInstance()
{
return Singleton<IStepDispatcher>::instance();
@@ -72,7 +88,7 @@ void IStepDispatcher::init( void * ptr )
nextIStep<INITSERVICE::MAX_ISTEPS;
nextIStep++ )
{
- pistep = &(isteps[nextIStep]);
+ pistep = &(g_isteps[nextIStep]);
if ( pistep->taskflags.task_type == END_TASK_LIST )
{
TRACDCOMP( g_trac_initsvc,
@@ -81,16 +97,30 @@ void IStepDispatcher::init( void * ptr )
}
- errl = executeFn( pistep, &args );
+ args.clear(); // clear the args struct for the next istep
+ errl = InitService::getTheInstance().executeFn( pistep,
+ &args );
- // report an error
- reportError( errl );
+ // handle an errorlog from the parent, if it exists
+ InitService::getTheInstance().reportError( errl );
/**
* @todo call getCanContinueProcedure when we have some ISteps that
- * require them.
+ * require them.
*/
+ if ( args.getReturnCode() != TASKARGS_UNDEFINED64 )
+ {
+ TRACFCOMP( g_trac_initsvc,
+ ERR_MRK "IStep TaskArgs returned 0x%llx, errlog=%p",
+ args.getReturnCode(),
+ args.getErrorLog()
+ );
+ }
+
+ // report an error from the child, if it exists.
+ reportIStepErrorLog( pistep, args.getErrorLog() );
+
} // endfor
@@ -99,6 +129,8 @@ void IStepDispatcher::init( void * ptr )
}
+
+
/**
* @note IStep Mode is hardwired to false for now
*
@@ -112,12 +144,20 @@ bool IStepDispatcher::getIStepMode( ) const
-bool IStepDispatcher::getCanContinueProcedure( TaskInfo &i_failingIStep,
- errlHndl_t &i_failingError,
- TaskInfo &io_nextIstep ) const
+bool IStepDispatcher::getCanContinueProcedure( const TaskInfo &i_failingIStep,
+ errlHndl_t &i_failingError,
+ TaskInfo &io_nextIstep
+ ) const
{
return false;
}
+void IStepDispatcher::reportIStepErrorLog( const TaskInfo *i_failingIStep,
+ errlHndl_t io_errl )
+{
+
+ InitService::getTheInstance().reportError( io_errl );
+}
+
} // namespace
diff --git a/src/usr/initservice/istepdispatcher/istepdispatcher.H b/src/usr/initservice/istepdispatcher/istepdispatcher.H
index 34e2dccf5..551f8292c 100644
--- a/src/usr/initservice/istepdispatcher/istepdispatcher.H
+++ b/src/usr/initservice/istepdispatcher/istepdispatcher.H
@@ -1,3 +1,20 @@
+/****************************************************************************
+ * $IBMCopyrightBlock:
+ *
+ * IBM Confidential
+ *
+ * Licensed Internal Code Source Materials
+ *
+ * IBM Flexible Support Processor Licensed Internal Code
+ *
+ * (C) Copyright IBM Corp. 2011
+ *
+ * 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.
+ * $
+****************************************************************************/
+
#ifndef __ISTEP_DISPATCHER_H
#define __ISTEP_DISPATCHER_H
/**
@@ -30,7 +47,6 @@ namespace INITSERVICE
// Globals/Constants
/******************************************************************************/
-
/******************************************************************************/
// Typedef/Enumerations
/******************************************************************************/
@@ -39,16 +55,13 @@ namespace INITSERVICE
// Class
/******************************************************************************/
-// Singleton definition
-class IStepDispatcher;
-typedef Singleton<IStepDispatcher> theIStepDispatcher;
-
-
/**
- * @class IStepDispatcher Singleton Class
+ * @class IStepDispatcher
+ *
+ * Dispatch ISteps and handle return codes, errorlogs, etc.
*
*/
-class IStepDispatcher : public InitService
+class IStepDispatcher
{
public:
@@ -85,6 +98,12 @@ protected:
private:
/**
+ * @note Disable copy constructor and assignment operator
+ */
+ IStepDispatcher(const IStepDispatcher& i_right);
+ IStepDispatcher& operator=(const IStepDispatcher& i_right);
+
+ /**
* @brief getIStepMode
* call into PNOR and fetch the "IStepMode flag" .
* This will tell us if we are locked to the SP (IStepMode=ON) or
@@ -108,10 +127,19 @@ private:
* true otherwise
*
*/
- bool getCanContinueProcedure( TaskInfo &i_failingIStep,
- errlHndl_t &i_failingError,
- TaskInfo &io_nextIstep ) const;
+ bool getCanContinueProcedure( const TaskInfo &i_failingIStep,
+ errlHndl_t &i_failingError,
+ TaskInfo &io_nextIstep ) const;
+ /**
+ * @brief reportIStepErrorLog
+ * If an IStep returns an error log, commit it.
+ *
+ * @todo Later there may be some decision about whether to report it
+ * based on the IStep.
+ */
+ void reportIStepErrorLog( const TaskInfo *i_failingIStep,
+ errlHndl_t io_errl );
bool iv_istepmodeflag;
@@ -120,6 +148,6 @@ private:
}; // class IStepDispatcher
-} // namespace ISTEPDISP
+} // namespace
#endif
diff --git a/src/usr/initservice/istepdispatcher/isteplist.H b/src/usr/initservice/istepdispatcher/isteplist.H
index a72815a79..993c6684d 100644
--- a/src/usr/initservice/istepdispatcher/isteplist.H
+++ b/src/usr/initservice/istepdispatcher/isteplist.H
@@ -1,7 +1,25 @@
+/****************************************************************************
+ * $IBMCopyrightBlock:
+ *
+ * IBM Confidential
+ *
+ * Licensed Internal Code Source Materials
+ *
+ * IBM Flexible Support Processor Licensed Internal Code
+ *
+ * (C) Copyright IBM Corp. 2011
+ *
+ * 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.
+ * $
+****************************************************************************/
+
#ifndef __ISTEPS_H
#define __ISTEPS_H
+
/**
- * @file extinitsvctasks.H
+ * @file isteplist.H
*
* TaskInfo structs for each task that will run in the extended image.
*/
@@ -15,7 +33,7 @@ namespace INITSERVICE
const uint64_t MAX_ISTEPS = 25;
-const TaskInfo isteps[] = {
+const TaskInfo g_isteps[] = {
// ----- ISteps Image ------------------------------------------
@@ -54,4 +72,4 @@ const TaskInfo isteps[] = {
}; // namespace
-#endif // __EXT_INIT_SVC_TASKS_H
+#endif
OpenPOWER on IntegriCloud