summaryrefslogtreecommitdiffstats
path: root/include/module.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/module.h')
-rw-r--r--include/module.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/include/module.h b/include/module.h
index faea2ae7e4..421b9374fb 100644
--- a/include/module.h
+++ b/include/module.h
@@ -4,6 +4,34 @@
#include <elf.h>
#include <asm/module.h>
+#ifndef MODULE_SYMBOL_PREFIX
+#define MODULE_SYMBOL_PREFIX
+#endif
+
+#ifdef CONFIG_MODULE
+struct kernel_symbol
+{
+ unsigned long value;
+ const char *name;
+};
+
+/* For every exported symbol, place a struct in the __ksymtab section */
+#define __EXPORT_SYMBOL(sym, sec) \
+ extern typeof(sym) sym; \
+ static const char __u_boot_strtab_##sym[] \
+ __attribute__((section("__u_boot_symtab_strings"))) \
+ = MODULE_SYMBOL_PREFIX #sym; \
+ static const struct kernel_symbol __u_boot_symtab_##sym \
+ __used \
+ __attribute__((section("__u_boot_symtab" sec), unused)) \
+ = { (unsigned long)&sym, __u_boot_strtab_##sym }
+
+#define EXPORT_SYMBOL(sym) \
+ __EXPORT_SYMBOL(sym, "")
+#else
+#define EXPORT_SYMBOL(sym)
+#endif
+
struct module {
char *name;