Changeset 41218 in vbox for trunk/include/VBox/vmm
- Timestamp:
- May 8, 2012 8:38:10 PM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 77857
- Location:
- trunk/include/VBox/vmm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/cpumctx.h
r40170 r41218 4 4 5 5 /* 6 * Copyright (C) 2006-201 0Oracle Corporation6 * Copyright (C) 2006-2012 Oracle Corporation 7 7 * 8 8 * This file is part of VirtualBox Open Source Edition (OSE), as … … 77 77 } CPUMSYSENTER; 78 78 79 /** 80 * For compilers (like DTrace) that does not grok nameless unions, we have a 81 * little hack to make them palatable. 82 */ 83 #ifdef VBOX_FOR_DTRACE_LIB 84 # define CPUM_UNION_NAME u 85 #elif defined(VBOX_WITHOUT_UNNAMED_UNIONS) 86 # define CPUM_UNION_NAME u 87 #else 88 # define CPUM_UNION_NAME 89 #endif 90 79 91 80 92 /** 81 93 * CPU context core. 82 94 */ 83 #ifndef VBOX_WITHOUT_UNNAMED_UNIONS 84 #pragma pack(1) 95 #ifndef VBOX_FOR_DTRACE_LIB 96 # pragma pack(1) 97 #endif 85 98 typedef struct CPUMCTXCORE 86 99 { … … 90 103 uint32_t edi; 91 104 uint64_t rdi; 92 } ;105 } CPUM_UNION_NAME; 93 106 union 94 107 { … … 96 109 uint32_t esi; 97 110 uint64_t rsi; 98 } ;111 } CPUM_UNION_NAME; 99 112 union 100 113 { … … 102 115 uint32_t ebp; 103 116 uint64_t rbp; 104 } ;117 } CPUM_UNION_NAME; 105 118 union 106 119 { … … 108 121 uint32_t eax; 109 122 uint64_t rax; 110 } ;123 } CPUM_UNION_NAME; 111 124 union 112 125 { … … 114 127 uint32_t ebx; 115 128 uint64_t rbx; 116 } ;129 } CPUM_UNION_NAME; 117 130 union 118 131 { … … 120 133 uint32_t edx; 121 134 uint64_t rdx; 122 } ;135 } CPUM_UNION_NAME; 123 136 union 124 137 { … … 126 139 uint32_t ecx; 127 140 uint64_t rcx; 128 } ;141 } CPUM_UNION_NAME; 129 142 union 130 143 { … … 132 145 uint32_t esp; 133 146 uint64_t rsp; 134 } ;147 } CPUM_UNION_NAME; 135 148 /* Note: lss esp, [] in the switcher needs some space, so we reserve it here instead of relying on the exact esp & ss layout as before. */ 136 149 uint32_t lss_esp; … … 153 166 X86EFLAGS eflags; 154 167 X86RFLAGS rflags; 155 } ;168 } CPUM_UNION_NAME; 156 169 union 157 170 { … … 159 172 uint32_t eip; 160 173 uint64_t rip; 161 } ;174 } CPUM_UNION_NAME; 162 175 163 176 uint64_t r8; … … 181 194 182 195 } CPUMCTXCORE; 183 #pragma pack() 184 # else /* VBOX_WITHOUT_UNNAMED_UNIONS */185 typedef struct CPUMCTXCORE CPUMCTXCORE; 186 # endif /* VBOX_WITHOUT_UNNAMED_UNIONS */196 197 # ifndef VBOX_FOR_DTRACE_LIB 198 # pragma pack() 199 # endif 187 200 188 201 … … 190 203 * CPU context. 191 204 */ 192 #ifndef VBOX_ WITHOUT_UNNAMED_UNIONS205 #ifndef VBOX_FOR_DTRACE_LIB 193 206 # pragma pack(1) 207 #endif 194 208 typedef struct CPUMCTX 195 209 { … … 207 221 uint32_t edi; 208 222 uint64_t rdi; 209 } ;223 } CPUM_UNION_NAME; 210 224 union 211 225 { … … 214 228 uint32_t esi; 215 229 uint64_t rsi; 216 } ;230 } CPUM_UNION_NAME; 217 231 union 218 232 { … … 220 234 uint32_t ebp; 221 235 uint64_t rbp; 222 } ;236 } CPUM_UNION_NAME; 223 237 union 224 238 { … … 227 241 uint32_t eax; 228 242 uint64_t rax; 229 } ;243 } CPUM_UNION_NAME; 230 244 union 231 245 { … … 234 248 uint32_t ebx; 235 249 uint64_t rbx; 236 } ;250 } CPUM_UNION_NAME; 237 251 union 238 252 { … … 241 255 uint32_t edx; 242 256 uint64_t rdx; 243 } ;257 } CPUM_UNION_NAME; 244 258 union 245 259 { … … 248 262 uint32_t ecx; 249 263 uint64_t rcx; 250 } ;264 } CPUM_UNION_NAME; 251 265 union 252 266 { … … 254 268 uint32_t esp; 255 269 uint64_t rsp; 256 } ;270 } CPUM_UNION_NAME; 257 271 /** @note lss esp, [] in the switcher needs some space, so we reserve it here 258 272 * instead of relying on the exact esp & ss layout as before (prevented … … 277 291 X86EFLAGS eflags; 278 292 X86RFLAGS rflags; 279 } ;293 } CPUM_UNION_NAME; 280 294 union 281 295 { … … 283 297 uint32_t eip; 284 298 uint64_t rip; 285 } ;299 } CPUM_UNION_NAME; 286 300 287 301 uint64_t r8; … … 364 378 # endif 365 379 } CPUMCTX; 366 # pragma pack() 367 #else /* VBOX_WITHOUT_UNNAMED_UNIONS */ 368 typedef struct CPUMCTX CPUMCTX; 369 #endif /* VBOX_WITHOUT_UNNAMED_UNIONS */ 380 # ifndef VBOX_FOR_DTRACE_LIB 381 # pragma pack() 382 # endif 383 384 #ifndef VBOX_FOR_DTRACE_LIB 370 385 371 386 /** 372 387 * Gets the CPUMCTXCORE part of a CPUMCTX. 373 388 */ 374 #define CPUMCTX2CORE(pCtx) ((PCPUMCTXCORE)(void *)&(pCtx)->edi) 389 # define CPUMCTX2CORE(pCtx) ((PCPUMCTXCORE)(void *)&(pCtx)->edi) 390 375 391 376 392 /** … … 393 409 * @remarks PATM uses this, which is why it has to be here. 394 410 */ 395 #ifndef VBOX_WITHOUT_UNNAMED_UNIONS396 411 # pragma pack(1) 397 412 typedef struct CPUMCTX_VER1_6 … … 408 423 uint32_t edi; 409 424 uint64_t rdi; 410 } ;425 } CPUM_UNION_NAME; 411 426 union 412 427 { 413 428 uint32_t esi; 414 429 uint64_t rsi; 415 } ;430 } CPUM_UNION_NAME; 416 431 union 417 432 { 418 433 uint32_t ebp; 419 434 uint64_t rbp; 420 } ;435 } CPUM_UNION_NAME; 421 436 union 422 437 { 423 438 uint32_t eax; 424 439 uint64_t rax; 425 } ;440 } CPUM_UNION_NAME; 426 441 union 427 442 { 428 443 uint32_t ebx; 429 444 uint64_t rbx; 430 } ;445 } CPUM_UNION_NAME; 431 446 union 432 447 { 433 448 uint32_t edx; 434 449 uint64_t rdx; 435 } ;450 } CPUM_UNION_NAME; 436 451 union 437 452 { 438 453 uint32_t ecx; 439 454 uint64_t rcx; 440 } ;455 } CPUM_UNION_NAME; 441 456 /** @note We rely on the exact layout, because we use lss esp, [] in the 442 457 * switcher. */ … … 462 477 X86EFLAGS eflags; 463 478 X86RFLAGS rflags; 464 } ;479 } CPUM_UNION_NAME; 465 480 union 466 481 { 467 482 uint32_t eip; 468 483 uint64_t rip; 469 } ;484 } CPUM_UNION_NAME; 470 485 471 486 uint64_t r8; … … 555 570 uint32_t padding[2]; 556 571 } CPUMCTX_VER1_6; 557 #pragma pack() 558 #else /* VBOX_WITHOUT_UNNAMED_UNIONS */ 559 typedef struct CPUMCTX_VER1_6 CPUMCTX_VER1_6; 560 #endif /* VBOX_WITHOUT_UNNAMED_UNIONS */ 572 # pragma pack() 573 574 #endif /* VBOX_FOR_DTRACE_LIB */ 561 575 562 576 /** -
trunk/include/VBox/vmm/vm.h
r41147 r41218 4 4 5 5 /* 6 * Copyright (C) 2006-201 1Oracle Corporation6 * Copyright (C) 2006-2012 Oracle Corporation 7 7 * 8 8 * This file is part of VirtualBox Open Source Edition (OSE), as … … 228 228 } VMCPU; 229 229 230 231 #ifndef VBOX_FOR_DTRACE_LIB 230 232 231 233 /** @name Operations on VMCPU::enmState … … 729 731 (rc)) 730 732 733 #endif /* !VBOX_FOR_DTRACE_LIB */ 734 735 731 736 732 737 /** This is the VM structure.
Note:
See TracChangeset
for help on using the changeset viewer.