RT-AC66 3.0.0.4.374.130 core
[tomato.git] / release / src-rt-6.x / linux / linux-2.6 / arch / um / include / sysdep-i386 / ptrace_user.h
blob899aa4b2a78d542888d09a4812fbb13da34035e3
1 /*
2 * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL
4 */
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)
23 #define PT_SYSCALL_ARG6_OFFSET PT_OFFSET(EBP)
25 #define PT_SYSCALL_RET_OFFSET PT_OFFSET(EAX)
27 #define REGS_SYSCALL_NR EAX /* This is used before a system call */
28 #define REGS_SYSCALL_ARG1 EBX
29 #define REGS_SYSCALL_ARG2 ECX
30 #define REGS_SYSCALL_ARG3 EDX
31 #define REGS_SYSCALL_ARG4 ESI
32 #define REGS_SYSCALL_ARG5 EDI
33 #define REGS_SYSCALL_ARG6 EBP
35 #define REGS_IP_INDEX EIP
36 #define REGS_SP_INDEX UESP
38 #define PT_IP_OFFSET PT_OFFSET(EIP)
39 #define PT_IP(regs) ((regs)[EIP])
40 #define PT_SP_OFFSET PT_OFFSET(UESP)
41 #define PT_SP(regs) ((regs)[UESP])
43 #ifndef FRAME_SIZE
44 #define FRAME_SIZE (17)
45 #endif
46 #define FRAME_SIZE_OFFSET (FRAME_SIZE * sizeof(unsigned long))
48 #define FP_FRAME_SIZE (27)
49 #define FPX_FRAME_SIZE (128)
51 #ifdef PTRACE_GETREGS
52 #define UM_HAVE_GETREGS
53 #endif
55 #ifdef PTRACE_SETREGS
56 #define UM_HAVE_SETREGS
57 #endif
59 #ifdef PTRACE_GETFPREGS
60 #define UM_HAVE_GETFPREGS
61 #endif
63 #ifdef PTRACE_SETFPREGS
64 #define UM_HAVE_SETFPREGS
65 #endif
67 #ifdef PTRACE_GETFPXREGS
68 #define UM_HAVE_GETFPXREGS
69 #endif
71 #ifdef PTRACE_SETFPXREGS
72 #define UM_HAVE_SETFPXREGS
73 #endif
75 #endif