diff options
Diffstat (limited to 'src/include/usr')
-rwxr-xr-x | src/include/usr/cxxtest/TestSuite.H | 33 | ||||
-rw-r--r-- | src/include/usr/initservice/initsvcreasoncodes.H | 62 | ||||
-rw-r--r-- | src/include/usr/initservice/taskargs.H | 145 |
3 files changed, 197 insertions, 43 deletions
diff --git a/src/include/usr/cxxtest/TestSuite.H b/src/include/usr/cxxtest/TestSuite.H index 937a29011..ff40ce06b 100755 --- a/src/include/usr/cxxtest/TestSuite.H +++ b/src/include/usr/cxxtest/TestSuite.H @@ -1,4 +1,8 @@ -// Imported from FSP tree - /src/test/cxxtest/cxxtest/ +/** @file TestSuite.H + * + * Imported from FSP tree - /src/test/cxxtest/cxxtest/ + */ + #ifndef __cxxtest__TestSuite_h__ #define __cxxtest__TestSuite_h__ @@ -10,17 +14,24 @@ #include <trace/interface.H> -extern trace_desc_t *g_trac_test; - -// -// class TestSuite is the base class for all test suites. -// To define a test suite, derive from this class and add -// member functions called void test*(); -// +extern trace_desc_t *g_trac_test; namespace CxxTest { +extern uint64_t g_TotalTests; +extern uint64_t g_TraceCalls; +extern uint64_t g_Warnings; +extern uint64_t g_FailedTests; + +/** + * @class TestSuite + * + * class TestSuite is the base class for all test suites. + * To define a test suite, derive from this class and add + * member functions called void test*(); + * + */ class TestSuite { public: @@ -39,12 +50,6 @@ void doFailAssert( const char *file, unsigned line, const char *expression, cons void reportTotalTests( const char *suitename, uint64_t numtests ); -// $$ these should be set up as readonly accessors -uint64_t getTotalTests(void); -uint64_t getFailedTests(void); -uint64_t getWarnings(void); -uint64_t getTraceCalls(void); - extern uint64_t g_ModulesCompleted; #define _TS_TRY diff --git a/src/include/usr/initservice/initsvcreasoncodes.H b/src/include/usr/initservice/initsvcreasoncodes.H index 41b11f43d..029276829 100644 --- a/src/include/usr/initservice/initsvcreasoncodes.H +++ b/src/include/usr/initservice/initsvcreasoncodes.H @@ -19,37 +19,40 @@ namespace INITSERVICE */ enum InitServiceModuleID { - START_TRACE_ID = 0x00, - START_ERRL_ID, - START_XSCOMDD_ID, - START_PNORDD_ID, - START_VFS_2_ID, - START_TARGETTING_ID, - GET_MASTER_CHIP_TARGET_ID, - START_MAILBOXDD_ID, - START_SP_COMM_ID, - ENABLE_STREAMING_TRACE_ID, - START_PROGRESS_CODES_ID, - START_FSIDD_ID, - SETUP_SLAVE_LINKS_ID, - START_FSISCOM_ID, - START_FSI_II2C_ID, - START_HWP_ID, - READ_MAX_CONFIG_FROM_PNOR_ID, - APPLY_PRESENCE_DETECT_ID, - APPLY_PARTIAL_BAD_ID, - APPLY_GARD_ID, - COLLECT_HW_IDEC_ID, - VERIFY_IDEC_ID, - DISABLE_WATCHDOG_ID, - EXECUTE_ISTEPS_ID, + UNDEFINED_MODULE_ERRL_ID = 0x00, + BASE_INITSVC_ERRL_ID, + START_TRACE_ERRL_ID, + START_ERRL_ERRL_ID, + START_XSCOMDD_ERRL_ID, + START_PNORDD_ERRL_ID, + START_EXTINITSVC_ERRL_ID, + START_TARGETING_ERRL_ID, + GET_MASTER_CHIP_TARGET_ERRL_ID, + START_MAILBOXDD_ERRL_ID, + START_SP_COMM_ERRL_ID, + ENABLE_STREAMING_TRACE_ERRL_ID, + START_PROGRESS_CODES_ERRL_ID, + START_FSIDD_ERRL_ID, + SETUP_SLAVE_LINKS_ERRL_ID, + START_FSISCOM_ERRL_ID, + START_FSI_II2C_ERRL_ID, + START_HWP_ERRL_ID, + READ_MAX_CONFIG_FROM_PNOR_ERRL_ID, + APPLY_PRESENCE_DETECT_ERRL_ID, + APPLY_PARTIAL_BAD_ERRL_ID, + APPLY_GARD_ERRL_ID, + COLLECT_HW_ERRL_IDEC_ERRL_ID, + VERIFY_ERRL_IDEC_ERRL_ID, + DISABLE_WATCHDOG_ERRL_ID, + EXECUTE_ISTEPS_ERRL_ID, // reserve some tasks for my unit tests... - INIT_SVC_TEST1_ID = 0xf0, - INIT_SVC_TEST2_ID, - INIT_SVC_TEST3_ID, - INIT_SVC_TEST4_ID, - INIT_SVC_TEST5_ID, + START_CXXTEST_ERRL_ID = 0xf0, + INIT_SVC_TEST1_ERRL_ID, + INIT_SVC_TEST2_ERRL_ID, + INIT_SVC_TEST3_ERRL_ID, + INIT_SVC_TEST4_ERRL_ID, + INIT_SVC_TEST5_ERRL_ID, }; @@ -57,6 +60,7 @@ enum InitServiceModuleID enum InitServiceReasonCode { START_TASK_FAILED = INITSVC_COMP_ID | 0x01, + INVALID_TASK_TYPE = INITSVC_COMP_ID | 0x02, }; diff --git a/src/include/usr/initservice/taskargs.H b/src/include/usr/initservice/taskargs.H new file mode 100644 index 000000000..5c8a908d8 --- /dev/null +++ b/src/include/usr/initservice/taskargs.H @@ -0,0 +1,145 @@ +#ifndef __TASKARGS_TASKARGS_H +#define __TASKARGS_TASKARGS_H + +/** + * @file taskargs.H + * + * common file to hold arguments passed onto tasks. + * + * will also hold macros, etc to manage arguments + + */ + +#include <assert.h> +#include <sys/sync.h> +#include <trace/interface.H> + +namespace INITSERVICE +{ + +/** + * @const TASKARGS_UNDEFINED64 + * iv_taskreturncode and iv_taskcommand are initialized to this value - + * if parent or child change them, it can be easily recognized + * + * + */ +const uint64_t TASKARGS_UNDEFINED64 = 0xbadc0ffee0ddf00d; + +/** + * @class TaskArgs + * + * passed into a task as a void* pointer + * contains: + * - barrier to wait on + * - data from parent (if used) + * - return code from child (if used) + * - pointer to errorlog handle + * + */ +class TaskArgs +{ + +public: + + /** + * @brief TaskArgs constructor + * + */ + TaskArgs(); + + + /** + * @brief TaskArgs destructor + */ + ~TaskArgs(); + + /** + * @brief waitParentSync() + * + * Wait for internal barrier associated with this args struct + * This should be called by the task that launches a child task. + * Currently there is no difference between parent and child + * but this may change. + * + */ + void waitParentSync(); + + + /** + * @brief waitChildSync() + * + * Wait for internal barrier associated with this args struct + * This should be called by the child task. + * Currently there is no difference between parent and child + * but this may change. + * + */ + void waitChildSync(); + + + /** + * @brief postReturnCode + * + * Child task can use this to post a return code to InitServices + * + * @param[in] i_returncode; + * + */ + void postReturnCode( const uint64_t &i_returncode ); + + + /** + * @brief getReturnCode + * + * Parent task can use this to get a return code from the child + * + * @return value of iv_taskreturncode; + * + */ + uint64_t getReturnCode( ) const; + + + /** + * @brief setCommand + * + * Parent can pass commands and info to the child using this function + * + * @param[in] i_command; + */ + void setCommand( const uint64_t &i_command ); + + + /** + * @brief getCommand + * + * Child can get commands from the parent using this function + * + *@return value of iv_taskcommand; + * + * @todo might overload this later if we need to pass structs, + * buffers, etc. + */ + uint64_t getCommand( ) const; + + +private: + + /** + * @note Disable copy constructor and assignment operator + */ + TaskArgs(const TaskArgs& i_right); + TaskArgs& operator=(const TaskArgs& i_right); + + + barrier_t iv_sync_barrier; + + uint64_t iv_taskreturncode; + uint64_t iv_taskcommand; + +}; + +}; // namespace TASKARGS + + +#endif |