Changeset 4207
- Timestamp:
- 08/17/07 22:11:37 (1 year ago)
- Files:
-
- trunk/include/VBox/cpum.h (modified) (2 diffs)
- trunk/include/VBox/pgm.h (modified) (1 diff)
- trunk/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp (modified) (1 diff)
- trunk/src/VBox/VMM/VMMAll/PGMAll.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/include/VBox/cpum.h
r4071 r4207 684 684 CPUMDECL(uint32_t) CPUMGetGuestCPL(PVM pVM, PCPUMCTXCORE pCtxCore); 685 685 686 /** 687 * CPU modes. 688 */ 689 typedef enum CPUMMODE 690 { 691 /** The usual invalid zero entry. */ 692 CPUMMODE_INVALID = 0, 693 /** Real mode. */ 694 CPUMMODE_REAL, 695 /** Protected mode (32-bit). */ 696 CPUMMODE_PROTECTED, 697 /** Long mode (64-bit). */ 698 CPUMMODE_LONG 699 } CPUMMODE; 700 701 /** 702 * Gets the current guest CPU mode. 703 * 704 * If paging mode is what you need, check out PGMGetGuestMode(). 705 * 706 * @returns The CPU mode. 707 * @param pVM The VM handle. 708 */ 709 CPUMDECL(uint32_t) CPUMGetGuestMode(PVM pVM); 710 686 711 687 712 #ifdef IN_RING3 … … 749 774 /** 750 775 * API for controlling a few of the CPU features found in CR4. 751 * 776 * 752 777 * Currently only X86_CR4_TSD is accepted as input. 753 * 778 * 754 779 * @returns VBox status code. 755 * 780 * 756 781 * @param pVM The VM handle. 757 782 * @param fOr The CR4 OR mask. trunk/include/VBox/pgm.h
r4071 r4207 576 576 * Gets the current guest paging mode. 577 577 * 578 * If you just need the CPU mode (real/protected/long), use CPUMGetGuestMode(). 579 * 578 580 * @returns The current paging mode. 579 581 * @param pVM The VM handle. trunk/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp
r4071 r4207 1505 1505 return cpl; 1506 1506 } 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 */ 1517 CPUMDECL(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 1315 1315 /** 1316 1316 * Gets the current guest paging mode. 1317 * 1318 * If you just need the CPU mode (real/protected/long), use CPUMGetGuestMode(). 1317 1319 * 1318 1320 * @returns The current paging mode.

