netfilter: nf_conntrack: support conntrack templates
[safe/jmp/linux-2.6] / include / linux / module.h
index a8f2c0a..6cb1a3c 100644 (file)
 #include <linux/stringify.h>
 #include <linux/kobject.h>
 #include <linux/moduleparam.h>
-#include <linux/marker.h>
 #include <linux/tracepoint.h>
-#include <asm/local.h>
 
+#include <asm/local.h>
 #include <asm/module.h>
 
+#include <trace/events/module.h>
+
 /* Not Yet Implemented */
 #define MODULE_SUPPORTED_DEVICE(name)
 
-/* some toolchains uses a `_' prefix for all user symbols */
-#ifndef MODULE_SYMBOL_PREFIX
+/* Some toolchains use a `_' prefix for all user symbols. */
+#ifdef CONFIG_SYMBOL_PREFIX
+#define MODULE_SYMBOL_PREFIX CONFIG_SYMBOL_PREFIX
+#else
 #define MODULE_SYMBOL_PREFIX ""
 #endif
 
@@ -77,6 +80,7 @@ search_extable(const struct exception_table_entry *first,
 void sort_extable(struct exception_table_entry *start,
                  struct exception_table_entry *finish);
 void sort_main_extable(void);
+void trim_init_extable(struct module *m);
 
 #ifdef MODULE
 #define MODULE_GENERIC_TABLE(gtype,name)                       \
@@ -126,7 +130,10 @@ extern struct module __this_module;
  */
 #define MODULE_LICENSE(_license) MODULE_INFO(license, _license)
 
-/* Author, ideally of form NAME[, NAME]*[ and NAME] */
+/*
+ * Author(s), use "Name <email>" or just "Name", for multiple
+ * authors use multiple MODULE_AUTHOR() statements/lines.
+ */
 #define MODULE_AUTHOR(_author) MODULE_INFO(author, _author)
   
 /* What your module does. */
@@ -306,10 +313,14 @@ struct module
 #endif
 
 #ifdef CONFIG_KALLSYMS
-       /* We keep the symbol and string tables for kallsyms. */
-       Elf_Sym *symtab;
-       unsigned int num_symtab;
-       char *strtab;
+       /*
+        * We keep the symbol and string tables for kallsyms.
+        * The core_* fields below are temporary, loader-only (they
+        * could really be discarded after module init).
+        */
+       Elf_Sym *symtab, *core_symtab;
+       unsigned int num_symtab, core_num_syms;
+       char *strtab, *core_strtab;
 
        /* Section attributes */
        struct module_sect_attrs *sect_attrs;
@@ -324,10 +335,6 @@ struct module
        /* The command line arguments (may be mangled).  People like
           keeping pointers to this stuff */
        char *args;
-#ifdef CONFIG_MARKERS
-       struct marker *markers;
-       unsigned int num_markers;
-#endif
 #ifdef CONFIG_TRACEPOINTS
        struct tracepoint *tracepoints;
        unsigned int num_tracepoints;
@@ -362,6 +369,12 @@ struct module
        local_t ref;
 #endif
 #endif
+
+#ifdef CONFIG_CONSTRUCTORS
+       /* Constructor functions. */
+       ctor_fn_t *ctors;
+       unsigned int num_ctors;
+#endif
 };
 #ifndef MODULE_ARCH_INIT
 #define MODULE_ARCH_INIT {}
@@ -455,7 +468,10 @@ static inline local_t *__module_ref_addr(struct module *mod, int cpu)
 static inline void __module_get(struct module *module)
 {
        if (module) {
-               local_inc(__module_ref_addr(module, get_cpu()));
+               unsigned int cpu = get_cpu();
+               local_inc(__module_ref_addr(module, cpu));
+               trace_module_get(module, _THIS_IP_,
+                                local_read(__module_ref_addr(module, cpu)));
                put_cpu();
        }
 }
@@ -466,8 +482,11 @@ static inline int try_module_get(struct module *module)
 
        if (module) {
                unsigned int cpu = get_cpu();
-               if (likely(module_is_live(module)))
+               if (likely(module_is_live(module))) {
                        local_inc(__module_ref_addr(module, cpu));
+                       trace_module_get(module, _THIS_IP_,
+                               local_read(__module_ref_addr(module, cpu)));
+               }
                else
                        ret = 0;
                put_cpu();
@@ -520,8 +539,6 @@ int unregister_module_notifier(struct notifier_block * nb);
 
 extern void print_modules(void);
 
-extern void module_update_markers(void);
-
 extern void module_update_tracepoints(void);
 extern int module_get_iter_tracepoints(struct tracepoint_iter *iter);
 
@@ -636,10 +653,6 @@ static inline void print_modules(void)
 {
 }
 
-static inline void module_update_markers(void)
-{
-}
-
 static inline void module_update_tracepoints(void)
 {
 }
@@ -696,4 +709,21 @@ static inline void module_remove_modinfo_attrs(struct module *mod)
 
 #define __MODULE_STRING(x) __stringify(x)
 
+
+#ifdef CONFIG_GENERIC_BUG
+int  module_bug_finalize(const Elf_Ehdr *, const Elf_Shdr *,
+                        struct module *);
+void module_bug_cleanup(struct module *);
+
+#else  /* !CONFIG_GENERIC_BUG */
+
+static inline int  module_bug_finalize(const Elf_Ehdr *hdr,
+                                       const Elf_Shdr *sechdrs,
+                                       struct module *mod)
+{
+       return 0;
+}
+static inline void module_bug_cleanup(struct module *mod) {}
+#endif /* CONFIG_GENERIC_BUG */
+
 #endif /* _LINUX_MODULE_H */