From 11a2e07a97bb44005dfd8fe8bac690014b3e2a81 Mon Sep 17 00:00:00 2001 From: Doug Gilbert Date: Fri, 13 Jan 2012 09:40:41 -0600 Subject: 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 Reviewed-by: Douglas R. Gilbert --- src/include/sys/vfs.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/include/sys') diff --git a/src/include/sys/vfs.h b/src/include/sys/vfs.h index 155851398..3094a1707 100644 --- a/src/include/sys/vfs.h +++ b/src/include/sys/vfs.h @@ -69,8 +69,8 @@ enum VfsMessages VFS_MSG_REGISTER_MSGQ, //!< Message to VFS_ROOT to register a message queue VFS_MSG_RESOLVE_MSGQ, //!< Message to VFS_ROOT to find a message queue VFS_MSG_EXEC, //!< Message to VFS_ROOT execute a module - VFS_MSG_LOAD, //!< Message to VFS_MSG to load a module - VFS_MSG_UNLOAD, //!< Message to VFS_MSG to unload a module + VFS_MSG_LOAD, //!< Message to vfsrp to load a module + VFS_MSG_UNLOAD, //!< Message to vfsrp to unload a module }; struct VfsSystemModule @@ -81,7 +81,7 @@ struct VfsSystemModule void (*fini)(void*); //!< ptr to fini() uint64_t * text; //!< ptr to text (code) section uint64_t * data; //!< ptr to data section - uint64_t byte_count; //!< no. of memory pages used + uint64_t byte_count; //!< no. of bytes in module }; extern VfsSystemModule VFS_MODULES[VFS_MODULE_MAX]; @@ -101,6 +101,15 @@ extern uint64_t VFS_LAST_ADDRESS; */ VfsSystemModule * vfs_find_module(VfsSystemModule * i_table, const char * i_name); +/** + * Find the VfsSystemModule for the given address + * @param[in] i_table The VFS module table to look in + * @param[in] i_vaddr The virtual address + * @return VrsSytemModule ptr for the module | NULL if not found + */ +VfsSystemModule * vfs_find_address(VfsSystemModule * i_table, + const void * i_vaddr); + /** * Get the module's start routine * @param[in] i_module VfsSystemModule data for the module -- cgit v1.2.3