]>
Commit | Line | Data |
---|---|---|
1da177e4 LT |
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> | |
2f56debd | 12 | #include "user_constants.h" |
1da177e4 LT |
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) | |
d67b569f | 24 | #define PT_SYSCALL_ARG6_OFFSET PT_OFFSET(EBP) |
1da177e4 LT |
25 | |
26 | #define PT_SYSCALL_RET_OFFSET PT_OFFSET(EAX) | |
27 | ||
d67b569f JD |
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 | ||
1da177e4 LT |
39 | #define PT_IP_OFFSET PT_OFFSET(EIP) |
40 | #define PT_IP(regs) ((regs)[EIP]) | |
d67b569f | 41 | #define PT_SP_OFFSET PT_OFFSET(UESP) |
1da177e4 LT |
42 | #define PT_SP(regs) ((regs)[UESP]) |
43 | ||
47906dd9 | 44 | #define FP_SIZE ((HOST_FPX_SIZE > HOST_FP_SIZE) ? HOST_FPX_SIZE : HOST_FP_SIZE) |
2f56debd | 45 | |
1da177e4 LT |
46 | #ifndef FRAME_SIZE |
47 | #define FRAME_SIZE (17) | |
48 | #endif | |
1da177e4 LT |
49 | |
50 | #endif |