diff options
author | Sascha Hauer <sha@octopus.labnet.pengutronix.de> | 2007-09-28 20:32:15 +0200 |
---|---|---|
committer | Sascha Hauer <sha@octopus.labnet.pengutronix.de> | 2007-09-28 20:32:15 +0200 |
commit | c396c4da497bc4cfdee1e98c0a7c6b98dff92ada (patch) | |
tree | 75ecb38ea9c8f552eb214a5cffa1f1f4e277ce62 /include/module.h | |
parent | 7a49f672c5b901b1082c693c22f87b0ea494b05e (diff) | |
download | barebox-c396c4da497bc4cfdee1e98c0a7c6b98dff92ada.tar.gz barebox-c396c4da497bc4cfdee1e98c0a7c6b98dff92ada.tar.xz |
Add module handling (mostly copied from Linux kernel and stripped down
for U-Boot)
Diffstat (limited to 'include/module.h')
-rw-r--r-- | include/module.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/include/module.h b/include/module.h new file mode 100644 index 0000000000..faea2ae7e4 --- /dev/null +++ b/include/module.h @@ -0,0 +1,39 @@ +#ifndef __MODULE_H +#define __MODULE_H + +#include <elf.h> +#include <asm/module.h> + +struct module { + char *name; + + /* Startup function. */ + int (*init)(void); + + /* Here is the actual code + data, free'd on unload. */ + void *module_core; + + /* Arch-specific module values */ + struct mod_arch_specific arch; + + unsigned long core_size; +}; + +/* 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); + +#endif /* __MODULE_H */ + |