diff options
Diffstat (limited to 'arch/x86/kernel/setup64.c')
-rw-r--r-- | arch/x86/kernel/setup64.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/x86/kernel/setup64.c b/arch/x86/kernel/setup64.c index e24c45677094..143aa78c566b 100644 --- a/arch/x86/kernel/setup64.c +++ b/arch/x86/kernel/setup64.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/bootmem.h> | 11 | #include <linux/bootmem.h> |
12 | #include <linux/bitops.h> | 12 | #include <linux/bitops.h> |
13 | #include <linux/module.h> | 13 | #include <linux/module.h> |
14 | #include <linux/kgdb.h> | ||
14 | #include <asm/pda.h> | 15 | #include <asm/pda.h> |
15 | #include <asm/pgtable.h> | 16 | #include <asm/pgtable.h> |
16 | #include <asm/processor.h> | 17 | #include <asm/processor.h> |
@@ -327,6 +328,17 @@ void __cpuinit cpu_init (void) | |||
327 | load_TR_desc(); | 328 | load_TR_desc(); |
328 | load_LDT(&init_mm.context); | 329 | load_LDT(&init_mm.context); |
329 | 330 | ||
331 | #ifdef CONFIG_KGDB | ||
332 | /* | ||
333 | * If the kgdb is connected no debug regs should be altered. This | ||
334 | * is only applicable when KGDB and a KGDB I/O module are built | ||
335 | * into the kernel and you are using early debugging with | ||
336 | * kgdbwait. KGDB will control the kernel HW breakpoint registers. | ||
337 | */ | ||
338 | if (kgdb_connected && arch_kgdb_ops.correct_hw_break) | ||
339 | arch_kgdb_ops.correct_hw_break(); | ||
340 | else { | ||
341 | #endif | ||
330 | /* | 342 | /* |
331 | * Clear all 6 debug registers: | 343 | * Clear all 6 debug registers: |
332 | */ | 344 | */ |
@@ -337,6 +349,10 @@ void __cpuinit cpu_init (void) | |||
337 | set_debugreg(0UL, 3); | 349 | set_debugreg(0UL, 3); |
338 | set_debugreg(0UL, 6); | 350 | set_debugreg(0UL, 6); |
339 | set_debugreg(0UL, 7); | 351 | set_debugreg(0UL, 7); |
352 | #ifdef CONFIG_KGDB | ||
353 | /* If the kgdb is connected no debug regs should be altered. */ | ||
354 | } | ||
355 | #endif | ||
340 | 356 | ||
341 | fpu_init(); | 357 | fpu_init(); |
342 | 358 | ||