diff options
Diffstat (limited to 'arch/blackfin/kernel/kgdb.c')
-rw-r--r-- | arch/blackfin/kernel/kgdb.c | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/arch/blackfin/kernel/kgdb.c b/arch/blackfin/kernel/kgdb.c index 08bc44ea6883..9b80b152435e 100644 --- a/arch/blackfin/kernel/kgdb.c +++ b/arch/blackfin/kernel/kgdb.c | |||
@@ -181,7 +181,7 @@ static int bfin_set_hw_break(unsigned long addr, int len, enum kgdb_bptype type) | |||
181 | return -ENOSPC; | 181 | return -ENOSPC; |
182 | } | 182 | } |
183 | 183 | ||
184 | /* Becasue hardware data watchpoint impelemented in current | 184 | /* Because hardware data watchpoint impelemented in current |
185 | * Blackfin can not trigger an exception event as the hardware | 185 | * Blackfin can not trigger an exception event as the hardware |
186 | * instrction watchpoint does, we ignaore all data watch point here. | 186 | * instrction watchpoint does, we ignaore all data watch point here. |
187 | * They can be turned on easily after future blackfin design | 187 | * They can be turned on easily after future blackfin design |
@@ -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); |
@@ -345,6 +345,23 @@ void kgdb_roundup_cpu(int cpu, unsigned long flags) | |||
345 | } | 345 | } |
346 | #endif | 346 | #endif |
347 | 347 | ||
348 | #ifdef CONFIG_IPIPE | ||
349 | static unsigned long kgdb_arch_imask; | ||
350 | #endif | ||
351 | |||
352 | void kgdb_post_primary_code(struct pt_regs *regs, int e_vector, int err_code) | ||
353 | { | ||
354 | if (kgdb_single_step) | ||
355 | preempt_enable(); | ||
356 | |||
357 | #ifdef CONFIG_IPIPE | ||
358 | if (kgdb_arch_imask) { | ||
359 | cpu_pda[raw_smp_processor_id()].ex_imask = kgdb_arch_imask; | ||
360 | kgdb_arch_imask = 0; | ||
361 | } | ||
362 | #endif | ||
363 | } | ||
364 | |||
348 | int kgdb_arch_handle_exception(int vector, int signo, | 365 | int kgdb_arch_handle_exception(int vector, int signo, |
349 | int err_code, char *remcom_in_buffer, | 366 | int err_code, char *remcom_in_buffer, |
350 | char *remcom_out_buffer, | 367 | char *remcom_out_buffer, |
@@ -388,6 +405,12 @@ int kgdb_arch_handle_exception(int vector, int signo, | |||
388 | * kgdb_single_step > 0 means in single step mode | 405 | * kgdb_single_step > 0 means in single step mode |
389 | */ | 406 | */ |
390 | kgdb_single_step = i + 1; | 407 | kgdb_single_step = i + 1; |
408 | |||
409 | preempt_disable(); | ||
410 | #ifdef CONFIG_IPIPE | ||
411 | kgdb_arch_imask = cpu_pda[raw_smp_processor_id()].ex_imask; | ||
412 | cpu_pda[raw_smp_processor_id()].ex_imask = 0; | ||
413 | #endif | ||
391 | } | 414 | } |
392 | 415 | ||
393 | bfin_correct_hw_break(); | 416 | bfin_correct_hw_break(); |
@@ -399,13 +422,10 @@ int kgdb_arch_handle_exception(int vector, int signo, | |||
399 | 422 | ||
400 | struct kgdb_arch arch_kgdb_ops = { | 423 | struct kgdb_arch arch_kgdb_ops = { |
401 | .gdb_bpt_instr = {0xa1}, | 424 | .gdb_bpt_instr = {0xa1}, |
402 | #ifdef CONFIG_SMP | ||
403 | .flags = KGDB_HW_BREAKPOINT|KGDB_THR_PROC_SWAP, | ||
404 | #else | ||
405 | .flags = KGDB_HW_BREAKPOINT, | 425 | .flags = KGDB_HW_BREAKPOINT, |
406 | #endif | ||
407 | .set_hw_breakpoint = bfin_set_hw_break, | 426 | .set_hw_breakpoint = bfin_set_hw_break, |
408 | .remove_hw_breakpoint = bfin_remove_hw_break, | 427 | .remove_hw_breakpoint = bfin_remove_hw_break, |
428 | .disable_hw_break = bfin_disable_hw_debug, | ||
409 | .remove_all_hw_break = bfin_remove_all_hw_break, | 429 | .remove_all_hw_break = bfin_remove_all_hw_break, |
410 | .correct_hw_break = bfin_correct_hw_break, | 430 | .correct_hw_break = bfin_correct_hw_break, |
411 | }; | 431 | }; |
@@ -447,6 +467,9 @@ void kgdb_arch_set_pc(struct pt_regs *regs, unsigned long ip) | |||
447 | int kgdb_arch_init(void) | 467 | int kgdb_arch_init(void) |
448 | { | 468 | { |
449 | kgdb_single_step = 0; | 469 | kgdb_single_step = 0; |
470 | #ifdef CONFIG_IPIPE | ||
471 | kgdb_arch_imask = 0; | ||
472 | #endif | ||
450 | 473 | ||
451 | bfin_remove_all_hw_break(); | 474 | bfin_remove_all_hw_break(); |
452 | return 0; | 475 | return 0; |