Changeset 19227 in vbox for trunk/src/VBox/VMM/VMMR0/HWACCMR0.cpp
- Timestamp:
- Apr 28, 2009 8:50:31 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR0/HWACCMR0.cpp
r19141 r19227 954 954 ASMAtomicWriteBool(&pCpu->fInUse, true); 955 955 956 AssertMsg(pVCpu->hwaccm.s.idEnteredCpu == NIL_RTCPUID, ("%d", (int)pVCpu->hwaccm.s.idEnteredCpu)); 957 pVCpu->hwaccm.s.idEnteredCpu = idCpu; 958 956 959 pCtx = CPUMQueryGuestCtxPtr(pVCpu); 957 960 … … 982 985 if (RT_SUCCESS(rc)) 983 986 { 984 AssertMsg(pVCpu->hwaccm.s.idEnteredCpu == NIL_RTCPUID, ("%d", (int)pVCpu->hwaccm.s.idEnteredCpu));985 pVCpu->hwaccm.s.idEnteredCpu = idCpu;986 987 987 #ifdef VBOX_WITH_2X_4GB_ADDR_SPACE 988 988 PGMDynMapMigrateAutoSet(pVCpu); 989 989 #endif 990 990 } 991 else 992 pVCpu->hwaccm.s.idEnteredCpu = NIL_RTCPUID; 991 993 return rc; 992 994 } … … 1170 1172 { 1171 1173 return &HWACCMR0Globals.aCpuInfo[idCpu]; 1174 } 1175 1176 /** 1177 * Returns the VMCPU of the current EMT thread. 1178 * 1179 * @param pVM The VM to operate on. 1180 */ 1181 VMMR0DECL(PVMCPU) HWACCMR0GetVMCPU(PVM pVM) 1182 { 1183 /* RTMpCpuId had better be cheap. */ 1184 RTCPUID idHostCpu = RTMpCpuId(); 1185 1186 /** @todo optimize for large number of VCPUs when that becomes more common. */ 1187 for (unsigned idCpu=0;idCpu<pVM->cCPUs;idCpu++) 1188 { 1189 PVMCPU pVCpu = &pVM->aCpus[idCpu]; 1190 1191 if (pVCpu->hwaccm.s.idEnteredCpu == idHostCpu) 1192 return pVCpu; 1193 } 1194 AssertReleaseFailed(); 1195 return 0; 1196 } 1197 1198 /** 1199 * Returns the VMCPU id of the current EMT thread. 1200 * 1201 * @param pVM The VM to operate on. 1202 */ 1203 VMMR0DECL(VMCPUID) HWACCMR0GetVMCPUId(PVM pVM) 1204 { 1205 PVMCPU pVCpu = HWACCMR0GetVMCPU(pVM); 1206 if (pVCpu) 1207 return pVCpu->idCpu; 1208 1209 AssertReleaseFailed(); 1210 return 0; 1172 1211 } 1173 1212
Note:
See TracChangeset
for help on using the changeset viewer.