vserver 1.9.5.x5
[linux-2.6.git] / arch / um / include / sysdep-i386 / ptrace_user.h
1 /* 
2  * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
3  * Licensed under the GPL
4  */
5
6 #ifndef __SYSDEP_I386_PTRACE_USER_H__
7 #define __SYSDEP_I386_PTRACE_USER_H__
8
9 #include <asm/ptrace.h>
10
11 #define PT_OFFSET(r) ((r) * sizeof(long))
12
13 #define PT_SYSCALL_NR(regs) ((regs)[ORIG_EAX])
14 #define PT_SYSCALL_NR_OFFSET PT_OFFSET(ORIG_EAX)
15
16 #define PT_SYSCALL_ARG1_OFFSET PT_OFFSET(EBX)
17 #define PT_SYSCALL_ARG2_OFFSET PT_OFFSET(ECX)
18 #define PT_SYSCALL_ARG3_OFFSET PT_OFFSET(EDX)
19 #define PT_SYSCALL_ARG4_OFFSET PT_OFFSET(ESI)
20 #define PT_SYSCALL_ARG5_OFFSET PT_OFFSET(EDI)
21
22 #define PT_SYSCALL_RET_OFFSET PT_OFFSET(EAX)
23
24 #define PT_IP_OFFSET PT_OFFSET(EIP)
25 #define PT_IP(regs) ((regs)[EIP])
26 #define PT_SP(regs) ((regs)[UESP])
27
28 #ifndef FRAME_SIZE
29 #define FRAME_SIZE (17)
30 #endif
31 #define FRAME_SIZE_OFFSET (FRAME_SIZE * sizeof(unsigned long))
32
33 #define FP_FRAME_SIZE (27)
34 #define FPX_FRAME_SIZE (128)
35
36 #define MAX_REG_OFFSET (FRAME_SIZE_OFFSET)
37 #define MAX_REG_NR (FRAME_SIZE)
38
39 #ifdef PTRACE_GETREGS
40 #define UM_HAVE_GETREGS
41 #endif
42
43 #ifdef PTRACE_SETREGS
44 #define UM_HAVE_SETREGS
45 #endif
46
47 #ifdef PTRACE_GETFPREGS
48 #define UM_HAVE_GETFPREGS
49 #endif
50
51 #ifdef PTRACE_SETFPREGS
52 #define UM_HAVE_SETFPREGS
53 #endif
54
55 #ifdef PTRACE_GETFPXREGS
56 #define UM_HAVE_GETFPXREGS
57 #endif
58
59 #ifdef PTRACE_SETFPXREGS
60 #define UM_HAVE_SETFPXREGS
61 #endif
62
63 extern void update_debugregs(int seq);
64
65 #endif