diff options
Diffstat (limited to 'arch/um/include/shared/sysdep-i386/ptrace_user.h')
-rw-r--r-- | arch/um/include/shared/sysdep-i386/ptrace_user.h | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/arch/um/include/shared/sysdep-i386/ptrace_user.h b/arch/um/include/shared/sysdep-i386/ptrace_user.h new file mode 100644 index 00000000000..ef56247e414 --- /dev/null +++ b/arch/um/include/shared/sysdep-i386/ptrace_user.h | |||
@@ -0,0 +1,50 @@ | |||
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 <sys/ptrace.h> | ||
10 | #include <linux/ptrace.h> | ||
11 | #include <asm/ptrace.h> | ||
12 | #include "user_constants.h" | ||
13 | |||
14 | #define PT_OFFSET(r) ((r) * sizeof(long)) | ||
15 | |||
16 | #define PT_SYSCALL_NR(regs) ((regs)[ORIG_EAX]) | ||
17 | #define PT_SYSCALL_NR_OFFSET PT_OFFSET(ORIG_EAX) | ||
18 | |||
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) | ||
25 | |||
26 | #define PT_SYSCALL_RET_OFFSET PT_OFFSET(EAX) | ||
27 | |||
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 | ||
35 | |||
36 | #define REGS_IP_INDEX EIP | ||
37 | #define REGS_SP_INDEX UESP | ||
38 | |||
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]) | ||
43 | |||
44 | #define FP_SIZE ((HOST_FPX_SIZE > HOST_FP_SIZE) ? HOST_FPX_SIZE : HOST_FP_SIZE) | ||
45 | |||
46 | #ifndef FRAME_SIZE | ||
47 | #define FRAME_SIZE (17) | ||
48 | #endif | ||
49 | |||
50 | #endif | ||