diff options
-rw-r--r-- | arch/powerpc/kernel/process.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index 6e2f03566b0d..84f000a45e36 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c | |||
@@ -219,22 +219,26 @@ void discard_lazy_cpu_state(void) | |||
219 | } | 219 | } |
220 | #endif /* CONFIG_SMP */ | 220 | #endif /* CONFIG_SMP */ |
221 | 221 | ||
222 | #ifdef CONFIG_PPC_MERGE /* XXX for now */ | ||
223 | int set_dabr(unsigned long dabr) | 222 | int set_dabr(unsigned long dabr) |
224 | { | 223 | { |
224 | #ifdef CONFIG_PPC_MERGE /* XXX for now */ | ||
225 | if (ppc_md.set_dabr) | 225 | if (ppc_md.set_dabr) |
226 | return ppc_md.set_dabr(dabr); | 226 | return ppc_md.set_dabr(dabr); |
227 | #endif | ||
227 | 228 | ||
229 | /* XXX should we have a CPU_FTR_HAS_DABR ? */ | ||
230 | #if defined(CONFIG_PPC64) || defined(CONFIG_6xx) | ||
228 | mtspr(SPRN_DABR, dabr); | 231 | mtspr(SPRN_DABR, dabr); |
232 | #endif | ||
229 | return 0; | 233 | return 0; |
230 | } | 234 | } |
231 | #endif | ||
232 | 235 | ||
233 | #ifdef CONFIG_PPC64 | 236 | #ifdef CONFIG_PPC64 |
234 | DEFINE_PER_CPU(struct cpu_usage, cpu_usage_array); | 237 | DEFINE_PER_CPU(struct cpu_usage, cpu_usage_array); |
235 | static DEFINE_PER_CPU(unsigned long, current_dabr); | ||
236 | #endif | 238 | #endif |
237 | 239 | ||
240 | static DEFINE_PER_CPU(unsigned long, current_dabr); | ||
241 | |||
238 | struct task_struct *__switch_to(struct task_struct *prev, | 242 | struct task_struct *__switch_to(struct task_struct *prev, |
239 | struct task_struct *new) | 243 | struct task_struct *new) |
240 | { | 244 | { |
@@ -299,12 +303,10 @@ struct task_struct *__switch_to(struct task_struct *prev, | |||
299 | 303 | ||
300 | #endif /* CONFIG_SMP */ | 304 | #endif /* CONFIG_SMP */ |
301 | 305 | ||
302 | #ifdef CONFIG_PPC64 /* for now */ | ||
303 | if (unlikely(__get_cpu_var(current_dabr) != new->thread.dabr)) { | 306 | if (unlikely(__get_cpu_var(current_dabr) != new->thread.dabr)) { |
304 | set_dabr(new->thread.dabr); | 307 | set_dabr(new->thread.dabr); |
305 | __get_cpu_var(current_dabr) = new->thread.dabr; | 308 | __get_cpu_var(current_dabr) = new->thread.dabr; |
306 | } | 309 | } |
307 | #endif /* CONFIG_PPC64 */ | ||
308 | 310 | ||
309 | new_thread = &new->thread; | 311 | new_thread = &new->thread; |
310 | old_thread = ¤t->thread; | 312 | old_thread = ¤t->thread; |
@@ -473,12 +475,10 @@ void flush_thread(void) | |||
473 | 475 | ||
474 | discard_lazy_cpu_state(); | 476 | discard_lazy_cpu_state(); |
475 | 477 | ||
476 | #ifdef CONFIG_PPC64 /* for now */ | ||
477 | if (current->thread.dabr) { | 478 | if (current->thread.dabr) { |
478 | current->thread.dabr = 0; | 479 | current->thread.dabr = 0; |
479 | set_dabr(0); | 480 | set_dabr(0); |
480 | } | 481 | } |
481 | #endif | ||
482 | } | 482 | } |
483 | 483 | ||
484 | void | 484 | void |