- Timestamp:
- Apr 18, 2007 2:08:30 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/SELMAll.cpp
r2119 r2179 134 134 || eflags.Bits.u1VM) 135 135 { 136 if (ppvGC) 137 { 138 if ( pHiddenSel 139 && CPUMAreHiddenSelRegsValid(pVM)) 140 { 141 *ppvGC = (RTGCPTR)pHiddenSel->u32Base; 142 } 143 else 144 { 145 RTGCUINTPTR uFlat = ((RTGCUINTPTR)Addr & 0xffff) + ((RTGCUINTPTR)Sel << 4); 146 *ppvGC = (RTGCPTR)uFlat; 147 } 148 } 136 149 if (pcb) 137 150 *pcb = 0x10000 - ((RTGCUINTPTR)Addr & 0xffff); 138 if (ppvGC)139 {140 RTGCUINTPTR uFlat = ((RTGCUINTPTR)Addr & 0xffff) + ((RTGCUINTPTR)Sel << 4);141 *ppvGC = (RTGCPTR)uFlat;142 }143 151 return VINF_SUCCESS; 144 152 } … … 401 409 SELMDECL(int) SELMValidateAndConvertCSAddr(PVM pVM, X86EFLAGS eflags, RTSEL SelCPL, RTSEL SelCS, CPUMSELREGHID *pHiddenCSSel, RTGCPTR Addr, PRTGCPTR ppvFlat) 402 410 { 403 /*404 * Deal with real & v86 mode first.405 */406 if ( CPUMIsGuestInRealMode(pVM)407 || eflags.Bits.u1VM)408 {409 if (ppvFlat)410 {411 RTGCUINTPTR uFlat = ((RTGCUINTPTR)Addr & 0xffff) + ((RTGCUINTPTR)SelCS << 4);412 *ppvFlat = (RTGCPTR)uFlat;413 }414 return VINF_SUCCESS;415 }416 417 411 if (!CPUMAreHiddenSelRegsValid(pVM)) 412 { 413 /* 414 * Deal with real & v86 mode first. 415 */ 416 if ( CPUMIsGuestInRealMode(pVM) 417 || eflags.Bits.u1VM) 418 { 419 if (ppvFlat) 420 { 421 RTGCUINTPTR uFlat = ((RTGCUINTPTR)Addr & 0xffff) + ((RTGCUINTPTR)SelCS << 4); 422 *ppvFlat = (RTGCPTR)uFlat; 423 } 424 return VINF_SUCCESS; 425 } 418 426 return selmValidateAndConvertCSAddr(pVM, SelCPL, SelCS, Addr, ppvFlat); 427 } 419 428 420 429 /* … … 500 509 SELMDECL(bool) SELMIsSelector32Bit(PVM pVM, X86EFLAGS eflags, RTSEL Sel, CPUMSELREGHID *pHiddenSel) 501 510 { 502 /*503 * Deal with real & v86 mode first.504 */505 if ( CPUMIsGuestInRealMode(pVM)506 || eflags.Bits.u1VM)507 return false;508 509 511 if (!CPUMAreHiddenSelRegsValid(pVM)) 512 { 513 /* 514 * Deal with real & v86 mode first. 515 */ 516 if ( CPUMIsGuestInRealMode(pVM) 517 || eflags.Bits.u1VM) 518 return false; 519 510 520 return selmIsSelector32Bit(pVM, Sel); 511 521 } 512 522 return pHiddenSel->Attr.n.u1DefBig; 513 523 }
Note:
See TracChangeset
for help on using the changeset viewer.