Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


Merge branch 'devel'
[palacios.git] / kitten / include / arch-x86_64 / ptrace.h
1 #ifndef _X86_64_PTRACE_H
2 #define _X86_64_PTRACE_H
3
4 #if defined(__ASSEMBLY__) || defined(__FRAME_OFFSETS) 
5 #define R15 0
6 #define R14 8
7 #define R13 16
8 #define R12 24
9 #define RBP 32
10 #define RBX 40
11 /* arguments: interrupts/non tracing syscalls only save upto here*/
12 #define R11 48
13 #define R10 56  
14 #define R9 64
15 #define R8 72
16 #define RAX 80
17 #define RCX 88
18 #define RDX 96
19 #define RSI 104
20 #define RDI 112
21 #define ORIG_RAX 120       /* = ERROR_CODE */ 
22 #define ERROR_CODE 120
23 /* end of arguments */  
24 /* cpu exception frame or undefined in case of fast syscall. */
25 #define RIP 128
26 #define CS 136
27 #define EFLAGS 144
28 #define RSP 152
29 #define SS 160
30 #define ARGOFFSET R11
31 #endif /* __ASSEMBLY__ */
32
33 /* top of stack page */ 
34 #define FRAME_SIZE 168
35
36 #define PTRACE_OLDSETOPTIONS         21
37
38 #ifndef __ASSEMBLY__ 
39
40 struct pt_regs {
41         unsigned long r15;
42         unsigned long r14;
43         unsigned long r13;
44         unsigned long r12;
45         unsigned long rbp;
46         unsigned long rbx;
47 /* arguments: non interrupts/non tracing syscalls only save upto here*/
48         unsigned long r11;
49         unsigned long r10;      
50         unsigned long r9;
51         unsigned long r8;
52         unsigned long rax;
53         unsigned long rcx;
54         unsigned long rdx;
55         unsigned long rsi;
56         unsigned long rdi;
57         unsigned long orig_rax;
58 /* end of arguments */  
59 /* cpu exception frame or undefined */
60         unsigned long rip;
61         unsigned long cs;
62         unsigned long eflags; 
63         unsigned long rsp; 
64         unsigned long ss;
65 /* top of stack page */ 
66 };
67
68 #endif
69
70 /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
71 #define PTRACE_GETREGS            12
72 #define PTRACE_SETREGS            13
73 #define PTRACE_GETFPREGS          14
74 #define PTRACE_SETFPREGS          15
75 #define PTRACE_GETFPXREGS         18
76 #define PTRACE_SETFPXREGS         19
77
78 /* only useful for access 32bit programs */
79 #define PTRACE_GET_THREAD_AREA    25
80 #define PTRACE_SET_THREAD_AREA    26
81
82 #define PTRACE_ARCH_PRCTL         30    /* arch_prctl for child */
83
84 #if defined(__KERNEL__) && !defined(__ASSEMBLY__) 
85 #define user_mode(regs) (!!((regs)->cs & 3))
86 #define user_mode_vm(regs) user_mode(regs)
87 #define instruction_pointer(regs) ((regs)->rip)
88 extern unsigned long profile_pc(struct pt_regs *regs);
89 void signal_fault(struct pt_regs *regs, void __user *frame, char *where);
90
91 struct task_struct;
92
93 extern unsigned long
94 convert_rip_to_linear(struct task_struct *child, struct pt_regs *regs);
95
96 enum {
97         EF_CF   = 0x00000001,
98         EF_PF   = 0x00000004,
99         EF_AF   = 0x00000010,
100         EF_ZF   = 0x00000040,
101         EF_SF   = 0x00000080,
102         EF_TF   = 0x00000100,
103         EF_IE   = 0x00000200,
104         EF_DF   = 0x00000400,
105         EF_OF   = 0x00000800,
106         EF_IOPL = 0x00003000,
107         EF_IOPL_RING0 = 0x00000000,
108         EF_IOPL_RING1 = 0x00001000,
109         EF_IOPL_RING2 = 0x00002000,
110         EF_NT   = 0x00004000,   /* nested task */
111         EF_RF   = 0x00010000,   /* resume */
112         EF_VM   = 0x00020000,   /* virtual mode */
113         EF_AC   = 0x00040000,   /* alignment */
114         EF_VIF  = 0x00080000,   /* virtual interrupt */
115         EF_VIP  = 0x00100000,   /* virtual interrupt pending */
116         EF_ID   = 0x00200000,   /* id */
117 };
118
119 /* TODO: remove this */
120 typedef void (*idtvec_handler_t)(struct pt_regs *regs, unsigned int vector);
121 void set_idtvec_handler(unsigned int vector, idtvec_handler_t handler);
122
123 #endif
124
125 #endif