upgrade to linux 2.6.9-1.11_FC2
[linux-2.6.git] / include / asm-mips / module.h
1 #ifndef _ASM_MODULE_H
2 #define _ASM_MODULE_H
3
4 #include <linux/config.h>
5 #include <linux/list.h>
6 #include <asm/uaccess.h>
7
8 struct mod_arch_specific {
9         /* Data Bus Error exception tables */
10         struct list_head dbe_list;
11         const struct exception_table_entry *dbe_start;
12         const struct exception_table_entry *dbe_end;
13 };
14
15 typedef uint8_t Elf64_Byte;             /* Type for a 8-bit quantity.  */
16
17 typedef struct
18 {
19   Elf64_Addr r_offset;                  /* Address of relocation.  */
20   Elf64_Word r_sym;                     /* Symbol index.  */
21   Elf64_Byte r_ssym;                    /* Special symbol.  */
22   Elf64_Byte r_type3;                   /* Third relocation.  */
23   Elf64_Byte r_type2;                   /* Second relocation.  */
24   Elf64_Byte r_type;                    /* First relocation.  */
25   Elf64_Sxword r_addend;                /* Addend.  */
26 } Elf64_Mips_Rela;
27
28 #ifdef CONFIG_MIPS32
29
30 #define MODULES_ARE_ELF32
31 #define Elf_Shdr        Elf32_Shdr
32 #define Elf_Sym         Elf32_Sym
33 #define Elf_Ehdr        Elf32_Ehdr
34 #define Elf_Rel         Elf32_Rel
35 #define Elf_Rela        Elf32_Rela
36 #define ELF_R_TYPE(X)   ELF32_R_TYPE(X)
37 #define ELF_R_SYM(X)    ELF32_R_SYM(X)
38
39 #endif
40
41 #ifdef CONFIG_MIPS64
42
43 #define MODULES_ARE_ELF64
44 #define Elf_Shdr        Elf64_Shdr
45 #define Elf_Sym         Elf64_Sym
46 #define Elf_Ehdr        Elf64_Ehdr
47 #define Elf_Rel         Elf64_Rel
48 #define Elf_Rela        Elf64_Rela
49 #define ELF_R_TYPE(X)   ELF64_R_TYPE(X)
50 #define ELF_R_SYM(X)    ELF64_R_SYM(X)
51
52 #endif
53
54 #ifdef CONFIG_MODULES
55 /* Given an address, look for it in the exception tables. */
56 const struct exception_table_entry*search_module_dbetables(unsigned long addr);
57 #else
58 /* Given an address, look for it in the exception tables. */
59 static inline const struct exception_table_entry *
60 search_module_dbetables(unsigned long addr)
61 {
62         return NULL;
63 }
64 #endif
65
66 #endif /* _ASM_MODULE_H */