summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-05-21 11:10:41 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2010-05-21 11:10:41 -0700
commitac3ee84c604502240122c47b52f0542ec8774f15 (patch)
treefa74b50e310af6cef3298a052514b2d42b260d6b /kernel
parent90b9a32d8f441369b2f97a765d2d957b531eb653 (diff)
parent4fe1da4ebc18c4c42fa56c228447f68033fce5f0 (diff)
downloadlinux-ac3ee84c604502240122c47b52f0542ec8774f15.tar.gz
linux-ac3ee84c604502240122c47b52f0542ec8774f15.tar.bz2
linux-ac3ee84c604502240122c47b52f0542ec8774f15.zip
Merge branch 'dbg-early-merge' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb
* 'dbg-early-merge' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb: echi-dbgp: Add kernel debugger support for the usb debug port earlyprintk,vga,kdb: Fix \b and \r for earlyprintk=vga with kdb kgdboc: Add ekgdboc for early use of the kernel debugger x86,early dr regs,kgdb: Allow kernel debugger early dr register access x86,kgdb: Implement early hardware breakpoint debugging x86, kgdb, init: Add early and late debug states x86, kgdb: early trap init for early debug
Diffstat (limited to 'kernel')
-rw-r--r--kernel/debug/debug_core.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/kernel/debug/debug_core.c b/kernel/debug/debug_core.c
index 64b5588c9638..5cb7cd1de10c 100644
--- a/kernel/debug/debug_core.c
+++ b/kernel/debug/debug_core.c
@@ -78,6 +78,8 @@ static DEFINE_SPINLOCK(kgdb_registration_lock);
static int kgdb_con_registered;
/* determine if kgdb console output should be used */
static int kgdb_use_con;
+/* Flag for alternate operations for early debugging */
+bool dbg_is_early = true;
/* Next cpu to become the master debug core */
int dbg_switch_cpu;
@@ -777,11 +779,25 @@ static struct notifier_block kgdb_panic_event_nb = {
.priority = INT_MAX,
};
+void __weak kgdb_arch_late(void)
+{
+}
+
+void __init dbg_late_init(void)
+{
+ dbg_is_early = false;
+ if (kgdb_io_module_registered)
+ kgdb_arch_late();
+ kdb_init(KDB_INIT_FULL);
+}
+
static void kgdb_register_callbacks(void)
{
if (!kgdb_io_module_registered) {
kgdb_io_module_registered = 1;
kgdb_arch_init();
+ if (!dbg_is_early)
+ kgdb_arch_late();
atomic_notifier_chain_register(&panic_notifier_list,
&kgdb_panic_event_nb);
#ifdef CONFIG_MAGIC_SYSRQ