Changeset 19227 in vbox
- Timestamp:
- Apr 28, 2009 8:50:31 AM (16 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/hwaccm.h
r18927 r19227 84 84 VMMDECL(bool) HWACCMIsNestedPagingActive(PVM pVM); 85 85 VMMDECL(PGMMODE) HWACCMGetShwPagingMode(PVM pVM); 86 VMMDECL(RTCPUID) HWACCMGetVMCPUId(PVM pVM);87 86 #else 88 87 /* Nop in GC */ … … 103 102 VMMR0DECL(int) HWACCMR0EnterSwitcher(PVM pVM, bool *pfVTxDisabled); 104 103 VMMR0DECL(int) HWACCMR0LeaveSwitcher(PVM pVM, bool fVTxDisabled); 104 105 VMMR0DECL(PVMCPU) HWACCMR0GetVMCPU(PVM pVM); 106 VMMR0DECL(VMCPUID) HWACCMR0GetVMCPUId(PVM pVM); 107 105 108 /** @} */ 106 109 #endif /* IN_RING0 */ -
trunk/src/VBox/VMM/VMMAll/HWACCMAll.cpp
r15167 r19227 148 148 } 149 149 150 #ifndef IN_RC151 /**152 * Returns the VMCPU id of the current EMT thread.153 *154 * @param pVM The VM to operate on.155 */156 VMMDECL(RTCPUID) HWACCMGetVMCPUId(PVM pVM)157 {158 /* @todo */159 Assert(pVM->cCPUs == 1);160 return 0;161 }162 #endif -
trunk/src/VBox/VMM/VMMAll/VMMAll.cpp
r18927 r19227 73 73 74 74 #else /* IN_RING0 */ 75 return HWACCM GetVMCPUId(pVM);75 return HWACCMR0GetVMCPUId(pVM); 76 76 #endif /* IN_RING0 */ 77 77 } … … 101 101 102 102 #else /* IN_RING0 */ 103 return &pVM->aCpus[HWACCMGetVMCPUId(pVM)];103 return HWACCMR0GetVMCPU(pVM); 104 104 #endif /* IN_RING0 */ 105 105 } -
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.