ia64/xen-unstable

view tools/libxc/xc_ptrace.h @ 9488:0a6f5527ca4b

[IA64] set itv handoff as masked and enable reading irr[0-3]

Set initial vcpu itv handoff state to mask the timer vector.
This seems to match hardware and makes logical sense from a
spurious interrupt perspective. Enable vcpu_get_irr[0-3]
functions as they seem to work and have the proper backing.
This enables the check_sal_cache_flush() in arch/ia64/kernel.sal.c
to work unmodified, allowing us to remove the Xen changes from
the file (and thus the file from the sparse tree).

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
author awilliam@xenbuild.aw
date Tue Apr 04 09:39:45 2006 -0600 (2006-04-04)
parents 30ae67d6e5f0
children f0e14b4e535c
line source
1 #ifndef XC_PTRACE_
2 #define XC_PTRACE_
4 #include <thread_db.h>
6 #ifdef XC_PTRACE_PRIVATE
7 #define X86_CR0_PE 0x00000001 /* Enable Protected Mode (RW) */
8 #define X86_CR0_PG 0x80000000 /* Paging (RW) */
9 #define BSD_PAGE_MASK (PAGE_SIZE-1)
10 #define PDRSHIFT 22
11 #define PSL_T 0x00000100 /* trace enable bit */
13 #ifdef __x86_64__
14 struct gdb_regs
15 {
16 unsigned long r15;
17 unsigned long r14;
18 unsigned long r13;
19 unsigned long r12;
20 unsigned long rbp;
21 unsigned long rbx;
22 unsigned long r11;
23 unsigned long r10;
24 unsigned long r9;
25 unsigned long r8;
26 unsigned long rax;
27 unsigned long rcx;
28 unsigned long rdx;
29 unsigned long rsi;
30 unsigned long rdi;
31 unsigned long orig_rax;
32 unsigned long rip;
33 unsigned long xcs;
34 unsigned long eflags;
35 unsigned long rsp;
36 unsigned long xss;
37 unsigned long fs_base;
38 unsigned long gs_base;
39 unsigned long xds;
40 unsigned long xes;
41 unsigned long xfs;
42 unsigned long xgs;
43 };
45 #define SET_PT_REGS(pt, xc) \
46 { \
47 pt.r8 = xc.r8; \
48 pt.r9 = xc.r9; \
49 pt.r10 = xc.r10; \
50 pt.r11 = xc.r11; \
51 pt.r12 = xc.r12; \
52 pt.r13 = xc.r13; \
53 pt.r14 = xc.r14; \
54 pt.r15 = xc.r15; \
55 pt.rbx = xc.rbx; \
56 pt.rcx = xc.rcx; \
57 pt.rdx = xc.rdx; \
58 pt.rsi = xc.rsi; \
59 pt.rdi = xc.rdi; \
60 pt.rbp = xc.rbp; \
61 pt.rax = xc.rax; \
62 pt.rip = xc.rip; \
63 pt.xcs = xc.cs; \
64 pt.eflags = xc.eflags; \
65 pt.rsp = xc.rsp; \
66 pt.xss = xc.ss; \
67 pt.xes = xc.es; \
68 pt.xds = xc.ds; \
69 pt.xfs = xc.fs; \
70 pt.xgs = xc.gs; \
71 }
73 #define SET_XC_REGS(pt, xc) \
74 { \
75 xc.r8 = pt->r8; \
76 xc.r9 = pt->r9; \
77 xc.r10 = pt->r10; \
78 xc.r11 = pt->r11; \
79 xc.r12 = pt->r12; \
80 xc.r13 = pt->r13; \
81 xc.r14 = pt->r14; \
82 xc.r15 = pt->r15; \
83 xc.rbx = pt->rbx; \
84 xc.rcx = pt->rcx; \
85 xc.rdx = pt->rdx; \
86 xc.rsi = pt->rsi; \
87 xc.rdi = pt->rdi; \
88 xc.rbp = pt->rbp; \
89 xc.rax = pt->rax; \
90 xc.rip = pt->rip; \
91 xc.cs = pt->xcs; \
92 xc.eflags = pt->eflags; \
93 xc.rsp = pt->rsp; \
94 xc.ss = pt->xss; \
95 xc.es = pt->xes; \
96 xc.ds = pt->xds; \
97 xc.fs = pt->xfs; \
98 xc.gs = pt->xgs; \
99 }
101 #elif __i386__
103 struct gdb_regs {
104 long ebx; /* 0 */
105 long ecx; /* 4 */
106 long edx; /* 8 */
107 long esi; /* 12 */
108 long edi; /* 16 */
109 long ebp; /* 20 */
110 long eax; /* 24 */
111 int xds; /* 28 */
112 int xes; /* 32 */
113 int xfs; /* 36 */
114 int xgs; /* 40 */
115 long orig_eax; /* 44 */
116 long eip; /* 48 */
117 int xcs; /* 52 */
118 long eflags; /* 56 */
119 long esp; /* 60 */
120 int xss; /* 64 */
121 };
123 #define SET_PT_REGS(pt, xc) \
124 { \
125 pt.ebx = xc.ebx; \
126 pt.ecx = xc.ecx; \
127 pt.edx = xc.edx; \
128 pt.esi = xc.esi; \
129 pt.edi = xc.edi; \
130 pt.ebp = xc.ebp; \
131 pt.eax = xc.eax; \
132 pt.eip = xc.eip; \
133 pt.xcs = xc.cs; \
134 pt.eflags = xc.eflags; \
135 pt.esp = xc.esp; \
136 pt.xss = xc.ss; \
137 pt.xes = xc.es; \
138 pt.xds = xc.ds; \
139 pt.xfs = xc.fs; \
140 pt.xgs = xc.gs; \
141 }
143 #define SET_XC_REGS(pt, xc) \
144 { \
145 xc.ebx = pt->ebx; \
146 xc.ecx = pt->ecx; \
147 xc.edx = pt->edx; \
148 xc.esi = pt->esi; \
149 xc.edi = pt->edi; \
150 xc.ebp = pt->ebp; \
151 xc.eax = pt->eax; \
152 xc.eip = pt->eip; \
153 xc.cs = pt->xcs; \
154 xc.eflags = pt->eflags; \
155 xc.esp = pt->esp; \
156 xc.ss = pt->xss; \
157 xc.es = pt->xes; \
158 xc.ds = pt->xds; \
159 xc.fs = pt->xfs; \
160 xc.gs = pt->xgs; \
161 }
162 #endif
164 #define printval(x) printf("%s = %lx\n", #x, (long)x);
165 #define vtopdi(va) ((va) >> PDRSHIFT)
166 #define vtopti(va) (((va) >> PAGE_SHIFT) & 0x3ff)
167 #endif
169 typedef void (*thr_ev_handler_t)(long);
171 void xc_register_event_handler(
172 thr_ev_handler_t h,
173 td_event_e e);
175 long xc_ptrace(
176 int xc_handle,
177 enum __ptrace_request request,
178 uint32_t domid,
179 long addr,
180 long data);
182 int xc_waitdomain(
183 int xc_handle,
184 int domain,
185 int *status,
186 int options);
188 #endif /* XC_PTRACE */