diff options
author | Stephen Cprek <smcprek@us.ibm.com> | 2013-08-22 14:49:22 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2013-09-13 14:10:50 -0500 |
commit | 5fddfa6e7b67e3ffe96e5b232646363a99edf1d1 (patch) | |
tree | 1605e84cf0a740708d1750b562ec24c8b8141d6d /src/usr/initservice/istepdispatcher/istepdispatcher.H | |
parent | 907bd272887a4223e233091172a6a6e5f29cb05a (diff) | |
download | talos-hostboot-5fddfa6e7b67e3ffe96e5b232646363a99edf1d1.tar.gz talos-hostboot-5fddfa6e7b67e3ffe96e5b232646363a99edf1d1.zip |
Added progress codes messages to be sent to FSP
Change-Id: I34b81310b2936481244afb3992f8f2a51aebea29
RTC: 34046
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/5887
Tested-by: Jenkins Server
Reviewed-by: Brian H. Horton <brianh@linux.ibm.com>
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/initservice/istepdispatcher/istepdispatcher.H')
-rw-r--r-- | src/usr/initservice/istepdispatcher/istepdispatcher.H | 46 |
1 files changed, 43 insertions, 3 deletions
diff --git a/src/usr/initservice/istepdispatcher/istepdispatcher.H b/src/usr/initservice/istepdispatcher/istepdispatcher.H index 2ad5eb8b5..1048b9c75 100644 --- a/src/usr/initservice/istepdispatcher/istepdispatcher.H +++ b/src/usr/initservice/istepdispatcher/istepdispatcher.H @@ -40,6 +40,7 @@ // Includes /******************************************************************************/ #include <stdint.h> +#include <time.h> #include <util/singleton.H> #include <sys/msg.h> #include <sys/sync.h> @@ -58,6 +59,12 @@ namespace INITSERVICE // Globals/Constants /******************************************************************************/ +/** + * @brief the maximum time (seconds) runProgressThread() waits to send the next + * progress code (FSP requires a message every 15 sec). Picking 10 sec + * is a good choice because it is sufficiently less than 15. + */ +const uint64_t MAX_WAIT_TIME_SEC = 10; /******************************************************************************/ // Typedef/Enumerations @@ -83,7 +90,6 @@ enum IStepSync_t ISTEP_ASYNC, }; - /******************************************************************************/ // Class IStepDispatcher /******************************************************************************/ @@ -193,7 +199,15 @@ public: */ bool getIStepMode( ) const; - + /** + * @brief This function sends a progress message if an istep/substep takes + * longer than MAX_WAIT_TIME_SEC. This function never returns and + * should only be called on a new thread by the startProgressThread + * function + * + * @return NONE. + */ + void runProgressThread ( void ); protected: @@ -303,12 +317,33 @@ private: */ bool checkMpiplMode ( void ) const; + /** + * @brief This function is used to send a progress message from Hostboot + * to Fsp. + * + * param[in] - flag to acquire mutex or not + * + * @return errlHndl_t - NULL if successful, otherwise a pointer to the + * error log. + */ + errlHndl_t sendProgressCode ( bool i_needsLock = true ); + + /** + * @brief This function spawns a thread for runProgressThread to run on + * + * param[in,out] - pointer to any args + * + * @return NONE + */ + static void * startProgressThread ( void * p); // ----- internal vars ----------------------------- mutex_t iv_bkPtMutex; mutex_t iv_syncMutex; - mutex_t iv_stepMutex; + mutex_t iv_mutex; //used to synchronize access to all instance + //variables except iv_sync which is handled by + //iv_syncMutex/iv_syncHit sync_cond_t iv_syncHit; uint8_t iv_curIStep; uint8_t iv_curSubStep; @@ -317,6 +352,11 @@ private: msg_q_t iv_msgQ; msg_t* iv_workerMsg; // More work Needed Msg from Worker msg_t* iv_Msg; // All other Msgs that need to be saved + bool iv_progressThreadStarted; + + //For progress code messages + timespec_t iv_lastProgressMsgTime; + }; // class IStepDispatcher |