patch-2_6_7-vs1_9_1_12
[linux-2.6.git] / include / linux / module.h
index 0a86652..2709330 100644 (file)
 #include <linux/kmod.h>
 #include <linux/elf.h>
 #include <linux/stringify.h>
+#include <linux/kobject.h>
+#include <linux/moduleparam.h>
 #include <asm/local.h>
 
 #include <asm/module.h>
 
 /* Not Yet Implemented */
 #define MODULE_SUPPORTED_DEVICE(name)
-#define print_modules()
 
 /* v850 toolchain uses a `_' prefix for all user symbols */
 #ifndef MODULE_SYMBOL_PREFIX
@@ -207,6 +208,23 @@ enum module_state
        MODULE_STATE_GOING,
 };
 
+/* sysfs stuff */
+struct module_attribute
+{
+       struct attribute attr;
+       struct kernel_param *param;
+};
+
+struct module_kobject
+{
+       /* Everyone should have one of these. */
+       struct kobject kobj;
+
+       /* We always have refcnt, we may have others from module_param(). */
+       unsigned int num_attributes;
+       struct module_attribute attr[0];
+};
+
 struct module
 {
        enum module_state state;
@@ -217,6 +235,9 @@ struct module
        /* Unique handle for this module */
        char name[MODULE_NAME_LEN];
 
+       /* Sysfs stuff. */
+       struct module_kobject *mkobj;
+
        /* Exported symbols */
        const struct kernel_symbol *syms;
        unsigned int num_syms;
@@ -267,6 +288,9 @@ struct module
 
        /* Destruction function. */
        void (*exit)(void);
+
+       /* Fake kernel param for refcnt. */
+       struct kernel_param refcnt_param;
 #endif
 
 #ifdef CONFIG_KALLSYMS
@@ -400,6 +424,7 @@ const struct exception_table_entry *search_module_extables(unsigned long addr);
 int register_module_notifier(struct notifier_block * nb);
 int unregister_module_notifier(struct notifier_block * nb);
 
+extern void print_modules(void);
 #else /* !CONFIG_MODULES... */
 #define EXPORT_SYMBOL(sym)
 #define EXPORT_SYMBOL_GPL(sym)
@@ -480,6 +505,9 @@ static inline int unregister_module_notifier(struct notifier_block * nb)
 
 #define module_put_and_exit(code) do_exit(code)
 
+static inline void print_modules(void)
+{
+}
 #endif /* CONFIG_MODULES */
 
 #define symbol_request(x) try_then_request_module(symbol_get(x), "symbol:" #x)