VirtualBox

Changeset 4207 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Aug 17, 2007 8:11:37 PM (17 years ago)
Author:
vboxsync
Message:

CPUMGetGuestMode

Location:
trunk/src/VBox/VMM/VMMAll
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp

    r4071 r4207  
    15051505    return cpl;
    15061506}
     1507
     1508
     1509/**
     1510 * Gets the current guest CPU mode.
     1511 *
     1512 * If paging mode is what you need, check out PGMGetGuestMode().
     1513 *
     1514 * @returns The CPU mode.
     1515 * @param   pVM         The VM handle.
     1516 */
     1517CPUMDECL(uint32_t) CPUMGetGuestMode(PVM pVM)
     1518{
     1519    CPUMMODE enmMode;
     1520    if (!(pVM->cpum.s.Guest.cr0 & X86_CR0_PE))
     1521        enmMode = CPUMMODE_REAL;
     1522    else //GUEST64 if (!(pVM->cpum.s.Guest.efer & MSR_K6_EFER_LMA)
     1523        enmMode = CPUMMODE_PROTECTED;
     1524//GUEST64     else
     1525//GUEST64         enmMode = CPUMMODE_LONG;
     1526
     1527    return enmMode;
     1528}
     1529
  • trunk/src/VBox/VMM/VMMAll/PGMAll.cpp

    r4071 r4207  
    13151315/**
    13161316 * Gets the current guest paging mode.
     1317 *
     1318 * If you just need the CPU mode (real/protected/long), use CPUMGetGuestMode().
    13171319 *
    13181320 * @returns The current paging mode.
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