aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/debug/debug_core.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/kernel/debug/debug_core.c b/kernel/debug/debug_core.c
index 375e42f0baf0..fff59019cca0 100644
--- a/kernel/debug/debug_core.c
+++ b/kernel/debug/debug_core.c
@@ -114,6 +114,7 @@ EXPORT_SYMBOL_GPL(kgdb_active);
114 */ 114 */
115static atomic_t passive_cpu_wait[NR_CPUS]; 115static atomic_t passive_cpu_wait[NR_CPUS];
116static atomic_t cpu_in_kgdb[NR_CPUS]; 116static atomic_t cpu_in_kgdb[NR_CPUS];
117static atomic_t kgdb_break_tasklet_var;
117atomic_t kgdb_setting_breakpoint; 118atomic_t kgdb_setting_breakpoint;
118 119
119struct task_struct *kgdb_usethread; 120struct task_struct *kgdb_usethread;
@@ -789,6 +790,31 @@ static void kgdb_unregister_callbacks(void)
789 } 790 }
790} 791}
791 792
793/*
794 * There are times a tasklet needs to be used vs a compiled in
795 * break point so as to cause an exception outside a kgdb I/O module,
796 * such as is the case with kgdboe, where calling a breakpoint in the
797 * I/O driver itself would be fatal.
798 */
799static void kgdb_tasklet_bpt(unsigned long ing)
800{
801 kgdb_breakpoint();
802 atomic_set(&kgdb_break_tasklet_var, 0);
803}
804
805static DECLARE_TASKLET(kgdb_tasklet_breakpoint, kgdb_tasklet_bpt, 0);
806
807void kgdb_schedule_breakpoint(void)
808{
809 if (atomic_read(&kgdb_break_tasklet_var) ||
810 atomic_read(&kgdb_active) != -1 ||
811 atomic_read(&kgdb_setting_breakpoint))
812 return;
813 atomic_inc(&kgdb_break_tasklet_var);
814 tasklet_schedule(&kgdb_tasklet_breakpoint);
815}
816EXPORT_SYMBOL_GPL(kgdb_schedule_breakpoint);
817
792static void kgdb_initial_breakpoint(void) 818static void kgdb_initial_breakpoint(void)
793{ 819{
794 kgdb_break_asap = 0; 820 kgdb_break_asap = 0;