Linux 2.6.25.3
[linux/fpc-iii.git] / arch / um / include / sysdep-i386 / ptrace_user.h
blob75650723c38f15506144d12f5cfedfb0f63a8072
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>
12 #include "user_constants.h"
14 #define PT_OFFSET(r) ((r) * sizeof(long))
16 #define PT_SYSCALL_NR(regs) ((regs)[ORIG_EAX])
17 #define PT_SYSCALL_NR_OFFSET PT_OFFSET(ORIG_EAX)
19 #define PT_SYSCALL_ARG1_OFFSET PT_OFFSET(EBX)
20 #define PT_SYSCALL_ARG2_OFFSET PT_OFFSET(ECX)
21 #define PT_SYSCALL_ARG3_OFFSET PT_OFFSET(EDX)
22 #define PT_SYSCALL_ARG4_OFFSET PT_OFFSET(ESI)
23 #define PT_SYSCALL_ARG5_OFFSET PT_OFFSET(EDI)
24 #define PT_SYSCALL_ARG6_OFFSET PT_OFFSET(EBP)
26 #define PT_SYSCALL_RET_OFFSET PT_OFFSET(EAX)
28 #define REGS_SYSCALL_NR EAX /* This is used before a system call */
29 #define REGS_SYSCALL_ARG1 EBX
30 #define REGS_SYSCALL_ARG2 ECX
31 #define REGS_SYSCALL_ARG3 EDX
32 #define REGS_SYSCALL_ARG4 ESI
33 #define REGS_SYSCALL_ARG5 EDI
34 #define REGS_SYSCALL_ARG6 EBP
36 #define REGS_IP_INDEX EIP
37 #define REGS_SP_INDEX UESP
39 #define PT_IP_OFFSET PT_OFFSET(EIP)
40 #define PT_IP(regs) ((regs)[EIP])
41 #define PT_SP_OFFSET PT_OFFSET(UESP)
42 #define PT_SP(regs) ((regs)[UESP])
44 #define FP_SIZE ((HOST_XFP_SIZE > HOST_FP_SIZE) ? HOST_XFP_SIZE : HOST_FP_SIZE)
46 #ifndef FRAME_SIZE
47 #define FRAME_SIZE (17)
48 #endif
49 #define FRAME_SIZE_OFFSET (FRAME_SIZE * sizeof(unsigned long))
51 #define FP_FRAME_SIZE (27)
52 #define FPX_FRAME_SIZE (128)
54 #ifdef PTRACE_GETREGS
55 #define UM_HAVE_GETREGS
56 #endif
58 #ifdef PTRACE_SETREGS
59 #define UM_HAVE_SETREGS
60 #endif
62 #ifdef PTRACE_GETFPREGS
63 #define UM_HAVE_GETFPREGS
64 #endif
66 #ifdef PTRACE_SETFPREGS
67 #define UM_HAVE_SETFPREGS
68 #endif
70 #ifdef PTRACE_GETFPXREGS
71 #define UM_HAVE_GETFPXREGS
72 #endif
74 #ifdef PTRACE_SETFPXREGS
75 #define UM_HAVE_SETFPXREGS
76 #endif
78 #endif