diff options
| author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2012-02-19 06:14:24 +0000 |
|---|---|---|
| committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2012-02-19 06:14:24 +0000 |
| commit | 6fafeb146e9efd59140ea58cebd7dd38ae9a6379 (patch) | |
| tree | 7db89ba6a28932514b105d620bba4884ec332ec3 /libdde_linux26/contrib/include/linux/moduleloader.h | |
| parent | 38c2c2458e3f4ecb329ff35621806252aac209b9 (diff) | |
| parent | 8df772b3c665e663f6f9d2a70f9c691590bd3f91 (diff) | |
Merge branch 'dde' into upstream-merged
Diffstat (limited to 'libdde_linux26/contrib/include/linux/moduleloader.h')
| -rw-r--r-- | libdde_linux26/contrib/include/linux/moduleloader.h | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/libdde_linux26/contrib/include/linux/moduleloader.h b/libdde_linux26/contrib/include/linux/moduleloader.h new file mode 100644 index 00000000..c1f40c2f --- /dev/null +++ b/libdde_linux26/contrib/include/linux/moduleloader.h @@ -0,0 +1,50 @@ +#ifndef _LINUX_MODULELOADER_H +#define _LINUX_MODULELOADER_H +/* The stuff needed for archs to support modules. */ + +#include <linux/module.h> +#include <linux/elf.h> + +/* These must be implemented by the specific architecture */ + +/* Adjust arch-specific sections. Return 0 on success. */ +int module_frob_arch_sections(Elf_Ehdr *hdr, + Elf_Shdr *sechdrs, + char *secstrings, + struct module *mod); + +/* Additional bytes needed by arch in front of individual sections */ +unsigned int arch_mod_section_prepend(struct module *mod, unsigned int section); + +/* 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 + 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); + +/* Any cleanup needed when module leaves. */ +void module_arch_cleanup(struct module *mod); + +#endif |
