diff options
author | Sonic Zhang <sonic.zhang@analog.com> | 2010-11-17 01:52:39 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2011-01-10 07:18:23 -0500 |
commit | b68233e7f0126dfe59e1a064da9e37827c1f35ec (patch) | |
tree | 79f7891894b4a943a7166a42f8c404b1de281a39 /arch/blackfin | |
parent | 900de05182d520ff66378e74a7b18f7d9971a32d (diff) |
Blackfin: kgdb: disable preempt schedule when running single step in kgdb
Otherwise, gdb continue operation after a breakpoint is hit may trap
into endless breakpoint.
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'arch/blackfin')
-rw-r--r-- | arch/blackfin/kernel/kgdb.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/arch/blackfin/kernel/kgdb.c b/arch/blackfin/kernel/kgdb.c index e89ef34f744f..eb92592fd80c 100644 --- a/arch/blackfin/kernel/kgdb.c +++ b/arch/blackfin/kernel/kgdb.c | |||
@@ -347,15 +347,20 @@ void kgdb_roundup_cpu(int cpu, unsigned long flags) | |||
347 | 347 | ||
348 | #ifdef CONFIG_IPIPE | 348 | #ifdef CONFIG_IPIPE |
349 | static unsigned long kgdb_arch_imask; | 349 | static unsigned long kgdb_arch_imask; |
350 | #endif | ||
350 | 351 | ||
351 | void kgdb_post_primary_code(struct pt_regs *regs, int e_vector, int err_code) | 352 | void kgdb_post_primary_code(struct pt_regs *regs, int e_vector, int err_code) |
352 | { | 353 | { |
354 | if (kgdb_single_step) | ||
355 | preempt_enable(); | ||
356 | |||
357 | #ifdef CONFIG_IPIPE | ||
353 | if (kgdb_arch_imask) { | 358 | if (kgdb_arch_imask) { |
354 | cpu_pda[raw_smp_processor_id()].ex_imask = kgdb_arch_imask; | 359 | cpu_pda[raw_smp_processor_id()].ex_imask = kgdb_arch_imask; |
355 | kgdb_arch_imask = 0; | 360 | kgdb_arch_imask = 0; |
356 | } | 361 | } |
357 | } | ||
358 | #endif | 362 | #endif |
363 | } | ||
359 | 364 | ||
360 | int kgdb_arch_handle_exception(int vector, int signo, | 365 | int kgdb_arch_handle_exception(int vector, int signo, |
361 | int err_code, char *remcom_in_buffer, | 366 | int err_code, char *remcom_in_buffer, |
@@ -401,6 +406,7 @@ int kgdb_arch_handle_exception(int vector, int signo, | |||
401 | */ | 406 | */ |
402 | kgdb_single_step = i + 1; | 407 | kgdb_single_step = i + 1; |
403 | 408 | ||
409 | preempt_disable(); | ||
404 | #ifdef CONFIG_IPIPE | 410 | #ifdef CONFIG_IPIPE |
405 | kgdb_arch_imask = cpu_pda[raw_smp_processor_id()].ex_imask; | 411 | kgdb_arch_imask = cpu_pda[raw_smp_processor_id()].ex_imask; |
406 | cpu_pda[raw_smp_processor_id()].ex_imask = 0; | 412 | cpu_pda[raw_smp_processor_id()].ex_imask = 0; |