VirtualBox

source: vbox/trunk/include/VBox/cpum.mac@ 13953

Last change on this file since 13953 was 13953, checked in by vboxsync, 16 years ago

Update

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 6.8 KB
Line 
1;; @file
2;
3; CPUM - CPU Monitor.
4;
5
6;
7; Copyright (C) 2006-2007 Sun Microsystems, Inc.
8;
9; This file is part of VirtualBox Open Source Edition (OSE), as
10; available from http://www.virtualbox.org. This file is free software;
11; you can redistribute it and/or modify it under the terms of the GNU
12; General Public License (GPL) as published by the Free Software
13; Foundation, in version 2 as it comes in the "COPYING" file of the
14; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16;
17; The contents of this file may alternatively be used under the terms
18; of the Common Development and Distribution License Version 1.0
19; (CDDL) only, as it comes in the "COPYING.CDDL" file of the
20; VirtualBox OSE distribution, in which case the provisions of the
21; CDDL are applicable instead of those of the GPL.
22;
23; You may elect to license modified versions of this file under the
24; terms and conditions of either the GPL or the CDDL or both.
25;
26; Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
27; Clara, CA 95054 USA or visit http://www.sun.com if you need
28; additional information or have any questions.
29;
30
31%ifndef __VBox_cpum_mac__
32%define __VBox_cpum_mac__
33
34
35;;
36; Converts the CPUM pointer to CPUMCPU (for the first VMCPU)
37; @param %1 register name
38%macro CPUMCPU_FROM_CPUM 1
39 add %1, [%1 + CPUM.ulOffCPUMCPU]
40%endmacro
41
42;;
43; Converts the CPUMCPU pointer to CPUM (for the first VMCPU)
44; @param %1 register name
45%macro CPUM_FROM_CPUMCPU 1
46 sub %1, [%1 + CPUMCPU.ulOffCPUM]
47%endmacro
48
49;;
50; Registers frame.
51; This is used internally in TRPM, VMMSwitcher_GuestToHost_GuestCtx
52; and other places.
53struc CPUMCTXCORE
54 .edi resq 1
55 .esi resq 1
56 .ebp resq 1
57 .eax resq 1
58 .ebx resq 1
59 .edx resq 1
60 .ecx resq 1
61 .esp resq 1
62 .lss_esp resd 1
63 .ss resw 1
64 .ssPadding resw 1
65 .gs resw 1
66 .gsPadding resw 1
67 .fs resw 1
68 .fsPadding resw 1
69 .es resw 1
70 .esPadding resw 1
71 .ds resw 1
72 .dsPadding resw 1
73 .cs resw 1
74 .csPadding resw 3
75 .eflags resq 1
76 .eip resq 1
77
78 .r8 resq 1
79 .r9 resq 1
80 .r10 resq 1
81 .r11 resq 1
82 .r12 resq 1
83 .r13 resq 1
84 .r14 resq 1
85 .r15 resq 1
86
87 .esHid.u64Base resq 1
88 .esHid.u32Limit resd 1
89 .esHid.Attr resd 1
90
91 .csHid.u64Base resq 1
92 .csHid.u32Limit resd 1
93 .csHid.Attr resd 1
94
95 .ssHid.u64Base resq 1
96 .ssHid.u32Limit resd 1
97 .ssHid.Attr resd 1
98
99 .dsHid.u64Base resq 1
100 .dsHid.u32Limit resd 1
101 .dsHid.Attr resd 1
102
103 .fsHid.u64Base resq 1
104 .fsHid.u32Limit resd 1
105 .fsHid.Attr resd 1
106
107 .gsHid.u64Base resq 1
108 .gsHid.u32Limit resd 1
109 .gsHid.Attr resd 1
110
111endstruc
112
113
114struc CPUMCTX
115 .fpu resb 512
116
117 .edi resq 1
118 .esi resq 1
119 .ebp resq 1
120 .eax resq 1
121 .ebx resq 1
122 .edx resq 1
123 .ecx resq 1
124 .esp resq 1
125 .lss_esp resd 1
126 .ss resw 1
127 .ssPadding resw 1
128 .gs resw 1
129 .gsPadding resw 1
130 .fs resw 1
131 .fsPadding resw 1
132 .es resw 1
133 .esPadding resw 1
134 .ds resw 1
135 .dsPadding resw 1
136 .cs resw 1
137 .csPadding resw 3
138 .eflags resq 1
139 .eip resq 1
140
141 .r8 resq 1
142 .r9 resq 1
143 .r10 resq 1
144 .r11 resq 1
145 .r12 resq 1
146 .r13 resq 1
147 .r14 resq 1
148 .r15 resq 1
149
150 .esHid.u64Base resq 1
151 .esHid.u32Limit resd 1
152 .esHid.Attr resd 1
153
154 .csHid.u64Base resq 1
155 .csHid.u32Limit resd 1
156 .csHid.Attr resd 1
157
158 .ssHid.u64Base resq 1
159 .ssHid.u32Limit resd 1
160 .ssHid.Attr resd 1
161
162 .dsHid.u64Base resq 1
163 .dsHid.u32Limit resd 1
164 .dsHid.Attr resd 1
165
166 .fsHid.u64Base resq 1
167 .fsHid.u32Limit resd 1
168 .fsHid.Attr resd 1
169
170 .gsHid.u64Base resq 1
171 .gsHid.u32Limit resd 1
172 .gsHid.Attr resd 1
173
174
175 .cr0 resq 1
176 .cr2 resq 1
177 .cr3 resq 1
178 .cr4 resq 1
179
180 .dr resq 8
181
182 .gdtr resb 10 ; GDT limit + linear address
183 .gdtrPadding resw 1
184 .idtr resb 10 ; IDT limit + linear address
185 .idtrPadding resw 1
186 .ldtr resw 1
187 .ldtrPadding resw 1
188 .tr resw 1
189 .trPadding resw 1
190
191 .SysEnter.cs resb 8
192 .SysEnter.eip resb 8
193 .SysEnter.esp resb 8
194
195 .msrEFER resb 8
196 .msrSTAR resb 8
197 .msrPAT resb 8
198 .msrLSTAR resb 8
199 .msrCSTAR resb 8
200 .msrSFMASK resb 8
201 .msrKERNELGSBASE resb 8
202
203 .ldtrHid.u64Base resq 1
204 .ldtrHid.u32Limit resd 1
205 .ldtrHid.Attr resd 1
206
207 .trHid.u64Base resq 1
208 .trHid.u32Limit resd 1
209 .trHid.Attr resd 1
210
211 ; padding
212;;; .padding resd 6
213endstruc
214
215;;
216; FPU/XMM state
217;;
218struc X86FXSTATE
219 ;/** Control word. */
220 .FCW resw 1
221 ;/** Status word. */
222 .FSW resw 1
223 ;/** Tag word (it's a byte actually). */
224 .FTW resb 1
225 .huh1 resb 1
226 ;/** Opcode. */
227 .FOP resw 1
228 ;/** Instruction pointer. */
229 .FPUIP resd 1
230 ;/** Code selector. */
231 .CS resw 1
232 .Rsvrd1 resw 1
233 ;/* - offset 16 - */
234 ;/** Data pointer. */
235 .FPUDP resd 1
236 ;/** Data segment */
237 .DS resw 1
238 .Rsrvd2 resw 1
239 .MXCSR resd 1
240 .MXCSR_MASK resd 1
241 ;/* - offset 32 - */
242 ; FPU & MMX registers
243 .aRegs resq 8*2
244 ;/* - offset 160 - */
245 ;/* 8 XMM registers in 32 bits mode; 16 in long mode */
246 .aXMM resq 16*2
247 ;/* - offset 416 - */
248 .au32RsrvdRest resd (512 - 416) / 4
249endstruc
250
251%endif
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette