1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_X86_KGDB_H
3 #define _ASM_X86_KGDB_H
6 * Copyright (C) 2001-2004 Amit S. Kale
7 * Copyright (C) 2008 Wind River Systems, Inc.
10 #include <asm/ptrace.h>
13 * BUFMAX defines the maximum number of characters in inbound/outbound
14 * buffers at least NUMREGBYTES*2 are needed for register packets
15 * Longer buffer is needed to list all threads
20 * Note that this register image is in a different order than
21 * the register image that Linux produces at interrupt time.
23 * Linux's register image is defined by struct pt_regs in ptrace.h.
24 * Just why GDB uses a different order is a historical mystery.
36 GDB_PC
, /* 8 also known as eip */
37 GDB_PS
, /* 9 also known as eflags */
45 #define GDB_ORIG_AX 41
46 #define DBG_MAX_REG_NUM 16
47 #define NUMREGBYTES ((GDB_GS+1)*4)
48 #else /* ! CONFIG_X86_32 */
75 #define GDB_ORIG_AX 57
76 #define DBG_MAX_REG_NUM 24
77 /* 17 64 bit regs and 5 32 bit regs */
78 #define NUMREGBYTES ((17 * 8) + (5 * 4))
79 #endif /* ! CONFIG_X86_32 */
81 static inline void arch_kgdb_breakpoint(void)
85 #define BREAK_INSTR_SIZE 1
86 #define CACHE_FLUSH_IS_SAFE 1
87 #define GDB_ADJUSTS_BREAK_OFFSET
89 extern int kgdb_ll_trap(int cmd
, const char *str
,
90 struct pt_regs
*regs
, long err
, int trap
, int sig
);
92 #endif /* _ASM_X86_KGDB_H */