]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blob - arch/um/include/sysdep-x86_64/ptrace_user.h
Linux-2.6.12-rc2
[mirror_ubuntu-artful-kernel.git] / arch / um / include / sysdep-x86_64 / ptrace_user.h
1 /*
2 * Copyright 2003 PathScale, Inc.
3 *
4 * Licensed under the GPL
5 */
6
7 #ifndef __SYSDEP_X86_64_PTRACE_USER_H__
8 #define __SYSDEP_X86_64_PTRACE_USER_H__
9
10 #define __FRAME_OFFSETS
11 #include <sys/ptrace.h>
12 #include <linux/ptrace.h>
13 #include <asm/ptrace.h>
14 #undef __FRAME_OFFSETS
15
16 #define PT_INDEX(off) ((off) / sizeof(unsigned long))
17
18 #define PT_SYSCALL_NR(regs) ((regs)[PT_INDEX(ORIG_RAX)])
19 #define PT_SYSCALL_NR_OFFSET (ORIG_RAX)
20
21 #define PT_SYSCALL_ARG1(regs) (((unsigned long *) (regs))[PT_INDEX(RDI)])
22 #define PT_SYSCALL_ARG1_OFFSET (RDI)
23
24 #define PT_SYSCALL_ARG2(regs) (((unsigned long *) (regs))[PT_INDEX(RSI)])
25 #define PT_SYSCALL_ARG2_OFFSET (RSI)
26
27 #define PT_SYSCALL_ARG3(regs) (((unsigned long *) (regs))[PT_INDEX(RDX)])
28 #define PT_SYSCALL_ARG3_OFFSET (RDX)
29
30 #define PT_SYSCALL_ARG4(regs) (((unsigned long *) (regs))[PT_INDEX(RCX)])
31 #define PT_SYSCALL_ARG4_OFFSET (RCX)
32
33 #define PT_SYSCALL_ARG5(regs) (((unsigned long *) (regs))[PT_INDEX(R8)])
34 #define PT_SYSCALL_ARG5_OFFSET (R8)
35
36 #define PT_SYSCALL_ARG6(regs) (((unsigned long *) (regs))[PT_INDEX(R9)])
37 #define PT_SYSCALL_ARG6_OFFSET (R9)
38
39 #define PT_SYSCALL_RET_OFFSET (RAX)
40
41 #define PT_IP_OFFSET (RIP)
42 #define PT_IP(regs) ((regs)[PT_INDEX(RIP)])
43
44 #define PT_SP_OFFSET (RSP)
45 #define PT_SP(regs) ((regs)[PT_INDEX(RSP)])
46
47 #define PT_ORIG_RAX_OFFSET (ORIG_RAX)
48 #define PT_ORIG_RAX(regs) ((regs)[PT_INDEX(ORIG_RAX)])
49
50 /* x86_64 FC3 doesn't define this in /usr/include/linux/ptrace.h even though
51 * it's defined in the kernel's include/linux/ptrace.h. Additionally, use the
52 * 2.4 name and value for 2.4 host compatibility.
53 */
54 #ifndef PTRACE_OLDSETOPTIONS
55 #define PTRACE_OLDSETOPTIONS 21
56 #endif
57
58 #endif
59
60 /*
61 * Overrides for Emacs so that we follow Linus's tabbing style.
62 * Emacs will notice this stuff at the end of the file and automatically
63 * adjust the settings for this buffer only. This must remain at the end
64 * of the file.
65 * ---------------------------------------------------------------------------
66 * Local variables:
67 * c-file-style: "linux"
68 * End:
69 */