diff options
author | Doug Gilbert <dgilbert@us.ibm.com> | 2012-01-13 09:40:41 -0600 |
---|---|---|
committer | Douglas R. Gilbert <dgilbert@us.ibm.com> | 2012-01-19 14:47:50 -0600 |
commit | 11a2e07a97bb44005dfd8fe8bac690014b3e2a81 (patch) | |
tree | 3a8492a5476e540ced0cbb7cb21c8d16b0936f9f /src/sys | |
parent | 67ab5c65b2caabff6147143a90ab5584573e24ae (diff) | |
download | talos-hostboot-11a2e07a97bb44005dfd8fe8bac690014b3e2a81.tar.gz talos-hostboot-11a2e07a97bb44005dfd8fe8bac690014b3e2a81.zip |
VFS add functions to find module by address and query if module is loaded
Change-Id: I471a2a773d42f11ab973f42ca701c8be5191d776
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/611
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/sys')
-rw-r--r-- | src/sys/vfs/vfs_init.C | 24 |
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; +} |