File tree 1 file changed +31
-0
lines changed
1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -159,6 +159,36 @@ lcr3(uintp val)
159
159
//PAGEBREAK: 36
160
160
// Layout of the trap frame built on the stack by the
161
161
// hardware and by trapasm.S, and passed to trap().
162
+ #if X64
163
+ // lie about some register names in 64bit mode to avoid
164
+ // clunky ifdefs in proc.c and trap.c.
165
+ struct trapframe {
166
+ uint64 eax ; // rax
167
+ uint64 rbx ;
168
+ uint64 rcx ;
169
+ uint64 rdx ;
170
+ uint64 rbp ;
171
+ uint64 rsi ;
172
+ uint64 rdi ;
173
+ uint64 r8 ;
174
+ uint64 r9 ;
175
+ uint64 r10 ;
176
+ uint64 r11 ;
177
+ uint64 r12 ;
178
+ uint64 r13 ;
179
+ uint64 r14 ;
180
+ uint64 r15 ;
181
+
182
+ uint64 trapno ;
183
+ uint64 err ;
184
+
185
+ uint64 eip ; // rip
186
+ uint64 cs ;
187
+ uint64 eflags ; // rflags
188
+ uint64 esp ; // rsp
189
+ uint64 ds ; // ss
190
+ };
191
+ #else
162
192
struct trapframe {
163
193
// registers as pushed by pusha
164
194
uint edi ;
@@ -193,3 +223,4 @@ struct trapframe {
193
223
ushort ss ;
194
224
ushort padding6 ;
195
225
};
226
+ #endif
You can’t perform that action at this time.
0 commit comments