diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2007-06-04 01:15:48 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-06-14 08:29:57 -0400 |
commit | 791cc501d422be96d6e3098faf6471ba29f4dd33 (patch) | |
tree | ab148d7193442a8a95c0f89fd96aa69f4fbbd4a3 /arch/powerpc | |
parent | 6d110da8c3c62167c54eb5e32bb80916a1a23362 (diff) |
[POWERPC] Always apply DABR changes on context switches
This patch removes the #ifdef CONFIG_PPC64 around setting the DABR.
The actual setting of the SPR inside of the set_dabr() function is dependent
on CONFIG_PPC64 || CONFIG_6xx but you can always provide a ppc_md hook to
override that. We should improve support for different HW breakpoints
facilities but this is a first step.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc')
-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 |