fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / include / linux / module.h
index c458418..159560d 100644 (file)
@@ -6,7 +6,6 @@
  * Rewritten by Richard Henderson <rth@tamu.edu> Dec 1996
  * Rewritten again by Rusty Russell, 2002
  */
-#include <linux/sched.h>
 #include <linux/spinlock.h>
 #include <linux/list.h>
 #include <linux/stat.h>
@@ -156,6 +155,11 @@ extern struct module __this_module;
 */
 #define MODULE_VERSION(_version) MODULE_INFO(version, _version)
 
+/* Optional firmware file (or files) needed by the module
+ * format is simply firmware file name.  Multiple firmware
+ * files require multiple MODULE_FIRMWARE() specifiers */
+#define MODULE_FIRMWARE(_firmware) MODULE_INFO(firmware, _firmware)
+
 /* Given an address, look for it in the exception tables */
 const struct exception_table_entry *search_exception_tables(unsigned long add);
 
@@ -227,17 +231,17 @@ enum module_state
 };
 
 /* Similar stuff for section attributes. */
-#define MODULE_SECT_NAME_LEN 32
 struct module_sect_attr
 {
        struct module_attribute mattr;
-       char name[MODULE_SECT_NAME_LEN];
+       char *name;
        unsigned long address;
 };
 
 struct module_sect_attrs
 {
        struct attribute_group grp;
+       int nsections;
        struct module_sect_attr attrs[0];
 };
 
@@ -259,6 +263,7 @@ struct module
        struct module_attribute *modinfo_attrs;
        const char *version;
        const char *srcversion;
+       struct kobject *drivers_dir;
 
        /* Exported symbols */
        const struct kernel_symbol *syms;
@@ -312,10 +317,16 @@ struct module
        /* Am I unsafe to unload? */
        int unsafe;
 
-       /* Am I GPL-compatible */
-       int license_gplok;
-       
-       /* Am I gpg signed */
+       unsigned int taints;    /* same bits as kernel:tainted */
+
+#ifdef CONFIG_GENERIC_BUG
+       /* Support for BUG */
+       struct list_head bug_list;
+       struct bug_entry *bug_table;
+       unsigned num_bugs;
+#endif
+
+       /* Is this module GPG signed */
        int gpgsig_ok;
 
 #ifdef CONFIG_MODULE_UNLOAD
@@ -409,17 +420,7 @@ static inline int try_module_get(struct module *module)
        return ret;
 }
 
-static inline void module_put(struct module *module)
-{
-       if (module) {
-               unsigned int cpu = get_cpu();
-               local_dec(&module->ref[cpu].count);
-               /* Maybe they're waiting for us to drop reference? */
-               if (unlikely(!module_is_live(module)))
-                       wake_up_process(module->waiter);
-               put_cpu();
-       }
-}
+extern void module_put(struct module *module);
 
 #else /*!CONFIG_MODULE_UNLOAD*/
 static inline int try_module_get(struct module *module)