Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[wrt350n-kernel.git] / arch / um / include / sysdep-x86_64 / ptrace_user.h
blob8e04463018fe262618cebb1d118a977e58b08d7f
1 /*
2 * Copyright 2003 PathScale, Inc.
4 * Licensed under the GPL
5 */
7 #ifndef __SYSDEP_X86_64_PTRACE_USER_H__
8 #define __SYSDEP_X86_64_PTRACE_USER_H__
10 #define __FRAME_OFFSETS
11 #include <sys/ptrace.h>
12 #include <linux/ptrace.h>
13 #include <asm/ptrace.h>
14 #undef __FRAME_OFFSETS
15 <<<<<<< HEAD:arch/um/include/sysdep-x86_64/ptrace_user.h
16 =======
17 #include "user_constants.h"
18 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a:arch/um/include/sysdep-x86_64/ptrace_user.h
20 #define PT_INDEX(off) ((off) / sizeof(unsigned long))
22 #define PT_SYSCALL_NR(regs) ((regs)[PT_INDEX(ORIG_RAX)])
23 #define PT_SYSCALL_NR_OFFSET (ORIG_RAX)
25 #define PT_SYSCALL_ARG1(regs) (((unsigned long *) (regs))[PT_INDEX(RDI)])
26 #define PT_SYSCALL_ARG1_OFFSET (RDI)
28 #define PT_SYSCALL_ARG2(regs) (((unsigned long *) (regs))[PT_INDEX(RSI)])
29 #define PT_SYSCALL_ARG2_OFFSET (RSI)
31 #define PT_SYSCALL_ARG3(regs) (((unsigned long *) (regs))[PT_INDEX(RDX)])
32 #define PT_SYSCALL_ARG3_OFFSET (RDX)
34 #define PT_SYSCALL_ARG4(regs) (((unsigned long *) (regs))[PT_INDEX(RCX)])
35 #define PT_SYSCALL_ARG4_OFFSET (RCX)
37 #define PT_SYSCALL_ARG5(regs) (((unsigned long *) (regs))[PT_INDEX(R8)])
38 #define PT_SYSCALL_ARG5_OFFSET (R8)
40 #define PT_SYSCALL_ARG6(regs) (((unsigned long *) (regs))[PT_INDEX(R9)])
41 #define PT_SYSCALL_ARG6_OFFSET (R9)
43 #define PT_SYSCALL_RET_OFFSET (RAX)
45 #define PT_IP_OFFSET (RIP)
46 #define PT_IP(regs) ((regs)[PT_INDEX(RIP)])
48 #define PT_SP_OFFSET (RSP)
49 #define PT_SP(regs) ((regs)[PT_INDEX(RSP)])
51 #define PT_ORIG_RAX_OFFSET (ORIG_RAX)
52 #define PT_ORIG_RAX(regs) ((regs)[PT_INDEX(ORIG_RAX)])
54 /* x86_64 FC3 doesn't define this in /usr/include/linux/ptrace.h even though
55 * it's defined in the kernel's include/linux/ptrace.h. Additionally, use the
56 * 2.4 name and value for 2.4 host compatibility.
58 #ifndef PTRACE_OLDSETOPTIONS
59 #define PTRACE_OLDSETOPTIONS 21
60 #endif
62 /* These are before the system call, so the system call number is RAX
63 * rather than ORIG_RAX, and arg4 is R10 rather than RCX
65 #define REGS_SYSCALL_NR PT_INDEX(RAX)
66 #define REGS_SYSCALL_ARG1 PT_INDEX(RDI)
67 #define REGS_SYSCALL_ARG2 PT_INDEX(RSI)
68 #define REGS_SYSCALL_ARG3 PT_INDEX(RDX)
69 #define REGS_SYSCALL_ARG4 PT_INDEX(R10)
70 #define REGS_SYSCALL_ARG5 PT_INDEX(R8)
71 #define REGS_SYSCALL_ARG6 PT_INDEX(R9)
73 #define REGS_IP_INDEX PT_INDEX(RIP)
74 #define REGS_SP_INDEX PT_INDEX(RSP)
76 <<<<<<< HEAD:arch/um/include/sysdep-x86_64/ptrace_user.h
77 =======
78 #define FP_SIZE (HOST_FP_SIZE)
80 >>>>>>> 264e3e889d86e552b4191d69bb60f4f3b383135a:arch/um/include/sysdep-x86_64/ptrace_user.h
81 #endif
84 * Overrides for Emacs so that we follow Linus's tabbing style.
85 * Emacs will notice this stuff at the end of the file and automatically
86 * adjust the settings for this buffer only. This must remain at the end
87 * of the file.
88 * ---------------------------------------------------------------------------
89 * Local variables:
90 * c-file-style: "linux"
91 * End: