root/src/linux/adm5120/linux-2.6.23/include/asm-mips/module.h

Revision 12415, 3.9 kB (checked in by BrainSlayer, 5 months ago)

latest adm5120 update incl. remap patch

Line 
1 #ifndef _ASM_MODULE_H
2 #define _ASM_MODULE_H
3
4 #include <linux/list.h>
5 #include <asm/uaccess.h>
6
7 struct mod_arch_specific {
8         /* Data Bus Error exception tables */
9         struct list_head dbe_list;
10         const struct exception_table_entry *dbe_start;
11         const struct exception_table_entry *dbe_end;
12
13         unsigned int core_plt_offset;
14         unsigned int init_plt_offset;
15 };
16
17 typedef uint8_t Elf64_Byte;             /* Type for a 8-bit quantity.  */
18
19 typedef struct {
20         Elf64_Addr r_offset;                    /* Address of relocation.  */
21         Elf64_Word r_sym;                       /* Symbol index.  */
22         Elf64_Byte r_ssym;                      /* Special symbol.  */
23         Elf64_Byte r_type3;                     /* Third relocation.  */
24         Elf64_Byte r_type2;                     /* Second relocation.  */
25         Elf64_Byte r_type;                      /* First relocation.  */
26 } Elf64_Mips_Rel;
27
28 typedef struct {
29         Elf64_Addr r_offset;                    /* Address of relocation.  */
30         Elf64_Word r_sym;                       /* Symbol index.  */
31         Elf64_Byte r_ssym;                      /* Special symbol.  */
32         Elf64_Byte r_type3;                     /* Third relocation.  */
33         Elf64_Byte r_type2;                     /* Second relocation.  */
34         Elf64_Byte r_type;                      /* First relocation.  */
35         Elf64_Sxword r_addend;                  /* Addend.  */
36 } Elf64_Mips_Rela;
37
38 #ifdef CONFIG_32BIT
39
40 #define Elf_Shdr        Elf32_Shdr
41 #define Elf_Sym         Elf32_Sym
42 #define Elf_Ehdr        Elf32_Ehdr
43 #define Elf_Addr        Elf32_Addr
44
45 #define Elf_Mips_Rel    Elf32_Rel
46 #define Elf_Mips_Rela   Elf32_Rela
47
48 #define ELF_MIPS_R_SYM(rel) ELF32_R_SYM(rel.r_info)
49 #define ELF_MIPS_R_TYPE(rel) ELF32_R_TYPE(rel.r_info)
50
51 #endif
52
53 #ifdef CONFIG_64BIT
54
55 #define Elf_Shdr        Elf64_Shdr
56 #define Elf_Sym         Elf64_Sym
57 #define Elf_Ehdr        Elf64_Ehdr
58 #define Elf_Addr        Elf64_Addr
59
60 #define Elf_Mips_Rel    Elf64_Mips_Rel
61 #define Elf_Mips_Rela   Elf64_Mips_Rela
62
63 #define ELF_MIPS_R_SYM(rel) (rel.r_sym)
64 #define ELF_MIPS_R_TYPE(rel) (rel.r_type)
65
66 #endif
67
68 #ifdef CONFIG_MODULES
69 /* Given an address, look for it in the exception tables. */
70 const struct exception_table_entry*search_module_dbetables(unsigned long addr);
71 int module_relayout(Elf32_Ehdr *hdr, Elf32_Shdr *sechdrs,
72                     char *secstrings, unsigned symindex, struct module *me);
73 #else
74 /* Given an address, look for it in the exception tables. */
75 static inline const struct exception_table_entry *
76 search_module_dbetables(unsigned long addr)
77 {
78         return NULL;
79 }
80 #endif
81
82 #ifdef CONFIG_CPU_MIPS32_R1
83 #define MODULE_PROC_FAMILY "MIPS32_R1 "
84 #elif defined CONFIG_CPU_MIPS32_R2
85 #define MODULE_PROC_FAMILY "MIPS32_R2 "
86 #elif defined CONFIG_CPU_MIPS64_R1
87 #define MODULE_PROC_FAMILY "MIPS64_R1 "
88 #elif defined CONFIG_CPU_MIPS64_R2
89 #define MODULE_PROC_FAMILY "MIPS64_R2 "
90 #elif defined CONFIG_CPU_R3000
91 #define MODULE_PROC_FAMILY "R3000 "
92 #elif defined CONFIG_CPU_TX39XX
93 #define MODULE_PROC_FAMILY "TX39XX "
94 #elif defined CONFIG_CPU_VR41XX
95 #define MODULE_PROC_FAMILY "VR41XX "
96 #elif defined CONFIG_CPU_R4300
97 #define MODULE_PROC_FAMILY "R4300 "
98 #elif defined CONFIG_CPU_R4X00
99 #define MODULE_PROC_FAMILY "R4X00 "
100 #elif defined CONFIG_CPU_TX49XX
101 #define MODULE_PROC_FAMILY "TX49XX "
102 #elif defined CONFIG_CPU_R5000
103 #define MODULE_PROC_FAMILY "R5000 "
104 #elif defined CONFIG_CPU_R5432
105 #define MODULE_PROC_FAMILY "R5432 "
106 #elif defined CONFIG_CPU_R6000
107 #define MODULE_PROC_FAMILY "R6000 "
108 #elif defined CONFIG_CPU_NEVADA
109 #define MODULE_PROC_FAMILY "NEVADA "
110 #elif defined CONFIG_CPU_R8000
111 #define MODULE_PROC_FAMILY "R8000 "
112 #elif defined CONFIG_CPU_R10000
113 #define MODULE_PROC_FAMILY "R10000 "
114 #elif defined CONFIG_CPU_RM7000
115 #define MODULE_PROC_FAMILY "RM7000 "
116 #elif defined CONFIG_CPU_RM9000
117 #define MODULE_PROC_FAMILY "RM9000 "
118 #elif defined CONFIG_CPU_SB1
119 #define MODULE_PROC_FAMILY "SB1 "
120 #elif defined CONFIG_CPU_LOONGSON2
121 #define MODULE_PROC_FAMILY "LOONGSON2 "
122 #else
123 #error MODULE_PROC_FAMILY undefined for your processor configuration
124 #endif
125
126 #ifdef CONFIG_32BIT
127 #define MODULE_KERNEL_TYPE "32BIT "
128 #elif defined CONFIG_64BIT
129 #define MODULE_KERNEL_TYPE "64BIT "
130 #endif
131
132 #ifdef CONFIG_MIPS_MT_SMTC
133 #define MODULE_KERNEL_SMTC "MT_SMTC "
134 #else
135 #define MODULE_KERNEL_SMTC ""
136 #endif
137
138 #define MODULE_ARCH_VERMAGIC \
139         MODULE_PROC_FAMILY MODULE_KERNEL_TYPE MODULE_KERNEL_SMTC
140
141 #endif /* _ASM_MODULE_H */
Note: See TracBrowser for help on using the browser.