summaryrefslogtreecommitdiffstats
path: root/src/usr
diff options
context:
space:
mode:
authorDoug Gilbert <dgilbert@us.ibm.com>2011-08-25 10:53:14 -0500
committerDouglas R. Gilbert <dgilbert@us.ibm.com>2011-09-07 10:37:16 -0500
commit6dd3a0514d3754d607be5689bf07a04d3cc8f483 (patch)
tree90428972c1acc0c6b470b83e84b2ece5780a6ad3 /src/usr
parentdd8d92217c8cebd6aa5408ad7fd4fa50ea248c84 (diff)
downloadtalos-hostboot-6dd3a0514d3754d607be5689bf07a04d3cc8f483.tar.gz
talos-hostboot-6dd3a0514d3754d607be5689bf07a04d3cc8f483.zip
Move libs to the extended image
Change-Id: I275a3a4b897e6426164e4f3bd642f92b0d3fed07 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/285 Tested-by: Jenkins Server Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: Douglas R. Gilbert <dgilbert@us.ibm.com>
Diffstat (limited to 'src/usr')
-rw-r--r--src/usr/cxxtest/cxxtestexec.C70
-rw-r--r--src/usr/initservice/baseinitsvc/initservice.C7
-rw-r--r--src/usr/initservice/baseinitsvc/initsvctasks.H2
-rw-r--r--src/usr/initservice/extinitsvc/extinitsvc.C3
-rw-r--r--src/usr/initservice/extinitsvc/extinitsvctasks.H102
-rw-r--r--src/usr/pnor/fakeext/fakeext.C65
-rw-r--r--src/usr/pnor/fakeext/makefile28
-rw-r--r--src/usr/pnor/makefile2
-rw-r--r--src/usr/vfs/vfsrp.C76
-rw-r--r--src/usr/vfs/vfsrp.H13
10 files changed, 192 insertions, 176 deletions
diff --git a/src/usr/cxxtest/cxxtestexec.C b/src/usr/cxxtest/cxxtestexec.C
index 4e5e1473c..c33e32fca 100644
--- a/src/usr/cxxtest/cxxtestexec.C
+++ b/src/usr/cxxtest/cxxtestexec.C
@@ -21,7 +21,7 @@
//
// IBM_PROLOG_END
-#include <sys/vfs.h>
+#include <vfs/vfs.H>
#include <sys/task.h>
#include <string.h>
#include <kernel/console.H>
@@ -33,8 +33,8 @@
namespace CxxTest
{
- uint64_t g_ModulesStarted = 0;
- uint64_t g_ModulesCompleted = 0;
+ extern uint64_t g_ModulesStarted;
+ extern uint64_t g_ModulesCompleted;
/**
* @var g_CxxTestBarrier - barrier for CxxTest modules.
@@ -62,11 +62,8 @@ TRAC_INIT(&g_trac_cxxtest, "CXXTEST", 1024 );
extern "C"
void _start(void *io_pArgs)
{
- // TODO These modules will eventually all be in the extended binary.
- // VfsSystemModule* vfsItr = (VfsSystemModule*) VFS_EXTENDED_MODULE_TABLE_ADDRESS;
- VfsSystemModule* vfsItr = &VFS_MODULES[0];
+ std::vector<const char *> module_list;
tid_t tidrc = 0;
- uint64_t totalmodules = 0;
TaskArgs::TaskArgs *pTaskArgs =
reinterpret_cast<TaskArgs::TaskArgs *>(io_pArgs);
@@ -74,61 +71,32 @@ void _start(void *io_pArgs)
// count up the number of viable modules ahead of time
TRACDCOMP( g_trac_cxxtest, "Counting CxxTextExec modules:" );
- while(vfsItr->module[0] != '\0')
- {
- if (0 == memcmp(vfsItr->module, "libtest", 7))
- {
- if (NULL != vfsItr->start)
- {
- TRACDBIN( g_trac_cxxtest,
- "",
- &(vfsItr->module[0]),
- strlen( &(vfsItr->module[0]) )
- );
-
- totalmodules++;
- }
- }
- vfsItr++;
- }
+ VFS::find_test_modules(module_list);
+
+ uint64_t totalmodules = module_list.size();
+
// start executing the CxxTest modules
TRACDCOMP( g_trac_cxxtest, ENTER_MRK "Execute CxxTestExec, totalmodules=%d.",
totalmodules);
- vfsItr = &VFS_MODULES[0]; // re-init
// set barrier for all the modules being started, plus this module
barrier_init( &CxxTest::g_CxxTestBarrier, totalmodules+1 );
__sync_add_and_fetch(&CxxTest::g_ModulesStarted, 1);
- while(vfsItr->module[0] != '\0')
+ for(std::vector<const char *>::const_iterator i = module_list.begin();
+ i != module_list.end(); ++i)
{
- if (0 == memcmp(vfsItr->module, "libtest", 7))
- {
- if (NULL != vfsItr->start)
- {
- __sync_add_and_fetch(&CxxTest::g_ModulesStarted, 1);
-
-#if 0
- // arrgh, no %s in trace
- TRACDCOMP( g_trac_cxxtest,
- "Running %s, ModulesStarted=%d",
- __LINE__,
- vfsItr->module,
- CxxTest::g_ModulesStarted );
-#else
- TRACDCOMP( g_trac_cxxtest,
- "ModulesStarted=%d",
- CxxTest::g_ModulesStarted );
-#endif
- tidrc = task_exec( vfsItr->module, NULL );
- TRACDCOMP( g_trac_cxxtest, "Launched task: tidrc=%d",
- tidrc );
-
- }
- }
- vfsItr++;
+ __sync_add_and_fetch(&CxxTest::g_ModulesStarted, 1);
+
+ TRACDCOMP( g_trac_cxxtest,
+ "ModulesStarted=%d",
+ CxxTest::g_ModulesStarted );
+
+ tidrc = task_exec( *i, NULL );
+ TRACDCOMP( g_trac_cxxtest, "Launched task: tidrc=%d",
+ tidrc );
}
TRACDCOMP( g_trac_cxxtest, "Waiting for all tasks to finish....");
diff --git a/src/usr/initservice/baseinitsvc/initservice.C b/src/usr/initservice/baseinitsvc/initservice.C
index 38458f12f..4579358a9 100644
--- a/src/usr/initservice/baseinitsvc/initservice.C
+++ b/src/usr/initservice/baseinitsvc/initservice.C
@@ -209,6 +209,13 @@ errlHndl_t InitService::dispatchTask( const TaskInfo *i_ptask,
l_errl = startTask( i_ptask,
io_pargs );
break;
+ case INIT_TASK:
+ TRACDCOMP( g_trac_initsvc,
+ "task_type==INIT_TASK: %s",
+ i_ptask->taskname);
+
+ l_errl = VFS::module_load( i_ptask->taskname );
+ break;
case START_FN:
TRACDCOMP( g_trac_initsvc,
"task_type==START_FN : %s %p",
diff --git a/src/usr/initservice/baseinitsvc/initsvctasks.H b/src/usr/initservice/baseinitsvc/initsvctasks.H
index 7897a6c42..6fa02022b 100644
--- a/src/usr/initservice/baseinitsvc/initsvctasks.H
+++ b/src/usr/initservice/baseinitsvc/initsvctasks.H
@@ -91,7 +91,7 @@ const TaskInfo g_taskinfolist[] = {
NULL, // no pointer to fn
{
START_TASK, // call start()
- BASE_IMAGE, // TODO EXT_IMAGE
+ EXT_IMAGE, // EXT_IMAGE
START_EXTINITSVC_ERRL_ID, // module id for errorlog
}
},
diff --git a/src/usr/initservice/extinitsvc/extinitsvc.C b/src/usr/initservice/extinitsvc/extinitsvc.C
index b5ab6b64e..03bae9364 100644
--- a/src/usr/initservice/extinitsvc/extinitsvc.C
+++ b/src/usr/initservice/extinitsvc/extinitsvc.C
@@ -204,6 +204,9 @@ void ExtInitSvc::init( void *i_ptr )
ENTER_MRK "Run Unit Tests (if libcxxtests.so is present): %s",
l_pcxxtask->taskname );
+ // If the test task does not exist then don't run it.
+ if(!VFS::module_exists(l_pcxxtask->taskname)) break;
+
l_cxxerrl = InitService::getTheInstance().startTask( l_pcxxtask,
&l_cxxtestargs );
diff --git a/src/usr/initservice/extinitsvc/extinitsvctasks.H b/src/usr/initservice/extinitsvc/extinitsvctasks.H
index 351b7d1d1..859e3caee 100644
--- a/src/usr/initservice/extinitsvc/extinitsvctasks.H
+++ b/src/usr/initservice/extinitsvc/extinitsvctasks.H
@@ -36,8 +36,6 @@
namespace INITSERVICE
{
- // TODO all these will eventuall be in BASE_IMAGE instead of BASE_IMAGE
-
const uint64_t MAX_EXT_TASKS = 25;
const TaskInfo g_exttaskinfolist[] = {
@@ -45,31 +43,97 @@ const TaskInfo g_exttaskinfolist[] = {
// ----- Extended Image ------------------------------------------
/**
- * @brief targeting task, initializes extended module area
+ * @brief ecmddatabuffer task,
*/
{
- "libtargeting.so" , // taskname
+ "libecmddatabuffer.so" , // taskname
NULL, // no pointer to fn
{
- START_TASK, // task type
- BASE_IMAGE, // Extended Module
- START_TARGETING_ERRL_ID, // module id
+ INIT_TASK, // task type
+ EXT_IMAGE, // Extended Module
+ START_ECMDDATABUFFER_ERRL_ID, // module id
+ }
+ },
+
+ /**
+ * @brief hwpf task,
+ */
+ {
+ "libhwpf.so" , // taskname
+ NULL, // no pointer to fn
+ {
+ INIT_TASK, // task type
+ EXT_IMAGE, // Extended Module
+ START_HWPF_ERRL_ID, // module id
}
},
/**
- * @brief IStep Dispatcher task, runs ISteps
- */
- {
- "libistepdisp.so" , // taskname
- NULL, // no pointer to fn
- {
- START_TASK, // task type
- BASE_IMAGE, // Extended Module
- EXECUTE_ISTEPS_ERRL_ID, // module id
- }
- },
+ * @brief fabi task,
+ */
+ {
+ "libfapi.so" , // taskname
+ NULL, // no pointer to fn
+ {
+ INIT_TASK, // task type
+ EXT_IMAGE, // Extended Module
+ START_FAPI_ERRL_ID, // module id
+ }
+ },
+
+ /**
+ * @brief hwp task,
+ */
+ {
+ "libhwp.so" , // taskname
+ NULL, // no pointer to fn
+ {
+ INIT_TASK, // task type
+ EXT_IMAGE, // Extended Module
+ START_HWP_ERRL_ID, // module id
+ }
+ },
+
+ /**
+ * @brief plat task,
+ */
+ {
+ "libplat.so" , // taskname
+ NULL, // no pointer to fn
+ {
+ INIT_TASK, // task type
+ EXT_IMAGE, // Extended Module
+ START_PLAT_ERRL_ID, // module id
+ }
+ },
+
+ /**
+ * @brief targeting task,
+ */
+ {
+ "libtargeting.so" , // taskname
+ NULL, // no pointer to fn
+ {
+ START_TASK, // task type
+ EXT_IMAGE, // Extended Module
+ START_TARGETING_ERRL_ID, // module id
+ }
+ },
+
+ /**
+ * @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!!! ---------------------------------------
// ---------------------------------------------------------------
@@ -96,7 +160,7 @@ const TaskInfo CXXTEST_TASK = {
NULL, // no pointer to fn
{
START_TASK, // task type
- BASE_IMAGE, // Extended Module
+ EXT_IMAGE, // Extended Module
START_CXXTEST_ERRL_ID, // module id
}
};
diff --git a/src/usr/pnor/fakeext/fakeext.C b/src/usr/pnor/fakeext/fakeext.C
deleted file mode 100644
index 7b40f494e..000000000
--- a/src/usr/pnor/fakeext/fakeext.C
+++ /dev/null
@@ -1,65 +0,0 @@
-// IBM_PROLOG_BEGIN_TAG
-// This is an automatically generated prolog.
-//
-// $Source: src/usr/pnor/fakeext/fakeext.C $
-//
-// 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
-
-#include <trace/interface.H>
-#include <initservice/taskargs.H>
-
-
-// Trace definition
-trace_desc_t* g_trac_fakeext = NULL;
-TRAC_INIT(&g_trac_fakeext, "FAKE_EXT", 4096); //4k
-
-
-/**
- * @brief Fake EXT test function 1
- *
- * @return void
- */
-void fakeExtTest1(void* i_taskArgs )
-{
- TRACFCOMP(g_trac_fakeext, "fakeExtTest1 called " );
-// INITSERVICE::TaskArgs::TaskArgs* args = (INITSERVICE::TaskArgs::TaskArgs*)i_taskArgs;
-
- return;
-}
-
-
-/**
- * @brief set up _start() task
- */
-TASK_ENTRY_MACRO( fakeExtTest1 );
-
-
-
-/**
- * @brief Fake EXT test function 2
- *
- * @return void
- */
-void fakeExtTest2()
-{
- TRACFCOMP(g_trac_fakeext, "fakeExtTest2 called " );
-
- return;
-}
-
diff --git a/src/usr/pnor/fakeext/makefile b/src/usr/pnor/fakeext/makefile
deleted file mode 100644
index 63a2fc6b1..000000000
--- a/src/usr/pnor/fakeext/makefile
+++ /dev/null
@@ -1,28 +0,0 @@
-# IBM_PROLOG_BEGIN_TAG
-# This is an automatically generated prolog.
-#
-# $Source: src/usr/pnor/fakeext/makefile $
-#
-# 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
-ROOTPATH = ../../../..
-
-MODULE = fakeext
-OBJS = fakeext.o
-
-include ${ROOTPATH}/config.mk
diff --git a/src/usr/pnor/makefile b/src/usr/pnor/makefile
index 1fe469b70..9a16dae5d 100644
--- a/src/usr/pnor/makefile
+++ b/src/usr/pnor/makefile
@@ -25,6 +25,6 @@ MODULE = pnor
OBJS = pnorrp.o pnordd.o
-SUBDIRS = test.d fakeext.d
+SUBDIRS = test.d
include ${ROOTPATH}/config.mk
diff --git a/src/usr/vfs/vfsrp.C b/src/usr/vfs/vfsrp.C
index 76cfd2c0e..e31cd629a 100644
--- a/src/usr/vfs/vfsrp.C
+++ b/src/usr/vfs/vfsrp.C
@@ -164,9 +164,8 @@ void VfsRp::msgHandler()
{
case VFS_MSG_LOAD:
{
- TRACDBIN(g_trac_vfs, "INFO: load module ",
- (const char *) msg->data[0],
- strlen((const char *) msg->data[0]));
+ TRACDCOMP(g_trac_vfs, "Load request: %s",
+ (const char *) msg->data[0]);
// run in own task so page faults can be handled
task_create(load_unload, msg);
@@ -175,9 +174,8 @@ void VfsRp::msgHandler()
case VFS_MSG_UNLOAD:
{
- TRACDBIN(g_trac_vfs, "INFO: unload module ",
- (const char *) msg->data[0],
- strlen((const char *) msg->data[0]));
+ TRACDCOMP(g_trac_vfs, "Unload request: %s",
+ (const char *) msg->data[0]);
// run in own task so page faults can be handled
task_create(load_unload, msg);
@@ -187,7 +185,7 @@ void VfsRp::msgHandler()
case VFS_MSG_EXEC:
{
- TRACDCOMP(g_trac_vfs, "VFS: Got exec request of %s",
+ TRACDCOMP(g_trac_vfs, "EXEC request: %s",
(const char*)((msg_t*)msg->data[0])->data[0]);
// run in own task so page faults can be handled
@@ -198,10 +196,9 @@ void VfsRp::msgHandler()
case MSG_MM_RP_READ:
{
- uint64_t vaddr = msg->data[0];
+ uint64_t vaddr = msg->data[0]; //page aligned
uint64_t paddr = msg->data[1]; //page aligned
- vaddr -= vaddr % PAGE_SIZE;
vaddr -= VFS_EXTENDED_MODULE_VADDR;
memcpy((void *)paddr, (void *)(iv_pnor_vaddr+vaddr),
PAGE_SIZE);
@@ -243,7 +240,8 @@ void VfsRp::_load_unload(msg_t * i_msg)
VfsSystemModule * module =
vfs_find_module
(
- (VfsSystemModule *)iv_pnor_vaddr, //VFS_EXTENDED_MODULE_TABLE_ADDRESS,
+ //(VfsSystemModule *)VFS_EXTENDED_MODULE_VADDR,
+ (VfsSystemModule *)(iv_pnor_vaddr + VFS_EXTENDED_MODULE_TABLE_OFFSET),
(const char *) i_msg->data[0]
);
@@ -272,7 +270,7 @@ void VfsRp::_load_unload(msg_t * i_msg)
{
// TODO error log? for now it's probably in the base
// and is aready loaded and initialized.
- TRACFBIN(g_trac_vfs, ERR_MRK"Module not found: ",
+ TRACFBIN(g_trac_vfs, ERR_MRK"load Module not found: ",
(const char *) i_msg->data[0],
strlen((const char *) i_msg->data[0]) );
}
@@ -304,6 +302,48 @@ void VfsRp::_exec(msg_t * i_msg)
msg_free(i_msg);
}
+// ----------------------------------------------------------------------------
+
+bool VfsRp::module_exists(const char * i_name) const
+{
+ bool result = false;
+ VfsSystemModule * module = vfs_find_module(VFS_MODULES,i_name);
+ if(!module)
+ {
+ module = vfs_find_module((VfsSystemModule *)(iv_pnor_vaddr +
+ VFS_EXTENDED_MODULE_TABLE_OFFSET),
+ i_name);
+ }
+ if(module) result = true;
+ return result;
+}
+
+// ----------------------------------------------------------------------------
+
+void VfsRp::get_test_modules(std::vector<const char *> & o_list) const
+{
+ o_list.clear();
+ o_list.reserve(32);
+
+ VfsSystemModule * vfsItr =
+ (VfsSystemModule *) (iv_pnor_vaddr + VFS_EXTENDED_MODULE_TABLE_OFFSET);
+
+ //TRACDCOMP(g_trac_vfs,"finding test modules...");
+
+ while(vfsItr->module[0] != '\0')
+ {
+ if (0 == memcmp(vfsItr->module, "libtest", 7))
+ {
+ if (NULL != vfsItr->start)
+ {
+ //TRACDCOMP( g_trac_vfs, "%s",vfsItr->module);
+ o_list.push_back(vfsItr->module);
+ }
+ }
+ vfsItr++;
+ }
+}
+
// -- External interface ------------------------------------------------------
@@ -336,3 +376,17 @@ errlHndl_t VFS::module_load_unload(const char * i_module, VfsMessages i_msgtype)
return err;
}
+// ----------------------------------------------------------------------------
+
+void VFS::find_test_modules(std::vector<const char *> & o_list)
+{
+ Singleton<VfsRp>::instance().get_test_modules(o_list);
+}
+
+// ----------------------------------------------------------------------------
+
+bool VFS::module_exists(const char * i_name)
+{
+ return Singleton<VfsRp>::instance().module_exists(i_name);
+}
+
diff --git a/src/usr/vfs/vfsrp.H b/src/usr/vfs/vfsrp.H
index f2460e74c..129b4bd37 100644
--- a/src/usr/vfs/vfsrp.H
+++ b/src/usr/vfs/vfsrp.H
@@ -46,6 +46,19 @@ namespace VFS
*/
static void init(void * i_taskArgs);
+ /**
+ * Get the list of test modules
+ * @param[out] list of test module names
+ */
+ void get_test_modules(std::vector<const char *> & o_list) const;
+
+ /**
+ * Test for existance of module
+ * @param[in] i_name module name
+ * @return [true|false]
+ */
+ bool module_exists(const char * i_name) const;
+
protected:
/**
* Ctor
OpenPOWER on IntegriCloud