Commit 900de051 authored by Sonic Zhang's avatar Sonic Zhang Committed by Mike Frysinger

Blackfin: kgdb: disable interrupt when single stepping in ADEOS

When ADEOS and kgdb are both enabled, single step in linux kernel may be
scheduled to Xenomai core after return from interrupt handlers.  This
blocks gdb continue operation after a break point is hit.  So, disable
interrupt when running gdb single step.
Signed-off-by: default avatarSonic Zhang <sonic.zhang@analog.com>
Signed-off-by: default avatarMike Frysinger <vapier@gentoo.org>
parent 84e97c10
...@@ -345,6 +345,18 @@ void kgdb_roundup_cpu(int cpu, unsigned long flags) ...@@ -345,6 +345,18 @@ void kgdb_roundup_cpu(int cpu, unsigned long flags)
} }
#endif #endif
#ifdef CONFIG_IPIPE
static unsigned long kgdb_arch_imask;
void kgdb_post_primary_code(struct pt_regs *regs, int e_vector, int err_code)
{
if (kgdb_arch_imask) {
cpu_pda[raw_smp_processor_id()].ex_imask = kgdb_arch_imask;
kgdb_arch_imask = 0;
}
}
#endif
int kgdb_arch_handle_exception(int vector, int signo, int kgdb_arch_handle_exception(int vector, int signo,
int err_code, char *remcom_in_buffer, int err_code, char *remcom_in_buffer,
char *remcom_out_buffer, char *remcom_out_buffer,
...@@ -388,6 +400,11 @@ int kgdb_arch_handle_exception(int vector, int signo, ...@@ -388,6 +400,11 @@ int kgdb_arch_handle_exception(int vector, int signo,
* kgdb_single_step > 0 means in single step mode * kgdb_single_step > 0 means in single step mode
*/ */
kgdb_single_step = i + 1; kgdb_single_step = i + 1;
#ifdef CONFIG_IPIPE
kgdb_arch_imask = cpu_pda[raw_smp_processor_id()].ex_imask;
cpu_pda[raw_smp_processor_id()].ex_imask = 0;
#endif
} }
bfin_correct_hw_break(); bfin_correct_hw_break();
...@@ -448,6 +465,9 @@ void kgdb_arch_set_pc(struct pt_regs *regs, unsigned long ip) ...@@ -448,6 +465,9 @@ void kgdb_arch_set_pc(struct pt_regs *regs, unsigned long ip)
int kgdb_arch_init(void) int kgdb_arch_init(void)
{ {
kgdb_single_step = 0; kgdb_single_step = 0;
#ifdef CONFIG_IPIPE
kgdb_arch_imask = 0;
#endif
bfin_remove_all_hw_break(); bfin_remove_all_hw_break();
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment