Commit 82da3ff8 authored by Ingo Molnar's avatar Ingo Molnar

x86: kgdb support

simplified and streamlined kgdb support on x86, both 32-bit and 64-bit,
based on patch from:

  Subject: kgdb: core-lite
  From: Jason Wessel <jason.wessel@windriver.com>

[ and countless other authors - see the patch for details. ]
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarJason Wessel <jason.wessel@windriver.com>
Signed-off-by: default avatarJan Kiszka <jan.kiszka@web.de>
Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent f2d937f3
......@@ -23,6 +23,7 @@ config X86
select HAVE_KPROBES
select HAVE_KRETPROBES
select HAVE_KVM if ((X86_32 && !X86_VOYAGER && !X86_VISWS && !X86_NUMAQ) || X86_64)
select HAVE_ARCH_KGDB
config GENERIC_LOCKBREAK
......
......@@ -66,6 +66,7 @@ obj-$(CONFIG_MODULES) += module_$(BITS).o
obj-$(CONFIG_ACPI_SRAT) += srat_32.o
obj-$(CONFIG_EFI) += efi.o efi_$(BITS).o efi_stub_$(BITS).o
obj-$(CONFIG_DOUBLEFAULT) += doublefault_32.o
obj-$(CONFIG_KGDB) += kgdb.o
obj-$(CONFIG_VM86) += vm86_32.o
obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
......
This diff is collapsed.
#ifndef _ASM_KGDB_H_
#define _ASM_KGDB_H_
/*
* Copyright (C) 2001-2004 Amit S. Kale
* Copyright (C) 2008 Wind River Systems, Inc.
*/
/*
* BUFMAX defines the maximum number of characters in inbound/outbound
* buffers at least NUMREGBYTES*2 are needed for register packets
* Longer buffer is needed to list all threads
*/
#define BUFMAX 1024
/*
* Note that this register image is in a different order than
* the register image that Linux produces at interrupt time.
*
* Linux's register image is defined by struct pt_regs in ptrace.h.
* Just why GDB uses a different order is a historical mystery.
*/
#ifdef CONFIG_X86_32
enum regnames {
GDB_AX, /* 0 */
GDB_CX, /* 1 */
GDB_DX, /* 2 */
GDB_BX, /* 3 */
GDB_SP, /* 4 */
GDB_BP, /* 5 */
GDB_SI, /* 6 */
GDB_DI, /* 7 */
GDB_PC, /* 8 also known as eip */
GDB_PS, /* 9 also known as eflags */
GDB_CS, /* 10 */
GDB_SS, /* 11 */
GDB_DS, /* 12 */
GDB_ES, /* 13 */
GDB_FS, /* 14 */
GDB_GS, /* 15 */
};
#else /* ! CONFIG_X86_32 */
enum regnames {
GDB_AX, /* 0 */
GDB_DX, /* 1 */
GDB_CX, /* 2 */
GDB_BX, /* 3 */
GDB_SI, /* 4 */
GDB_DI, /* 5 */
GDB_BP, /* 6 */
GDB_SP, /* 7 */
GDB_R8, /* 8 */
GDB_R9, /* 9 */
GDB_R10, /* 10 */
GDB_R11, /* 11 */
GDB_R12, /* 12 */
GDB_R13, /* 13 */
GDB_R14, /* 14 */
GDB_R15, /* 15 */
GDB_PC, /* 16 */
GDB_PS, /* 17 */
};
#endif /* CONFIG_X86_32 */
/*
* Number of bytes of registers:
*/
#ifdef CONFIG_X86_32
# define NUMREGBYTES 64
#else
# define NUMREGBYTES ((GDB_PS+1)*8)
#endif
static inline void arch_kgdb_breakpoint(void)
{
asm(" int $3");
}
#define BREAK_INSTR_SIZE 1
#define CACHE_FLUSH_IS_SAFE 1
#endif /* _ASM_KGDB_H_ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment