]> git.hungrycats.org Git - linux/commitdiff
[PATCH] separate out moduleloader.h
authorRusty Russell <rusty@rustcorp.com.au>
Sun, 17 Nov 2002 03:21:48 +0000 (19:21 -0800)
committerLinus Torvalds <torvalds@home.transmeta.com>
Sun, 17 Nov 2002 03:21:48 +0000 (19:21 -0800)
Separates the module loading function prototypes (and elf.h) into
moduleloader.h.  AT_GID in elf.h clashes with xfs.h, but this also
makes module.h less cluttered.

arch/i386/kernel/module.c
arch/sparc/kernel/module.c
arch/sparc64/kernel/module.c
include/linux/module.h
include/linux/moduleloader.h [new file with mode: 0644]
kernel/module.c

index 0433c2b2007d06c4edabe132f26d40d0c630ee68..500723e0305158bafddf3ec96134f4c022abbf05 100644 (file)
@@ -15,7 +15,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
-#include <linux/module.h>
+#include <linux/moduleloader.h>
 #include <linux/elf.h>
 #include <linux/vmalloc.h>
 #include <linux/fs.h>
index 89dac673444d147d8724482eca231d930474f6a2..609e6920ec3ae2b8ecad1f18764930a5e837d08c 100644 (file)
@@ -4,7 +4,7 @@
  * Copyright (C) 2002 David S. Miller.
  */
 
-#include <linux/module.h>
+#include <linux/moduleloader.h>
 #include <linux/kernel.h>
 #include <linux/elf.h>
 #include <linux/vmalloc.h>
index 5ffe195c6aedaa69a511a03e7dd75b660357a313..abff5ca9c68be915c2578c35c6a53b40d8566817 100644 (file)
@@ -4,7 +4,7 @@
  * Copyright (C) 2002 David S. Miller.
  */
 
-#include <linux/module.h>
+#include <linux/moduleloader.h>
 #include <linux/kernel.h>
 #include <linux/elf.h>
 #include <linux/vmalloc.h>
index bbdf2b49d5b0986736d5556d5fb34720fe0e0d1b..ff026ad568d12cbd3f34d39f94dac83d547ddea9 100644 (file)
@@ -10,7 +10,6 @@
 #include <linux/sched.h>
 #include <linux/spinlock.h>
 #include <linux/list.h>
-#include <linux/elf.h>
 #include <linux/stat.h>
 #include <linux/compiler.h>
 #include <linux/cache.h>
@@ -143,53 +142,6 @@ struct module
        char args[0];
 };
 
-/* Helper function for arch-specific module loaders */
-unsigned long find_symbol_internal(Elf_Shdr *sechdrs,
-                                  unsigned int symindex,
-                                  const char *strtab,
-                                  const char *name,
-                                  struct module *mod,
-                                  struct kernel_symbol_group **group);
-
-/* These must be implemented by the specific architecture */
-
-/* vmalloc AND zero for the non-releasable code; return ERR_PTR() on error. */
-void *module_core_alloc(const Elf_Ehdr *hdr,
-                       const Elf_Shdr *sechdrs,
-                       const char *secstrings,
-                       struct module *mod);
-
-/* vmalloc and zero (if any) for sections to be freed after init.
-   Return ERR_PTR() on error. */
-void *module_init_alloc(const Elf_Ehdr *hdr,
-                       const Elf_Shdr *sechdrs,
-                       const char *secstrings,
-                       struct module *mod);
-
-/* Apply the given relocation to the (simplified) ELF.  Return -error
-   or 0. */
-int apply_relocate(Elf_Shdr *sechdrs,
-                  const char *strtab,
-                  unsigned int symindex,
-                  unsigned int relsec,
-                  struct module *mod);
-
-/* Apply the given add relocation to the (simplified) ELF.  Return
-   -error or 0 */
-int apply_relocate_add(Elf_Shdr *sechdrs,
-                      const char *strtab,
-                      unsigned int symindex,
-                      unsigned int relsec,
-                      struct module *mod);
-
-/* Any final processing of module before access.  Return -error or 0. */
-int module_finalize(const Elf_Ehdr *hdr,
-                   const Elf_Shdr *sechdrs,
-                   struct module *mod);
-
-/* Free memory returned from module_core_alloc/module_init_alloc */
-void module_free(struct module *mod, void *module_region);
-
 #ifdef CONFIG_MODULE_UNLOAD
 
 void __symbol_put(const char *symbol);
diff --git a/include/linux/moduleloader.h b/include/linux/moduleloader.h
new file mode 100644 (file)
index 0000000..a749604
--- /dev/null
@@ -0,0 +1,55 @@
+#ifndef _LINUX_MODULELOADER_H
+#define _LINUX_MODULELOADER_H
+/* The stuff needed for archs to support modules. */
+
+#include <linux/module.h>
+#include <linux/elf.h>
+
+/* Helper function for arch-specific module loaders */
+unsigned long find_symbol_internal(Elf_Shdr *sechdrs,
+                                  unsigned int symindex,
+                                  const char *strtab,
+                                  const char *name,
+                                  struct module *mod,
+                                  struct kernel_symbol_group **group);
+
+/* These must be implemented by the specific architecture */
+
+/* vmalloc AND zero for the non-releasable code; return ERR_PTR() on error. */
+void *module_core_alloc(const Elf_Ehdr *hdr,
+                       const Elf_Shdr *sechdrs,
+                       const char *secstrings,
+                       struct module *mod);
+
+/* vmalloc and zero (if any) for sections to be freed after init.
+   Return ERR_PTR() on error. */
+void *module_init_alloc(const Elf_Ehdr *hdr,
+                       const Elf_Shdr *sechdrs,
+                       const char *secstrings,
+                       struct module *mod);
+
+/* Free memory returned from module_core_alloc/module_init_alloc */
+void module_free(struct module *mod, void *module_region);
+
+/* Apply the given relocation to the (simplified) ELF.  Return -error
+   or 0. */
+int apply_relocate(Elf_Shdr *sechdrs,
+                  const char *strtab,
+                  unsigned int symindex,
+                  unsigned int relsec,
+                  struct module *mod);
+
+/* Apply the given add relocation to the (simplified) ELF.  Return
+   -error or 0 */
+int apply_relocate_add(Elf_Shdr *sechdrs,
+                      const char *strtab,
+                      unsigned int symindex,
+                      unsigned int relsec,
+                      struct module *mod);
+
+/* Any final processing of module before access.  Return -error or 0. */
+int module_finalize(const Elf_Ehdr *hdr,
+                   const Elf_Shdr *sechdrs,
+                   struct module *mod);
+
+#endif
index 668406fa22cd6ec4b09d12f46676da1ced80296b..c92e6b7ca6bfc464a1a1ce7cb883389033c68ba2 100644 (file)
@@ -17,6 +17,7 @@
 */
 #include <linux/config.h>
 #include <linux/module.h>
+#include <linux/moduleloader.h>
 #include <linux/init.h>
 #include <linux/slab.h>
 #include <linux/vmalloc.h>