Changeset 2260 in vbox
- Timestamp:
- Apr 20, 2007 9:18:48 AM (18 years ago)
- svn:sync-xref-src-repo-rev:
- 20619
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/SELMAll.cpp
r2189 r2260 91 91 SELMDECL(RTGCPTR) SELMToFlat(PVM pVM, X86EFLAGS eflags, RTSEL Sel, CPUMSELREGHID *pHiddenSel, RTGCPTR Addr) 92 92 { 93 Assert(pHiddenSel); 94 95 /* 96 * Deal with real & v86 mode first. 97 */ 98 if ( CPUMIsGuestInRealMode(pVM) 99 || eflags.Bits.u1VM) 100 { 101 RTGCUINTPTR uFlat = (RTGCUINTPTR)Addr & 0xffff; 102 103 if (CPUMAreHiddenSelRegsValid(pVM)) 104 uFlat += pHiddenSel->u32Base; 105 else 106 uFlat += ((RTGCUINTPTR)Sel << 4); 107 return (RTGCPTR)uFlat; 108 } 109 110 /** @todo when we're in 16 bits mode, we should cut off the address as well.. */ 93 111 if (!CPUMAreHiddenSelRegsValid(pVM)) 94 {95 /*96 * Deal with real & v86 mode first.97 */98 if ( CPUMIsGuestInRealMode(pVM)99 || eflags.Bits.u1VM)100 {101 RTGCUINTPTR uFlat = ((RTGCUINTPTR)Addr & 0xffff) + ((RTGCUINTPTR)Sel << 4);102 return (RTGCPTR)uFlat;103 }104 105 112 return selmToFlat(pVM, Sel, Addr); 106 }107 return (RTGCPTR)(pHiddenSel->u32Base + (RTGCUINTPTR)Addr);113 else 114 return (RTGCPTR)(pHiddenSel->u32Base + (RTGCUINTPTR)Addr); 108 115 } 109 116 … … 134 141 || eflags.Bits.u1VM) 135 142 { 143 RTGCUINTPTR uFlat = (RTGCUINTPTR)Addr & 0xffff; 136 144 if (ppvGC) 137 145 { 138 146 if ( pHiddenSel 139 147 && CPUMAreHiddenSelRegsValid(pVM)) 140 { 141 *ppvGC = (RTGCPTR)(pHiddenSel->u32Base + (RTGCUINTPTR)Addr); 142 } 148 *ppvGC = (RTGCPTR)(pHiddenSel->u32Base + uFlat); 143 149 else 144 { 145 RTGCUINTPTR uFlat = ((RTGCUINTPTR)Addr & 0xffff) + ((RTGCUINTPTR)Sel << 4); 146 *ppvGC = (RTGCPTR)uFlat; 147 } 150 *ppvGC = (RTGCPTR)(((RTGCUINTPTR)Sel << 4) + uFlat); 148 151 } 149 152 if (pcb) 150 *pcb = 0x10000 - ((RTGCUINTPTR)Addr & 0xffff);153 *pcb = 0x10000 - uFlat; 151 154 return VINF_SUCCESS; 152 155 } … … 157 160 uint32_t u1Present, u1DescType, u1Granularity, u4Type; 158 161 162 /** @todo when we're in 16 bits mode, we should cut off the address as well.. */ 159 163 if ( pHiddenSel 160 164 && CPUMAreHiddenSelRegsValid(pVM)) … … 420 424 if (ppvFlat) 421 425 { 422 RTGCUINTPTR uFlat ;426 RTGCUINTPTR uFlat = (RTGCUINTPTR)Addr & 0xffff; 423 427 424 428 if (!CPUMAreHiddenSelRegsValid(pVM)) 425 uFlat = ((RTGCUINTPTR)Addr & 0xffff) +((RTGCUINTPTR)SelCS << 4);429 uFlat += ((RTGCUINTPTR)SelCS << 4); 426 430 else 427 uFlat = pHiddenCSSel->u32Base + (RTGCUINTPTR)Addr;431 uFlat += pHiddenCSSel->u32Base; 428 432 429 433 *ppvFlat = (RTGCPTR)uFlat; … … 431 435 return VINF_SUCCESS; 432 436 } 437 438 /** @todo when we're in 16 bits mode, we should cut off the address as well.. */ 433 439 434 440 if (!CPUMAreHiddenSelRegsValid(pVM))
Note:
See TracChangeset
for help on using the changeset viewer.