1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
2966e803aSAl Viro #include <generated/user_constants.h>
3966e803aSAl Viro 
4966e803aSAl Viro #define PT_OFFSET(r) ((r) * sizeof(long))
5966e803aSAl Viro 
6966e803aSAl Viro #define PT_SYSCALL_NR(regs) ((regs)[HOST_ORIG_AX])
7966e803aSAl Viro #define PT_SYSCALL_NR_OFFSET PT_OFFSET(HOST_ORIG_AX)
8966e803aSAl Viro 
9966e803aSAl Viro #define PT_SYSCALL_RET_OFFSET PT_OFFSET(HOST_AX)
10966e803aSAl Viro 
11966e803aSAl Viro #define REGS_IP_INDEX HOST_IP
12966e803aSAl Viro #define REGS_SP_INDEX HOST_SP
13966e803aSAl Viro 
145c48b108SAl Viro #ifdef __i386__
15966e803aSAl Viro #define FP_SIZE ((HOST_FPX_SIZE > HOST_FP_SIZE) ? HOST_FPX_SIZE : HOST_FP_SIZE)
165c48b108SAl Viro #else
17966e803aSAl Viro #define FP_SIZE HOST_FP_SIZE
18966e803aSAl Viro 
19966e803aSAl Viro /*
20966e803aSAl Viro  * x86_64 FC3 doesn't define this in /usr/include/linux/ptrace.h even though
21966e803aSAl Viro  * it's defined in the kernel's include/linux/ptrace.h. Additionally, use the
22966e803aSAl Viro  * 2.4 name and value for 2.4 host compatibility.
23966e803aSAl Viro  */
24966e803aSAl Viro #ifndef PTRACE_OLDSETOPTIONS
25966e803aSAl Viro #define PTRACE_OLDSETOPTIONS 21
26966e803aSAl Viro #endif
27966e803aSAl Viro 
285c48b108SAl Viro #endif
29