Changeset 31489 in vbox for trunk/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp
- Timestamp:
- Aug 9, 2010 4:12:00 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/CPUMAllRegs.cpp
r31079 r31489 1155 1155 1156 1156 1157 VMMDECL(uint64_t) CPUMGetGuestCR8(PVMCPU pVCpu) 1158 { 1159 uint64_t u64; 1160 int rc = CPUMGetGuestCRx(pVCpu, USE_REG_CR8, &u64); 1161 if (RT_FAILURE(rc)) 1162 u64 = 0; 1163 return u64; 1164 } 1165 1166 1157 1167 VMMDECL(void) CPUMGetGuestGDTR(PVMCPU pVCpu, PVBOXGDTR pGDTR) 1158 1168 { … … 1227 1237 1228 1238 1229 ///@todo: crx should be an array1230 1239 VMMDECL(int) CPUMGetGuestCRx(PVMCPU pVCpu, unsigned iReg, uint64_t *pValue) 1231 1240 { … … 1235 1244 *pValue = pVCpu->cpum.s.Guest.cr0; 1236 1245 break; 1246 1237 1247 case USE_REG_CR2: 1238 1248 *pValue = pVCpu->cpum.s.Guest.cr2; 1239 1249 break; 1250 1240 1251 case USE_REG_CR3: 1241 1252 *pValue = pVCpu->cpum.s.Guest.cr3; 1242 1253 break; 1254 1243 1255 case USE_REG_CR4: 1244 1256 *pValue = pVCpu->cpum.s.Guest.cr4; 1245 1257 break; 1258 1259 case USE_REG_CR8: 1260 { 1261 uint8_t u8Tpr; 1262 int rc = PDMApicGetTPR(pVCpu, &u8Tpr, NULL /*pfPending*/); 1263 if (RT_FAILURE(rc)) 1264 { 1265 AssertMsg(rc == VERR_PDM_NO_APIC_INSTANCE, ("%Rrc\n", rc)); 1266 *pValue = 0; 1267 return rc; 1268 } 1269 *pValue = u8Tpr >> 4; /* bits 7-4 contain the task priority that go in cr8, bits 3-0*/ 1270 break; 1271 } 1272 1246 1273 default: 1247 1274 return VERR_INVALID_PARAMETER;
Note:
See TracChangeset
for help on using the changeset viewer.