summaryrefslogtreecommitdiffstats
path: root/src/sys
diff options
context:
space:
mode:
Diffstat (limited to 'src/sys')
-rw-r--r--src/sys/vfs/vfs_init.C24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/sys/vfs/vfs_init.C b/src/sys/vfs/vfs_init.C
index 91e09876f..e0cf844fa 100644
--- a/src/sys/vfs/vfs_init.C
+++ b/src/sys/vfs/vfs_init.C
@@ -119,4 +119,28 @@ VfsSystemModule * vfs_find_module(VfsSystemModule * i_table,
return ret;
}
+// ----------------------------------------------------------------------------
+
+VfsSystemModule * vfs_find_address(VfsSystemModule * i_table,
+ const void * i_vaddr)
+{
+ VfsSystemModule * module = i_table;
+ VfsSystemModule * ret = NULL;
+
+ const uint8_t * vaddr = reinterpret_cast<const uint8_t *>(i_vaddr);
+
+ while('\0' != module->module[0])
+ {
+ const uint8_t * first = reinterpret_cast<const uint8_t *>(module->text);
+ const uint8_t * last = first + module->byte_count;
+
+ if(vaddr >= first && vaddr < last)
+ {
+ ret = module;
+ break;
+ }
+ ++module;
+ }
+ return ret;
+}
OpenPOWER on IntegriCloud