diff options
Diffstat (limited to 'src/usr/initservice')
-rw-r--r-- | src/usr/initservice/baseinitsvc/initservice.C | 9 | ||||
-rw-r--r-- | src/usr/initservice/baseinitsvc/initservice.H | 6 | ||||
-rw-r--r-- | src/usr/initservice/extinitsvc/extinitsvc.C | 201 | ||||
-rw-r--r-- | src/usr/initservice/extinitsvc/extinitsvc.H | 11 | ||||
-rw-r--r-- | src/usr/initservice/extinitsvc/extinitsvctasks.H | 2 | ||||
-rw-r--r-- | src/usr/initservice/istepdispatcher/istep_mbox_msgs.H | 12 | ||||
-rw-r--r-- | src/usr/initservice/istepdispatcher/istepdispatcher.C | 21 | ||||
-rw-r--r-- | src/usr/initservice/istepdispatcher/istepdispatcher.H | 68 |
8 files changed, 205 insertions, 125 deletions
diff --git a/src/usr/initservice/baseinitsvc/initservice.C b/src/usr/initservice/baseinitsvc/initservice.C index 6c3b6179d..c5c802c9b 100644 --- a/src/usr/initservice/baseinitsvc/initservice.C +++ b/src/usr/initservice/baseinitsvc/initservice.C @@ -610,6 +610,15 @@ void InitService::registerBlock(void* i_vaddr, uint64_t i_size, } } +void doShutdown ( uint64_t i_status, + uint64_t i_payload_base, + uint64_t i_payload_entry ) +{ + Singleton<InitService>::instance().doShutdown( i_status, + i_payload_base, + i_payload_entry ); +} + void InitService::doShutdown(uint64_t i_status, uint64_t i_payload_base, uint64_t i_payload_entry) diff --git a/src/usr/initservice/baseinitsvc/initservice.H b/src/usr/initservice/baseinitsvc/initservice.H index 5a3820d36..1457dc48d 100644 --- a/src/usr/initservice/baseinitsvc/initservice.H +++ b/src/usr/initservice/baseinitsvc/initservice.H @@ -212,9 +212,9 @@ public: * @note This calls registered services to notify them of shutdown and it * flushes the virtual memory. */ - void doShutdown(uint64_t i_status, - uint64_t i_payload_base = 0, - uint64_t i_payload_entry = 0); + void doShutdown ( uint64_t i_status, + uint64_t i_payload_base = 0, + uint64_t i_payload_entry = 0 ); protected: diff --git a/src/usr/initservice/extinitsvc/extinitsvc.C b/src/usr/initservice/extinitsvc/extinitsvc.C index 0c42e9678..f90e97651 100644 --- a/src/usr/initservice/extinitsvc/extinitsvc.C +++ b/src/usr/initservice/extinitsvc/extinitsvc.C @@ -133,102 +133,6 @@ void ExtInitSvc::init( errlHndl_t &io_rtaskRetErrl ) task_end2( l_errl ); } - TRACFCOMP( g_trac_initsvc, - "ExtInitSvc finished OK."); - - - // ===================================================================== - // ----- Unit Tests ------------------------------------------------- - // ===================================================================== - /** - * @note run all of the unit tests after we finish the rest - * There are 2 images generated in the build: - * hbicore.bin (HostBoot shippable image) - * hbicore_test.bin (runs all unit tests) - * Only hbicore_test.bin has the libcxxtest.so module, so that's - * how we test whether to run this. - */ - - // If the test task does not exist then don't run it. - if ( VFS::module_exists( cxxTestTask.taskname ) ) - { - printk( "CxxTest entry.\n" ); - - // Pass it a set of args so we can wait on the barrier - errlHndl_t l_cxxerrl = NULL; - const TaskInfo *l_pcxxtask = &cxxTestTask; - - TRACDCOMP( g_trac_initsvc, - "Run CxxTest Unit Tests: %s", - l_pcxxtask->taskname ); - - l_cxxerrl = InitService::getTheInstance().startTask( l_pcxxtask, - NULL ); - // process any errorlogs from cxxtestexec (not sure there are any...) - if ( l_cxxerrl ) - { -#if 0 - // @todo detach this task and just do task_end() - // First commit the errorlog... - TRACFCOMP( g_trac_initsvc, - "Committing errorlog %p from cxxtask", - l_cxxerrl ); - errlCommit( l_cxxerrl, INITSVC_COMP_ID ); - - // Tell the kernel to shut down. This will not actually - // happen until the last thread has ended. - InitService::getTheInstance().doShutdown( SHUTDOWN_STATUS_UT_FAILED); - - // end the task. - end_task(); -#endif - - // end the task and pass the errorlog to initservice to be committed. - // initservice should do the shutdown. - TRACFCOMP( g_trac_initsvc, - "CxxTest: ERROR: return to initsvc with errlog %p", - l_cxxerrl ); - - task_end2( l_cxxerrl ); - } // endif l_cxxerrl - - - // make up and post an errorlog if any tests failed. - if ( CxxTest::g_FailedTests ) - { - // some unit tests failed, post an errorlog - /*@ errorlog tag - * @errortype ERRL_SEV_CRITICAL_SYS_TERM - * @moduleid CXXTEST_MOD_ID - * @reasoncode CXXTEST_FAILED_TEST - * @userdata1 number of failed tests - * @userdata2 0 - * - * @devdesc One or more CxxTest Unit Tests failed. - * - */ - l_cxxerrl = new ERRORLOG::ErrlEntry( - ERRORLOG::ERRL_SEV_CRITICAL_SYS_TERM, - INITSERVICE::CXXTEST_MOD_ID, - INITSERVICE::CXXTEST_FAILED_TEST, - CxxTest::g_FailedTests, - 0 ); - TRACFCOMP( g_trac_initsvc, - "CxxTest ERROR: %d failed tests, build errlog %p.", - CxxTest::g_FailedTests, - l_cxxerrl ); - - // end the task and pass the errorlog to initservice to be committed. - // initservice should do the shutdown. - TRACFCOMP( g_trac_initsvc, "CxxTest: return to initsvc with errlog" ); - - task_end2( l_cxxerrl ); - } // endif g_FailedTest - - printk( "CxxTest exit.\n" ); - - } // endif cxxtest module exists. - // finish things up, return to initservice with goodness. TRACFCOMP( g_trac_initsvc, "ExtInitSvc finished OK, return to initsvc with NULL."); @@ -253,4 +157,109 @@ ExtInitSvc::~ExtInitSvc() { } +// +// Execute CXX Unit Tests +// NOTE: This should be done right before doShutDown is called. +// +errlHndl_t executeUnitTests ( void ) +{ + return Singleton<ExtInitSvc>::instance().executeUnitTests(); +} + +errlHndl_t ExtInitSvc::executeUnitTests ( void ) +{ + errlHndl_t err = NULL; + + TRACDCOMP( ISTEPS_TRACE::g_trac_isteps_trace, + ENTER_MRK"executeUnitTests()" ); + + do + { + // --------------------------------------------------------------------- + // ----- Unit Tests ------------------------------------------------- + // --------------------------------------------------------------------- + /** + * @note run all of the unit tests after we finish the rest + * There are 2 images generated in the build: + * hbicore.bin (HostBoot shippable image) + * hbicore_test.bin (runs all unit tests) + * Only hbicore_test.bin has the libcxxtest.so module, so that's + * how we test whether to run this. + */ + // If the test task does not exist then don't run it. + if ( VFS::module_exists( cxxTestTask.taskname ) ) + { + printk( "CxxTest entry.\n" ); + + // Pass it a set of args so we can wait on the barrier + errlHndl_t l_cxxerrl = NULL; + const INITSERVICE::TaskInfo *l_pcxxtask = &cxxTestTask; + + TRACFCOMP( g_trac_initsvc, + "Run CxxTest Unit Tests: %s", + l_pcxxtask->taskname ); + + INITSERVICE::InitService &is + = INITSERVICE::InitService::getTheInstance(); + l_cxxerrl = is.startTask( l_pcxxtask, + NULL ); + + // process any errorlogs from cxxtestexec (not sure there are any...) + if ( l_cxxerrl ) + { + // end the task and pass the errorlog to initservice to be + // committed. initservice should do the shutdown. + TRACFCOMP( g_trac_initsvc, + "CxxTest: ERROR: return to host_start_payload istep " + "with errlog %p", + l_cxxerrl ); + + err = l_cxxerrl; + break; + } // endif l_cxxerrl + + + // make up and post an errorlog if any tests failed. + if ( CxxTest::g_FailedTests ) + { + // some unit tests failed, post an errorlog + /*@ errorlog tag + * @errortype ERRL_SEV_CRITICAL_SYS_TERM + * @moduleid CXXTEST_MOD_ID + * @reasoncode CXXTEST_FAILED_TEST + * @userdata1 number of failed tests + * @userdata2 <UNUSED> + * @devdesc One or more CxxTest Unit Tests failed. + */ + l_cxxerrl = new ERRORLOG::ErrlEntry( + ERRORLOG::ERRL_SEV_CRITICAL_SYS_TERM, + INITSERVICE::CXXTEST_MOD_ID, + INITSERVICE::CXXTEST_FAILED_TEST, + CxxTest::g_FailedTests, + 0 ); + + TRACFCOMP( g_trac_initsvc, + "CxxTest ERROR: %d failed tests, build errlog %p.", + CxxTest::g_FailedTests, + l_cxxerrl ); + + // end the task and pass the errorlog to initservice to be + // committed. initservice should do the shutdown. + TRACFCOMP( g_trac_initsvc, + "CxxTest: return to host_start_payload with errlog!" ); + + err = l_cxxerrl; + break; + } // endif g_FailedTest + + printk( "CxxTest exit.\n" ); + } // endif cxxtest module exists. + } while( 0 ); + + TRACDCOMP( g_trac_initsvc, + EXIT_MRK"executeUnitTests()" ); + + return err; +} + } // namespace diff --git a/src/usr/initservice/extinitsvc/extinitsvc.H b/src/usr/initservice/extinitsvc/extinitsvc.H index 7c6acec1b..f2643812a 100644 --- a/src/usr/initservice/extinitsvc/extinitsvc.H +++ b/src/usr/initservice/extinitsvc/extinitsvc.H @@ -91,6 +91,17 @@ public: void init( errlHndl_t &io_rtaskRetErrl ); + /** + * @brief This function will execute the Cxx Unit tests for Hostboot. It is + * to be done here, instead of in Initservice, because when this istep + * completes the Payload will be started. + * + * @return errlHndl_t - NULL if successfule, otherwise a pointer to the error + * log. + */ + errlHndl_t executeUnitTests ( void ); + + protected: /** * @brief Constructor for the InitService object. diff --git a/src/usr/initservice/extinitsvc/extinitsvctasks.H b/src/usr/initservice/extinitsvc/extinitsvctasks.H index 7b4da54c7..f9cbb9ff8 100644 --- a/src/usr/initservice/extinitsvc/extinitsvctasks.H +++ b/src/usr/initservice/extinitsvc/extinitsvctasks.H @@ -84,7 +84,7 @@ const TaskInfo g_exttaskinfolist[] = { "libmbox.so", // taskname NULL, // no ptr to fnct { - + START_TASK, // task type EXT_IMAGE, // Extended Module } diff --git a/src/usr/initservice/istepdispatcher/istep_mbox_msgs.H b/src/usr/initservice/istepdispatcher/istep_mbox_msgs.H index 6799db5fb..ae3ca45ff 100644 --- a/src/usr/initservice/istepdispatcher/istep_mbox_msgs.H +++ b/src/usr/initservice/istepdispatcher/istep_mbox_msgs.H @@ -37,6 +37,18 @@ namespace INITSERVICE enum { + // TODO - I'm not changing this file, but I would really like to put the + // SYNC_POINT_REACHED message here. Since its related to Isteps and + // syncing Hostboot and Fsp. But to do that, this needs to be in the + // src/include/usr side of things. + // + // Plus, I think its weird that this file uses definitions from + // splesscommon.H. It should be the other way around. Define them here + // and use them from splesscommon. Issue 42491 has been opened to + // discuss this further. + // + // I am going to define my own message in the code that I'm writing until + // we get something figured out. SINGLE_STEP_TYPE = MBOX::FIRST_SECURE_MSG | SPLESS::SPLESS_SINGLE_ISTEP_CMD, CLEAR_TRACE_TYPE = MBOX::FIRST_SECURE_MSG | diff --git a/src/usr/initservice/istepdispatcher/istepdispatcher.C b/src/usr/initservice/istepdispatcher/istepdispatcher.C index a628cc3b0..feb683968 100644 --- a/src/usr/initservice/istepdispatcher/istepdispatcher.C +++ b/src/usr/initservice/istepdispatcher/istepdispatcher.C @@ -5,7 +5,7 @@ * * IBM CONFIDENTIAL * - * COPYRIGHT International Business Machines Corp. 2011 - 2012 + * COPYRIGHT International Business Machines Corp. 2011-2012 * * p1 * @@ -807,6 +807,25 @@ void iStepBreakPoint(uint32_t i_info) } +void getIstepMsgQ ( msg_q_t & o_msgQ ) +{ + Singleton<IStepDispatcher>::instance().getIstepMsgQ( o_msgQ ); +} +void IStepDispatcher::getIstepMsgQ ( msg_q_t & o_msgQ ) +{ + o_msgQ = iv_msgQ; +} + +void getIstepMsg ( msg_t * o_msg ) +{ + Singleton<IStepDispatcher>::instance().getIstepMsg( o_msg ); +} +void IStepDispatcher::getIstepMsg ( msg_t * o_msg ) +{ + o_msg = iv_pMsg; +} + + IStepDispatcher::IStepDispatcher() : iv_sts() { diff --git a/src/usr/initservice/istepdispatcher/istepdispatcher.H b/src/usr/initservice/istepdispatcher/istepdispatcher.H index e05660bd9..c0e14a530 100644 --- a/src/usr/initservice/istepdispatcher/istepdispatcher.H +++ b/src/usr/initservice/istepdispatcher/istepdispatcher.H @@ -1,26 +1,26 @@ -// IBM_PROLOG_BEGIN_TAG -// This is an automatically generated prolog. -// -// $Source: src/usr/initservice/istepdispatcher/istepdispatcher.H $ -// -// IBM CONFIDENTIAL -// -// COPYRIGHT International Business Machines Corp. 2011 -// -// p1 -// -// Object Code Only (OCO) source materials -// Licensed Internal Code Source Materials -// IBM HostBoot Licensed Internal Code -// -// 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. -// -// Origin: 30 -// -// IBM_PROLOG_END - +/* IBM_PROLOG_BEGIN_TAG + * This is an automatically generated prolog. + * + * $Source: src/usr/initservice/istepdispatcher/istepdispatcher.H $ + * + * IBM CONFIDENTIAL + * + * COPYRIGHT International Business Machines Corp. 2011-2012 + * + * p1 + * + * Object Code Only (OCO) source materials + * Licensed Internal Code Source Materials + * IBM HostBoot Licensed Internal Code + * + * 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. + * + * Origin: 30 + * + * IBM_PROLOG_END_TAG + */ #ifndef __ISTEPDISPATCHER_ISTEPDISPATCHER_H #define __ISTEPDISPATCHER_ISTEPDISPATCHER_H /** @@ -133,6 +133,27 @@ public: */ void handleSPlessBreakPoint( uint32_t info); + /** + * @brief This function returns the MBOX Message Queue used by the istep + * dispatcher. + * + * @param[out] o_msgQ - The message queue. + * + * @return NONE. + */ + void getIstepMsgQ ( msg_q_t & o_msgQ ); + + /** + * @brief This function returns the current MBOX Message used by the istep + * dispatcher. + * + * @param[out] o_msg - The message. + * + * @return NONE. + */ + void getIstepMsg ( msg_t * o_msg ); + + protected: /** @@ -253,7 +274,6 @@ private: uint32_t &o_rSts ); - // ----- internal vars ----------------------------- mutex_t iv_poll_mutex; //!< protect who's polling istep cmds |