summaryrefslogtreecommitdiff
path: root/include/linux/module.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/module.h')
-rw-r--r--include/linux/module.h27
1 files changed, 25 insertions, 2 deletions
diff --git a/include/linux/module.h b/include/linux/module.h
index 9a47e8926bfd..c71778e38536 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -10,6 +10,7 @@
#include <linux/config.h>
#include <linux/spinlock.h>
#include <linux/list.h>
+#include <linux/errno.h>
#include <asm/atomic.h>
@@ -316,8 +317,6 @@ static const struct gtype##_id * __module_##gtype##_table \
#define MOD_DEC_USE_COUNT do { } while (0)
#define MOD_IN_USE 1
-extern struct module *module_list;
-
#endif /* !__GENKSYMS__ */
#endif /* MODULE */
@@ -506,4 +505,28 @@ __asm__(".section __ksymtab,\"a\"\n.previous");
#define SET_MODULE_OWNER(some_struct) do { } while (0)
#endif
+extern void print_modules(void);
+
+#if defined(CONFIG_MODULES) || defined(CONFIG_KALLSYMS)
+
+extern struct module *module_list;
+
+/*
+ * print_symbols takes a format string containing one %s.
+ * If support for resolving symbols is compiled in, the %s will
+ * be replaced by the closest symbol to the address and the entire
+ * string is printk()ed. Otherwise, nothing is printed.
+ */
+extern void print_symbol(const char *fmt, unsigned long address);
+
+#else
+
+static inline int
+print_symbol(const char *fmt, unsigned long address)
+{
+ return -ESRCH;
+}
+
+#endif
+
#endif /* _LINUX_MODULE_H */