From 66f67a6b1bc034b3bbf7dc2ae96afd6ea68a0454 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Sat, 16 Nov 2002 19:21:55 -0800 Subject: [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. --- include/linux/moduleloader.h | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) (limited to 'include') 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 -- cgit v1.2.3