Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef _ASM_PPC_MODULE_H |
| 2 | #define _ASM_PPC_MODULE_H |
| 3 | /* Module stuff for PPC. (C) 2001 Rusty Russell */ |
| 4 | |
| 5 | #include <linux/list.h> |
| 6 | #include <asm/bug.h> |
| 7 | |
| 8 | /* Thanks to Paul M for explaining this. |
| 9 | |
| 10 | PPC can only do rel jumps += 32MB, and often the kernel and other |
| 11 | modules are furthur away than this. So, we jump to a table of |
| 12 | trampolines attached to the module (the Procedure Linkage Table) |
| 13 | whenever that happens. |
| 14 | */ |
| 15 | |
| 16 | struct ppc_plt_entry |
| 17 | { |
| 18 | /* 16 byte jump instruction sequence (4 instructions) */ |
| 19 | unsigned int jump[4]; |
| 20 | }; |
| 21 | |
| 22 | struct mod_arch_specific |
| 23 | { |
| 24 | /* Indices of PLT sections within module. */ |
| 25 | unsigned int core_plt_section, init_plt_section; |
| 26 | |
| 27 | /* List of BUG addresses, source line numbers and filenames */ |
| 28 | struct list_head bug_list; |
| 29 | struct bug_entry *bug_table; |
| 30 | unsigned int num_bugs; |
| 31 | }; |
| 32 | |
| 33 | extern struct bug_entry *module_find_bug(unsigned long bugaddr); |
| 34 | |
| 35 | #define Elf_Shdr Elf32_Shdr |
| 36 | #define Elf_Sym Elf32_Sym |
| 37 | #define Elf_Ehdr Elf32_Ehdr |
| 38 | |
| 39 | /* Make empty sections for module_frob_arch_sections to expand. */ |
| 40 | #ifdef MODULE |
| 41 | asm(".section .plt,\"ax\",@nobits; .align 3; .previous"); |
| 42 | asm(".section .init.plt,\"ax\",@nobits; .align 3; .previous"); |
| 43 | #endif |
| 44 | #endif /* _ASM_PPC_MODULE_H */ |