VirtualBox

Changeset 36639 in vbox


Ignore:
Timestamp:
Apr 11, 2011 10:10:38 AM (13 years ago)
Author:
vboxsync
Message:

CPUMIsGuestInRealOrV86Mode and CPUMIsGuestInRealOrV86ModeEx.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/cpum.h

    r35994 r36639  
    181181VMMDECL(bool)       CPUMIsGuestR0WriteProtEnabled(PVMCPU pVCpu);
    182182VMMDECL(bool)       CPUMIsGuestInRealMode(PVMCPU pVCpu);
     183VMMDECL(bool)       CPUMIsGuestInRealOrV86Mode(PVMCPU pVCpu);
    183184VMMDECL(bool)       CPUMIsGuestInProtectedMode(PVMCPU pVCpu);
    184185VMMDECL(bool)       CPUMIsGuestInPagedProtectedMode(PVMCPU pVCpu);
     
    197198{
    198199    return !(pCtx->cr0 & X86_CR0_PE);
     200}
     201
     202/**
     203 * Tests if the guest is running in real or virtual 8086 mode.
     204 *
     205 * @returns @c true if it is, @c false if not.
     206 * @param   pCtx    Current CPU context
     207 */
     208VMMDECL(bool) CPUMIsGuestInRealOrV86ModeEx(PCPUMCTX pCtx)
     209{
     210    return !(pCtx->cr0 & X86_CR0_PE)
     211        || pCtx->eflags.Bits.u1VM; /** @todo verify that this cannot be set in long mode. */
    199212}
    200213
  • trunk/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp

    r36315 r36639  
    870870
    871871            if ((pVCpu->CTX_SUFF(pVM)->cpum.s.aGuestCpuIdStd[1].ecx & X86_CPUID_FEATURE_ECX_MONITOR) != 0)
    872                
     872
    873873                *puValue |= MSR_IA32_MISC_ENABLE_MONITOR /* if mwait/monitor available */;
    874874            /** @todo: add more cpuid-controlled features this way. */
     
    20592059
    20602060/**
     2061 * Tests if the guest is running in real or virtual 8086 mode.
     2062 *
     2063 * @returns @c true if it is, @c false if not.
     2064 * @param   pVCpu       The virtual CPU handle.
     2065 */
     2066VMMDECL(bool) CPUMIsGuestInRealOrV86Mode(PVMCPU pVCpu)
     2067{
     2068    return !(pVCpu->cpum.s.Guest.cr0 & X86_CR0_PE)
     2069        || pVCpu->cpum.s.Guest.eflags.Bits.u1VM; /** @todo verify that this cannot be set in long mode. */
     2070}
     2071
     2072
     2073/**
    20612074 * Tests if the guest is running in protected or not.
    20622075 *
  • trunk/src/VBox/VMM/VMMAll/PGMAllPhys.cpp

    r36009 r36639  
    544544        {
    545545            /* Lazy approach: check all pages in the 2 MB range.
    546              * The whole range must be ram and unallocated. */ 
     546             * The whole range must be ram and unallocated. */
    547547            GCPhys = GCPhysBase;
    548548            unsigned iPage;
Note: See TracChangeset for help on using the changeset viewer.

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