summaryrefslogtreecommitdiffstats
path: root/src/usr/vfs
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/vfs
parentdd8d92217c8cebd6aa5408ad7fd4fa50ea248c84 (diff)
downloadblackbird-hostboot-6dd3a0514d3754d607be5689bf07a04d3cc8f483.tar.gz
blackbird-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/vfs')
-rw-r--r--src/usr/vfs/vfsrp.C76
-rw-r--r--src/usr/vfs/vfsrp.H13
2 files changed, 78 insertions, 11 deletions
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