summaryrefslogtreecommitdiffstats
path: root/kernel/module.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/module.c')
-rw-r--r--kernel/module.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/kernel/module.c b/kernel/module.c
index 41ffd5734..aef180ff4 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -871,7 +871,6 @@ int get_module_list(char *p)
}
safe_copy_cstr("]");
}
-
safe_copy_cstr("\n");
#undef safe_copy_str
@@ -932,6 +931,34 @@ leave_the_loop:
return len;
}
+/*
+ * Gets the address for a symbol in the given module. If modname is
+ * NULL, it looks for the name in any registered symbol table. If the
+ * modname is an empty string, it looks for the symbol in kernel exported
+ * symbol tables.
+ */
+unsigned long
+get_module_symbol(char *modname, char *symname)
+{
+ struct module *mp;
+ struct module_symbol *sym;
+ int i;
+
+ for (mp = module_list; mp; mp = mp->next) {
+ if (((modname == NULL) || (strcmp(mp->name, modname) == 0)) &&
+ (mp->flags == MOD_RUNNING) && (mp->nsyms > 0)) {
+ for (i = mp->nsyms, sym = mp->syms;
+ i > 0; --i, ++sym) {
+
+ if (strcmp(sym->name, symname) == 0) {
+ return sym->value;
+ }
+ }
+ }
+ }
+ return 0;
+}
+
#else /* CONFIG_MODULES */
/* Dummy syscalls for people who don't want modules */