diff options
author | Mark Wenning <wenning@us.ibm.com> | 2011-06-29 17:30:28 -0500 |
---|---|---|
committer | Mark W. Wenning <wenning@us.ibm.com> | 2011-07-14 15:38:11 -0500 |
commit | 5530b7609c0351deb5d707c5950a56309842a325 (patch) | |
tree | 2382ef9aa2e3cfebe33d6d1737647be7325a94e0 /src/include/usr/initservice | |
parent | 2583b46750d1e1c062763eff204baa1460e7ae90 (diff) | |
download | talos-hostboot-5530b7609c0351deb5d707c5950a56309842a325.tar.gz talos-hostboot-5530b7609c0351deb5d707c5950a56309842a325.zip |
InitService changes for LLDD 0.7
- implement task flags
- add barrier to unit tests
- startTask returns errlog handle
- factor taskargs.H
- add STRICT mode and fix results
- add tasktest2 to replace example.C
- add cxxtest as an explicit task at the end
- cleanup todo's
- post-review fixes
- merge problem
Change-Id: I073bd154a64013553c1863f9eb674cda2bf40a8d
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/187
Tested-by: Jenkins Server
Reviewed-by: MIKE J. JONES <mjjones@us.ibm.com>
Diffstat (limited to 'src/include/usr/initservice')
-rw-r--r-- | src/include/usr/initservice/initsvcreasoncodes.H | 62 | ||||
-rw-r--r-- | src/include/usr/initservice/taskargs.H | 145 |
2 files changed, 178 insertions, 29 deletions
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 |