summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2002-11-16 19:21:55 -0800
committerLinus Torvalds <torvalds@home.transmeta.com>2002-11-16 19:21:55 -0800
commit66f67a6b1bc034b3bbf7dc2ae96afd6ea68a0454 (patch)
treef62a6139dd1a11a337861a64160d95528b8d55e8 /include
parent3d19ab58bcae6b90a622e2e5fc1831260ed48b38 (diff)
[PATCH] Allocate struct module using special allocator
Sparc64 (and probably others) need all the kernel symbols within 32-bits, which includes the manufactured "__this_module" which refers to the struct module *. This changes the interface back to its old style: the arch-specific code manipulates the init and core sizes, and we call module_alloc() ourselves.
Diffstat (limited to 'include')
-rw-r--r--include/linux/moduleloader.h34
1 files changed, 20 insertions, 14 deletions
diff --git a/include/linux/moduleloader.h b/include/linux/moduleloader.h
index a74960440032..928ae553ca37 100644
--- a/include/linux/moduleloader.h
+++ b/include/linux/moduleloader.h
@@ -15,20 +15,26 @@ unsigned long find_symbol_internal(Elf_Shdr *sechdrs,
/* 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 */
+/* Total size to allocate for the non-releasable code; return len or
+ -error. mod->core_size is the current generic tally. */
+long module_core_size(const Elf_Ehdr *hdr,
+ const Elf_Shdr *sechdrs,
+ const char *secstrings,
+ struct module *mod);
+
+/* Total size of (if any) sections to be freed after init. Return 0
+ for none, len, or -error. mod->init_size is the current generic
+ tally. */
+long module_init_size(const Elf_Ehdr *hdr,
+ const Elf_Shdr *sechdrs,
+ const char *secstrings,
+ struct module *mod);
+
+/* Allocator used for allocating struct module, core sections and init
+ sections. Returns NULL on failure. */
+void *module_alloc(unsigned long size);
+
+/* Free memory returned from module_alloc. */
void module_free(struct module *mod, void *module_region);
/* Apply the given relocation to the (simplified) ELF. Return -error