xref: /linux/arch/x86/um/shared/sysdep/ptrace_user.h (revision 831c1926ee728c3e747255f7c0f434762e8e863d)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #include <generated/user_constants.h>
3 
4 #define PT_OFFSET(r) ((r) * sizeof(long))
5 
6 #define PT_SYSCALL_NR(regs) ((regs)[HOST_ORIG_AX])
7 #define PT_SYSCALL_NR_OFFSET PT_OFFSET(HOST_ORIG_AX)
8 
9 #define PT_SYSCALL_RET_OFFSET PT_OFFSET(HOST_AX)
10 
11 #define REGS_IP_INDEX HOST_IP
12 #define REGS_SP_INDEX HOST_SP
13 
14 /*
15  * glibc before 2.27 does not include PTRACE_SYSEMU_SINGLESTEP in its enum,
16  * ensure we have a definition by (re-)defining it here.
17  */
18 #ifndef PTRACE_SYSEMU_SINGLESTEP
19 #define PTRACE_SYSEMU_SINGLESTEP 32
20 #endif
21