From 353cc0391b0982b936fe0437fbaa0439f775a6dd Mon Sep 17 00:00:00 2001 From: Mark Wenning Date: Sun, 10 Jul 2011 21:14:46 -0500 Subject: IStep Dispatcher - remove refs to include/src/usr/taskargs/ dir - use _start() macro in IStepDispatcher - post-review fixes - fixed - inadvertently ran copyright script on staged files Change-Id: I2b256524746d0eb25ed04e0835450e220dc65492 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/191 Tested-by: Jenkins Server Reviewed-by: MIKE J. JONES --- src/include/usr/initservice/initsvcreasoncodes.H | 12 +- src/include/usr/initservice/taskargs.H | 21 ++++ src/makefile | 4 +- src/sys/vfs/vfs_main.C | 3 +- src/usr/initservice/baseinitsvc/initservice.C | 83 ++++++++++++-- src/usr/initservice/baseinitsvc/initservice.H | 97 +++++----------- .../initservice/baseinitsvc/initservicetaskentry.C | 1 - src/usr/initservice/common/initsvcstructs.H | 93 +++++++++++++++ src/usr/initservice/extinitsvc/extinitsvc.C | 2 + src/usr/initservice/extinitsvc/extinitsvc.H | 2 +- src/usr/initservice/extinitsvc/extinitsvctasks.H | 13 +++ .../initservice/istepdispatcher/istepdispatcher.C | 123 ++++++++++++++++++++ .../initservice/istepdispatcher/istepdispatcher.H | 125 +++++++++++++++++++++ src/usr/initservice/istepdispatcher/isteplist.H | 57 ++++++++++ src/usr/initservice/istepdispatcher/makefile | 8 ++ src/usr/initservice/makefile | 2 +- src/usr/initservice/taskargs/taskargs.C | 2 +- src/usr/isteps/istep1.C | 51 +++++++++ src/usr/isteps/isteps.H | 20 ++++ src/usr/isteps/makefile | 8 ++ src/usr/makefile | 5 +- 21 files changed, 645 insertions(+), 87 deletions(-) create mode 100644 src/usr/initservice/common/initsvcstructs.H create mode 100644 src/usr/initservice/istepdispatcher/istepdispatcher.C create mode 100644 src/usr/initservice/istepdispatcher/istepdispatcher.H create mode 100644 src/usr/initservice/istepdispatcher/isteplist.H create mode 100644 src/usr/initservice/istepdispatcher/makefile create mode 100644 src/usr/isteps/istep1.C create mode 100644 src/usr/isteps/isteps.H create mode 100644 src/usr/isteps/makefile diff --git a/src/include/usr/initservice/initsvcreasoncodes.H b/src/include/usr/initservice/initsvcreasoncodes.H index 029276829..83d1c9f28 100644 --- a/src/include/usr/initservice/initsvcreasoncodes.H +++ b/src/include/usr/initservice/initsvcreasoncodes.H @@ -46,6 +46,12 @@ enum InitServiceModuleID DISABLE_WATCHDOG_ERRL_ID, EXECUTE_ISTEPS_ERRL_ID, + ISTEP_1_ERRL_ID, + ISTEP_2_ERRL_ID, + ISTEP_3_ERRL_ID, + ISTEP_4_ERRL_ID, + ISTEP_5_ERRL_ID, + // reserve some tasks for my unit tests... START_CXXTEST_ERRL_ID = 0xf0, INIT_SVC_TEST1_ERRL_ID, @@ -59,8 +65,10 @@ enum InitServiceModuleID enum InitServiceReasonCode { - START_TASK_FAILED = INITSVC_COMP_ID | 0x01, - INVALID_TASK_TYPE = INITSVC_COMP_ID | 0x02, + START_TASK_FAILED = INITSVC_COMP_ID | 0x01, + INVALID_TASK_TYPE = INITSVC_COMP_ID | 0x02, + START_FN_FAILED = INITSVC_COMP_ID | 0x03, + NULL_FN_PTR = INITSVC_COMP_ID | 0x04, }; diff --git a/src/include/usr/initservice/taskargs.H b/src/include/usr/initservice/taskargs.H index 5c8a908d8..17e5cbce3 100644 --- a/src/include/usr/initservice/taskargs.H +++ b/src/include/usr/initservice/taskargs.H @@ -14,6 +14,27 @@ #include #include +/** + * @note macro to set up a _start() task entry routine. + */ +#define TASK_ENTRY_MACRO( MyInitFn ) \ +extern "C" \ +void _start( void *io_pArgs ) \ +{ \ + INITSERVICE::TaskArgs::TaskArgs *pTaskArgs = \ + reinterpret_cast(io_pArgs); \ + \ + MyInitFn( pTaskArgs ); \ + \ + if ( pTaskArgs ) \ + { \ + pTaskArgs->waitChildSync(); \ + } \ + \ + task_end(); \ +} + + namespace INITSERVICE { diff --git a/src/makefile b/src/makefile index e4e8e4660..9404aad71 100644 --- a/src/makefile +++ b/src/makefile @@ -17,8 +17,8 @@ DIRECT_BOOT_OBJECTS = start.o kernel.o taskmgr.o cpumgr.o syscall.o \ RUNTIME_OBJECTS = BASE_MODULES = trace errl devicefw scom xscom initservice taskargs -EXTENDED_MODULES = targeting ecmddatabuffer hwpf fapi hwp plat extinitsvc - +EXTENDED_MODULES = targeting ecmddatabuffer hwpf fapi hwp plat \ + extinitsvc istepdisp isteps DIRECT_BOOT_MODULES = example RUNTIME_MODULES = TESTCASE_MODULES = cxxtest testerrl testdevicefw testsyslib \ diff --git a/src/sys/vfs/vfs_main.C b/src/sys/vfs/vfs_main.C index 322768fc9..36d6ddcff 100644 --- a/src/sys/vfs/vfs_main.C +++ b/src/sys/vfs/vfs_main.C @@ -91,7 +91,8 @@ void vfs_main(void* unused) if ( module->start == NULL) { // module has no _start() routine, - // return child = -1 + // return child = -2 + child = -2; break; } child = task_create(module->start, diff --git a/src/usr/initservice/baseinitsvc/initservice.C b/src/usr/initservice/baseinitsvc/initservice.C index 0c3617023..de96ea922 100644 --- a/src/usr/initservice/baseinitsvc/initservice.C +++ b/src/usr/initservice/baseinitsvc/initservice.C @@ -65,14 +65,9 @@ errlHndl_t InitService::startTask( const TaskInfo *i_ptask, assert(i_ptask->taskflags.task_type == START_TASK); tidrc = task_exec( i_ptask->taskname, io_pargs ); // launch the child - - if ( io_pargs ) - { - io_pargs->waitParentSync(); // sync up childtask - } - if ( static_cast(tidrc) < 0 ) { + // task failed to launch, post an errorlog and dump some trace io_rerrl = new ERRORLOG::ErrlEntry( ERRORLOG::ERRL_SEV_CRITICAL_SYS_TERM, // severity i_ptask->taskflags.module_id, // moduleid @@ -91,6 +86,7 @@ errlHndl_t InitService::startTask( const TaskInfo *i_ptask, } // endif tidrc else { + // task launched OK. TRACDBIN( g_trac_initsvc, "Task finished OK :", i_ptask->taskname, @@ -98,12 +94,85 @@ errlHndl_t InitService::startTask( const TaskInfo *i_ptask, TRACDCOMP( g_trac_initsvc, "task number %d, errlog p = %p", tidrc, io_rerrl ); - } + + if ( io_pargs ) + { + io_pargs->waitParentSync(); // sync up childtask + } + + } return io_rerrl; } +errlHndl_t InitService::executeFn( const TaskInfo *i_ptask, + TaskArgs *io_pargs +) const +{ + tid_t tidrc = 0; + errlHndl_t errl = NULL; + + if ( i_ptask->taskfn == NULL ) + { + TRACDBIN( g_trac_initsvc, + "ERROR: NULL function pointer:", + i_ptask->taskname, + strlen(i_ptask->taskname) ); + + errl = new ERRORLOG::ErrlEntry( + ERRORLOG::ERRL_SEV_CRITICAL_SYS_TERM, // severity + i_ptask->taskflags.module_id, // moduleid + INITSERVICE::NULL_FN_PTR, // reason Code + 0, + 0 ); + + return errl; + } + + + // valid function, launch it + tidrc = task_create( i_ptask->taskfn, io_pargs ); + if ( static_cast(tidrc) < 0 ) + { + errl = new ERRORLOG::ErrlEntry( + ERRORLOG::ERRL_SEV_CRITICAL_SYS_TERM, // severity + i_ptask->taskflags.module_id, // moduleid + INITSERVICE::START_FN_FAILED, // reason Code + tidrc, // user1 = tidrc + 0 ); + + TRACDBIN( g_trac_initsvc, + ENTER_MRK "ERROR starting function:", + i_ptask->taskname, + strlen(i_ptask->taskname) ); + TRACDCOMP( g_trac_initsvc, + EXIT_MRK "tidrc=%d, errlog p = %p" , + (int16_t)tidrc, errl ); + + } // endif tidrc + else + { + TRACDBIN( g_trac_initsvc, + ENTER_MRK "function launched OK :", + i_ptask->taskname, + strlen(i_ptask->taskname) ); + TRACDCOMP( g_trac_initsvc, + EXIT_MRK "task number %d, errlog p = %p", + tidrc, errl ); + + // task launched OK. + if ( io_pargs ) + { + io_pargs->waitParentSync(); // sync up parent task + } + } + + return errl; + +} + + void InitService::reportError(errlHndl_t &io_rerrl ) const { diff --git a/src/usr/initservice/baseinitsvc/initservice.H b/src/usr/initservice/baseinitsvc/initservice.H index dd0a7df32..db16ede89 100644 --- a/src/usr/initservice/baseinitsvc/initservice.H +++ b/src/usr/initservice/baseinitsvc/initservice.H @@ -26,10 +26,11 @@ #include // VFS_MODULE_NAME_MAX #include -#include #include #include +#include +#include "../common/initsvcstructs.H" namespace INITSERVICE { @@ -38,77 +39,10 @@ namespace INITSERVICE // Globals/Constants /******************************************************************************/ - /******************************************************************************/ // Typedef/Enumerations /******************************************************************************/ -/** - * @enum TaskType - * - NONE == placeholder, no task - * - START_TASK == task with _start() function entry point - * - START_FN == task with function pointer entry point - * - BARRIER == set barrier for next N tasks. - * - STOP_TASK == Execute the destructor on the task in extended image. - * ( not implemented yet) - * - END_TASK_LIST == last entry in the task list. - */ -enum TaskType -{ - UNDEFINED_TT = 0, - NONE, - START_TASK, - START_FN, - BARRIER, - STOP_TASK, - END_TASK_LIST, -}; -/** - * @enum ModuleType - * - BASE_IMAGE == module in the base image - * - EXT_IMAGE == module in the extended image - */ -enum ModuleType -{ - UNDEFINED_MT = 0, - BASE_IMAGE, - EXT_IMAGE, -}; - - -/** - * @struct TaskFlags - * - * - run _start() function on start - * - module type, BASE_MODULE or EXT_MODULE - * - module_id for errorlog if task fails - * - * @todo revisit these flags in sprint3 - */ -struct TaskFlags -{ - TaskType task_type; // this is a task, run _start() function - ModuleType module_type; // BASE_IMAGE or EXT_IMAGE - InitServiceModuleID module_id; // module id for errorlog -}; - -/** - * @struct _TaskInfo - * - * Holds information on each task in the system. - * - taskname - * - execution flags, see TaskFlags above - * - */ -struct TaskInfo -{ - const char taskname[VFS_MODULE_NAME_MAX]; - void (*taskfn)(void *ptr); - const TaskFlags taskflags; - -}; - - /******************************************************************************/ // InitService Class /******************************************************************************/ @@ -156,7 +90,17 @@ public: // $$protected: /** - * @brief start a task + * @brief start a task using the taskname string in the TaskInfo struct. + * taskname string will be something like "libtargeting.so", which + * is the name of the compiled and linked targetting module. + * The module is expected to have implemented a extern "C" + * function called "void _start(void *args)" which is considered + * to be the "task entry point". When _start is called, its + * parameter will be set to point to a TaskArgs struct which + * can be used to pass information back and forth. See the + * comments in TaskArgs.H for more info. + * See initsvctasks.H and the unit tests for some examples of + * how this is used. * * @param[in] i_ptask pointer to a TaskInfo struct * @param[in] io_pargs pointer to a TaskArgs struct, or NULL @@ -171,6 +115,21 @@ public: TaskArgs::TaskArgs *i_pargs, errlHndl_t &io_rerrl ) const; + /** + * @brief executeFn + * Execute an function + * + * @param[in] i_ptask - pointer to an TaskInfo struct + * @param[in,out] i_pargs - pointer to a TaskArgs struct + * + * @return errlHndl_t handle, NULL if success, filled out errorlog + * if failure + */ + errlHndl_t executeFn( const TaskInfo *i_ptask, + TaskArgs *i_pargs + ) const; + + /** * @brief report Error to the system. diff --git a/src/usr/initservice/baseinitsvc/initservicetaskentry.C b/src/usr/initservice/baseinitsvc/initservicetaskentry.C index 62d531c07..b27ca6a44 100644 --- a/src/usr/initservice/baseinitsvc/initservicetaskentry.C +++ b/src/usr/initservice/baseinitsvc/initservicetaskentry.C @@ -33,7 +33,6 @@ void _start(void *ptr) TRACFCOMP( g_trac_initsvc, ENTER_MRK "Executing Initialization Service module." ); - // create an instance of InitService //InitService::InitService& is = InitService::getTheInstance(); diff --git a/src/usr/initservice/common/initsvcstructs.H b/src/usr/initservice/common/initsvcstructs.H new file mode 100644 index 000000000..38c02612f --- /dev/null +++ b/src/usr/initservice/common/initsvcstructs.H @@ -0,0 +1,93 @@ +#ifndef __COMMON_INITSVCSTRUCTS_H +#define __COMMON_INITSVCSTRUCTS_H +/** + * @file initsvcstructs.H + * + * common structs for initservice, extinitsvc, istepdispatcher + */ + +/******************************************************************************/ +// Includes +/******************************************************************************/ +#include + +namespace INITSERVICE +{ + +/******************************************************************************/ +// Globals/Constants +/******************************************************************************/ + + +/******************************************************************************/ +// Typedef/Enumerations +/******************************************************************************/ + +/** + * @enum TaskType + * - NONE == placeholder, no task + * - START_TASK == task with _start() function entry point + * - START_FN == task with function pointer entry point + * - BARRIER == set barrier for next N tasks. + * - STOP_TASK == Execute the destructor on the task in extended image. + * ( not implemented yet) + * - END_TASK_LIST == last entry in the task list. + */ +enum TaskType +{ + UNDEFINED_TT = 0, + NONE, + START_TASK, + START_FN, + BARRIER, + STOP_TASK, + END_TASK_LIST, +}; +/** + * @enum ModuleType + * - BASE_IMAGE == module in the base image + * - EXT_IMAGE == module in the extended image + */ +enum ModuleType +{ + UNDEFINED_MT = 0, + BASE_IMAGE, + EXT_IMAGE, +}; + + +/** + * @struct TaskFlags + * + * - run _start() function on start + * - module type, BASE_MODULE or EXT_MODULE + * - module_id for errorlog if task fails + * + * @todo revisit these flags in sprint3 + */ +struct TaskFlags +{ + TaskType task_type; // this is a task, run _start() function + ModuleType module_type; // BASE_IMAGE or EXT_IMAGE + InitServiceModuleID module_id; // module id for errorlog +}; + +/** + * @struct _TaskInfo + * + * Holds information on each task in the system. + * - taskname + * - execution flags, see TaskFlags above + * + */ +struct TaskInfo +{ + const char taskname[VFS_MODULE_NAME_MAX]; + void (*taskfn)(void *ptr); + const TaskFlags taskflags; + +}; + +} // namespace + +#endif diff --git a/src/usr/initservice/extinitsvc/extinitsvc.C b/src/usr/initservice/extinitsvc/extinitsvc.C index d1df2427e..3d9ab6441 100644 --- a/src/usr/initservice/extinitsvc/extinitsvc.C +++ b/src/usr/initservice/extinitsvc/extinitsvc.C @@ -13,6 +13,7 @@ #include #include +#include // task entry routine #include "extinitsvc.H" #include "extinitsvctasks.H" @@ -46,6 +47,7 @@ void _start( void *io_pArgs ) } + /******************************************************************************/ // ExtInitSvc::getTheInstance return the only instance /******************************************************************************/ diff --git a/src/usr/initservice/extinitsvc/extinitsvc.H b/src/usr/initservice/extinitsvc/extinitsvc.H index 8e7874fd2..aa4ef6bc6 100644 --- a/src/usr/initservice/extinitsvc/extinitsvc.H +++ b/src/usr/initservice/extinitsvc/extinitsvc.H @@ -37,7 +37,7 @@ namespace INITSERVICE /******************************************************************************/ -// InitService Class +// ExtInitSvc Class /******************************************************************************/ // Singleton definition diff --git a/src/usr/initservice/extinitsvc/extinitsvctasks.H b/src/usr/initservice/extinitsvc/extinitsvctasks.H index 347d29ffa..29a62e57d 100644 --- a/src/usr/initservice/extinitsvc/extinitsvctasks.H +++ b/src/usr/initservice/extinitsvc/extinitsvctasks.H @@ -32,6 +32,19 @@ const TaskInfo iv_exttaskinfolist[] = { } }, + /** + * @brief IStep Dispatcher task, runs ISteps + */ + { + "libistepdisp.so" , // taskname + NULL, // no pointer to fn + { + START_TASK, // task type + EXT_IMAGE, // Extended Module + EXECUTE_ISTEPS_ERRL_ID, // module id + } + }, + // --------------------------------------------------------------- // ----- END OF LIST!!! --------------------------------------- // --------------------------------------------------------------- diff --git a/src/usr/initservice/istepdispatcher/istepdispatcher.C b/src/usr/initservice/istepdispatcher/istepdispatcher.C new file mode 100644 index 000000000..cb3634c9b --- /dev/null +++ b/src/usr/initservice/istepdispatcher/istepdispatcher.C @@ -0,0 +1,123 @@ +/** + * @file istepdispatcher.C + * + * IStep Dispatcher interface. Launched from Extended Initialization Service + * + */ + + +/******************************************************************************/ +// Includes +/******************************************************************************/ +#include +#include +#include + +#include // tid_t, task_create, etc +#include // trace support +#include // errlHndl_t + +#include "istepdispatcher.H" +#include "isteplist.H" + +namespace INITSERVICE +{ + +/******************************************************************************/ +// Globals/Constants +/******************************************************************************/ +extern trace_desc_t *g_trac_initsvc; + +/** + * @brief set up _start() task entry procedure + * + */ +TASK_ENTRY_MACRO( IStepDispatcher::getTheInstance().init ); + + +IStepDispatcher::IStepDispatcher() +: + iv_istepmodeflag(false), + iv_nextistep( 0 ), + iv_cancontinueflag(false) +{ + +} + +IStepDispatcher::~IStepDispatcher() +{ + +} + + + +IStepDispatcher& IStepDispatcher::getTheInstance() +{ + return Singleton::instance(); +} + + +void IStepDispatcher::init( void * ptr ) +{ + errlHndl_t errl = NULL; + uint64_t nextIStep = 0; + const TaskInfo *pistep = NULL; + TaskArgs::TaskArgs args; + + TRACFCOMP( g_trac_initsvc, + ENTER_MRK "starting IStepDispatcher, ptr=%p. &args=%p", + ptr, &args ); + + for ( nextIStep=0; + nextISteptaskflags.task_type == END_TASK_LIST ) + { + TRACDCOMP( g_trac_initsvc, + "End of IStep list.\n" ); + break; + } + + + errl = executeFn( pistep, &args ); + + // report an error + reportError( errl ); + + /** + * @todo call getCanContinueProcedure when we have some ISteps that + * require them. + */ + + } // endfor + + + TRACFCOMP( g_trac_initsvc, + EXIT_MRK "IStepDispatcher finished."); + +} + +/** + * @note IStep Mode is hardwired to false for now + * + * @todo revisit this when PNOR Driver is implemented + */ +bool IStepDispatcher::getIStepMode( ) const +{ + + return false; +} + + + +bool IStepDispatcher::getCanContinueProcedure( TaskInfo &i_failingIStep, + errlHndl_t &i_failingError, + TaskInfo &io_nextIstep ) const +{ + + return false; +} + +} // namespace diff --git a/src/usr/initservice/istepdispatcher/istepdispatcher.H b/src/usr/initservice/istepdispatcher/istepdispatcher.H new file mode 100644 index 000000000..34e2dccf5 --- /dev/null +++ b/src/usr/initservice/istepdispatcher/istepdispatcher.H @@ -0,0 +1,125 @@ +#ifndef __ISTEP_DISPATCHER_H +#define __ISTEP_DISPATCHER_H +/** + * @file istepdispatcher.H + * + * IStep Dispatcher interface. Launched from Extended Initialization Service + * + */ + + +/******************************************************************************/ +// Includes +/******************************************************************************/ +#include +#include // VFS_MODULE_NAME_MAX + +#include +#include +#include + +#include "../baseinitsvc/initservice.H" +#include "../common/initsvcstructs.H" + + +namespace INITSERVICE +{ + + +/******************************************************************************/ +// Globals/Constants +/******************************************************************************/ + + +/******************************************************************************/ +// Typedef/Enumerations +/******************************************************************************/ + +/******************************************************************************/ +// Class +/******************************************************************************/ + +// Singleton definition +class IStepDispatcher; +typedef Singleton theIStepDispatcher; + + +/** + * @class IStepDispatcher Singleton Class + * + */ +class IStepDispatcher : public InitService +{ + +public: + + /** + * @brief Get singleton instance of this class. + * + * @return the (one and only) instance of IStepDispatcher + */ + static IStepDispatcher& getTheInstance(); + + + /** + * @brief Provide an entry function into the class, called from _start() + * + * @param[in] i_pargs pointer to any arguments passed in from + * _start(). + */ + void init( void *i_pargs); + +protected: + + /** + * @brief Constructor for the IStepDispatcher object. + */ + IStepDispatcher(); + + + /** + * @brief Destructor for the IStepDispatcher object. + */ + ~IStepDispatcher(); + +private: + + /** + * @brief getIStepMode + * call into PNOR and fetch the "IStepMode flag" . + * This will tell us if we are locked to the SP (IStepMode=ON) or + * can run all the ISteps available (IStepMode=OFF). + * + * @return false if IStep Mode is "OFF" + * true if IStep Mode is "ON" + */ + bool getIStepMode( ) const; + + + /** + * @brief getCanContinueProcedure + * If an IStep fails, this routine will fetch the recovery procedure + * + * @param[in] reference to IStepInfo struct for failing Istep + * @param[in] reference to errorlog for the failure + * @param[in,out] reference to IStepInfo struct for next IStep to run + * + * @return false if there is no Can-Continue procedure + * true otherwise + * + */ + bool getCanContinueProcedure( TaskInfo &i_failingIStep, + errlHndl_t &i_failingError, + TaskInfo &io_nextIstep ) const; + + + + bool iv_istepmodeflag; + uint64_t iv_nextistep; + bool iv_cancontinueflag; + +}; // class IStepDispatcher + +} // namespace ISTEPDISP + +#endif diff --git a/src/usr/initservice/istepdispatcher/isteplist.H b/src/usr/initservice/istepdispatcher/isteplist.H new file mode 100644 index 000000000..a72815a79 --- /dev/null +++ b/src/usr/initservice/istepdispatcher/isteplist.H @@ -0,0 +1,57 @@ +#ifndef __ISTEPS_H +#define __ISTEPS_H +/** + * @file extinitsvctasks.H + * + * TaskInfo structs for each task that will run in the extended image. + */ + +#include +#include "istepdispatcher.H" +#include "../../isteps/isteps.H" + +namespace INITSERVICE +{ + +const uint64_t MAX_ISTEPS = 25; + +const TaskInfo isteps[] = { + + // ----- ISteps Image ------------------------------------------ + + /** + * @brief targeting task, initializes extended module area + */ + { + "istep1" , // istep name + ISTEPS::IStep1, // pointer to fn + { + NONE, // task type + EXT_IMAGE, // Extended Module + ISTEP_1_ERRL_ID, // module id + } + }, + + // --------------------------------------------------------------- + // ----- END OF LIST!!! --------------------------------------- + // --------------------------------------------------------------- + + /** + * @brief last task in the list + */ + { + "end" , // dummy string + NULL, // pointer to fn + { + END_TASK_LIST, // end of list + UNDEFINED_MT, // dummy module type + UNDEFINED_MODULE_ERRL_ID, // dummy errorlog + } + }, + +}; + + +}; // namespace + +#endif // __EXT_INIT_SVC_TASKS_H diff --git a/src/usr/initservice/istepdispatcher/makefile b/src/usr/initservice/istepdispatcher/makefile new file mode 100644 index 000000000..6ccfbe797 --- /dev/null +++ b/src/usr/initservice/istepdispatcher/makefile @@ -0,0 +1,8 @@ +ROOTPATH = ../../../.. +MODULE = istepdisp + +OBJS = istepdispatcher.o + +## SUBDIRS = test.d + +include ${ROOTPATH}/config.mk diff --git a/src/usr/initservice/makefile b/src/usr/initservice/makefile index 3c57f7178..4b7333dec 100644 --- a/src/usr/initservice/makefile +++ b/src/usr/initservice/makefile @@ -5,7 +5,7 @@ ROOTPATH = ../../.. # NOTE: initsvcunittesttask2 is a dummy module that is executed by # unit test 2 in the test directory. Please do not rename. -SUBDIRS = baseinitsvc.d extinitsvc.d taskargs.d \ +SUBDIRS = baseinitsvc.d extinitsvc.d taskargs.d istepdispatcher.d \ test.d initsvcunittesttask2.d include ${ROOTPATH}/config.mk diff --git a/src/usr/initservice/taskargs/taskargs.C b/src/usr/initservice/taskargs/taskargs.C index bfb50056a..26eb21804 100644 --- a/src/usr/initservice/taskargs/taskargs.C +++ b/src/usr/initservice/taskargs/taskargs.C @@ -108,4 +108,4 @@ TaskArgs::~TaskArgs() barrier_destroy( &iv_sync_barrier ); } -}; // namespace TASKARGS +}; // namespace diff --git a/src/usr/isteps/istep1.C b/src/usr/isteps/istep1.C new file mode 100644 index 000000000..1a28f10e1 --- /dev/null +++ b/src/usr/isteps/istep1.C @@ -0,0 +1,51 @@ +/** + * @file isteps.C + * + * Collection of IStep modules + * + */ + + +/******************************************************************************/ +// Includes +/******************************************************************************/ +#include +#include +#include + +#include + +#include // trace support +#include // errlHndl_t +#include // task args + +namespace ISTEPS +{ + +/******************************************************************************/ +// Globals/Constants +/******************************************************************************/ +trace_desc_t *g_trac_istep1 = NULL; +TRAC_INIT(&g_trac_istep1, "ISTEP1", 4096); + +extern "C" +void IStep1( void * io_pArgs ) +{ + INITSERVICE::TaskArgs::TaskArgs *pTaskArgs = + reinterpret_cast(io_pArgs); + + TRACFCOMP( g_trac_istep1, + ENTER_MRK "starting IStep 1"); + + + + if ( pTaskArgs ) + { + pTaskArgs->waitChildSync(); + } + + task_end(); +} + + +} // namespace diff --git a/src/usr/isteps/isteps.H b/src/usr/isteps/isteps.H new file mode 100644 index 000000000..fedcd8f88 --- /dev/null +++ b/src/usr/isteps/isteps.H @@ -0,0 +1,20 @@ +/** + * @file isteps.H + * + * Prototypes of ISteps launched by IStepDispatcher + * + */ + + +/******************************************************************************/ +// Includes +/******************************************************************************/ +#include + +namespace ISTEPS +{ + +extern "C" +void IStep1( void * io_pArgs ); + +} // namespace diff --git a/src/usr/isteps/makefile b/src/usr/isteps/makefile new file mode 100644 index 000000000..1e1580136 --- /dev/null +++ b/src/usr/isteps/makefile @@ -0,0 +1,8 @@ +ROOTPATH = ../../.. +MODULE = isteps + +OBJS = istep1.o + +# SUBDIRS = test + +include ${ROOTPATH}/config.mk diff --git a/src/usr/makefile b/src/usr/makefile index 3cf04b4ea..2056bfa28 100644 --- a/src/usr/makefile +++ b/src/usr/makefile @@ -2,7 +2,8 @@ ROOTPATH = ../.. OBJS = module_init.o -SUBDIRS = example.d trace.d cxxtest.d testcore.d errl.d devicefw.d \ - scom.d xscom.d targeting.d initservice.d hwpf.d ecmddatabuffer.d +SUBDIRS = example.d trace.d cxxtest.d testcore.d errl.d devicefw.d \ + scom.d xscom.d targeting.d initservice.d hwpf.d \ + ecmddatabuffer.d isteps.d include ${ROOTPATH}/config.mk -- cgit v1.2.1