diff options
author | Dongdong Deng <dongdong.deng@windriver.com> | 2010-08-18 07:02:00 -0400 |
---|---|---|
committer | Jason Wessel <jason.wessel@windriver.com> | 2010-10-29 14:14:41 -0400 |
commit | d7ba979d45272385ce0fdf141d922e61ff48e07b (patch) | |
tree | 713ffb5f2e079c6abdeb15cd4830a014df12db9b | |
parent | 578bd4dfcda63d2ef15f025f1d5d55c0e56b9660 (diff) |
debug_core,x86,blackfin: Clean up hw debug disable API
The kgdb_disable_hw_debug() was an architecture specific function for
disabling all hardware breakpoints on a per cpu basis when entering
the debug core.
This patch will remove the weak function kdbg_disable_hw_debug() and
change it into a call back which lives with the rest of hw breakpoint
call backs in struct kgdb_arch.
Signed-off-by: Dongdong Deng <dongdong.deng@windriver.com>
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
-rw-r--r-- | arch/blackfin/kernel/kgdb.c | 3 | ||||
-rw-r--r-- | arch/x86/kernel/kgdb.c | 3 | ||||
-rw-r--r-- | include/linux/kgdb.h | 13 | ||||
-rw-r--r-- | kernel/debug/debug_core.c | 16 |
4 files changed, 10 insertions, 25 deletions
diff --git a/arch/blackfin/kernel/kgdb.c b/arch/blackfin/kernel/kgdb.c index 08bc44ea6883..edae461b1c54 100644 --- a/arch/blackfin/kernel/kgdb.c +++ b/arch/blackfin/kernel/kgdb.c | |||
@@ -320,7 +320,7 @@ static void bfin_correct_hw_break(void) | |||
320 | } | 320 | } |
321 | } | 321 | } |
322 | 322 | ||
323 | void kgdb_disable_hw_debug(struct pt_regs *regs) | 323 | static void bfin_disable_hw_debug(struct pt_regs *regs) |
324 | { | 324 | { |
325 | /* Disable hardware debugging while we are in kgdb */ | 325 | /* Disable hardware debugging while we are in kgdb */ |
326 | bfin_write_WPIACTL(0); | 326 | bfin_write_WPIACTL(0); |
@@ -406,6 +406,7 @@ struct kgdb_arch arch_kgdb_ops = { | |||
406 | #endif | 406 | #endif |
407 | .set_hw_breakpoint = bfin_set_hw_break, | 407 | .set_hw_breakpoint = bfin_set_hw_break, |
408 | .remove_hw_breakpoint = bfin_remove_hw_break, | 408 | .remove_hw_breakpoint = bfin_remove_hw_break, |
409 | .disable_hw_break = bfin_disable_hw_debug, | ||
409 | .remove_all_hw_break = bfin_remove_all_hw_break, | 410 | .remove_all_hw_break = bfin_remove_all_hw_break, |
410 | .correct_hw_break = bfin_correct_hw_break, | 411 | .correct_hw_break = bfin_correct_hw_break, |
411 | }; | 412 | }; |
diff --git a/arch/x86/kernel/kgdb.c b/arch/x86/kernel/kgdb.c index d81cfebb848f..ec592caac4b4 100644 --- a/arch/x86/kernel/kgdb.c +++ b/arch/x86/kernel/kgdb.c | |||
@@ -387,7 +387,7 @@ kgdb_set_hw_break(unsigned long addr, int len, enum kgdb_bptype bptype) | |||
387 | * disable hardware debugging while it is processing gdb packets or | 387 | * disable hardware debugging while it is processing gdb packets or |
388 | * handling exception. | 388 | * handling exception. |
389 | */ | 389 | */ |
390 | void kgdb_disable_hw_debug(struct pt_regs *regs) | 390 | static void kgdb_disable_hw_debug(struct pt_regs *regs) |
391 | { | 391 | { |
392 | int i; | 392 | int i; |
393 | int cpu = raw_smp_processor_id(); | 393 | int cpu = raw_smp_processor_id(); |
@@ -724,6 +724,7 @@ struct kgdb_arch arch_kgdb_ops = { | |||
724 | .flags = KGDB_HW_BREAKPOINT, | 724 | .flags = KGDB_HW_BREAKPOINT, |
725 | .set_hw_breakpoint = kgdb_set_hw_break, | 725 | .set_hw_breakpoint = kgdb_set_hw_break, |
726 | .remove_hw_breakpoint = kgdb_remove_hw_break, | 726 | .remove_hw_breakpoint = kgdb_remove_hw_break, |
727 | .disable_hw_break = kgdb_disable_hw_debug, | ||
727 | .remove_all_hw_break = kgdb_remove_all_hw_break, | 728 | .remove_all_hw_break = kgdb_remove_all_hw_break, |
728 | .correct_hw_break = kgdb_correct_hw_break, | 729 | .correct_hw_break = kgdb_correct_hw_break, |
729 | }; | 730 | }; |
diff --git a/include/linux/kgdb.h b/include/linux/kgdb.h index cc96f0f23e04..092e4250a458 100644 --- a/include/linux/kgdb.h +++ b/include/linux/kgdb.h | |||
@@ -35,16 +35,6 @@ struct pt_regs; | |||
35 | */ | 35 | */ |
36 | extern int kgdb_skipexception(int exception, struct pt_regs *regs); | 36 | extern int kgdb_skipexception(int exception, struct pt_regs *regs); |
37 | 37 | ||
38 | /** | ||
39 | * kgdb_disable_hw_debug - (optional) Disable hardware debugging hook | ||
40 | * @regs: Current &struct pt_regs. | ||
41 | * | ||
42 | * This function will be called if the particular architecture must | ||
43 | * disable hardware debugging while it is processing gdb packets or | ||
44 | * handling exception. | ||
45 | */ | ||
46 | extern void kgdb_disable_hw_debug(struct pt_regs *regs); | ||
47 | |||
48 | struct tasklet_struct; | 38 | struct tasklet_struct; |
49 | struct task_struct; | 39 | struct task_struct; |
50 | struct uart_port; | 40 | struct uart_port; |
@@ -243,6 +233,8 @@ extern void kgdb_arch_late(void); | |||
243 | * breakpoint. | 233 | * breakpoint. |
244 | * @remove_hw_breakpoint: Allow an architecture to specify how to remove a | 234 | * @remove_hw_breakpoint: Allow an architecture to specify how to remove a |
245 | * hardware breakpoint. | 235 | * hardware breakpoint. |
236 | * @disable_hw_break: Allow an architecture to specify how to disable | ||
237 | * hardware breakpoints for a single cpu. | ||
246 | * @remove_all_hw_break: Allow an architecture to specify how to remove all | 238 | * @remove_all_hw_break: Allow an architecture to specify how to remove all |
247 | * hardware breakpoints. | 239 | * hardware breakpoints. |
248 | * @correct_hw_break: Allow an architecture to specify how to correct the | 240 | * @correct_hw_break: Allow an architecture to specify how to correct the |
@@ -256,6 +248,7 @@ struct kgdb_arch { | |||
256 | int (*remove_breakpoint)(unsigned long, char *); | 248 | int (*remove_breakpoint)(unsigned long, char *); |
257 | int (*set_hw_breakpoint)(unsigned long, int, enum kgdb_bptype); | 249 | int (*set_hw_breakpoint)(unsigned long, int, enum kgdb_bptype); |
258 | int (*remove_hw_breakpoint)(unsigned long, int, enum kgdb_bptype); | 250 | int (*remove_hw_breakpoint)(unsigned long, int, enum kgdb_bptype); |
251 | void (*disable_hw_break)(struct pt_regs *regs); | ||
259 | void (*remove_all_hw_break)(void); | 252 | void (*remove_all_hw_break)(void); |
260 | void (*correct_hw_break)(void); | 253 | void (*correct_hw_break)(void); |
261 | }; | 254 | }; |
diff --git a/kernel/debug/debug_core.c b/kernel/debug/debug_core.c index fec596da9bd0..cefd4a11f6d9 100644 --- a/kernel/debug/debug_core.c +++ b/kernel/debug/debug_core.c | |||
@@ -209,18 +209,6 @@ int __weak kgdb_skipexception(int exception, struct pt_regs *regs) | |||
209 | return 0; | 209 | return 0; |
210 | } | 210 | } |
211 | 211 | ||
212 | /** | ||
213 | * kgdb_disable_hw_debug - Disable hardware debugging while we in kgdb. | ||
214 | * @regs: Current &struct pt_regs. | ||
215 | * | ||
216 | * This function will be called if the particular architecture must | ||
217 | * disable hardware debugging while it is processing gdb packets or | ||
218 | * handling exception. | ||
219 | */ | ||
220 | void __weak kgdb_disable_hw_debug(struct pt_regs *regs) | ||
221 | { | ||
222 | } | ||
223 | |||
224 | /* | 212 | /* |
225 | * Some architectures need cache flushes when we set/clear a | 213 | * Some architectures need cache flushes when we set/clear a |
226 | * breakpoint: | 214 | * breakpoint: |
@@ -484,7 +472,9 @@ static int kgdb_cpu_enter(struct kgdb_state *ks, struct pt_regs *regs, | |||
484 | atomic_inc(&masters_in_kgdb); | 472 | atomic_inc(&masters_in_kgdb); |
485 | else | 473 | else |
486 | atomic_inc(&slaves_in_kgdb); | 474 | atomic_inc(&slaves_in_kgdb); |
487 | kgdb_disable_hw_debug(ks->linux_regs); | 475 | |
476 | if (arch_kgdb_ops.disable_hw_break) | ||
477 | arch_kgdb_ops.disable_hw_break(regs); | ||
488 | 478 | ||
489 | acquirelock: | 479 | acquirelock: |
490 | /* | 480 | /* |