Changeset 9649 in vbox
- Timestamp:
- Jun 12, 2008 9:48:30 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/cpum.h
r9647 r9649 518 518 519 519 /** 520 * Tests if the guest is running in long mode or not. 521 * 522 * @returns true if in long mode, otherwise false. 523 * @param pVM The VM handle. 524 */ 525 DECLINLINE(bool) CPUMIsGuestInLongMode(PVM pVM) 526 { 527 return (CPUMGetGuestEFER(pVM) & MSR_K6_EFER_LMA) == MSR_K6_EFER_LMA; 528 } 529 530 /** 520 531 * Tests if the guest is running in paged protected or not. 521 532 * -
trunk/src/VBox/VMM/CPUM.cpp
r9545 r9649 790 790 { 791 791 case CPUMDUMPTYPE_TERSE: 792 if (CPUM GetGuestMode(pVM) == CPUMMODE_LONG)792 if (CPUMIsGuestInLongMode(pVM)) 793 793 { 794 794 pHlp->pfnPrintf(pHlp, … … 818 818 819 819 case CPUMDUMPTYPE_DEFAULT: 820 if (CPUM GetGuestMode(pVM) == CPUMMODE_LONG)820 if (CPUMIsGuestInLongMode(pVM)) 821 821 { 822 822 pHlp->pfnPrintf(pHlp, … … 854 854 855 855 case CPUMDUMPTYPE_VERBOSE: 856 if (CPUM GetGuestMode(pVM) == CPUMMODE_LONG)856 if (CPUMIsGuestInLongMode(pVM)) 857 857 { 858 858 pHlp->pfnPrintf(pHlp, -
trunk/src/VBox/VMM/PGM.cpp
r9606 r9649 2383 2383 /** @todo fix this! Convert the PGMR3DumpHierarchyHC functions to do guest stuff. */ 2384 2384 /* Big pages supported? */ 2385 bool fPSE; 2386 2387 if (CPUMGetGuestMode(pVM) == CPUMMODE_LONG) 2388 fPSE = true; 2389 else 2390 fPSE = !!(CPUMGetGuestCR4(pVM) & X86_CR4_PSE); 2385 const bool fPSE = CPUMIsGuestInLongMode(pVM) || !!(CPUMGetGuestCR4(pVM) & X86_CR4_PSE); 2391 2386 2392 2387 /* Global pages supported? */ … … 3262 3257 return VERR_INVALID_PARAMETER; 3263 3258 } 3264 bool fBigPagesSupported; 3265 3266 if (CPUMGetGuestMode(pVM) == CPUMMODE_LONG) 3267 fBigPagesSupported = true; 3268 else 3269 fBigPagesSupported = !!(cr4 & X86_CR4_PSE); 3259 const bool fBigPagesSupported = CPUMIsGuestInLongMode(pVM) || !!(cr4 & X86_CR4_PSE); 3270 3260 3271 3261 int rc = VINF_SUCCESS; -
trunk/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp
r9647 r9649 397 397 398 398 /* Mask away invalid parts of the cpu context. */ 399 if ( CPUMGetGuestMode(pVM) != CPUMMODE_LONG)399 if (!CPUMIsGuestInLongMode(pVM)) 400 400 { 401 401 uint64_t u64Mask = UINT64_C(0xffffffff); -
trunk/src/VBox/VMM/VMMAll/EMAll.cpp
r9647 r9649 1865 1865 EMDECL(int) EMInterpretDRxWrite(PVM pVM, PCPUMCTXCORE pRegFrame, uint32_t DestRegDrx, uint32_t SrcRegGen) 1866 1866 { 1867 uint32_t val32; 1868 1869 int rc = DISFetchReg32(pRegFrame, SrcRegGen, &val32); 1867 uint64_t val; 1868 int rc; 1869 1870 if (CPUMIsGuestInLongMode(pVM)) 1871 { 1872 rc = DISFetchReg64(pRegFrame, SrcRegGen, &val); 1873 } 1874 else 1875 { 1876 uint32_t val32; 1877 rc = DISFetchReg32(pRegFrame, SrcRegGen, &val32); 1878 val = val32; 1879 } 1880 1870 1881 if (VBOX_SUCCESS(rc)) 1871 1882 { 1872 rc = CPUMSetGuestDRx(pVM, DestRegDrx, val 32);1883 rc = CPUMSetGuestDRx(pVM, DestRegDrx, val); 1873 1884 if (VBOX_SUCCESS(rc)) 1874 1885 return rc; -
trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp
r9606 r9649 988 988 * PAE or 32-bit? 989 989 */ 990 Assert( CPUMGetGuestMode(pVM) != CPUMMODE_LONG);990 Assert(!CPUMIsGuestInLongMode(pVM)); 991 991 992 992 int rc;
Note:
See TracChangeset
for help on using the changeset viewer.