linux/arch/x86/include/uapi/asm/ptrace-abi.h

/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef _ASM_X86_PTRACE_ABI_H
#define _ASM_X86_PTRACE_ABI_H

#ifdef __i386__

#define EBX
#define ECX
#define EDX
#define ESI
#define EDI
#define EBP
#define EAX
#define DS
#define ES
#define FS
#define GS
#define ORIG_EAX
#define EIP
#define CS
#define EFL
#define UESP
#define SS
#define FRAME_SIZE

#else /* __i386__ */

#if defined(__ASSEMBLY__) || defined(__FRAME_OFFSETS)
/*
 * C ABI says these regs are callee-preserved. They aren't saved on kernel entry
 * unless syscall needs a complete, fully filled "struct pt_regs".
 */
#define R15
#define R14
#define R13
#define R12
#define RBP
#define RBX
/* These regs are callee-clobbered. Always saved on kernel entry. */
#define R11
#define R10
#define R9
#define R8
#define RAX
#define RCX
#define RDX
#define RSI
#define RDI
/*
 * On syscall entry, this is syscall#. On CPU exception, this is error code.
 * On hw interrupt, it's IRQ number:
 */
#define ORIG_RAX
/* Return frame for iretq */
#define RIP
#define CS
#define EFLAGS
#define RSP
#define SS
#endif /* __ASSEMBLY__ */

/* top of stack page */
#define FRAME_SIZE

#endif /* !__i386__ */

/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
#define PTRACE_GETREGS
#define PTRACE_SETREGS
#define PTRACE_GETFPREGS
#define PTRACE_SETFPREGS
#define PTRACE_GETFPXREGS
#define PTRACE_SETFPXREGS

#define PTRACE_OLDSETOPTIONS

/* only useful for access 32bit programs / kernels */
#define PTRACE_GET_THREAD_AREA
#define PTRACE_SET_THREAD_AREA

#ifdef __x86_64__
#define PTRACE_ARCH_PRCTL
#endif

#define PTRACE_SYSEMU
#define PTRACE_SYSEMU_SINGLESTEP

#define PTRACE_SINGLEBLOCK

#ifndef __ASSEMBLY__
#include <linux/types.h>
#endif

#endif /* _ASM_X86_PTRACE_ABI_H */