[PATCH] uml: implement {get,set}_thread_area for i386
[sfrench/cifs-2.6.git] / include / asm-um / ptrace-x86_64.h
1 /*
2  * Copyright 2003 PathScale, Inc.
3  *
4  * Licensed under the GPL
5  */
6
7 #ifndef __UM_PTRACE_X86_64_H
8 #define __UM_PTRACE_X86_64_H
9
10 #include "linux/compiler.h"
11 #include "asm/errno.h"
12 #include "asm/host_ldt.h"
13
14 #define signal_fault signal_fault_x86_64
15 #define __FRAME_OFFSETS /* Needed to get the R* macros */
16 #include "asm/ptrace-generic.h"
17 #undef signal_fault
18
19 #define HOST_AUDIT_ARCH AUDIT_ARCH_X86_64
20
21 void signal_fault(struct pt_regs_subarch *regs, void *frame, char *where);
22
23 #define FS_BASE (21 * sizeof(unsigned long))
24 #define GS_BASE (22 * sizeof(unsigned long))
25 #define DS (23 * sizeof(unsigned long))
26 #define ES (24 * sizeof(unsigned long))
27 #define FS (25 * sizeof(unsigned long))
28 #define GS (26 * sizeof(unsigned long))
29
30 #define PT_REGS_RBX(r) UPT_RBX(&(r)->regs)
31 #define PT_REGS_RCX(r) UPT_RCX(&(r)->regs)
32 #define PT_REGS_RDX(r) UPT_RDX(&(r)->regs)
33 #define PT_REGS_RSI(r) UPT_RSI(&(r)->regs)
34 #define PT_REGS_RDI(r) UPT_RDI(&(r)->regs)
35 #define PT_REGS_RBP(r) UPT_RBP(&(r)->regs)
36 #define PT_REGS_RAX(r) UPT_RAX(&(r)->regs)
37 #define PT_REGS_R8(r) UPT_R8(&(r)->regs)
38 #define PT_REGS_R9(r) UPT_R9(&(r)->regs)
39 #define PT_REGS_R10(r) UPT_R10(&(r)->regs)
40 #define PT_REGS_R11(r) UPT_R11(&(r)->regs)
41 #define PT_REGS_R12(r) UPT_R12(&(r)->regs)
42 #define PT_REGS_R13(r) UPT_R13(&(r)->regs)
43 #define PT_REGS_R14(r) UPT_R14(&(r)->regs)
44 #define PT_REGS_R15(r) UPT_R15(&(r)->regs)
45
46 #define PT_REGS_FS(r) UPT_FS(&(r)->regs)
47 #define PT_REGS_GS(r) UPT_GS(&(r)->regs)
48 #define PT_REGS_DS(r) UPT_DS(&(r)->regs)
49 #define PT_REGS_ES(r) UPT_ES(&(r)->regs)
50 #define PT_REGS_SS(r) UPT_SS(&(r)->regs)
51 #define PT_REGS_CS(r) UPT_CS(&(r)->regs)
52
53 #define PT_REGS_ORIG_RAX(r) UPT_ORIG_RAX(&(r)->regs)
54 #define PT_REGS_RIP(r) UPT_IP(&(r)->regs)
55 #define PT_REGS_RSP(r) UPT_SP(&(r)->regs)
56
57 #define PT_REGS_EFLAGS(r) UPT_EFLAGS(&(r)->regs)
58
59 /* XXX */
60 #define user_mode(r) UPT_IS_USER(&(r)->regs)
61 #define PT_REGS_ORIG_SYSCALL(r) PT_REGS_RAX(r)
62 #define PT_REGS_SYSCALL_RET(r) PT_REGS_RAX(r)
63
64 #define PT_FIX_EXEC_STACK(sp) do ; while(0)
65
66 #define profile_pc(regs) PT_REGS_IP(regs)
67
68 static inline int ptrace_get_thread_area(struct task_struct *child, int idx,
69                                          struct user_desc __user *user_desc)
70 {
71         return -ENOSYS;
72 }
73
74 static inline int ptrace_set_thread_area(struct task_struct *child, int idx,
75                                          struct user_desc __user *user_desc)
76 {
77         return -ENOSYS;
78 }
79
80 static inline void arch_switch_to_tt(struct task_struct *from,
81                                      struct task_struct *to)
82 {
83 }
84
85 static inline void arch_switch_to_skas(struct task_struct *from,
86                                        struct task_struct *to)
87 {
88 }
89
90 #endif