diff options
author | Mikael Starvik <mikael.starvik@axis.com> | 2005-07-27 14:44:43 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-07-27 19:26:01 -0400 |
commit | 5d01e6ce785884a5db5792cd2e5bb36fa82fe23c (patch) | |
tree | aec09f0c058a6750904b947733a6cc7033359447 /arch/cris/kernel | |
parent | dcf1310b72149d016970c666539d4d73bb77c086 (diff) |
[PATCH] CRIS update: updates for 2.6.12
Patches to make CRIS work with 2.6.12.
Signed-off-by: Mikael Starvik <starvik@axis.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/cris/kernel')
-rw-r--r-- | arch/cris/kernel/module.c | 39 | ||||
-rw-r--r-- | arch/cris/kernel/process.c | 31 |
2 files changed, 39 insertions, 31 deletions
diff --git a/arch/cris/kernel/module.c b/arch/cris/kernel/module.c index f1d3e784f30c..11b867df8617 100644 --- a/arch/cris/kernel/module.c +++ b/arch/cris/kernel/module.c | |||
@@ -32,7 +32,7 @@ void *module_alloc(unsigned long size) | |||
32 | { | 32 | { |
33 | if (size == 0) | 33 | if (size == 0) |
34 | return NULL; | 34 | return NULL; |
35 | return vmalloc(size); | 35 | return vmalloc_exec(size); |
36 | } | 36 | } |
37 | 37 | ||
38 | 38 | ||
@@ -59,26 +59,8 @@ int apply_relocate(Elf32_Shdr *sechdrs, | |||
59 | unsigned int relsec, | 59 | unsigned int relsec, |
60 | struct module *me) | 60 | struct module *me) |
61 | { | 61 | { |
62 | unsigned int i; | 62 | printk(KERN_ERR "module %s: REL relocation unsupported\n", me->name); |
63 | Elf32_Rel *rel = (void *)sechdrs[relsec].sh_addr; | 63 | return -ENOEXEC; |
64 | Elf32_Sym *sym; | ||
65 | uint32_t *location; | ||
66 | |||
67 | DEBUGP("Applying relocate section %u to %u\n", relsec, | ||
68 | sechdrs[relsec].sh_info); | ||
69 | for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) { | ||
70 | /* This is where to make the change */ | ||
71 | location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_offset | ||
72 | + rel[i].r_offset; | ||
73 | /* This is the symbol it is referring to. Note that all | ||
74 | undefined symbols have been resolved. */ | ||
75 | sym = (Elf32_Sym *)sechdrs[symindex].sh_addr | ||
76 | + ELF32_R_SYM(rel[i].r_info); | ||
77 | |||
78 | /* We add the value into the location given */ | ||
79 | *location += sym->st_value; | ||
80 | } | ||
81 | return 0; | ||
82 | } | 64 | } |
83 | 65 | ||
84 | int apply_relocate_add(Elf32_Shdr *sechdrs, | 66 | int apply_relocate_add(Elf32_Shdr *sechdrs, |
@@ -90,7 +72,7 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, | |||
90 | unsigned int i; | 72 | unsigned int i; |
91 | Elf32_Rela *rela = (void *)sechdrs[relsec].sh_addr; | 73 | Elf32_Rela *rela = (void *)sechdrs[relsec].sh_addr; |
92 | 74 | ||
93 | DEBUGP ("Applying relocate section %u to %u\n", relsec, | 75 | DEBUGP ("Applying add relocate section %u to %u\n", relsec, |
94 | sechdrs[relsec].sh_info); | 76 | sechdrs[relsec].sh_info); |
95 | 77 | ||
96 | for (i = 0; i < sechdrs[relsec].sh_size / sizeof (*rela); i++) { | 78 | for (i = 0; i < sechdrs[relsec].sh_size / sizeof (*rela); i++) { |
@@ -103,7 +85,18 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, | |||
103 | Elf32_Sym *sym | 85 | Elf32_Sym *sym |
104 | = ((Elf32_Sym *)sechdrs[symindex].sh_addr | 86 | = ((Elf32_Sym *)sechdrs[symindex].sh_addr |
105 | + ELF32_R_SYM (rela[i].r_info)); | 87 | + ELF32_R_SYM (rela[i].r_info)); |
106 | *loc = sym->st_value + rela[i].r_addend; | 88 | switch (ELF32_R_TYPE(rela[i].r_info)) { |
89 | case R_CRIS_32: | ||
90 | *loc = sym->st_value + rela[i].r_addend; | ||
91 | break; | ||
92 | case R_CRIS_32_PCREL: | ||
93 | *loc = sym->st_value - (unsigned)loc + rela[i].r_addend - 4; | ||
94 | break; | ||
95 | default: | ||
96 | printk(KERN_ERR "module %s: Unknown relocation: %u\n", | ||
97 | me->name, ELF32_R_TYPE(rela[i].r_info)); | ||
98 | return -ENOEXEC; | ||
99 | } | ||
107 | } | 100 | } |
108 | 101 | ||
109 | return 0; | 102 | return 0; |
diff --git a/arch/cris/kernel/process.c b/arch/cris/kernel/process.c index a5ad2b675853..949a0e40e03c 100644 --- a/arch/cris/kernel/process.c +++ b/arch/cris/kernel/process.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: process.c,v 1.17 2004/04/05 13:53:48 starvik Exp $ | 1 | /* $Id: process.c,v 1.21 2005/03/04 08:16:17 starvik Exp $ |
2 | * | 2 | * |
3 | * linux/arch/cris/kernel/process.c | 3 | * linux/arch/cris/kernel/process.c |
4 | * | 4 | * |
@@ -8,6 +8,18 @@ | |||
8 | * Authors: Bjorn Wesen (bjornw@axis.com) | 8 | * Authors: Bjorn Wesen (bjornw@axis.com) |
9 | * | 9 | * |
10 | * $Log: process.c,v $ | 10 | * $Log: process.c,v $ |
11 | * Revision 1.21 2005/03/04 08:16:17 starvik | ||
12 | * Merge of Linux 2.6.11. | ||
13 | * | ||
14 | * Revision 1.20 2005/01/18 05:57:22 starvik | ||
15 | * Renamed hlt_counter to cris_hlt_counter and made it global. | ||
16 | * | ||
17 | * Revision 1.19 2004/10/19 13:07:43 starvik | ||
18 | * Merge of Linux 2.6.9 | ||
19 | * | ||
20 | * Revision 1.18 2004/08/16 12:37:23 starvik | ||
21 | * Merge of Linux 2.6.8 | ||
22 | * | ||
11 | * Revision 1.17 2004/04/05 13:53:48 starvik | 23 | * Revision 1.17 2004/04/05 13:53:48 starvik |
12 | * Merge of Linux 2.6.5 | 24 | * Merge of Linux 2.6.5 |
13 | * | 25 | * |
@@ -161,18 +173,18 @@ EXPORT_SYMBOL(init_task); | |||
161 | * region by enable_hlt/disable_hlt. | 173 | * region by enable_hlt/disable_hlt. |
162 | */ | 174 | */ |
163 | 175 | ||
164 | static int hlt_counter=0; | 176 | int cris_hlt_counter=0; |
165 | 177 | ||
166 | void disable_hlt(void) | 178 | void disable_hlt(void) |
167 | { | 179 | { |
168 | hlt_counter++; | 180 | cris_hlt_counter++; |
169 | } | 181 | } |
170 | 182 | ||
171 | EXPORT_SYMBOL(disable_hlt); | 183 | EXPORT_SYMBOL(disable_hlt); |
172 | 184 | ||
173 | void enable_hlt(void) | 185 | void enable_hlt(void) |
174 | { | 186 | { |
175 | hlt_counter--; | 187 | cris_hlt_counter--; |
176 | } | 188 | } |
177 | 189 | ||
178 | EXPORT_SYMBOL(enable_hlt); | 190 | EXPORT_SYMBOL(enable_hlt); |
@@ -195,16 +207,19 @@ void cpu_idle (void) | |||
195 | /* endless idle loop with no priority at all */ | 207 | /* endless idle loop with no priority at all */ |
196 | while (1) { | 208 | while (1) { |
197 | while (!need_resched()) { | 209 | while (!need_resched()) { |
198 | void (*idle)(void) = pm_idle; | 210 | void (*idle)(void); |
199 | 211 | /* | |
212 | * Mark this as an RCU critical section so that | ||
213 | * synchronize_kernel() in the unload path waits | ||
214 | * for our completion. | ||
215 | */ | ||
216 | idle = pm_idle; | ||
200 | if (!idle) | 217 | if (!idle) |
201 | idle = default_idle; | 218 | idle = default_idle; |
202 | |||
203 | idle(); | 219 | idle(); |
204 | } | 220 | } |
205 | schedule(); | 221 | schedule(); |
206 | } | 222 | } |
207 | |||
208 | } | 223 | } |
209 | 224 | ||
210 | void hard_reset_now (void); | 225 | void hard_reset_now (void); |