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 4be499cd6a0d..9042fb0e36f5 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> |
@@ -251,6 +252,17 @@ void __cpuinit cpu_init (void) | |||
251 | load_TR_desc(); | 252 | load_TR_desc(); |
252 | load_LDT(&init_mm.context); | 253 | load_LDT(&init_mm.context); |
253 | 254 | ||
255 | #ifdef CONFIG_KGDB | ||
256 | /* | ||
257 | * If the kgdb is connected no debug regs should be altered. This | ||
258 | * is only applicable when KGDB and a KGDB I/O module are built | ||
259 | * into the kernel and you are using early debugging with | ||
260 | * kgdbwait. KGDB will control the kernel HW breakpoint registers. | ||
261 | */ | ||
262 | if (kgdb_connected && arch_kgdb_ops.correct_hw_break) | ||
263 | arch_kgdb_ops.correct_hw_break(); | ||
264 | else { | ||
265 | #endif | ||
254 | /* | 266 | /* |
255 | * Clear all 6 debug registers: | 267 | * Clear all 6 debug registers: |
256 | */ | 268 | */ |
@@ -261,6 +273,10 @@ void __cpuinit cpu_init (void) | |||
261 | set_debugreg(0UL, 3); | 273 | set_debugreg(0UL, 3); |
262 | set_debugreg(0UL, 6); | 274 | set_debugreg(0UL, 6); |
263 | set_debugreg(0UL, 7); | 275 | set_debugreg(0UL, 7); |
276 | #ifdef CONFIG_KGDB | ||
277 | /* If the kgdb is connected no debug regs should be altered. */ | ||
278 | } | ||
279 | #endif | ||
264 | 280 | ||
265 | fpu_init(); | 281 | fpu_init(); |
266 | 282 | ||