2 * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL
6 #ifndef __SYSDEP_I386_PTRACE_USER_H__
7 #define __SYSDEP_I386_PTRACE_USER_H__
9 #include <sys/ptrace.h>
10 #include <linux/ptrace.h>
11 #include <asm/ptrace.h>
13 #define PT_OFFSET(r) ((r) * sizeof(long))
15 #define PT_SYSCALL_NR(regs) ((regs)[ORIG_EAX])
16 #define PT_SYSCALL_NR_OFFSET PT_OFFSET(ORIG_EAX)
18 #define PT_SYSCALL_ARG1_OFFSET PT_OFFSET(EBX)
19 #define PT_SYSCALL_ARG2_OFFSET PT_OFFSET(ECX)
20 #define PT_SYSCALL_ARG3_OFFSET PT_OFFSET(EDX)
21 #define PT_SYSCALL_ARG4_OFFSET PT_OFFSET(ESI)
22 #define PT_SYSCALL_ARG5_OFFSET PT_OFFSET(EDI)
24 #define PT_SYSCALL_RET_OFFSET PT_OFFSET(EAX)
26 #define PT_IP_OFFSET PT_OFFSET(EIP)
27 #define PT_IP(regs) ((regs)[EIP])
28 #define PT_SP(regs) ((regs)[UESP])
31 #define FRAME_SIZE (17)
33 #define FRAME_SIZE_OFFSET (FRAME_SIZE * sizeof(unsigned long))
35 #define FP_FRAME_SIZE (27)
36 #define FPX_FRAME_SIZE (128)
39 #define UM_HAVE_GETREGS
43 #define UM_HAVE_SETREGS
46 #ifdef PTRACE_GETFPREGS
47 #define UM_HAVE_GETFPREGS
50 #ifdef PTRACE_SETFPREGS
51 #define UM_HAVE_SETFPREGS
54 #ifdef PTRACE_GETFPXREGS
55 #define UM_HAVE_GETFPXREGS
58 #ifdef PTRACE_SETFPXREGS
59 #define UM_HAVE_SETFPXREGS