1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21#ifndef _ASM_REGISTERS_H
22#define _ASM_REGISTERS_H
23
24#define SP r29
25
26#ifndef __ASSEMBLY__
27
28
29
30
31
32
33
34
35struct hvm_event_record {
36 unsigned long vmel;
37 unsigned long vmest;
38 unsigned long vmpsp;
39 unsigned long vmbadva;
40};
41
42struct pt_regs {
43 long restart_r0;
44 long syscall_nr;
45 union {
46 struct {
47 unsigned long usr;
48 unsigned long preds;
49 };
50 long long int predsusr;
51 };
52 union {
53 struct {
54 unsigned long m0;
55 unsigned long m1;
56 };
57 long long int m1m0;
58 };
59 union {
60 struct {
61 unsigned long sa1;
62 unsigned long lc1;
63 };
64 long long int lc1sa1;
65 };
66 union {
67 struct {
68 unsigned long sa0;
69 unsigned long lc0;
70 };
71 long long int lc0sa0;
72 };
73 union {
74 struct {
75 unsigned long gp;
76 unsigned long ugp;
77 };
78 long long int ugpgp;
79 };
80
81
82
83
84
85
86 union {
87 struct {
88 unsigned long r00;
89 unsigned long r01;
90 };
91 long long int r0100;
92 };
93 union {
94 struct {
95 unsigned long r02;
96 unsigned long r03;
97 };
98 long long int r0302;
99 };
100 union {
101 struct {
102 unsigned long r04;
103 unsigned long r05;
104 };
105 long long int r0504;
106 };
107 union {
108 struct {
109 unsigned long r06;
110 unsigned long r07;
111 };
112 long long int r0706;
113 };
114 union {
115 struct {
116 unsigned long r08;
117 unsigned long r09;
118 };
119 long long int r0908;
120 };
121 union {
122 struct {
123 unsigned long r10;
124 unsigned long r11;
125 };
126 long long int r1110;
127 };
128 union {
129 struct {
130 unsigned long r12;
131 unsigned long r13;
132 };
133 long long int r1312;
134 };
135 union {
136 struct {
137 unsigned long r14;
138 unsigned long r15;
139 };
140 long long int r1514;
141 };
142 union {
143 struct {
144 unsigned long r16;
145 unsigned long r17;
146 };
147 long long int r1716;
148 };
149 union {
150 struct {
151 unsigned long r18;
152 unsigned long r19;
153 };
154 long long int r1918;
155 };
156 union {
157 struct {
158 unsigned long r20;
159 unsigned long r21;
160 };
161 long long int r2120;
162 };
163 union {
164 struct {
165 unsigned long r22;
166 unsigned long r23;
167 };
168 long long int r2322;
169 };
170 union {
171 struct {
172 unsigned long r24;
173 unsigned long r25;
174 };
175 long long int r2524;
176 };
177 union {
178 struct {
179 unsigned long r26;
180 unsigned long r27;
181 };
182 long long int r2726;
183 };
184 union {
185 struct {
186 unsigned long r28;
187 unsigned long r29;
188 };
189 long long int r2928;
190 };
191 union {
192 struct {
193 unsigned long r30;
194 unsigned long r31;
195 };
196 long long int r3130;
197 };
198
199 struct hvm_event_record hvmer;
200};
201
202
203
204
205
206
207
208
209
210
211
212#define pt_elr(regs) ((regs)->hvmer.vmel)
213#define pt_set_elr(regs, val) ((regs)->hvmer.vmel = (val))
214#define pt_cause(regs) ((regs)->hvmer.vmest & (HVM_VMEST_CAUSE_MSK))
215#define user_mode(regs) \
216 (((regs)->hvmer.vmest & (HVM_VMEST_UM_MSK << HVM_VMEST_UM_SFT)) != 0)
217#define ints_enabled(regs) \
218 (((regs)->hvmer.vmest & (HVM_VMEST_IE_MSK << HVM_VMEST_IE_SFT)) != 0)
219#define pt_psp(regs) ((regs)->hvmer.vmpsp)
220#define pt_badva(regs) ((regs)->hvmer.vmbadva)
221
222#define pt_set_rte_sp(regs, sp) do {\
223 pt_psp(regs) = (sp);\
224 (regs)->SP = (unsigned long) &((regs)->hvmer);\
225 } while (0)
226
227#define pt_set_kmode(regs) \
228 (regs)->hvmer.vmest = (HVM_VMEST_IE_MSK << HVM_VMEST_IE_SFT)
229
230#define pt_set_usermode(regs) \
231 (regs)->hvmer.vmest = (HVM_VMEST_UM_MSK << HVM_VMEST_UM_SFT) \
232 | (HVM_VMEST_IE_MSK << HVM_VMEST_IE_SFT)
233
234#endif
235
236#endif
237